FeaturesAPI_Extrusion.h
FeaturesAPI_ExtrusionBoolean.h
FeaturesAPI_Group.h
+ FeaturesAPI_Partition.h
FeaturesAPI_Pipe.h
FeaturesAPI_Placement.h
FeaturesAPI_Revolution.h
FeaturesAPI_Extrusion.cpp
FeaturesAPI_ExtrusionBoolean.cpp
FeaturesAPI_Group.cpp
+ FeaturesAPI_Partition.cpp
FeaturesAPI_Pipe.cpp
FeaturesAPI_Placement.cpp
FeaturesAPI_Rotation.cpp
%shared_ptr(FeaturesAPI_ExtrusionCut)
%shared_ptr(FeaturesAPI_ExtrusionFuse)
%shared_ptr(FeaturesAPI_Group)
+%shared_ptr(FeaturesAPI_Partition)
%shared_ptr(FeaturesAPI_Pipe)
%shared_ptr(FeaturesAPI_Placement)
%shared_ptr(FeaturesAPI_Revolution)
%include "FeaturesAPI_Extrusion.h"
%include "FeaturesAPI_ExtrusionBoolean.h"
%include "FeaturesAPI_Group.h"
+%include "FeaturesAPI_Partition.h"
%include "FeaturesAPI_Pipe.h"
%include "FeaturesAPI_Placement.h"
%include "FeaturesAPI_Revolution.h"
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File: FeaturesAPI_Partition.cpp
+// Created: 09 June 2016
+// Author: Dmitry Bobylev
+
+#include "FeaturesAPI_Partition.h"
+
+#include <ModelHighAPI_Tools.h>
+
+//==================================================================================================
+FeaturesAPI_Partition::FeaturesAPI_Partition(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: ModelHighAPI_Interface(theFeature)
+{
+ initialize();
+}
+
+//==================================================================================================
+FeaturesAPI_Partition::FeaturesAPI_Partition(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects)
+: ModelHighAPI_Interface(theFeature)
+{
+ if(initialize()) {
+ setBase(theBaseObjects);
+ }
+}
+
+//==================================================================================================
+FeaturesAPI_Partition::~FeaturesAPI_Partition()
+{
+
+}
+
+//==================================================================================================
+void FeaturesAPI_Partition::setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects)
+{
+ fillAttribute(theBaseObjects, mybaseObjects);
+
+ execute();
+}
+
+// TODO(spo): make add* as static functions of the class
+//==================================================================================================
+PartitionPtr addPartition(const std::shared_ptr<ModelAPI_Document>& thePart,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects)
+{
+ std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Partition::ID());
+ return PartitionPtr(new FeaturesAPI_Partition(aFeature, theBaseObjects));
+}
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File: FeaturesAPI_Partition.h
+// Created: 09 June 2016
+// Author: Dmitry Bobylev
+
+#ifndef FeaturesAPI_Partition_H_
+#define FeaturesAPI_Partition_H_
+
+#include "FeaturesAPI.h"
+
+#include <FeaturesPlugin_Partition.h>
+
+#include <ModelHighAPI_Interface.h>
+#include <ModelHighAPI_Macro.h>
+
+class ModelHighAPI_Selection;
+
+/// \class FeaturesAPI_Partition
+/// \ingroup CPPHighAPI
+/// \brief Interface for Partition feature.
+class FeaturesAPI_Partition: public ModelHighAPI_Interface
+{
+public:
+ /// Constructor without values.
+ FEATURESAPI_EXPORT
+ explicit FeaturesAPI_Partition(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+
+ /// Constructor with values.
+ FEATURESAPI_EXPORT
+ explicit FeaturesAPI_Partition(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects);
+
+ /// Destructor.
+ FEATURESAPI_EXPORT
+ virtual ~FeaturesAPI_Partition();
+
+ INTERFACE_1(FeaturesPlugin_Partition::ID(),
+ baseObjects, FeaturesPlugin_Partition::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */)
+
+ /// Modify base attribute of the feature.
+ FEATURESAPI_EXPORT
+ void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
+};
+
+/// Pointer on Partition object.
+typedef std::shared_ptr<FeaturesAPI_Partition> PartitionPtr;
+
+/// \ingroup CPPHighAPI
+/// \brief Create Partition feature.
+FEATURESAPI_EXPORT
+PartitionPtr addPartition(const std::shared_ptr<ModelAPI_Document>& thePart,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects);
+
+#endif // FeaturesAPI_Partition_H_
#include "FeaturesAPI_Extrusion.h"
#include "FeaturesAPI_ExtrusionBoolean.h"
#include "FeaturesAPI_Group.h"
+ #include "FeaturesAPI_Partition.h"
#include "FeaturesAPI_Pipe.h"
#include "FeaturesAPI_Placement.h"
#include "FeaturesAPI_Revolution.h"