Salome HOME
Added CPP High API for FeaturesPlugin_ExtrusionCut, FeaturesPlugin_ExtrusionFuse
authordbv <dbv@opencascade.com>
Thu, 16 Jun 2016 11:11:21 +0000 (14:11 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Fri, 17 Jun 2016 11:41:11 +0000 (14:41 +0300)
src/FeaturesAPI/CMakeLists.txt
src/FeaturesAPI/FeaturesAPI.i
src/FeaturesAPI/FeaturesAPI_Extrusion.h
src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp [new file with mode: 0644]
src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.h [new file with mode: 0644]
src/FeaturesAPI/FeaturesAPI_Revolution.h
src/FeaturesAPI/FeaturesAPI_swig.h
src/ModelHighAPI/ModelHighAPI_Interface.h
src/ModelHighAPI/ModelHighAPI_Macro.h
src/PythonAPI/Test/TestFeatures.py
src/PythonAPI/model/features/__init__.py

index ec14e58dedc64752e63b880cc042676cb2006185..519f4e755486bdf4d08ecba9a4e00c8ba1fb8dc1 100644 (file)
@@ -6,6 +6,7 @@ SET(PROJECT_HEADERS
   FeaturesAPI.h
   FeaturesAPI_Boolean.h
   FeaturesAPI_Extrusion.h
+  FeaturesAPI_ExtrusionBoolean.h
   FeaturesAPI_Group.h
   FeaturesAPI_Placement.h
   FeaturesAPI_Revolution.h
@@ -16,6 +17,7 @@ SET(PROJECT_HEADERS
 SET(PROJECT_SOURCES
   FeaturesAPI_Boolean.cpp
   FeaturesAPI_Extrusion.cpp
+  FeaturesAPI_ExtrusionBoolean.cpp
   FeaturesAPI_Group.cpp
   FeaturesAPI_Placement.cpp
   FeaturesAPI_Rotation.cpp
index 6fc57716fd79e943cbbe8b6f59815f823a58d619..55094b61d90dbda03c7027bcfb59eb7bca9fe477 100644 (file)
@@ -21,6 +21,9 @@
 // shared pointers
 %shared_ptr(FeaturesAPI_Boolean)
 %shared_ptr(FeaturesAPI_Extrusion)
+%shared_ptr(FeaturesAPI_ExtrusionBoolean)
+%shared_ptr(FeaturesAPI_ExtrusionCut)
+%shared_ptr(FeaturesAPI_ExtrusionFuse)
 %shared_ptr(FeaturesAPI_Group)
 %shared_ptr(FeaturesAPI_Placement)
 %shared_ptr(FeaturesAPI_Revolution)
@@ -30,6 +33,7 @@
 // all supported interfaces
 %include "FeaturesAPI_Boolean.h"
 %include "FeaturesAPI_Extrusion.h"
+%include "FeaturesAPI_ExtrusionBoolean.h"
 %include "FeaturesAPI_Group.h"
 %include "FeaturesAPI_Placement.h"
 %include "FeaturesAPI_Revolution.h"
index 3f271e7d592683b61ad69edcefb02688c44334b3..2c569802f942c7a48db6e82bd913c0b68c0d8a65 100644 (file)
@@ -78,7 +78,7 @@ public:
   virtual ~FeaturesAPI_Extrusion();
 
   INTERFACE_10(FeaturesPlugin_Extrusion::ID(),
-               baseObjects, FeaturesPlugin_CompositeSketch::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
+               baseObjects, FeaturesPlugin_Extrusion::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
                creationMethod, FeaturesPlugin_Extrusion::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
                toSize, FeaturesPlugin_Extrusion::TO_SIZE_ID(), ModelAPI_AttributeDouble, /** To size */,
                fromSize, FeaturesPlugin_Extrusion::FROM_SIZE_ID(), ModelAPI_AttributeDouble, /** From size */,
@@ -87,7 +87,7 @@ public:
                fromObject, FeaturesPlugin_Extrusion::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */,
                fromOffset, FeaturesPlugin_Extrusion::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */,
                direction, FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID(), ModelAPI_AttributeSelection, /** Direction */,
-               sketchLauncher, FeaturesPlugin_CompositeSketch::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */)
+               sketchLauncher, FeaturesPlugin_Extrusion::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */)
 
   /// Modify base attribute of the feature.
   FEATURESAPI_EXPORT
diff --git a/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp b/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp
new file mode 100644 (file)
index 0000000..b645e73
--- /dev/null
@@ -0,0 +1,492 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File:        FeaturesAPI_Extrusion.cpp
+// Created:     09 June 2016
+// Author:      Dmitry Bobylev
+
+#include "FeaturesAPI_ExtrusionBoolean.h"
+
+#include <ModelHighAPI_Double.h>
+#include <ModelHighAPI_Tools.h>
+
+//==================================================================================================
+FeaturesAPI_ExtrusionBoolean::FeaturesAPI_ExtrusionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: ModelHighAPI_Interface(theFeature)
+{
+}
+
+//==================================================================================================
+FeaturesAPI_ExtrusionBoolean::~FeaturesAPI_ExtrusionBoolean()
+{
+}
+
+//==================================================================================================
+void FeaturesAPI_ExtrusionBoolean::setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects)
+{
+  fillAttribute(theBaseObjects, mybaseObjects);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_ExtrusionBoolean::setDirection(const ModelHighAPI_Selection& theDirection)
+{
+  fillAttribute(theDirection, mydirection);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_ExtrusionBoolean::setSizes(const ModelHighAPI_Double& theToSize,
+                                            const ModelHighAPI_Double& theFromSize)
+{
+  fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
+  fillAttribute(theToSize, mytoSize);
+  fillAttribute(theFromSize, myfromSize);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_ExtrusionBoolean::setSize(const ModelHighAPI_Double& theSize)
+{
+  fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
+  fillAttribute(theSize, mytoSize);
+  fillAttribute(ModelHighAPI_Double(), myfromSize);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_ExtrusionBoolean::setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
+                                                       const ModelHighAPI_Double& theToOffset,
+                                                       const ModelHighAPI_Selection& theFromObject,
+                                                       const ModelHighAPI_Double& theFromOffset)
+{
+  fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_PLANES(), mycreationMethod);
+  fillAttribute(theToObject, mytoObject);
+  fillAttribute(theToOffset, mytoOffset);
+  fillAttribute(theFromObject, myfromObject);
+  fillAttribute(theFromOffset, myfromOffset);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_ExtrusionBoolean::setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  fillAttribute(theBooleanObjects, mybooleanObjects);
+
+  execute();
+}
+
+//==================================================================================================
+FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: FeaturesAPI_ExtrusionBoolean(theFeature)
+{
+  initialize();
+}
+
+//==================================================================================================
+FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                                   const ModelHighAPI_Double& theSize,
+                                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_ExtrusionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theSize, mytoSize);
+    fillAttribute(ModelHighAPI_Double(), myfromSize);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                                   const ModelHighAPI_Selection& theDirection,
+                                                   const ModelHighAPI_Double& theSize,
+                                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_ExtrusionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theDirection, mydirection);
+    fillAttribute(theSize, mytoSize);
+    fillAttribute(ModelHighAPI_Double(), myfromSize);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                                   const ModelHighAPI_Double& theToSize,
+                                                   const ModelHighAPI_Double& theFromSize,
+                                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_ExtrusionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theToSize, mytoSize);
+    fillAttribute(theFromSize, myfromSize);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                                   const ModelHighAPI_Selection& theDirection,
+                                                   const ModelHighAPI_Double& theToSize,
+                                                   const ModelHighAPI_Double& theFromSize,
+                                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_ExtrusionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theDirection, mydirection);
+    fillAttribute(theToSize, mytoSize);
+    fillAttribute(theFromSize, myfromSize);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                                   const ModelHighAPI_Selection& theToObject,
+                                                   const ModelHighAPI_Double& theToOffset,
+                                                   const ModelHighAPI_Selection& theFromObject,
+                                                   const ModelHighAPI_Double& theFromOffset,
+                                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_ExtrusionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theToObject, mytoObject);
+    fillAttribute(theToOffset, mytoOffset);
+    fillAttribute(theFromObject, myfromObject);
+    fillAttribute(theFromOffset, myfromOffset);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                                   const ModelHighAPI_Selection& theDirection,
+                                                   const ModelHighAPI_Selection& theToObject,
+                                                   const ModelHighAPI_Double& theToOffset,
+                                                   const ModelHighAPI_Selection& theFromObject,
+                                                   const ModelHighAPI_Double& theFromOffset,
+                                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_ExtrusionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theDirection, mydirection);
+    fillAttribute(theToObject, mytoObject);
+    fillAttribute(theToOffset, mytoOffset);
+    fillAttribute(theFromObject, myfromObject);
+    fillAttribute(theFromOffset, myfromOffset);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
+// TODO(spo): make add* as static functions of the class
+//==================================================================================================
+ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                const ModelHighAPI_Double& theSize,
+                                const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
+  return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theSize, theBooleanObjects));
+}
+
+//==================================================================================================
+ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                const ModelHighAPI_Selection& theDirection,
+                                const ModelHighAPI_Double& theSize,
+                                const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
+  return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theDirection, theSize, theBooleanObjects));
+}
+
+//==================================================================================================
+ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                const ModelHighAPI_Double& theToSize,
+                                const ModelHighAPI_Double& theFromSize,
+                                const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
+  return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theToSize, theFromSize, theBooleanObjects));
+}
+
+//==================================================================================================
+ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                const ModelHighAPI_Selection& theDirection,
+                                const ModelHighAPI_Double& theToSize,
+                                const ModelHighAPI_Double& theFromSize,
+                                const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
+  return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature,
+                                                      theBaseObjects,
+                                                      theDirection,
+                                                      theToSize,
+                                                      theFromSize,
+                                                      theBooleanObjects));
+}
+
+//==================================================================================================
+ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                const ModelHighAPI_Selection& theToObject,
+                                const ModelHighAPI_Double& theToOffset,
+                                const ModelHighAPI_Selection& theFromObject,
+                                const ModelHighAPI_Double& theFromOffset,
+                                const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
+  return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature,
+                                                      theBaseObjects,
+                                                      theToObject,
+                                                      theToOffset,
+                                                      theFromObject,
+                                                      theFromOffset,
+                                                      theBooleanObjects));
+}
+
+//==================================================================================================
+ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                const ModelHighAPI_Selection& theDirection,
+                                const ModelHighAPI_Selection& theToObject,
+                                const ModelHighAPI_Double& theToOffset,
+                                const ModelHighAPI_Selection& theFromObject,
+                                const ModelHighAPI_Double& theFromOffset,
+                                const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
+  return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature,
+                                                      theBaseObjects,
+                                                      theDirection,
+                                                      theToObject,
+                                                      theToOffset,
+                                                      theFromObject,
+                                                      theFromOffset,
+                                                      theBooleanObjects));
+}
+
+
+//==================================================================================================
+FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: FeaturesAPI_ExtrusionBoolean(theFeature)
+{
+  initialize();
+}
+
+//==================================================================================================
+FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                                     const ModelHighAPI_Double& theSize,
+                                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_ExtrusionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theSize, mytoSize);
+    fillAttribute(ModelHighAPI_Double(), myfromSize);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                                     const ModelHighAPI_Selection& theDirection,
+                                                     const ModelHighAPI_Double& theSize,
+                                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_ExtrusionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theDirection, mydirection);
+    fillAttribute(theSize, mytoSize);
+    fillAttribute(ModelHighAPI_Double(), myfromSize);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                                     const ModelHighAPI_Double& theToSize,
+                                                     const ModelHighAPI_Double& theFromSize,
+                                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_ExtrusionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theToSize, mytoSize);
+    fillAttribute(theFromSize, myfromSize);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                                     const ModelHighAPI_Selection& theDirection,
+                                                     const ModelHighAPI_Double& theToSize,
+                                                     const ModelHighAPI_Double& theFromSize,
+                                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_ExtrusionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theDirection, mydirection);
+    fillAttribute(theToSize, mytoSize);
+    fillAttribute(theFromSize, myfromSize);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                                     const ModelHighAPI_Selection& theToObject,
+                                                     const ModelHighAPI_Double& theToOffset,
+                                                     const ModelHighAPI_Selection& theFromObject,
+                                                     const ModelHighAPI_Double& theFromOffset,
+                                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_ExtrusionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theToObject, mytoObject);
+    fillAttribute(theToOffset, mytoOffset);
+    fillAttribute(theFromObject, myfromObject);
+    fillAttribute(theFromOffset, myfromOffset);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                                     const ModelHighAPI_Selection& theDirection,
+                                                     const ModelHighAPI_Selection& theToObject,
+                                                     const ModelHighAPI_Double& theToOffset,
+                                                     const ModelHighAPI_Selection& theFromObject,
+                                                     const ModelHighAPI_Double& theFromOffset,
+                                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_ExtrusionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theDirection, mydirection);
+    fillAttribute(theToObject, mytoObject);
+    fillAttribute(theToOffset, mytoOffset);
+    fillAttribute(theFromObject, myfromObject);
+    fillAttribute(theFromOffset, myfromOffset);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
+// TODO(spo): make add* as static functions of the class
+//==================================================================================================
+ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Double& theSize,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
+  return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, theSize, theBooleanObjects));
+}
+
+//==================================================================================================
+ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Selection& theDirection,
+                                  const ModelHighAPI_Double& theSize,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
+  return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, theDirection, theSize, theBooleanObjects));
+}
+
+//==================================================================================================
+ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Double& theToSize,
+                                  const ModelHighAPI_Double& theFromSize,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
+  return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, theToSize, theFromSize, theBooleanObjects));
+}
+
+//==================================================================================================
+ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Selection& theDirection,
+                                  const ModelHighAPI_Double& theToSize,
+                                  const ModelHighAPI_Double& theFromSize,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
+  return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature,
+                                                        theBaseObjects,
+                                                        theDirection,
+                                                        theToSize,
+                                                        theFromSize,
+                                                        theBooleanObjects));
+}
+
+//==================================================================================================
+ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Selection& theToObject,
+                                  const ModelHighAPI_Double& theToOffset,
+                                  const ModelHighAPI_Selection& theFromObject,
+                                  const ModelHighAPI_Double& theFromOffset,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
+  return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature,
+                                                        theBaseObjects,
+                                                        theToObject,
+                                                        theToOffset,
+                                                        theFromObject,
+                                                        theFromOffset,
+                                                        theBooleanObjects));
+}
+
+//==================================================================================================
+ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Selection& theDirection,
+                                  const ModelHighAPI_Selection& theToObject,
+                                  const ModelHighAPI_Double& theToOffset,
+                                  const ModelHighAPI_Selection& theFromObject,
+                                  const ModelHighAPI_Double& theFromOffset,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
+  return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature,
+                                                        theBaseObjects,
+                                                        theDirection,
+                                                        theToObject,
+                                                        theToOffset,
+                                                        theFromObject,
+                                                        theFromOffset,
+                                                        theBooleanObjects));
+}
diff --git a/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.h b/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.h
new file mode 100644 (file)
index 0000000..390a955
--- /dev/null
@@ -0,0 +1,334 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File:        FeaturesAPI_ExtrusionBoolean.h
+// Created:     09 June 2016
+// Author:      Dmitry Bobylev
+
+#ifndef FeaturesAPI_ExtrusionBoolean_H_
+#define FeaturesAPI_ExtrusionBoolean_H_
+
+#include "FeaturesAPI.h"
+
+#include <FeaturesPlugin_CompositeBoolean.h>
+#include <FeaturesPlugin_ExtrusionCut.h>
+#include <FeaturesPlugin_ExtrusionFuse.h>
+
+#include <ModelHighAPI_Interface.h>
+#include <ModelHighAPI_Macro.h>
+
+class ModelHighAPI_Double;
+class ModelHighAPI_Selection;
+
+/// \class FeaturesAPI_ExtrusionBoolean
+/// \ingroup CPPHighAPI
+/// \brief Interface for ExtrusionBoolean feature.
+class FeaturesAPI_ExtrusionBoolean: public ModelHighAPI_Interface
+{
+public:
+  /// Destructor.
+  FEATURESAPI_EXPORT
+  virtual ~FeaturesAPI_ExtrusionBoolean();
+
+  INTERFACE_11("",
+               sketchLauncher, FeaturesPlugin_Extrusion::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */,
+               baseObjects, FeaturesPlugin_Extrusion::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
+               direction, FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID(), ModelAPI_AttributeSelection, /** Direction */,
+               creationMethod, FeaturesPlugin_Extrusion::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
+               toSize, FeaturesPlugin_Extrusion::TO_SIZE_ID(), ModelAPI_AttributeDouble, /** To size */,
+               fromSize, FeaturesPlugin_Extrusion::FROM_SIZE_ID(), ModelAPI_AttributeDouble, /** From size */,
+               toObject, FeaturesPlugin_Extrusion::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */,
+               toOffset, FeaturesPlugin_Extrusion::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */,
+               fromObject, FeaturesPlugin_Extrusion::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */,
+               fromOffset, FeaturesPlugin_Extrusion::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */,
+               booleanObjects, FeaturesPlugin_CompositeBoolean::OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Boolean objects */)
+
+  /// Modify base attribute of the feature.
+  FEATURESAPI_EXPORT
+  void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
+
+  /// Modify direction_object attribute of the feature.
+  FEATURESAPI_EXPORT
+  void setDirection(const ModelHighAPI_Selection& theDirection);
+
+  /// Modify CreationMethod, to_size, from_size attributes of the feature.
+  FEATURESAPI_EXPORT
+  void setSizes(const ModelHighAPI_Double& theToSize, const ModelHighAPI_Double& theFromSize);
+
+  /// Modify creation_method, to_size, from_size attributes of the feature.
+  FEATURESAPI_EXPORT
+  void setSize(const ModelHighAPI_Double& theSize);
+
+  /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature.
+  FEATURESAPI_EXPORT
+  void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
+                           const ModelHighAPI_Double& theToOffset,
+                           const ModelHighAPI_Selection& theFromObject,
+                           const ModelHighAPI_Double& theFromOffset);
+
+  /// Modiyfy main_objects attribute of the feature.
+  FEATURESAPI_EXPORT
+  void setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+protected:
+  /// Constructor without values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_ExtrusionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+};
+
+class FeaturesAPI_ExtrusionCut: public FeaturesAPI_ExtrusionBoolean
+{
+public:
+  FEATURESAPI_EXPORT
+  virtual std::string getID() {
+    return FeaturesPlugin_ExtrusionCut::ID();
+  }
+
+  /// Constructor without values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                    const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                    const ModelHighAPI_Double& theSize,
+                                    const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                    const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                    const ModelHighAPI_Selection& theDirection,
+                                    const ModelHighAPI_Double& theSize,
+                                    const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                    const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                    const ModelHighAPI_Double& theToSize,
+                                    const ModelHighAPI_Double& theFromSize,
+                                    const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                    const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                    const ModelHighAPI_Selection& theDirection,
+                                    const ModelHighAPI_Double& theToSize,
+                                    const ModelHighAPI_Double& theFromSize,
+                                    const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                    const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                    const ModelHighAPI_Selection& theToObject,
+                                    const ModelHighAPI_Double& theToOffset,
+                                    const ModelHighAPI_Selection& theFromObject,
+                                    const ModelHighAPI_Double& theFromOffset,
+                                    const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                    const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                    const ModelHighAPI_Selection& theDirection,
+                                    const ModelHighAPI_Selection& theToObject,
+                                    const ModelHighAPI_Double& theToOffset,
+                                    const ModelHighAPI_Selection& theFromObject,
+                                    const ModelHighAPI_Double& theFromOffset,
+                                    const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+};
+
+/// Pointer on ExtrusionCut object.
+typedef std::shared_ptr<FeaturesAPI_ExtrusionCut> ExtrusionCutPtr;
+
+/// \ingroup CPPHighAPI
+/// \brief Create ExtrusionCut feature.
+FEATURESAPI_EXPORT
+ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                const ModelHighAPI_Double& theSize,
+                                const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+/// \ingroup CPPHighAPI
+/// \brief Create ExtrusionCut feature.
+FEATURESAPI_EXPORT
+ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                const ModelHighAPI_Selection& theDirection,
+                                const ModelHighAPI_Double& theSize,
+                                const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+/// \ingroup CPPHighAPI
+/// \brief Create ExtrusionCut feature.
+FEATURESAPI_EXPORT
+ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                const ModelHighAPI_Double& theToSize,
+                                const ModelHighAPI_Double& theFromSize,
+                                const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+/// \ingroup CPPHighAPI
+/// \brief Create ExtrusionCut feature.
+FEATURESAPI_EXPORT
+ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                const ModelHighAPI_Selection& theDirection,
+                                const ModelHighAPI_Double& theToSize,
+                                const ModelHighAPI_Double& theFromSize,
+                                const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+/// \ingroup CPPHighAPI
+/// \brief Create ExtrusionCut feature.
+FEATURESAPI_EXPORT
+ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                const ModelHighAPI_Selection& theToObject,
+                                const ModelHighAPI_Double& theToOffset,
+                                const ModelHighAPI_Selection& theFromObject,
+                                const ModelHighAPI_Double& theFromOffset,
+                                const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+/// \ingroup CPPHighAPI
+/// \brief Create ExtrusionCut feature.
+FEATURESAPI_EXPORT
+ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                const ModelHighAPI_Selection& theDirection,
+                                const ModelHighAPI_Selection& theToObject,
+                                const ModelHighAPI_Double& theToOffset,
+                                const ModelHighAPI_Selection& theFromObject,
+                                const ModelHighAPI_Double& theFromOffset,
+                                const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+class FeaturesAPI_ExtrusionFuse: public FeaturesAPI_ExtrusionBoolean
+{
+public:
+  FEATURESAPI_EXPORT
+  virtual std::string getID() {
+    return FeaturesPlugin_ExtrusionFuse::ID();
+  }
+
+  /// Constructor without values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                     const ModelHighAPI_Double& theSize,
+                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                     const ModelHighAPI_Selection& theDirection,
+                                     const ModelHighAPI_Double& theSize,
+                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                     const ModelHighAPI_Double& theToSize,
+                                     const ModelHighAPI_Double& theFromSize,
+                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                     const ModelHighAPI_Selection& theDirection,
+                                     const ModelHighAPI_Double& theToSize,
+                                     const ModelHighAPI_Double& theFromSize,
+                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                     const ModelHighAPI_Selection& theToObject,
+                                     const ModelHighAPI_Double& theToOffset,
+                                     const ModelHighAPI_Selection& theFromObject,
+                                     const ModelHighAPI_Double& theFromOffset,
+                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                     const ModelHighAPI_Selection& theDirection,
+                                     const ModelHighAPI_Selection& theToObject,
+                                     const ModelHighAPI_Double& theToOffset,
+                                     const ModelHighAPI_Selection& theFromObject,
+                                     const ModelHighAPI_Double& theFromOffset,
+                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+};
+
+/// Pointer on ExtrusionFuse object.
+typedef std::shared_ptr<FeaturesAPI_ExtrusionFuse> ExtrusionFusePtr;
+
+/// \ingroup CPPHighAPI
+/// \brief Create ExtrusionFuse feature.
+FEATURESAPI_EXPORT
+ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Double& theSize,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+/// \ingroup CPPHighAPI
+/// \brief Create ExtrusionFuse feature.
+FEATURESAPI_EXPORT
+ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Selection& theDirection,
+                                  const ModelHighAPI_Double& theSize,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+/// \ingroup CPPHighAPI
+/// \brief Create ExtrusionFuse feature.
+FEATURESAPI_EXPORT
+ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Double& theToSize,
+                                  const ModelHighAPI_Double& theFromSize,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+/// \ingroup CPPHighAPI
+/// \brief Create ExtrusionFuse feature.
+FEATURESAPI_EXPORT
+ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Selection& theDirection,
+                                  const ModelHighAPI_Double& theToSize,
+                                  const ModelHighAPI_Double& theFromSize,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+/// \ingroup CPPHighAPI
+/// \brief Create ExtrusionFuse feature.
+FEATURESAPI_EXPORT
+ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Selection& theToObject,
+                                  const ModelHighAPI_Double& theToOffset,
+                                  const ModelHighAPI_Selection& theFromObject,
+                                  const ModelHighAPI_Double& theFromOffset,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+/// \ingroup CPPHighAPI
+/// \brief Create ExtrusionFuse feature.
+FEATURESAPI_EXPORT
+ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Selection& theDirection,
+                                  const ModelHighAPI_Selection& theToObject,
+                                  const ModelHighAPI_Double& theToOffset,
+                                  const ModelHighAPI_Selection& theFromObject,
+                                  const ModelHighAPI_Double& theFromOffset,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+#endif // FeaturesAPI_ExtrusionBoolean_H_
index a7c0a096c3457f2d0223cf79a1d9640369555e9f..a8e4bc6dd80eb36cef3c55cba3335dd40b6611ac 100644 (file)
@@ -57,7 +57,7 @@ public:
   virtual ~FeaturesAPI_Revolution();
 
   INTERFACE_10(FeaturesPlugin_Revolution::ID(),
-               baseObjects, FeaturesPlugin_CompositeSketch::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
+               baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
                axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection, /** Axis */,
                creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
                toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(), ModelAPI_AttributeDouble, /** To angle */,
@@ -66,7 +66,7 @@ public:
                toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */,
                fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */,
                fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */,
-               sketchLauncher, FeaturesPlugin_CompositeSketch::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */)
+               sketchLauncher, FeaturesPlugin_Revolution::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */)
 
   /// Modify base attribute of the feature.
   FEATURESAPI_EXPORT
index 8caf40e977b4886b98252a1a9b906ad70d0935e9..b226b5504c04f52198b28da98ef730afacea9696 100644 (file)
@@ -12,6 +12,7 @@
   #include "FeaturesAPI.h"
   #include "FeaturesAPI_Boolean.h"
   #include "FeaturesAPI_Extrusion.h"
+  #include "FeaturesAPI_ExtrusionBoolean.h"
   #include "FeaturesAPI_Group.h"
   #include "FeaturesAPI_Placement.h"
   #include "FeaturesAPI_Revolution.h"
index 97084a50bc2223434188c0c49fdbe0d11bc01bd7..f8644968c2b30a10e458d129e66069052490d4a5 100644 (file)
@@ -13,6 +13,7 @@
 #include <list>
 #include <memory>
 #include <string>
+#include <iostream>
 //--------------------------------------------------------------------------------------
 class ModelAPI_Feature;
 class ModelAPI_Result;
index 86e1bec88a9629da335fabde88d26612157d1ac5..a38bebe7b0da1564bf29656b5a8ec28fa549e2e8 100644 (file)
@@ -47,7 +47,8 @@
 
 //--------------------------------------------------------------------------------------
 #define INTERFACE_COMMON(KIND) \
-  static std::string ID() { return KIND; }
+  static std::string ID() { return KIND; }\
+  virtual std::string getID() { return ID(); }
 
 //--------------------------------------------------------------------------------------
 #define START_INIT() \
@@ -56,7 +57,7 @@
       throwException(ID() + " exception: The feature is NULL."); \
       return false; \
     } \
-    if (getKind() != ID()) { \
+    if (getKind() != getID()) { \
       throwException(ID() + " exception: Wrong feature kind."); \
       return false; \
     }
     END_INIT() \
   public:
 
+//--------------------------------------------------------------------------------------
+#define INTERFACE_11(KIND, \
+                     N_0, AN_0, T_0, C_0, \
+                     N_1, AN_1, T_1, C_1, \
+                     N_2, AN_2, T_2, C_2, \
+                     N_3, AN_3, T_3, C_3, \
+                     N_4, AN_4, T_4, C_4, \
+                     N_5, AN_5, T_5, C_5, \
+                     N_6, AN_6, T_6, C_6, \
+                     N_7, AN_7, T_7, C_7, \
+                     N_8, AN_8, T_8, C_8, \
+                     N_9, AN_9, T_9, C_9, \
+                     N_10, AN_10, T_10, C_10) \
+  public: \
+    INTERFACE_COMMON(KIND) \
+    DEFINE_ATTRIBUTE(N_0, T_0, C_0) \
+    DEFINE_ATTRIBUTE(N_1, T_1, C_1) \
+    DEFINE_ATTRIBUTE(N_2, T_2, C_2) \
+    DEFINE_ATTRIBUTE(N_3, T_3, C_3) \
+    DEFINE_ATTRIBUTE(N_4, T_4, C_4) \
+    DEFINE_ATTRIBUTE(N_5, T_5, C_5) \
+    DEFINE_ATTRIBUTE(N_6, T_6, C_6) \
+    DEFINE_ATTRIBUTE(N_7, T_7, C_7) \
+    DEFINE_ATTRIBUTE(N_8, T_8, C_8) \
+    DEFINE_ATTRIBUTE(N_9, T_9, C_9) \
+    DEFINE_ATTRIBUTE(N_10, T_10, C_10) \
+  protected: \
+    START_INIT() \
+      SET_ATTRIBUTE(N_0, T_0, AN_0) \
+      SET_ATTRIBUTE(N_1, T_1, AN_1) \
+      SET_ATTRIBUTE(N_2, T_2, AN_2) \
+      SET_ATTRIBUTE(N_3, T_3, AN_3) \
+      SET_ATTRIBUTE(N_4, T_4, AN_4) \
+      SET_ATTRIBUTE(N_5, T_5, AN_5) \
+      SET_ATTRIBUTE(N_6, T_6, AN_6) \
+      SET_ATTRIBUTE(N_7, T_7, AN_7) \
+      SET_ATTRIBUTE(N_8, T_8, AN_8) \
+      SET_ATTRIBUTE(N_9, T_9, AN_9) \
+      SET_ATTRIBUTE(N_10, T_10, AN_10) \
+    END_INIT() \
+  public:
+
 //--------------------------------------------------------------------------------------
 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_MACRO_H_ */
index c744fe82b8372a24c57654ab1f2b1c189adc7501..111af601b1759d74dbbff76b9206c6a44d5a2bef 100644 (file)
@@ -64,8 +64,8 @@ class FeaturesTestCase(FeaturesFixture):
         import FeaturesAPI
         FeaturesAPI.FeaturesAPI_Boolean(self.part.addFeature("Boolean"))
         FeaturesAPI.FeaturesAPI_Extrusion(self.part.addFeature("Extrusion"))
-        # model.features.extrusion_boolean.ExtrusionBoolean(self.part.addFeature("ExtrusionCut"))
-        # model.features.extrusion_boolean.ExtrusionBoolean(self.part.addFeature("ExtrusionFuse"))
+        FeaturesAPI.FeaturesAPI_ExtrusionCut(self.part.addFeature("ExtrusionCut"))
+        FeaturesAPI.FeaturesAPI_ExtrusionFuse(self.part.addFeature("ExtrusionFuse"))
         FeaturesAPI.FeaturesAPI_Revolution(self.part.addFeature("Revolution"))
         # model.features.revolution_boolean.RevolutionBoolean(self.part.addFeature("RevolutionCut"))
         # model.features.revolution_boolean.RevolutionBoolean(self.part.addFeature("RevolutionFuse"))
index ca00dd5bb813758e14c0e9ce5c6adc0c47cfa872..cba59bf27d9c7ff0cd860485010e4d6c9cfbbd60 100644 (file)
@@ -1,16 +1,14 @@
 """Package for Features plugin for the Parametric Geometry API of the Modeler.
 """
 
+from FeaturesAPI import addPlacement, addRotation, addTranslation
+
 from FeaturesAPI import addFuse, addCut, addCommon
 
 from partition import addPartition
 
-from FeaturesAPI import addExtrusion, addRevolution
-from extrusion_boolean import addExtrusionCut, addExtrusionFuse
+from FeaturesAPI import addExtrusion, addExtrusionCut, addExtrusionFuse
+from FeaturesAPI import addRevolution
 from revolution_boolean import addRevolutionCut, addRevolutionFuse
 
-from placement import addPlacement
-from rotation import addRotation
-from translation import addTranslation
-
 from group import addGroup