1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
20 #ifndef FeaturesAPI_Placement_H_
21 #define FeaturesAPI_Placement_H_
23 #include "FeaturesAPI.h"
25 #include <FeaturesPlugin_Placement.h>
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
30 class ModelHighAPI_Dumper;
31 class ModelHighAPI_Selection;
33 /// \class FeaturesAPI_Placement
34 /// \ingroup CPPHighAPI
35 /// \brief Interface for Placement feature.
36 class FeaturesAPI_Placement: public ModelHighAPI_Interface
39 /// Constructor without values.
41 explicit FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43 /// Constructor with values.
45 FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature>& theFeature,
46 const std::list<ModelHighAPI_Selection>& theObjects,
47 const ModelHighAPI_Selection& theStartShape,
48 const ModelHighAPI_Selection& theEndShape,
49 const bool theReverseDirection = false,
50 const bool theCentering = false);
54 virtual ~FeaturesAPI_Placement();
56 INTERFACE_5(FeaturesPlugin_Placement::ID(),
57 objects, FeaturesPlugin_Placement::OBJECTS_LIST_ID(),
58 ModelAPI_AttributeSelectionList, /** Main objects */,
59 startShape, FeaturesPlugin_Placement::START_SHAPE_ID(),
60 ModelAPI_AttributeSelection, /** Start shape */,
61 endShape, FeaturesPlugin_Placement::END_SHAPE_ID(),
62 ModelAPI_AttributeSelection, /** End shape */,
63 reverseDirection, FeaturesPlugin_Placement::REVERSE_ID(),
64 ModelAPI_AttributeBoolean, /** Reverse direction flag */,
65 centering, FeaturesPlugin_Placement::CENTERING_ID(),
66 ModelAPI_AttributeBoolean, /** Centering flag */)
70 void setObjects(const std::list<ModelHighAPI_Selection>& theObjects);
74 void setStartShape(const ModelHighAPI_Selection& theStartShape);
78 void setEndShape(const ModelHighAPI_Selection& theEndShape);
80 /// Set reverse direction flag.
82 void setReverseDirection(const bool theReverseDirection);
84 /// Set centering flag.
86 void setCentering(const bool theCentering);
88 /// Dump wrapped feature
90 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
93 /// Pointer on Placement object.
94 typedef std::shared_ptr<FeaturesAPI_Placement> PlacementPtr;
96 /// \ingroup CPPHighAPI
97 /// \brief Create Placement feature.
99 PlacementPtr addPlacement(const std::shared_ptr<ModelAPI_Document>& thePart,
100 const std::list<ModelHighAPI_Selection>& theObjects,
101 const ModelHighAPI_Selection& theStartShape,
102 const ModelHighAPI_Selection& theEndShape,
103 const bool theReverseDirection = false,
104 const bool theCentering = false);
106 #endif // FeaturesAPI_Placement_H_