PartDesign/Gui: add origin sizing and rework datums sizing

This commit is contained in:
Alexander Golubev
2015-09-08 10:45:22 +03:00
committed by Stefan Tröger
parent a3e3c78388
commit 68c78de00d
21 changed files with 308 additions and 195 deletions

View File

@@ -59,6 +59,16 @@ public:
*/
App::PropertyLink BaseFeature;
/// Returns all Model objects prepanded by BaseFeature (if any)
std::vector<App::DocumentObject *> getFullModel () {
std::vector<App::DocumentObject *> rv;
if ( BaseFeature.getValue () ) {
rv.push_back ( BaseFeature.getValue () );
}
std::copy ( Model.getValues ().begin (), Model.getValues ().end (), std::back_inserter (rv) );
return rv;
}
// These methods are located here to avoid a dependency of ViewProviderSketchObject on PartDesign
/// Remove the feature from the body
virtual void removeFeature(App::DocumentObject* feature){}

View File

@@ -102,3 +102,7 @@ TopoDS_Shape Datum::getShape() const
sh.setPlacement(Placement.getValue());
return sh._Shape;
}
Base::Vector3d Datum::getBasePoint () const {
return Placement.getValue().getPosition();
}

View File

@@ -54,6 +54,8 @@ public:
/// Return a shape including Placement representing the datum feature
TopoDS_Shape getShape() const;
/// Returns a point of the feature it counts as it's base
virtual Base::Vector3d getBasePoint () const;
protected:
void onChanged (const App::Property* prop);
void onDocumentRestored();