SET(PROJECT_HEADERS
FeaturesAPI.h
FeaturesAPI_Boolean.h
+ FeaturesAPI_Group.h
FeaturesAPI_Placement.h
FeaturesAPI_Rotation.h
FeaturesAPI_Translation.h
SET(PROJECT_SOURCES
FeaturesAPI_Boolean.cpp
+ FeaturesAPI_Group.cpp
FeaturesAPI_Placement.cpp
FeaturesAPI_Rotation.cpp
FeaturesAPI_Translation.cpp
// shared pointers
%shared_ptr(FeaturesAPI_Boolean)
+%shared_ptr(FeaturesAPI_Group)
%shared_ptr(FeaturesAPI_Placement)
%shared_ptr(FeaturesAPI_Rotation)
%shared_ptr(FeaturesAPI_Translation)
// all supported interfaces
%include "FeaturesAPI_Boolean.h"
+%include "FeaturesAPI_Group.h"
%include "FeaturesAPI_Placement.h"
%include "FeaturesAPI_Rotation.h"
%include "FeaturesAPI_Translation.h"
#include <ModelHighAPI_Tools.h>
//==================================================================================================
-FeaturesAPI_Boolean::FeaturesAPI_Boolean(const std::shared_ptr<ModelAPI_Feature> & theFeature)
+FeaturesAPI_Boolean::FeaturesAPI_Boolean(const std::shared_ptr<ModelAPI_Feature>& theFeature)
: ModelHighAPI_Interface(theFeature)
{
initialize();
}
//==================================================================================================
-FeaturesAPI_Boolean::FeaturesAPI_Boolean(const std::shared_ptr<ModelAPI_Feature> & theFeature,
+FeaturesAPI_Boolean::FeaturesAPI_Boolean(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const ModelHighAPI_Integer& theBoolType,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects)
// TODO(spo): make add* as static functions of the class
//==================================================================================================
-BooleanPtr addCut(const std::shared_ptr<ModelAPI_Document> & thePart,
+BooleanPtr addCut(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects)
{
}
//==================================================================================================
-BooleanPtr addFuse(const std::shared_ptr<ModelAPI_Document> & thePart,
+BooleanPtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theObjects)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Boolean::ID());
}
//==================================================================================================
-BooleanPtr addFuse(const std::shared_ptr<ModelAPI_Document> & thePart,
+BooleanPtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects)
{
}
//==================================================================================================
-BooleanPtr addCommon(const std::shared_ptr<ModelAPI_Document> & thePart,
+BooleanPtr addCommon(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects)
{
/// \class FeaturesAPI_Boolean
/// \ingroup CPPHighAPI
/// \brief Interface for Boolean feature.
-class FeaturesAPI_Boolean : public ModelHighAPI_Interface
+class FeaturesAPI_Boolean: public ModelHighAPI_Interface
{
public:
/// Constructor without values.
FEATURESAPI_EXPORT
- explicit FeaturesAPI_Boolean(const std::shared_ptr<ModelAPI_Feature> & theFeature);
+ explicit FeaturesAPI_Boolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
/// Constructor with values.
FEATURESAPI_EXPORT
- FeaturesAPI_Boolean(const std::shared_ptr<ModelAPI_Feature> & theFeature,
+ FeaturesAPI_Boolean(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const ModelHighAPI_Integer& theBoolType,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects);
/// \ingroup CPPHighAPI
/// \brief Create Boolean Cut feature.
FEATURESAPI_EXPORT
-BooleanPtr addCut(const std::shared_ptr<ModelAPI_Document> & thePart,
+BooleanPtr addCut(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects);
/// \ingroup CPPHighAPI
/// \brief Create Boolean Fuse feature.
FEATURESAPI_EXPORT
-BooleanPtr addFuse(const std::shared_ptr<ModelAPI_Document> & thePart,
+BooleanPtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theObjects);
/// \ingroup CPPHighAPI
/// \brief Create Boolean Fuse feature.
FEATURESAPI_EXPORT
-BooleanPtr addFuse(const std::shared_ptr<ModelAPI_Document> & thePart,
+BooleanPtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects);
/// \ingroup CPPHighAPI
/// \brief Create Boolean Common feature.
FEATURESAPI_EXPORT
-BooleanPtr addCommon(const std::shared_ptr<ModelAPI_Document> & thePart,
+BooleanPtr addCommon(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects);
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File: FeaturesAPI_Group.cpp
+// Created: 07 June 2016
+// Author: Dmitry Bobylev
+
+#include "FeaturesAPI_Group.h"
+
+#include <ModelHighAPI_Integer.h>
+#include <ModelHighAPI_Selection.h>
+#include <ModelHighAPI_Tools.h>
+
+//==================================================================================================
+FeaturesAPI_Group::FeaturesAPI_Group(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: ModelHighAPI_Interface(theFeature)
+{
+ initialize();
+}
+
+//==================================================================================================
+FeaturesAPI_Group::FeaturesAPI_Group(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theGroupList)
+: ModelHighAPI_Interface(theFeature)
+{
+ if(initialize()) {
+ setGroupList(theGroupList);
+ }
+}
+
+//==================================================================================================
+FeaturesAPI_Group::~FeaturesAPI_Group()
+{
+
+}
+
+//==================================================================================================
+void FeaturesAPI_Group::setGroupList(const std::list<ModelHighAPI_Selection>& theGroupList)
+{
+ fillAttribute(theGroupList, mygroupList);
+
+ execute();
+}
+
+// TODO(spo): make add* as static functions of the class
+//==================================================================================================
+GroupPtr addGroup(const std::shared_ptr<ModelAPI_Document>& thePart,
+ const std::list<ModelHighAPI_Selection>& theGroupList)
+{
+ std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Group::ID());
+ return GroupPtr(new FeaturesAPI_Group(aFeature, theGroupList));
+}
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File: FeaturesAPI_Group.h
+// Created: 07 June 2016
+// Author: Dmitry Bobylev
+
+#ifndef FeaturesAPI_Group_H_
+#define FeaturesAPI_Group_H_
+
+#include "FeaturesAPI.h"
+
+#include <FeaturesPlugin_Group.h>
+
+#include <ModelHighAPI_Interface.h>
+#include <ModelHighAPI_Macro.h>
+
+class ModelHighAPI_Selection;
+
+/// \class FeaturesAPI_Group
+/// \ingroup CPPHighAPI
+/// \brief Interface for Group feature.
+class FeaturesAPI_Group: public ModelHighAPI_Interface
+{
+public:
+ /// Constructor without values.
+ FEATURESAPI_EXPORT
+ explicit FeaturesAPI_Group(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+
+ /// Constructor with values.
+ FEATURESAPI_EXPORT
+ FeaturesAPI_Group(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theGroupList);
+
+ /// Destructor.
+ FEATURESAPI_EXPORT
+ virtual ~FeaturesAPI_Group();
+
+ INTERFACE_1(FeaturesPlugin_Group::ID(),
+ groupList, FeaturesPlugin_Group::LIST_ID()(), ModelAPI_AttributeSelectionList, /** Group list*/)
+
+ /// Set main objects.
+ FEATURESAPI_EXPORT
+ void setGroupList(const std::list<ModelHighAPI_Selection>& theGroupList);
+};
+
+/// Pointer on Group object.
+typedef std::shared_ptr<FeaturesAPI_Group> GroupPtr;
+
+/// \ingroup CPPHighAPI
+/// \brief Create Group feature.
+FEATURESAPI_EXPORT
+GroupPtr addGroup(const std::shared_ptr<ModelAPI_Document>& thePart,
+ const std::list<ModelHighAPI_Selection>& theGroupList);
+
+#endif // FeaturesAPI_Group_H_
#include <ModelHighAPI_Tools.h>
//==================================================================================================
-FeaturesAPI_Placement::FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature> & theFeature)
+FeaturesAPI_Placement::FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature>& theFeature)
: ModelHighAPI_Interface(theFeature)
{
initialize();
}
//==================================================================================================
-FeaturesAPI_Placement::FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature> & theFeature,
+FeaturesAPI_Placement::FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theObjects,
const ModelHighAPI_Selection& theStartShape,
const ModelHighAPI_Selection& theEndShape,
// TODO(spo): make add* as static functions of the class
//==================================================================================================
-PlacementPtr addPlacement(const std::shared_ptr<ModelAPI_Document> & thePart,
+PlacementPtr addPlacement(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theObjects,
const ModelHighAPI_Selection& theStartShape,
const ModelHighAPI_Selection& theEndShape,
/// \class FeaturesAPI_Placement
/// \ingroup CPPHighAPI
/// \brief Interface for Placement feature.
-class FeaturesAPI_Placement : public ModelHighAPI_Interface
+class FeaturesAPI_Placement: public ModelHighAPI_Interface
{
public:
/// Constructor without values.
FEATURESAPI_EXPORT
- explicit FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature> & theFeature);
+ explicit FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature>& theFeature);
/// Constructor with values.
FEATURESAPI_EXPORT
- FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature> & theFeature,
+ FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theObjects,
const ModelHighAPI_Selection& theStartShape,
const ModelHighAPI_Selection& theEndShape,
/// \ingroup CPPHighAPI
/// \brief Create Placement feature.
FEATURESAPI_EXPORT
-PlacementPtr addPlacement(const std::shared_ptr<ModelAPI_Document> & thePart,
+PlacementPtr addPlacement(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theObjects,
const ModelHighAPI_Selection& theStartShape,
const ModelHighAPI_Selection& theEndShape,
#include <ModelHighAPI_Tools.h>
//==================================================================================================
-FeaturesAPI_Rotation::FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature> & theFeature)
+FeaturesAPI_Rotation::FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature>& theFeature)
: ModelHighAPI_Interface(theFeature)
{
initialize();
}
//==================================================================================================
-FeaturesAPI_Rotation::FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature> & theFeature,
+FeaturesAPI_Rotation::FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const ModelHighAPI_Selection& theAxisObject,
const ModelHighAPI_Double& theAngle)
// TODO(spo): make add* as static functions of the class
//==================================================================================================
-RotationPtr addRotation(const std::shared_ptr<ModelAPI_Document> & thePart,
+RotationPtr addRotation(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const ModelHighAPI_Selection& theAxisObject,
const ModelHighAPI_Double& theDistance)
/// \class FeaturesAPI_Rotation
/// \ingroup CPPHighAPI
/// \brief Interface for Rotation feature.
-class FeaturesAPI_Rotation : public ModelHighAPI_Interface
+class FeaturesAPI_Rotation: public ModelHighAPI_Interface
{
public:
/// Constructor without values.
FEATURESAPI_EXPORT
- explicit FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature> & theFeature);
+ explicit FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
/// Constructor with values.
FEATURESAPI_EXPORT
- FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature> & theFeature,
+ FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const ModelHighAPI_Selection& theAxisObject,
const ModelHighAPI_Double& theAngle);
/// \ingroup CPPHighAPI
/// \brief Create Rotation feature.
FEATURESAPI_EXPORT
-RotationPtr addRotation(const std::shared_ptr<ModelAPI_Document> & thePart,
+RotationPtr addRotation(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const ModelHighAPI_Selection& theAxisObject,
const ModelHighAPI_Double& theDistance);
#include <ModelHighAPI_Tools.h>
//==================================================================================================
-FeaturesAPI_Translation::FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature> & theFeature)
+FeaturesAPI_Translation::FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature)
: ModelHighAPI_Interface(theFeature)
{
initialize();
}
//==================================================================================================
-FeaturesAPI_Translation::FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature> & theFeature,
+FeaturesAPI_Translation::FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const ModelHighAPI_Selection& theAxisObject,
const ModelHighAPI_Double& theDistance)
// TODO(spo): make add* as static functions of the class
//==================================================================================================
-TranslationPtr addTranslation(const std::shared_ptr<ModelAPI_Document> & thePart,
+TranslationPtr addTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const ModelHighAPI_Selection& theAxisObject,
const ModelHighAPI_Double& theDistance)
/// \class FeaturesAPI_Translation
/// \ingroup CPPHighAPI
/// \brief Interface for Translation feature.
-class FeaturesAPI_Translation : public ModelHighAPI_Interface
+class FeaturesAPI_Translation: public ModelHighAPI_Interface
{
public:
/// Constructor without values.
FEATURESAPI_EXPORT
- explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature> & theFeature);
+ explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
/// Constructor with values.
FEATURESAPI_EXPORT
- FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature> & theFeature,
+ FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const ModelHighAPI_Selection& theAxisObject,
const ModelHighAPI_Double& theDistance);
/// \ingroup CPPHighAPI
/// \brief Create Translation feature.
FEATURESAPI_EXPORT
-TranslationPtr addTranslation(const std::shared_ptr<ModelAPI_Document> & thePart,
+TranslationPtr addTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const ModelHighAPI_Selection& theAxisObject,
const ModelHighAPI_Double& theDistance);
#include <ModelHighAPI_swig.h>
#include "FeaturesAPI.h"
+ #include "FeaturesAPI_Group.h"
#include "FeaturesAPI_Boolean.h"
#include "FeaturesAPI_Placement.h"
#include "FeaturesAPI_Rotation.h"
FeaturesAPI.FeaturesAPI_Placement(self.part.addFeature("Placement"))
FeaturesAPI.FeaturesAPI_Rotation(self.part.addFeature("Rotation"))
FeaturesAPI.FeaturesAPI_Translation(self.part.addFeature("Translation"))
- model.features.group.Group(self.part.addFeature("Group"))
+ FeaturesAPI.FeaturesAPI_Group(self.part.addFeature("Group"))
model.parameter.Parameter(self.part.addFeature("Parameter"))