]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
It replaces using of direct value "SketchLine" to SKETCH_LINE_KIND, which is defined...
authornds <natalia.donis@opencascade.com>
Wed, 4 Jun 2014 09:41:17 +0000 (13:41 +0400)
committernds <natalia.donis@opencascade.com>
Wed, 4 Jun 2014 09:41:17 +0000 (13:41 +0400)
12 files changed:
src/PartSet/PartSet_OperationConstraint.cpp
src/PartSet/PartSet_OperationEditLine.cpp
src/PartSet/PartSet_OperationSketchLine.cpp
src/PartSet/PartSet_OperationSketchLine.h
src/PartSet/PartSet_Presentation.cpp
src/PartSet/PartSet_Tools.cpp
src/SketchPlugin/SketchPlugin_Line.h
src/SketchPlugin/SketchPlugin_Plugin.cpp
src/SketchPlugin/SketchPlugin_Sketch.h
src/SketchSolver/SketchSolver_Constraint.cpp
src/SketchSolver/SketchSolver_ConstraintGroup.cpp
src/SketchSolver/SketchSolver_ConstraintManager.cpp

index 76c7db50e14cd9dc66f871d1be42d761f0cdf5e9..99e167d41935684af4cd91e06a9e8c7fb7baf264 100644 (file)
@@ -63,7 +63,7 @@ void PartSet_OperationConstraint::init(boost::shared_ptr<ModelAPI_Feature> theFe
                                        const std::list<XGUI_ViewerPrs>& /*theSelected*/,
                                        const std::list<XGUI_ViewerPrs>& /*theHighlighted*/)
 {
-  //if (!theFeature || theFeature->getKind() != "SketchLine")
+  //if (!theFeature || theFeature->getKind() != SKETCH_LINE_KIND)
   //  return;
   // use the last point of the previous feature as the first of the new one
   //boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
@@ -253,7 +253,7 @@ boost::shared_ptr<ModelAPI_Feature> PartSet_OperationConstraint::createFeature(c
 
 void PartSet_OperationConstraint::setFeature(boost::shared_ptr<ModelAPI_Feature> theFeature)
 {
-  if (!theFeature || theFeature->getKind() != "SketchLine")
+  if (!theFeature || theFeature->getKind() != SKETCH_LINE_KIND)
     return;
 
   boost::shared_ptr<ModelAPI_Data> aData = feature()->data();
index 7b1a928843f83675a9bc9b45dd36e4ca11851777..7b34c8f8fd4352175a32276fca0c6d94bfaa4b8d 100644 (file)
@@ -215,7 +215,7 @@ void PartSet_OperationEditLine::moveLinePoint(boost::shared_ptr<ModelAPI_Feature
                                                double theDeltaX, double theDeltaY,
                                                const std::string& theAttribute)
 {
-  if (!theFeature || theFeature->getKind() != "SketchLine")
+  if (!theFeature || theFeature->getKind() != SKETCH_LINE_KIND)
     return;
 
   boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
index 9a971ac48fbdcb74b61d87449aea01f705ca4e46..46534645da19c882761505243ea0c81149eeb772 100644 (file)
@@ -76,7 +76,7 @@ void PartSet_OperationSketchLine::init(boost::shared_ptr<ModelAPI_Feature> theFe
                                        const std::list<XGUI_ViewerPrs>& /*theSelected*/,
                                        const std::list<XGUI_ViewerPrs>& /*theHighlighted*/)
 {
-  if (!theFeature || theFeature->getKind() != "SketchLine")
+  if (!theFeature || theFeature->getKind() != SKETCH_LINE_KIND)
     return;
   // use the last point of the previous feature as the first of the new one
   boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
@@ -364,7 +364,7 @@ void PartSet_OperationSketchLine::getLinePoint(boost::shared_ptr<ModelAPI_Featur
                                                const std::string& theAttribute,
                                                double& theX, double& theY)
 {
-  if (!theFeature || theFeature->getKind() != "SketchLine")
+  if (!theFeature || theFeature->getKind() != SKETCH_LINE_KIND)
     return;
   boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
   boost::shared_ptr<GeomDataAPI_Point2D> aPoint =
@@ -378,7 +378,7 @@ boost::shared_ptr<GeomDataAPI_Point2D> PartSet_OperationSketchLine::findLinePoin
                                                double theX, double theY)
 {
   boost::shared_ptr<GeomDataAPI_Point2D> aPoint2D;
-  if (!theFeature || theFeature->getKind() != "SketchLine")
+  if (!theFeature || theFeature->getKind() != SKETCH_LINE_KIND)
     return aPoint2D;
   boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
   
index cda1781c45b0c7289af0356d3524c8480f921ebc..9dd5dc6ccc92888000fa3b40cb30200d1dea039e 100644 (file)
@@ -8,6 +8,9 @@
 #include "PartSet.h"
 
 #include <PartSet_OperationSketchBase.h>
+
+#include <SketchPlugin_Line.h>
+
 #include <QObject>
 
 class GeomDataAPI_Point2D;
@@ -24,7 +27,7 @@ class PARTSET_EXPORT PartSet_OperationSketchLine : public PartSet_OperationSketc
 
 public:
   /// Returns the operation type key
-  static std::string Type() { return "SketchLine"; }
+  static std::string Type() { return SKETCH_LINE_KIND; }
 
 public:
   /// Constructor
index 8ec2901597db8b503eddb12ef5a54beef09bbbff..e37e869d988fe2a602c42921769e9dd979af8dec 100644 (file)
@@ -97,7 +97,7 @@ Handle(AIS_InteractiveObject) PartSet_Presentation::createSketchConstraintLength
   if (!anAttr)
     return thePrevPrs;
   boost::shared_ptr<ModelAPI_Feature> aFeature = anAttr->feature();
-  if (!aFeature || aFeature->getKind() != "SketchLine")
+  if (!aFeature || aFeature->getKind() != SKETCH_LINE_KIND)
     return thePrevPrs;
 
   aData = aFeature->data();
index b526342b6fef028c9e5000b9acc56c831dfc9777..4713f2cdaf4fb8bd475aa07434216e6b36765d36 100644 (file)
@@ -199,7 +199,7 @@ double PartSet_Tools::distanceToPoint(boost::shared_ptr<ModelAPI_Feature> theFea
                                       double theX, double theY)
 {
   double aDelta = 0;
-  if (theFeature->getKind() != "SketchLine")
+  if (theFeature->getKind() != SKETCH_LINE_KIND)
     return aDelta;
 
   boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
index 72050ac8780e0d8a8144415684002d216ca70462..b22f551b704a0acc3597540a5edb9c8b8ab398c9 100644 (file)
@@ -10,6 +10,9 @@
 #include <SketchPlugin_Sketch.h>
 #include <list>
 
+/// Line feature kind
+const std::string SKETCH_LINE_KIND("SketchLine");
+
 /// Start 2D point of the line
 const std::string LINE_ATTR_START("StartPoint");
 /// End 2D point of the line
@@ -24,7 +27,7 @@ class SketchPlugin_Line: public SketchPlugin_Feature
 public:
   /// Returns the kind of a feature
   SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
-  {static std::string MY_KIND = "SketchLine"; return MY_KIND;}
+  {static std::string MY_KIND = SKETCH_LINE_KIND; return MY_KIND;}
 
   /// Returns to which group in the document must be added feature
   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
index be1c3f581aacc784beb6593d418fadef19019a4f..a1f71d285b8e38f46fa69d79c11dded974c913ec 100644 (file)
@@ -32,7 +32,7 @@ boost::shared_ptr<ModelAPI_Feature> SketchPlugin_Plugin::createFeature(string th
   else if (theFeatureID == "SketchPoint") {
     return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_Point);
   }
-  else if (theFeatureID == "SketchLine") {
+  else if (theFeatureID == SKETCH_LINE_KIND) {
     return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_Line);
   }
   else if (theFeatureID == "SketchCircle") {
index a9a1c8fd147bb628005db126e5e5e9a10bc26d1b..b5a46830ab9d70372b8547885cc235c1f50cc721 100644 (file)
@@ -10,7 +10,7 @@
 #include <GeomAPI_Pnt.h>
 #include <list>
 
-/// All features of this sketch (list of references)
+/// Sketch feature kind
 const std::string SKETCH_KIND("Sketch");
 
 /// Origin point of the sketcher in 3D space
index 83bc31671beaec0e09b32b932946e4774d546d8f..3766ffcae6bd2512cfdafd05f3c7795f4d9f8416 100644 (file)
@@ -5,6 +5,8 @@
 #include "SketchSolver_Constraint.h"
 #include <SketchSolver_Solver.h>
 
+#include <SketchPlugin_Line.h>
+
 #include <ModelAPI_AttributeRefAttr.h>
 #include <ModelAPI_Data.h>
 
@@ -102,7 +104,7 @@ const int& SketchSolver_Constraint::getType(boost::shared_ptr<SketchPlugin_Const
           myAttributesList[aNbPoints++] = CONSTRAINT_ATTRIBUTES[indAttr];
           continue;
         }
-        else if(aKind.compare("SketchLine") == 0)
+        else if(aKind.compare(SKETCH_LINE_KIND) == 0)
         {
           // entities are placed starting from CONSTRAINT_ATTR_ENTITY_C attribute
           myAttributesList[2 + aNbEntities++] = CONSTRAINT_ATTRIBUTES[indAttr];
@@ -150,7 +152,7 @@ const int& SketchSolver_Constraint::getType(boost::shared_ptr<SketchPlugin_Const
         );
       if (!anAttr) continue;
       if (anAttr->isFeature() && anAttr->feature() &&
-          anAttr->feature()->getKind().compare("SketchLine") == 0)
+          anAttr->feature()->getKind().compare(SKETCH_LINE_KIND) == 0)
       {
         myAttributesList[aNbLines++] = CONSTRAINT_ATTRIBUTES[indAttr];
         break;
@@ -175,7 +177,7 @@ const int& SketchSolver_Constraint::getType(boost::shared_ptr<SketchPlugin_Const
         );
       if (!anAttr || !anAttr->isFeature()) continue;
       const std::string& aKind = anAttr->feature()->getKind();
-      if (aKind.compare("SketchLine") == 0)
+      if (aKind.compare(SKETCH_LINE_KIND) == 0)
       {
         myAttributesList[aNbEntities++] = CONSTRAINT_ATTRIBUTES[indAttr];
         continue;
index 1a3f1b104803a316ce5a0d29fb10e6fdfb48576d..e0e68a9ae63914327d984427d9ef72162dc6530c 100644 (file)
@@ -331,7 +331,7 @@ Slvs_hEntity SketchSolver_ConstraintGroup::changeEntity(
     const std::string& aFeatureKind = aFeature->getKind();
 
     // Line
-    if (aFeatureKind.compare("SketchLine") == 0)
+    if (aFeatureKind.compare(SKETCH_LINE_KIND) == 0)
     {
       Slvs_hEntity aStart = changeEntity(aFeature->data()->attribute(LINE_ATTR_START));
       Slvs_hEntity aEnd   = changeEntity(aFeature->data()->attribute(LINE_ATTR_END));
index 36d26d59b27fd5cae50fdfd715c8d6910b7b9f79..cf93fd73c2c6a45f4aa3042d0a469ed4f24d5ae2 100644 (file)
@@ -259,7 +259,7 @@ void SketchSolver_ConstraintManager::updateEntity(boost::shared_ptr<SketchPlugin
   if (aFeatureKind.compare("SketchPoint") == 0)
     anAttrList.push_back(POINT_ATTR_COORD);
   // Line
-  else if (aFeatureKind.compare("SketchLine") == 0)
+  else if (aFeatureKind.compare(SKETCH_LINE_KIND) == 0)
   {
     anAttrList.push_back(LINE_ATTR_START);
     anAttrList.push_back(LINE_ATTR_END);