SHAPER 9.16.0
ModelHighAPI_Tools.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_MODELHIGHAPI_MODELHIGHAPI_TOOLS_H_
21#define SRC_MODELHIGHAPI_MODELHIGHAPI_TOOLS_H_
22
23//--------------------------------------------------------------------------------------
24#include "ModelHighAPI.h"
25#include <ModelAPI_AttributeTables.h>
26
27#include <GeomAPI_Shape.h>
28
29#include <list>
30#include <memory>
31#include <string>
32//--------------------------------------------------------------------------------------
33class GeomAPI_Dir;
34class GeomAPI_Pnt;
35class GeomAPI_Pnt2d;
36//--------------------------------------------------------------------------------------
37class GeomDataAPI_Dir;
41//--------------------------------------------------------------------------------------
55class ModelAPI_Object;
56//--------------------------------------------------------------------------------------
62//--------------------------------------------------------------------------------------
63MODELHIGHAPI_EXPORT
64void fillAttribute(const std::shared_ptr<GeomAPI_Pnt2d> & theValue,
65 const std::shared_ptr<GeomDataAPI_Point2D> & theAttribute);
66
67MODELHIGHAPI_EXPORT
68void fillAttribute(const std::shared_ptr<GeomDataAPI_Point2D> & theAttribute,
69 double theX, double theY);
70
71MODELHIGHAPI_EXPORT
72void fillAttribute(const std::shared_ptr<GeomAPI_Dir> & theValue,
73 const std::shared_ptr<GeomDataAPI_Dir> & theAttribute);
74
75MODELHIGHAPI_EXPORT
76void fillAttribute(const std::shared_ptr<GeomAPI_Pnt> & theValue,
77 const std::shared_ptr<GeomDataAPI_Point> & theAttribute);
78
79//--------------------------------------------------------------------------------------
80MODELHIGHAPI_EXPORT
81void fillAttribute(bool theValue,
82 const std::shared_ptr<ModelAPI_AttributeBoolean> & theAttribute);
83
84MODELHIGHAPI_EXPORT
85void fillAttribute(const ModelHighAPI_Double & theValue,
86 const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute);
87
88MODELHIGHAPI_EXPORT
89void fillAttribute(double theValue,
90 const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute);
91
92MODELHIGHAPI_EXPORT
93void fillAttribute(const ModelHighAPI_Integer & theValue,
94 const std::shared_ptr<ModelAPI_AttributeInteger> & theAttribute);
95
96MODELHIGHAPI_EXPORT
97void fillAttribute(int theValue,
98 const std::shared_ptr<ModelAPI_AttributeInteger> & theAttribute);
99
100MODELHIGHAPI_EXPORT
101void fillAttribute(const ModelHighAPI_RefAttr & theValue,
102 const std::shared_ptr<ModelAPI_AttributeRefAttr> & theAttribute);
103
104MODELHIGHAPI_EXPORT
105void fillAttribute(const std::list<ModelHighAPI_RefAttr> & theValue,
106 const std::shared_ptr<ModelAPI_AttributeRefAttrList> & theAttribute);
107
108MODELHIGHAPI_EXPORT
109void fillAttribute(const ModelHighAPI_Reference & theValue,
110 const std::shared_ptr<ModelAPI_AttributeReference> & theAttribute);
111
112MODELHIGHAPI_EXPORT
113void fillAttribute(const std::list<ModelHighAPI_Reference> & theValue,
114 const std::shared_ptr<ModelAPI_AttributeRefList> & theAttribute);
115
116MODELHIGHAPI_EXPORT
117void fillAttribute(const std::shared_ptr<ModelAPI_Object> & theValue,
118 const std::shared_ptr<ModelAPI_AttributeReference> & theAttribute);
119
120MODELHIGHAPI_EXPORT
121void fillAttribute(const std::list<std::shared_ptr<ModelAPI_Object> > & theValue,
122 const std::shared_ptr<ModelAPI_AttributeRefList> & theAttribute);
123
124MODELHIGHAPI_EXPORT
125void fillAttribute(const std::list<ModelHighAPI_Selection> & theValue,
126 const std::shared_ptr<ModelAPI_AttributeRefList> & theAttribute);
127
128MODELHIGHAPI_EXPORT
129void fillAttribute(const ModelHighAPI_Selection & theValue,
130 const std::shared_ptr<ModelAPI_AttributeSelection> & theAttribute);
131
132MODELHIGHAPI_EXPORT
133void fillAttribute(const std::list<ModelHighAPI_Selection> & theValue,
134 const std::shared_ptr<ModelAPI_AttributeSelectionList> & theAttribute,
135 const bool theIsIgnoreGroups = false);
136
137MODELHIGHAPI_EXPORT
138void fillAttribute(const std::string & theValue,
139 const std::shared_ptr<ModelAPI_AttributeString> & theAttribute);
140
141MODELHIGHAPI_EXPORT
142void fillAttribute(const std::wstring & theValue,
143 const std::shared_ptr<ModelAPI_AttributeString> & theAttribute);
144
145MODELHIGHAPI_EXPORT
146void fillAttribute(const char * theValue,
147 const std::shared_ptr<ModelAPI_AttributeString> & theAttribute);
148
149MODELHIGHAPI_EXPORT
150void fillAttribute(const std::list<std::string> & theValue,
151 const std::shared_ptr<ModelAPI_AttributeStringArray> & theAttribute);
152
153MODELHIGHAPI_EXPORT
154void fillAttribute(const std::list<ModelHighAPI_Integer> & theValue,
155 const std::shared_ptr<ModelAPI_AttributeIntArray> & theAttribute);
156
157MODELHIGHAPI_EXPORT
158void fillAttribute(const std::list<ModelHighAPI_Double> & theValue,
159 const std::shared_ptr<ModelAPI_AttributeDoubleArray> & theAttribute);
160
161MODELHIGHAPI_EXPORT
162void fillAttribute(const std::list<std::shared_ptr<GeomAPI_Pnt2d> > & theValue,
163 const std::shared_ptr<GeomDataAPI_Point2DArray> & theAttribute);
164
165MODELHIGHAPI_EXPORT
166void fillAttribute(const ModelHighAPI_Double & theX,
167 const ModelHighAPI_Double & theY,
168 const ModelHighAPI_Double & theZ,
169 const std::shared_ptr<GeomDataAPI_Point> & theAttribute);
170
171MODELHIGHAPI_EXPORT
172GeomAPI_Shape::ShapeType shapeTypeByStr(std::string theShapeTypeStr);
173
174MODELHIGHAPI_EXPORT
175std::string strByShapeType(GeomAPI_Shape::ShapeType theShapeType);
176
177MODELHIGHAPI_EXPORT
178GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection);
179
180MODELHIGHAPI_EXPORT
181ModelAPI_AttributeTables::ValueType valueTypeByStr(const std::string& theValueTypeStr);
182
183MODELHIGHAPI_EXPORT
184std::string strByValueType(const ModelAPI_AttributeTables::ValueType theType);
185
187enum checkDumpType {
188 CHECK_NAMING = 1,
189 CHECK_GEOMETRICAL = 2,
190 CHECK_NAMING_AND_GEOMETRICAL = 3,
191 CHECK_WEAK = 4,
192};
193
197MODELHIGHAPI_EXPORT
198bool checkPyDump(const std::string& theFilenameNaming,
199 const std::string& theFilenameGeo,
200 const std::string& theFilenameWeak,
201 const checkDumpType theCheckType = CHECK_NAMING_AND_GEOMETRICAL,
202 const bool theCheckPlane = true);
203
204//--------------------------------------------------------------------------------------
205//--------------------------------------------------------------------------------------
206#endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_TOOLS_H_ */
3D direction defined by three normalized coordinates
Definition: GeomAPI_Dir.h:34
2D point defined by two coordinates
Definition: GeomAPI_Pnt2d.h:36
3D point defined by three coordinates
Definition: GeomAPI_Pnt.h:38
ShapeType
Shape type enum.
Definition: GeomAPI_Shape.h:46
Attribute that contains 3D direction coordinates.
Definition: GeomDataAPI_Dir.h:35
Attribute that contains array of 2D point coordinates.
Definition: GeomDataAPI_Point2DArray.h:34
Attribute that contains 2D point coordinates.
Definition: GeomDataAPI_Point2D.h:37
Attribute that contains 3D point coordinates.
Definition: GeomDataAPI_Point.h:36
Attribute that contains boolean value.
Definition: ModelAPI_AttributeBoolean.h:31
API for the attribute that contains several double in the array inside.
Definition: ModelAPI_AttributeDoubleArray.h:32
Attribute that contains real value with double precision.
Definition: ModelAPI_AttributeDouble.h:34
API for the attribute that contains several integers in the array inside.
Definition: ModelAPI_AttributeIntArray.h:36
API for the attribute that contains integer (int).
Definition: ModelAPI_AttributeInteger.h:34
Attribute that contains list of references to features (located in the same document) or references t...
Definition: ModelAPI_AttributeRefAttrList.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
Attribute that contains reference to feature (located in the same document).
Definition: ModelAPI_AttributeReference.h:32
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 several strings in the array inside.
Definition: ModelAPI_AttributeStringArray.h:32
API for the attribute that contains std (null terminated) string.
Definition: ModelAPI_AttributeString.h:33
ValueType
Type of the value in the table.
Definition: ModelAPI_AttributeTables.h:42
Represents any object in the data model and in the object browser.
Definition: ModelAPI_Object.h:45
Class for filling ModelAPI_AttributeDouble.
Definition: ModelHighAPI_Double.h:37
Class for filling ModelAPI_AttributeInteger.
Definition: ModelHighAPI_Integer.h:36
Class for filling ModelAPI_AttributeRefAttr.
Definition: ModelHighAPI_RefAttr.h:41
Class for filling ModelAPI_AttributeReference.
Definition: ModelHighAPI_Reference.h:41
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
virtual void fillAttribute(const std::shared_ptr< ModelAPI_AttributeSelection > &theAttribute) const
Fill attribute values.
Definition: ModelHighAPI_Selection.cpp:88