]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Added CPP High API for FeaturesPlugin_RevolutionCut, FeaturesPlugin_RevolutionFuse
authordbv <dbv@opencascade.com>
Thu, 16 Jun 2016 12:29:59 +0000 (15:29 +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_ExtrusionBoolean.cpp
src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp [new file with mode: 0644]
src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h [new file with mode: 0644]
src/FeaturesAPI/FeaturesAPI_swig.h
src/PythonAPI/Test/TestFeatures.py
src/PythonAPI/model/features/__init__.py

index 519f4e755486bdf4d08ecba9a4e00c8ba1fb8dc1..a04936172f12e6b210550759c530e1fd2713a8d5 100644 (file)
@@ -10,6 +10,7 @@ SET(PROJECT_HEADERS
   FeaturesAPI_Group.h
   FeaturesAPI_Placement.h
   FeaturesAPI_Revolution.h
+  FeaturesAPI_RevolutionBoolean.h
   FeaturesAPI_Rotation.h
   FeaturesAPI_Translation.h
 )
@@ -22,6 +23,7 @@ SET(PROJECT_SOURCES
   FeaturesAPI_Placement.cpp
   FeaturesAPI_Rotation.cpp
   FeaturesAPI_Revolution.cpp
+  FeaturesAPI_RevolutionBoolean.cpp
   FeaturesAPI_Translation.cpp
 )
 
index 55094b61d90dbda03c7027bcfb59eb7bca9fe477..b88e019a1a665cf40e79bc38e56249619c8c4587 100644 (file)
@@ -27,6 +27,9 @@
 %shared_ptr(FeaturesAPI_Group)
 %shared_ptr(FeaturesAPI_Placement)
 %shared_ptr(FeaturesAPI_Revolution)
+%shared_ptr(FeaturesAPI_RevolutionBoolean)
+%shared_ptr(FeaturesAPI_RevolutionCut)
+%shared_ptr(FeaturesAPI_RevolutionFuse)
 %shared_ptr(FeaturesAPI_Rotation)
 %shared_ptr(FeaturesAPI_Translation)
 
@@ -37,5 +40,6 @@
 %include "FeaturesAPI_Group.h"
 %include "FeaturesAPI_Placement.h"
 %include "FeaturesAPI_Revolution.h"
+%include "FeaturesAPI_RevolutionBoolean.h"
 %include "FeaturesAPI_Rotation.h"
 %include "FeaturesAPI_Translation.h"
index b645e739321253e8dba95c82a825fa0fc56a5d49..92587dc8523e80d767c928e000f74ca405740942 100644 (file)
@@ -1,6 +1,6 @@
 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
 
-// File:        FeaturesAPI_Extrusion.cpp
+// File:        FeaturesAPI_ExtrusionBoolean.cpp
 // Created:     09 June 2016
 // Author:      Dmitry Bobylev
 
diff --git a/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp
new file mode 100644 (file)
index 0000000..6590d1a
--- /dev/null
@@ -0,0 +1,310 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File:        FeaturesAPI_RevolutionBoolean.cpp
+// Created:     09 June 2016
+// Author:      Dmitry Bobylev
+
+#include "FeaturesAPI_RevolutionBoolean.h"
+
+#include <ModelHighAPI_Double.h>
+#include <ModelHighAPI_Tools.h>
+
+//==================================================================================================
+FeaturesAPI_RevolutionBoolean::FeaturesAPI_RevolutionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: ModelHighAPI_Interface(theFeature)
+{
+}
+
+//==================================================================================================
+FeaturesAPI_RevolutionBoolean::~FeaturesAPI_RevolutionBoolean()
+{
+}
+
+//==================================================================================================
+void FeaturesAPI_RevolutionBoolean::setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects)
+{
+  fillAttribute(theBaseObjects, mybaseObjects);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_RevolutionBoolean::setAxis(const ModelHighAPI_Selection& theAxis)
+{
+  fillAttribute(theAxis, myaxis);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_RevolutionBoolean::setAngles(const ModelHighAPI_Double& theToAngle,
+                                              const ModelHighAPI_Double& theFromAngle)
+{
+  fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_BY_ANGLES(), mycreationMethod);
+  fillAttribute(theToAngle, mytoAngle);
+  fillAttribute(theFromAngle, myfromAngle);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_RevolutionBoolean::setAngle(const ModelHighAPI_Double& theAngle)
+{
+  fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_BY_ANGLES(), mycreationMethod);
+  fillAttribute(theAngle, mytoAngle);
+  fillAttribute(ModelHighAPI_Double(), myfromAngle);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_RevolutionBoolean::setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
+                                                        const ModelHighAPI_Double& theToOffset,
+                                                        const ModelHighAPI_Selection& theFromObject,
+                                                        const ModelHighAPI_Double& theFromOffset)
+{
+  fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_BY_PLANES(), mycreationMethod);
+  fillAttribute(theToObject, mytoObject);
+  fillAttribute(theToOffset, mytoOffset);
+  fillAttribute(theFromObject, myfromObject);
+  fillAttribute(theFromOffset, myfromOffset);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_RevolutionBoolean::setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  fillAttribute(theBooleanObjects, mybooleanObjects);
+
+  execute();
+}
+
+//==================================================================================================
+FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: FeaturesAPI_RevolutionBoolean(theFeature)
+{
+  initialize();
+}
+
+//==================================================================================================
+FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                                     const ModelHighAPI_Selection& theAxis,
+                                                     const ModelHighAPI_Double& theSize,
+                                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_RevolutionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theAxis, myaxis);
+    fillAttribute(theSize, mytoAngle);
+    fillAttribute(ModelHighAPI_Double(), myfromAngle);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                                     const ModelHighAPI_Selection& theAxis,
+                                                     const ModelHighAPI_Double& theToAngle,
+                                                     const ModelHighAPI_Double& theFromAngle,
+                                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_RevolutionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theAxis, myaxis);
+    fillAttribute(theToAngle, mytoAngle);
+    fillAttribute(theFromAngle, myfromAngle);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                                     const ModelHighAPI_Selection& theAxis,
+                                                     const ModelHighAPI_Selection& theToObject,
+                                                     const ModelHighAPI_Double& theToOffset,
+                                                     const ModelHighAPI_Selection& theFromObject,
+                                                     const ModelHighAPI_Double& theFromOffset,
+                                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_RevolutionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theAxis, myaxis);
+    fillAttribute(theToObject, mytoObject);
+    fillAttribute(theToOffset, mytoOffset);
+    fillAttribute(theFromObject, myfromObject);
+    fillAttribute(theFromOffset, myfromOffset);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
+// TODO(spo): make add* as static functions of the class
+//==================================================================================================
+RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Selection& theAxis,
+                                  const ModelHighAPI_Double& theSize,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_RevolutionCut::ID());
+  return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature, theBaseObjects, theAxis, theSize, theBooleanObjects));
+}
+
+//==================================================================================================
+RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Selection& theAxis,
+                                  const ModelHighAPI_Double& theToAngle,
+                                  const ModelHighAPI_Double& theFromAngle,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_RevolutionCut::ID());
+  return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature,
+                                                      theBaseObjects,
+                                                      theAxis,
+                                                      theToAngle,
+                                                      theFromAngle,
+                                                      theBooleanObjects));
+}
+
+//==================================================================================================
+RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Selection& theAxis,
+                                  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_RevolutionCut::ID());
+  return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature,
+                                                      theBaseObjects,
+                                                      theAxis,
+                                                      theToObject,
+                                                      theToOffset,
+                                                      theFromObject,
+                                                      theFromOffset,
+                                                      theBooleanObjects));
+}
+
+
+//==================================================================================================
+FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: FeaturesAPI_RevolutionBoolean(theFeature)
+{
+  initialize();
+}
+
+//==================================================================================================
+FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                       const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                                       const ModelHighAPI_Selection& theAxis,
+                                                       const ModelHighAPI_Double& theSize,
+                                                       const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_RevolutionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theAxis, myaxis);
+    fillAttribute(theSize, mytoAngle);
+    fillAttribute(ModelHighAPI_Double(), myfromAngle);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                       const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                                       const ModelHighAPI_Selection& theAxis,
+                                                       const ModelHighAPI_Double& theToAngle,
+                                                       const ModelHighAPI_Double& theFromAngle,
+                                                       const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_RevolutionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theAxis, myaxis);
+    fillAttribute(theToAngle, mytoAngle);
+    fillAttribute(theFromAngle, myfromAngle);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                       const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                                       const ModelHighAPI_Selection& theAxis,
+                                                       const ModelHighAPI_Selection& theToObject,
+                                                       const ModelHighAPI_Double& theToOffset,
+                                                       const ModelHighAPI_Selection& theFromObject,
+                                                       const ModelHighAPI_Double& theFromOffset,
+                                                       const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_RevolutionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theAxis, myaxis);
+    fillAttribute(theToObject, mytoObject);
+    fillAttribute(theToOffset, mytoOffset);
+    fillAttribute(theFromObject, myfromObject);
+    fillAttribute(theFromOffset, myfromOffset);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
+// TODO(spo): make add* as static functions of the class
+//==================================================================================================
+RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                    const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                    const ModelHighAPI_Selection& theAxis,
+                                    const ModelHighAPI_Double& theSize,
+                                    const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID());
+  return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature, theBaseObjects, theAxis, theSize, theBooleanObjects));
+}
+
+//==================================================================================================
+RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                    const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                    const ModelHighAPI_Selection& theAxis,
+                                    const ModelHighAPI_Double& theToAngle,
+                                    const ModelHighAPI_Double& theFromAngle,
+                                    const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID());
+  return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature,
+                                                        theBaseObjects,
+                                                        theAxis,
+                                                        theToAngle,
+                                                        theFromAngle,
+                                                        theBooleanObjects));
+}
+
+//==================================================================================================
+RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                    const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                    const ModelHighAPI_Selection& theAxis,
+                                    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_RevolutionFuse::ID());
+  return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature,
+                                                        theBaseObjects,
+                                                        theAxis,
+                                                        theToObject,
+                                                        theToOffset,
+                                                        theFromObject,
+                                                        theFromOffset,
+                                                        theBooleanObjects));
+}
diff --git a/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h
new file mode 100644 (file)
index 0000000..679eb58
--- /dev/null
@@ -0,0 +1,228 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File:        FeaturesAPI_RevolutionBoolean.h
+// Created:     09 June 2016
+// Author:      Dmitry Bobylev
+
+#ifndef FeaturesAPI_RevolutionBoolean_H_
+#define FeaturesAPI_RevolutionBoolean_H_
+
+#include "FeaturesAPI.h"
+
+#include <FeaturesPlugin_CompositeBoolean.h>
+#include <FeaturesPlugin_RevolutionCut.h>
+#include <FeaturesPlugin_RevolutionFuse.h>
+
+#include <ModelHighAPI_Interface.h>
+#include <ModelHighAPI_Macro.h>
+
+class ModelHighAPI_Double;
+class ModelHighAPI_Selection;
+
+/// \class FeaturesAPI_RevolutionBoolean
+/// \ingroup CPPHighAPI
+/// \brief Interface for RevolutionBoolean feature.
+class FeaturesAPI_RevolutionBoolean: public ModelHighAPI_Interface
+{
+public:
+  /// Destructor.
+  FEATURESAPI_EXPORT
+  virtual ~FeaturesAPI_RevolutionBoolean();
+
+  INTERFACE_11("",
+               sketchLauncher, FeaturesPlugin_Revolution::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */,
+               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 */,
+               fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(), ModelAPI_AttributeDouble, /** From angle */,
+               toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */,
+               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 */,
+               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 axis_object attribute of the feature.
+  FEATURESAPI_EXPORT
+  void setAxis(const ModelHighAPI_Selection& theAxis);
+
+  /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
+  FEATURESAPI_EXPORT
+  void setAngles(const ModelHighAPI_Double& theToAngle, const ModelHighAPI_Double& theFromAngle);
+
+  /// Modify creation_method, to_angle, from_angle attributes of the feature.
+  FEATURESAPI_EXPORT
+  void setAngle(const ModelHighAPI_Double& theAngle);
+
+  /// 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_RevolutionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+};
+
+class FeaturesAPI_RevolutionCut: public FeaturesAPI_RevolutionBoolean
+{
+public:
+  FEATURESAPI_EXPORT
+  virtual std::string getID() {
+    return FeaturesPlugin_RevolutionCut::ID();
+  }
+
+  /// Constructor without values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                     const ModelHighAPI_Selection& theAxis,
+                                     const ModelHighAPI_Double& theAngle,
+                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                     const ModelHighAPI_Selection& theAxis,
+                                     const ModelHighAPI_Double& theToAngle,
+                                     const ModelHighAPI_Double& theFromAngle,
+                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                     const ModelHighAPI_Selection& theAxis,
+                                     const ModelHighAPI_Selection& theToObject,
+                                     const ModelHighAPI_Double& theToOffset,
+                                     const ModelHighAPI_Selection& theFromObject,
+                                     const ModelHighAPI_Double& theFromOffset,
+                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+};
+
+/// Pointer on RevolutionCut object.
+typedef std::shared_ptr<FeaturesAPI_RevolutionCut> RevolutionCutPtr;
+
+/// \ingroup CPPHighAPI
+/// \brief Create RevolutionCut feature.
+FEATURESAPI_EXPORT
+RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Selection& theAxis,
+                                  const ModelHighAPI_Double& theAngle,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+/// \ingroup CPPHighAPI
+/// \brief Create RevolutionCut feature.
+FEATURESAPI_EXPORT
+RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Selection& theAxis,
+                                  const ModelHighAPI_Double& theToAngle,
+                                  const ModelHighAPI_Double& theFromAngle,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+/// \ingroup CPPHighAPI
+/// \brief Create RevolutionCut feature.
+FEATURESAPI_EXPORT
+RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Selection& theAxis,
+                                  const ModelHighAPI_Selection& theToObject,
+                                  const ModelHighAPI_Double& theToOffset,
+                                  const ModelHighAPI_Selection& theFromObject,
+                                  const ModelHighAPI_Double& theFromOffset,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+class FeaturesAPI_RevolutionFuse: public FeaturesAPI_RevolutionBoolean
+{
+public:
+  FEATURESAPI_EXPORT
+  virtual std::string getID() {
+    return FeaturesPlugin_RevolutionFuse::ID();
+  }
+
+  /// Constructor without values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                      const ModelHighAPI_Selection& theAxis,
+                                      const ModelHighAPI_Double& theAngle,
+                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                      const ModelHighAPI_Selection& theAxis,
+                                      const ModelHighAPI_Double& theToAngle,
+                                      const ModelHighAPI_Double& theFromAngle,
+                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                      const ModelHighAPI_Selection& theAxis,
+                                      const ModelHighAPI_Selection& theToObject,
+                                      const ModelHighAPI_Double& theToOffset,
+                                      const ModelHighAPI_Selection& theFromObject,
+                                      const ModelHighAPI_Double& theFromOffset,
+                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+};
+
+/// Pointer on RevolutionFuse object.
+typedef std::shared_ptr<FeaturesAPI_RevolutionFuse> RevolutionFusePtr;
+
+/// \ingroup CPPHighAPI
+/// \brief Create RevolutionFuse feature.
+FEATURESAPI_EXPORT
+RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                    const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                    const ModelHighAPI_Selection& theAxis,
+                                    const ModelHighAPI_Double& theAngle,
+                                    const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+/// \ingroup CPPHighAPI
+/// \brief Create RevolutionFuse feature.
+FEATURESAPI_EXPORT
+RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                    const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                    const ModelHighAPI_Selection& theAxis,
+                                    const ModelHighAPI_Double& theToAngle,
+                                    const ModelHighAPI_Double& theFromAngle,
+                                    const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+/// \ingroup CPPHighAPI
+/// \brief Create RevolutionFuse feature.
+FEATURESAPI_EXPORT
+RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                    const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                    const ModelHighAPI_Selection& theAxis,
+                                    const ModelHighAPI_Selection& theToObject,
+                                    const ModelHighAPI_Double& theToOffset,
+                                    const ModelHighAPI_Selection& theFromObject,
+                                    const ModelHighAPI_Double& theFromOffset,
+                                    const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
+#endif // FeaturesAPI_RevolutionBoolean_H_
index b226b5504c04f52198b28da98ef730afacea9696..a81bc621f17c9215d7993305d8f63359427ace5c 100644 (file)
@@ -16,6 +16,7 @@
   #include "FeaturesAPI_Group.h"
   #include "FeaturesAPI_Placement.h"
   #include "FeaturesAPI_Revolution.h"
+  #include "FeaturesAPI_RevolutionBoolean.h"
   #include "FeaturesAPI_Rotation.h"
   #include "FeaturesAPI_Translation.h"
 
index 111af601b1759d74dbbff76b9206c6a44d5a2bef..8e4f43039f5c553257b7d7a60433261367d8fb3a 100644 (file)
@@ -67,8 +67,8 @@ class FeaturesTestCase(FeaturesFixture):
         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"))
+        FeaturesAPI.FeaturesAPI_RevolutionCut(self.part.addFeature("RevolutionCut"))
+        FeaturesAPI.FeaturesAPI_RevolutionFuse(self.part.addFeature("RevolutionFuse"))
         FeaturesAPI.FeaturesAPI_Placement(self.part.addFeature("Placement"))
         FeaturesAPI.FeaturesAPI_Rotation(self.part.addFeature("Rotation"))
         FeaturesAPI.FeaturesAPI_Translation(self.part.addFeature("Translation"))
index cba59bf27d9c7ff0cd860485010e4d6c9cfbbd60..5fdf4c72d5ea5542af5e1d49827194643a8963dc 100644 (file)
@@ -8,7 +8,6 @@ from FeaturesAPI import addFuse, addCut, addCommon
 from partition import addPartition
 
 from FeaturesAPI import addExtrusion, addExtrusionCut, addExtrusionFuse
-from FeaturesAPI import addRevolution
-from revolution_boolean import addRevolutionCut, addRevolutionFuse
+from FeaturesAPI import addRevolution, addRevolutionCut, addRevolutionFuse
 
-from group import addGroup
+from FeaturesAPI import addGroup