1 // Copyright (C) 2014-2020 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
20 #ifndef SRC_SKETCHAPI_SKETCHAPI_TRANSLATION_H_
21 #define SRC_SKETCHAPI_SKETCHAPI_TRANSLATION_H_
23 //--------------------------------------------------------------------------------------
24 #include "SketchAPI.h"
25 #include "SketchAPI_SketchEntity.h"
29 #include <SketchPlugin_MultiTranslation.h>
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
40 * \brief Interface for Translation feature
42 class SketchAPI_Translation : public ModelHighAPI_Interface
45 /// Constructor without values
47 explicit SketchAPI_Translation(const std::shared_ptr<ModelAPI_Feature> & theFeature);
48 /// Constructor with values
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);
58 virtual ~SketchAPI_Translation();
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 */
77 /// Set list of objects to be translated
79 void setTranslationList(const std::list<std::shared_ptr<ModelAPI_Object> >& theObjects);
81 /// List of translated objects.
82 /// [DEPRECATED]: use translatedList() instead.
84 std::list<std::shared_ptr<SketchAPI_SketchEntity> > translated() const;
86 /// List of translated objects.
88 std::list<std::shared_ptr<SketchAPI_SketchEntity> > translatedList() const;
90 /// Dump wrapped feature
91 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
94 //! Pointer on Translation object
95 typedef std::shared_ptr<SketchAPI_Translation> TranslationPtr;
97 //--------------------------------------------------------------------------------------
98 //--------------------------------------------------------------------------------------
99 #endif /* SRC_SKETCHAPI_SKETCHAPI_TRANSLATION_H_ */