1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesAPI_Placement.h
4 // Created: 07 June 2016
5 // Author: Dmitry Bobylev
7 #ifndef FeaturesAPI_Placement_H_
8 #define FeaturesAPI_Placement_H_
10 #include "FeaturesAPI.h"
12 #include <FeaturesPlugin_Placement.h>
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
17 class ModelHighAPI_Selection;
19 /// \class FeaturesAPI_Placement
20 /// \ingroup CPPHighAPI
21 /// \brief Interface for Placement feature.
22 class FeaturesAPI_Placement : public ModelHighAPI_Interface
25 /// Constructor without values.
27 explicit FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature> & theFeature);
29 /// Constructor with values.
31 FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature> & theFeature,
32 const std::list<ModelHighAPI_Selection>& theObjects,
33 const ModelHighAPI_Selection& theStartShape,
34 const ModelHighAPI_Selection& theEndShape,
35 const bool theReverseDirection = false,
36 const bool theCentering = false);
40 virtual ~FeaturesAPI_Placement();
42 INTERFACE_5(FeaturesPlugin_Placement::ID(),
43 objects, FeaturesPlugin_Placement::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList, /** Main objects */,
44 startShape, FeaturesPlugin_Placement::START_SHAPE_ID(), ModelAPI_AttributeSelection, /** Start shape */,
45 endShape, FeaturesPlugin_Placement::END_SHAPE_ID(), ModelAPI_AttributeSelection, /** End shape */,
46 reverseDirection, FeaturesPlugin_Placement::REVERSE_ID(), ModelAPI_AttributeBoolean, /** Reverse direction flag */,
47 centering, FeaturesPlugin_Placement::CENTERING_ID(), ModelAPI_AttributeBoolean, /** Centering flag */)
51 void setObjects(const std::list<ModelHighAPI_Selection>& theObjects);
55 void setStartShape(const ModelHighAPI_Selection& theStartShape);
59 void setEndShape(const ModelHighAPI_Selection& theEndShape);
61 /// Set reverse direction flag.
63 void setReverseDirection(const bool theReverseDirection);
65 /// Set centering flag.
67 void setCentering(const bool theCentering);
70 /// Pointer on Placement object.
71 typedef std::shared_ptr<FeaturesAPI_Placement> PlacementPtr;
73 /// \ingroup CPPHighAPI
74 /// \brief Create Placement feature.
76 PlacementPtr addPlacement(const std::shared_ptr<ModelAPI_Document> & thePart,
77 const std::list<ModelHighAPI_Selection>& theObjects,
78 const ModelHighAPI_Selection& theStartShape,
79 const ModelHighAPI_Selection& theEndShape,
80 const bool theReverseDirection = false,
81 const bool theCentering = false);
83 #endif // FeaturesAPI_Placement_H_