Skip to content

Commit

Permalink
+ Special view provider to display splines
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Oct 22, 2013
1 parent f061b6f commit 25b6645
Show file tree
Hide file tree
Showing 10 changed files with 460 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/Mod/Part/App/AppPart.cpp
Expand Up @@ -38,6 +38,7 @@
#include "FeaturePartCurveNet.h"
#include "FeaturePartCircle.h"
#include "FeaturePartPolygon.h"
#include "FeaturePartSpline.h"
#include "FeatureGeometrySet.h"
#include "FeatureChamfer.h"
#include "FeatureCompound.h"
Expand Down Expand Up @@ -164,6 +165,7 @@ void PartExport initPart()
Part::CustomFeaturePython ::init();
Part::Primitive ::init();
Part::Box ::init();
Part::Spline ::init();
Part::Boolean ::init();
Part::Common ::init();
Part::MultiCommon ::init();
Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Part/App/CMakeLists.txt
Expand Up @@ -101,6 +101,8 @@ SET(Features_SRCS
FeaturePartPolygon.h
FeaturePartSection.cpp
FeaturePartSection.h
FeaturePartSpline.cpp
FeaturePartSpline.h
FeatureChamfer.cpp
FeatureChamfer.h
FeatureCompound.cpp
Expand Down
42 changes: 42 additions & 0 deletions src/Mod/Part/App/FeaturePartSpline.cpp
@@ -0,0 +1,42 @@
/***************************************************************************
* Copyright (c) 2013 Werner Mayer <wmayer[at]users.sourceforge.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/


#include "PreCompiled.h"
#ifndef _PreComp_
#endif


#include "FeaturePartSpline.h"


using namespace Part;


PROPERTY_SOURCE(Part::Spline, Part::Feature)


Spline::Spline()
{
}


49 changes: 49 additions & 0 deletions src/Mod/Part/App/FeaturePartSpline.h
@@ -0,0 +1,49 @@
/***************************************************************************
* Copyright (c) 2013 Werner Mayer <wmayer[at]users.sourceforge.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/



#ifndef PART_FEATUREPARTSPLINE_H
#define PART_FEATUREPARTSPLINE_H

#include "PartFeature.h"

namespace Part
{

class PartExport Spline :public Part::Feature
{
PROPERTY_HEADER(Part::Spline);

public:
Spline();
/// returns the type name of the ViewProvider
const char* getViewProviderName(void) const {
return "PartGui::ViewProviderSpline";
}
};

} //namespace Part


#endif // PART_FEATUREPARTSPLINE_H

2 changes: 2 additions & 0 deletions src/Mod/Part/Gui/AppPartGui.cpp
Expand Up @@ -50,6 +50,7 @@
#include "ViewProviderTorusParametric.h"
#include "ViewProviderRuledSurface.h"
#include "ViewProviderPrism.h"
#include "ViewProviderSpline.h"

#include "DlgSettingsGeneral.h"
#include "DlgSettingsObjectColor.h"
Expand Down Expand Up @@ -139,6 +140,7 @@ void PartGuiExport initPartGui()
PartGui::ViewProviderConeParametric ::init();
PartGui::ViewProviderTorusParametric ::init();
PartGui::ViewProviderRuledSurface ::init();
PartGui::ViewProviderSpline ::init();

PartGui::Workbench ::init();

Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Part/Gui/CMakeLists.txt
Expand Up @@ -169,6 +169,8 @@ SET(PartGui_SRCS
ViewProviderTorusParametric.h
ViewProviderCurveNet.cpp
ViewProviderCurveNet.h
ViewProviderSpline.cpp
ViewProviderSpline.h
ViewProviderImport.cpp
ViewProviderImport.h
ViewProviderExtrusion.cpp
Expand Down
1 change: 0 additions & 1 deletion src/Mod/Part/Gui/ViewProviderExt.cpp
Expand Up @@ -149,7 +149,6 @@ ViewProviderPartExt::ViewProviderPartExt()
ADD_PROPERTY(PointSize,(lwidth));
ADD_PROPERTY(Deviation,(0.5f));
Deviation.setConstraints(&tessRange);
ADD_PROPERTY(ControlPoints,(false));
ADD_PROPERTY(Lighting,(1));
Lighting.setEnums(LightingEnums);
ADD_PROPERTY(DrawStyle,((long int)0));
Expand Down
2 changes: 0 additions & 2 deletions src/Mod/Part/Gui/ViewProviderExt.h
Expand Up @@ -75,7 +75,6 @@ class PartGuiExport ViewProviderPartExt : public Gui::ViewProviderGeometryObject
App::PropertyColor PointColor;
App::PropertyMaterial LineMaterial;
App::PropertyMaterial PointMaterial;
App::PropertyBool ControlPoints;
App::PropertyEnumeration Lighting;
App::PropertyEnumeration DrawStyle;

Expand Down Expand Up @@ -126,7 +125,6 @@ class PartGuiExport ViewProviderPartExt : public Gui::ViewProviderGeometryObject
SoMaterial * pcPointMaterial;
SoDrawStyle * pcLineStyle;
SoDrawStyle * pcPointStyle;
//SoSwitch * pcControlPoints;
SoShapeHints * pShapeHints;

SoCoordinate3 * coords;
Expand Down

0 comments on commit 25b6645

Please sign in to comment.