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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef FeaturesAPI_Translation_H_
22 #define FeaturesAPI_Translation_H_
24 #include "FeaturesAPI.h"
26 #include <FeaturesPlugin_Translation.h>
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
31 class ModelHighAPI_Double;
32 class ModelHighAPI_Dumper;
33 class ModelHighAPI_Selection;
35 /// \class FeaturesAPI_Translation
36 /// \ingroup CPPHighAPI
37 /// \brief Interface for Translation feature.
38 class FeaturesAPI_Translation: public ModelHighAPI_Interface
41 /// Constructor without values.
43 explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
45 /// Constructor with values.
47 explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
48 const std::list<ModelHighAPI_Selection>& theMainObjects,
49 const ModelHighAPI_Selection& theAxisObject,
50 const ModelHighAPI_Double& theDistance);
52 /// Constructor with values.
54 explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
55 const std::list<ModelHighAPI_Selection>& theMainObjects,
56 const ModelHighAPI_Double& theDx,
57 const ModelHighAPI_Double& theDy,
58 const ModelHighAPI_Double& theDz);
60 /// Constructor with values.
62 explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
63 const std::list<ModelHighAPI_Selection>& theMainObjects,
64 const ModelHighAPI_Selection& theStartPoint,
65 const ModelHighAPI_Selection& theEndPoint);
69 virtual ~FeaturesAPI_Translation();
71 INTERFACE_9(FeaturesPlugin_Translation::ID(),
72 creationMethod, FeaturesPlugin_Translation::CREATION_METHOD(),
73 ModelAPI_AttributeString, /** Creation method */,
74 mainObjects, FeaturesPlugin_Translation::OBJECTS_LIST_ID(),
75 ModelAPI_AttributeSelectionList, /** Main objects */,
76 axisObject, FeaturesPlugin_Translation::AXIS_OBJECT_ID(),
77 ModelAPI_AttributeSelection, /** Axis object */,
78 distance, FeaturesPlugin_Translation::DISTANCE_ID(),
79 ModelAPI_AttributeDouble, /** Distance */,
80 dx, FeaturesPlugin_Translation::DX_ID(),
81 ModelAPI_AttributeDouble, /** Dimension in X */,
82 dy, FeaturesPlugin_Translation::DY_ID(),
83 ModelAPI_AttributeDouble, /** Dimension in Y */,
84 dz, FeaturesPlugin_Translation::DZ_ID(),
85 ModelAPI_AttributeDouble, /** Dimension in Z */,
86 startPoint, FeaturesPlugin_Translation::START_POINT_ID(),
87 ModelAPI_AttributeSelection, /** Start point object */,
88 endPoint, FeaturesPlugin_Translation::END_POINT_ID(),
89 ModelAPI_AttributeSelection, /** End point object */
94 void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
96 /// Modify CreationMethod, axis_object, distance attributes of the feature.
98 void setAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
99 const ModelHighAPI_Double& theDistance);
101 /// Modify CreationMethod, dx, dy, dz attributes of the feature.
103 void setDimensions(const ModelHighAPI_Double& theDx,
104 const ModelHighAPI_Double& theDy,
105 const ModelHighAPI_Double& theDz);
107 /// Modify CreationMethod, start_point, end_point attributes of the feature.
109 void setPoints(const ModelHighAPI_Selection& theStartPoint,
110 const ModelHighAPI_Selection& theEndPoint);
112 /// Dump wrapped feature
114 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
117 /// Pointer on Translation object.
118 typedef std::shared_ptr<FeaturesAPI_Translation> TranslationPtr;
120 /// \ingroup CPPHighAPI
121 /// \brief Create Translation feature.
123 TranslationPtr addTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
124 const std::list<ModelHighAPI_Selection>& theMainObjects,
125 const ModelHighAPI_Selection& theAxisObject,
126 const ModelHighAPI_Double& theDistance);
128 /// \ingroup CPPHighAPI
129 /// \brief Create Translation feature.
131 TranslationPtr addTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
132 const std::list<ModelHighAPI_Selection>& theMainObjects,
133 const ModelHighAPI_Double& theDx,
134 const ModelHighAPI_Double& theDy,
135 const ModelHighAPI_Double& theDz);
137 /// \ingroup CPPHighAPI
138 /// \brief Create Translation feature.
140 TranslationPtr addTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
141 const std::list<ModelHighAPI_Selection>& theMainObjects,
142 const ModelHighAPI_Selection& theStartPoint,
143 const ModelHighAPI_Selection& theEndPoint);
145 #endif // FeaturesAPI_Translation_H_