From: azv Date: Tue, 26 Dec 2017 12:45:52 +0000 (+0300) Subject: Fix compilation error on Linux X-Git-Tag: V_2.10.1~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5d4a94f71bdfac29da59f832e76825f323c4b1dd;p=modules%2Fshaper.git Fix compilation error on Linux --- diff --git a/src/SketchPlugin/SketchPlugin_Fillet.cpp b/src/SketchPlugin/SketchPlugin_Fillet.cpp index 544ea99d6..b38352be8 100644 --- a/src/SketchPlugin/SketchPlugin_Fillet.cpp +++ b/src/SketchPlugin/SketchPlugin_Fillet.cpp @@ -133,12 +133,12 @@ void SketchPlugin_Fillet::execute() FeaturePtr aConstraint; // Create coincidence features. - aConstraint = SketchPlugin_Tools::createConstraint(sketch(), + aConstraint = SketchPlugin_Tools::createConstraintAttrAttr(sketch(), SketchPlugin_ConstraintCoincidence::ID(), aFilletArc->attribute(SketchPlugin_Arc::START_ID()), myBaseFeatures[aFeatInd[0]]->attribute(myFeatAttributes[anAttrInd[0]])); ModelAPI_EventCreator::get()->sendUpdated(aConstraint, anUpdateEvent); - aConstraint = SketchPlugin_Tools::createConstraint(sketch(), + aConstraint = SketchPlugin_Tools::createConstraintAttrAttr(sketch(), SketchPlugin_ConstraintCoincidence::ID(), aFilletArc->attribute(SketchPlugin_Arc::END_ID()), myBaseFeatures[aFeatInd[1]]->attribute(myFeatAttributes[anAttrInd[1]])); @@ -146,7 +146,7 @@ void SketchPlugin_Fillet::execute() // Create tangent features. for (int i = 0; i < 2; i++) { - aConstraint = SketchPlugin_Tools::createConstraint(sketch(), + aConstraint = SketchPlugin_Tools::createConstraintObjectObject(sketch(), SketchPlugin_ConstraintTangent::ID(), aFilletArc->lastResult(), myBaseFeatures[i]->lastResult()); @@ -337,7 +337,7 @@ FeaturePtr SketchPlugin_Fillet::createFilletApex(const GeomPnt2dPtr& theCoordina static Events_ID anUpdateEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED); FeaturePtr aConstraint; for (int i = 0; i < 2; i++) { - aConstraint = SketchPlugin_Tools::createConstraint(sketch(), + aConstraint = SketchPlugin_Tools::createConstraintAttrObject(sketch(), SketchPlugin_ConstraintCoincidence::ID(), aCoord, myBaseFeatures[i]->lastResult()); @@ -438,7 +438,7 @@ void SketchPlugin_Fillet::removeReferencesButKeepDistances( FeaturePtr aConstraint; std::list::iterator anIt = aLengthToDistance.begin(); for (; anIt != aLengthToDistance.end(); ++anIt) { - aConstraint = SketchPlugin_Tools::createConstraint(sketch(), + aConstraint = SketchPlugin_Tools::createConstraintAttrAttr(sketch(), SketchPlugin_ConstraintDistance::ID(), anIt->myPoints[0], anIt->myPoints[1]); // set value AttributeDoublePtr aValue = aConstraint->real(SketchPlugin_Constraint::VALUE()); diff --git a/src/SketchPlugin/SketchPlugin_Split.cpp b/src/SketchPlugin/SketchPlugin_Split.cpp index 7da9ca15f..5ac4b994b 100644 --- a/src/SketchPlugin/SketchPlugin_Split.cpp +++ b/src/SketchPlugin/SketchPlugin_Split.cpp @@ -914,7 +914,7 @@ void SketchPlugin_Split::updateCoincidenceConstraintsToFeature( } if (aFeaturePointAttribute.get()) { // create new constraint and remove the current - aCoincFeature = SketchPlugin_Tools::createConstraint(sketch(), + aCoincFeature = SketchPlugin_Tools::createConstraintAttrAttr(sketch(), SketchPlugin_ConstraintCoincidence::ID(), aFeaturePointAttribute, aCoincFeature->refattr(aSecondAttribute)->attr()); theFeaturesToDelete.insert(aCIt->first); @@ -924,7 +924,8 @@ void SketchPlugin_Split::updateCoincidenceConstraintsToFeature( for (; aSFIt != aSFLast; aSFIt++) { AttributePoint2DPtr aSFAttribute = *aSFIt; if (aCoincPnt->isEqual(aSFAttribute->pnt())) { - SketchPlugin_Tools::createConstraint(sketch(), SketchPlugin_ConstraintCoincidence::ID(), + SketchPlugin_Tools::createConstraintAttrAttr(sketch(), + SketchPlugin_ConstraintCoincidence::ID(), aSFAttribute, aCoincFeature->refattr(aSecondAttribute)->attr()); } } @@ -1082,7 +1083,7 @@ FeaturePtr SketchPlugin_Split::splitLine(FeaturePtr& theSplitFeature, aFeature->attribute(SketchPlugin_Line::END_ID()))); anNewFeature = aFeature; } - aConstraintFeature = SketchPlugin_Tools::createConstraint(sketch(), + aConstraintFeature = SketchPlugin_Tools::createConstraintAttrAttr(sketch(), SketchPlugin_ConstraintCoincidence::ID(), theSplitFeature->attribute(SketchPlugin_Line::END_ID()), aFeature->attribute(SketchPlugin_Line::START_ID())); @@ -1112,7 +1113,7 @@ FeaturePtr SketchPlugin_Split::splitLine(FeaturePtr& theSplitFeature, fillAttribute(theBaseFeatureModified->attribute(SketchPlugin_Line::END_ID()), aFirstPointAttrOfSplit); theBaseFeatureModified->execute(); // to update result - aConstraintFeature = SketchPlugin_Tools::createConstraint(sketch(), + aConstraintFeature = SketchPlugin_Tools::createConstraintAttrAttr(sketch(), SketchPlugin_ConstraintCoincidence::ID(), theBaseFeatureModified->attribute(SketchPlugin_Line::END_ID()), theSplitFeature->attribute(SketchPlugin_Line::START_ID())); @@ -1225,7 +1226,7 @@ FeaturePtr SketchPlugin_Split::splitArc(FeaturePtr& theSplitFeature, aFeature->attribute(SketchPlugin_Arc::END_ID()))); anNewFeature = aFeature; } - aConstraintFeature = SketchPlugin_Tools::createConstraint(sketch(), + aConstraintFeature = SketchPlugin_Tools::createConstraintAttrAttr(sketch(), SketchPlugin_ConstraintCoincidence::ID(), theSplitFeature->attribute(SketchPlugin_Arc::END_ID()), aFeature->attribute(SketchPlugin_Arc::START_ID())); @@ -1255,7 +1256,7 @@ FeaturePtr SketchPlugin_Split::splitArc(FeaturePtr& theSplitFeature, fillAttribute(theBaseFeatureModified->attribute(SketchPlugin_Arc::END_ID()), aFirstPointAttrOfSplit); theBaseFeatureModified->execute(); // to update result - aConstraintFeature = SketchPlugin_Tools::createConstraint(sketch(), + aConstraintFeature = SketchPlugin_Tools::createConstraintAttrAttr(sketch(), SketchPlugin_ConstraintCoincidence::ID(), theBaseFeatureModified->attribute(SketchPlugin_Arc::END_ID()), theSplitFeature->attribute(SketchPlugin_Arc::START_ID())); @@ -1355,12 +1356,12 @@ FeaturePtr SketchPlugin_Split::splitCircle(FeaturePtr& theSplitFeature, (theBaseFeatureModified->attribute(SketchPlugin_Arc::END_ID()))); // additional constraints between split and base features - aConstraintFeature = SketchPlugin_Tools::createConstraint(sketch(), + aConstraintFeature = SketchPlugin_Tools::createConstraintAttrAttr(sketch(), SketchPlugin_ConstraintCoincidence::ID(), theBaseFeatureModified->attribute(SketchPlugin_Arc::END_ID()), theSplitFeature->attribute(SketchPlugin_Arc::END_ID())); theCreatedFeatures.insert(aConstraintFeature); - aConstraintFeature = SketchPlugin_Tools::createConstraint(sketch(), + aConstraintFeature = SketchPlugin_Tools::createConstraintAttrAttr(sketch(), SketchPlugin_ConstraintCoincidence::ID(), theBaseFeatureModified->attribute(SketchPlugin_Arc::START_ID()), theSplitFeature->attribute(SketchPlugin_Arc::START_ID())); diff --git a/src/SketchPlugin/SketchPlugin_Tools.cpp b/src/SketchPlugin/SketchPlugin_Tools.cpp index 7a3895a34..d0c13c069 100644 --- a/src/SketchPlugin/SketchPlugin_Tools.cpp +++ b/src/SketchPlugin/SketchPlugin_Tools.cpp @@ -318,10 +318,10 @@ void convertRefAttrToPointOrTangentCurve(const AttributeRefAttrPtr& theRefA } -FeaturePtr createConstraint(SketchPlugin_Sketch* theSketch, - const std::string& theConstraintId, - const AttributePtr& theFirstAttribute, - const AttributePtr& theSecondAttribute) +FeaturePtr createConstraintAttrAttr(SketchPlugin_Sketch* theSketch, + const std::string& theConstraintId, + const AttributePtr& theFirstAttribute, + const AttributePtr& theSecondAttribute) { FeaturePtr aConstraint = theSketch->addFeature(theConstraintId); AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast( @@ -342,10 +342,10 @@ FeaturePtr createConstraint(SketchPlugin_Sketch* theSketch, return aConstraint; } -FeaturePtr createConstraint(SketchPlugin_Sketch* theSketch, - const std::string& theConstraintId, - const AttributePtr& theFirstAttribute, - const ObjectPtr& theSecondObject) +FeaturePtr createConstraintAttrObject(SketchPlugin_Sketch* theSketch, + const std::string& theConstraintId, + const AttributePtr& theFirstAttribute, + const ObjectPtr& theSecondObject) { FeaturePtr aConstraint = theSketch->addFeature(theConstraintId); AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast( @@ -366,10 +366,10 @@ FeaturePtr createConstraint(SketchPlugin_Sketch* theSketch, return aConstraint; } -FeaturePtr createConstraint(SketchPlugin_Sketch* theSketch, - const std::string& theConstraintId, - const ObjectPtr& theFirstObject, - const ObjectPtr& theSecondObject) +FeaturePtr createConstraintObjectObject(SketchPlugin_Sketch* theSketch, + const std::string& theConstraintId, + const ObjectPtr& theFirstObject, + const ObjectPtr& theSecondObject) { FeaturePtr aConstraint = theSketch->addFeature(theConstraintId); AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast( diff --git a/src/SketchPlugin/SketchPlugin_Tools.h b/src/SketchPlugin/SketchPlugin_Tools.h index 6653b44ff..42c2f439f 100644 --- a/src/SketchPlugin/SketchPlugin_Tools.h +++ b/src/SketchPlugin/SketchPlugin_Tools.h @@ -66,30 +66,30 @@ void resetAttribute(SketchPlugin_Feature* theFeature, const std::string& theId); /// \param[in] theConstraintId a constraint identifier /// \param[in] theFirstAttribute an attribute of further constraint /// \param[in] theSecondAttribute an attribute of further constraint -FeaturePtr createConstraint(SketchPlugin_Sketch* theSketch, - const std::string& theConstraintId, - const AttributePtr& theFirstAttribute, - const AttributePtr& theSecondAttribute); +FeaturePtr createConstraintAttrAttr(SketchPlugin_Sketch* theSketch, + const std::string& theConstraintId, + const AttributePtr& theFirstAttribute, + const AttributePtr& theSecondAttribute); /// Create new constraint between given attribute and object /// \param[in] theSketch a sketch where the constraint will be created /// \param[in] theConstraintId a constraint identifier /// \param[in] theFirstAttribute an attribute of further constraint /// \param[in] theSecondObject an attribute of further constraint -FeaturePtr createConstraint(SketchPlugin_Sketch* theSketch, - const std::string& theConstraintId, - const AttributePtr& theFirstAttribute, - const ObjectPtr& theSecondObject); +FeaturePtr createConstraintAttrObject(SketchPlugin_Sketch* theSketch, + const std::string& theConstraintId, + const AttributePtr& theFirstAttribute, + const ObjectPtr& theSecondObject); /// Create new constraint between given objects /// \param[in] theSketch a sketch where the constraint will be created /// \param[in] theConstraintId a constraint identifier /// \param[in] theFirstObject an attribute of further constraint /// \param[in] theSecondObject an attribute of further constraint -FeaturePtr createConstraint(SketchPlugin_Sketch* theSketch, - const std::string& theConstraintId, - const ObjectPtr& theFirstObject, - const ObjectPtr& theSecondObject); +FeaturePtr createConstraintObjectObject(SketchPlugin_Sketch* theSketch, + const std::string& theConstraintId, + const ObjectPtr& theFirstObject, + const ObjectPtr& theSecondObject); /// Creates coincidence or tangent constraint. /// \param[in] theFeature to get selected attribute or object diff --git a/src/SketchPlugin/SketchPlugin_Trim.cpp b/src/SketchPlugin/SketchPlugin_Trim.cpp index ec57b9393..387f3a8b4 100644 --- a/src/SketchPlugin/SketchPlugin_Trim.cpp +++ b/src/SketchPlugin/SketchPlugin_Trim.cpp @@ -359,8 +359,9 @@ void SketchPlugin_Trim::execute() const std::list& anObjects = anInfo.second; for (std::list::const_iterator anObjectIt = anObjects.begin(); anObjectIt != anObjects.end(); anObjectIt++) { - SketchPlugin_Tools::createConstraint(sketch(), SketchPlugin_ConstraintCoincidence::ID(), - aPointAttribute, *anObjectIt); + SketchPlugin_Tools::createConstraintAttrObject(sketch(), + SketchPlugin_ConstraintCoincidence::ID(), + aPointAttribute, *anObjectIt); } } @@ -550,8 +551,9 @@ bool SketchPlugin_Trim::setCoincidenceToAttribute(const AttributePtr& theAttribu std::shared_ptr aPoint2d = aPointAttribute->pnt(); if (aPoint2d->isEqual(aRefPnt2d)) { // create new coincidence and then remove the old one - SketchPlugin_Tools::createConstraint(sketch(), SketchPlugin_ConstraintCoincidence::ID(), - aRefPointAttr, aPointAttribute); + SketchPlugin_Tools::createConstraintAttrAttr(sketch(), + SketchPlugin_ConstraintCoincidence::ID(), + aRefPointAttr, aPointAttribute); theFeaturesToDelete.insert(aFeature); } } @@ -962,7 +964,8 @@ FeaturePtr SketchPlugin_Trim::trimLine(const std::shared_ptr& the (aBaseFeature->attribute(aModifiedAttribute))); // Collinear constraint for lines - SketchPlugin_Tools::createConstraint(sketch(), SketchPlugin_ConstraintCollinear::ID(), + SketchPlugin_Tools::createConstraintObjectObject(sketch(), + SketchPlugin_ConstraintCollinear::ID(), getFeatureResult(aBaseFeature), getFeatureResult(anNewFeature)); } @@ -1046,11 +1049,13 @@ FeaturePtr SketchPlugin_Trim::trimArc(const std::shared_ptr& theS (aBaseFeature->attribute(aModifiedAttribute))); // equal Radius constraint for arcs - SketchPlugin_Tools::createConstraint(sketch(), SketchPlugin_ConstraintEqual::ID(), + SketchPlugin_Tools::createConstraintObjectObject(sketch(), + SketchPlugin_ConstraintEqual::ID(), getFeatureResult(aBaseFeature), getFeatureResult(anNewFeature)); // coincident centers constraint - SketchPlugin_Tools::createConstraint(sketch(), SketchPlugin_ConstraintCoincidence::ID(), + SketchPlugin_Tools::createConstraintAttrAttr(sketch(), + SketchPlugin_ConstraintCoincidence::ID(), aBaseFeature->attribute(SketchPlugin_Arc::CENTER_ID()), anNewFeature->attribute(SketchPlugin_Arc::CENTER_ID()));