SHAPER 9.16.0
SketchAPI_Translation.h
1// Copyright (C) 2014-2026 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//--------------------------------------------------------------------------------------
34class ModelAPI_Object;
37//--------------------------------------------------------------------------------------
43{
44public:
46 SKETCHAPI_EXPORT
47 explicit SketchAPI_Translation(const std::shared_ptr<ModelAPI_Feature> & theFeature);
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);
57 SKETCHAPI_EXPORT
58 virtual ~SketchAPI_Translation();
59
75 )
76
77
78 SKETCHAPI_EXPORT
79 void setTranslationList(const std::list<std::shared_ptr<ModelAPI_Object> >& theObjects);
80
83 SKETCHAPI_EXPORT
84 std::list<std::shared_ptr<SketchAPI_SketchEntity> > translated() const;
85
87 SKETCHAPI_EXPORT
88 std::list<std::shared_ptr<SketchAPI_SketchEntity> > translatedList() const;
89
91 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
92};
93
95typedef std::shared_ptr<SketchAPI_Translation> TranslationPtr;
96
97//--------------------------------------------------------------------------------------
98//--------------------------------------------------------------------------------------
99#endif /* SRC_SKETCHAPI_SKETCHAPI_TRANSLATION_H_ */
API for the attribute that contains integer (int).
Definition: ModelAPI_AttributeInteger.h:34
Attribute that contains reference to an attribute of a feature or reference to a feature (switchable)
Definition: ModelAPI_AttributeRefAttr.h:33
Attribute that contains list of references to features (located in the same document).
Definition: ModelAPI_AttributeRefList.h:33
API for the attribute that contains std (null terminated) string.
Definition: ModelAPI_AttributeString.h:33
Represents any object in the data model and in the object browser.
Definition: ModelAPI_Object.h:45
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Class for filling ModelAPI_AttributeInteger.
Definition: ModelHighAPI_Integer.h:36
Base class for feature interfaces.
Definition: ModelHighAPI_Interface.h:46
Class for filling ModelAPI_AttributeRefAttr.
Definition: ModelHighAPI_RefAttr.h:41
Base class for Sketch feature interfaces.
Definition: SketchAPI_SketchEntity.h:38
Interface for Translation feature.
Definition: SketchAPI_Translation.h:43
std::list< std::shared_ptr< SketchAPI_SketchEntity > > translated() const
List of translated objects.
Definition: SketchAPI_Translation.cpp:65
virtual std::shared_ptr< ModelAPI_AttributeRefAttr > startPoint() const
Start point.
Definition: SketchAPI_Translation.h:75
SketchAPI_Translation(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: SketchAPI_Translation.cpp:28
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: SketchAPI_Translation.cpp:102
std::list< std::shared_ptr< SketchAPI_SketchEntity > > translatedList() const
List of translated objects.
Definition: SketchAPI_Translation.cpp:80
virtual std::shared_ptr< ModelAPI_AttributeRefList > referenceObjects() const
Reference objects.
Definition: SketchAPI_Translation.h:75
virtual std::shared_ptr< ModelAPI_AttributeInteger > numberOfObjects() const
Number of objects.
Definition: SketchAPI_Translation.h:75
virtual std::shared_ptr< ModelAPI_AttributeString > valueType() const
Value type.
Definition: SketchAPI_Translation.h:75
virtual ~SketchAPI_Translation()
Destructor.
Definition: SketchAPI_Translation.cpp:54
void setTranslationList(const std::list< std::shared_ptr< ModelAPI_Object > > &theObjects)
Set list of objects to be translated.
Definition: SketchAPI_Translation.cpp:58
virtual std::shared_ptr< ModelAPI_AttributeRefAttr > endPoint() const
Start point.
Definition: SketchAPI_Translation.h:75
virtual std::shared_ptr< ModelAPI_AttributeRefList > translationList() const
Translation list.
Definition: SketchAPI_Translation.h:75
virtual std::shared_ptr< ModelAPI_AttributeRefList > translatedObjects() const
Translationed objects.
Definition: SketchAPI_Translation.h:75
static const std::string & ENTITY_A()
First entity for the constraint.
Definition: SketchPlugin_Constraint.h:58
static const std::string & ENTITY_B()
Second entity for the constraint.
Definition: SketchPlugin_Constraint.h:64
static const std::string & START_POINT_ID()
Start point of translation.
Definition: SketchPlugin_MultiTranslation.h:70
static const std::string & ID()
Multi-translation kind.
Definition: SketchPlugin_MultiTranslation.h:43
static const std::string & VALUE_TYPE()
attribute name for first point
Definition: SketchPlugin_MultiTranslation.h:63
static const std::string & TRANSLATION_LIST_ID()
List of objects to be mirrored.
Definition: SketchPlugin_MultiTranslation.h:56
static const std::string & NUMBER_OF_OBJECTS_ID()
Total number of objects, initial and translated objects.
Definition: SketchPlugin_MultiTranslation.h:84
static const std::string & END_POINT_ID()
End point of translation.
Definition: SketchPlugin_MultiTranslation.h:77