Salome HOME
updated copyright message
[modules/shaper.git] / src / SketchAPI / SketchAPI_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 SRC_SKETCHAPI_SKETCHAPI_TRANSLATION_H_
21 #define SRC_SKETCHAPI_SKETCHAPI_TRANSLATION_H_
22
23 //--------------------------------------------------------------------------------------
24 #include "SketchAPI.h"
25 #include "SketchAPI_SketchEntity.h"
26
27 #include <list>
28
29 #include <SketchPlugin_MultiTranslation.h>
30
31 #include <ModelHighAPI_Interface.h>
32 #include <ModelHighAPI_Macro.h>
33 //--------------------------------------------------------------------------------------
34 class ModelAPI_Object;
35 class ModelHighAPI_Integer;
36 class ModelHighAPI_RefAttr;
37 //--------------------------------------------------------------------------------------
38 /**\class SketchAPI_Translation
39  * \ingroup CPPHighAPI
40  * \brief Interface for Translation feature
41  */
42 class SketchAPI_Translation : public ModelHighAPI_Interface
43 {
44 public:
45   /// Constructor without values
46   SKETCHAPI_EXPORT
47   explicit SketchAPI_Translation(const std::shared_ptr<ModelAPI_Feature> & theFeature);
48   /// Constructor with values
49   SKETCHAPI_EXPORT
50   SketchAPI_Translation(const std::shared_ptr<ModelAPI_Feature> & theFeature,
51                         const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
52                         const ModelHighAPI_RefAttr & thePoint1,
53                         const ModelHighAPI_RefAttr & thePoint2,
54                         const ModelHighAPI_Integer & theNumberOfObjects,
55                         bool theFullValue = false);
56   /// Destructor
57   SKETCHAPI_EXPORT
58   virtual ~SketchAPI_Translation();
59
60   INTERFACE_7(SketchPlugin_MultiTranslation::ID(),
61               translationList, SketchPlugin_MultiTranslation::TRANSLATION_LIST_ID(),
62               ModelAPI_AttributeRefList, /** Translation list */,
63               startPoint, SketchPlugin_MultiTranslation::START_POINT_ID(),
64               ModelAPI_AttributeRefAttr, /** Start point */,
65               endPoint, SketchPlugin_MultiTranslation::END_POINT_ID(),
66               ModelAPI_AttributeRefAttr, /** Start point */,
67               numberOfObjects, SketchPlugin_MultiTranslation::NUMBER_OF_OBJECTS_ID(),
68               ModelAPI_AttributeInteger, /** Number of objects */,
69               valueType, SketchPlugin_MultiTranslation::VALUE_TYPE(),
70               ModelAPI_AttributeString, /** Value type */,
71               referenceObjects, SketchPlugin_MultiTranslation::ENTITY_A(),
72               ModelAPI_AttributeRefList, /** Reference objects */,
73               translatedObjects, SketchPlugin_MultiTranslation::ENTITY_B(),
74               ModelAPI_AttributeRefList, /** Translationed objects */
75   )
76
77   /// Set list of objects to be translated
78   SKETCHAPI_EXPORT
79   void setTranslationList(const std::list<std::shared_ptr<ModelAPI_Object> >& theObjects);
80
81   /// List of translated objects.
82   /// [DEPRECATED]: use translatedList() instead.
83   SKETCHAPI_EXPORT
84   std::list<std::shared_ptr<SketchAPI_SketchEntity> > translated() const;
85
86   /// List of translated objects.
87   SKETCHAPI_EXPORT
88   std::list<std::shared_ptr<SketchAPI_SketchEntity> > translatedList() const;
89
90   /// Dump wrapped feature
91   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
92 };
93
94 //! Pointer on Translation object
95 typedef std::shared_ptr<SketchAPI_Translation> TranslationPtr;
96
97 //--------------------------------------------------------------------------------------
98 //--------------------------------------------------------------------------------------
99 #endif /* SRC_SKETCHAPI_SKETCHAPI_TRANSLATION_H_ */