From 5c7b3a51fb898212a8ea6543bee3df9f3bd889c2 Mon Sep 17 00:00:00 2001 From: dbv Date: Thu, 16 Jun 2016 15:29:59 +0300 Subject: [PATCH] Added CPP High API for FeaturesPlugin_RevolutionCut, FeaturesPlugin_RevolutionFuse --- src/FeaturesAPI/CMakeLists.txt | 2 + src/FeaturesAPI/FeaturesAPI.i | 4 + .../FeaturesAPI_ExtrusionBoolean.cpp | 2 +- .../FeaturesAPI_RevolutionBoolean.cpp | 310 ++++++++++++++++++ .../FeaturesAPI_RevolutionBoolean.h | 228 +++++++++++++ src/FeaturesAPI/FeaturesAPI_swig.h | 1 + src/PythonAPI/Test/TestFeatures.py | 4 +- src/PythonAPI/model/features/__init__.py | 5 +- 8 files changed, 550 insertions(+), 6 deletions(-) create mode 100644 src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp create mode 100644 src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h diff --git a/src/FeaturesAPI/CMakeLists.txt b/src/FeaturesAPI/CMakeLists.txt index 519f4e755..a04936172 100644 --- a/src/FeaturesAPI/CMakeLists.txt +++ b/src/FeaturesAPI/CMakeLists.txt @@ -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 ) diff --git a/src/FeaturesAPI/FeaturesAPI.i b/src/FeaturesAPI/FeaturesAPI.i index 55094b61d..b88e019a1 100644 --- a/src/FeaturesAPI/FeaturesAPI.i +++ b/src/FeaturesAPI/FeaturesAPI.i @@ -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" diff --git a/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp b/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp index b645e7393..92587dc85 100644 --- a/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp +++ b/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp @@ -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 index 000000000..6590d1acc --- /dev/null +++ b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp @@ -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 +#include + +//================================================================================================== +FeaturesAPI_RevolutionBoolean::FeaturesAPI_RevolutionBoolean(const std::shared_ptr& theFeature) +: ModelHighAPI_Interface(theFeature) +{ +} + +//================================================================================================== +FeaturesAPI_RevolutionBoolean::~FeaturesAPI_RevolutionBoolean() +{ +} + +//================================================================================================== +void FeaturesAPI_RevolutionBoolean::setBase(const std::list& 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& theBooleanObjects) +{ + fillAttribute(theBooleanObjects, mybooleanObjects); + + execute(); +} + +//================================================================================================== +FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(const std::shared_ptr& theFeature) +: FeaturesAPI_RevolutionBoolean(theFeature) +{ + initialize(); +} + +//================================================================================================== +FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theSize, + const std::list& 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& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theToAngle, + const ModelHighAPI_Double& theFromAngle, + const std::list& 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& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Selection& theToObject, + const ModelHighAPI_Double& theToOffset, + const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Double& theFromOffset, + const std::list& 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& thePart, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theSize, + const std::list& theBooleanObjects) +{ + std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_RevolutionCut::ID()); + return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature, theBaseObjects, theAxis, theSize, theBooleanObjects)); +} + +//================================================================================================== +RevolutionCutPtr addRevolutionCut(const std::shared_ptr& thePart, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theToAngle, + const ModelHighAPI_Double& theFromAngle, + const std::list& theBooleanObjects) +{ + std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_RevolutionCut::ID()); + return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature, + theBaseObjects, + theAxis, + theToAngle, + theFromAngle, + theBooleanObjects)); +} + +//================================================================================================== +RevolutionCutPtr addRevolutionCut(const std::shared_ptr& thePart, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Selection& theToObject, + const ModelHighAPI_Double& theToOffset, + const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Double& theFromOffset, + const std::list& theBooleanObjects) +{ + std::shared_ptr 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& theFeature) +: FeaturesAPI_RevolutionBoolean(theFeature) +{ + initialize(); +} + +//================================================================================================== +FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theSize, + const std::list& 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& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theToAngle, + const ModelHighAPI_Double& theFromAngle, + const std::list& 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& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Selection& theToObject, + const ModelHighAPI_Double& theToOffset, + const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Double& theFromOffset, + const std::list& 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& thePart, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theSize, + const std::list& theBooleanObjects) +{ + std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID()); + return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature, theBaseObjects, theAxis, theSize, theBooleanObjects)); +} + +//================================================================================================== +RevolutionFusePtr addRevolutionFuse(const std::shared_ptr& thePart, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theToAngle, + const ModelHighAPI_Double& theFromAngle, + const std::list& theBooleanObjects) +{ + std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID()); + return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature, + theBaseObjects, + theAxis, + theToAngle, + theFromAngle, + theBooleanObjects)); +} + +//================================================================================================== +RevolutionFusePtr addRevolutionFuse(const std::shared_ptr& thePart, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Selection& theToObject, + const ModelHighAPI_Double& theToOffset, + const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Double& theFromOffset, + const std::list& theBooleanObjects) +{ + std::shared_ptr 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 index 000000000..679eb5831 --- /dev/null +++ b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h @@ -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 +#include +#include + +#include +#include + +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& 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& theBooleanObjects); + +protected: + /// Constructor without values. + FEATURESAPI_EXPORT + explicit FeaturesAPI_RevolutionBoolean(const std::shared_ptr& 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& theFeature); + + /// Constructor with values. + FEATURESAPI_EXPORT + explicit FeaturesAPI_RevolutionCut(const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theAngle, + const std::list& theBooleanObjects); + + /// Constructor with values. + FEATURESAPI_EXPORT + explicit FeaturesAPI_RevolutionCut(const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theToAngle, + const ModelHighAPI_Double& theFromAngle, + const std::list& theBooleanObjects); + + /// Constructor with values. + FEATURESAPI_EXPORT + explicit FeaturesAPI_RevolutionCut(const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Selection& theToObject, + const ModelHighAPI_Double& theToOffset, + const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Double& theFromOffset, + const std::list& theBooleanObjects); +}; + +/// Pointer on RevolutionCut object. +typedef std::shared_ptr RevolutionCutPtr; + +/// \ingroup CPPHighAPI +/// \brief Create RevolutionCut feature. +FEATURESAPI_EXPORT +RevolutionCutPtr addRevolutionCut(const std::shared_ptr& thePart, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theAngle, + const std::list& theBooleanObjects); + +/// \ingroup CPPHighAPI +/// \brief Create RevolutionCut feature. +FEATURESAPI_EXPORT +RevolutionCutPtr addRevolutionCut(const std::shared_ptr& thePart, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theToAngle, + const ModelHighAPI_Double& theFromAngle, + const std::list& theBooleanObjects); + +/// \ingroup CPPHighAPI +/// \brief Create RevolutionCut feature. +FEATURESAPI_EXPORT +RevolutionCutPtr addRevolutionCut(const std::shared_ptr& thePart, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Selection& theToObject, + const ModelHighAPI_Double& theToOffset, + const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Double& theFromOffset, + const std::list& 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& theFeature); + + /// Constructor with values. + FEATURESAPI_EXPORT + explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theAngle, + const std::list& theBooleanObjects); + + /// Constructor with values. + FEATURESAPI_EXPORT + explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theToAngle, + const ModelHighAPI_Double& theFromAngle, + const std::list& theBooleanObjects); + + /// Constructor with values. + FEATURESAPI_EXPORT + explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Selection& theToObject, + const ModelHighAPI_Double& theToOffset, + const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Double& theFromOffset, + const std::list& theBooleanObjects); +}; + +/// Pointer on RevolutionFuse object. +typedef std::shared_ptr RevolutionFusePtr; + +/// \ingroup CPPHighAPI +/// \brief Create RevolutionFuse feature. +FEATURESAPI_EXPORT +RevolutionFusePtr addRevolutionFuse(const std::shared_ptr& thePart, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theAngle, + const std::list& theBooleanObjects); + +/// \ingroup CPPHighAPI +/// \brief Create RevolutionFuse feature. +FEATURESAPI_EXPORT +RevolutionFusePtr addRevolutionFuse(const std::shared_ptr& thePart, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theToAngle, + const ModelHighAPI_Double& theFromAngle, + const std::list& theBooleanObjects); + +/// \ingroup CPPHighAPI +/// \brief Create RevolutionFuse feature. +FEATURESAPI_EXPORT +RevolutionFusePtr addRevolutionFuse(const std::shared_ptr& thePart, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Selection& theToObject, + const ModelHighAPI_Double& theToOffset, + const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Double& theFromOffset, + const std::list& theBooleanObjects); + +#endif // FeaturesAPI_RevolutionBoolean_H_ diff --git a/src/FeaturesAPI/FeaturesAPI_swig.h b/src/FeaturesAPI/FeaturesAPI_swig.h index b226b5504..a81bc621f 100644 --- a/src/FeaturesAPI/FeaturesAPI_swig.h +++ b/src/FeaturesAPI/FeaturesAPI_swig.h @@ -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" diff --git a/src/PythonAPI/Test/TestFeatures.py b/src/PythonAPI/Test/TestFeatures.py index 111af601b..8e4f43039 100644 --- a/src/PythonAPI/Test/TestFeatures.py +++ b/src/PythonAPI/Test/TestFeatures.py @@ -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")) diff --git a/src/PythonAPI/model/features/__init__.py b/src/PythonAPI/model/features/__init__.py index cba59bf27..5fdf4c72d 100644 --- a/src/PythonAPI/model/features/__init__.py +++ b/src/PythonAPI/model/features/__init__.py @@ -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 -- 2.39.2