Miscellaneous fixes

This commit is contained in:
jrheinlaender 2013-05-22 20:48:03 +04:30 committed by Stefan Tröger
parent 638cfd2682
commit c4fe27d093
3 changed files with 12 additions and 9 deletions

View File

@ -333,16 +333,18 @@ Base::BoundBox3d Body::getBoundBox()
Base::BoundBox3d result;
Part::Feature* tipSolid = static_cast<Part::Feature*>(getPrevSolidFeature());
TopoDS_Shape sh = tipSolid->Shape.getValue();
if (sh.IsNull())
// This can happen when a new feature is added without having its Shape property set yet
tipSolid = static_cast<Part::Feature*>(getPrevSolidFeature(NULL, false));
if (tipSolid != NULL) {
result = tipSolid->Shape.getShape().getBoundBox();
} else {
result = App::Plane::getBoundBox();
TopoDS_Shape sh = tipSolid->Shape.getValue();
if (sh.IsNull())
// This can happen when a new feature is added without having its Shape property set yet
tipSolid = static_cast<Part::Feature*>(getPrevSolidFeature(NULL, false));
if (tipSolid != NULL) {
result = tipSolid->Shape.getShape().getBoundBox();
}
}
if (tipSolid == NULL)
result = App::Plane::getBoundBox();
std::vector<App::DocumentObject*> model = Model.getValues();
// TODO: In DatumLine and DatumPlane, recalculate the Base point to be as near as possible to the origin (0,0,0)

View File

@ -52,7 +52,7 @@ PROPERTY_SOURCE(PartDesign::Feature,Part::Feature)
Feature::Feature()
{
ADD_PROPERTY(BaseFeature,(0));
Placement.StatusBits.set(2, true);
}
short Feature::mustExecute() const

View File

@ -39,6 +39,7 @@ PROPERTY_SOURCE(PartDesign::DressUp, PartDesign::Feature)
DressUp::DressUp()
{
ADD_PROPERTY(Base,(0));
Placement.StatusBits.set(2, true);
}
short DressUp::mustExecute() const