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