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