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_Dumper;
18 class ModelHighAPI_Selection;
20 /// \class FeaturesAPI_Placement
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for Placement feature.
23 class FeaturesAPI_Placement: public ModelHighAPI_Interface
26 /// Constructor without values.
28 explicit FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature>& theFeature);
30 /// Constructor with values.
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);
41 virtual ~FeaturesAPI_Placement();
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 */)
52 void setObjects(const std::list<ModelHighAPI_Selection>& theObjects);
56 void setStartShape(const ModelHighAPI_Selection& theStartShape);
60 void setEndShape(const ModelHighAPI_Selection& theEndShape);
62 /// Set reverse direction flag.
64 void setReverseDirection(const bool theReverseDirection);
66 /// Set centering flag.
68 void setCentering(const bool theCentering);
70 /// Dump wrapped feature
72 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
75 /// Pointer on Placement object.
76 typedef std::shared_ptr<FeaturesAPI_Placement> PlacementPtr;
78 /// \ingroup CPPHighAPI
79 /// \brief Create Placement feature.
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);
88 #endif // FeaturesAPI_Placement_H_