SHAPER  9.12.0
FeaturesAPI_Translation.h
1 // Copyright (C) 2014-2023 CEA, EDF
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef FeaturesAPI_Translation_H_
21 #define FeaturesAPI_Translation_H_
22 
23 #include "FeaturesAPI.h"
24 
25 #include <FeaturesPlugin_Translation.h>
26 
27 #include <ModelHighAPI_Double.h>
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
30 #include <ModelHighAPI_Selection.h>
31 
33 
38 {
39 public:
41  FEATURESAPI_EXPORT
42  explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43 
45  FEATURESAPI_EXPORT
46  explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
47  const std::list<ModelHighAPI_Selection>& theMainObjects,
48  const ModelHighAPI_Selection& theAxisObject,
49  const ModelHighAPI_Double& theDistance);
50 
52  FEATURESAPI_EXPORT
53  explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
54  const std::list<ModelHighAPI_Selection>& theMainObjects,
55  const ModelHighAPI_Double& theDx,
56  const ModelHighAPI_Double& theDy,
57  const ModelHighAPI_Double& theDz);
58 
60  FEATURESAPI_EXPORT
61  explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
62  const std::list<ModelHighAPI_Selection>& theMainObjects,
63  const ModelHighAPI_Selection& theStartPoint,
64  const ModelHighAPI_Selection& theEndPoint);
65 
67  FEATURESAPI_EXPORT
68  virtual ~FeaturesAPI_Translation();
69 
70  INTERFACE_9(FeaturesPlugin_Translation::ID(),
89  )
90 
91 
92  FEATURESAPI_EXPORT
93  void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
94 
96  FEATURESAPI_EXPORT
97  void setAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
98  const ModelHighAPI_Double& theDistance);
99 
101  FEATURESAPI_EXPORT
102  void setDimensions(const ModelHighAPI_Double& theDx,
103  const ModelHighAPI_Double& theDy,
104  const ModelHighAPI_Double& theDz);
105 
107  FEATURESAPI_EXPORT
108  void setPoints(const ModelHighAPI_Selection& theStartPoint,
109  const ModelHighAPI_Selection& theEndPoint);
110 
112  FEATURESAPI_EXPORT
113  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
114 };
115 
117 typedef std::shared_ptr<FeaturesAPI_Translation> TranslationPtr;
118 
119 #define DUMMY std::pair<ModelHighAPI_Selection, ModelHighAPI_Double>()
120 
123 FEATURESAPI_EXPORT TranslationPtr addTranslation(
124  const std::shared_ptr<ModelAPI_Document>& part,
125  const std::list<ModelHighAPI_Selection>& objects,
126  const std::pair<ModelHighAPI_Selection, ModelHighAPI_Double>& deprecated1 = DUMMY,
127  const std::pair<ModelHighAPI_Selection, ModelHighAPI_Double>& deprecated2 = DUMMY,
128  const std::pair<ModelHighAPI_Selection, ModelHighAPI_Double>& deprecated3 = DUMMY,
131  const std::list<ModelHighAPI_Double>& vector = std::list<ModelHighAPI_Double>(),
134  const bool keepSubResults = false );
135 
136 #endif // FeaturesAPI_Translation_H_
Interface for Translation feature.
Definition: FeaturesAPI_Translation.h:38
virtual std::shared_ptr< ModelAPI_AttributeString > creationMethod() const
Creation method.
Definition: FeaturesAPI_Translation.h:89
virtual std::shared_ptr< ModelAPI_AttributeDouble > dx() const
Dimension in X.
Definition: FeaturesAPI_Translation.h:89
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: FeaturesAPI_Translation.cpp:127
virtual std::shared_ptr< ModelAPI_AttributeDouble > dz() const
Dimension in Z.
Definition: FeaturesAPI_Translation.h:89
virtual std::shared_ptr< ModelAPI_AttributeDouble > distance() const
Distance.
Definition: FeaturesAPI_Translation.h:89
virtual std::shared_ptr< ModelAPI_AttributeSelection > startPoint() const
Start point object.
Definition: FeaturesAPI_Translation.h:89
void setPoints(const ModelHighAPI_Selection &theStartPoint, const ModelHighAPI_Selection &theEndPoint)
Modify CreationMethod, start_point, end_point attributes of the feature.
Definition: FeaturesAPI_Translation.cpp:116
virtual std::shared_ptr< ModelAPI_AttributeSelection > endPoint() const
End point object.
Definition: FeaturesAPI_Translation.h:89
virtual std::shared_ptr< ModelAPI_AttributeDouble > dy() const
Dimension in Y.
Definition: FeaturesAPI_Translation.h:89
virtual std::shared_ptr< ModelAPI_AttributeSelection > axisObject() const
Axis object.
Definition: FeaturesAPI_Translation.h:89
void setDimensions(const ModelHighAPI_Double &theDx, const ModelHighAPI_Double &theDy, const ModelHighAPI_Double &theDz)
Modify CreationMethod, dx, dy, dz attributes of the feature.
Definition: FeaturesAPI_Translation.cpp:103
virtual std::shared_ptr< ModelAPI_AttributeSelectionList > mainObjects() const
Main objects.
Definition: FeaturesAPI_Translation.h:89
FeaturesAPI_Translation(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: FeaturesAPI_Translation.cpp:26
void setMainObjects(const std::list< ModelHighAPI_Selection > &theMainObjects)
Set main objects.
Definition: FeaturesAPI_Translation.cpp:83
void setAxisAndDistance(const ModelHighAPI_Selection &theAxisObject, const ModelHighAPI_Double &theDistance)
Modify CreationMethod, axis_object, distance attributes of the feature.
Definition: FeaturesAPI_Translation.cpp:92
virtual ~FeaturesAPI_Translation()
Destructor.
Definition: FeaturesAPI_Translation.cpp:77
static const std::string & START_POINT_ID()
Attribute name of start point.
Definition: FeaturesPlugin_Translation.h:113
static const std::string & END_POINT_ID()
Attribute name of end point.
Definition: FeaturesPlugin_Translation.h:120
static const std::string & DY_ID()
Attribute name of dimension in Y.
Definition: FeaturesPlugin_Translation.h:99
static const std::string & ID()
Translation kind.
Definition: FeaturesPlugin_Translation.h:36
static const std::string & OBJECTS_LIST_ID()
Attribute name of referenced objects.
Definition: FeaturesPlugin_Translation.h:71
static const std::string & CREATION_METHOD()
Attribute name for creation method.
Definition: FeaturesPlugin_Translation.h:43
static const std::string & DZ_ID()
Attribute name of dimension in Z.
Definition: FeaturesPlugin_Translation.h:106
static const std::string & DISTANCE_ID()
Attribute name of distance.
Definition: FeaturesPlugin_Translation.h:85
static const std::string & AXIS_OBJECT_ID()
Attribute name of an axis.
Definition: FeaturesPlugin_Translation.h:78
static const std::string & DX_ID()
Attribute name of dimension in X.
Definition: FeaturesPlugin_Translation.h:92
Attribute that contains real value with double precision.
Definition: ModelAPI_AttributeDouble.h:34
Attribute that contains list of references to the sub-shapes with possibility to manage them.
Definition: ModelAPI_AttributeSelectionList.h:37
Attribute that contains reference to the sub-shape of some result, the selected shape.
Definition: ModelAPI_AttributeSelection.h:35
API for the attribute that contains std (null terminated) string.
Definition: ModelAPI_AttributeString.h:33
Class for filling ModelAPI_AttributeDouble.
Definition: ModelHighAPI_Double.h:37
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Base class for feature interfaces.
Definition: ModelHighAPI_Interface.h:42
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
TranslationPtr addTranslation(const std::shared_ptr< ModelAPI_Document > &part, const std::list< ModelHighAPI_Selection > &objects, const std::pair< ModelHighAPI_Selection, ModelHighAPI_Double > &deprecated1=std::pair< ModelHighAPI_Selection, ModelHighAPI_Double >(), const std::pair< ModelHighAPI_Selection, ModelHighAPI_Double > &deprecated2=std::pair< ModelHighAPI_Selection, ModelHighAPI_Double >(), const std::pair< ModelHighAPI_Selection, ModelHighAPI_Double > &deprecated3=std::pair< ModelHighAPI_Selection, ModelHighAPI_Double >(), const ModelHighAPI_Selection &axis=ModelHighAPI_Selection(), const ModelHighAPI_Double &distance=ModelHighAPI_Double(0.0), const std::list< ModelHighAPI_Double > &vector=std::list< ModelHighAPI_Double >(), const ModelHighAPI_Selection &startPoint=ModelHighAPI_Selection(), const ModelHighAPI_Selection &endPoint=ModelHighAPI_Selection(), const bool keepSubResults=false)
Create Translation feature.
Definition: FeaturesAPI_Translation.cpp:165