From c4fe27d0933f0a415a098508bf4921fff6fde636 Mon Sep 17 00:00:00 2001 From: jrheinlaender Date: Wed, 22 May 2013 20:48:03 +0430 Subject: [PATCH] Miscellaneous fixes --- src/Mod/PartDesign/App/Body.cpp | 18 ++++++++++-------- src/Mod/PartDesign/App/Feature.cpp | 2 +- src/Mod/PartDesign/App/FeatureDressUp.cpp | 1 + 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/Mod/PartDesign/App/Body.cpp b/src/Mod/PartDesign/App/Body.cpp index a31379f3a..8f7740750 100644 --- a/src/Mod/PartDesign/App/Body.cpp +++ b/src/Mod/PartDesign/App/Body.cpp @@ -333,16 +333,18 @@ Base::BoundBox3d Body::getBoundBox() Base::BoundBox3d result; Part::Feature* tipSolid = static_cast(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(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(getPrevSolidFeature(NULL, false)); + + if (tipSolid != NULL) { + result = tipSolid->Shape.getShape().getBoundBox(); + } } + if (tipSolid == NULL) + result = App::Plane::getBoundBox(); std::vector model = Model.getValues(); // TODO: In DatumLine and DatumPlane, recalculate the Base point to be as near as possible to the origin (0,0,0) diff --git a/src/Mod/PartDesign/App/Feature.cpp b/src/Mod/PartDesign/App/Feature.cpp index 2b56be6fb..1e091b4ab 100644 --- a/src/Mod/PartDesign/App/Feature.cpp +++ b/src/Mod/PartDesign/App/Feature.cpp @@ -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 diff --git a/src/Mod/PartDesign/App/FeatureDressUp.cpp b/src/Mod/PartDesign/App/FeatureDressUp.cpp index b6f92218f..8d8a42a64 100644 --- a/src/Mod/PartDesign/App/FeatureDressUp.cpp +++ b/src/Mod/PartDesign/App/FeatureDressUp.cpp @@ -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