From efc01f73d21e44920950a7b420fa4cc9f8945809 Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 12 Sep 2019 14:47:57 +0300 Subject: [PATCH] Issue #3001: Fit all only to non-axillary object --- src/PartSet/PartSet_SketcherMgr.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index 6370d6c4b..9807b344c 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -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 aSPFeature = + std::dynamic_pointer_cast(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); + } + } + } } } } -- 2.39.2