Remove ShapeBinder2D
As profile based features can work with faces and wires now ShapeBinder can do everything that needed ShapeBinder2D before.
This commit is contained in:
parent
2b0e6883c3
commit
e7d8a1a9a4
|
@ -111,7 +111,6 @@ PyMODINIT_FUNC init_PartDesign()
|
|||
PartDesign::AdditiveLoft ::init();
|
||||
PartDesign::SubtractiveLoft ::init();
|
||||
PartDesign::ShapeBinder ::init();
|
||||
PartDesign::ShapeBinder2D ::init();
|
||||
PartDesign::Plane ::init();
|
||||
PartDesign::Line ::init();
|
||||
PartDesign::Point ::init();
|
||||
|
|
|
@ -148,28 +148,4 @@ TopoShape ShapeBinder::buildShapeFromReferences( Part::Feature* obj, std::vector
|
|||
return base;
|
||||
}
|
||||
return base;
|
||||
}
|
||||
|
||||
|
||||
PROPERTY_SOURCE(PartDesign::ShapeBinder2D, Part::Part2DObject)
|
||||
|
||||
ShapeBinder2D::ShapeBinder2D() {
|
||||
|
||||
}
|
||||
|
||||
ShapeBinder2D::~ShapeBinder2D() {
|
||||
|
||||
}
|
||||
|
||||
App::DocumentObjectExecReturn* ShapeBinder2D::execute(void) {
|
||||
|
||||
if(! this->isRestoring()){
|
||||
|
||||
Part::Feature* obj = nullptr;
|
||||
std::vector<std::string> subs;
|
||||
|
||||
ShapeBinder::getFilterdReferences(&Support, obj, subs);
|
||||
Shape.setValue(ShapeBinder::buildShapeFromReferences(obj, subs)._Shape);
|
||||
}
|
||||
return Part::Part2DObject::execute();
|
||||
}
|
||||
}
|
|
@ -27,15 +27,14 @@
|
|||
#include <QString>
|
||||
#include <App/PropertyLinks.h>
|
||||
#include <Mod/Part/App/DatumFeature.h>
|
||||
#include <Mod/Part/App/Part2DObject.h>
|
||||
|
||||
namespace PartDesign
|
||||
{
|
||||
|
||||
/*Those two feature are not realy a classical datum. They are fully defined shapes and not
|
||||
*infinit geometries like planes and lines. Also they are not calculated by references and hence
|
||||
*are not "attaced" to anything. Furthermore real shapes must be visualized. This makes it hard
|
||||
*to reuse the existing datum infrastructure and a special handling foor those two types is
|
||||
/*This feature is not realy a classical datum. It is a fully defined shape and not
|
||||
*infinit geometrie like a plane and a line. Also it is not calculated by references and hence
|
||||
*is not "attaced" to anything. Furthermore real shapes must be visualized. This makes it hard
|
||||
*to reuse the existing datum infrastructure and a special handling for this type is
|
||||
*created.
|
||||
*/
|
||||
// TODO Add a better documentation (2015-09-11, Fat-Zer)
|
||||
|
@ -62,23 +61,6 @@ protected:
|
|||
virtual App::DocumentObjectExecReturn* execute(void);
|
||||
};
|
||||
|
||||
//this class is needed as long as sketch-based features can only work with Part2DObjects
|
||||
class PartDesignExport ShapeBinder2D : public Part::Part2DObject
|
||||
{
|
||||
PROPERTY_HEADER(PartDesign::ShapeBinder2D);
|
||||
|
||||
public:
|
||||
ShapeBinder2D();
|
||||
virtual ~ShapeBinder2D();
|
||||
|
||||
const char* getViewProviderName(void) const {
|
||||
return "PartDesignGui::ViewProviderShapeBinder";
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual App::DocumentObjectExecReturn* execute(void);
|
||||
};
|
||||
|
||||
} //namespace PartDesign
|
||||
|
||||
|
||||
|
|
|
@ -245,8 +245,7 @@ void CmdPartDesignShapeBinder::activated(int iMsg)
|
|||
|
||||
bool bEditSelected = false;
|
||||
if (support.getSize() == 1 && support.getValue() ){
|
||||
if (support.getValue()->isDerivedFrom(PartDesign::ShapeBinder::getClassTypeId()) ||
|
||||
support.getValue()->isDerivedFrom(PartDesign::ShapeBinder2D::getClassTypeId()))
|
||||
if (support.getValue()->isDerivedFrom(PartDesign::ShapeBinder::getClassTypeId()))
|
||||
bEditSelected = true;
|
||||
}
|
||||
|
||||
|
@ -266,16 +265,9 @@ void CmdPartDesignShapeBinder::activated(int iMsg)
|
|||
|
||||
openCommand(tmp.c_str());
|
||||
|
||||
if ( support.getValue() &&
|
||||
( support.getValue()->isDerivedFrom(PartDesign::ShapeBinder2D::getClassTypeId()) ||
|
||||
support.getValue()->isDerivedFrom(Part::Part2DObject::getClassTypeId()) ) ) {
|
||||
doCommand(Gui::Command::Doc,"App.activeDocument().addObject('%s','%s')",
|
||||
"PartDesign::ShapeBinder2D",FeatName.c_str());
|
||||
} else {
|
||||
doCommand(Gui::Command::Doc,"App.activeDocument().addObject('%s','%s')",
|
||||
doCommand(Gui::Command::Doc,"App.activeDocument().addObject('%s','%s')",
|
||||
"PartDesign::ShapeBinder",FeatName.c_str());
|
||||
}
|
||||
|
||||
|
||||
//test if current selection fits a mode.
|
||||
if (support.getSize() > 0) {
|
||||
doCommand(Gui::Command::Doc,"App.activeDocument().%s.Support = %s",
|
||||
|
|
|
@ -261,6 +261,7 @@ std::vector<App::DocumentObject*> TaskFeaturePick::buildFeatures() {
|
|||
}
|
||||
|
||||
App::DocumentObject* TaskFeaturePick::makeCopy(App::DocumentObject* obj, std::string sub, bool independent) {
|
||||
|
||||
App::DocumentObject* copy = nullptr;
|
||||
if( independent &&
|
||||
(obj->isDerivedFrom(Sketcher::SketchObject::getClassTypeId()) ||
|
||||
|
@ -356,15 +357,6 @@ App::DocumentObject* TaskFeaturePick::makeCopy(App::DocumentObject* obj, std::st
|
|||
datumCopy->Shape.setValue(static_cast<Part::Datum*>(obj)->Shape.getValue());
|
||||
}
|
||||
}
|
||||
else if(obj->isDerivedFrom(Part::Part2DObject::getClassTypeId()) ||
|
||||
obj->getTypeId() == PartDesign::ShapeBinder2D::getClassTypeId()) {
|
||||
copy = App::GetApplication().getActiveDocument()->addObject("PartDesign::ShapeBinder2D", name.c_str());
|
||||
|
||||
if(!independent)
|
||||
static_cast<PartDesign::ShapeBinder2D*>(copy)->Support.setValue(obj, entity.c_str());
|
||||
else
|
||||
shapeProp = &static_cast<PartDesign::ShapeBinder*>(copy)->Shape;
|
||||
}
|
||||
else if(obj->getTypeId() == PartDesign::ShapeBinder::getClassTypeId() ||
|
||||
obj->isDerivedFrom(Part::Feature::getClassTypeId())) {
|
||||
|
||||
|
@ -387,7 +379,6 @@ App::DocumentObject* TaskFeaturePick::makeCopy(App::DocumentObject* obj, std::st
|
|||
return copy;
|
||||
}
|
||||
|
||||
|
||||
void TaskFeaturePick::onSelectionChanged(const Gui::SelectionChanges& msg)
|
||||
{
|
||||
ui->listWidget->clearSelection();
|
||||
|
|
|
@ -82,11 +82,8 @@ TaskShapeBinder::TaskShapeBinder(ViewProviderShapeBinder *view,bool newObj, QWid
|
|||
Part::Feature* obj = nullptr;
|
||||
std::vector<std::string> subs;
|
||||
|
||||
if(vp->getObject()->isDerivedFrom(PartDesign::ShapeBinder::getClassTypeId()))
|
||||
PartDesign::ShapeBinder::getFilterdReferences(&static_cast<PartDesign::ShapeBinder*>(vp->getObject())->Support, obj, subs);
|
||||
else
|
||||
PartDesign::ShapeBinder::getFilterdReferences(&static_cast<PartDesign::ShapeBinder2D*>(vp->getObject())->Support, obj, subs);
|
||||
|
||||
PartDesign::ShapeBinder::getFilterdReferences(&static_cast<PartDesign::ShapeBinder*>(vp->getObject())->Support, obj, subs);
|
||||
|
||||
if(obj)
|
||||
ui->baseEdit->setText(QString::fromUtf8(obj->getNameInDocument()));
|
||||
|
||||
|
@ -232,10 +229,7 @@ bool TaskShapeBinder::referenceSelected(const SelectionChanges& msg) const {
|
|||
Part::Feature* obj = nullptr;
|
||||
std::vector<std::string> refs;
|
||||
|
||||
if(vp->getObject()->isDerivedFrom(PartDesign::ShapeBinder::getClassTypeId()))
|
||||
PartDesign::ShapeBinder::getFilterdReferences(&static_cast<PartDesign::ShapeBinder*>(vp->getObject())->Support, obj, refs);
|
||||
else
|
||||
PartDesign::ShapeBinder::getFilterdReferences(&static_cast<PartDesign::ShapeBinder2D*>(vp->getObject())->Support, obj, refs);
|
||||
PartDesign::ShapeBinder::getFilterdReferences(&static_cast<PartDesign::ShapeBinder*>(vp->getObject())->Support, obj, refs);
|
||||
|
||||
//if we already have a object we need to ensure th new selected subref belongs to it
|
||||
if(obj && strcmp(msg.pObjectName, obj->getNameInDocument()) != 0)
|
||||
|
@ -260,11 +254,8 @@ bool TaskShapeBinder::referenceSelected(const SelectionChanges& msg) const {
|
|||
refs.clear();
|
||||
}
|
||||
|
||||
if(vp->getObject()->isDerivedFrom(PartDesign::ShapeBinder::getClassTypeId()))
|
||||
static_cast<PartDesign::ShapeBinder*>(vp->getObject())->Support.setValue(obj, refs);
|
||||
else
|
||||
static_cast<PartDesign::ShapeBinder2D*>(vp->getObject())->Support.setValue( obj, refs);
|
||||
|
||||
static_cast<PartDesign::ShapeBinder*>(vp->getObject())->Support.setValue(obj, refs);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -124,8 +124,6 @@ void ViewProviderShapeBinder::highlightReferences(const bool on, bool auxillery)
|
|||
|
||||
if(getObject()->isDerivedFrom(PartDesign::ShapeBinder::getClassTypeId()))
|
||||
PartDesign::ShapeBinder::getFilterdReferences(&static_cast<PartDesign::ShapeBinder*>(getObject())->Support, obj, subs);
|
||||
else if(getObject()->isDerivedFrom(PartDesign::ShapeBinder2D::getClassTypeId()))
|
||||
PartDesign::ShapeBinder::getFilterdReferences(&static_cast<PartDesign::ShapeBinder2D*>(getObject())->Support, obj, subs);
|
||||
else
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user