choose more comprehensive class and file names
This commit is contained in:
@@ -31,9 +31,9 @@
|
||||
#include "FeatureFilling.h"
|
||||
#include "FeatureSewing.h"
|
||||
#include "FeatureCut.h"
|
||||
#include "FeatureBSurf.h"
|
||||
#include "FeatureBezSurf.h"
|
||||
#include "FeatureBSplineSurf.h"
|
||||
#include "FeatureSurface.h"
|
||||
#include "FeatureBezierSurface.h"
|
||||
#include "FeatureBSplineSurface.h"
|
||||
|
||||
#include <Base/Interpreter.h>
|
||||
#include <Base/Parameter.h>
|
||||
@@ -79,9 +79,9 @@ PyMOD_INIT_FUNC(Surface)
|
||||
Surface::Filling ::init();
|
||||
Surface::Sewing ::init();
|
||||
Surface::Cut ::init();
|
||||
Surface::BSurf ::init();
|
||||
Surface::BezSurf ::init();
|
||||
Surface::BSplineSurf ::init();
|
||||
Surface::SurfaceFeature ::init();
|
||||
Surface::BezierSurface ::init();
|
||||
Surface::BSplineSurface ::init();
|
||||
|
||||
PyMOD_Return(mod);
|
||||
}
|
||||
|
||||
@@ -21,18 +21,18 @@ SET(Surface_SRCS
|
||||
AppSurface.cpp
|
||||
PreCompiled.cpp
|
||||
PreCompiled.h
|
||||
FeatureBSurf.h
|
||||
FeatureBSurf.cpp
|
||||
FeatureFilling.h
|
||||
FeatureSurface.cpp
|
||||
FeatureSurface.h
|
||||
FeatureFilling.cpp
|
||||
FeatureSewing.h
|
||||
FeatureFilling.h
|
||||
FeatureSewing.cpp
|
||||
FeatureCut.h
|
||||
FeatureSewing.h
|
||||
FeatureCut.cpp
|
||||
FeatureBezSurf.h
|
||||
FeatureBezSurf.cpp
|
||||
FeatureBSplineSurf.h
|
||||
FeatureBSplineSurf.cpp
|
||||
FeatureCut.h
|
||||
FeatureBezierSurface.cpp
|
||||
FeatureBezierSurface.h
|
||||
FeatureBSplineSurface.cpp
|
||||
FeatureBSplineSurface.h
|
||||
FillType.h
|
||||
)
|
||||
|
||||
|
||||
@@ -43,19 +43,19 @@
|
||||
#include <Base/Tools.h>
|
||||
#include <Base/Exception.h>
|
||||
|
||||
#include "FeatureBSplineSurf.h"
|
||||
#include "FeatureBSplineSurface.h"
|
||||
|
||||
|
||||
using namespace Surface;
|
||||
|
||||
PROPERTY_SOURCE(Surface::BSplineSurf, Surface::BSurf)
|
||||
PROPERTY_SOURCE(Surface::BSplineSurface, Surface::SurfaceFeature)
|
||||
|
||||
|
||||
BSplineSurf::BSplineSurf() : BSurf()
|
||||
BSplineSurface::BSplineSurface() : SurfaceFeature()
|
||||
{
|
||||
}
|
||||
|
||||
App::DocumentObjectExecReturn *BSplineSurf::execute(void)
|
||||
App::DocumentObjectExecReturn *BSplineSurface::execute(void)
|
||||
{
|
||||
correcteInvalidFillType();
|
||||
|
||||
@@ -21,20 +21,20 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef SURFACE_FEATUREBSPLINESURF_H
|
||||
#define SURFACE_FEATUREBSPLINESURF_H
|
||||
#ifndef SURFACE_FEATUREBSPLINESURFACE_H
|
||||
#define SURFACE_FEATUREBSPLINESURFACE_H
|
||||
|
||||
#include "FeatureBSurf.h"
|
||||
#include "FeatureSurface.h"
|
||||
|
||||
namespace Surface
|
||||
{
|
||||
|
||||
class SurfaceExport BSplineSurf : public BSurf
|
||||
class SurfaceExport BSplineSurface : public SurfaceFeature
|
||||
{
|
||||
PROPERTY_HEADER(Surface::BSplineSurf);
|
||||
PROPERTY_HEADER(Surface::BSplineSurface);
|
||||
|
||||
public:
|
||||
BSplineSurf();
|
||||
BSplineSurface();
|
||||
|
||||
// recalculate the feature
|
||||
virtual App::DocumentObjectExecReturn *execute(void);
|
||||
@@ -41,18 +41,18 @@
|
||||
#include <Base/Tools.h>
|
||||
#include <Base/Exception.h>
|
||||
|
||||
#include "FeatureBezSurf.h"
|
||||
#include "FeatureBezierSurface.h"
|
||||
|
||||
|
||||
using namespace Surface;
|
||||
|
||||
PROPERTY_SOURCE(Surface::BezSurf, Surface::BSurf)
|
||||
PROPERTY_SOURCE(Surface::BezierSurface, Surface::SurfaceFeature)
|
||||
|
||||
BezSurf::BezSurf() : BSurf()
|
||||
BezierSurface::BezierSurface() : SurfaceFeature()
|
||||
{
|
||||
}
|
||||
|
||||
App::DocumentObjectExecReturn *BezSurf::execute(void)
|
||||
App::DocumentObjectExecReturn *BezierSurface::execute(void)
|
||||
{
|
||||
correcteInvalidFillType();
|
||||
|
||||
@@ -21,20 +21,20 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef SURFACE_FEATUREBEZSURF_H
|
||||
#define SURFACE_FEATUREBEZSURF_H
|
||||
#ifndef SURFACE_FEATUREBEZIERSURFACE_H
|
||||
#define SURFACE_FEATUREBEZIERSURFACE_H
|
||||
|
||||
#include "FeatureBSurf.h"
|
||||
#include "FeatureSurface.h"
|
||||
|
||||
namespace Surface
|
||||
{
|
||||
|
||||
class SurfaceExport BezSurf : public BSurf
|
||||
class SurfaceExport BezierSurface : public SurfaceFeature
|
||||
{
|
||||
PROPERTY_HEADER(Surface::BezSurf);
|
||||
PROPERTY_HEADER(Surface::BezierSurface);
|
||||
|
||||
public:
|
||||
BezSurf();
|
||||
BezierSurface();
|
||||
|
||||
// recalculate the feature
|
||||
virtual App::DocumentObjectExecReturn *execute(void);
|
||||
@@ -41,7 +41,7 @@
|
||||
#include <Base/Exception.h>
|
||||
#include <Base/Tools.h>
|
||||
|
||||
#include "FeatureBSurf.h"
|
||||
#include "FeatureSurface.h"
|
||||
|
||||
using namespace Surface;
|
||||
|
||||
@@ -148,11 +148,11 @@ void ShapeValidator::checkAndAdd(const Part::TopoShape &ts, const char *subName,
|
||||
}
|
||||
|
||||
|
||||
PROPERTY_SOURCE(Surface::BSurf, Part::Feature)
|
||||
PROPERTY_SOURCE(Surface::SurfaceFeature, Part::Feature)
|
||||
|
||||
const char* BSurf::FillTypeEnums[] = {"Invalid", "Stretched", "Coons", "Curved", NULL};
|
||||
const char* SurfaceFeature::FillTypeEnums[] = {"Invalid", "Stretched", "Coons", "Curved", NULL};
|
||||
|
||||
BSurf::BSurf(): Feature()
|
||||
SurfaceFeature::SurfaceFeature(): Feature()
|
||||
{
|
||||
ADD_PROPERTY(FillType, ((long)0));
|
||||
ADD_PROPERTY(BoundaryList, (0, "Dummy"));
|
||||
@@ -162,7 +162,7 @@ BSurf::BSurf(): Feature()
|
||||
|
||||
|
||||
//Check if any components of the surface have been modified
|
||||
short BSurf::mustExecute() const
|
||||
short SurfaceFeature::mustExecute() const
|
||||
{
|
||||
if (BoundaryList.isTouched() ||
|
||||
FillType.isTouched())
|
||||
@@ -172,7 +172,7 @@ short BSurf::mustExecute() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
GeomFill_FillingStyle BSurf::getFillingStyle()
|
||||
GeomFill_FillingStyle SurfaceFeature::getFillingStyle()
|
||||
{
|
||||
//Identify filling style
|
||||
int ftype = FillType.getValue();
|
||||
@@ -188,7 +188,7 @@ GeomFill_FillingStyle BSurf::getFillingStyle()
|
||||
}
|
||||
|
||||
|
||||
void BSurf::getWire(TopoDS_Wire& aWire)
|
||||
void SurfaceFeature::getWire(TopoDS_Wire& aWire)
|
||||
{
|
||||
Handle(ShapeFix_Wire) aShFW = new ShapeFix_Wire;
|
||||
Handle(ShapeExtend_WireData) aWD = new ShapeExtend_WireData;
|
||||
@@ -234,7 +234,7 @@ void BSurf::getWire(TopoDS_Wire& aWire)
|
||||
}
|
||||
}
|
||||
|
||||
void BSurf::createFace(const Handle_Geom_BoundedSurface &aSurface)
|
||||
void SurfaceFeature::createFace(const Handle_Geom_BoundedSurface &aSurface)
|
||||
{
|
||||
BRepBuilderAPI_MakeFace aFaceBuilder;
|
||||
Standard_Real u1, u2, v1, v2;
|
||||
@@ -253,7 +253,7 @@ void BSurf::createFace(const Handle_Geom_BoundedSurface &aSurface)
|
||||
this->Shape.setValue(aFace);
|
||||
}
|
||||
|
||||
void BSurf::correcteInvalidFillType()
|
||||
void SurfaceFeature::correcteInvalidFillType()
|
||||
{
|
||||
int ftype = FillType.getValue();
|
||||
if(ftype == InvalidStyle)
|
||||
@@ -21,8 +21,8 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef FEATUREBSURF_H
|
||||
#define FEATUREBSURF_H
|
||||
#ifndef FEATURESURFACE_H
|
||||
#define FEATURESURFACE_H
|
||||
|
||||
#include <Geom_BoundedSurface.hxx>
|
||||
#include <GeomFill_FillingStyle.hxx>
|
||||
@@ -62,12 +62,12 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class BSurf : public Part::Feature
|
||||
class SurfaceFeature : public Part::Feature
|
||||
{
|
||||
PROPERTY_HEADER(Surface::BSurf);
|
||||
PROPERTY_HEADER(Surface::SurfaceFeature);
|
||||
|
||||
public:
|
||||
BSurf();
|
||||
SurfaceFeature();
|
||||
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)
|
||||
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
|
||||
/// returns the type name of the view provider
|
||||
const char* getViewProviderName(void) const {
|
||||
return "SurfaceGui::ViewProviderBSurf";
|
||||
return "SurfaceGui::ViewProviderSurfaceFeature";
|
||||
}
|
||||
|
||||
protected:
|
||||
@@ -92,4 +92,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // FEATUREBSURF_H
|
||||
#endif // FEATURESURFACE_H
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <Gui/Application.h>
|
||||
|
||||
#include "Workbench.h"
|
||||
#include "BSurf.h"
|
||||
#include "SurfaceFilling.h"
|
||||
|
||||
// use a different name to CreateCommand()
|
||||
void CreateSurfaceCommands(void);
|
||||
@@ -76,7 +76,7 @@ PyMOD_INIT_FUNC(SurfaceGui)
|
||||
CreateSurfaceCommands();
|
||||
|
||||
SurfaceGui::Workbench::init();
|
||||
SurfaceGui::ViewProviderBSurf::init();
|
||||
SurfaceGui::ViewProviderSurfaceFeature::init();
|
||||
|
||||
// SurfaceGui::ViewProviderCut::init();
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ set(SurfaceGui_LIBS
|
||||
)
|
||||
|
||||
set(SurfaceGui_MOC_HDRS
|
||||
BSurf.h
|
||||
SurfaceFilling.h
|
||||
)
|
||||
fc_wrap_cpp(SurfaceGui_MOC_SRCS ${SurfaceGui_MOC_HDRS})
|
||||
SOURCE_GROUP("Moc" FILES ${SurfaceGui_MOC_SRCS})
|
||||
@@ -36,7 +36,7 @@ else()
|
||||
endif()
|
||||
|
||||
SET(SurfaceGui_UIC_SRCS
|
||||
BSurf.ui
|
||||
SurfaceFilling.ui
|
||||
)
|
||||
|
||||
if (BUILD_QT5)
|
||||
@@ -48,8 +48,8 @@ endif()
|
||||
SET(SurfaceGui_SRCS
|
||||
${SurfaceGui_QRC_SRCS}
|
||||
${SurfaceGui_UIC_HDRS}
|
||||
BSurf.cpp
|
||||
BSurf.h
|
||||
SurfaceFilling.cpp
|
||||
SurfaceFilling.h
|
||||
AppSurfaceGui.cpp
|
||||
Command.cpp
|
||||
PreCompiled.cpp
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
#include <App/PropertyUnits.h>
|
||||
#include <App/PropertyLinks.h>
|
||||
#include "Mod/Part/App/PartFeature.h"
|
||||
#include "BSurf.h"
|
||||
#include "SurfaceFilling.h"
|
||||
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
@@ -157,7 +157,7 @@ CmdSurfaceBSurf::CmdSurfaceBSurf()
|
||||
sAppModule = "Surface";
|
||||
sGroup = QT_TR_NOOP("Surface");
|
||||
sMenuText = QT_TR_NOOP("Bezier or BSpline surface");
|
||||
sToolTipText = QT_TR_NOOP("Creates a surface from 2, 3 or 4 Bezier or BSpline curves");
|
||||
sToolTipText = QT_TR_NOOP("Creates a surface from 2, 3 or 4 Bezier or B-spline curves");
|
||||
sWhatsThis = "Surface_BSurf";
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "BSplineSurf";
|
||||
@@ -242,7 +242,7 @@ void CmdSurfaceBSurf::activated(int iMsg)
|
||||
std::string FeatName = getUniqueObjectName("BezierSurface");
|
||||
|
||||
openCommand("Create Bezier surface");
|
||||
doCommand(Doc, "App.ActiveDocument.addObject(\"Surface::BezSurf\",\"%s\")", FeatName.c_str());
|
||||
doCommand(Doc, "App.ActiveDocument.addObject(\"Surface::BezierSurface\",\"%s\")", FeatName.c_str());
|
||||
// invalid fill type meaning the surface is just created and cancel should delete it
|
||||
doCommand(Doc, "App.ActiveDocument.ActiveObject.FillType=0");
|
||||
doCommand(Doc, "App.ActiveDocument.ActiveObject.BoundaryList = [%s]", linklist.c_str());
|
||||
@@ -253,8 +253,8 @@ void CmdSurfaceBSurf::activated(int iMsg)
|
||||
if (validator.isBSpline()) {
|
||||
std::string FeatName = getUniqueObjectName("BSplineSurface");
|
||||
|
||||
openCommand("Create BSpline surface");
|
||||
doCommand(Doc, "App.ActiveDocument.addObject(\"Surface::BSplineSurf\",\"%s\")", FeatName.c_str());
|
||||
openCommand("Create B-spline surface");
|
||||
doCommand(Doc, "App.ActiveDocument.addObject(\"Surface::BSplineSurface\",\"%s\")", FeatName.c_str());
|
||||
// invalid fill type meaning the surface is just created and cancel should delete it
|
||||
doCommand(Doc, "App.ActiveDocument.ActiveObject.FillType=0");
|
||||
doCommand(Doc, "App.ActiveDocument.ActiveObject.BoundaryList = [%s]", linklist.c_str());
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include <Mod/Surface/App/FeatureBSurf.h>
|
||||
#include <Mod/Surface/App/FillType.h>
|
||||
#include <Gui/ViewProvider.h>
|
||||
#include <Gui/Application.h>
|
||||
@@ -32,26 +31,26 @@
|
||||
#include <Gui/Control.h>
|
||||
#include <Gui/BitmapFactory.h>
|
||||
|
||||
#include "BSurf.h"
|
||||
#include "ui_BSurf.h"
|
||||
#include "SurfaceFilling.h"
|
||||
#include "ui_SurfaceFilling.h"
|
||||
|
||||
|
||||
using namespace SurfaceGui;
|
||||
|
||||
PROPERTY_SOURCE(SurfaceGui::ViewProviderBSurf, PartGui::ViewProviderPart)
|
||||
PROPERTY_SOURCE(SurfaceGui::ViewProviderSurfaceFeature, PartGui::ViewProviderPart)
|
||||
|
||||
namespace SurfaceGui {
|
||||
|
||||
bool ViewProviderBSurf::setEdit(int ModNum)
|
||||
bool ViewProviderSurfaceFeature::setEdit(int ModNum)
|
||||
{
|
||||
// When double-clicking on the item for this sketch the
|
||||
// object unsets and sets its edit mode without closing
|
||||
// the task panel
|
||||
|
||||
Surface::BSurf* obj = static_cast<Surface::BSurf*>(this->getObject());
|
||||
Surface::SurfaceFeature* obj = static_cast<Surface::SurfaceFeature*>(this->getObject());
|
||||
|
||||
Gui::TaskView::TaskDialog* dlg = Gui::Control().activeDialog();
|
||||
TaskBSurf* tDlg = qobject_cast<TaskBSurf*>(dlg);
|
||||
TaskSurfaceFilling* tDlg = qobject_cast<TaskSurfaceFilling*>(dlg);
|
||||
|
||||
// start the edit dialog
|
||||
if(dlg) {
|
||||
@@ -59,24 +58,24 @@ bool ViewProviderBSurf::setEdit(int ModNum)
|
||||
Gui::Control().showDialog(tDlg);
|
||||
}
|
||||
else {
|
||||
Gui::Control().showDialog(new TaskBSurf(this, obj));
|
||||
Gui::Control().showDialog(new TaskSurfaceFilling(this, obj));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void ViewProviderBSurf::unsetEdit(int ModNum)
|
||||
void ViewProviderSurfaceFeature::unsetEdit(int ModNum)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
QIcon ViewProviderBSurf::getIcon(void) const
|
||||
QIcon ViewProviderSurfaceFeature::getIcon(void) const
|
||||
{
|
||||
return Gui::BitmapFactory().pixmap("BSplineSurf");
|
||||
}
|
||||
|
||||
BSurf::BSurf(ViewProviderBSurf* vp, Surface::BSurf* obj)
|
||||
SurfaceFilling::SurfaceFilling(ViewProviderSurfaceFeature* vp, Surface::SurfaceFeature* obj)
|
||||
{
|
||||
ui = new Ui_DlgBSurf();
|
||||
ui = new Ui_SurfaceFilling();
|
||||
ui->setupUi(this);
|
||||
this->vp = vp;
|
||||
setEditedObject(obj);
|
||||
@@ -85,14 +84,14 @@ BSurf::BSurf(ViewProviderBSurf* vp, Surface::BSurf* obj)
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
BSurf::~BSurf()
|
||||
SurfaceFilling::~SurfaceFilling()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
delete ui;
|
||||
}
|
||||
|
||||
// stores object pointer, its old fill type and adjusts radio buttons according to it.
|
||||
void BSurf::setEditedObject(Surface::BSurf* obj)
|
||||
void SurfaceFilling::setEditedObject(Surface::SurfaceFeature* obj)
|
||||
{
|
||||
editedObject = obj;
|
||||
oldFillType = (FillType_t)(editedObject->FillType.getValue());
|
||||
@@ -111,7 +110,7 @@ void BSurf::setEditedObject(Surface::BSurf* obj)
|
||||
fillType = oldFillType;
|
||||
}
|
||||
|
||||
FillType_t BSurf::getFillType() const
|
||||
FillType_t SurfaceFilling::getFillType() const
|
||||
{
|
||||
FillType_t ret;
|
||||
if (ui->fillType_stretch->isChecked())
|
||||
@@ -123,7 +122,7 @@ FillType_t BSurf::getFillType() const
|
||||
return ret;
|
||||
}
|
||||
|
||||
void BSurf::changeEvent(QEvent *e)
|
||||
void SurfaceFilling::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
ui->retranslateUi(this);
|
||||
@@ -133,7 +132,7 @@ void BSurf::changeEvent(QEvent *e)
|
||||
}
|
||||
}
|
||||
|
||||
void BSurf::accept()
|
||||
void SurfaceFilling::accept()
|
||||
{
|
||||
// applies the changes
|
||||
apply();
|
||||
@@ -141,7 +140,7 @@ void BSurf::accept()
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.resetEdit()");
|
||||
}
|
||||
|
||||
void BSurf::reject()
|
||||
void SurfaceFilling::reject()
|
||||
{
|
||||
if (oldFillType == InvalidStyle) {
|
||||
Gui::Command::abortCommand();
|
||||
@@ -159,7 +158,7 @@ void BSurf::reject()
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.resetEdit()");
|
||||
}
|
||||
|
||||
void BSurf::apply()
|
||||
void SurfaceFilling::apply()
|
||||
{
|
||||
// apply the change only if it is a real change
|
||||
if (editedObject->FillType.getValue() != fillType) {
|
||||
@@ -168,26 +167,26 @@ void BSurf::apply()
|
||||
}
|
||||
}
|
||||
|
||||
void BSurf::on_fillType_stretch_clicked()
|
||||
void SurfaceFilling::on_fillType_stretch_clicked()
|
||||
{
|
||||
fillType = StretchStyle;
|
||||
}
|
||||
|
||||
void BSurf::on_fillType_coons_clicked()
|
||||
void SurfaceFilling::on_fillType_coons_clicked()
|
||||
{
|
||||
fillType = CoonsStyle;
|
||||
}
|
||||
|
||||
void BSurf::on_fillType_curved_clicked()
|
||||
void SurfaceFilling::on_fillType_curved_clicked()
|
||||
{
|
||||
fillType = CurvedStyle;
|
||||
}
|
||||
|
||||
// ---------------------------------------
|
||||
|
||||
TaskBSurf::TaskBSurf(ViewProviderBSurf* vp, Surface::BSurf* obj)
|
||||
TaskSurfaceFilling::TaskSurfaceFilling(ViewProviderSurfaceFeature* vp, Surface::SurfaceFeature* obj)
|
||||
{
|
||||
widget = new BSurf(vp, obj);
|
||||
widget = new SurfaceFilling(vp, obj);
|
||||
widget->setWindowTitle(QObject::tr("Surface"));
|
||||
taskbox = new Gui::TaskView::TaskBox(
|
||||
Gui::BitmapFactory().pixmap("BezSurf"),
|
||||
@@ -196,30 +195,30 @@ TaskBSurf::TaskBSurf(ViewProviderBSurf* vp, Surface::BSurf* obj)
|
||||
Content.push_back(taskbox);
|
||||
}
|
||||
|
||||
TaskBSurf::~TaskBSurf()
|
||||
TaskSurfaceFilling::~TaskSurfaceFilling()
|
||||
{
|
||||
// automatically deleted in the sub-class
|
||||
}
|
||||
|
||||
void TaskBSurf::setEditedObject(Surface::BSurf* obj)
|
||||
void TaskSurfaceFilling::setEditedObject(Surface::SurfaceFeature* obj)
|
||||
{
|
||||
widget->setEditedObject(obj);
|
||||
}
|
||||
|
||||
bool TaskBSurf::accept()
|
||||
bool TaskSurfaceFilling::accept()
|
||||
{
|
||||
widget->accept();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TaskBSurf::reject()
|
||||
bool TaskSurfaceFilling::reject()
|
||||
{
|
||||
widget->reject();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Apply clicked
|
||||
void TaskBSurf::clicked(int id)
|
||||
void TaskSurfaceFilling::clicked(int id)
|
||||
{
|
||||
if (id == QDialogButtonBox::Apply) {
|
||||
widget->apply();
|
||||
@@ -227,4 +226,5 @@ void TaskBSurf::clicked(int id)
|
||||
}
|
||||
|
||||
}
|
||||
#include "moc_BSurf.cpp"
|
||||
|
||||
#include "moc_SurfaceFilling.cpp"
|
||||
@@ -20,50 +20,50 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef SURFACE_GUI_BSURF_H
|
||||
#define SURFACE_GUI_BSURF_H
|
||||
#ifndef SURFACE_GUI_SURFACE_H
|
||||
#define SURFACE_GUI_SURFACE_H
|
||||
|
||||
#include <Gui/TaskView/TaskDialog.h>
|
||||
#include <Gui/TaskView/TaskView.h>
|
||||
#include <Base/BoundBox.h>
|
||||
#include <Mod/Surface/App/FillType.h>
|
||||
#include <Mod/Part/Gui/ViewProvider.h>
|
||||
#include <Mod/Surface/App/FeatureBSurf.h>
|
||||
#include <Mod/Surface/App/FeatureSurface.h>
|
||||
|
||||
namespace SurfaceGui
|
||||
{
|
||||
|
||||
class Ui_DlgBSurf;
|
||||
class Ui_SurfaceFilling;
|
||||
|
||||
class ViewProviderBSurf : public PartGui::ViewProviderPart
|
||||
class ViewProviderSurfaceFeature : public PartGui::ViewProviderPart
|
||||
{
|
||||
PROPERTY_HEADER(SurfaceGui::ViewProviderBSurf);
|
||||
PROPERTY_HEADER(SurfaceGui::ViewProviderSurfaceFeature);
|
||||
public:
|
||||
virtual bool setEdit(int ModNum);
|
||||
virtual void unsetEdit(int ModNum);
|
||||
QIcon getIcon(void) const;
|
||||
};
|
||||
|
||||
class BSurf : public QWidget
|
||||
class SurfaceFilling : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
protected:
|
||||
FillType_t fillType, oldFillType;
|
||||
Surface::BSurf* editedObject;
|
||||
Surface::SurfaceFeature* editedObject;
|
||||
|
||||
private:
|
||||
Ui_DlgBSurf* ui;
|
||||
Ui_SurfaceFilling* ui;
|
||||
Base::BoundBox3d bbox;
|
||||
ViewProviderBSurf* vp;
|
||||
ViewProviderSurfaceFeature* vp;
|
||||
|
||||
public:
|
||||
BSurf(ViewProviderBSurf* vp, Surface::BSurf* obj);
|
||||
~BSurf();
|
||||
SurfaceFilling(ViewProviderSurfaceFeature* vp, Surface::SurfaceFeature* obj);
|
||||
~SurfaceFilling();
|
||||
void accept();
|
||||
void reject();
|
||||
void apply();
|
||||
void setEditedObject(Surface::BSurf* obj);
|
||||
void setEditedObject(Surface::SurfaceFeature* obj);
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
@@ -75,14 +75,14 @@ namespace SurfaceGui
|
||||
FillType_t getFillType() const;
|
||||
};
|
||||
|
||||
class TaskBSurf : public Gui::TaskView::TaskDialog
|
||||
class TaskSurfaceFilling : public Gui::TaskView::TaskDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskBSurf(ViewProviderBSurf* vp, Surface::BSurf* obj);
|
||||
~TaskBSurf();
|
||||
void setEditedObject(Surface::BSurf* obj);
|
||||
TaskSurfaceFilling(ViewProviderSurfaceFeature* vp, Surface::SurfaceFeature* obj);
|
||||
~TaskSurfaceFilling();
|
||||
void setEditedObject(Surface::SurfaceFeature* obj);
|
||||
|
||||
public:
|
||||
bool accept();
|
||||
@@ -93,11 +93,11 @@ namespace SurfaceGui
|
||||
{ return QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel; }
|
||||
|
||||
private:
|
||||
BSurf* widget;
|
||||
SurfaceFilling* widget;
|
||||
Gui::TaskView::TaskBox* taskbox;
|
||||
ViewProviderBSurf* view;
|
||||
ViewProviderSurfaceFeature* view;
|
||||
};
|
||||
|
||||
} //namespace Surface
|
||||
|
||||
#endif // SURFACE_GUI_BSURF_H
|
||||
#endif // SURFACE_GUI_SURFACE_H
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SurfaceGui::DlgBSurf</class>
|
||||
<widget class="QWidget" name="SurfaceGui::DlgBSurf">
|
||||
<class>SurfaceGui::SurfaceFilling</class>
|
||||
<widget class="QWidget" name="SurfaceGui::SurfaceFilling">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -17,7 +17,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Placement</string>
|
||||
<string>Filling</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" colspan="2">
|
||||
Reference in New Issue
Block a user