]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Axis creation on cylindrical face stub
authorsbh <sergey.belash@opencascade.com>
Wed, 11 Mar 2015 17:26:26 +0000 (20:26 +0300)
committersbh <sergey.belash@opencascade.com>
Wed, 11 Mar 2015 17:26:26 +0000 (20:26 +0300)
src/ConstructionPlugin/ConstructionPlugin_Axis.cpp
src/ConstructionPlugin/ConstructionPlugin_Axis.h

index 7678b51a4d222bdc62d35860900183c6f9eb5f35..8e90fae27eb89033d6f4e06ed2c314117a08c096 100644 (file)
 #include <GeomAlgoAPI_EdgeBuilder.h>
 #include <GeomAlgoAPI_PointBuilder.h>
 
+#ifdef _DEBUG
+#include <iostream>
+#endif
+
 using namespace std;
 
 ConstructionPlugin_Axis::ConstructionPlugin_Axis()
@@ -34,7 +38,7 @@ void ConstructionPlugin_Axis::initAttributes()
                        ModelAPI_AttributeSelection::type());
 }
 
-void ConstructionPlugin_Axis::execute()
+void ConstructionPlugin_Axis::createAxisByTwoPoints()
 {
   AttributeSelectionPtr aRef1 = data()->selection(ConstructionPlugin_Axis::POINT_FIRST());
   AttributeSelectionPtr aRef2 = data()->selection(ConstructionPlugin_Axis::POINT_SECOND());
@@ -55,6 +59,21 @@ void ConstructionPlugin_Axis::execute()
   }
 }
 
+void ConstructionPlugin_Axis::execute()
+{
+  AttributePtr anAttr = data()->attribute(ConstructionPlugin_Axis::METHOD());
+  AttributeStringPtr aMethodTypeAttr =
+      std::dynamic_pointer_cast<ModelAPI_AttributeString>(anAttr);
+  std::string aMethodType = aMethodTypeAttr->value();
+  if (aMethodType == "AxisByPointsCase") {
+    createAxisByTwoPoints();
+  } else if (aMethodType == "AxisByCylindricalFaceCase") {
+    #ifdef _DEBUG
+    std::cout << "ConstructionPlugin_Axis::execute: " << "AxisByCylindricalFaceCase is not supported yet." << std::endl;
+    #endif
+  }
+}
+
 bool ConstructionPlugin_Axis::customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
                                                     std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs)
 {
index b92e0842c4ed9b595adc017156c5f10a1e458dfd..cbf40fce70b04a0b1861e7b42b373dda01bb0613 100644 (file)
@@ -75,6 +75,9 @@ class ConstructionPlugin_Axis : public ModelAPI_Feature, public GeomAPI_ICustomP
   /// Customize presentation of the feature
   virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
                                      std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs);
+
+ protected:
+  void createAxisByTwoPoints();
 };