%shared_ptr(BuildAPI_Edge)
%shared_ptr(BuildAPI_Face)
%shared_ptr(BuildAPI_Shell)
+%shared_ptr(BuildAPI_SubShapes)
%shared_ptr(BuildAPI_Vertex)
%shared_ptr(BuildAPI_Wire)
%include "BuildAPI_Edge.h"
%include "BuildAPI_Face.h"
%include "BuildAPI_Shell.h"
+%include "BuildAPI_SubShapes.h"
%include "BuildAPI_Vertex.h"
%include "BuildAPI_Wire.h"
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File: BuildAPI_SubShapes.cpp
+// Created: 09 June 2016
+// Author: Dmitry Bobylev
+
+#include "BuildAPI_SubShapes.h"
+
+#include <ModelHighAPI_Tools.h>
+
+//==================================================================================================
+BuildAPI_SubShapes::BuildAPI_SubShapes(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: ModelHighAPI_Interface(theFeature)
+{
+ initialize();
+}
+
+//==================================================================================================
+BuildAPI_SubShapes::BuildAPI_SubShapes(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const ModelHighAPI_Selection& theBaseShape,
+ const std::list<ModelHighAPI_Selection>& theSubShapes)
+: ModelHighAPI_Interface(theFeature)
+{
+ if(initialize()) {
+ fillAttribute(theBaseShape, mybaseShape);
+ setSubShapes(theSubShapes);
+ }
+}
+
+//==================================================================================================
+BuildAPI_SubShapes::~BuildAPI_SubShapes()
+{
+
+}
+
+//==================================================================================================
+void BuildAPI_SubShapes::setBaseShape(const ModelHighAPI_Selection& theBaseShape)
+{
+ fillAttribute(theBaseShape, mybaseShape);
+
+ execute();
+}
+
+//==================================================================================================
+void BuildAPI_SubShapes::setSubShapes(const std::list<ModelHighAPI_Selection>& theSubShapes)
+{
+ fillAttribute(theSubShapes, mysubShapes);
+
+ execute();
+}
+
+// TODO(spo): make add* as static functions of the class
+//==================================================================================================
+SubShapesPtr addSubShapes(const std::shared_ptr<ModelAPI_Document>& thePart,
+ const ModelHighAPI_Selection& theBaseShape,
+ const std::list<ModelHighAPI_Selection>& theSubShapes)
+{
+ std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(BuildAPI_SubShapes::ID());
+ return SubShapesPtr(new BuildAPI_SubShapes(aFeature, theBaseShape, theSubShapes));
+}
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File: BuildAPI_SubShapes.h
+// Created: 09 June 2016
+// Author: Dmitry Bobylev
+
+#ifndef BuildAPI_SubShapes_H_
+#define BuildAPI_SubShapes_H_
+
+#include "BuildAPI.h"
+
+#include <BuildPlugin_SubShapes.h>
+
+#include <ModelHighAPI_Interface.h>
+#include <ModelHighAPI_Macro.h>
+
+class ModelHighAPI_Selection;
+
+/// \class BuildAPI_SubShapes
+/// \ingroup CPPHighAPI
+/// \brief Interface for SubShapes feature.
+class BuildAPI_SubShapes: public ModelHighAPI_Interface
+{
+public:
+ /// Constructor without values.
+ BUILDAPI_EXPORT
+ explicit BuildAPI_SubShapes(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+
+ /// Constructor with values.
+ BUILDAPI_EXPORT
+ explicit BuildAPI_SubShapes(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const ModelHighAPI_Selection& theBaseShape,
+ const std::list<ModelHighAPI_Selection>& theSubShapes);
+
+ /// Destructor.
+ BUILDAPI_EXPORT
+ virtual ~BuildAPI_SubShapes();
+
+ INTERFACE_2(BuildPlugin_SubShapes::ID(),
+ baseShape, BuildPlugin_SubShapes::BASE_SHAPE_ID(), ModelAPI_AttributeSelection, /** Base shape */,
+ subShapes, BuildPlugin_SubShapes::SUBSHAPES_ID(), ModelAPI_AttributeSelectionList, /** Sub-shapes */)
+
+ /// Modify base attribute of the feature.
+ BUILDAPI_EXPORT
+ void setBaseShape(const ModelHighAPI_Selection& theBaseShape);
+
+ /// Modify sub-shapes attribute of the feature.
+ BUILDAPI_EXPORT
+ void setSubShapes(const std::list<ModelHighAPI_Selection>& theSubShapes);
+};
+
+/// Pointer on SubShapes object.
+typedef std::shared_ptr<BuildAPI_SubShapes> SubShapesPtr;
+
+/// \ingroup CPPHighAPI
+/// \brief Create SubShapes feature.
+BUILDAPI_EXPORT
+SubShapesPtr addSubShapes(const std::shared_ptr<ModelAPI_Document>& thePart,
+ const ModelHighAPI_Selection& theBaseShape,
+ const std::list<ModelHighAPI_Selection>& theSubShapes);
+
+#endif // BuildAPI_SubShapes_H_
#include "BuildAPI_Edge.h"
#include "BuildAPI_Face.h"
#include "BuildAPI_Shell.h"
+ #include "BuildAPI_SubShapes.h"
#include "BuildAPI_Vertex.h"
#include "BuildAPI_Wire.h"
BuildAPI_Edge.h
BuildAPI_Face.h
BuildAPI_Shell.h
+ BuildAPI_SubShapes.h
BuildAPI_Vertex.h
BuildAPI_Wire.h
)
BuildAPI_Edge.cpp
BuildAPI_Face.cpp
BuildAPI_Shell.cpp
+ BuildAPI_SubShapes.cpp
BuildAPI_Vertex.cpp
BuildAPI_Wire.cpp
)