Salome HOME
Meet the coding style (line length <= 100)
[modules/shaper.git] / src / PrimitivesAPI / PrimitivesAPI_Cylinder.cpp
index debf4b0541fe06fbb6e3364ec746ef188a5589dd..4bd696da7e8149e2cf827834b1f821338ae4f7ec 100644 (file)
@@ -10,6 +10,8 @@
 #include <ModelHighAPI_Selection.h>
 #include <ModelHighAPI_Tools.h>
 
+#include <iostream>
+
 //==================================================================================================
 PrimitivesAPI_Cylinder::PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature)
 : ModelHighAPI_Interface(theFeature)
@@ -26,6 +28,7 @@ PrimitivesAPI_Cylinder::PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Fe
 : ModelHighAPI_Interface(theFeature)
 {
   if (initialize()) {
+    fillAttribute(PrimitivesPlugin_Cylinder::CREATION_METHOD_CYLINDER(), creationMethod());
     fillAttribute(theBasePoint, basePoint());
     fillAttribute(theAxis, axis());
     setSizes(theRadius, theHeight);
@@ -42,6 +45,7 @@ PrimitivesAPI_Cylinder::PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Fe
 : ModelHighAPI_Interface(theFeature)
 {
   if (initialize()) {
+    fillAttribute(PrimitivesPlugin_Cylinder::CREATION_METHOD_CYLINDER_PORTION(), creationMethod());
     fillAttribute(theBasePoint, basePoint());
     fillAttribute(theAxis, axis());
     fillAttribute(theAngle, angle());
@@ -122,8 +126,8 @@ CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
                         const ModelHighAPI_Double& theRadius,
                         const ModelHighAPI_Double& theHeight)
 {
-  ModelHighAPI_Selection aBasePoint("VERT", "Origin");
-  ModelHighAPI_Selection anAxis("EDGE", "OZ");
+  ModelHighAPI_Selection aBasePoint("VERTEX", "PartSet/Origin");
+  ModelHighAPI_Selection anAxis("EDGE", "PartSet/OZ");
   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(PrimitivesAPI_Cylinder::ID());
   return CylinderPtr(new PrimitivesAPI_Cylinder(aFeature, aBasePoint, anAxis,
                                                 theRadius, theHeight));
@@ -135,9 +139,9 @@ CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
                         const ModelHighAPI_Double& theHeight,
                         const ModelHighAPI_Double& theAngle)
 {
-  ModelHighAPI_Selection aBasePoint("VERT", "Origin");
-  ModelHighAPI_Selection anAxis("EDGE", "OZ");
+  ModelHighAPI_Selection aBasePoint("VERTEX", "PartSet/Origin");
+  ModelHighAPI_Selection anAxis("EDGE", "PartSet/OZ");
   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(PrimitivesAPI_Cylinder::ID());
   return CylinderPtr(new PrimitivesAPI_Cylinder(aFeature, aBasePoint, anAxis,
-                                                theRadius, theHeight));
-}
\ No newline at end of file
+                                                theRadius, theHeight, theAngle));
+}