Salome HOME
Fixed features creation from CPP High API
authordbv <dbv@opencascade.com>
Tue, 14 Jun 2016 14:22:29 +0000 (17:22 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Fri, 17 Jun 2016 11:41:08 +0000 (14:41 +0300)
src/FeaturesAPI/FeaturesAPI_Boolean.cpp
src/FeaturesAPI/FeaturesAPI_Extrusion.cpp
src/PythonAPI/examples/MakeBrick1.py

index 6f68890cfaab05cf5a2222c0f0b734cc0c46477f..128b9abfcff9ddc064639428ef86689cf16ecc3a 100644 (file)
@@ -25,9 +25,11 @@ FeaturesAPI_Boolean::FeaturesAPI_Boolean(const std::shared_ptr<ModelAPI_Feature>
 : ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
-    setBoolType(theBoolType);
-    setMainObjects(theMainObjects);
-    setToolObjects(theToolObjects);
+    fillAttribute(theBoolType, myboolType);
+    fillAttribute(theMainObjects, mymainObjects);
+    fillAttribute(theToolObjects, mytoolObjects);
+
+    execute();
   }
 }
 
index da6f0cf3e38e971925176c809a9a433f4f29b036..8bb243a0224572348d5be1ef9d2a2c08ff355516 100644 (file)
@@ -23,8 +23,8 @@ FeaturesAPI_Extrusion::FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feat
 : ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
-    setBase(theBaseObjects);
-    setSize(theSize);
+    fillAttribute(theBaseObjects, mybaseObjects);
+    setSizes(theSize, ModelHighAPI_Double());
   }
 }
 
@@ -36,9 +36,9 @@ FeaturesAPI_Extrusion::FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feat
 : ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
-    setBase(theBaseObjects);
-    setDirection(theDirection);
-    setSize(theSize);
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theDirection, mydirection);
+    setSizes(theSize, ModelHighAPI_Double());
   }
 }
 
@@ -50,7 +50,7 @@ FeaturesAPI_Extrusion::FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feat
 : ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
-    setBase(theBaseObjects);
+    fillAttribute(theBaseObjects, mybaseObjects);
     setSizes(theToSize, theFromSize);
   }
 }
@@ -64,8 +64,8 @@ FeaturesAPI_Extrusion::FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feat
 : ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
-    setBase(theBaseObjects);
-    setDirection(theDirection);
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theDirection, mydirection);
     setSizes(theToSize, theFromSize);
   }
 }
@@ -80,7 +80,7 @@ FeaturesAPI_Extrusion::FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feat
 : ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
-    setBase(theBaseObjects);
+    fillAttribute(theBaseObjects, mybaseObjects);
     setPlanesAndOffsets(theToObject, theToOffset, theFromObject, theFromOffset);
   }
 }
@@ -96,8 +96,8 @@ FeaturesAPI_Extrusion::FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feat
 : ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
-    setBase(theBaseObjects);
-    setDirection(theDirection);
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theDirection, mydirection);
     setPlanesAndOffsets(theToObject, theToOffset, theFromObject, theFromOffset);
   }
 }
index 4efed0b1508de9d7a315805b86454cafb367b963..07a2629ec354479730f9eea4a9499992e138625f 100644 (file)
@@ -56,6 +56,8 @@ c1 = mystand.addCircle(0, 25, 5)
 mystand.setDistance(c1.center(), mystand.addLine(thisxmin), 10)
 mystand.setDistance(c1.center(), mystand.addLine(thiszmax), 10)
 
+mystand.execute()
+
 myboss = model.addExtrusion(mypart, mystand.selectFace(), -5)
 
 # Subtracting the cylinder to the box