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