]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix compilation error on Linux
authorazv <azv@opencascade.com>
Tue, 26 Dec 2017 12:45:52 +0000 (15:45 +0300)
committerazv <azv@opencascade.com>
Tue, 26 Dec 2017 12:45:52 +0000 (15:45 +0300)
src/SketchPlugin/SketchPlugin_Fillet.cpp
src/SketchPlugin/SketchPlugin_Split.cpp
src/SketchPlugin/SketchPlugin_Tools.cpp
src/SketchPlugin/SketchPlugin_Tools.h
src/SketchPlugin/SketchPlugin_Trim.cpp

index 544ea99d65dbc6655d71150f48401d8273012d09..b38352be8d2a28726c086e7cd5693f337676b99b 100644 (file)
@@ -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<Length>::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());
index 7da9ca15fb04e393536d58e2369ddf0f01bbedbe..5ac4b994b0401f5f55ec99b3f8661f5cb2cab3f4 100644 (file)
@@ -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()));
index 7a3895a34e38990d561099810e75f8fe9f1b4981..d0c13c069755c25c0da3ddd7a209373cad34b87d 100644 (file)
@@ -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<ModelAPI_AttributeRefAttr>(
@@ -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<ModelAPI_AttributeRefAttr>(
@@ -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<ModelAPI_AttributeRefAttr>(
index 6653b44ff349611d4e3ad338e5f519c8a91ca490..42c2f439f217627546124d1afdd3f7dd9cdda167 100644 (file)
@@ -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
index ec57b93934eac4c2986db93b30e25b247c036657..387f3a8b4e9edaf2ccfcffc9263c3f0b0066b81d 100644 (file)
@@ -359,8 +359,9 @@ void SketchPlugin_Trim::execute()
     const std::list<ObjectPtr>& anObjects = anInfo.second;
     for (std::list<ObjectPtr>::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<GeomAPI_Pnt2d> 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<GeomAPI_Pnt2d>& 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<GeomAPI_Pnt2d>& 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()));