From: dbv Date: Thu, 18 Feb 2016 13:18:22 +0000 (+0300) Subject: Bug #1325: Fatal error when create fillet X-Git-Tag: V_2.2.0~102 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4d94557b6a27aaf59ae51e60ebfdbff7569b3044;p=modules%2Fshaper.git Bug #1325: Fatal error when create fillet --- diff --git a/src/SketchPlugin/SketchPlugin_Validators.cpp b/src/SketchPlugin/SketchPlugin_Validators.cpp index 9b5b63cc1..4fa4856f6 100755 --- a/src/SketchPlugin/SketchPlugin_Validators.cpp +++ b/src/SketchPlugin/SketchPlugin_Validators.cpp @@ -480,6 +480,7 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut for(std::list>::const_iterator aPointsIt = aPointsList.cbegin(); aPointsIt != aPointsList.cend(); aPointsIt++) { ObjectPtr anObject = (*aPointsIt).first; AttributePtr aPointAttribute = (*aPointsIt).second; + std::shared_ptr aSelectedPnt = std::dynamic_pointer_cast(aPointAttribute)->pnt(); // If we alredy have some result then: // - if it is the same point all ok, just skip it @@ -498,7 +499,6 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut AttributePtr anArcEnd = aResultArc->attribute(SketchPlugin_Arc::END_ID()); std::shared_ptr anArcStartPnt = std::dynamic_pointer_cast(anArcStart)->pnt(); std::shared_ptr anArcEndPnt = std::dynamic_pointer_cast(anArcEnd)->pnt(); - std::shared_ptr aSelectedPnt = std::dynamic_pointer_cast(aPointAttribute)->pnt(); double aDistSelectedArcStart = aSelectedPnt->distance(anArcStartPnt); double aDistSelectedArcEnd = aSelectedPnt->distance(anArcEndPnt); if(aDistSelectedArcStart < tolerance || aDistSelectedArcEnd < tolerance) { @@ -553,10 +553,19 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut // Remove points from set of coincides. std::set aNewSetOfCoincides; for(std::set::iterator anIt = aCoinsides.begin(); anIt != aCoinsides.end(); ++anIt) { - if((*anIt)->getKind() == SketchPlugin_Line::ID() || - (*anIt)->getKind() == SketchPlugin_Arc::ID()) { - aNewSetOfCoincides.insert(*anIt); + if((*anIt)->getKind() != SketchPlugin_Line::ID() && + (*anIt)->getKind() != SketchPlugin_Arc::ID()) { + continue; } + if((*anIt)->getKind() == SketchPlugin_Arc::ID()) { + AttributePtr anArcCenter = (*anIt)->attribute(SketchPlugin_Arc::CENTER_ID()); + std::shared_ptr anArcCenterPnt = std::dynamic_pointer_cast(anArcCenter)->pnt(); + double aDistSelectedArcCenter = aSelectedPnt->distance(anArcCenterPnt); + if(aDistSelectedArcCenter < tolerance) { + continue; + } + } + aNewSetOfCoincides.insert(*anIt); } aCoinsides = aNewSetOfCoincides;