]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #3001: Fit all only to non-axillary object
authorvsv <vsv@opencascade.com>
Thu, 12 Sep 2019 11:47:57 +0000 (14:47 +0300)
committervsv <vsv@opencascade.com>
Thu, 12 Sep 2019 11:48:20 +0000 (14:48 +0300)
src/PartSet/PartSet_SketcherMgr.cpp

index 6370d6c4bd976fb82770875185eb1376d2ec69da..9807b344cce755545b598ce0a8ba7f5575dd112d 100644 (file)
@@ -2121,11 +2121,22 @@ void PartSet_Fitter::fitAll(Handle(V3d_View) theView)
     for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) {
       aRes = (*aIt);
       if (aRes->isDisplayed()) {
-        GeomShapePtr aShape = aRes->shape();
-        aShape->computeSize(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
-        Bnd_Box aBox;
-        aBox.Update(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
-        aBndBox.Add(aBox);
+        FeaturePtr aFeature = ModelAPI_Feature::feature(aRes);
+        if (aFeature.get()) {
+          std::shared_ptr<SketchPlugin_SketchEntity> aSPFeature =
+            std::dynamic_pointer_cast<SketchPlugin_SketchEntity>(aFeature);
+          if (aSPFeature.get()) {
+            bool isAxiliary =
+              aSPFeature->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value();
+            if (!(aSPFeature->isExternal() || isAxiliary)) {
+              GeomShapePtr aShape = aRes->shape();
+              aShape->computeSize(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
+              Bnd_Box aBox;
+              aBox.Update(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
+              aBndBox.Add(aBox);
+            }
+          }
+        }
       }
     }
   }