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(),
45 ModelAPI_AttributeSelectionList, /** Main objects */,
46 startShape, FeaturesPlugin_Placement::START_SHAPE_ID(),
47 ModelAPI_AttributeSelection, /** Start shape */,
48 endShape, FeaturesPlugin_Placement::END_SHAPE_ID(),
49 ModelAPI_AttributeSelection, /** End shape */,
50 reverseDirection, FeaturesPlugin_Placement::REVERSE_ID(),
51 ModelAPI_AttributeBoolean, /** Reverse direction flag */,
52 centering, FeaturesPlugin_Placement::CENTERING_ID(),
53 ModelAPI_AttributeBoolean, /** Centering flag */)
57 void setObjects(const std::list<ModelHighAPI_Selection>& theObjects);
61 void setStartShape(const ModelHighAPI_Selection& theStartShape);
65 void setEndShape(const ModelHighAPI_Selection& theEndShape);
67 /// Set reverse direction flag.
69 void setReverseDirection(const bool theReverseDirection);
71 /// Set centering flag.
73 void setCentering(const bool theCentering);
75 /// Dump wrapped feature
77 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
80 /// Pointer on Placement object.
81 typedef std::shared_ptr<FeaturesAPI_Placement> PlacementPtr;
83 /// \ingroup CPPHighAPI
84 /// \brief Create Placement feature.
86 PlacementPtr addPlacement(const std::shared_ptr<ModelAPI_Document>& thePart,
87 const std::list<ModelHighAPI_Selection>& theObjects,
88 const ModelHighAPI_Selection& theStartShape,
89 const ModelHighAPI_Selection& theEndShape,
90 const bool theReverseDirection = false,
91 const bool theCentering = false);
93 #endif // FeaturesAPI_Placement_H_