Salome HOME
Issue #1629 : it is not anymore possible to select entities first in the sketcher...
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Placement.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesAPI_Placement.h
4 // Created:     07 June 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef FeaturesAPI_Placement_H_
8 #define FeaturesAPI_Placement_H_
9
10 #include "FeaturesAPI.h"
11
12 #include <FeaturesPlugin_Placement.h>
13
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
16
17 class ModelHighAPI_Selection;
18
19 /// \class FeaturesAPI_Placement
20 /// \ingroup CPPHighAPI
21 /// \brief Interface for Placement feature.
22 class FeaturesAPI_Placement: public ModelHighAPI_Interface
23 {
24 public:
25   /// Constructor without values.
26   FEATURESAPI_EXPORT
27   explicit FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature>& theFeature);
28
29   /// Constructor with values.
30   FEATURESAPI_EXPORT
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);
37
38   /// Destructor.
39   FEATURESAPI_EXPORT
40   virtual ~FeaturesAPI_Placement();
41
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 */)
48
49   /// Set objects.
50   FEATURESAPI_EXPORT
51   void setObjects(const std::list<ModelHighAPI_Selection>& theObjects);
52
53   /// Set start shape.
54   FEATURESAPI_EXPORT
55   void setStartShape(const ModelHighAPI_Selection& theStartShape);
56
57   /// Set end shape.
58   FEATURESAPI_EXPORT
59   void setEndShape(const ModelHighAPI_Selection& theEndShape);
60
61   /// Set reverse direction flag.
62   FEATURESAPI_EXPORT
63   void setReverseDirection(const bool theReverseDirection);
64
65   /// Set centering flag.
66   FEATURESAPI_EXPORT
67   void setCentering(const bool theCentering);
68 };
69
70 /// Pointer on Placement object.
71 typedef std::shared_ptr<FeaturesAPI_Placement> PlacementPtr;
72
73 /// \ingroup CPPHighAPI
74 /// \brief Create Placement feature.
75 FEATURESAPI_EXPORT
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);
82
83 #endif // FeaturesAPI_Placement_H_