X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_Tools.cpp;h=d88fd2ac20da9cfaa78d8898040c52feaee2aec7;hb=8634847ac05ce637193ec2f5234c3c8996762f94;hp=70a6138dcb8e40ebaa6a0fdea7df912795e77765;hpb=023c72db1a0c06efe73559cc2ff37c841842823a;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_Tools.cpp b/src/PartSet/PartSet_Tools.cpp index 70a6138dc..d88fd2ac2 100755 --- a/src/PartSet/PartSet_Tools.cpp +++ b/src/PartSet/PartSet_Tools.cpp @@ -386,7 +386,7 @@ void PartSet_Tools::setConstraints(CompositeFeaturePtr theSketch, FeaturePtr the std::list > anAttiributes; for (; anIt != aLast; anIt++) { FeaturePtr aFeature = std::dynamic_pointer_cast(*anIt); - if (!aFeature.get() || theFeature == aFeature) + if (!aFeature.get() || (theFeature == aFeature) || (aFeaturePoint->owner() == aFeature)) continue; std::shared_ptr aFPoint = PartSet_Tools::findFirstEqualPoint(aFeature, aClickedPoint); @@ -539,6 +539,8 @@ ResultPtr PartSet_Tools::createFixedObjectByExternal(const TopoDS_Shape& theShap FeaturePtr aFix = theSketch->addFeature(SketchPlugin_ConstraintRigid::ID()); aFix->data()->refattr(SketchPlugin_Constraint::ENTITY_A())-> setObject(aMyFeature->lastResult()); + // we need to flush created signal in order to fixed constraint is processed by solver + Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_CREATED)); //} return aMyFeature->lastResult(); } @@ -597,6 +599,8 @@ ResultPtr PartSet_Tools::createFixedObjectByExternal(const TopoDS_Shape& theShap FeaturePtr aFix = theSketch->addFeature(SketchPlugin_ConstraintRigid::ID()); aFix->data()->refattr(SketchPlugin_Constraint::ENTITY_A())-> setObject(aMyFeature->lastResult()); + // we need to flush created signal in order to fixed constraint is processed by solver + Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_CREATED)); //} return aMyFeature->lastResult(); } @@ -917,6 +921,8 @@ AttributePtr PartSet_Tools::findAttributeBy2dPoint(ObjectPtr theObj, for (; anIt != aLast && !anAttribute; anIt++) { std::shared_ptr aCurPoint = std::dynamic_pointer_cast(*anIt); + if (!aCurPoint->isInitialized()) + continue; std::shared_ptr aPnt = convertTo3D(aCurPoint->x(), aCurPoint->y(), theSketch); if (aPnt && (aPnt->distance(aValue) < Precision::Confusion())) {