Salome HOME
IMP 0020670: Be able to keep the same names for the 'Set ... subshapes arguments...
[modules/geom.git] / src / GEOM_SWIG / geompyDC.py
1 #  -*- coding: iso-8859-1 -*-
2 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
3 #
4 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 #
7 #  This library is free software; you can redistribute it and/or
8 #  modify it under the terms of the GNU Lesser General Public
9 #  License as published by the Free Software Foundation; either
10 #  version 2.1 of the License.
11 #
12 #  This library is distributed in the hope that it will be useful,
13 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 #  Lesser General Public License for more details.
16 #
17 #  You should have received a copy of the GNU Lesser General Public
18 #  License along with this library; if not, write to the Free Software
19 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
20 #
21 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #
23 #  GEOM GEOM_SWIG : binding of C++ omplementaion with Python
24 #  File   : geompy.py
25 #  Author : Paul RASCLE, EDF
26 #  Module : GEOM
27
28 """
29     \namespace geompy
30     \brief Module geompy
31 """
32
33 ## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
34
35 ## @defgroup l1_geompy_purpose   All package methods, grouped by their purpose
36 ## @{
37 ##   @defgroup l2_import_export Importing/exporting geometrical objects
38 ##   @defgroup l2_creating      Creating geometrical objects
39 ##   @{
40 ##     @defgroup l3_basic_go      Creating Basic Geometric Objects
41 ##     @{
42 ##       @defgroup l4_curves        Creating Curves
43
44 ##     @}
45 ##     @defgroup l3_3d_primitives Creating 3D Primitives
46 ##     @defgroup l3_complex       Creating Complex Objects
47 ##     @defgroup l3_groups        Working with groups
48 ##     @defgroup l3_blocks        Building by blocks
49 ##     @{
50 ##       @defgroup l4_blocks_measure Check and Improve
51
52 ##     @}
53 ##     @defgroup l3_sketcher      Sketcher
54 ##     @defgroup l3_advanced      Creating Advanced Geometrical Objects
55 ##     @{
56 ##       @defgroup l4_decompose     Decompose objects
57 ##       @defgroup l4_access        Access to sub-shapes by their unique IDs inside the main shape
58 ##       @defgroup l4_obtain        Access to subshapes by a criteria
59 ##       @defgroup l4_advanced      Advanced objects creation functions
60
61 ##     @}
62
63 ##   @}
64 ##   @defgroup l2_transforming  Transforming geometrical objects
65 ##   @{
66 ##     @defgroup l3_basic_op      Basic Operations
67 ##     @defgroup l3_boolean       Boolean Operations
68 ##     @defgroup l3_transform     Transformation Operations
69 ##     @defgroup l3_local         Local Operations (Fillet and Chamfer)
70 ##     @defgroup l3_blocks_op     Blocks Operations
71 ##     @defgroup l3_healing       Repairing Operations
72 ##     @defgroup l3_restore_ss    Restore presentation parameters and a tree of subshapes
73
74 ##   @}
75 ##   @defgroup l2_measure       Using measurement tools
76
77 ## @}
78
79 import salome
80 salome.salome_init()
81 from salome import *
82
83 from salome_notebook import *
84
85 import GEOM
86 import math
87
88 ## Enumeration ShapeType as a dictionary
89 #  @ingroup l1_geompy_auxiliary
90 ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
91
92 ## Raise an Error, containing the Method_name, if Operation is Failed
93 ## @ingroup l1_geompy_auxiliary
94 def RaiseIfFailed (Method_name, Operation):
95     if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
96         raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
97
98 ## Return list of variables value from salome notebook
99 ## @ingroup l1_geompy_auxiliary
100 def ParseParameters(*parameters):
101     Result = []
102     StringResult = []
103     for parameter in parameters:
104         if isinstance(parameter,str):
105             if notebook.isVariable(parameter):
106                 Result.append(notebook.get(parameter))
107             else:
108                 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
109         else:
110             Result.append(parameter)
111             pass
112
113         StringResult.append(str(parameter))
114         pass
115     if Result:
116         Result.append(":".join(StringResult))
117     else:
118         Result = ":".join(StringResult)
119     return Result
120
121 ## Return list of variables value from salome notebook
122 ## @ingroup l1_geompy_auxiliary
123 def ParseList(list):
124     Result = []
125     StringResult = ""
126     for parameter in list:
127         if isinstance(parameter,str) and notebook.isVariable(parameter):
128             Result.append(str(notebook.get(parameter)))
129             pass
130         else:
131             Result.append(str(parameter))
132             pass
133
134         StringResult = StringResult + str(parameter)
135         StringResult = StringResult + ":"
136         pass
137     StringResult = StringResult[:len(StringResult)-1]
138     return Result, StringResult
139
140 ## Return list of variables value from salome notebook
141 ## @ingroup l1_geompy_auxiliary
142 def ParseSketcherCommand(command):
143     Result = ""
144     StringResult = ""
145     sections = command.split(":")
146     for section in sections:
147         parameters = section.split(" ")
148         paramIndex = 1
149         for parameter in parameters:
150             if paramIndex > 1 and parameter.find("'") != -1:
151                 parameter = parameter.replace("'","")
152                 if notebook.isVariable(parameter):
153                     Result = Result + str(notebook.get(parameter)) + " "
154                     pass
155                 else:
156                     raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
157                     pass
158                 pass
159             else:
160                 Result = Result + str(parameter) + " "
161                 pass
162             if paramIndex > 1:
163                 StringResult = StringResult + parameter
164                 StringResult = StringResult + ":"
165                 pass
166             paramIndex = paramIndex + 1
167             pass
168         Result = Result[:len(Result)-1] + ":"
169         pass
170     Result = Result[:len(Result)-1]
171     return Result, StringResult
172
173 ## Helper function which can be used to pack the passed string to the byte data.
174 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
175 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
176 ## For example,
177 ## \code
178 ## val = PackData("10001110") # val = 0xAE
179 ## val = PackData("1")        # val = 0x80
180 ## \endcode
181 ## @param data unpacked data - a string containing '1' and '0' symbols
182 ## @return data packed to the byte stream
183 ## @ingroup l1_geompy_auxiliary
184 def PackData(data):
185     bytes = len(data)/8
186     if len(data)%8: bytes += 1
187     res = ""
188     for b in range(bytes):
189         d = data[b*8:(b+1)*8]
190         val = 0
191         for i in range(8):
192             val *= 2
193             if i < len(d):
194                 if d[i] == "1": val += 1
195                 elif d[i] != "0":
196                     raise "Invalid symbol %s" % d[i]
197                 pass
198             pass
199         res += chr(val)
200         pass
201     return res
202
203 ## Read bitmap texture from the text file.
204 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
205 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
206 ## The function returns width and height of the pixmap in pixels and byte stream representing
207 ## texture bitmap itself.
208 ##
209 ## This function can be used to read the texture to the byte stream in order to pass it to
210 ## the AddTexture() function of geompy class.
211 ## For example,
212 ## \code
213 ## import geompy
214 ## geompy.init_geom(salome.myStudy)
215 ## texture = geompy.readtexture('mytexture.dat')
216 ## texture = geompy.AddTexture(*texture)
217 ## obj.SetMarkerTexture(texture)
218 ## \endcode
219 ## @param fname texture file name
220 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
221 ## @ingroup l1_geompy_auxiliary
222 def ReadTexture(fname):
223     try:
224         f = open(fname)
225         lines = [ l.strip() for l in f.readlines()]
226         f.close()
227         maxlen = 0
228         if lines: maxlen = max([len(x) for x in lines])
229         lenbytes = maxlen/8
230         if maxlen%8: lenbytes += 1
231         bytedata=""
232         for line in lines:
233             if len(line)%8:
234                 lenline = (len(line)/8+1)*8
235                 pass
236             else:
237                 lenline = (len(line)/8)*8
238                 pass
239             for i in range(lenline/8):
240                 byte=""
241                 for j in range(8):
242                     if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
243                     else: byte += "0"
244                     pass
245                 bytedata += PackData(byte)
246                 pass
247             for i in range(lenline/8, lenbytes):
248                 bytedata += PackData("0")
249             pass
250         return lenbytes*8, len(lines), bytedata
251     except:
252         pass
253     return 0, 0, ""
254
255 ## Kinds of shape enumeration
256 #  @ingroup l1_geompy_auxiliary
257 kind = GEOM.GEOM_IKindOfShape
258
259 ## Information about closed/unclosed state of shell or wire
260 #  @ingroup l1_geompy_auxiliary
261 class info:
262     UNKNOWN  = 0
263     CLOSED   = 1
264     UNCLOSED = 2
265
266 class geompyDC(GEOM._objref_GEOM_Gen):
267
268         def __init__(self):
269             GEOM._objref_GEOM_Gen.__init__(self)
270             self.myBuilder = None
271             self.myStudyId = 0
272             self.father    = None
273
274             self.BasicOp  = None
275             self.CurvesOp = None
276             self.PrimOp   = None
277             self.ShapesOp = None
278             self.HealOp   = None
279             self.InsertOp = None
280             self.BoolOp   = None
281             self.TrsfOp   = None
282             self.LocalOp  = None
283             self.MeasuOp  = None
284             self.BlocksOp = None
285             self.GroupOp  = None
286             self.AdvOp    = None
287             pass
288
289         ## @addtogroup l1_geompy_auxiliary
290         ## @{
291         def init_geom(self,theStudy):
292             self.myStudy = theStudy
293             self.myStudyId = self.myStudy._get_StudyId()
294             self.myBuilder = self.myStudy.NewBuilder()
295             self.father = self.myStudy.FindComponent("GEOM")
296             if self.father is None:
297                 self.father = self.myBuilder.NewComponent("GEOM")
298                 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
299                 FName = A1._narrow(SALOMEDS.AttributeName)
300                 FName.SetValue("Geometry")
301                 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
302                 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
303                 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
304                 self.myBuilder.DefineComponentInstance(self.father,self)
305                 pass
306             self.BasicOp  = self.GetIBasicOperations    (self.myStudyId)
307             self.CurvesOp = self.GetICurvesOperations   (self.myStudyId)
308             self.PrimOp   = self.GetI3DPrimOperations   (self.myStudyId)
309             self.ShapesOp = self.GetIShapesOperations   (self.myStudyId)
310             self.HealOp   = self.GetIHealingOperations  (self.myStudyId)
311             self.InsertOp = self.GetIInsertOperations   (self.myStudyId)
312             self.BoolOp   = self.GetIBooleanOperations  (self.myStudyId)
313             self.TrsfOp   = self.GetITransformOperations(self.myStudyId)
314             self.LocalOp  = self.GetILocalOperations    (self.myStudyId)
315             self.MeasuOp  = self.GetIMeasureOperations  (self.myStudyId)
316             self.BlocksOp = self.GetIBlocksOperations   (self.myStudyId)
317             self.GroupOp  = self.GetIGroupOperations    (self.myStudyId)
318             self.AdvOp    = self.GetIAdvancedOperations (self.myStudyId)
319             pass
320
321         ## Get name for sub-shape aSubObj of shape aMainObj
322         #
323         # @ref swig_SubShapeAllSorted "Example"
324         def SubShapeName(self,aSubObj, aMainObj):
325             # Example: see GEOM_TestAll.py
326
327             #aSubId  = orb.object_to_string(aSubObj)
328             #aMainId = orb.object_to_string(aMainObj)
329             #index = gg.getIndexTopology(aSubId, aMainId)
330             #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
331             index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
332             name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
333             return name
334
335         ## Publish in study aShape with name aName
336         #
337         #  \param aShape the shape to be published
338         #  \param aName  the name for the shape
339         #  \param doRestoreSubShapes if True, finds and publishes also
340         #         sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
341         #         and published sub-shapes of arguments
342         #  \param theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes for
343         #                                                  these arguments description
344         #  \return study entry of the published shape in form of string
345         #
346         #  @ref swig_MakeQuad4Vertices "Example"
347         def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
348                        theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
349             # Example: see GEOM_TestAll.py
350             try:
351                 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
352                 if doRestoreSubShapes:
353                     self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
354                                             theFindMethod, theInheritFirstArg)
355             except:
356                 print "addToStudy() failed"
357                 return ""
358             return aShape.GetStudyEntry()
359
360         ## Publish in study aShape with name aName as sub-object of previously published aFather
361         #
362         #  @ref swig_SubShapeAllSorted "Example"
363         def addToStudyInFather(self, aFather, aShape, aName):
364             # Example: see GEOM_TestAll.py
365             try:
366                 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
367             except:
368                 print "addToStudyInFather() failed"
369                 return ""
370             return aShape.GetStudyEntry()
371
372         # end of l1_geompy_auxiliary
373         ## @}
374
375         ## @addtogroup l3_restore_ss
376         ## @{
377
378         ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
379         #  To be used from python scripts out of geompy.addToStudy (non-default usage)
380         #  \param theObject published GEOM object, arguments of which will be published
381         #  \param theArgs   list of GEOM_Object, operation arguments to be published.
382         #                   If this list is empty, all operation arguments will be published
383         #  \param theFindMethod method to search subshapes, corresponding to arguments and
384         #                       their subshapes. Value from enumeration GEOM::find_shape_method.
385         #  \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
386         #                            Do not publish subshapes in place of arguments, but only
387         #                            in place of subshapes of the first argument,
388         #                            because the whole shape corresponds to the first argument.
389         #                            Mainly to be used after transformations, but it also can be
390         #                            usefull after partition with one object shape, and some other
391         #                            operations, where only the first argument has to be considered.
392         #                            If theObject has only one argument shape, this flag is automatically
393         #                            considered as True, not regarding really passed value.
394         #  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
395         #                      and prefix "from_subshapes_of_" to names of partially restored subshapes.
396         #  \return list of published sub-shapes
397         #
398         #  @ref tui_restore_prs_params "Example"
399         def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
400                               theInheritFirstArg=False, theAddPrefix=True):
401             # Example: see GEOM_TestAll.py
402             return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
403                                           theFindMethod, theInheritFirstArg, theAddPrefix)
404
405         # end of l3_restore_ss
406         ## @}
407
408         ## @addtogroup l3_basic_go
409         ## @{
410
411         ## Create point by three coordinates.
412         #  @param theX The X coordinate of the point.
413         #  @param theY The Y coordinate of the point.
414         #  @param theZ The Z coordinate of the point.
415         #  @return New GEOM_Object, containing the created point.
416         #
417         #  @ref tui_creation_point "Example"
418         def MakeVertex(self,theX, theY, theZ):
419             # Example: see GEOM_TestAll.py
420             theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
421             anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
422             RaiseIfFailed("MakePointXYZ", self.BasicOp)
423             anObj.SetParameters(Parameters)
424             return anObj
425
426         ## Create a point, distant from the referenced point
427         #  on the given distances along the coordinate axes.
428         #  @param theReference The referenced point.
429         #  @param theX Displacement from the referenced point along OX axis.
430         #  @param theY Displacement from the referenced point along OY axis.
431         #  @param theZ Displacement from the referenced point along OZ axis.
432         #  @return New GEOM_Object, containing the created point.
433         #
434         #  @ref tui_creation_point "Example"
435         def MakeVertexWithRef(self,theReference, theX, theY, theZ):
436             # Example: see GEOM_TestAll.py
437             theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
438             anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
439             RaiseIfFailed("MakePointWithReference", self.BasicOp)
440             anObj.SetParameters(Parameters)
441             return anObj
442
443         ## Create a point, corresponding to the given parameter on the given curve.
444         #  @param theRefCurve The referenced curve.
445         #  @param theParameter Value of parameter on the referenced curve.
446         #  @return New GEOM_Object, containing the created point.
447         #
448         #  @ref tui_creation_point "Example"
449         def MakeVertexOnCurve(self,theRefCurve, theParameter):
450             # Example: see GEOM_TestAll.py
451             theParameter, Parameters = ParseParameters(theParameter)
452             anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
453             RaiseIfFailed("MakePointOnCurve", self.BasicOp)
454             anObj.SetParameters(Parameters)
455             return anObj
456
457         ## Create a point by projection give coordinates on the given curve
458         #  @param theRefCurve The referenced curve.
459         #  @param theX X-coordinate in 3D space
460         #  @param theY Y-coordinate in 3D space
461         #  @param theZ Z-coordinate in 3D space
462         #  @return New GEOM_Object, containing the created point.
463         #
464         #  @ref tui_creation_point "Example"
465         def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
466             # Example: see GEOM_TestAll.py
467             theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
468             anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
469             RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
470             anObj.SetParameters(Parameters)
471             return anObj
472
473         ## Create a point, corresponding to the given parameters on the
474         #    given surface.
475         #  @param theRefSurf The referenced surface.
476         #  @param theUParameter Value of U-parameter on the referenced surface.
477         #  @param theVParameter Value of V-parameter on the referenced surface.
478         #  @return New GEOM_Object, containing the created point.
479         #
480         #  @ref swig_MakeVertexOnSurface "Example"
481         def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
482             theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
483             # Example: see GEOM_TestAll.py
484             anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
485             RaiseIfFailed("MakePointOnSurface", self.BasicOp)
486             anObj.SetParameters(Parameters);
487             return anObj
488
489         ## Create a point by projection give coordinates on the given surface
490         #  @param theRefSurf The referenced surface.
491         #  @param theX X-coordinate in 3D space
492         #  @param theY Y-coordinate in 3D space
493         #  @param theZ Z-coordinate in 3D space
494         #  @return New GEOM_Object, containing the created point.
495         #
496         #  @ref swig_MakeVertexOnSurfaceByCoord "Example"
497         def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
498             theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
499             # Example: see GEOM_TestAll.py
500             anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
501             RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
502             anObj.SetParameters(Parameters);
503             return anObj
504
505         ## Create a point on intersection of two lines.
506         #  @param theRefLine1, theRefLine2 The referenced lines.
507         #  @return New GEOM_Object, containing the created point.
508         #
509         #  @ref swig_MakeVertexOnLinesIntersection "Example"
510         def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
511             # Example: see GEOM_TestAll.py
512             anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
513             RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
514             return anObj
515
516         ## Create a tangent, corresponding to the given parameter on the given curve.
517         #  @param theRefCurve The referenced curve.
518         #  @param theParameter Value of parameter on the referenced curve.
519         #  @return New GEOM_Object, containing the created tangent.
520         #
521         #  @ref swig_MakeTangentOnCurve "Example"
522         def MakeTangentOnCurve(self, theRefCurve, theParameter):
523             anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
524             RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
525             return anObj
526
527         ## Create a tangent plane, corresponding to the given parameter on the given face.
528         #  @param theFace The face for which tangent plane should be built.
529         #  @param theParameterV vertical value of the center point (0.0 - 1.0).
530         #  @param theParameterU horisontal value of the center point (0.0 - 1.0).
531         #  @param theTrimSize the size of plane.
532         #  @return New GEOM_Object, containing the created tangent.
533         #
534         #  @ref swig_MakeTangentPlaneOnFace "Example"
535         def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
536             anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
537             RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
538             return anObj
539
540         ## Create a vector with the given components.
541         #  @param theDX X component of the vector.
542         #  @param theDY Y component of the vector.
543         #  @param theDZ Z component of the vector.
544         #  @return New GEOM_Object, containing the created vector.
545         #
546         #  @ref tui_creation_vector "Example"
547         def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
548             # Example: see GEOM_TestAll.py
549             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
550             anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
551             RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
552             anObj.SetParameters(Parameters)
553             return anObj
554
555         ## Create a vector between two points.
556         #  @param thePnt1 Start point for the vector.
557         #  @param thePnt2 End point for the vector.
558         #  @return New GEOM_Object, containing the created vector.
559         #
560         #  @ref tui_creation_vector "Example"
561         def MakeVector(self,thePnt1, thePnt2):
562             # Example: see GEOM_TestAll.py
563             anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
564             RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
565             return anObj
566
567         ## Create a line, passing through the given point
568         #  and parrallel to the given direction
569         #  @param thePnt Point. The resulting line will pass through it.
570         #  @param theDir Direction. The resulting line will be parallel to it.
571         #  @return New GEOM_Object, containing the created line.
572         #
573         #  @ref tui_creation_line "Example"
574         def MakeLine(self,thePnt, theDir):
575             # Example: see GEOM_TestAll.py
576             anObj = self.BasicOp.MakeLine(thePnt, theDir)
577             RaiseIfFailed("MakeLine", self.BasicOp)
578             return anObj
579
580         ## Create a line, passing through the given points
581         #  @param thePnt1 First of two points, defining the line.
582         #  @param thePnt2 Second of two points, defining the line.
583         #  @return New GEOM_Object, containing the created line.
584         #
585         #  @ref tui_creation_line "Example"
586         def MakeLineTwoPnt(self,thePnt1, thePnt2):
587             # Example: see GEOM_TestAll.py
588             anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
589             RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
590             return anObj
591
592         ## Create a line on two faces intersection.
593         #  @param theFace1 First of two faces, defining the line.
594         #  @param theFace2 Second of two faces, defining the line.
595         #  @return New GEOM_Object, containing the created line.
596         #
597         #  @ref swig_MakeLineTwoFaces "Example"
598         def MakeLineTwoFaces(self, theFace1, theFace2):
599             # Example: see GEOM_TestAll.py
600             anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
601             RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
602             return anObj
603
604         ## Create a plane, passing through the given point
605         #  and normal to the given vector.
606         #  @param thePnt Point, the plane has to pass through.
607         #  @param theVec Vector, defining the plane normal direction.
608         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
609         #  @return New GEOM_Object, containing the created plane.
610         #
611         #  @ref tui_creation_plane "Example"
612         def MakePlane(self,thePnt, theVec, theTrimSize):
613             # Example: see GEOM_TestAll.py
614             theTrimSize, Parameters = ParseParameters(theTrimSize);
615             anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
616             RaiseIfFailed("MakePlanePntVec", self.BasicOp)
617             anObj.SetParameters(Parameters)
618             return anObj
619
620         ## Create a plane, passing through the three given points
621         #  @param thePnt1 First of three points, defining the plane.
622         #  @param thePnt2 Second of three points, defining the plane.
623         #  @param thePnt3 Fird of three points, defining the plane.
624         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
625         #  @return New GEOM_Object, containing the created plane.
626         #
627         #  @ref tui_creation_plane "Example"
628         def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
629             # Example: see GEOM_TestAll.py
630             theTrimSize, Parameters = ParseParameters(theTrimSize);
631             anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
632             RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
633             anObj.SetParameters(Parameters)
634             return anObj
635
636         ## Create a plane, similar to the existing one, but with another size of representing face.
637         #  @param theFace Referenced plane or LCS(Marker).
638         #  @param theTrimSize New half size of a side of quadrangle face, representing the plane.
639         #  @return New GEOM_Object, containing the created plane.
640         #
641         #  @ref tui_creation_plane "Example"
642         def MakePlaneFace(self,theFace, theTrimSize):
643             # Example: see GEOM_TestAll.py
644             theTrimSize, Parameters = ParseParameters(theTrimSize);
645             anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
646             RaiseIfFailed("MakePlaneFace", self.BasicOp)
647             anObj.SetParameters(Parameters)
648             return anObj
649
650         ## Create a plane, passing through the 2 vectors
651         #  with center in a start point of the first vector.
652         #  @param theVec1 Vector, defining center point and plane direction.
653         #  @param theVec2 Vector, defining the plane normal direction.
654         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
655         #  @return New GEOM_Object, containing the created plane.
656         #
657         #  @ref tui_creation_plane "Example"
658         def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
659             # Example: see GEOM_TestAll.py
660             theTrimSize, Parameters = ParseParameters(theTrimSize);
661             anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
662             RaiseIfFailed("MakePlane2Vec", self.BasicOp)
663             anObj.SetParameters(Parameters)
664             return anObj
665
666         ## Create a plane, based on a Local coordinate system.
667         #  @param theLCS  coordinate system, defining plane.
668         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
669         #  @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
670         #  @return New GEOM_Object, containing the created plane.
671         #
672         #  @ref tui_creation_plane "Example"
673         def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
674             # Example: see GEOM_TestAll.py
675             theTrimSize, Parameters = ParseParameters(theTrimSize);
676             anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
677             RaiseIfFailed("MakePlaneLCS", self.BasicOp)
678             anObj.SetParameters(Parameters)
679             return anObj
680
681         ## Create a local coordinate system.
682         #  @param OX,OY,OZ Three coordinates of coordinate system origin.
683         #  @param XDX,XDY,XDZ Three components of OX direction
684         #  @param YDX,YDY,YDZ Three components of OY direction
685         #  @return New GEOM_Object, containing the created coordinate system.
686         #
687         #  @ref swig_MakeMarker "Example"
688         def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
689             # Example: see GEOM_TestAll.py
690             OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
691             anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
692             RaiseIfFailed("MakeMarker", self.BasicOp)
693             anObj.SetParameters(Parameters)
694             return anObj
695             
696         ## Create a local coordinate system from shape.
697         #  @param theShape The initial shape to detect the coordinate system.
698         #  @return New GEOM_Object, containing the created coordinate system.
699         #
700         #  @ref tui_creation_lcs "Example"
701         def MakeMarkerFromShape(self, theShape):
702             anObj = self.BasicOp.MakeMarkerFromShape(theShape)
703             RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
704             return anObj
705
706         ## Create a local coordinate system from point and two vectors.
707         #  @param theOrigin Point of coordinate system origin.
708         #  @param theXVec Vector of X direction
709         #  @param theYVec Vector of Y direction
710         #  @return New GEOM_Object, containing the created coordinate system.
711         #
712         #  @ref tui_creation_lcs "Example"
713         def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
714             anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
715             RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
716             return anObj
717
718         # end of l3_basic_go
719         ## @}
720
721         ## @addtogroup l4_curves
722         ## @{
723
724         ##  Create an arc of circle, passing through three given points.
725         #  @param thePnt1 Start point of the arc.
726         #  @param thePnt2 Middle point of the arc.
727         #  @param thePnt3 End point of the arc.
728         #  @return New GEOM_Object, containing the created arc.
729         #
730         #  @ref swig_MakeArc "Example"
731         def MakeArc(self,thePnt1, thePnt2, thePnt3):
732             # Example: see GEOM_TestAll.py
733             anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
734             RaiseIfFailed("MakeArc", self.CurvesOp)
735             return anObj
736
737         ##  Create an arc of circle from a center and 2 points.
738         #  @param thePnt1 Center of the arc
739         #  @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
740         #  @param thePnt3 End point of the arc (Gives also a direction)
741         #  @param theSense Orientation of the arc
742         #  @return New GEOM_Object, containing the created arc.
743         #
744         #  @ref swig_MakeArc "Example"
745         def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
746             # Example: see GEOM_TestAll.py
747             anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
748             RaiseIfFailed("MakeArcCenter", self.CurvesOp)
749             return anObj
750         
751         ##  Create an arc of ellipse, of center and two points.
752         #  @param theCenter Center of the arc.
753         #  @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
754         #  @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
755         #  @return New GEOM_Object, containing the created arc.
756         #
757         #  @ref swig_MakeArc "Example"
758         def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
759             # Example: see GEOM_TestAll.py
760             anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
761             RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
762             return anObj
763
764         ## Create a circle with given center, normal vector and radius.
765         #  @param thePnt Circle center.
766         #  @param theVec Vector, normal to the plane of the circle.
767         #  @param theR Circle radius.
768         #  @return New GEOM_Object, containing the created circle.
769         #
770         #  @ref tui_creation_circle "Example"
771         def MakeCircle(self, thePnt, theVec, theR):
772             # Example: see GEOM_TestAll.py
773             theR, Parameters = ParseParameters(theR)
774             anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
775             RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
776             anObj.SetParameters(Parameters)
777             return anObj
778
779         ## Create a circle with given radius.
780         #  Center of the circle will be in the origin of global
781         #  coordinate system and normal vector will be codirected with Z axis
782         #  @param theR Circle radius.
783         #  @return New GEOM_Object, containing the created circle.
784         def MakeCircleR(self, theR):
785             anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
786             RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
787             return anObj
788
789         ## Create a circle, passing through three given points
790         #  @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
791         #  @return New GEOM_Object, containing the created circle.
792         #
793         #  @ref tui_creation_circle "Example"
794         def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
795             # Example: see GEOM_TestAll.py
796             anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
797             RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
798             return anObj
799
800         ## Create a circle, with given point1 as center,
801         #  passing through the point2 as radius and laying in the plane,
802         #  defined by all three given points.
803         #  @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
804         #  @return New GEOM_Object, containing the created circle.
805         #
806         #  @ref swig_MakeCircle "Example"
807         def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
808             # Example: see GEOM_example6.py
809             anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
810             RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
811             return anObj
812
813         ## Create an ellipse with given center, normal vector and radiuses.
814         #  @param thePnt Ellipse center.
815         #  @param theVec Vector, normal to the plane of the ellipse.
816         #  @param theRMajor Major ellipse radius.
817         #  @param theRMinor Minor ellipse radius.
818         #  @param theVecMaj Vector, direction of the ellipse's main axis.
819         #  @return New GEOM_Object, containing the created ellipse.
820         #
821         #  @ref tui_creation_ellipse "Example"
822         def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
823             # Example: see GEOM_TestAll.py
824             theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
825             if theVecMaj is not None:
826                 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
827             else:
828                 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
829                 pass
830             RaiseIfFailed("MakeEllipse", self.CurvesOp)
831             anObj.SetParameters(Parameters)
832             return anObj
833
834         ## Create an ellipse with given radiuses.
835         #  Center of the ellipse will be in the origin of global
836         #  coordinate system and normal vector will be codirected with Z axis
837         #  @param theRMajor Major ellipse radius.
838         #  @param theRMinor Minor ellipse radius.
839         #  @return New GEOM_Object, containing the created ellipse.
840         def MakeEllipseRR(self, theRMajor, theRMinor):
841             anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
842             RaiseIfFailed("MakeEllipse", self.CurvesOp)
843             return anObj
844
845         ## Create a polyline on the set of points.
846         #  @param thePoints Sequence of points for the polyline.
847         #  @return New GEOM_Object, containing the created polyline.
848         #
849         #  @ref tui_creation_curve "Example"
850         def MakePolyline(self,thePoints):
851             # Example: see GEOM_TestAll.py
852             anObj = self.CurvesOp.MakePolyline(thePoints)
853             RaiseIfFailed("MakePolyline", self.CurvesOp)
854             return anObj
855
856         ## Create bezier curve on the set of points.
857         #  @param thePoints Sequence of points for the bezier curve.
858         #  @return New GEOM_Object, containing the created bezier curve.
859         #
860         #  @ref tui_creation_curve "Example"
861         def MakeBezier(self,thePoints):
862             # Example: see GEOM_TestAll.py
863             anObj = self.CurvesOp.MakeSplineBezier(thePoints)
864             RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
865             return anObj
866
867         ## Create B-Spline curve on the set of points.
868         #  @param thePoints Sequence of points for the B-Spline curve.
869         #  @param theIsClosed If True, build a closed curve.
870         #  @return New GEOM_Object, containing the created B-Spline curve.
871         #
872         #  @ref tui_creation_curve "Example"
873         def MakeInterpol(self, thePoints, theIsClosed=False):
874             # Example: see GEOM_TestAll.py
875             anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed)
876             RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
877             return anObj
878
879         # end of l4_curves
880         ## @}
881
882         ## @addtogroup l3_sketcher
883         ## @{
884
885         ## Create a sketcher (wire or face), following the textual description,
886         #  passed through <VAR>theCommand</VAR> argument. \n
887         #  Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
888         #  Format of the description string have to be the following:
889         #
890         #  "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
891         #
892         #  Where:
893         #  - x1, y1 are coordinates of the first sketcher point (zero by default),
894         #  - CMD is one of
895         #     - "R angle" : Set the direction by angle
896         #     - "D dx dy" : Set the direction by DX & DY
897         #     .
898         #       \n
899         #     - "TT x y" : Create segment by point at X & Y
900         #     - "T dx dy" : Create segment by point with DX & DY
901         #     - "L length" : Create segment by direction & Length
902         #     - "IX x" : Create segment by direction & Intersect. X
903         #     - "IY y" : Create segment by direction & Intersect. Y
904         #     .
905         #       \n
906         #     - "C radius length" : Create arc by direction, radius and length(in degree)
907         #     .
908         #       \n
909         #     - "WW" : Close Wire (to finish)
910         #     - "WF" : Close Wire and build face (to finish)
911         #
912         #  @param theCommand String, defining the sketcher in local
913         #                    coordinates of the working plane.
914         #  @param theWorkingPlane Nine double values, defining origin,
915         #                         OZ and OX directions of the working plane.
916         #  @return New GEOM_Object, containing the created wire.
917         #
918         #  @ref tui_sketcher_page "Example"
919         def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
920             # Example: see GEOM_TestAll.py
921             theCommand,Parameters = ParseSketcherCommand(theCommand)
922             anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
923             RaiseIfFailed("MakeSketcher", self.CurvesOp)
924             anObj.SetParameters(Parameters)
925             return anObj
926
927         ## Create a sketcher (wire or face), following the textual description,
928         #  passed through <VAR>theCommand</VAR> argument. \n
929         #  For format of the description string see the previous method.\n
930         #  @param theCommand String, defining the sketcher in local
931         #                    coordinates of the working plane.
932         #  @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
933         #  @return New GEOM_Object, containing the created wire.
934         #
935         #  @ref tui_sketcher_page "Example"
936         def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
937             anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
938             RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
939             return anObj
940
941         ## Create a sketcher wire, following the numerical description,
942         #  passed through <VAR>theCoordinates</VAR> argument. \n
943         #  @param theCoordinates double values, defining points to create a wire,
944         #                                                      passing from it.
945         #  @return New GEOM_Object, containing the created wire.
946         #
947         #  @ref tui_sketcher_page "Example"
948         def Make3DSketcher(self, theCoordinates):
949             anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
950             RaiseIfFailed("Make3DSketcher", self.CurvesOp)
951             return anObj
952
953         # end of l3_sketcher
954         ## @}
955
956         ## @addtogroup l3_3d_primitives
957         ## @{
958
959         ## Create a box by coordinates of two opposite vertices.
960         #
961         #  @ref tui_creation_box "Example"
962         def MakeBox(self,x1,y1,z1,x2,y2,z2):
963             # Example: see GEOM_TestAll.py
964             pnt1 = self.MakeVertex(x1,y1,z1)
965             pnt2 = self.MakeVertex(x2,y2,z2)
966             return self.MakeBoxTwoPnt(pnt1,pnt2)
967
968         ## Create a box with specified dimensions along the coordinate axes
969         #  and with edges, parallel to the coordinate axes.
970         #  Center of the box will be at point (DX/2, DY/2, DZ/2).
971         #  @param theDX Length of Box edges, parallel to OX axis.
972         #  @param theDY Length of Box edges, parallel to OY axis.
973         #  @param theDZ Length of Box edges, parallel to OZ axis.
974         #  @return New GEOM_Object, containing the created box.
975         #
976         #  @ref tui_creation_box "Example"
977         def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
978             # Example: see GEOM_TestAll.py
979             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
980             anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
981             RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
982             anObj.SetParameters(Parameters)
983             return anObj
984
985         ## Create a box with two specified opposite vertices,
986         #  and with edges, parallel to the coordinate axes
987         #  @param thePnt1 First of two opposite vertices.
988         #  @param thePnt2 Second of two opposite vertices.
989         #  @return New GEOM_Object, containing the created box.
990         #
991         #  @ref tui_creation_box "Example"
992         def MakeBoxTwoPnt(self,thePnt1, thePnt2):
993             # Example: see GEOM_TestAll.py
994             anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
995             RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
996             return anObj
997
998         ## Create a face with specified dimensions along OX-OY coordinate axes,
999         #  with edges, parallel to this coordinate axes.
1000         #  @param theH height of Face.
1001         #  @param theW width of Face.
1002         #  @param theOrientation orientation belong axis OXY OYZ OZX
1003         #  @return New GEOM_Object, containing the created face.
1004         #
1005         #  @ref tui_creation_face "Example"
1006         def MakeFaceHW(self,theH, theW, theOrientation):
1007             # Example: see GEOM_TestAll.py
1008             theH,theW,Parameters = ParseParameters(theH, theW)
1009             anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1010             RaiseIfFailed("MakeFaceHW", self.PrimOp)
1011             anObj.SetParameters(Parameters)
1012             return anObj
1013
1014         ## Create a face from another plane and two sizes,
1015         #  vertical size and horisontal size.
1016         #  @param theObj   Normale vector to the creating face or
1017         #  the face object.
1018         #  @param theH     Height (vertical size).
1019         #  @param theW     Width (horisontal size).
1020         #  @return New GEOM_Object, containing the created face.
1021         #
1022         #  @ref tui_creation_face "Example"
1023         def MakeFaceObjHW(self, theObj, theH, theW):
1024             # Example: see GEOM_TestAll.py
1025             theH,theW,Parameters = ParseParameters(theH, theW)
1026             anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1027             RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1028             anObj.SetParameters(Parameters)
1029             return anObj
1030
1031         ## Create a disk with given center, normal vector and radius.
1032         #  @param thePnt Disk center.
1033         #  @param theVec Vector, normal to the plane of the disk.
1034         #  @param theR Disk radius.
1035         #  @return New GEOM_Object, containing the created disk.
1036         #
1037         #  @ref tui_creation_disk "Example"
1038         def MakeDiskPntVecR(self,thePnt, theVec, theR):
1039             # Example: see GEOM_TestAll.py
1040             theR,Parameters = ParseParameters(theR)
1041             anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1042             RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1043             anObj.SetParameters(Parameters)
1044             return anObj
1045
1046         ## Create a disk, passing through three given points
1047         #  @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1048         #  @return New GEOM_Object, containing the created disk.
1049         #
1050         #  @ref tui_creation_disk "Example"
1051         def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1052             # Example: see GEOM_TestAll.py
1053             anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1054             RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1055             return anObj
1056
1057         ## Create a disk with specified dimensions along OX-OY coordinate axes.
1058         #  @param theR Radius of Face.
1059         #  @param theOrientation set the orientation belong axis OXY or OYZ or OZX
1060         #  @return New GEOM_Object, containing the created disk.
1061         #
1062         #  @ref tui_creation_face "Example"
1063         def MakeDiskR(self,theR, theOrientation):
1064             # Example: see GEOM_TestAll.py
1065             theR,Parameters = ParseParameters(theR)
1066             anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
1067             RaiseIfFailed("MakeDiskR", self.PrimOp)
1068             anObj.SetParameters(Parameters)
1069             return anObj
1070
1071         ## Create a cylinder with given base point, axis, radius and height.
1072         #  @param thePnt Central point of cylinder base.
1073         #  @param theAxis Cylinder axis.
1074         #  @param theR Cylinder radius.
1075         #  @param theH Cylinder height.
1076         #  @return New GEOM_Object, containing the created cylinder.
1077         #
1078         #  @ref tui_creation_cylinder "Example"
1079         def MakeCylinder(self,thePnt, theAxis, theR, theH):
1080             # Example: see GEOM_TestAll.py
1081             theR,theH,Parameters = ParseParameters(theR, theH)
1082             anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
1083             RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
1084             anObj.SetParameters(Parameters)
1085             return anObj
1086
1087         ## Create a cylinder with given radius and height at
1088         #  the origin of coordinate system. Axis of the cylinder
1089         #  will be collinear to the OZ axis of the coordinate system.
1090         #  @param theR Cylinder radius.
1091         #  @param theH Cylinder height.
1092         #  @return New GEOM_Object, containing the created cylinder.
1093         #
1094         #  @ref tui_creation_cylinder "Example"
1095         def MakeCylinderRH(self,theR, theH):
1096             # Example: see GEOM_TestAll.py
1097             theR,theH,Parameters = ParseParameters(theR, theH)
1098             anObj = self.PrimOp.MakeCylinderRH(theR, theH)
1099             RaiseIfFailed("MakeCylinderRH", self.PrimOp)
1100             anObj.SetParameters(Parameters)
1101             return anObj
1102
1103         ## Create a sphere with given center and radius.
1104         #  @param thePnt Sphere center.
1105         #  @param theR Sphere radius.
1106         #  @return New GEOM_Object, containing the created sphere.
1107         #
1108         #  @ref tui_creation_sphere "Example"
1109         def MakeSpherePntR(self, thePnt, theR):
1110             # Example: see GEOM_TestAll.py
1111             theR,Parameters = ParseParameters(theR)
1112             anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
1113             RaiseIfFailed("MakeSpherePntR", self.PrimOp)
1114             anObj.SetParameters(Parameters)
1115             return anObj
1116
1117         ## Create a sphere with given center and radius.
1118         #  @param x,y,z Coordinates of sphere center.
1119         #  @param theR Sphere radius.
1120         #  @return New GEOM_Object, containing the created sphere.
1121         #
1122         #  @ref tui_creation_sphere "Example"
1123         def MakeSphere(self, x, y, z, theR):
1124             # Example: see GEOM_TestAll.py
1125             point = self.MakeVertex(x, y, z)
1126             anObj = self.MakeSpherePntR(point, theR)
1127             return anObj
1128
1129         ## Create a sphere with given radius at the origin of coordinate system.
1130         #  @param theR Sphere radius.
1131         #  @return New GEOM_Object, containing the created sphere.
1132         #
1133         #  @ref tui_creation_sphere "Example"
1134         def MakeSphereR(self, theR):
1135             # Example: see GEOM_TestAll.py
1136             theR,Parameters = ParseParameters(theR)
1137             anObj = self.PrimOp.MakeSphereR(theR)
1138             RaiseIfFailed("MakeSphereR", self.PrimOp)
1139             anObj.SetParameters(Parameters)
1140             return anObj
1141
1142         ## Create a cone with given base point, axis, height and radiuses.
1143         #  @param thePnt Central point of the first cone base.
1144         #  @param theAxis Cone axis.
1145         #  @param theR1 Radius of the first cone base.
1146         #  @param theR2 Radius of the second cone base.
1147         #    \note If both radiuses are non-zero, the cone will be truncated.
1148         #    \note If the radiuses are equal, a cylinder will be created instead.
1149         #  @param theH Cone height.
1150         #  @return New GEOM_Object, containing the created cone.
1151         #
1152         #  @ref tui_creation_cone "Example"
1153         def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
1154             # Example: see GEOM_TestAll.py
1155             theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1156             anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
1157             RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
1158             anObj.SetParameters(Parameters)
1159             return anObj
1160
1161         ## Create a cone with given height and radiuses at
1162         #  the origin of coordinate system. Axis of the cone will
1163         #  be collinear to the OZ axis of the coordinate system.
1164         #  @param theR1 Radius of the first cone base.
1165         #  @param theR2 Radius of the second cone base.
1166         #    \note If both radiuses are non-zero, the cone will be truncated.
1167         #    \note If the radiuses are equal, a cylinder will be created instead.
1168         #  @param theH Cone height.
1169         #  @return New GEOM_Object, containing the created cone.
1170         #
1171         #  @ref tui_creation_cone "Example"
1172         def MakeConeR1R2H(self,theR1, theR2, theH):
1173             # Example: see GEOM_TestAll.py
1174             theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1175             anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
1176             RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
1177             anObj.SetParameters(Parameters)
1178             return anObj
1179
1180         ## Create a torus with given center, normal vector and radiuses.
1181         #  @param thePnt Torus central point.
1182         #  @param theVec Torus axis of symmetry.
1183         #  @param theRMajor Torus major radius.
1184         #  @param theRMinor Torus minor radius.
1185         #  @return New GEOM_Object, containing the created torus.
1186         #
1187         #  @ref tui_creation_torus "Example"
1188         def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
1189             # Example: see GEOM_TestAll.py
1190             theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1191             anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
1192             RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
1193             anObj.SetParameters(Parameters)
1194             return anObj
1195
1196         ## Create a torus with given radiuses at the origin of coordinate system.
1197         #  @param theRMajor Torus major radius.
1198         #  @param theRMinor Torus minor radius.
1199         #  @return New GEOM_Object, containing the created torus.
1200         #
1201         #  @ref tui_creation_torus "Example"
1202         def MakeTorusRR(self, theRMajor, theRMinor):
1203             # Example: see GEOM_TestAll.py
1204             theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1205             anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
1206             RaiseIfFailed("MakeTorusRR", self.PrimOp)
1207             anObj.SetParameters(Parameters)
1208             return anObj
1209
1210         # end of l3_3d_primitives
1211         ## @}
1212
1213         ## @addtogroup l3_complex
1214         ## @{
1215
1216         ## Create a shape by extrusion of the base shape along a vector, defined by two points.
1217         #  @param theBase Base shape to be extruded.
1218         #  @param thePoint1 First end of extrusion vector.
1219         #  @param thePoint2 Second end of extrusion vector.
1220         #  @return New GEOM_Object, containing the created prism.
1221         #
1222         #  @ref tui_creation_prism "Example"
1223         def MakePrism(self, theBase, thePoint1, thePoint2):
1224             # Example: see GEOM_TestAll.py
1225             anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
1226             RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1227             return anObj
1228
1229         ## Create a shape by extrusion of the base shape along the vector,
1230         #  i.e. all the space, transfixed by the base shape during its translation
1231         #  along the vector on the given distance.
1232         #  @param theBase Base shape to be extruded.
1233         #  @param theVec Direction of extrusion.
1234         #  @param theH Prism dimension along theVec.
1235         #  @return New GEOM_Object, containing the created prism.
1236         #
1237         #  @ref tui_creation_prism "Example"
1238         def MakePrismVecH(self, theBase, theVec, theH):
1239             # Example: see GEOM_TestAll.py
1240             theH,Parameters = ParseParameters(theH)
1241             anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1242             RaiseIfFailed("MakePrismVecH", self.PrimOp)
1243             anObj.SetParameters(Parameters)
1244             return anObj
1245
1246         ## Create a shape by extrusion of the base shape along the vector,
1247         #  i.e. all the space, transfixed by the base shape during its translation
1248         #  along the vector on the given distance in 2 Ways (forward/backward) .
1249         #  @param theBase Base shape to be extruded.
1250         #  @param theVec Direction of extrusion.
1251         #  @param theH Prism dimension along theVec in forward direction.
1252         #  @return New GEOM_Object, containing the created prism.
1253         #
1254         #  @ref tui_creation_prism "Example"
1255         def MakePrismVecH2Ways(self, theBase, theVec, theH):
1256             # Example: see GEOM_TestAll.py
1257             theH,Parameters = ParseParameters(theH)
1258             anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1259             RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1260             anObj.SetParameters(Parameters)
1261             return anObj
1262
1263         ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1264         #  @param theBase Base shape to be extruded.
1265         #  @param theDX, theDY, theDZ Directions of extrusion.
1266         #  @return New GEOM_Object, containing the created prism.
1267         #
1268         #  @ref tui_creation_prism "Example"
1269         def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
1270             # Example: see GEOM_TestAll.py
1271             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1272             anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1273             RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1274             anObj.SetParameters(Parameters)
1275             return anObj
1276
1277         ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1278         #  i.e. all the space, transfixed by the base shape during its translation
1279         #  along the vector on the given distance in 2 Ways (forward/backward) .
1280         #  @param theBase Base shape to be extruded.
1281         #  @param theDX, theDY, theDZ Directions of extrusion.
1282         #  @return New GEOM_Object, containing the created prism.
1283         #
1284         #  @ref tui_creation_prism "Example"
1285         def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1286             # Example: see GEOM_TestAll.py
1287             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1288             anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1289             RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1290             anObj.SetParameters(Parameters)
1291             return anObj
1292
1293         ## Create a shape by revolution of the base shape around the axis
1294         #  on the given angle, i.e. all the space, transfixed by the base
1295         #  shape during its rotation around the axis on the given angle.
1296         #  @param theBase Base shape to be rotated.
1297         #  @param theAxis Rotation axis.
1298         #  @param theAngle Rotation angle in radians.
1299         #  @return New GEOM_Object, containing the created revolution.
1300         #
1301         #  @ref tui_creation_revolution "Example"
1302         def MakeRevolution(self, theBase, theAxis, theAngle):
1303             # Example: see GEOM_TestAll.py
1304             theAngle,Parameters = ParseParameters(theAngle)
1305             anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1306             RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1307             anObj.SetParameters(Parameters)
1308             return anObj
1309
1310         ## The Same Revolution but in both ways forward&backward.
1311         def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1312             theAngle,Parameters = ParseParameters(theAngle)
1313             anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1314             RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1315             anObj.SetParameters(Parameters)
1316             return anObj
1317
1318         ## Create a filling from the given compound of contours.
1319         #  @param theShape the compound of contours
1320         #  @param theMinDeg a minimal degree of BSpline surface to create
1321         #  @param theMaxDeg a maximal degree of BSpline surface to create
1322         #  @param theTol2D a 2d tolerance to be reached
1323         #  @param theTol3D a 3d tolerance to be reached
1324         #  @param theNbIter a number of iteration of approximation algorithm
1325         #  @param isUseOri flag for take into account orientation of edges
1326         #  @param isApprox if True, BSpline curves are generated in the process
1327         #                  of surface construction. By default it is False, that means
1328         #                  the surface is created using Besier curves. The usage of
1329         #                  Approximation makes the algorithm work slower, but allows
1330         #                  building the surface for rather complex cases
1331         #  @return New GEOM_Object, containing the created filling surface.
1332         #
1333         #  @ref tui_creation_filling "Example"
1334         def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D,
1335                         theTol3D, theNbIter, isUseOri=0, isApprox=0):
1336             # Example: see GEOM_TestAll.py
1337             theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg,
1338                                                                                          theTol2D, theTol3D, theNbIter)
1339             anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1340                                             theTol2D, theTol3D, theNbIter,
1341                                             isUseOri, isApprox)
1342             RaiseIfFailed("MakeFilling", self.PrimOp)
1343             anObj.SetParameters(Parameters)
1344             return anObj
1345
1346         ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1347         #  @param theSeqSections - set of specified sections.
1348         #  @param theModeSolid - mode defining building solid or shell
1349         #  @param thePreci - precision 3D used for smoothing by default 1.e-6
1350         #  @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1351         #  @return New GEOM_Object, containing the created shell or solid.
1352         #
1353         #  @ref swig_todo "Example"
1354         def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1355             # Example: see GEOM_TestAll.py
1356             anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1357             RaiseIfFailed("MakeThruSections", self.PrimOp)
1358             return anObj
1359
1360         ## Create a shape by extrusion of the base shape along
1361         #  the path shape. The path shape can be a wire or an edge.
1362         #  @param theBase Base shape to be extruded.
1363         #  @param thePath Path shape to extrude the base shape along it.
1364         #  @return New GEOM_Object, containing the created pipe.
1365         #
1366         #  @ref tui_creation_pipe "Example"
1367         def MakePipe(self,theBase, thePath):
1368             # Example: see GEOM_TestAll.py
1369             anObj = self.PrimOp.MakePipe(theBase, thePath)
1370             RaiseIfFailed("MakePipe", self.PrimOp)
1371             return anObj
1372
1373         ## Create a shape by extrusion of the profile shape along
1374         #  the path shape. The path shape can be a wire or an edge.
1375         #  the several profiles can be specified in the several locations of path.      
1376         #  @param theSeqBases - list of  Bases shape to be extruded.
1377         #  @param theLocations - list of locations on the path corresponding
1378         #                        specified list of the Bases shapes. Number of locations
1379         #                        should be equal to number of bases or list of locations can be empty.
1380         #  @param thePath - Path shape to extrude the base shape along it.
1381         #  @param theWithContact - the mode defining that the section is translated to be in
1382         #                          contact with the spine.
1383         #  @param theWithCorrection - defining that the section is rotated to be
1384         #                             orthogonal to the spine tangent in the correspondent point
1385         #  @return New GEOM_Object, containing the created pipe.
1386         #
1387         #  @ref tui_creation_pipe_with_diff_sec "Example"
1388         def MakePipeWithDifferentSections(self, theSeqBases,
1389                                           theLocations, thePath,
1390                                           theWithContact, theWithCorrection):
1391             anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1392                                                               theLocations, thePath,
1393                                                               theWithContact, theWithCorrection)
1394             RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1395             return anObj
1396
1397         ## Create a shape by extrusion of the profile shape along
1398         #  the path shape. The path shape can be a wire or a edge.
1399         #  the several profiles can be specified in the several locations of path.      
1400         #  @param theSeqBases - list of  Bases shape to be extruded. Base shape must be
1401         #                       shell or face. If number of faces in neighbour sections
1402         #                       aren't coincided result solid between such sections will
1403         #                       be created using external boundaries of this shells.
1404         #  @param theSeqSubBases - list of corresponding subshapes of section shapes.
1405         #                          This list is used for searching correspondences between
1406         #                          faces in the sections. Size of this list must be equal
1407         #                          to size of list of base shapes.
1408         #  @param theLocations - list of locations on the path corresponding
1409         #                        specified list of the Bases shapes. Number of locations
1410         #                        should be equal to number of bases. First and last
1411         #                        locations must be coincided with first and last vertexes
1412         #                        of path correspondingly.
1413         #  @param thePath - Path shape to extrude the base shape along it.
1414         #  @param theWithContact - the mode defining that the section is translated to be in
1415         #                          contact with the spine.
1416         #  @param theWithCorrection - defining that the section is rotated to be
1417         #                             orthogonal to the spine tangent in the correspondent point
1418         #  @return New GEOM_Object, containing the created solids.
1419         #
1420         #  @ref tui_creation_pipe_with_shell_sec "Example"
1421         def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1422                                       theLocations, thePath,
1423                                       theWithContact, theWithCorrection):
1424             anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1425                                                           theLocations, thePath,
1426                                                           theWithContact, theWithCorrection)
1427             RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1428             return anObj
1429
1430         ## Create a shape by extrusion of the profile shape along
1431         #  the path shape. This function is used only for debug pipe
1432         #  functionality - it is a version of previous function
1433         #  (MakePipeWithShellSections(...)) which give a possibility to
1434         #  recieve information about creating pipe between each pair of
1435         #  sections step by step.
1436         def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1437                                              theLocations, thePath,
1438                                              theWithContact, theWithCorrection):
1439             res = []
1440             nbsect = len(theSeqBases)
1441             nbsubsect = len(theSeqSubBases)
1442             #print "nbsect = ",nbsect
1443             for i in range(1,nbsect):
1444                 #print "  i = ",i
1445                 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1446                 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1447                 tmpSeqSubBases = []
1448                 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1449                 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1450                                                               tmpLocations, thePath,
1451                                                               theWithContact, theWithCorrection)
1452                 if self.PrimOp.IsDone() == 0:
1453                     print "Problems with pipe creation between ",i," and ",i+1," sections"
1454                     RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1455                     break
1456                 else:
1457                     print "Pipe between ",i," and ",i+1," sections is OK"
1458                     res.append(anObj)
1459                     pass
1460                 pass
1461
1462             resc = self.MakeCompound(res)
1463             #resc = self.MakeSewing(res, 0.001)
1464             #print "resc: ",resc
1465             return resc
1466
1467         ## Create solids between given sections
1468         #  @param theSeqBases - list of sections (shell or face).
1469         #  @param theLocations - list of corresponding vertexes
1470         #  @return New GEOM_Object, containing the created solids.
1471         #
1472         #  @ref tui_creation_pipe_without_path "Example"
1473         def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1474             anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1475             RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1476             return anObj
1477
1478         ## Create a shape by extrusion of the base shape along
1479         #  the path shape with constant bi-normal direction along the given vector.
1480         #  The path shape can be a wire or an edge.
1481         #  @param theBase Base shape to be extruded.
1482         #  @param thePath Path shape to extrude the base shape along it.
1483         #  @param theVec Vector defines a constant binormal direction to keep the
1484         #                same angle beetween the direction and the sections
1485         #                along the sweep surface.
1486         #  @return New GEOM_Object, containing the created pipe.
1487         #
1488         #  @ref tui_creation_pipe "Example"
1489         def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1490             # Example: see GEOM_TestAll.py
1491             anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1492             RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1493             return anObj
1494
1495         # end of l3_complex
1496         ## @}
1497
1498         ## @addtogroup l3_advanced
1499         ## @{
1500
1501         ## Create a linear edge with specified ends.
1502         #  @param thePnt1 Point for the first end of edge.
1503         #  @param thePnt2 Point for the second end of edge.
1504         #  @return New GEOM_Object, containing the created edge.
1505         #
1506         #  @ref tui_creation_edge "Example"
1507         def MakeEdge(self,thePnt1, thePnt2):
1508             # Example: see GEOM_TestAll.py
1509             anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1510             RaiseIfFailed("MakeEdge", self.ShapesOp)
1511             return anObj
1512
1513         ## Create a wire from the set of edges and wires.
1514         #  @param theEdgesAndWires List of edges and/or wires.
1515         #  @param theTolerance Maximum distance between vertices, that will be merged.
1516         #                      Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1517         #  @return New GEOM_Object, containing the created wire.
1518         #
1519         #  @ref tui_creation_wire "Example"
1520         def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
1521             # Example: see GEOM_TestAll.py
1522             anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
1523             RaiseIfFailed("MakeWire", self.ShapesOp)
1524             return anObj
1525
1526         ## Create a face on the given wire.
1527         #  @param theWire closed Wire or Edge to build the face on.
1528         #  @param isPlanarWanted If TRUE, only planar face will be built.
1529         #                        If impossible, NULL object will be returned.
1530         #  @return New GEOM_Object, containing the created face.
1531         #
1532         #  @ref tui_creation_face "Example"
1533         def MakeFace(self,theWire, isPlanarWanted):
1534             # Example: see GEOM_TestAll.py
1535             anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1536             RaiseIfFailed("MakeFace", self.ShapesOp)
1537             return anObj
1538
1539         ## Create a face on the given wires set.
1540         #  @param theWires List of closed wires or edges to build the face on.
1541         #  @param isPlanarWanted If TRUE, only planar face will be built.
1542         #                        If impossible, NULL object will be returned.
1543         #  @return New GEOM_Object, containing the created face.
1544         #
1545         #  @ref tui_creation_face "Example"
1546         def MakeFaceWires(self,theWires, isPlanarWanted):
1547             # Example: see GEOM_TestAll.py
1548             anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1549             RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1550             return anObj
1551
1552         ## Shortcut to MakeFaceWires()
1553         #
1554         #  @ref tui_creation_face "Example 1"
1555         #  \n @ref swig_MakeFaces  "Example 2"
1556         def MakeFaces(self,theWires, isPlanarWanted):
1557             # Example: see GEOM_TestOthers.py
1558             anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1559             return anObj
1560
1561         ## Create a shell from the set of faces and shells.
1562         #  @param theFacesAndShells List of faces and/or shells.
1563         #  @return New GEOM_Object, containing the created shell.
1564         #
1565         #  @ref tui_creation_shell "Example"
1566         def MakeShell(self,theFacesAndShells):
1567             # Example: see GEOM_TestAll.py
1568             anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1569             RaiseIfFailed("MakeShell", self.ShapesOp)
1570             return anObj
1571
1572         ## Create a solid, bounded by the given shells.
1573         #  @param theShells Sequence of bounding shells.
1574         #  @return New GEOM_Object, containing the created solid.
1575         #
1576         #  @ref tui_creation_solid "Example"
1577         def MakeSolid(self,theShells):
1578             # Example: see GEOM_TestAll.py
1579             anObj = self.ShapesOp.MakeSolidShells(theShells)
1580             RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1581             return anObj
1582
1583         ## Create a compound of the given shapes.
1584         #  @param theShapes List of shapes to put in compound.
1585         #  @return New GEOM_Object, containing the created compound.
1586         #
1587         #  @ref tui_creation_compound "Example"
1588         def MakeCompound(self,theShapes):
1589             # Example: see GEOM_TestAll.py
1590             anObj = self.ShapesOp.MakeCompound(theShapes)
1591             RaiseIfFailed("MakeCompound", self.ShapesOp)
1592             return anObj
1593
1594         # end of l3_advanced
1595         ## @}
1596
1597         ## @addtogroup l2_measure
1598         ## @{
1599
1600         ## Gives quantity of faces in the given shape.
1601         #  @param theShape Shape to count faces of.
1602         #  @return Quantity of faces.
1603         #
1604         #  @ref swig_NumberOf "Example"
1605         def NumberOfFaces(self, theShape):
1606             # Example: see GEOM_TestOthers.py
1607             nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1608             RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1609             return nb_faces
1610
1611         ## Gives quantity of edges in the given shape.
1612         #  @param theShape Shape to count edges of.
1613         #  @return Quantity of edges.
1614         #
1615         #  @ref swig_NumberOf "Example"
1616         def NumberOfEdges(self, theShape):
1617             # Example: see GEOM_TestOthers.py
1618             nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1619             RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1620             return nb_edges
1621
1622         ## Gives quantity of subshapes of type theShapeType in the given shape.
1623         #  @param theShape Shape to count subshapes of.
1624         #  @param theShapeType Type of subshapes to count.
1625         #  @return Quantity of subshapes of given type.
1626         #
1627         #  @ref swig_NumberOf "Example"
1628         def NumberOfSubShapes(self, theShape, theShapeType):
1629             # Example: see GEOM_TestOthers.py
1630             nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
1631             RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
1632             return nb_ss
1633
1634         ## Gives quantity of solids in the given shape.
1635         #  @param theShape Shape to count solids in.
1636         #  @return Quantity of solids.
1637         #
1638         #  @ref swig_NumberOf "Example"
1639         def NumberOfSolids(self, theShape):
1640             # Example: see GEOM_TestOthers.py
1641             nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
1642             RaiseIfFailed("NumberOfSolids", self.ShapesOp)
1643             return nb_solids
1644
1645         # end of l2_measure
1646         ## @}
1647
1648         ## @addtogroup l3_healing
1649         ## @{
1650
1651         ## Reverses an orientation the given shape.
1652         #  @param theShape Shape to be reversed.
1653         #  @return The reversed copy of theShape.
1654         #
1655         #  @ref swig_ChangeOrientation "Example"
1656         def ChangeOrientation(self,theShape):
1657             # Example: see GEOM_TestAll.py
1658             anObj = self.ShapesOp.ChangeOrientation(theShape)
1659             RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1660             return anObj
1661
1662         ## Shortcut to ChangeOrientation()
1663         #
1664         #  @ref swig_OrientationChange "Example"
1665         def OrientationChange(self,theShape):
1666             # Example: see GEOM_TestOthers.py
1667             anObj = self.ChangeOrientation(theShape)
1668             return anObj
1669
1670         # end of l3_healing
1671         ## @}
1672
1673         ## @addtogroup l4_obtain
1674         ## @{
1675
1676         ## Retrieve all free faces from the given shape.
1677         #  Free face is a face, which is not shared between two shells of the shape.
1678         #  @param theShape Shape to find free faces in.
1679         #  @return List of IDs of all free faces, contained in theShape.
1680         #
1681         #  @ref tui_measurement_tools_page "Example"
1682         def GetFreeFacesIDs(self,theShape):
1683             # Example: see GEOM_TestOthers.py
1684             anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1685             RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1686             return anIDs
1687
1688         ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1689         #  @param theShape1 Shape to find sub-shapes in.
1690         #  @param theShape2 Shape to find shared sub-shapes with.
1691         #  @param theShapeType Type of sub-shapes to be retrieved.
1692         #  @return List of sub-shapes of theShape1, shared with theShape2.
1693         #
1694         #  @ref swig_GetSharedShapes "Example"
1695         def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1696             # Example: see GEOM_TestOthers.py
1697             aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1698             RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1699             return aList
1700
1701         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1702         #  situated relatively the specified plane by the certain way,
1703         #  defined through <VAR>theState</VAR> parameter.
1704         #  @param theShape Shape to find sub-shapes of.
1705         #  @param theShapeType Type of sub-shapes to be retrieved.
1706         #  @param theAx1 Vector (or line, or linear edge), specifying normal
1707         #                direction and location of the plane to find shapes on.
1708         #  @param theState The state of the subshapes to find. It can be one of
1709         #   ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1710         #  @return List of all found sub-shapes.
1711         #
1712         #  @ref swig_GetShapesOnPlane "Example"
1713         def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1714             # Example: see GEOM_TestOthers.py
1715             aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1716             RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1717             return aList
1718
1719         ## Works like the above method, but returns list of sub-shapes indices
1720         #
1721         #  @ref swig_GetShapesOnPlaneIDs "Example"
1722         def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1723             # Example: see GEOM_TestOthers.py
1724             aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1725             RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1726             return aList
1727
1728         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1729         #  situated relatively the specified plane by the certain way,
1730         #  defined through <VAR>theState</VAR> parameter.
1731         #  @param theShape Shape to find sub-shapes of.
1732         #  @param theShapeType Type of sub-shapes to be retrieved.
1733         #  @param theAx1 Vector (or line, or linear edge), specifying normal
1734         #                direction of the plane to find shapes on.
1735         #  @param thePnt Point specifying location of the plane to find shapes on.
1736         #  @param theState The state of the subshapes to find. It can be one of
1737         #                  ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1738         #  @return List of all found sub-shapes.
1739         #
1740         #  @ref swig_GetShapesOnPlaneWithLocation "Example"
1741         def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1742             # Example: see GEOM_TestOthers.py
1743             aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1744                                                                theAx1, thePnt, theState)
1745             RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1746             return aList
1747
1748         ## Works like the above method, but returns list of sub-shapes indices
1749         #
1750         #  @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1751         def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1752             # Example: see GEOM_TestOthers.py
1753             aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1754                                                                   theAx1, thePnt, theState)
1755             RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1756             return aList
1757
1758         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1759         #  the specified cylinder by the certain way, defined through \a theState parameter.
1760         #  @param theShape Shape to find sub-shapes of.
1761         #  @param theShapeType Type of sub-shapes to be retrieved.
1762         #  @param theAxis Vector (or line, or linear edge), specifying
1763         #                 axis of the cylinder to find shapes on.
1764         #  @param theRadius Radius of the cylinder to find shapes on.
1765         #  @param theState The state of the subshapes to find. It can be one of
1766         #   ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1767         #  @return List of all found sub-shapes.
1768         #
1769         #  @ref swig_GetShapesOnCylinder "Example"
1770         def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1771             # Example: see GEOM_TestOthers.py
1772             aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1773             RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1774             return aList
1775
1776         ## Works like the above method, but returns list of sub-shapes indices
1777         #
1778         #  @ref swig_GetShapesOnCylinderIDs "Example"
1779         def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1780             # Example: see GEOM_TestOthers.py
1781             aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1782             RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1783             return aList
1784
1785         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1786         #  the specified cylinder by the certain way, defined through \a theState parameter.
1787         #  @param theShape Shape to find sub-shapes of.
1788         #  @param theShapeType Type of sub-shapes to be retrieved.
1789         #  @param theAxis Vector (or line, or linear edge), specifying
1790         #                 axis of the cylinder to find shapes on.
1791         #  @param thePnt Point specifying location of the bottom of the cylinder.
1792         #  @param theRadius Radius of the cylinder to find shapes on.
1793         #  @param theState The state of the subshapes to find. It can be one of
1794         #   ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1795         #  @return List of all found sub-shapes.
1796         #
1797         #  @ref swig_GetShapesOnCylinderWithLocation "Example"
1798         def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1799             # Example: see GEOM_TestOthers.py
1800             aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1801             RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
1802             return aList
1803
1804         ## Works like the above method, but returns list of sub-shapes indices
1805         #
1806         #  @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
1807         def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1808             # Example: see GEOM_TestOthers.py
1809             aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1810             RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
1811             return aList
1812
1813         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1814         #  the specified sphere by the certain way, defined through \a theState parameter.
1815         #  @param theShape Shape to find sub-shapes of.
1816         #  @param theShapeType Type of sub-shapes to be retrieved.
1817         #  @param theCenter Point, specifying center of the sphere to find shapes on.
1818         #  @param theRadius Radius of the sphere to find shapes on.
1819         #  @param theState The state of the subshapes to find. It can be one of
1820         #   ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1821         #  @return List of all found sub-shapes.
1822         #
1823         #  @ref swig_GetShapesOnSphere "Example"
1824         def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1825             # Example: see GEOM_TestOthers.py
1826             aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1827             RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1828             return aList
1829
1830         ## Works like the above method, but returns list of sub-shapes indices
1831         #
1832         #  @ref swig_GetShapesOnSphereIDs "Example"
1833         def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1834             # Example: see GEOM_TestOthers.py
1835             aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1836             RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1837             return aList
1838
1839         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1840         #  the specified quadrangle by the certain way, defined through \a theState parameter.
1841         #  @param theShape Shape to find sub-shapes of.
1842         #  @param theShapeType Type of sub-shapes to be retrieved.
1843         #  @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1844         #  @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1845         #  @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1846         #  @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1847         #  @param theState The state of the subshapes to find. It can be one of
1848         #                  ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1849         #  @return List of all found sub-shapes.
1850         #
1851         #  @ref swig_GetShapesOnQuadrangle "Example"
1852         def GetShapesOnQuadrangle(self, theShape, theShapeType,
1853                                   theTopLeftPoint, theTopRigthPoint,
1854                                   theBottomLeftPoint, theBottomRigthPoint, theState):
1855             # Example: see GEOM_TestOthers.py
1856             aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1857                                                         theTopLeftPoint, theTopRigthPoint,
1858                                                         theBottomLeftPoint, theBottomRigthPoint, theState)
1859             RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1860             return aList
1861
1862         ## Works like the above method, but returns list of sub-shapes indices
1863         #
1864         #  @ref swig_GetShapesOnQuadrangleIDs "Example"
1865         def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1866                                      theTopLeftPoint, theTopRigthPoint,
1867                                      theBottomLeftPoint, theBottomRigthPoint, theState):
1868             # Example: see GEOM_TestOthers.py
1869             aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1870                                                            theTopLeftPoint, theTopRigthPoint,
1871                                                            theBottomLeftPoint, theBottomRigthPoint, theState)
1872             RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1873             return aList
1874
1875         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1876         #  the specified \a theBox by the certain way, defined through \a theState parameter.
1877         #  @param theBox Shape for relative comparing.
1878         #  @param theShape Shape to find sub-shapes of.
1879         #  @param theShapeType Type of sub-shapes to be retrieved.
1880         #  @param theState The state of the subshapes to find. It can be one of
1881         #                  ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1882         #  @return List of all found sub-shapes.
1883         #
1884         #  @ref swig_GetShapesOnBox "Example"
1885         def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1886             # Example: see GEOM_TestOthers.py
1887             aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1888             RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1889             return aList
1890
1891         ## Works like the above method, but returns list of sub-shapes indices
1892         #
1893         #  @ref swig_GetShapesOnBoxIDs "Example"
1894         def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1895             # Example: see GEOM_TestOthers.py
1896             aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1897             RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1898             return aList
1899
1900         ## Find in \a theShape all sub-shapes of type \a theShapeType,
1901         #  situated relatively the specified \a theCheckShape by the
1902         #  certain way, defined through \a theState parameter.
1903         #  @param theCheckShape Shape for relative comparing. It must be a solid.
1904         #  @param theShape Shape to find sub-shapes of.
1905         #  @param theShapeType Type of sub-shapes to be retrieved.
1906         #  @param theState The state of the subshapes to find. It can be one of
1907         #                  ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1908         #  @return List of all found sub-shapes.
1909         #
1910         #  @ref swig_GetShapesOnShape "Example"
1911         def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1912             # Example: see GEOM_TestOthers.py
1913             aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1914                                                    theShapeType, theState)
1915             RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1916             return aList
1917
1918         ## Works like the above method, but returns result as compound
1919         #
1920         #  @ref swig_GetShapesOnShapeAsCompound "Example"
1921         def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1922             # Example: see GEOM_TestOthers.py
1923             anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1924                                                              theShapeType, theState)
1925             RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1926             return anObj
1927
1928         ## Works like the above method, but returns list of sub-shapes indices
1929         #
1930         #  @ref swig_GetShapesOnShapeIDs "Example"
1931         def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1932             # Example: see GEOM_TestOthers.py
1933             aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1934                                                       theShapeType, theState)
1935             RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1936             return aList
1937
1938         ## Get sub-shape(s) of theShapeWhere, which are
1939         #  coincident with \a theShapeWhat or could be a part of it.
1940         #  @param theShapeWhere Shape to find sub-shapes of.
1941         #  @param theShapeWhat Shape, specifying what to find.
1942         #  @return Group of all found sub-shapes or a single found sub-shape.
1943         #
1944         #  @ref swig_GetInPlace "Example"
1945         def GetInPlace(self,theShapeWhere, theShapeWhat):
1946             # Example: see GEOM_TestOthers.py
1947             anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1948             RaiseIfFailed("GetInPlace", self.ShapesOp)
1949             return anObj
1950
1951         ## Get sub-shape(s) of \a theShapeWhere, which are
1952         #  coincident with \a theShapeWhat or could be a part of it.
1953         #
1954         #  Implementation of this method is based on a saved history of an operation,
1955         #  produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1956         #  arguments (an argument shape or a sub-shape of an argument shape).
1957         #  The operation could be the Partition or one of boolean operations,
1958         #  performed on simple shapes (not on compounds).
1959         #
1960         #  @param theShapeWhere Shape to find sub-shapes of.
1961         #  @param theShapeWhat Shape, specifying what to find (must be in the
1962         #                      building history of the ShapeWhere).
1963         #  @return Group of all found sub-shapes or a single found sub-shape.
1964         #
1965         #  @ref swig_GetInPlace "Example"
1966         def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1967             # Example: see GEOM_TestOthers.py
1968             anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1969             RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
1970             return anObj
1971
1972         ## Get sub-shape of theShapeWhere, which is
1973         #  equal to \a theShapeWhat.
1974         #  @param theShapeWhere Shape to find sub-shape of.
1975         #  @param theShapeWhat Shape, specifying what to find.
1976         #  @return New GEOM_Object for found sub-shape.
1977         #
1978         #  @ref swig_GetSame "Example"
1979         def GetSame(self,theShapeWhere, theShapeWhat):
1980             anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
1981             RaiseIfFailed("GetSame", self.ShapesOp)
1982             return anObj
1983
1984         # end of l4_obtain
1985         ## @}
1986
1987         ## @addtogroup l4_access
1988         ## @{
1989
1990         ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
1991         #  of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
1992         #
1993         #  @ref swig_all_decompose "Example"
1994         def GetSubShape(self, aShape, ListOfID):
1995             # Example: see GEOM_TestAll.py
1996             anObj = self.AddSubShape(aShape,ListOfID)
1997             return anObj
1998
1999         ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
2000         #
2001         #  @ref swig_all_decompose "Example"
2002         def GetSubShapeID(self, aShape, aSubShape):
2003             # Example: see GEOM_TestAll.py
2004             anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
2005             RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
2006             return anID
2007
2008         # end of l4_access
2009         ## @}
2010
2011         ## @addtogroup l4_decompose
2012         ## @{
2013
2014         ## Explode a shape on subshapes of a given type.
2015         #  @param aShape Shape to be exploded.
2016         #  @param aType Type of sub-shapes to be retrieved.
2017         #  @return List of sub-shapes of type theShapeType, contained in theShape.
2018         #
2019         #  @ref swig_all_decompose "Example"
2020         def SubShapeAll(self, aShape, aType):
2021             # Example: see GEOM_TestAll.py
2022             ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
2023             RaiseIfFailed("MakeExplode", self.ShapesOp)
2024             return ListObj
2025
2026         ## Explode a shape on subshapes of a given type.
2027         #  @param aShape Shape to be exploded.
2028         #  @param aType Type of sub-shapes to be retrieved.
2029         #  @return List of IDs of sub-shapes.
2030         #
2031         #  @ref swig_all_decompose "Example"
2032         def SubShapeAllIDs(self, aShape, aType):
2033             ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
2034             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2035             return ListObj
2036
2037         ## Explode a shape on subshapes of a given type.
2038         #  Sub-shapes will be sorted by coordinates of their gravity centers.
2039         #  @param aShape Shape to be exploded.
2040         #  @param aType Type of sub-shapes to be retrieved.
2041         #  @return List of sub-shapes of type theShapeType, contained in theShape.
2042         #
2043         #  @ref swig_SubShapeAllSorted "Example"
2044         def SubShapeAllSorted(self, aShape, aType):
2045             # Example: see GEOM_TestAll.py
2046             ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
2047             RaiseIfFailed("MakeExplode", self.ShapesOp)
2048             return ListObj
2049
2050         ## Explode a shape on subshapes of a given type.
2051         #  Sub-shapes will be sorted by coordinates of their gravity centers.
2052         #  @param aShape Shape to be exploded.
2053         #  @param aType Type of sub-shapes to be retrieved.
2054         #  @return List of IDs of sub-shapes.
2055         #
2056         #  @ref swig_all_decompose "Example"
2057         def SubShapeAllSortedIDs(self, aShape, aType):
2058             ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
2059             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2060             return ListIDs
2061
2062         ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2063         #  selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
2064         #  Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2065         #
2066         #  @ref swig_all_decompose "Example"
2067         def SubShape(self, aShape, aType, ListOfInd):
2068             # Example: see GEOM_TestAll.py
2069             ListOfIDs = []
2070             AllShapeList = self.SubShapeAll(aShape, aType)
2071             for ind in ListOfInd:
2072                 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
2073             anObj = self.GetSubShape(aShape, ListOfIDs)
2074             return anObj
2075
2076         ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2077         #  selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
2078         #  Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2079         #
2080         #  @ref swig_all_decompose "Example"
2081         def SubShapeSorted(self,aShape, aType, ListOfInd):
2082             # Example: see GEOM_TestAll.py
2083             ListOfIDs = []
2084             AllShapeList = self.SubShapeAllSorted(aShape, aType)
2085             for ind in ListOfInd:
2086                 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
2087             anObj = self.GetSubShape(aShape, ListOfIDs)
2088             return anObj
2089
2090         # end of l4_decompose
2091         ## @}
2092
2093         ## @addtogroup l3_healing
2094         ## @{
2095
2096         ## Apply a sequence of Shape Healing operators to the given object.
2097         #  @param theShape Shape to be processed.
2098         #  @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
2099         #  @param theParameters List of names of parameters
2100         #                    ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
2101         #  @param theValues List of values of parameters, in the same order
2102         #                    as parameters are listed in <VAR>theParameters</VAR> list.
2103         #  @return New GEOM_Object, containing processed shape.
2104         #
2105         #  @ref tui_shape_processing "Example"
2106         def ProcessShape(self,theShape, theOperators, theParameters, theValues):
2107             # Example: see GEOM_TestHealing.py
2108             theValues,Parameters = ParseList(theValues)
2109             anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
2110             RaiseIfFailed("ProcessShape", self.HealOp)
2111             for string in (theOperators + theParameters):
2112                 Parameters = ":" + Parameters
2113                 pass
2114             anObj.SetParameters(Parameters)
2115             return anObj
2116
2117         ## Remove faces from the given object (shape).
2118         #  @param theObject Shape to be processed.
2119         #  @param theFaces Indices of faces to be removed, if EMPTY then the method
2120         #                  removes ALL faces of the given object.
2121         #  @return New GEOM_Object, containing processed shape.
2122         #
2123         #  @ref tui_suppress_faces "Example"
2124         def SuppressFaces(self,theObject, theFaces):
2125             # Example: see GEOM_TestHealing.py
2126             anObj = self.HealOp.SuppressFaces(theObject, theFaces)
2127             RaiseIfFailed("SuppressFaces", self.HealOp)
2128             return anObj
2129
2130         ## Sewing of some shapes into single shape.
2131         #
2132         #  @ref tui_sewing "Example"
2133         def MakeSewing(self, ListShape, theTolerance):
2134             # Example: see GEOM_TestHealing.py
2135             comp = self.MakeCompound(ListShape)
2136             anObj = self.Sew(comp, theTolerance)
2137             return anObj
2138
2139         ## Sewing of the given object.
2140         #  @param theObject Shape to be processed.
2141         #  @param theTolerance Required tolerance value.
2142         #  @return New GEOM_Object, containing processed shape.
2143         def Sew(self, theObject, theTolerance):
2144             # Example: see MakeSewing() above
2145             theTolerance,Parameters = ParseParameters(theTolerance)
2146             anObj = self.HealOp.Sew(theObject, theTolerance)
2147             RaiseIfFailed("Sew", self.HealOp)
2148             anObj.SetParameters(Parameters)
2149             return anObj
2150
2151         ## Remove internal wires and edges from the given object (face).
2152         #  @param theObject Shape to be processed.
2153         #  @param theWires Indices of wires to be removed, if EMPTY then the method
2154         #                  removes ALL internal wires of the given object.
2155         #  @return New GEOM_Object, containing processed shape.
2156         #
2157         #  @ref tui_suppress_internal_wires "Example"
2158         def SuppressInternalWires(self,theObject, theWires):
2159             # Example: see GEOM_TestHealing.py
2160             anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2161             RaiseIfFailed("RemoveIntWires", self.HealOp)
2162             return anObj
2163
2164         ## Remove internal closed contours (holes) from the given object.
2165         #  @param theObject Shape to be processed.
2166         #  @param theWires Indices of wires to be removed, if EMPTY then the method
2167         #                  removes ALL internal holes of the given object
2168         #  @return New GEOM_Object, containing processed shape.
2169         #
2170         #  @ref tui_suppress_holes "Example"
2171         def SuppressHoles(self,theObject, theWires):
2172             # Example: see GEOM_TestHealing.py
2173             anObj = self.HealOp.FillHoles(theObject, theWires)
2174             RaiseIfFailed("FillHoles", self.HealOp)
2175             return anObj
2176
2177         ## Close an open wire.
2178         #  @param theObject Shape to be processed.
2179         #  @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2180         #                  if -1, then <VAR>theObject</VAR> itself is a wire.
2181         #  @param isCommonVertex If TRUE : closure by creation of a common vertex,
2182         #                        If FALS : closure by creation of an edge between ends.
2183         #  @return New GEOM_Object, containing processed shape.
2184         #
2185         #  @ref tui_close_contour "Example"
2186         def CloseContour(self,theObject, theWires, isCommonVertex):
2187             # Example: see GEOM_TestHealing.py
2188             anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2189             RaiseIfFailed("CloseContour", self.HealOp)
2190             return anObj
2191
2192         ## Addition of a point to a given edge object.
2193         #  @param theObject Shape to be processed.
2194         #  @param theEdgeIndex Index of edge to be divided within theObject's shape,
2195         #                      if -1, then theObject itself is the edge.
2196         #  @param theValue Value of parameter on edge or length parameter,
2197         #                  depending on \a isByParameter.
2198         #  @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2199         #                       if FALSE : \a theValue is treated as a length parameter [0..1]
2200         #  @return New GEOM_Object, containing processed shape.
2201         #
2202         #  @ref tui_add_point_on_edge "Example"
2203         def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2204             # Example: see GEOM_TestHealing.py
2205             theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2206             anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2207             RaiseIfFailed("DivideEdge", self.HealOp)
2208             anObj.SetParameters(Parameters)
2209             return anObj
2210
2211         ## Change orientation of the given object. Updates given shape.
2212         #  @param theObject Shape to be processed.
2213         #
2214         #  @ref swig_todo "Example"
2215         def ChangeOrientationShell(self,theObject):
2216             theObject = self.HealOp.ChangeOrientation(theObject)
2217             RaiseIfFailed("ChangeOrientation", self.HealOp)
2218             pass
2219
2220         ## Change orientation of the given object.
2221         #  @param theObject Shape to be processed.
2222         #  @return New GEOM_Object, containing processed shape.
2223         #
2224         #  @ref swig_todo "Example"
2225         def ChangeOrientationShellCopy(self,theObject):
2226             anObj = self.HealOp.ChangeOrientationCopy(theObject)
2227             RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2228             return anObj
2229
2230         ## Get a list of wires (wrapped in GEOM_Object-s),
2231         #  that constitute a free boundary of the given shape.
2232         #  @param theObject Shape to get free boundary of.
2233         #  @return [status, theClosedWires, theOpenWires]
2234         #  status: FALSE, if an error(s) occured during the method execution.
2235         #  theClosedWires: Closed wires on the free boundary of the given shape.
2236         #  theOpenWires: Open wires on the free boundary of the given shape.
2237         #
2238         #  @ref tui_measurement_tools_page "Example"
2239         def GetFreeBoundary(self,theObject):
2240             # Example: see GEOM_TestHealing.py
2241             anObj = self.HealOp.GetFreeBoundary(theObject)
2242             RaiseIfFailed("GetFreeBoundary", self.HealOp)
2243             return anObj
2244
2245         ## Replace coincident faces in theShape by one face.
2246         #  @param theShape Initial shape.
2247         #  @param theTolerance Maximum distance between faces, which can be considered as coincident.
2248         #  @param doKeepNonSolids If FALSE, only solids will present in the result,
2249         #                         otherwise all initial shapes.
2250         #  @return New GEOM_Object, containing a copy of theShape without coincident faces.
2251         #
2252         #  @ref tui_glue_faces "Example"
2253         def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2254             # Example: see GEOM_Spanner.py
2255             theTolerance,Parameters = ParseParameters(theTolerance)
2256             anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2257             if anObj is None:
2258                 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2259             anObj.SetParameters(Parameters)
2260             return anObj
2261
2262         ## Find coincident faces in theShape for possible gluing.
2263         #  @param theShape Initial shape.
2264         #  @param theTolerance Maximum distance between faces,
2265         #                      which can be considered as coincident.
2266         #  @return ListOfGO.
2267         #
2268         #  @ref swig_todo "Example"
2269         def GetGlueFaces(self, theShape, theTolerance):
2270             # Example: see GEOM_Spanner.py
2271             anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2272             RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2273             return anObj
2274
2275         ## Replace coincident faces in theShape by one face
2276         #  in compliance with given list of faces
2277         #  @param theShape Initial shape.
2278         #  @param theTolerance Maximum distance between faces,
2279         #                      which can be considered as coincident.
2280         #  @param theFaces List of faces for gluing.
2281         #  @param doKeepNonSolids If FALSE, only solids will present in the result,
2282         #                         otherwise all initial shapes.
2283         #  @return New GEOM_Object, containing a copy of theShape
2284         #          without some faces.
2285         #
2286         #  @ref swig_todo "Example"
2287         def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2288             # Example: see GEOM_Spanner.py
2289             anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2290             if anObj is None:
2291                 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2292             return anObj
2293
2294         # end of l3_healing
2295         ## @}
2296
2297         ## @addtogroup l3_boolean Boolean Operations
2298         ## @{
2299
2300         # -----------------------------------------------------------------------------
2301         # Boolean (Common, Cut, Fuse, Section)
2302         # -----------------------------------------------------------------------------
2303
2304         ## Perform one of boolean operations on two given shapes.
2305         #  @param theShape1 First argument for boolean operation.
2306         #  @param theShape2 Second argument for boolean operation.
2307         #  @param theOperation Indicates the operation to be done:
2308         #                      1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2309         #  @return New GEOM_Object, containing the result shape.
2310         #
2311         #  @ref tui_fuse "Example"
2312         def MakeBoolean(self,theShape1, theShape2, theOperation):
2313             # Example: see GEOM_TestAll.py
2314             anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2315             RaiseIfFailed("MakeBoolean", self.BoolOp)
2316             return anObj
2317
2318         ## Shortcut to MakeBoolean(s1, s2, 1)
2319         #
2320         #  @ref tui_common "Example 1"
2321         #  \n @ref swig_MakeCommon "Example 2"
2322         def MakeCommon(self, s1, s2):
2323             # Example: see GEOM_TestOthers.py
2324             return self.MakeBoolean(s1, s2, 1)
2325
2326         ## Shortcut to MakeBoolean(s1, s2, 2)
2327         #
2328         #  @ref tui_cut "Example 1"
2329         #  \n @ref swig_MakeCommon "Example 2"
2330         def MakeCut(self, s1, s2):
2331             # Example: see GEOM_TestOthers.py
2332             return self.MakeBoolean(s1, s2, 2)
2333
2334         ## Shortcut to MakeBoolean(s1, s2, 3)
2335         #
2336         #  @ref tui_fuse "Example 1"
2337         #  \n @ref swig_MakeCommon "Example 2"
2338         def MakeFuse(self, s1, s2):
2339             # Example: see GEOM_TestOthers.py
2340             return self.MakeBoolean(s1, s2, 3)
2341
2342         ## Shortcut to MakeBoolean(s1, s2, 4)
2343         #
2344         #  @ref tui_section "Example 1"
2345         #  \n @ref swig_MakeCommon "Example 2"
2346         def MakeSection(self, s1, s2):
2347             # Example: see GEOM_TestOthers.py
2348             return self.MakeBoolean(s1, s2, 4)
2349
2350         # end of l3_boolean
2351         ## @}
2352
2353         ## @addtogroup l3_basic_op
2354         ## @{
2355
2356         ## Perform partition operation.
2357         #  @param ListShapes Shapes to be intersected.
2358         #  @param ListTools Shapes to intersect theShapes.
2359         #  !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2360         #           in order to avoid possible intersection between shapes from
2361         #           this compound.
2362         #  @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2363         #  @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
2364         #                             type <= Limit are kept in the result,
2365         #                             else - shapes with type > Limit are kept
2366         #                             also (if they exist)
2367         #
2368         #  After implementation new version of PartitionAlgo (October 2006)
2369         #  other parameters are ignored by current functionality. They are kept
2370         #  in this function only for support old versions.
2371         #  Ignored parameters:
2372         #      @param ListKeepInside Shapes, outside which the results will be deleted.
2373         #         Each shape from theKeepInside must belong to theShapes also.
2374         #      @param ListRemoveInside Shapes, inside which the results will be deleted.
2375         #         Each shape from theRemoveInside must belong to theShapes also.
2376         #      @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2377         #      @param ListMaterials Material indices for each shape. Make sence,
2378         #         only if theRemoveWebs is TRUE.
2379         #
2380         #  @return New GEOM_Object, containing the result shapes.
2381         #
2382         #  @ref tui_partition "Example"
2383         def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2384                           Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2385                           KeepNonlimitShapes=0):
2386             # Example: see GEOM_TestAll.py
2387             anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2388                                               ListKeepInside, ListRemoveInside,
2389                                               Limit, RemoveWebs, ListMaterials,
2390                                               KeepNonlimitShapes);
2391             RaiseIfFailed("MakePartition", self.BoolOp)
2392             return anObj
2393
2394         ## Perform partition operation.
2395         #  This method may be useful if it is needed to make a partition for
2396         #  compound contains nonintersected shapes. Performance will be better
2397         #  since intersection between shapes from compound is not performed.
2398         #
2399         #  Description of all parameters as in previous method MakePartition()
2400         #
2401         #  !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2402         #           have to consist of nonintersecting shapes.
2403         #
2404         #  @return New GEOM_Object, containing the result shapes.
2405         #
2406         #  @ref swig_todo "Example"
2407         def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2408                                                  ListKeepInside=[], ListRemoveInside=[],
2409                                                  Limit=ShapeType["SHAPE"], RemoveWebs=0,
2410                                                  ListMaterials=[], KeepNonlimitShapes=0):
2411             anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2412                                                                      ListKeepInside, ListRemoveInside,
2413                                                                      Limit, RemoveWebs, ListMaterials,
2414                                                                      KeepNonlimitShapes);
2415             RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2416             return anObj
2417
2418         ## Shortcut to MakePartition()
2419         #
2420         #  @ref tui_partition "Example 1"
2421         #  \n @ref swig_Partition "Example 2"
2422         def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2423                       Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2424                       KeepNonlimitShapes=0):
2425             # Example: see GEOM_TestOthers.py
2426             anObj = self.MakePartition(ListShapes, ListTools,
2427                                        ListKeepInside, ListRemoveInside,
2428                                        Limit, RemoveWebs, ListMaterials,
2429                                        KeepNonlimitShapes);
2430             return anObj
2431
2432         ## Perform partition of the Shape with the Plane
2433         #  @param theShape Shape to be intersected.
2434         #  @param thePlane Tool shape, to intersect theShape.
2435         #  @return New GEOM_Object, containing the result shape.
2436         #
2437         #  @ref tui_partition "Example"
2438         def MakeHalfPartition(self,theShape, thePlane):
2439             # Example: see GEOM_TestAll.py
2440             anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2441             RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2442             return anObj
2443
2444         # end of l3_basic_op
2445         ## @}
2446
2447         ## @addtogroup l3_transform
2448         ## @{
2449
2450         ## Translate the given object along the vector, specified
2451         #  by its end points, creating its copy before the translation.
2452         #  @param theObject The object to be translated.
2453         #  @param thePoint1 Start point of translation vector.
2454         #  @param thePoint2 End point of translation vector.
2455         #  @return New GEOM_Object, containing the translated object.
2456         #
2457         #  @ref tui_translation "Example 1"
2458         #  \n @ref swig_MakeTranslationTwoPoints "Example 2"
2459         def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2460             # Example: see GEOM_TestAll.py
2461             anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2462             RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2463             return anObj
2464
2465         ## Translate the given object along the vector, specified by its components.
2466         #  @param theObject The object to be translated.
2467         #  @param theDX,theDY,theDZ Components of translation vector.
2468         #  @return Translated GEOM_Object.
2469         #
2470         #  @ref tui_translation "Example"
2471         def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2472             # Example: see GEOM_TestAll.py
2473             theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2474             anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2475             anObj.SetParameters(Parameters)
2476             RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2477             return anObj
2478
2479         ## Translate the given object along the vector, specified
2480         #  by its components, creating its copy before the translation.
2481         #  @param theObject The object to be translated.
2482         #  @param theDX,theDY,theDZ Components of translation vector.
2483         #  @return New GEOM_Object, containing the translated object.
2484         #
2485         #  @ref tui_translation "Example"
2486         def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2487             # Example: see GEOM_TestAll.py
2488             theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2489             anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2490             anObj.SetParameters(Parameters)
2491             RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2492             return anObj
2493
2494         ## Translate the given object along the given vector,
2495         #  creating its copy before the translation.
2496         #  @param theObject The object to be translated.
2497         #  @param theVector The translation vector.
2498         #  @return New GEOM_Object, containing the translated object.
2499         #
2500         #  @ref tui_translation "Example"
2501         def MakeTranslationVector(self,theObject, theVector):
2502             # Example: see GEOM_TestAll.py
2503             anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2504             RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2505             return anObj
2506
2507         ## Translate the given object along the given vector on given distance.
2508         #  @param theObject The object to be translated.
2509         #  @param theVector The translation vector.
2510         #  @param theDistance The translation distance.
2511         #  @param theCopy Flag used to translate object itself or create a copy.
2512         #  @return Translated GEOM_Object.
2513         #
2514         #  @ref tui_translation "Example"
2515         def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2516             # Example: see GEOM_TestAll.py
2517             theDistance,Parameters = ParseParameters(theDistance)
2518             anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2519             RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2520             anObj.SetParameters(Parameters)
2521             return anObj
2522
2523         ## Translate the given object along the given vector on given distance,
2524         #  creating its copy before the translation.
2525         #  @param theObject The object to be translated.
2526         #  @param theVector The translation vector.
2527         #  @param theDistance The translation distance.
2528         #  @return New GEOM_Object, containing the translated object.
2529         #
2530         #  @ref tui_translation "Example"
2531         def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2532             # Example: see GEOM_TestAll.py
2533             theDistance,Parameters = ParseParameters(theDistance)
2534             anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2535             RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2536             anObj.SetParameters(Parameters)
2537             return anObj
2538
2539         ## Rotate the given object around the given axis on the given angle.
2540         #  @param theObject The object to be rotated.
2541         #  @param theAxis Rotation axis.
2542         #  @param theAngle Rotation angle in radians.
2543         #  @return Rotated GEOM_Object.
2544         #
2545         #  @ref tui_rotation "Example"
2546         def Rotate(self,theObject, theAxis, theAngle):
2547             # Example: see GEOM_TestAll.py
2548             flag = False
2549             if isinstance(theAngle,str):
2550                 flag = True
2551             theAngle, Parameters = ParseParameters(theAngle)
2552             if flag:
2553                 theAngle = theAngle*math.pi/180.0
2554             anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2555             RaiseIfFailed("RotateCopy", self.TrsfOp)
2556             anObj.SetParameters(Parameters)
2557             return anObj
2558
2559         ## Rotate the given object around the given axis
2560         #  on the given angle, creating its copy before the rotatation.
2561         #  @param theObject The object to be rotated.
2562         #  @param theAxis Rotation axis.
2563         #  @param theAngle Rotation angle in radians.
2564         #  @return New GEOM_Object, containing the rotated object.
2565         #
2566         #  @ref tui_rotation "Example"
2567         def MakeRotation(self,theObject, theAxis, theAngle):
2568             # Example: see GEOM_TestAll.py
2569             flag = False
2570             if isinstance(theAngle,str):
2571                 flag = True
2572             theAngle, Parameters = ParseParameters(theAngle)
2573             if flag:
2574                 theAngle = theAngle*math.pi/180.0
2575             anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2576             RaiseIfFailed("RotateCopy", self.TrsfOp)
2577             anObj.SetParameters(Parameters)
2578             return anObj
2579
2580         ## Rotate given object around vector perpendicular to plane
2581         #  containing three points, creating its copy before the rotatation.
2582         #  @param theObject The object to be rotated.
2583         #  @param theCentPoint central point - the axis is the vector perpendicular to the plane
2584         #  containing the three points.
2585         #  @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2586         #  @return New GEOM_Object, containing the rotated object.
2587         #
2588         #  @ref tui_rotation "Example"
2589         def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2590             # Example: see GEOM_TestAll.py
2591             anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2592             RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2593             return anObj
2594
2595         ## Scale the given object by the factor, creating its copy before the scaling.
2596         #  @param theObject The object to be scaled.
2597         #  @param thePoint Center point for scaling.
2598         #                  Passing None for it means scaling relatively the origin of global CS.
2599         #  @param theFactor Scaling factor value.
2600         #  @return New GEOM_Object, containing the scaled shape.
2601         #
2602         #  @ref tui_scale "Example"
2603         def MakeScaleTransform(self, theObject, thePoint, theFactor):
2604             # Example: see GEOM_TestAll.py
2605             theFactor, Parameters = ParseParameters(theFactor)
2606             anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2607             RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2608             anObj.SetParameters(Parameters)
2609             return anObj
2610
2611         ## Scale the given object by different factors along coordinate axes,
2612         #  creating its copy before the scaling.
2613         #  @param theObject The object to be scaled.
2614         #  @param thePoint Center point for scaling.
2615         #                  Passing None for it means scaling relatively the origin of global CS.
2616         #  @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2617         #  @return New GEOM_Object, containing the scaled shape.
2618         #
2619         #  @ref swig_scale "Example"
2620         def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2621             # Example: see GEOM_TestAll.py
2622             theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2623             anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2624                                                         theFactorX, theFactorY, theFactorZ)
2625             RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2626             anObj.SetParameters(Parameters)
2627             return anObj
2628
2629         ## Create an object, symmetrical
2630         #  to the given one relatively the given plane.
2631         #  @param theObject The object to be mirrored.
2632         #  @param thePlane Plane of symmetry.
2633         #  @return New GEOM_Object, containing the mirrored shape.
2634         #
2635         #  @ref tui_mirror "Example"
2636         def MakeMirrorByPlane(self,theObject, thePlane):
2637             # Example: see GEOM_TestAll.py
2638             anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2639             RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2640             return anObj
2641
2642         ## Create an object, symmetrical
2643         #  to the given one relatively the given axis.
2644         #  @param theObject The object to be mirrored.
2645         #  @param theAxis Axis of symmetry.
2646         #  @return New GEOM_Object, containing the mirrored shape.
2647         #
2648         #  @ref tui_mirror "Example"
2649         def MakeMirrorByAxis(self,theObject, theAxis):
2650             # Example: see GEOM_TestAll.py
2651             anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2652             RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2653             return anObj
2654
2655         ## Create an object, symmetrical
2656         #  to the given one relatively the given point.
2657         #  @param theObject The object to be mirrored.
2658         #  @param thePoint Point of symmetry.
2659         #  @return New GEOM_Object, containing the mirrored shape.
2660         #
2661         #  @ref tui_mirror "Example"
2662         def MakeMirrorByPoint(self,theObject, thePoint):
2663             # Example: see GEOM_TestAll.py
2664             anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2665             RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2666             return anObj
2667
2668         ## Modify the Location of the given object by LCS,
2669         #  creating its copy before the setting.
2670         #  @param theObject The object to be displaced.
2671         #  @param theStartLCS Coordinate system to perform displacement from it.
2672         #                     If \a theStartLCS is NULL, displacement
2673         #                     will be performed from global CS.
2674         #                     If \a theObject itself is used as \a theStartLCS,
2675         #                     its location will be changed to \a theEndLCS.
2676         #  @param theEndLCS Coordinate system to perform displacement to it.
2677         #  @return New GEOM_Object, containing the displaced shape.
2678         #
2679         #  @ref tui_modify_location "Example"
2680         def MakePosition(self,theObject, theStartLCS, theEndLCS):
2681             # Example: see GEOM_TestAll.py
2682             anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2683             RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2684             return anObj
2685
2686         ## Modify the Location of the given object by Path,
2687         #  @param  theObject The object to be displaced.
2688         #  @param  thePath Wire or Edge along that the object will be translated.
2689         #  @param  theDistance progress of Path (0 = start location, 1 = end of path location).
2690         #  @param  theCopy is to create a copy objects if true.
2691         #  @param  theReverse - 0 for usual direction, 1 to reverse path direction.
2692         #  @return New GEOM_Object, containing the displaced shape.
2693         #
2694         #  @ref tui_modify_location "Example"
2695         def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2696             # Example: see GEOM_TestAll.py
2697             anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2698             RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2699             return anObj
2700
2701         ## Create new object as offset of the given one.
2702         #  @param theObject The base object for the offset.
2703         #  @param theOffset Offset value.
2704         #  @return New GEOM_Object, containing the offset object.
2705         #
2706         #  @ref tui_offset "Example"
2707         def MakeOffset(self,theObject, theOffset):
2708             # Example: see GEOM_TestAll.py
2709             theOffset, Parameters = ParseParameters(theOffset)
2710             anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2711             RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2712             anObj.SetParameters(Parameters)
2713             return anObj
2714
2715         # -----------------------------------------------------------------------------
2716         # Patterns
2717         # -----------------------------------------------------------------------------
2718
2719         ## Translate the given object along the given vector a given number times
2720         #  @param theObject The object to be translated.
2721         #  @param theVector Direction of the translation.
2722         #  @param theStep Distance to translate on.
2723         #  @param theNbTimes Quantity of translations to be done.
2724         #  @return New GEOM_Object, containing compound of all
2725         #          the shapes, obtained after each translation.
2726         #
2727         #  @ref tui_multi_translation "Example"
2728         def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2729             # Example: see GEOM_TestAll.py
2730             theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
2731             anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2732             RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2733             anObj.SetParameters(Parameters)
2734             return anObj
2735
2736         ## Conseqently apply two specified translations to theObject specified number of times.
2737         #  @param theObject The object to be translated.
2738         #  @param theVector1 Direction of the first translation.
2739         #  @param theStep1 Step of the first translation.
2740         #  @param theNbTimes1 Quantity of translations to be done along theVector1.
2741         #  @param theVector2 Direction of the second translation.
2742         #  @param theStep2 Step of the second translation.
2743         #  @param theNbTimes2 Quantity of translations to be done along theVector2.
2744         #  @return New GEOM_Object, containing compound of all
2745         #          the shapes, obtained after each translation.
2746         #
2747         #  @ref tui_multi_translation "Example"
2748         def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2749                                    theVector2, theStep2, theNbTimes2):
2750             # Example: see GEOM_TestAll.py
2751             theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
2752             anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2753                                                  theVector2, theStep2, theNbTimes2)
2754             RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2755             anObj.SetParameters(Parameters)
2756             return anObj
2757
2758         ## Rotate the given object around the given axis a given number times.
2759         #  Rotation angle will be 2*PI/theNbTimes.
2760         #  @param theObject The object to be rotated.
2761         #  @param theAxis The rotation axis.
2762         #  @param theNbTimes Quantity of rotations to be done.
2763         #  @return New GEOM_Object, containing compound of all the
2764         #          shapes, obtained after each rotation.
2765         #
2766         #  @ref tui_multi_rotation "Example"
2767         def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2768             # Example: see GEOM_TestAll.py
2769             theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
2770             anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2771             RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2772             anObj.SetParameters(Parameters)
2773             return anObj
2774
2775         ## Rotate the given object around the
2776         #  given axis on the given angle a given number
2777         #  times and multi-translate each rotation result.
2778         #  Translation direction passes through center of gravity
2779         #  of rotated shape and its projection on the rotation axis.
2780         #  @param theObject The object to be rotated.
2781         #  @param theAxis Rotation axis.
2782         #  @param theAngle Rotation angle in graduces.
2783         #  @param theNbTimes1 Quantity of rotations to be done.
2784         #  @param theStep Translation distance.
2785         #  @param theNbTimes2 Quantity of translations to be done.
2786         #  @return New GEOM_Object, containing compound of all the
2787         #          shapes, obtained after each transformation.
2788         #
2789         #  @ref tui_multi_rotation "Example"
2790         def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2791             # Example: see GEOM_TestAll.py
2792             theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
2793             anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2794             RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2795             anObj.SetParameters(Parameters)
2796             return anObj
2797
2798         ## The same, as MultiRotate1D(), but axis is given by direction and point
2799         #  @ref swig_MakeMultiRotation "Example"
2800         def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2801             # Example: see GEOM_TestOthers.py
2802             aVec = self.MakeLine(aPoint,aDir)
2803             anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2804             return anObj
2805
2806         ## The same, as MultiRotate2D(), but axis is given by direction and point
2807         #  @ref swig_MakeMultiRotation "Example"
2808         def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2809             # Example: see GEOM_TestOthers.py
2810             aVec = self.MakeLine(aPoint,aDir)
2811             anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2812             return anObj
2813
2814         # end of l3_transform
2815         ## @}
2816
2817         ## @addtogroup l3_local
2818         ## @{
2819
2820         ## Perform a fillet on all edges of the given shape.
2821         #  @param theShape Shape, to perform fillet on.
2822         #  @param theR Fillet radius.
2823         #  @return New GEOM_Object, containing the result shape.
2824         #
2825         #  @ref tui_fillet "Example 1"
2826         #  \n @ref swig_MakeFilletAll "Example 2"
2827         def MakeFilletAll(self,theShape, theR):
2828             # Example: see GEOM_TestOthers.py
2829             theR,Parameters = ParseParameters(theR)
2830             anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2831             RaiseIfFailed("MakeFilletAll", self.LocalOp)
2832             anObj.SetParameters(Parameters)
2833             return anObj
2834
2835         ## Perform a fillet on the specified edges/faces of the given shape
2836         #  @param theShape Shape, to perform fillet on.
2837         #  @param theR Fillet radius.
2838         #  @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2839         #  @param theListShapes Global indices of edges/faces to perform fillet on.
2840         #    \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2841         #  @return New GEOM_Object, containing the result shape.
2842         #
2843         #  @ref tui_fillet "Example"
2844         def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2845             # Example: see GEOM_TestAll.py
2846             theR,Parameters = ParseParameters(theR)
2847             anObj = None
2848             if theShapeType == ShapeType["EDGE"]:
2849                 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2850                 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2851             else:
2852                 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2853                 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2854             anObj.SetParameters(Parameters)
2855             return anObj
2856
2857         ## The same that MakeFillet but with two Fillet Radius R1 and R2
2858         def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2859             theR1,theR2,Parameters = ParseParameters(theR1,theR2)
2860             anObj = None
2861             if theShapeType == ShapeType["EDGE"]:
2862                 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2863                 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2864             else:
2865                 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2866                 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2867             anObj.SetParameters(Parameters)
2868             return anObj
2869
2870         ## Perform a fillet on the specified edges of the given shape
2871         #  @param theShape - Wire Shape to perform fillet on.
2872         #  @param theR - Fillet radius.
2873         #  @param theListOfVertexes Global indices of vertexes to perform fillet on.
2874         #    \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2875         #    \note The list of vertices could be empty,
2876         #          in this case fillet will done done at all vertices in wire
2877         #  @return New GEOM_Object, containing the result shape.
2878         #
2879         #  @ref tui_fillet2d "Example"
2880         def MakeFillet1D(self,theShape, theR, theListOfVertexes):
2881             # Example: see GEOM_TestAll.py
2882             anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
2883             RaiseIfFailed("MakeFillet1D", self.LocalOp)
2884             return anObj
2885
2886         ## Perform a fillet on the specified edges/faces of the given shape
2887         #  @param theShape - Face Shape to perform fillet on.
2888         #  @param theR - Fillet radius.
2889         #  @param theListOfVertexes Global indices of vertexes to perform fillet on.
2890         #    \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2891         #  @return New GEOM_Object, containing the result shape.
2892         #
2893         #  @ref tui_fillet2d "Example"
2894         def MakeFillet2D(self,theShape, theR, theListOfVertexes):
2895             # Example: see GEOM_TestAll.py
2896             anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
2897             RaiseIfFailed("MakeFillet2D", self.LocalOp)
2898             return anObj
2899
2900         ## Perform a symmetric chamfer on all edges of the given shape.
2901         #  @param theShape Shape, to perform chamfer on.
2902         #  @param theD Chamfer size along each face.
2903         #  @return New GEOM_Object, containing the result shape.
2904         #
2905         #  @ref tui_chamfer "Example 1"
2906         #  \n @ref swig_MakeChamferAll "Example 2"
2907         def MakeChamferAll(self,theShape, theD):
2908             # Example: see GEOM_TestOthers.py
2909             theD,Parameters = ParseParameters(theD)
2910             anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2911             RaiseIfFailed("MakeChamferAll", self.LocalOp)
2912             anObj.SetParameters(Parameters)
2913             return anObj
2914
2915         ## Perform a chamfer on edges, common to the specified faces,
2916         #  with distance D1 on the Face1
2917         #  @param theShape Shape, to perform chamfer on.
2918         #  @param theD1 Chamfer size along \a theFace1.
2919         #  @param theD2 Chamfer size along \a theFace2.
2920         #  @param theFace1,theFace2 Global indices of two faces of \a theShape.
2921         #    \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2922         #  @return New GEOM_Object, containing the result shape.
2923         #
2924         #  @ref tui_chamfer "Example"
2925         def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2926             # Example: see GEOM_TestAll.py
2927             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2928             anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2929             RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2930             anObj.SetParameters(Parameters)
2931             return anObj
2932
2933         ## The Same that MakeChamferEdge but with params theD is chamfer length and
2934         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2935         def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2936             flag = False
2937             if isinstance(theAngle,str):
2938                 flag = True
2939             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2940             if flag:
2941                 theAngle = theAngle*math.pi/180.0
2942             anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2943             RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2944             anObj.SetParameters(Parameters)
2945             return anObj
2946
2947         ## Perform a chamfer on all edges of the specified faces,
2948         #  with distance D1 on the first specified face (if several for one edge)
2949         #  @param theShape Shape, to perform chamfer on.
2950         #  @param theD1 Chamfer size along face from \a theFaces. If both faces,
2951         #               connected to the edge, are in \a theFaces, \a theD1
2952         #               will be get along face, which is nearer to \a theFaces beginning.
2953         #  @param theD2 Chamfer size along another of two faces, connected to the edge.
2954         #  @param theFaces Sequence of global indices of faces of \a theShape.
2955         #    \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2956         #  @return New GEOM_Object, containing the result shape.
2957         #
2958         #  @ref tui_chamfer "Example"
2959         def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
2960             # Example: see GEOM_TestAll.py
2961             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2962             anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
2963             RaiseIfFailed("MakeChamferFaces", self.LocalOp)
2964             anObj.SetParameters(Parameters)
2965             return anObj
2966
2967         ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
2968         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2969         #
2970         #  @ref swig_FilletChamfer "Example"
2971         def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
2972             flag = False
2973             if isinstance(theAngle,str):
2974                 flag = True
2975             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2976             if flag:
2977                 theAngle = theAngle*math.pi/180.0
2978             anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
2979             RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
2980             anObj.SetParameters(Parameters)
2981             return anObj
2982
2983         ## Perform a chamfer on edges,
2984         #  with distance D1 on the first specified face (if several for one edge)
2985         #  @param theShape Shape, to perform chamfer on.
2986         #  @param theD1,theD2 Chamfer size
2987         #  @param theEdges Sequence of edges of \a theShape.
2988         #  @return New GEOM_Object, containing the result shape.
2989         #
2990         #  @ref swig_FilletChamfer "Example"
2991         def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
2992             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2993             anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
2994             RaiseIfFailed("MakeChamferEdges", self.LocalOp)
2995             anObj.SetParameters(Parameters)
2996             return anObj
2997
2998         ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
2999         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3000         def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
3001             flag = False
3002             if isinstance(theAngle,str):
3003                 flag = True
3004             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3005             if flag:
3006                 theAngle = theAngle*math.pi/180.0
3007             anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
3008             RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
3009             anObj.SetParameters(Parameters)
3010             return anObj
3011
3012         ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
3013         #
3014         #  @ref swig_MakeChamfer "Example"
3015         def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
3016             # Example: see GEOM_TestOthers.py
3017             anObj = None
3018             if aShapeType == ShapeType["EDGE"]:
3019                 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
3020             else:
3021                 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
3022             return anObj
3023
3024         # end of l3_local
3025         ## @}
3026
3027         ## @addtogroup l3_basic_op
3028         ## @{
3029
3030         ## Perform an Archimde operation on the given shape with given parameters.
3031         #  The object presenting the resulting face is returned.
3032         #  @param theShape Shape to be put in water.
3033         #  @param theWeight Weight og the shape.
3034         #  @param theWaterDensity Density of the water.
3035         #  @param theMeshDeflection Deflection of the mesh, using to compute the section.
3036         #  @return New GEOM_Object, containing a section of \a theShape
3037         #          by a plane, corresponding to water level.
3038         #
3039         #  @ref tui_archimede "Example"
3040         def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
3041             # Example: see GEOM_TestAll.py
3042             theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
3043               theWeight,theWaterDensity,theMeshDeflection)
3044             anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
3045             RaiseIfFailed("MakeArchimede", self.LocalOp)
3046             anObj.SetParameters(Parameters)
3047             return anObj
3048
3049         # end of l3_basic_op
3050         ## @}
3051
3052         ## @addtogroup l2_measure
3053         ## @{
3054
3055         ## Get point coordinates
3056         #  @return [x, y, z]
3057         #
3058         #  @ref tui_measurement_tools_page "Example"
3059         def PointCoordinates(self,Point):
3060             # Example: see GEOM_TestMeasures.py
3061             aTuple = self.MeasuOp.PointCoordinates(Point)
3062             RaiseIfFailed("PointCoordinates", self.MeasuOp)
3063             return aTuple
3064
3065         ## Get summarized length of all wires,
3066         #  area of surface and volume of the given shape.
3067         #  @param theShape Shape to define properties of.
3068         #  @return [theLength, theSurfArea, theVolume]
3069         #  theLength:   Summarized length of all wires of the given shape.
3070         #  theSurfArea: Area of surface of the given shape.
3071         #  theVolume:   Volume of the given shape.
3072         #
3073         #  @ref tui_measurement_tools_page "Example"
3074         def BasicProperties(self,theShape):
3075             # Example: see GEOM_TestMeasures.py
3076             aTuple = self.MeasuOp.GetBasicProperties(theShape)
3077             RaiseIfFailed("GetBasicProperties", self.MeasuOp)
3078             return aTuple
3079
3080         ## Get parameters of bounding box of the given shape
3081         #  @param theShape Shape to obtain bounding box of.
3082         #  @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
3083         #  Xmin,Xmax: Limits of shape along OX axis.
3084         #  Ymin,Ymax: Limits of shape along OY axis.
3085         #  Zmin,Zmax: Limits of shape along OZ axis.
3086         #
3087         #  @ref tui_measurement_tools_page "Example"
3088         def BoundingBox(self,theShape):
3089             # Example: see GEOM_TestMeasures.py
3090             aTuple = self.MeasuOp.GetBoundingBox(theShape)
3091             RaiseIfFailed("GetBoundingBox", self.MeasuOp)
3092             return aTuple
3093
3094         ## Get inertia matrix and moments of inertia of theShape.
3095         #  @param theShape Shape to calculate inertia of.
3096         #  @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
3097         #  I(1-3)(1-3): Components of the inertia matrix of the given shape.
3098         #  Ix,Iy,Iz:    Moments of inertia of the given shape.
3099         #
3100         #  @ref tui_measurement_tools_page "Example"
3101         def Inertia(self,theShape):
3102             # Example: see GEOM_TestMeasures.py
3103             aTuple = self.MeasuOp.GetInertia(theShape)
3104             RaiseIfFailed("GetInertia", self.MeasuOp)
3105             return aTuple
3106
3107         ## Get minimal distance between the given shapes.
3108         #  @param theShape1,theShape2 Shapes to find minimal distance between.
3109         #  @return Value of the minimal distance between the given shapes.
3110         #
3111         #  @ref tui_measurement_tools_page "Example"
3112         def MinDistance(self, theShape1, theShape2):
3113             # Example: see GEOM_TestMeasures.py
3114             aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3115             RaiseIfFailed("GetMinDistance", self.MeasuOp)
3116             return aTuple[0]
3117
3118         ## Get minimal distance between the given shapes.
3119         #  @param theShape1,theShape2 Shapes to find minimal distance between.
3120         #  @return Value of the minimal distance between the given shapes.
3121         #
3122         #  @ref swig_all_measure "Example"
3123         def MinDistanceComponents(self, theShape1, theShape2):
3124             # Example: see GEOM_TestMeasures.py
3125             aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3126             RaiseIfFailed("GetMinDistance", self.MeasuOp)
3127             aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
3128             return aRes
3129
3130         ## Get angle between the given shapes in degrees.
3131         #  @param theShape1,theShape2 Lines or linear edges to find angle between.
3132         #  @return Value of the angle between the given shapes in degrees.
3133         #
3134         #  @ref tui_measurement_tools_page "Example"
3135         def GetAngle(self, theShape1, theShape2):
3136             # Example: see GEOM_TestMeasures.py
3137             anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
3138             RaiseIfFailed("GetAngle", self.MeasuOp)
3139             return anAngle
3140         ## Get angle between the given shapes in radians.
3141         #  @param theShape1,theShape2 Lines or linear edges to find angle between.
3142         #  @return Value of the angle between the given shapes in radians.
3143         #
3144         #  @ref tui_measurement_tools_page "Example"
3145         def GetAngleRadians(self, theShape1, theShape2):
3146             # Example: see GEOM_TestMeasures.py
3147             anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
3148             RaiseIfFailed("GetAngle", self.MeasuOp)
3149             return anAngle
3150
3151         ## @name Curve Curvature Measurement
3152         #  Methods for receiving radius of curvature of curves
3153         #  in the given point
3154         ## @{
3155
3156         ## Measure curvature of a curve at a point, set by parameter.
3157         #  @ref swig_todo "Example"
3158         def CurveCurvatureByParam(self, theCurve, theParam):
3159             # Example: see GEOM_TestMeasures.py
3160             aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
3161             RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
3162             return aCurv
3163
3164         ## @details
3165         #  @ref swig_todo "Example"
3166         def CurveCurvatureByPoint(self, theCurve, thePoint):
3167             aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3168             RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3169             return aCurv
3170         ## @}
3171
3172         ## @name Surface Curvature Measurement
3173         #  Methods for receiving max and min radius of curvature of surfaces
3174         #  in the given point
3175         ## @{
3176
3177         ## @details
3178         ## @ref swig_todo "Example"
3179         def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3180             # Example: see GEOM_TestMeasures.py
3181             aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3182             RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3183             return aSurf
3184
3185         ## @details
3186         ## @ref swig_todo "Example"
3187         def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3188             aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3189             RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3190             return aSurf
3191
3192         ## @details
3193         ## @ref swig_todo "Example"
3194         def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3195             aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3196             RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3197             return aSurf
3198
3199         ## @details
3200         ## @ref swig_todo "Example"
3201         def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3202             aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3203             RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3204             return aSurf
3205         ## @}
3206
3207         ## Get min and max tolerances of sub-shapes of theShape
3208         #  @param theShape Shape, to get tolerances of.
3209         #  @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3210         #  FaceMin,FaceMax: Min and max tolerances of the faces.
3211         #  EdgeMin,EdgeMax: Min and max tolerances of the edges.
3212         #  VertMin,VertMax: Min and max tolerances of the vertices.
3213         #
3214         #  @ref tui_measurement_tools_page "Example"
3215         def Tolerance(self,theShape):
3216             # Example: see GEOM_TestMeasures.py
3217             aTuple = self.MeasuOp.GetTolerance(theShape)
3218             RaiseIfFailed("GetTolerance", self.MeasuOp)
3219             return aTuple
3220
3221         ## Obtain description of the given shape (number of sub-shapes of each type)
3222         #  @param theShape Shape to be described.
3223         #  @return Description of the given shape.
3224         #
3225         #  @ref tui_measurement_tools_page "Example"
3226         def WhatIs(self,theShape):
3227             # Example: see GEOM_TestMeasures.py
3228             aDescr = self.MeasuOp.WhatIs(theShape)
3229             RaiseIfFailed("WhatIs", self.MeasuOp)
3230             return aDescr
3231
3232         ## Get a point, situated at the centre of mass of theShape.
3233         #  @param theShape Shape to define centre of mass of.
3234         #  @return New GEOM_Object, containing the created point.
3235         #
3236         #  @ref tui_measurement_tools_page "Example"
3237         def MakeCDG(self,theShape):
3238             # Example: see GEOM_TestMeasures.py
3239             anObj = self.MeasuOp.GetCentreOfMass(theShape)
3240             RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3241             return anObj
3242
3243         ## Get a vertex subshape by index depended with orientation.
3244         #  @param theShape Shape to find subshape.
3245         #  @param theIndex Index to find vertex by this index.
3246         #  @return New GEOM_Object, containing the created vertex.
3247         #
3248         #  @ref tui_measurement_tools_page "Example"
3249         def GetVertexByIndex(self,theShape, theIndex):
3250             # Example: see GEOM_TestMeasures.py
3251             anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
3252             RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
3253             return anObj
3254
3255         ## Get the first vertex of wire/edge depended orientation.
3256         #  @param theShape Shape to find first vertex.
3257         #  @return New GEOM_Object, containing the created vertex.
3258         #
3259         #  @ref tui_measurement_tools_page "Example"
3260         def GetFirstVertex(self,theShape):
3261             # Example: see GEOM_TestMeasures.py
3262             anObj = self.GetVertexByIndex(theShape, 0)
3263             RaiseIfFailed("GetFirstVertex", self.MeasuOp)
3264             return anObj
3265
3266         ## Get the last vertex of wire/edge depended orientation.
3267         #  @param theShape Shape to find last vertex.
3268         #  @return New GEOM_Object, containing the created vertex.
3269         #
3270         #  @ref tui_measurement_tools_page "Example"
3271         def GetLastVertex(self,theShape):
3272             # Example: see GEOM_TestMeasures.py
3273             nb_vert =  self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
3274             anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
3275             RaiseIfFailed("GetLastVertex", self.MeasuOp)
3276             return anObj
3277
3278         ## Get a normale to the given face. If the point is not given,
3279         #  the normale is calculated at the center of mass.
3280         #  @param theFace Face to define normale of.
3281         #  @param theOptionalPoint Point to compute the normale at.
3282         #  @return New GEOM_Object, containing the created vector.
3283         #
3284         #  @ref swig_todo "Example"
3285         def GetNormal(self, theFace, theOptionalPoint = None):
3286             # Example: see GEOM_TestMeasures.py
3287             anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3288             RaiseIfFailed("GetNormal", self.MeasuOp)
3289             return anObj
3290
3291         ## Check a topology of the given shape.
3292         #  @param theShape Shape to check validity of.
3293         #  @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3294         #                        if TRUE, the shape's geometry will be checked also.
3295         #  @return TRUE, if the shape "seems to be valid".
3296         #  If theShape is invalid, prints a description of problem.
3297         #
3298         #  @ref tui_measurement_tools_page "Example"
3299         def CheckShape(self,theShape, theIsCheckGeom = 0):
3300             # Example: see GEOM_TestMeasures.py
3301             if theIsCheckGeom:
3302                 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3303                 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3304             else:
3305                 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3306                 RaiseIfFailed("CheckShape", self.MeasuOp)
3307             if IsValid == 0:
3308                 print Status
3309             return IsValid
3310
3311         ## Get position (LCS) of theShape.
3312         #
3313         #  Origin of the LCS is situated at the shape's center of mass.
3314         #  Axes of the LCS are obtained from shape's location or,
3315         #  if the shape is a planar face, from position of its plane.
3316         #
3317         #  @param theShape Shape to calculate position of.
3318         #  @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3319         #          Ox,Oy,Oz: Coordinates of shape's LCS origin.
3320         #          Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3321         #          Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3322         #
3323         #  @ref swig_todo "Example"
3324         def GetPosition(self,theShape):
3325             # Example: see GEOM_TestMeasures.py
3326             aTuple = self.MeasuOp.GetPosition(theShape)
3327             RaiseIfFailed("GetPosition", self.MeasuOp)
3328             return aTuple
3329
3330         ## Get kind of theShape.
3331         #
3332         #  @param theShape Shape to get a kind of.
3333         #  @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3334         #          and a list of parameters, describing the shape.
3335         #  @note  Concrete meaning of each value, returned via \a theIntegers
3336         #         or \a theDoubles list depends on the kind of the shape.
3337         #         The full list of possible outputs is:
3338         #
3339         #  - geompy.kind.COMPOUND              nb_solids  nb_faces  nb_edges  nb_vertices
3340         #  - geompy.kind.COMPSOLID             nb_solids  nb_faces  nb_edges  nb_vertices
3341         #
3342         #  - geompy.kind.SHELL       geompy.info.CLOSED   nb_faces  nb_edges  nb_vertices
3343         #  - geompy.kind.SHELL       geompy.info.UNCLOSED nb_faces  nb_edges  nb_vertices
3344         #
3345         #  - geompy.kind.WIRE        geompy.info.CLOSED             nb_edges  nb_vertices
3346         #  - geompy.kind.WIRE        geompy.info.UNCLOSED           nb_edges  nb_vertices
3347         #
3348         #  - geompy.kind.SPHERE       xc yc zc            R
3349         #  - geompy.kind.CYLINDER     xb yb zb  dx dy dz  R         H
3350         #  - geompy.kind.BOX          xc yc zc                      ax ay az
3351         #  - geompy.kind.ROTATED_BOX  xc yc zc  zx zy zz  xx xy xz  ax ay az
3352         #  - geompy.kind.TORUS        xc yc zc  dx dy dz  R_1  R_2
3353         #  - geompy.kind.CONE         xb yb zb  dx dy dz  R_1  R_2  H
3354         #  - geompy.kind.POLYHEDRON                       nb_faces  nb_edges  nb_vertices
3355         #  - geompy.kind.SOLID                            nb_faces  nb_edges  nb_vertices
3356         #
3357         #  - geompy.kind.SPHERE2D     xc yc zc            R
3358         #  - geompy.kind.CYLINDER2D   xb yb zb  dx dy dz  R         H
3359         #  - geompy.kind.TORUS2D      xc yc zc  dx dy dz  R_1  R_2
3360         #  - geompy.kind.CONE2D       xc yc zc  dx dy dz  R_1  R_2  H
3361         #  - geompy.kind.DISK_CIRCLE  xc yc zc  dx dy dz  R
3362         #  - geompy.kind.DISK_ELLIPSE xc yc zc  dx dy dz  R_1  R_2
3363         #  - geompy.kind.POLYGON      xo yo zo  dx dy dz            nb_edges  nb_vertices
3364         #  - geompy.kind.PLANE        xo yo zo  dx dy dz
3365         #  - geompy.kind.PLANAR       xo yo zo  dx dy dz            nb_edges  nb_vertices
3366         #  - geompy.kind.FACE                                       nb_edges  nb_vertices
3367         #
3368         #  - geompy.kind.CIRCLE       xc yc zc  dx dy dz  R
3369         #  - geompy.kind.ARC_CIRCLE   xc yc zc  dx dy dz  R         x1 y1 z1  x2 y2 z2
3370         #  - geompy.kind.ELLIPSE      xc yc zc  dx dy dz  R_1  R_2
3371         #  - geompy.kind.ARC_ELLIPSE  xc yc zc  dx dy dz  R_1  R_2  x1 y1 z1  x2 y2 z2
3372         #  - geompy.kind.LINE         xo yo zo  dx dy dz
3373         #  - geompy.kind.SEGMENT      x1 y1 z1  x2 y2 z2
3374         #  - geompy.kind.EDGE                                                 nb_vertices
3375         #
3376         #  - geompy.kind.VERTEX       x  y  z
3377         #
3378         #  @ref swig_todo "Example"
3379         def KindOfShape(self,theShape):
3380             # Example: see GEOM_TestMeasures.py
3381             aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3382             RaiseIfFailed("KindOfShape", self.MeasuOp)
3383
3384             aKind  = aRoughTuple[0]
3385             anInts = aRoughTuple[1]
3386             aDbls  = aRoughTuple[2]
3387
3388             # Now there is no exception from this rule:
3389             aKindTuple = [aKind] + aDbls + anInts
3390
3391             # If they are we will regroup parameters for such kind of shape.
3392             # For example:
3393             #if aKind == kind.SOME_KIND:
3394             #    #  SOME_KIND     int int double int double double
3395             #    aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3396
3397             return aKindTuple
3398
3399         # end of l2_measure
3400         ## @}
3401
3402         ## @addtogroup l2_import_export
3403         ## @{
3404
3405         ## Import a shape from the BREP or IGES or STEP file
3406         #  (depends on given format) with given name.
3407         #  @param theFileName The file, containing the shape.
3408         #  @param theFormatName Specify format for the file reading.
3409         #         Available formats can be obtained with InsertOp.ImportTranslators() method.
3410         #         If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3411         #         set to 'meter' and result model will be scaled.
3412         #  @return New GEOM_Object, containing the imported shape.
3413         #
3414         #  @ref swig_Import_Export "Example"
3415         def Import(self,theFileName, theFormatName):
3416             # Example: see GEOM_TestOthers.py
3417             anObj = self.InsertOp.Import(theFileName, theFormatName)
3418             RaiseIfFailed("Import", self.InsertOp)
3419             return anObj
3420
3421         ## Shortcut to Import() for BREP format
3422         #
3423         #  @ref swig_Import_Export "Example"
3424         def ImportBREP(self,theFileName):
3425             # Example: see GEOM_TestOthers.py
3426             return self.Import(theFileName, "BREP")
3427
3428         ## Shortcut to Import() for IGES format
3429         #
3430         #  @ref swig_Import_Export "Example"
3431         def ImportIGES(self,theFileName):
3432             # Example: see GEOM_TestOthers.py
3433             return self.Import(theFileName, "IGES")
3434
3435         ## Return length unit from given IGES file
3436         #
3437         #  @ref swig_Import_Export "Example"
3438         def GetIGESUnit(self,theFileName):
3439             # Example: see GEOM_TestOthers.py
3440             anObj = self.InsertOp.Import(theFileName, "IGES_UNIT")
3441             #RaiseIfFailed("Import", self.InsertOp)
3442             # recieve name using returned vertex
3443             UnitName = "M"
3444             vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3445             if len(vertices)>0:
3446                 p = self.PointCoordinates(vertices[0])
3447                 if abs(p[0]-0.01) < 1.e-6:
3448                     UnitName = "CM"
3449                 elif abs(p[0]-0.001) < 1.e-6:
3450                     UnitName = "MM"
3451             return UnitName
3452
3453         ## Shortcut to Import() for STEP format
3454         #
3455         #  @ref swig_Import_Export "Example"
3456         def ImportSTEP(self,theFileName):
3457             # Example: see GEOM_TestOthers.py
3458             return self.Import(theFileName, "STEP")
3459
3460         ## Export the given shape into a file with given name.
3461         #  @param theObject Shape to be stored in the file.
3462         #  @param theFileName Name of the file to store the given shape in.
3463         #  @param theFormatName Specify format for the shape storage.
3464         #         Available formats can be obtained with InsertOp.ImportTranslators() method.
3465         #
3466         #  @ref swig_Import_Export "Example"
3467         def Export(self,theObject, theFileName, theFormatName):
3468             # Example: see GEOM_TestOthers.py
3469             self.InsertOp.Export(theObject, theFileName, theFormatName)
3470             if self.InsertOp.IsDone() == 0:
3471                 raise RuntimeError,  "Export : " + self.InsertOp.GetErrorCode()
3472                 pass
3473             pass
3474
3475         ## Shortcut to Export() for BREP format
3476         #
3477         #  @ref swig_Import_Export "Example"
3478         def ExportBREP(self,theObject, theFileName):
3479             # Example: see GEOM_TestOthers.py
3480             return self.Export(theObject, theFileName, "BREP")
3481
3482         ## Shortcut to Export() for IGES format
3483         #
3484         #  @ref swig_Import_Export "Example"
3485         def ExportIGES(self,theObject, theFileName):
3486             # Example: see GEOM_TestOthers.py
3487             return self.Export(theObject, theFileName, "IGES")
3488
3489         ## Shortcut to Export() for STEP format
3490         #
3491         #  @ref swig_Import_Export "Example"
3492         def ExportSTEP(self,theObject, theFileName):
3493             # Example: see GEOM_TestOthers.py
3494             return self.Export(theObject, theFileName, "STEP")
3495
3496         # end of l2_import_export
3497         ## @}
3498
3499         ## @addtogroup l3_blocks
3500         ## @{
3501
3502         ## Create a quadrangle face from four edges. Order of Edges is not
3503         #  important. It is  not necessary that edges share the same vertex.
3504         #  @param E1,E2,E3,E4 Edges for the face bound.
3505         #  @return New GEOM_Object, containing the created face.
3506         #
3507         #  @ref tui_building_by_blocks_page "Example"
3508         def MakeQuad(self,E1, E2, E3, E4):
3509             # Example: see GEOM_Spanner.py
3510             anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3511             RaiseIfFailed("MakeQuad", self.BlocksOp)
3512             return anObj
3513
3514         ## Create a quadrangle face on two edges.
3515         #  The missing edges will be built by creating the shortest ones.
3516         #  @param E1,E2 Two opposite edges for the face.
3517         #  @return New GEOM_Object, containing the created face.
3518         #
3519         #  @ref tui_building_by_blocks_page "Example"
3520         def MakeQuad2Edges(self,E1, E2):
3521             # Example: see GEOM_Spanner.py
3522             anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3523             RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3524             return anObj
3525
3526         ## Create a quadrangle face with specified corners.
3527         #  The missing edges will be built by creating the shortest ones.
3528         #  @param V1,V2,V3,V4 Corner vertices for the face.
3529         #  @return New GEOM_Object, containing the created face.
3530         #
3531         #  @ref tui_building_by_blocks_page "Example 1"
3532         #  \n @ref swig_MakeQuad4Vertices "Example 2"
3533         def MakeQuad4Vertices(self,V1, V2, V3, V4):
3534             # Example: see GEOM_Spanner.py
3535             anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3536             RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3537             return anObj
3538
3539         ## Create a hexahedral solid, bounded by the six given faces. Order of
3540         #  faces is not important. It is  not necessary that Faces share the same edge.
3541         #  @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3542         #  @return New GEOM_Object, containing the created solid.
3543         #
3544         #  @ref tui_building_by_blocks_page "Example 1"
3545         #  \n @ref swig_MakeHexa "Example 2"
3546         def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3547             # Example: see GEOM_Spanner.py
3548             anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3549             RaiseIfFailed("MakeHexa", self.BlocksOp)
3550             return anObj
3551
3552         ## Create a hexahedral solid between two given faces.
3553         #  The missing faces will be built by creating the smallest ones.
3554         #  @param F1,F2 Two opposite faces for the hexahedral solid.
3555         #  @return New GEOM_Object, containing the created solid.
3556         #
3557         #  @ref tui_building_by_blocks_page "Example 1"
3558         #  \n @ref swig_MakeHexa2Faces "Example 2"
3559         def MakeHexa2Faces(self,F1, F2):
3560             # Example: see GEOM_Spanner.py
3561             anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3562             RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3563             return anObj
3564
3565         # end of l3_blocks
3566         ## @}
3567
3568         ## @addtogroup l3_blocks_op
3569         ## @{
3570
3571         ## Get a vertex, found in the given shape by its coordinates.
3572         #  @param theShape Block or a compound of blocks.
3573         #  @param theX,theY,theZ Coordinates of the sought vertex.
3574         #  @param theEpsilon Maximum allowed distance between the resulting
3575         #                    vertex and point with the given coordinates.
3576         #  @return New GEOM_Object, containing the found vertex.
3577         #
3578         #  @ref swig_GetPoint "Example"
3579         def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
3580             # Example: see GEOM_TestOthers.py
3581             anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3582             RaiseIfFailed("GetPoint", self.BlocksOp)
3583             return anObj
3584
3585         ## Get an edge, found in the given shape by two given vertices.
3586         #  @param theShape Block or a compound of blocks.
3587         #  @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3588         #  @return New GEOM_Object, containing the found edge.
3589         #
3590         #  @ref swig_todo "Example"
3591         def GetEdge(self,theShape, thePoint1, thePoint2):
3592             # Example: see GEOM_Spanner.py
3593             anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3594             RaiseIfFailed("GetEdge", self.BlocksOp)
3595             return anObj
3596
3597         ## Find an edge of the given shape, which has minimal distance to the given point.
3598         #  @param theShape Block or a compound of blocks.
3599         #  @param thePoint Point, close to the desired edge.
3600         #  @return New GEOM_Object, containing the found edge.
3601         #
3602         #  @ref swig_GetEdgeNearPoint "Example"
3603         def GetEdgeNearPoint(self,theShape, thePoint):
3604             # Example: see GEOM_TestOthers.py
3605             anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3606             RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3607             return anObj
3608
3609         ## Returns a face, found in the given shape by four given corner vertices.
3610         #  @param theShape Block or a compound of blocks.
3611         #  @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3612         #  @return New GEOM_Object, containing the found face.
3613         #
3614         #  @ref swig_todo "Example"
3615         def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3616             # Example: see GEOM_Spanner.py
3617             anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3618             RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3619             return anObj
3620
3621         ## Get a face of block, found in the given shape by two given edges.
3622         #  @param theShape Block or a compound of blocks.
3623         #  @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3624         #  @return New GEOM_Object, containing the found face.
3625         #
3626         #  @ref swig_todo "Example"
3627         def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3628             # Example: see GEOM_Spanner.py
3629             anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3630             RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3631             return anObj
3632
3633         ## Find a face, opposite to the given one in the given block.
3634         #  @param theBlock Must be a hexahedral solid.
3635         #  @param theFace Face of \a theBlock, opposite to the desired face.
3636         #  @return New GEOM_Object, containing the found face.
3637         #
3638         #  @ref swig_GetOppositeFace "Example"
3639         def GetOppositeFace(self,theBlock, theFace):
3640             # Example: see GEOM_Spanner.py
3641             anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3642             RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3643             return anObj
3644
3645         ## Find a face of the given shape, which has minimal distance to the given point.
3646         #  @param theShape Block or a compound of blocks.
3647         #  @param thePoint Point, close to the desired face.
3648         #  @return New GEOM_Object, containing the found face.
3649         #
3650         #  @ref swig_GetFaceNearPoint "Example"
3651         def GetFaceNearPoint(self,theShape, thePoint):
3652             # Example: see GEOM_Spanner.py
3653             anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3654             RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3655             return anObj
3656
3657         ## Find a face of block, whose outside normale has minimal angle with the given vector.
3658         #  @param theBlock Block or a compound of blocks.
3659         #  @param theVector Vector, close to the normale of the desired face.
3660         #  @return New GEOM_Object, containing the found face.
3661         #
3662         #  @ref swig_todo "Example"
3663         def GetFaceByNormale(self, theBlock, theVector):
3664             # Example: see GEOM_Spanner.py
3665             anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3666             RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3667             return anObj
3668
3669         # end of l3_blocks_op
3670         ## @}
3671
3672         ## @addtogroup l4_blocks_measure
3673         ## @{
3674
3675         ## Check, if the compound of blocks is given.
3676         #  To be considered as a compound of blocks, the
3677         #  given shape must satisfy the following conditions:
3678         #  - Each element of the compound should be a Block (6 faces and 12 edges).
3679         #  - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3680         #  - The compound should be connexe.
3681         #  - The glue between two quadrangle faces should be applied.
3682         #  @param theCompound The compound to check.
3683         #  @return TRUE, if the given shape is a compound of blocks.
3684         #  If theCompound is not valid, prints all discovered errors.
3685         #
3686         #  @ref tui_measurement_tools_page "Example 1"
3687         #  \n @ref swig_CheckCompoundOfBlocks "Example 2"
3688         def CheckCompoundOfBlocks(self,theCompound):
3689             # Example: see GEOM_Spanner.py
3690             (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3691             RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3692             if IsValid == 0:
3693                 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3694                 print Descr
3695             return IsValid
3696
3697         ## Remove all seam and degenerated edges from \a theShape.
3698         #  Unite faces and edges, sharing one surface. It means that
3699         #  this faces must have references to one C++ surface object (handle).
3700         #  @param theShape The compound or single solid to remove irregular edges from.
3701         #  @param doUnionFaces If True, then unite faces. If False (the default value),
3702         #         do not unite faces.
3703         #  @return Improved shape.
3704         #
3705         #  @ref swig_RemoveExtraEdges "Example"
3706         def RemoveExtraEdges(self, theShape, doUnionFaces=False):
3707             # Example: see GEOM_TestOthers.py
3708             nbFacesOptimum = -1 # -1 means do not unite faces
3709             if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
3710             anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
3711             RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3712             return anObj
3713
3714         ## Check, if the given shape is a blocks compound.
3715         #  Fix all detected errors.
3716         #    \note Single block can be also fixed by this method.
3717         #  @param theShape The compound to check and improve.
3718         #  @return Improved compound.
3719         #
3720         #  @ref swig_CheckAndImprove "Example"
3721         def CheckAndImprove(self,theShape):
3722             # Example: see GEOM_TestOthers.py
3723             anObj = self.BlocksOp.CheckAndImprove(theShape)
3724             RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3725             return anObj
3726
3727         # end of l4_blocks_measure
3728         ## @}
3729
3730         ## @addtogroup l3_blocks_op
3731         ## @{
3732
3733         ## Get all the blocks, contained in the given compound.
3734         #  @param theCompound The compound to explode.
3735         #  @param theMinNbFaces If solid has lower number of faces, it is not a block.
3736         #  @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3737         #    \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3738         #  @return List of GEOM_Objects, containing the retrieved blocks.
3739         #
3740         #  @ref tui_explode_on_blocks "Example 1"
3741         #  \n @ref swig_MakeBlockExplode "Example 2"
3742         def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3743             # Example: see GEOM_TestOthers.py
3744             theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
3745             aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3746             RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3747             for anObj in aList:
3748                 anObj.SetParameters(Parameters)
3749                 pass
3750             return aList
3751
3752         ## Find block, containing the given point inside its volume or on boundary.
3753         #  @param theCompound Compound, to find block in.
3754         #  @param thePoint Point, close to the desired block. If the point lays on
3755         #         boundary between some blocks, we return block with nearest center.
3756         #  @return New GEOM_Object, containing the found block.
3757         #
3758         #  @ref swig_todo "Example"
3759         def GetBlockNearPoint(self,theCompound, thePoint):
3760             # Example: see GEOM_Spanner.py
3761             anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3762             RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3763             return anObj
3764
3765         ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3766         #  @param theCompound Compound, to find block in.
3767         #  @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3768         #  @return New GEOM_Object, containing the found block.
3769         #
3770         #  @ref swig_GetBlockByParts "Example"
3771         def GetBlockByParts(self,theCompound, theParts):
3772             # Example: see GEOM_TestOthers.py
3773             anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3774             RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3775             return anObj
3776
3777         ## Return all blocks, containing all the elements, passed as the parts.
3778         #  @param theCompound Compound, to find blocks in.
3779         #  @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3780         #  @return List of GEOM_Objects, containing the found blocks.
3781         #
3782         #  @ref swig_todo "Example"
3783         def GetBlocksByParts(self,theCompound, theParts):
3784             # Example: see GEOM_Spanner.py
3785             aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3786             RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3787             return aList
3788
3789         ## Multi-transformate block and glue the result.
3790         #  Transformation is defined so, as to superpose direction faces.
3791         #  @param Block Hexahedral solid to be multi-transformed.
3792         #  @param DirFace1 ID of First direction face.
3793         #  @param DirFace2 ID of Second direction face.
3794         #  @param NbTimes Quantity of transformations to be done.
3795         #    \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3796         #  @return New GEOM_Object, containing the result shape.
3797         #
3798         #  @ref tui_multi_transformation "Example"
3799         def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3800             # Example: see GEOM_Spanner.py
3801             DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
3802             anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3803             RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3804             anObj.SetParameters(Parameters)
3805             return anObj
3806
3807         ## Multi-transformate block and glue the result.
3808         #  @param Block Hexahedral solid to be multi-transformed.
3809         #  @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3810         #  @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3811         #  @param NbTimesU,NbTimesV Quantity of transformations to be done.
3812         #  @return New GEOM_Object, containing the result shape.
3813         #
3814         #  @ref tui_multi_transformation "Example"
3815         def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3816                                       DirFace1V, DirFace2V, NbTimesV):
3817             # Example: see GEOM_Spanner.py
3818             DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
3819               DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
3820             anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3821                                                             DirFace1V, DirFace2V, NbTimesV)
3822             RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3823             anObj.SetParameters(Parameters)
3824             return anObj
3825
3826         ## Build all possible propagation groups.
3827         #  Propagation group is a set of all edges, opposite to one (main)
3828         #  edge of this group directly or through other opposite edges.
3829         #  Notion of Opposite Edge make sence only on quadrangle face.
3830         #  @param theShape Shape to build propagation groups on.
3831         #  @return List of GEOM_Objects, each of them is a propagation group.
3832         #
3833         #  @ref swig_Propagate "Example"
3834         def Propagate(self,theShape):
3835             # Example: see GEOM_TestOthers.py
3836             listChains = self.BlocksOp.Propagate(theShape)
3837             RaiseIfFailed("Propagate", self.BlocksOp)
3838             return listChains
3839
3840         # end of l3_blocks_op
3841         ## @}
3842
3843         ## @addtogroup l3_groups
3844         ## @{
3845
3846         ## Creates a new group which will store sub shapes of theMainShape
3847         #  @param theMainShape is a GEOM object on which the group is selected
3848         #  @param theShapeType defines a shape type of the group
3849         #  @return a newly created GEOM group
3850         #
3851         #  @ref tui_working_with_groups_page "Example 1"
3852         #  \n @ref swig_CreateGroup "Example 2"
3853         def CreateGroup(self,theMainShape, theShapeType):
3854             # Example: see GEOM_TestOthers.py
3855             anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3856             RaiseIfFailed("CreateGroup", self.GroupOp)
3857             return anObj
3858
3859         ## Adds a sub object with ID theSubShapeId to the group
3860         #  @param theGroup is a GEOM group to which the new sub shape is added
3861         #  @param theSubShapeID is a sub shape ID in the main object.
3862         #  \note Use method GetSubShapeID() to get an unique ID of the sub shape
3863         #
3864         #  @ref tui_working_with_groups_page "Example"
3865         def AddObject(self,theGroup, theSubShapeID):
3866             # Example: see GEOM_TestOthers.py
3867             self.GroupOp.AddObject(theGroup, theSubShapeID)
3868             RaiseIfFailed("AddObject", self.GroupOp)
3869             pass
3870
3871         ## Removes a sub object with ID \a theSubShapeId from the group
3872         #  @param theGroup is a GEOM group from which the new sub shape is removed
3873         #  @param theSubShapeID is a sub shape ID in the main object.
3874         #  \note Use method GetSubShapeID() to get an unique ID of the sub shape
3875         #
3876         #  @ref tui_working_with_groups_page "Example"
3877         def RemoveObject(self,theGroup, theSubShapeID):
3878             # Example: see GEOM_TestOthers.py
3879             self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3880             RaiseIfFailed("RemoveObject", self.GroupOp)
3881             pass
3882
3883         ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3884         #  @param theGroup is a GEOM group to which the new sub shapes are added.
3885         #  @param theSubShapes is a list of sub shapes to be added.
3886         #
3887         #  @ref tui_working_with_groups_page "Example"
3888         def UnionList (self,theGroup, theSubShapes):
3889             # Example: see GEOM_TestOthers.py
3890             self.GroupOp.UnionList(theGroup, theSubShapes)
3891             RaiseIfFailed("UnionList", self.GroupOp)
3892             pass
3893
3894         ## Works like the above method, but argument
3895         #  theSubShapes here is a list of sub-shapes indices
3896         #
3897         #  @ref swig_UnionIDs "Example"
3898         def UnionIDs(self,theGroup, theSubShapes):
3899             # Example: see GEOM_TestOthers.py
3900             self.GroupOp.UnionIDs(theGroup, theSubShapes)
3901             RaiseIfFailed("UnionIDs", self.GroupOp)
3902             pass
3903
3904         ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3905         #  @param theGroup is a GEOM group from which the sub-shapes are removed.
3906         #  @param theSubShapes is a list of sub-shapes to be removed.
3907         #
3908         #  @ref tui_working_with_groups_page "Example"
3909         def DifferenceList (self,theGroup, theSubShapes):
3910             # Example: see GEOM_TestOthers.py
3911             self.GroupOp.DifferenceList(theGroup, theSubShapes)
3912             RaiseIfFailed("DifferenceList", self.GroupOp)
3913             pass
3914
3915         ## Works like the above method, but argument
3916         #  theSubShapes here is a list of sub-shapes indices
3917         #
3918         #  @ref swig_DifferenceIDs "Example"
3919         def DifferenceIDs(self,theGroup, theSubShapes):
3920             # Example: see GEOM_TestOthers.py
3921             self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3922             RaiseIfFailed("DifferenceIDs", self.GroupOp)
3923             pass
3924
3925         ## Returns a list of sub objects ID stored in the group
3926         #  @param theGroup is a GEOM group for which a list of IDs is requested
3927         #
3928         #  @ref swig_GetObjectIDs "Example"
3929         def GetObjectIDs(self,theGroup):
3930             # Example: see GEOM_TestOthers.py
3931             ListIDs = self.GroupOp.GetObjects(theGroup)
3932             RaiseIfFailed("GetObjects", self.GroupOp)
3933             return ListIDs
3934
3935         ## Returns a type of sub objects stored in the group
3936         #  @param theGroup is a GEOM group which type is returned.
3937         #
3938         #  @ref swig_GetType "Example"
3939         def GetType(self,theGroup):
3940             # Example: see GEOM_TestOthers.py
3941             aType = self.GroupOp.GetType(theGroup)
3942             RaiseIfFailed("GetType", self.GroupOp)
3943             return aType
3944
3945         ## Convert a type of geom object from id to string value
3946         #  @param theId is a GEOM obect type id.
3947         #
3948         #  @ref swig_GetType "Example"
3949         def ShapeIdToType(self, theId):
3950             if theId == 0:
3951                 return "COPY"
3952             if theId == 1:
3953                 return "IMPORT"
3954             if theId == 2:
3955                 return "POINT"
3956             if theId == 3:
3957                 return "VECTOR"
3958             if theId == 4:
3959                 return "PLANE"
3960             if theId == 5:
3961                 return "LINE"
3962             if theId == 6:
3963                 return "TORUS"
3964             if theId == 7:
3965                 return "BOX"
3966             if theId == 8:
3967                 return "CYLINDER"
3968             if theId == 9:
3969                 return "CONE"
3970             if theId == 10:
3971                 return "SPHERE"
3972             if theId == 11:
3973                 return "PRISM"
3974             if theId == 12:
3975                 return "REVOLUTION"
3976             if theId == 13:
3977                 return "BOOLEAN"
3978             if theId == 14:
3979                 return "PARTITION"
3980             if theId == 15:
3981                 return "POLYLINE"
3982             if theId == 16:
3983                 return "CIRCLE"
3984             if theId == 17:
3985                 return "SPLINE"
3986             if theId == 18:
3987                 return "ELLIPSE"
3988             if theId == 19:
3989                 return "CIRC_ARC"
3990             if theId == 20:
3991                 return "FILLET"
3992             if theId == 21:
3993                 return "CHAMFER"
3994             if theId == 22:
3995                 return "EDGE"
3996             if theId == 23:
3997                 return "WIRE"
3998             if theId == 24:
3999                 return "FACE"
4000             if theId == 25:
4001                 return "SHELL"
4002             if theId == 26:
4003                 return "SOLID"
4004             if theId == 27:
4005                 return "COMPOUND"
4006             if theId == 28:
4007                 return "SUBSHAPE"
4008             if theId == 29:
4009                 return "PIPE"
4010             if theId == 30:
4011                 return "ARCHIMEDE"
4012             if theId == 31:
4013                 return "FILLING"
4014             if theId == 32:
4015                 return "EXPLODE"
4016             if theId == 33:
4017                 return "GLUED"
4018             if theId == 34:
4019                 return "SKETCHER"
4020             if theId == 35:
4021                 return "CDG"
4022             if theId == 36:
4023                 return "FREE_BOUNDS"
4024             if theId == 37:
4025                 return "GROUP"
4026             if theId == 38:
4027                 return "BLOCK"
4028             if theId == 39:
4029                 return "MARKER"
4030             if theId == 40:
4031                 return "THRUSECTIONS"
4032             if theId == 41:
4033                 return "COMPOUNDFILTER"
4034             if theId == 42:
4035                 return "SHAPES_ON_SHAPE"
4036             if theId == 43:
4037                 return "ELLIPSE_ARC"
4038             if theId == 44:
4039                 return "3DSKETCHER"
4040             if theId == 45:
4041                 return "FILLET_2D"
4042             if theId == 46:
4043                 return "FILLET_1D"
4044             return "Shape Id not exist."
4045
4046         ## Returns a main shape associated with the group
4047         #  @param theGroup is a GEOM group for which a main shape object is requested
4048         #  @return a GEOM object which is a main shape for theGroup
4049         #
4050         #  @ref swig_GetMainShape "Example"
4051         def GetMainShape(self,theGroup):
4052             # Example: see GEOM_TestOthers.py
4053             anObj = self.GroupOp.GetMainShape(theGroup)
4054             RaiseIfFailed("GetMainShape", self.GroupOp)
4055             return anObj
4056
4057         ## Create group of edges of theShape, whose length is in range [min_length, max_length].
4058         #  If include_min/max == 0, edges with length == min/max_length will not be included in result.
4059         #
4060         #  @ref swig_todo "Example"
4061         def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
4062             edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
4063             edges_in_range = []
4064             for edge in edges:
4065                 Props = self.BasicProperties(edge)
4066                 if min_length <= Props[0] and Props[0] <= max_length:
4067                     if (not include_min) and (min_length == Props[0]):
4068                         skip = 1
4069                     else:
4070                         if (not include_max) and (Props[0] == max_length):
4071                             skip = 1
4072                         else:
4073                             edges_in_range.append(edge)
4074
4075             if len(edges_in_range) <= 0:
4076                 print "No edges found by given criteria"
4077                 return 0
4078
4079             group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
4080             self.UnionList(group_edges, edges_in_range)
4081
4082             return group_edges
4083
4084         ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
4085         #  If include_min/max == 0, edges with length == min/max_length will not be included in result.
4086         #
4087         #  @ref swig_todo "Example"
4088         def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
4089             nb_selected = sg.SelectedCount()
4090             if nb_selected < 1:
4091                 print "Select a shape before calling this function, please."
4092                 return 0
4093             if nb_selected > 1:
4094                 print "Only one shape must be selected"
4095                 return 0
4096
4097             id_shape = sg.getSelected(0)
4098             shape = IDToObject( id_shape )
4099
4100             group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
4101
4102             left_str  = " < "
4103             right_str = " < "
4104             if include_min: left_str  = " <= "
4105             if include_max: right_str  = " <= "
4106
4107             self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
4108                                     + left_str + "length" + right_str + `max_length`)
4109
4110             sg.updateObjBrowser(1)
4111
4112             return group_edges
4113
4114         # end of l3_groups
4115         ## @}
4116
4117         ## @addtogroup l4_advanced 
4118         ## @{
4119
4120         #@@ insert new functions before this line @@#
4121
4122         # end of l4_advanced
4123         ## @}
4124
4125         ## Create a copy of the given object
4126         #  @ingroup l1_geompy_auxiliary
4127         #
4128         #  @ref swig_all_advanced "Example"
4129         def MakeCopy(self,theOriginal):
4130             # Example: see GEOM_TestAll.py
4131             anObj = self.InsertOp.MakeCopy(theOriginal)
4132             RaiseIfFailed("MakeCopy", self.InsertOp)
4133             return anObj
4134
4135         ## Add Path to load python scripts from
4136         #  @ingroup l1_geompy_auxiliary
4137         def addPath(self,Path):
4138             if (sys.path.count(Path) < 1):
4139                 sys.path.append(Path)
4140                 pass
4141             pass
4142
4143         ## Load marker texture from the file
4144         #  @param Path a path to the texture file
4145         #  @return unique texture identifier
4146         #  @ingroup l1_geompy_auxiliary
4147         def LoadTexture(self, Path):
4148             # Example: see GEOM_TestAll.py
4149             ID = self.InsertOp.LoadTexture(Path)
4150             RaiseIfFailed("LoadTexture", self.InsertOp)
4151             return ID
4152
4153         ## Add marker texture. @a Width and @a Height parameters
4154         #  specify width and height of the texture in pixels.
4155         #  If @a RowData is @c True, @a Texture parameter should represent texture data
4156         #  packed into the byte array. If @a RowData is @c False (default), @a Texture
4157         #  parameter should be unpacked string, in which '1' symbols represent opaque
4158         #  pixels and '0' represent transparent pixels of the texture bitmap.
4159         #
4160         #  @param Width texture width in pixels
4161         #  @param Height texture height in pixels
4162         #  @param Texture texture data
4163         #  @param RowData if @c True, @a Texture data are packed in the byte stream
4164         #  @ingroup l1_geompy_auxiliary
4165         def AddTexture(self, Width, Height, Texture, RowData=False):
4166             # Example: see GEOM_TestAll.py
4167             if not RowData: Texture = PackData(Texture)
4168             ID = self.InsertOp.AddTexture(Width, Height, Texture)
4169             RaiseIfFailed("AddTexture", self.InsertOp)
4170             return ID
4171
4172 import omniORB
4173 #Register the new proxy for GEOM_Gen
4174 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)