rename SurfaceFeature to GeomFillSurface
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
#include "FeatureFilling.h"
|
||||
#include "FeatureSewing.h"
|
||||
#include "FeatureCut.h"
|
||||
#include "FeatureSurface.h"
|
||||
#include "FeatureGeomFillSurface.h"
|
||||
|
||||
#include <Base/Interpreter.h>
|
||||
#include <Base/Parameter.h>
|
||||
@@ -74,10 +74,10 @@ PyMOD_INIT_FUNC(Surface)
|
||||
Base::Console().Log("Loading Surface module... done\n");
|
||||
|
||||
// Add types to module
|
||||
Surface::Filling ::init();
|
||||
Surface::Sewing ::init();
|
||||
Surface::Cut ::init();
|
||||
Surface::SurfaceFeature ::init();
|
||||
Surface::Filling ::init();
|
||||
Surface::Sewing ::init();
|
||||
Surface::Cut ::init();
|
||||
Surface::GeomFillSurface ::init();
|
||||
|
||||
PyMOD_Return(mod);
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ SET(Surface_SRCS
|
||||
AppSurface.cpp
|
||||
PreCompiled.cpp
|
||||
PreCompiled.h
|
||||
FeatureSurface.cpp
|
||||
FeatureSurface.h
|
||||
FeatureGeomFillSurface.cpp
|
||||
FeatureGeomFillSurface.h
|
||||
FeatureFilling.cpp
|
||||
FeatureFilling.h
|
||||
FeatureSewing.cpp
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include <Base/Exception.h>
|
||||
#include <Base/Tools.h>
|
||||
|
||||
#include "FeatureSurface.h"
|
||||
#include "FeatureGeomFillSurface.h"
|
||||
|
||||
using namespace Surface;
|
||||
|
||||
@@ -122,11 +122,11 @@ void ShapeValidator::checkAndAdd(const Part::TopoShape &ts, const char *subName,
|
||||
}
|
||||
|
||||
|
||||
PROPERTY_SOURCE(Surface::SurfaceFeature, Part::Spline)
|
||||
PROPERTY_SOURCE(Surface::GeomFillSurface, Part::Spline)
|
||||
|
||||
const char* SurfaceFeature::FillTypeEnums[] = {"Stretched", "Coons", "Curved", NULL};
|
||||
const char* GeomFillSurface::FillTypeEnums[] = {"Stretched", "Coons", "Curved", NULL};
|
||||
|
||||
SurfaceFeature::SurfaceFeature(): Spline()
|
||||
GeomFillSurface::GeomFillSurface(): Spline()
|
||||
{
|
||||
ADD_PROPERTY(FillType, ((long)0));
|
||||
ADD_PROPERTY(BoundaryList, (0, "Dummy"));
|
||||
@@ -135,7 +135,7 @@ SurfaceFeature::SurfaceFeature(): Spline()
|
||||
|
||||
|
||||
//Check if any components of the surface have been modified
|
||||
short SurfaceFeature::mustExecute() const
|
||||
short GeomFillSurface::mustExecute() const
|
||||
{
|
||||
if (BoundaryList.isTouched() ||
|
||||
FillType.isTouched()) {
|
||||
@@ -144,7 +144,7 @@ short SurfaceFeature::mustExecute() const
|
||||
return Spline::mustExecute();
|
||||
}
|
||||
|
||||
App::DocumentObjectExecReturn *SurfaceFeature::execute(void)
|
||||
App::DocumentObjectExecReturn *GeomFillSurface::execute(void)
|
||||
{
|
||||
try {
|
||||
TopoDS_Wire aWire;
|
||||
@@ -172,7 +172,7 @@ App::DocumentObjectExecReturn *SurfaceFeature::execute(void)
|
||||
}
|
||||
}
|
||||
|
||||
GeomFill_FillingStyle SurfaceFeature::getFillingStyle()
|
||||
GeomFill_FillingStyle GeomFillSurface::getFillingStyle()
|
||||
{
|
||||
//Identify filling style
|
||||
switch (FillType.getValue()) {
|
||||
@@ -186,7 +186,7 @@ GeomFill_FillingStyle SurfaceFeature::getFillingStyle()
|
||||
}
|
||||
}
|
||||
|
||||
bool SurfaceFeature::getWire(TopoDS_Wire& aWire)
|
||||
bool GeomFillSurface::getWire(TopoDS_Wire& aWire)
|
||||
{
|
||||
Handle(ShapeFix_Wire) aShFW = new ShapeFix_Wire;
|
||||
Handle(ShapeExtend_WireData) aWD = new ShapeExtend_WireData;
|
||||
@@ -233,7 +233,7 @@ bool SurfaceFeature::getWire(TopoDS_Wire& aWire)
|
||||
return validator.isBezier();
|
||||
}
|
||||
|
||||
void SurfaceFeature::createFace(const Handle_Geom_BoundedSurface &aSurface)
|
||||
void GeomFillSurface::createFace(const Handle_Geom_BoundedSurface &aSurface)
|
||||
{
|
||||
BRepBuilderAPI_MakeFace aFaceBuilder;
|
||||
Standard_Real u1, u2, v1, v2;
|
||||
@@ -252,7 +252,7 @@ void SurfaceFeature::createFace(const Handle_Geom_BoundedSurface &aSurface)
|
||||
this->Shape.setValue(aFace);
|
||||
}
|
||||
|
||||
void SurfaceFeature::createBezierSurface(TopoDS_Wire& aWire)
|
||||
void GeomFillSurface::createBezierSurface(TopoDS_Wire& aWire)
|
||||
{
|
||||
std::vector<Handle_Geom_BezierCurve> crvs;
|
||||
crvs.reserve(4);
|
||||
@@ -293,7 +293,7 @@ void SurfaceFeature::createBezierSurface(TopoDS_Wire& aWire)
|
||||
createFace(aSurfBuilder.Surface());
|
||||
}
|
||||
|
||||
void SurfaceFeature::createBSplineSurface(TopoDS_Wire& aWire)
|
||||
void GeomFillSurface::createBSplineSurface(TopoDS_Wire& aWire)
|
||||
{
|
||||
std::vector<Handle_Geom_BSplineCurve> crvs;
|
||||
crvs.reserve(4);
|
||||
@@ -21,8 +21,8 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef FEATURESURFACE_H
|
||||
#define FEATURESURFACE_H
|
||||
#ifndef FEATUREGEOMFILLSURFACE_H
|
||||
#define FEATUREGEOMFILLSURFACE_H
|
||||
|
||||
#include <Geom_BoundedSurface.hxx>
|
||||
#include <GeomFill_FillingStyle.hxx>
|
||||
@@ -56,13 +56,13 @@ public:
|
||||
return edgeCount;
|
||||
}
|
||||
};
|
||||
|
||||
class SurfaceFeature : public Part::Spline
|
||||
|
||||
class GeomFillSurface : public Part::Spline
|
||||
{
|
||||
PROPERTY_HEADER(Surface::SurfaceFeature);
|
||||
PROPERTY_HEADER(Surface::GeomFillSurface);
|
||||
|
||||
public:
|
||||
SurfaceFeature();
|
||||
GeomFillSurface();
|
||||
App::PropertyLinkSubList BoundaryList; //curves to be turned into a face (2-4 curves allowed).
|
||||
App::PropertyEnumeration FillType; //Fill method (1, 2, or 3 for Stretch, Coons, and Curved)
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
/// returns the type name of the view provider
|
||||
const char* getViewProviderName(void) const {
|
||||
return "SurfaceGui::ViewProviderSurfaceFeature";
|
||||
return "SurfaceGui::ViewProviderGeomFillSurface";
|
||||
}
|
||||
|
||||
protected:
|
||||
@@ -88,4 +88,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // FEATURESURFACE_H
|
||||
#endif // FEATUREGEOMFILLSURFACE_H
|
||||
@@ -76,7 +76,7 @@ PyMOD_INIT_FUNC(SurfaceGui)
|
||||
CreateSurfaceCommands();
|
||||
|
||||
SurfaceGui::Workbench::init();
|
||||
SurfaceGui::ViewProviderSurfaceFeature::init();
|
||||
SurfaceGui::ViewProviderGeomFillSurface::init();
|
||||
|
||||
// SurfaceGui::ViewProviderCut::init();
|
||||
|
||||
|
||||
@@ -149,31 +149,31 @@ void CmdSurfaceCut::activated(int iMsg)
|
||||
//===========================================================================
|
||||
// Bezier and BSpline surfaces
|
||||
//===========================================================================
|
||||
DEF_STD_CMD_A(CmdSurfaceBSurf);
|
||||
DEF_STD_CMD_A(CmdSurfaceGeomFillSurface)
|
||||
|
||||
CmdSurfaceBSurf::CmdSurfaceBSurf()
|
||||
: Command("Surface_BSurf")
|
||||
CmdSurfaceGeomFillSurface::CmdSurfaceGeomFillSurface()
|
||||
: Command("Surface_GeomFillSurface")
|
||||
{
|
||||
sAppModule = "Surface";
|
||||
sGroup = QT_TR_NOOP("Surface");
|
||||
sMenuText = QT_TR_NOOP("Fill boundary curves");
|
||||
sToolTipText = QT_TR_NOOP("Creates a surface from two, three or four boundary edges");
|
||||
sWhatsThis = "Surface_BSurf";
|
||||
sWhatsThis = "Surface_GeomFillSurface";
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "BSplineSurf";
|
||||
}
|
||||
|
||||
bool CmdSurfaceBSurf::isActive(void)
|
||||
bool CmdSurfaceGeomFillSurface::isActive(void)
|
||||
{
|
||||
return hasActiveDocument();
|
||||
}
|
||||
|
||||
void CmdSurfaceBSurf::activated(int iMsg)
|
||||
void CmdSurfaceGeomFillSurface::activated(int iMsg)
|
||||
{
|
||||
std::string FeatName = getUniqueObjectName("Surface");
|
||||
|
||||
openCommand("Create surface");
|
||||
doCommand(Doc, "App.ActiveDocument.addObject(\"Surface::SurfaceFeature\",\"%s\")", FeatName.c_str());
|
||||
doCommand(Doc, "App.ActiveDocument.addObject(\"Surface::GeomFillSurface\",\"%s\")", FeatName.c_str());
|
||||
doCommand(Doc, "Gui.ActiveDocument.setEdit('%s',0)", FeatName.c_str());
|
||||
}
|
||||
|
||||
@@ -182,5 +182,5 @@ void CreateSurfaceCommands(void)
|
||||
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
|
||||
/* rcCmdMgr.addCommand(new CmdSurfaceFilling());
|
||||
rcCmdMgr.addCommand(new CmdSurfaceCut());*/
|
||||
rcCmdMgr.addCommand(new CmdSurfaceBSurf());
|
||||
rcCmdMgr.addCommand(new CmdSurfaceGeomFillSurface());
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
using namespace SurfaceGui;
|
||||
|
||||
PROPERTY_SOURCE(SurfaceGui::ViewProviderSurfaceFeature, PartGui::ViewProviderSpline)
|
||||
PROPERTY_SOURCE(SurfaceGui::ViewProviderGeomFillSurface, PartGui::ViewProviderSpline)
|
||||
|
||||
namespace SurfaceGui {
|
||||
|
||||
@@ -72,7 +72,7 @@ bool EdgeSelection::allow(App::Document* , App::DocumentObject* pObj, const char
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void ViewProviderSurfaceFeature::setupContextMenu(QMenu* menu, QObject* receiver, const char* member)
|
||||
void ViewProviderGeomFillSurface::setupContextMenu(QMenu* menu, QObject* receiver, const char* member)
|
||||
{
|
||||
QAction* act;
|
||||
act = menu->addAction(QObject::tr("Edit filling"), receiver, member);
|
||||
@@ -80,14 +80,14 @@ void ViewProviderSurfaceFeature::setupContextMenu(QMenu* menu, QObject* receiver
|
||||
PartGui::ViewProviderSpline::setupContextMenu(menu, receiver, member);
|
||||
}
|
||||
|
||||
bool ViewProviderSurfaceFeature::setEdit(int ModNum)
|
||||
bool ViewProviderGeomFillSurface::setEdit(int ModNum)
|
||||
{
|
||||
if (ModNum == ViewProvider::Default ) {
|
||||
// When double-clicking on the item for this sketch the
|
||||
// object unsets and sets its edit mode without closing
|
||||
// the task panel
|
||||
|
||||
Surface::SurfaceFeature* obj = static_cast<Surface::SurfaceFeature*>(this->getObject());
|
||||
Surface::GeomFillSurface* obj = static_cast<Surface::GeomFillSurface*>(this->getObject());
|
||||
|
||||
Gui::TaskView::TaskDialog* dlg = Gui::Control().activeDialog();
|
||||
|
||||
@@ -108,7 +108,7 @@ bool ViewProviderSurfaceFeature::setEdit(int ModNum)
|
||||
}
|
||||
}
|
||||
|
||||
void ViewProviderSurfaceFeature::unsetEdit(int ModNum)
|
||||
void ViewProviderGeomFillSurface::unsetEdit(int ModNum)
|
||||
{
|
||||
if (ModNum == ViewProvider::Default) {
|
||||
// when pressing ESC make sure to close the dialog
|
||||
@@ -119,14 +119,14 @@ void ViewProviderSurfaceFeature::unsetEdit(int ModNum)
|
||||
}
|
||||
}
|
||||
|
||||
QIcon ViewProviderSurfaceFeature::getIcon(void) const
|
||||
QIcon ViewProviderGeomFillSurface::getIcon(void) const
|
||||
{
|
||||
return Gui::BitmapFactory().pixmap("BSplineSurf");
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
SurfaceFilling::SurfaceFilling(ViewProviderSurfaceFeature* vp, Surface::SurfaceFeature* obj)
|
||||
SurfaceFilling::SurfaceFilling(ViewProviderGeomFillSurface* vp, Surface::GeomFillSurface* obj)
|
||||
{
|
||||
ui = new Ui_SurfaceFilling();
|
||||
ui->setupUi(this);
|
||||
@@ -152,7 +152,7 @@ SurfaceFilling::~SurfaceFilling()
|
||||
}
|
||||
|
||||
// stores object pointer, its old fill type and adjusts radio buttons according to it.
|
||||
void SurfaceFilling::setEditedObject(Surface::SurfaceFeature* obj)
|
||||
void SurfaceFilling::setEditedObject(Surface::GeomFillSurface* obj)
|
||||
{
|
||||
editedObject = obj;
|
||||
GeomFill_FillingStyle curtype = static_cast<GeomFill_FillingStyle>(editedObject->FillType.getValue());
|
||||
@@ -404,7 +404,7 @@ void SurfaceFilling::onDeleteEdge()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
TaskSurfaceFilling::TaskSurfaceFilling(ViewProviderSurfaceFeature* vp, Surface::SurfaceFeature* obj)
|
||||
TaskSurfaceFilling::TaskSurfaceFilling(ViewProviderGeomFillSurface* vp, Surface::GeomFillSurface* obj)
|
||||
{
|
||||
widget = new SurfaceFilling(vp, obj);
|
||||
widget->setWindowTitle(QObject::tr("Surface"));
|
||||
@@ -420,7 +420,7 @@ TaskSurfaceFilling::~TaskSurfaceFilling()
|
||||
// automatically deleted in the sub-class
|
||||
}
|
||||
|
||||
void TaskSurfaceFilling::setEditedObject(Surface::SurfaceFeature* obj)
|
||||
void TaskSurfaceFilling::setEditedObject(Surface::GeomFillSurface* obj)
|
||||
{
|
||||
widget->setEditedObject(obj);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <Gui/DocumentObserver.h>
|
||||
#include <Base/BoundBox.h>
|
||||
#include <Mod/Part/Gui/ViewProviderSpline.h>
|
||||
#include <Mod/Surface/App/FeatureSurface.h>
|
||||
#include <Mod/Surface/App/FeatureGeomFillSurface.h>
|
||||
#include <GeomFill_FillingStyle.hxx>
|
||||
|
||||
namespace SurfaceGui
|
||||
@@ -38,7 +38,7 @@ namespace SurfaceGui
|
||||
class EdgeSelection : public Gui::SelectionFilterGate
|
||||
{
|
||||
public:
|
||||
EdgeSelection(bool appendEdges, Surface::SurfaceFeature* editedObject)
|
||||
EdgeSelection(bool appendEdges, Surface::GeomFillSurface* editedObject)
|
||||
: Gui::SelectionFilterGate(static_cast<Gui::SelectionFilter*>(nullptr))
|
||||
, appendEdges(appendEdges)
|
||||
, editedObject(editedObject)
|
||||
@@ -51,14 +51,14 @@ public:
|
||||
|
||||
private:
|
||||
bool appendEdges;
|
||||
Surface::SurfaceFeature* editedObject;
|
||||
Surface::GeomFillSurface* editedObject;
|
||||
};
|
||||
|
||||
class Ui_SurfaceFilling;
|
||||
|
||||
class ViewProviderSurfaceFeature : public PartGui::ViewProviderSpline
|
||||
class ViewProviderGeomFillSurface : public PartGui::ViewProviderSpline
|
||||
{
|
||||
PROPERTY_HEADER(SurfaceGui::ViewProviderSurfaceFeature);
|
||||
PROPERTY_HEADER(SurfaceGui::ViewProviderGeomFillSurface);
|
||||
public:
|
||||
virtual void setupContextMenu(QMenu*, QObject*, const char*);
|
||||
virtual bool setEdit(int ModNum);
|
||||
@@ -75,21 +75,21 @@ class SurfaceFilling : public QWidget,
|
||||
protected:
|
||||
enum SelectionMode { None, Append, Remove };
|
||||
SelectionMode selectionMode;
|
||||
Surface::SurfaceFeature* editedObject;
|
||||
Surface::GeomFillSurface* editedObject;
|
||||
bool checkCommand;
|
||||
|
||||
private:
|
||||
Ui_SurfaceFilling* ui;
|
||||
ViewProviderSurfaceFeature* vp;
|
||||
ViewProviderGeomFillSurface* vp;
|
||||
|
||||
public:
|
||||
SurfaceFilling(ViewProviderSurfaceFeature* vp, Surface::SurfaceFeature* obj);
|
||||
SurfaceFilling(ViewProviderGeomFillSurface* vp, Surface::GeomFillSurface* obj);
|
||||
~SurfaceFilling();
|
||||
|
||||
void open();
|
||||
bool accept();
|
||||
bool reject();
|
||||
void setEditedObject(Surface::SurfaceFeature* obj);
|
||||
void setEditedObject(Surface::GeomFillSurface* obj);
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
@@ -114,9 +114,9 @@ class TaskSurfaceFilling : public Gui::TaskView::TaskDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskSurfaceFilling(ViewProviderSurfaceFeature* vp, Surface::SurfaceFeature* obj);
|
||||
TaskSurfaceFilling(ViewProviderGeomFillSurface* vp, Surface::GeomFillSurface* obj);
|
||||
~TaskSurfaceFilling();
|
||||
void setEditedObject(Surface::SurfaceFeature* obj);
|
||||
void setEditedObject(Surface::GeomFillSurface* obj);
|
||||
|
||||
public:
|
||||
void open();
|
||||
@@ -129,7 +129,7 @@ public:
|
||||
private:
|
||||
SurfaceFilling* widget;
|
||||
Gui::TaskView::TaskBox* taskbox;
|
||||
ViewProviderSurfaceFeature* view;
|
||||
ViewProviderGeomFillSurface* view;
|
||||
};
|
||||
|
||||
} //namespace Surface
|
||||
|
||||
@@ -52,7 +52,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const
|
||||
Gui::MenuItem* surface = new Gui::MenuItem;
|
||||
root->insertItem( item, surface );
|
||||
surface->setCommand("Surface");
|
||||
*surface << "Surface_BSurf";
|
||||
*surface << "Surface_GeomFillSurface";
|
||||
/* *surface << "Surface_Filling";
|
||||
*surface << "Surface_Cut";*/
|
||||
|
||||
@@ -65,7 +65,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
|
||||
|
||||
Gui::ToolBarItem* surface = new Gui::ToolBarItem(root);
|
||||
surface->setCommand( "Surface" );
|
||||
*surface << "Surface_BSurf";
|
||||
*surface << "Surface_GeomFillSurface";
|
||||
/* *surface << "Surface_Filling";
|
||||
*surface << "Surface_Cut"; */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user