FeaturesAPI_Partition.h
FeaturesAPI_Pipe.h
FeaturesAPI_Placement.h
+ FeaturesAPI_RemoveSubShapes.h
FeaturesAPI_Revolution.h
FeaturesAPI_RevolutionBoolean.h
FeaturesAPI_Rotation.h
FeaturesAPI_Partition.cpp
FeaturesAPI_Pipe.cpp
FeaturesAPI_Placement.cpp
- FeaturesAPI_Rotation.cpp
+ FeaturesAPI_RemoveSubShapes.cpp
FeaturesAPI_Revolution.cpp
FeaturesAPI_RevolutionBoolean.cpp
+ FeaturesAPI_Rotation.cpp
FeaturesAPI_Translation.cpp
)
%shared_ptr(FeaturesAPI_Partition)
%shared_ptr(FeaturesAPI_Pipe)
%shared_ptr(FeaturesAPI_Placement)
+%shared_ptr(FeaturesAPI_RemoveSubShapes)
%shared_ptr(FeaturesAPI_Revolution)
%shared_ptr(FeaturesAPI_RevolutionBoolean)
%shared_ptr(FeaturesAPI_RevolutionCut)
%include "FeaturesAPI_Partition.h"
%include "FeaturesAPI_Pipe.h"
%include "FeaturesAPI_Placement.h"
+%include "FeaturesAPI_RemoveSubShapes.h"
%include "FeaturesAPI_Revolution.h"
%include "FeaturesAPI_RevolutionBoolean.h"
%include "FeaturesAPI_Rotation.h"
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File: FeaturesAPI_RemoveSubShapes.cpp
+// Created: 09 June 2016
+// Author: Dmitry Bobylev
+
+#include "FeaturesAPI_RemoveSubShapes.h"
+
+#include <ModelHighAPI_Tools.h>
+
+//==================================================================================================
+FeaturesAPI_RemoveSubShapes::FeaturesAPI_RemoveSubShapes(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: ModelHighAPI_Interface(theFeature)
+{
+ initialize();
+}
+
+//==================================================================================================
+FeaturesAPI_RemoveSubShapes::FeaturesAPI_RemoveSubShapes(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const ModelHighAPI_Selection& theBase)
+: ModelHighAPI_Interface(theFeature)
+{
+ if(initialize()) {
+ setBase(theBase);
+
+ execute();
+ }
+}
+
+//==================================================================================================
+FeaturesAPI_RemoveSubShapes::~FeaturesAPI_RemoveSubShapes()
+{
+
+}
+
+//==================================================================================================
+void FeaturesAPI_RemoveSubShapes::setBase(const ModelHighAPI_Selection& theBase)
+{
+ fillAttribute(theBase, mybase);
+
+ execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_RemoveSubShapes::setSubShapesToKeep(const std::list<ModelHighAPI_Selection>& theSubShapes)
+{
+ fillAttribute(theSubShapes, mysubshapes);
+
+ execute();
+}
+
+// TODO(spo): make add* as static functions of the class
+//==================================================================================================
+RemoveSubShapesPtr addRemoveSubShapes(const std::shared_ptr<ModelAPI_Document>& thePart,
+ const ModelHighAPI_Selection& theBase)
+{
+ std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_RemoveSubShapes::ID());
+ return RemoveSubShapesPtr(new FeaturesAPI_RemoveSubShapes(aFeature, theBase));
+}
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File: FeaturesAPI_RemoveSubShapes.h
+// Created: 09 June 2016
+// Author: Dmitry Bobylev
+
+#ifndef FeaturesAPI_RemoveSubShapes_H_
+#define FeaturesAPI_RemoveSubShapes_H_
+
+#include "FeaturesAPI.h"
+
+#include <FeaturesPlugin_RemoveSubShapes.h>
+
+#include <ModelHighAPI_Interface.h>
+#include <ModelHighAPI_Macro.h>
+
+class ModelHighAPI_Selection;
+
+/// \class FeaturesAPI_RemoveSubShapes
+/// \ingroup CPPHighAPI
+/// \brief Interface for RemoveSubShapes feature.
+class FeaturesAPI_RemoveSubShapes: public ModelHighAPI_Interface
+{
+public:
+ /// Constructor without values.
+ FEATURESAPI_EXPORT
+ explicit FeaturesAPI_RemoveSubShapes(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+
+ /// Constructor with values.
+ FEATURESAPI_EXPORT
+ explicit FeaturesAPI_RemoveSubShapes(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const ModelHighAPI_Selection& theBase);
+
+ /// Destructor.
+ FEATURESAPI_EXPORT
+ virtual ~FeaturesAPI_RemoveSubShapes();
+
+ INTERFACE_2(FeaturesPlugin_RemoveSubShapes::ID(),
+ base, FeaturesPlugin_RemoveSubShapes::BASE_SHAPE_ID(), ModelAPI_AttributeSelection, /** Base */,
+ subshapes, FeaturesPlugin_RemoveSubShapes::SUBSHAPES_ID(), ModelAPI_AttributeSelectionList, /** Subshapes */)
+
+ /// Modify objects attribute of the feature.
+ FEATURESAPI_EXPORT
+ void setBase(const ModelHighAPI_Selection& theBase);
+
+ /// Modify tools attribute of the feature.
+ FEATURESAPI_EXPORT
+ void setSubShapesToKeep(const std::list<ModelHighAPI_Selection>& theSubShapes);
+};
+
+/// Pointer on RemoveSubShapes object.
+typedef std::shared_ptr<FeaturesAPI_RemoveSubShapes> RemoveSubShapesPtr;
+
+/// \ingroup CPPHighAPI
+/// \brief Create RemoveSubShapes feature.
+FEATURESAPI_EXPORT
+RemoveSubShapesPtr addRemoveSubShapes(const std::shared_ptr<ModelAPI_Document>& thePart,
+ const ModelHighAPI_Selection& theBase);
+
+#endif // FeaturesAPI_RemoveSubShapes_H_
#include "FeaturesAPI_Partition.h"
#include "FeaturesAPI_Pipe.h"
#include "FeaturesAPI_Placement.h"
+ #include "FeaturesAPI_RemoveSubShapes.h"
#include "FeaturesAPI_Revolution.h"
#include "FeaturesAPI_RevolutionBoolean.h"
#include "FeaturesAPI_Rotation.h"