]> SALOME platform Git repositories - modules/shaper.git/blob - src/FeaturesAPI/FeaturesAPI_Placement.h
Salome HOME
Issue #1648: Dump Python in the High Level Parameterized Geometry API
[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_Dumper;
18 class ModelHighAPI_Selection;
19
20 /// \class FeaturesAPI_Placement
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for Placement feature.
23 class FeaturesAPI_Placement: public ModelHighAPI_Interface
24 {
25 public:
26   /// Constructor without values.
27   FEATURESAPI_EXPORT
28   explicit FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature>& theFeature);
29
30   /// Constructor with values.
31   FEATURESAPI_EXPORT
32   FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature>& theFeature,
33                         const std::list<ModelHighAPI_Selection>& theObjects,
34                         const ModelHighAPI_Selection& theStartShape,
35                         const ModelHighAPI_Selection& theEndShape,
36                         const bool theReverseDirection = false,
37                         const bool theCentering = false);
38
39   /// Destructor.
40   FEATURESAPI_EXPORT
41   virtual ~FeaturesAPI_Placement();
42
43   INTERFACE_5(FeaturesPlugin_Placement::ID(),
44               objects, FeaturesPlugin_Placement::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList, /** Main objects */,
45               startShape, FeaturesPlugin_Placement::START_SHAPE_ID(), ModelAPI_AttributeSelection, /** Start shape */,
46               endShape, FeaturesPlugin_Placement::END_SHAPE_ID(), ModelAPI_AttributeSelection, /** End shape */,
47               reverseDirection, FeaturesPlugin_Placement::REVERSE_ID(), ModelAPI_AttributeBoolean, /** Reverse direction flag */,
48               centering, FeaturesPlugin_Placement::CENTERING_ID(), ModelAPI_AttributeBoolean, /** Centering flag */)
49
50   /// Set objects.
51   FEATURESAPI_EXPORT
52   void setObjects(const std::list<ModelHighAPI_Selection>& theObjects);
53
54   /// Set start shape.
55   FEATURESAPI_EXPORT
56   void setStartShape(const ModelHighAPI_Selection& theStartShape);
57
58   /// Set end shape.
59   FEATURESAPI_EXPORT
60   void setEndShape(const ModelHighAPI_Selection& theEndShape);
61
62   /// Set reverse direction flag.
63   FEATURESAPI_EXPORT
64   void setReverseDirection(const bool theReverseDirection);
65
66   /// Set centering flag.
67   FEATURESAPI_EXPORT
68   void setCentering(const bool theCentering);
69
70   /// Dump wrapped feature
71   FEATURESAPI_EXPORT
72   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
73 };
74
75 /// Pointer on Placement object.
76 typedef std::shared_ptr<FeaturesAPI_Placement> PlacementPtr;
77
78 /// \ingroup CPPHighAPI
79 /// \brief Create Placement feature.
80 FEATURESAPI_EXPORT
81 PlacementPtr addPlacement(const std::shared_ptr<ModelAPI_Document>& thePart,
82                           const std::list<ModelHighAPI_Selection>& theObjects,
83                           const ModelHighAPI_Selection& theStartShape,
84                           const ModelHighAPI_Selection& theEndShape,
85                           const bool theReverseDirection = false,
86                           const bool theCentering = false);
87
88 #endif // FeaturesAPI_Placement_H_