Salome HOME
Restart from scratch
[modules/geom.git] / src / GEOM_SWIG / geompyDC.py
1 #  -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2012  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 sub-shapes 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, Chamfer and other Features)
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 sub-shapes
70
71 ##   @}
72 ##   @defgroup l2_measure       Using measurement tools
73
74 ## @}
75
76 # initialize SALOME session in try/except block
77 # to avoid problems in some cases, e.g. when generating documentation
78 try:
79     import salome
80     salome.salome_init()
81     from salome import *
82 except:
83     pass
84
85 from salome_notebook import *
86
87 import GEOM
88 import math
89 import os
90
91 from gsketcher import Sketcher3D
92
93 ## Enumeration ShapeType as a dictionary. \n
94 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
95 #  @ingroup l1_geompy_auxiliary
96 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
97
98 ## Raise an Error, containing the Method_name, if Operation is Failed
99 ## @ingroup l1_geompy_auxiliary
100 def RaiseIfFailed (Method_name, Operation):
101     if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
102         raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
103
104 ## Return list of variables value from salome notebook
105 ## @ingroup l1_geompy_auxiliary
106 def ParseParameters(*parameters):
107     Result = []
108     StringResult = []
109     for parameter in parameters:
110         if isinstance(parameter, list):
111             lResults = ParseParameters(*parameter)
112             if len(lResults) > 0:
113                 Result.append(lResults[:-1])
114                 StringResult += lResults[-1].split(":")
115                 pass
116             pass
117         else:
118             if isinstance(parameter,str):
119                 if notebook.isVariable(parameter):
120                     Result.append(notebook.get(parameter))
121                 else:
122                     raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
123                 pass
124             else:
125                 Result.append(parameter)
126                 pass
127             StringResult.append(str(parameter))
128             pass
129         pass
130     if Result:
131         Result.append(":".join(StringResult))
132     else:
133         Result = ":".join(StringResult)
134     return Result
135
136 ## Return list of variables value from salome notebook
137 ## @ingroup l1_geompy_auxiliary
138 def ParseList(list):
139     Result = []
140     StringResult = ""
141     for parameter in list:
142         if isinstance(parameter,str) and notebook.isVariable(parameter):
143             Result.append(str(notebook.get(parameter)))
144             pass
145         else:
146             Result.append(str(parameter))
147             pass
148
149         StringResult = StringResult + str(parameter)
150         StringResult = StringResult + ":"
151         pass
152     StringResult = StringResult[:len(StringResult)-1]
153     return Result, StringResult
154
155 ## Return list of variables value from salome notebook
156 ## @ingroup l1_geompy_auxiliary
157 def ParseSketcherCommand(command):
158     Result = ""
159     StringResult = ""
160     sections = command.split(":")
161     for section in sections:
162         parameters = section.split(" ")
163         paramIndex = 1
164         for parameter in parameters:
165             if paramIndex > 1 and parameter.find("'") != -1:
166                 parameter = parameter.replace("'","")
167                 if notebook.isVariable(parameter):
168                     Result = Result + str(notebook.get(parameter)) + " "
169                     pass
170                 else:
171                     raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
172                     pass
173                 pass
174             else:
175                 Result = Result + str(parameter) + " "
176                 pass
177             if paramIndex > 1:
178                 StringResult = StringResult + parameter
179                 StringResult = StringResult + ":"
180                 pass
181             paramIndex = paramIndex + 1
182             pass
183         Result = Result[:len(Result)-1] + ":"
184         pass
185     Result = Result[:len(Result)-1]
186     return Result, StringResult
187
188 ## Helper function which can be used to pack the passed string to the byte data.
189 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
190 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
191 ## For example,
192 ## \code
193 ## val = PackData("10001110") # val = 0xAE
194 ## val = PackData("1")        # val = 0x80
195 ## \endcode
196 ## @param data unpacked data - a string containing '1' and '0' symbols
197 ## @return data packed to the byte stream
198 ## @ingroup l1_geompy_auxiliary
199 def PackData(data):
200     """
201     Helper function which can be used to pack the passed string to the byte data.
202     Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
203     If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
204
205     Parameters:
206         data unpacked data - a string containing '1' and '0' symbols
207
208     Returns:
209         data packed to the byte stream
210         
211     Example of usage:
212         val = PackData("10001110") # val = 0xAE
213         val = PackData("1")        # val = 0x80
214     """
215     bytes = len(data)/8
216     if len(data)%8: bytes += 1
217     res = ""
218     for b in range(bytes):
219         d = data[b*8:(b+1)*8]
220         val = 0
221         for i in range(8):
222             val *= 2
223             if i < len(d):
224                 if d[i] == "1": val += 1
225                 elif d[i] != "0":
226                     raise "Invalid symbol %s" % d[i]
227                 pass
228             pass
229         res += chr(val)
230         pass
231     return res
232
233 ## Read bitmap texture from the text file.
234 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
235 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
236 ## The function returns width and height of the pixmap in pixels and byte stream representing
237 ## texture bitmap itself.
238 ##
239 ## This function can be used to read the texture to the byte stream in order to pass it to
240 ## the AddTexture() function of geompy class.
241 ## For example,
242 ## \code
243 ## import geompy
244 ## geompy.init_geom(salome.myStudy)
245 ## texture = geompy.readtexture('mytexture.dat')
246 ## texture = geompy.AddTexture(*texture)
247 ## obj.SetMarkerTexture(texture)
248 ## \endcode
249 ## @param fname texture file name
250 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
251 ## @ingroup l1_geompy_auxiliary
252 def ReadTexture(fname):
253     """
254     Read bitmap texture from the text file.
255     In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
256     A zero symbol ('0') represents transparent pixel of the texture bitmap.
257     The function returns width and height of the pixmap in pixels and byte stream representing
258     texture bitmap itself.
259     This function can be used to read the texture to the byte stream in order to pass it to
260     the AddTexture() function of geompy class.
261     
262     Parameters:
263         fname texture file name
264
265     Returns:
266         sequence of tree values: texture's width, height in pixels and its byte stream
267     
268     Example of usage:
269         import geompy
270         geompy.init_geom(salome.myStudy)
271         texture = geompy.readtexture('mytexture.dat')
272         texture = geompy.AddTexture(*texture)
273         obj.SetMarkerTexture(texture)
274     """
275     try:
276         f = open(fname)
277         lines = [ l.strip() for l in f.readlines()]
278         f.close()
279         maxlen = 0
280         if lines: maxlen = max([len(x) for x in lines])
281         lenbytes = maxlen/8
282         if maxlen%8: lenbytes += 1
283         bytedata=""
284         for line in lines:
285             if len(line)%8:
286                 lenline = (len(line)/8+1)*8
287                 pass
288             else:
289                 lenline = (len(line)/8)*8
290                 pass
291             for i in range(lenline/8):
292                 byte=""
293                 for j in range(8):
294                     if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
295                     else: byte += "0"
296                     pass
297                 bytedata += PackData(byte)
298                 pass
299             for i in range(lenline/8, lenbytes):
300                 bytedata += PackData("0")
301             pass
302         return lenbytes*8, len(lines), bytedata
303     except:
304         pass
305     return 0, 0, ""
306
307 ## Returns a long value from enumeration type
308 #  Can be used for CORBA enumerator types like GEOM.shape_type
309 #  @param theItem enumeration type
310 #  @ingroup l1_geompy_auxiliary
311 def EnumToLong(theItem):
312     """
313     Returns a long value from enumeration type
314     Can be used for CORBA enumerator types like geompy.ShapeType
315
316     Parameters:
317         theItem enumeration type
318     """
319     ret = theItem
320     if hasattr(theItem, "_v"): ret = theItem._v
321     return ret
322
323 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
324 #  and a list of parameters, describing the shape.
325 #  List of parameters, describing the shape:
326 #  - COMPOUND:            [nb_solids  nb_faces  nb_edges  nb_vertices]
327 #  - COMPSOLID:           [nb_solids  nb_faces  nb_edges  nb_vertices]
328 #
329 #  - SHELL:       [info.CLOSED / info.UNCLOSED  nb_faces  nb_edges  nb_vertices]
330 #
331 #  - WIRE:        [info.CLOSED / info.UNCLOSED nb_edges  nb_vertices]
332 #
333 #  - SPHERE:       [xc yc zc            R]
334 #  - CYLINDER:     [xb yb zb  dx dy dz  R         H]
335 #  - BOX:          [xc yc zc                      ax ay az]
336 #  - ROTATED_BOX:  [xc yc zc  zx zy zz  xx xy xz  ax ay az]
337 #  - TORUS:        [xc yc zc  dx dy dz  R_1  R_2]
338 #  - CONE:         [xb yb zb  dx dy dz  R_1  R_2  H]
339 #  - POLYHEDRON:                       [nb_faces  nb_edges  nb_vertices]
340 #  - SOLID:                            [nb_faces  nb_edges  nb_vertices]
341 #
342 #  - SPHERE2D:     [xc yc zc            R]
343 #  - CYLINDER2D:   [xb yb zb  dx dy dz  R         H]
344 #  - TORUS2D:      [xc yc zc  dx dy dz  R_1  R_2]
345 #  - CONE2D:       [xc yc zc  dx dy dz  R_1  R_2  H]
346 #  - DISK_CIRCLE:  [xc yc zc  dx dy dz  R]
347 #  - DISK_ELLIPSE: [xc yc zc  dx dy dz  R_1  R_2]
348 #  - POLYGON:      [xo yo zo  dx dy dz            nb_edges  nb_vertices]
349 #  - PLANE:        [xo yo zo  dx dy dz]
350 #  - PLANAR:       [xo yo zo  dx dy dz            nb_edges  nb_vertices]
351 #  - FACE:                                       [nb_edges  nb_vertices]
352 #
353 #  - CIRCLE:       [xc yc zc  dx dy dz  R]
354 #  - ARC_CIRCLE:   [xc yc zc  dx dy dz  R         x1 y1 z1  x2 y2 z2]
355 #  - ELLIPSE:      [xc yc zc  dx dy dz  R_1  R_2]
356 #  - ARC_ELLIPSE:  [xc yc zc  dx dy dz  R_1  R_2  x1 y1 z1  x2 y2 z2]
357 #  - LINE:         [xo yo zo  dx dy dz]
358 #  - SEGMENT:      [x1 y1 z1  x2 y2 z2]
359 #  - EDGE:                                                 [nb_vertices]
360 #
361 #  - VERTEX:       [x  y  z]
362 #  @ingroup l1_geompy_auxiliary
363 kind = GEOM.GEOM_IKindOfShape
364
365 ## Information about closed/unclosed state of shell or wire
366 #  @ingroup l1_geompy_auxiliary
367 class info:
368     """
369     Information about closed/unclosed state of shell or wire
370     """
371     UNKNOWN  = 0
372     CLOSED   = 1
373     UNCLOSED = 2
374
375 class geompyDC(GEOM._objref_GEOM_Gen):
376
377         def __init__(self):
378             GEOM._objref_GEOM_Gen.__init__(self)
379             self.myBuilder = None
380             self.myStudyId = 0
381             self.father    = None
382
383             self.BasicOp  = None
384             self.CurvesOp = None
385             self.PrimOp   = None
386             self.ShapesOp = None
387             self.HealOp   = None
388             self.InsertOp = None
389             self.BoolOp   = None
390             self.TrsfOp   = None
391             self.LocalOp  = None
392             self.MeasuOp  = None
393             self.BlocksOp = None
394             self.GroupOp  = None
395             self.AdvOp    = None
396             self.ImpExpOp    = None
397             pass
398
399         ## @addtogroup l1_geompy_auxiliary
400         ## @{
401         def init_geom(self,theStudy):
402             self.myStudy = theStudy
403             self.myStudyId = self.myStudy._get_StudyId()
404             self.myBuilder = self.myStudy.NewBuilder()
405             self.father = self.myStudy.FindComponent("GEOM")
406             if self.father is None:
407                 self.father = self.myBuilder.NewComponent("GEOM")
408                 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
409                 FName = A1._narrow(SALOMEDS.AttributeName)
410                 FName.SetValue("Geometry")
411                 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
412                 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
413                 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
414                 self.myBuilder.DefineComponentInstance(self.father,self)
415                 pass
416             self.BasicOp  = self.GetIBasicOperations    (self.myStudyId)
417             self.CurvesOp = self.GetICurvesOperations   (self.myStudyId)
418             self.PrimOp   = self.GetI3DPrimOperations   (self.myStudyId)
419             self.ShapesOp = self.GetIShapesOperations   (self.myStudyId)
420             self.HealOp   = self.GetIHealingOperations  (self.myStudyId)
421             self.InsertOp = self.GetIInsertOperations   (self.myStudyId)
422             self.BoolOp   = self.GetIBooleanOperations  (self.myStudyId)
423             self.TrsfOp   = self.GetITransformOperations(self.myStudyId)
424             self.LocalOp  = self.GetILocalOperations    (self.myStudyId)
425             self.MeasuOp  = self.GetIMeasureOperations  (self.myStudyId)
426             self.BlocksOp = self.GetIBlocksOperations   (self.myStudyId)
427             self.GroupOp  = self.GetIGroupOperations    (self.myStudyId)
428             self.AdvOp    = self.GetIAdvancedOperations (self.myStudyId)
429             self.ImpExpOp    = self.GetIImportExportOperations (self.myStudyId)
430             pass
431
432         ## Dump component to the Python script
433         #  This method overrides IDL function to allow default values for the parameters.
434         def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
435             """
436             Dump component to the Python script
437             This method overrides IDL function to allow default values for the parameters.
438             """
439             return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
440
441         ## Get name for sub-shape aSubObj of shape aMainObj
442         #
443         # @ref swig_SubShapeName "Example"
444         def SubShapeName(self,aSubObj, aMainObj):
445             """
446             Get name for sub-shape aSubObj of shape aMainObj
447             """
448             # Example: see GEOM_TestAll.py
449
450             #aSubId  = orb.object_to_string(aSubObj)
451             #aMainId = orb.object_to_string(aMainObj)
452             #index = gg.getIndexTopology(aSubId, aMainId)
453             #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
454             index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
455             name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
456             return name
457
458         ## Publish in study aShape with name aName
459         #
460         #  \param aShape the shape to be published
461         #  \param aName  the name for the shape
462         #  \param doRestoreSubShapes if True, finds and publishes also
463         #         sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
464         #         and published sub-shapes of arguments
465         #  \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
466         #                                                  these arguments description
467         #  \return study entry of the published shape in form of string
468         #
469         #  @ref swig_all_addtostudy "Example"
470         def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
471                        theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
472             """
473             Publish in study aShape with name aName
474
475             Parameters:
476                 aShape the shape to be published
477                 aName  the name for the shape
478                 doRestoreSubShapes if True, finds and publishes also
479                                    sub-shapes of aShape, corresponding to its arguments
480                                    and published sub-shapes of arguments
481                 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
482                                                          these arguments description
483
484             Returns:
485                 study entry of the published shape in form of string
486
487             Example of usage:
488                 id_block1 = geompy.addToStudy(Block1, "Block 1")
489             """
490             # Example: see GEOM_TestAll.py
491             try:
492                 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
493                 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
494                 if doRestoreSubShapes:
495                     self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
496                                             theFindMethod, theInheritFirstArg, True )
497             except:
498                 print "addToStudy() failed"
499                 return ""
500             return aShape.GetStudyEntry()
501
502         ## Publish in study aShape with name aName as sub-object of previously published aFather
503         #  \param aFather previously published object
504         #  \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
505         #  \param aName  the name for the shape
506         #
507         #  \return study entry of the published shape in form of string
508         #  @ref swig_all_addtostudyInFather "Example"
509         def addToStudyInFather(self, aFather, aShape, aName):
510             """
511             Publish in study aShape with name aName as sub-object of previously published aFather
512
513             Parameters:
514                 aFather previously published object
515                 aShape the shape to be published as sub-object of aFather
516                 aName  the name for the shape
517
518             Returns:
519                 study entry of the published shape in form of string
520             """
521             # Example: see GEOM_TestAll.py
522             try:
523                 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
524                 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
525             except:
526                 print "addToStudyInFather() failed"
527                 return ""
528             return aShape.GetStudyEntry()
529
530         ## Unpublish object in study
531         #
532         #  \param obj the object to be unpublished
533         def hideInStudy(self, obj):
534             """
535             Unpublish object in study
536
537             Parameters:
538                 obj the object to be unpublished
539             """
540             ior = salome.orb.object_to_string(obj)
541             aSObject = self.myStudy.FindObjectIOR(ior)
542             if aSObject is not None:
543                 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
544                 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
545                 drwAttribute.SetDrawable(False)
546                 pass
547
548         # end of l1_geompy_auxiliary
549         ## @}
550
551         ## @addtogroup l3_restore_ss
552         ## @{
553
554         ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
555         #  To be used from python scripts out of addToStudy() (non-default usage)
556         #  \param theObject published GEOM.GEOM_Object, arguments of which will be published
557         #  \param theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
558         #                   If this list is empty, all operation arguments will be published
559         #  \param theFindMethod method to search sub-shapes, corresponding to arguments and
560         #                       their sub-shapes. Value from enumeration GEOM.find_shape_method.
561         #  \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
562         #                            Do not publish sub-shapes in place of arguments, but only
563         #                            in place of sub-shapes of the first argument,
564         #                            because the whole shape corresponds to the first argument.
565         #                            Mainly to be used after transformations, but it also can be
566         #                            usefull after partition with one object shape, and some other
567         #                            operations, where only the first argument has to be considered.
568         #                            If theObject has only one argument shape, this flag is automatically
569         #                            considered as True, not regarding really passed value.
570         #  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
571         #                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
572         #  \return list of published sub-shapes
573         #
574         #  @ref tui_restore_prs_params "Example"
575         def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
576                               theInheritFirstArg=False, theAddPrefix=True):
577             """
578             Publish sub-shapes, standing for arguments and sub-shapes of arguments
579             To be used from python scripts out of geompy.addToStudy (non-default usage)
580
581             Parameters:
582                 theObject published GEOM.GEOM_Object, arguments of which will be published
583                 theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
584                           If this list is empty, all operation arguments will be published
585                 theFindMethod method to search sub-shapes, corresponding to arguments and
586                               their sub-shapes. Value from enumeration GEOM.find_shape_method.
587                 theInheritFirstArg set properties of the first argument for theObject.
588                                    Do not publish sub-shapes in place of arguments, but only
589                                    in place of sub-shapes of the first argument,
590                                    because the whole shape corresponds to the first argument.
591                                    Mainly to be used after transformations, but it also can be
592                                    usefull after partition with one object shape, and some other
593                                    operations, where only the first argument has to be considered.
594                                    If theObject has only one argument shape, this flag is automatically
595                                    considered as True, not regarding really passed value.
596                 theAddPrefix add prefix "from_" to names of restored sub-shapes,
597                              and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
598             Returns:
599                 list of published sub-shapes
600             """
601             # Example: see GEOM_TestAll.py
602             return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
603                                           theFindMethod, theInheritFirstArg, theAddPrefix)
604
605         ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
606         #  To be used from python scripts out of addToStudy() (non-default usage)
607         #  \param theObject published GEOM.GEOM_Object, arguments of which will be published
608         #  \param theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
609         #                   If this list is empty, all operation arguments will be published
610         #  \param theFindMethod method to search sub-shapes, corresponding to arguments and
611         #                       their sub-shapes. Value from enumeration GEOM::find_shape_method.
612         #  \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
613         #                            Do not publish sub-shapes in place of arguments, but only
614         #                            in place of sub-shapes of the first argument,
615         #                            because the whole shape corresponds to the first argument.
616         #                            Mainly to be used after transformations, but it also can be
617         #                            usefull after partition with one object shape, and some other
618         #                            operations, where only the first argument has to be considered.
619         #                            If theObject has only one argument shape, this flag is automatically
620         #                            considered as True, not regarding really passed value.
621         #  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
622         #                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
623         #  \return list of published sub-shapes
624         #
625         #  @ref tui_restore_prs_params "Example"
626         def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
627                                    theInheritFirstArg=False, theAddPrefix=True):
628             """
629             Publish sub-shapes, standing for arguments and sub-shapes of arguments
630             To be used from python scripts out of geompy.addToStudy() (non-default usage)
631
632             Parameters:
633                 theObject published GEOM.GEOM_Object, arguments of which will be published
634                 theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
635                           If this list is empty, all operation arguments will be published
636                 theFindMethod method to search sub-shapes, corresponding to arguments and
637                               their sub-shapes. Value from enumeration GEOM::find_shape_method.
638                 theInheritFirstArg set properties of the first argument for theObject.
639                                    Do not publish sub-shapes in place of arguments, but only
640                                    in place of sub-shapes of the first argument,
641                                    because the whole shape corresponds to the first argument.
642                                    Mainly to be used after transformations, but it also can be
643                                    usefull after partition with one object shape, and some other
644                                    operations, where only the first argument has to be considered.
645                                    If theObject has only one argument shape, this flag is automatically
646                                    considered as True, not regarding really passed value.
647                 theAddPrefix add prefix "from_" to names of restored sub-shapes,
648                              and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
649
650             Returns: 
651                 list of published sub-shapes
652             """
653             # Example: see GEOM_TestAll.py
654             return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
655                                                theFindMethod, theInheritFirstArg, theAddPrefix)
656
657         # end of l3_restore_ss
658         ## @}
659
660         ## @addtogroup l3_basic_go
661         ## @{
662
663         ## Create point by three coordinates.
664         #  @param theX The X coordinate of the point.
665         #  @param theY The Y coordinate of the point.
666         #  @param theZ The Z coordinate of the point.
667         #  @return New GEOM.GEOM_Object, containing the created point.
668         #
669         #  @ref tui_creation_point "Example"
670         def MakeVertex(self, theX, theY, theZ):
671             """
672             Create point by three coordinates.
673
674             Parameters:
675                 theX The X coordinate of the point.
676                 theY The Y coordinate of the point.
677                 theZ The Z coordinate of the point.
678                 
679             Returns: 
680                 New GEOM.GEOM_Object, containing the created point.
681             """
682             # Example: see GEOM_TestAll.py
683             theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
684             anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
685             RaiseIfFailed("MakePointXYZ", self.BasicOp)
686             anObj.SetParameters(Parameters)
687             return anObj
688
689         ## Create a point, distant from the referenced point
690         #  on the given distances along the coordinate axes.
691         #  @param theReference The referenced point.
692         #  @param theX Displacement from the referenced point along OX axis.
693         #  @param theY Displacement from the referenced point along OY axis.
694         #  @param theZ Displacement from the referenced point along OZ axis.
695         #  @return New GEOM.GEOM_Object, containing the created point.
696         #
697         #  @ref tui_creation_point "Example"
698         def MakeVertexWithRef(self,theReference, theX, theY, theZ):
699             """
700             Create a point, distant from the referenced point
701             on the given distances along the coordinate axes.
702
703             Parameters:
704                 theReference The referenced point.
705                 theX Displacement from the referenced point along OX axis.
706                 theY Displacement from the referenced point along OY axis.
707                 theZ Displacement from the referenced point along OZ axis.
708
709             Returns:
710                 New GEOM.GEOM_Object, containing the created point.
711             """
712             # Example: see GEOM_TestAll.py
713             theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
714             anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
715             RaiseIfFailed("MakePointWithReference", self.BasicOp)
716             anObj.SetParameters(Parameters)
717             return anObj
718
719         ## Create a point, corresponding to the given parameter on the given curve.
720         #  @param theRefCurve The referenced curve.
721         #  @param theParameter Value of parameter on the referenced curve.
722         #  @return New GEOM.GEOM_Object, containing the created point.
723         #
724         #  @ref tui_creation_point "Example"
725         def MakeVertexOnCurve(self,theRefCurve, theParameter):
726             """
727             Create a point, corresponding to the given parameter on the given curve.
728
729             Parameters:
730                 theRefCurve The referenced curve.
731                 theParameter Value of parameter on the referenced curve.
732
733             Returns:
734                 New GEOM.GEOM_Object, containing the created point.
735
736             Example of usage:
737                 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
738             """
739             # Example: see GEOM_TestAll.py
740             theParameter, Parameters = ParseParameters(theParameter)
741             anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
742             RaiseIfFailed("MakePointOnCurve", self.BasicOp)
743             anObj.SetParameters(Parameters)
744             return anObj
745
746         ## Create a point by projection give coordinates on the given curve
747         #  @param theRefCurve The referenced curve.
748         #  @param theX X-coordinate in 3D space
749         #  @param theY Y-coordinate in 3D space
750         #  @param theZ Z-coordinate in 3D space
751         #  @return New GEOM.GEOM_Object, containing the created point.
752         #
753         #  @ref tui_creation_point "Example"
754         def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
755             """
756             Create a point by projection give coordinates on the given curve
757             
758             Parameters:
759                 theRefCurve The referenced curve.
760                 theX X-coordinate in 3D space
761                 theY Y-coordinate in 3D space
762                 theZ Z-coordinate in 3D space
763
764             Returns:
765                 New GEOM.GEOM_Object, containing the created point.
766
767             Example of usage:
768                 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
769             """
770             # Example: see GEOM_TestAll.py
771             theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
772             anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
773             RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
774             anObj.SetParameters(Parameters)
775             return anObj
776
777         ## Create a point, corresponding to the given length on the given curve.
778         #  @param theRefCurve The referenced curve.
779         #  @param theLength Length on the referenced curve. It can be negative.
780         #  @param theStartPoint Point allowing to choose the direction for the calculation
781         #                       of the length. If None, start from the first point of theRefCurve.
782         #  @return New GEOM.GEOM_Object, containing the created point.
783         #
784         #  @ref tui_creation_point "Example"
785         def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
786             """
787             Create a point, corresponding to the given length on the given curve.
788
789             Parameters:
790                 theRefCurve The referenced curve.
791                 theLength Length on the referenced curve. It can be negative.
792                 theStartPoint Point allowing to choose the direction for the calculation
793                               of the length. If None, start from the first point of theRefCurve.
794
795             Returns:
796                 New GEOM.GEOM_Object, containing the created point.
797             """
798             # Example: see GEOM_TestAll.py
799             theLength, Parameters = ParseParameters(theLength)
800             anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
801             RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
802             anObj.SetParameters(Parameters)
803             return anObj
804
805         ## Create a point, corresponding to the given parameters on the
806         #    given surface.
807         #  @param theRefSurf The referenced surface.
808         #  @param theUParameter Value of U-parameter on the referenced surface.
809         #  @param theVParameter Value of V-parameter on the referenced surface.
810         #  @return New GEOM.GEOM_Object, containing the created point.
811         #
812         #  @ref swig_MakeVertexOnSurface "Example"
813         def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
814             """
815             Create a point, corresponding to the given parameters on the
816             given surface.
817
818             Parameters:
819                 theRefSurf The referenced surface.
820                 theUParameter Value of U-parameter on the referenced surface.
821                 theVParameter Value of V-parameter on the referenced surface.
822
823             Returns:
824                 New GEOM.GEOM_Object, containing the created point.
825
826             Example of usage:
827                 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
828             """
829             theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
830             # Example: see GEOM_TestAll.py
831             anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
832             RaiseIfFailed("MakePointOnSurface", self.BasicOp)
833             anObj.SetParameters(Parameters);
834             return anObj
835
836         ## Create a point by projection give coordinates on the given surface
837         #  @param theRefSurf The referenced surface.
838         #  @param theX X-coordinate in 3D space
839         #  @param theY Y-coordinate in 3D space
840         #  @param theZ Z-coordinate in 3D space
841         #  @return New GEOM.GEOM_Object, containing the created point.
842         #
843         #  @ref swig_MakeVertexOnSurfaceByCoord "Example"
844         def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
845             """
846             Create a point by projection give coordinates on the given surface
847
848             Parameters:
849                 theRefSurf The referenced surface.
850                 theX X-coordinate in 3D space
851                 theY Y-coordinate in 3D space
852                 theZ Z-coordinate in 3D space
853
854             Returns:
855                 New GEOM.GEOM_Object, containing the created point.
856
857             Example of usage:
858                 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
859             """
860             theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
861             # Example: see GEOM_TestAll.py
862             anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
863             RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
864             anObj.SetParameters(Parameters);
865             return anObj
866
867         ## Create a point, which lays on the given face.
868         #  The point will lay in arbitrary place of the face.
869         #  The only condition on it is a non-zero distance to the face boundary.
870         #  Such point can be used to uniquely identify the face inside any
871         #  shape in case, when the shape does not contain overlapped faces.
872         #  @param theFace The referenced face.
873         #  @return New GEOM.GEOM_Object, containing the created point.
874         #
875         #  @ref swig_MakeVertexInsideFace "Example"
876         def MakeVertexInsideFace (self, theFace):
877             """
878             Create a point, which lays on the given face.
879             The point will lay in arbitrary place of the face.
880             The only condition on it is a non-zero distance to the face boundary.
881             Such point can be used to uniquely identify the face inside any
882             shape in case, when the shape does not contain overlapped faces.
883
884             Parameters:
885                 theFace The referenced face.
886
887             Returns:
888                 New GEOM.GEOM_Object, containing the created point.
889
890             Example of usage:
891                 p_on_face = geompy.MakeVertexInsideFace(Face)
892             """
893             # Example: see GEOM_TestAll.py
894             anObj = self.BasicOp.MakePointOnFace(theFace)
895             RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
896             return anObj
897
898         ## Create a point on intersection of two lines.
899         #  @param theRefLine1, theRefLine2 The referenced lines.
900         #  @return New GEOM.GEOM_Object, containing the created point.
901         #
902         #  @ref swig_MakeVertexOnLinesIntersection "Example"
903         def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
904             """
905             Create a point on intersection of two lines.
906
907             Parameters:
908                 theRefLine1, theRefLine2 The referenced lines.
909
910             Returns:
911                 New GEOM.GEOM_Object, containing the created point.
912             """
913             # Example: see GEOM_TestAll.py
914             anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
915             RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
916             return anObj
917
918         ## Create a tangent, corresponding to the given parameter on the given curve.
919         #  @param theRefCurve The referenced curve.
920         #  @param theParameter Value of parameter on the referenced curve.
921         #  @return New GEOM.GEOM_Object, containing the created tangent.
922         #
923         #  @ref swig_MakeTangentOnCurve "Example"
924         def MakeTangentOnCurve(self, theRefCurve, theParameter):
925             """
926             Create a tangent, corresponding to the given parameter on the given curve.
927
928             Parameters:
929                 theRefCurve The referenced curve.
930                 theParameter Value of parameter on the referenced curve.
931
932             Returns:
933                 New GEOM.GEOM_Object, containing the created tangent.
934
935             Example of usage:
936                 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
937             """
938             anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
939             RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
940             return anObj
941
942         ## Create a tangent plane, corresponding to the given parameter on the given face.
943         #  @param theFace The face for which tangent plane should be built.
944         #  @param theParameterV vertical value of the center point (0.0 - 1.0).
945         #  @param theParameterU horisontal value of the center point (0.0 - 1.0).
946         #  @param theTrimSize the size of plane.
947         #  @return New GEOM.GEOM_Object, containing the created tangent.
948         #
949         #  @ref swig_MakeTangentPlaneOnFace "Example"
950         def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
951             """
952             Create a tangent plane, corresponding to the given parameter on the given face.
953
954             Parameters:
955                 theFace The face for which tangent plane should be built.
956                 theParameterV vertical value of the center point (0.0 - 1.0).
957                 theParameterU horisontal value of the center point (0.0 - 1.0).
958                 theTrimSize the size of plane.
959
960            Returns: 
961                 New GEOM.GEOM_Object, containing the created tangent.
962
963            Example of usage:
964                 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
965             """
966             anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
967             RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
968             return anObj
969
970         ## Create a vector with the given components.
971         #  @param theDX X component of the vector.
972         #  @param theDY Y component of the vector.
973         #  @param theDZ Z component of the vector.
974         #  @return New GEOM.GEOM_Object, containing the created vector.
975         #
976         #  @ref tui_creation_vector "Example"
977         def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
978             """
979             Create a vector with the given components.
980
981             Parameters:
982                 theDX X component of the vector.
983                 theDY Y component of the vector.
984                 theDZ Z component of the vector.
985
986             Returns:     
987                 New GEOM.GEOM_Object, containing the created vector.
988             """
989             # Example: see GEOM_TestAll.py
990             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
991             anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
992             RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
993             anObj.SetParameters(Parameters)
994             return anObj
995
996         ## Create a vector between two points.
997         #  @param thePnt1 Start point for the vector.
998         #  @param thePnt2 End point for the vector.
999         #  @return New GEOM.GEOM_Object, containing the created vector.
1000         #
1001         #  @ref tui_creation_vector "Example"
1002         def MakeVector(self,thePnt1, thePnt2):
1003             """
1004             Create a vector between two points.
1005
1006             Parameters:
1007                 thePnt1 Start point for the vector.
1008                 thePnt2 End point for the vector.
1009
1010             Returns:        
1011                 New GEOM.GEOM_Object, containing the created vector.
1012             """
1013             # Example: see GEOM_TestAll.py
1014             anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1015             RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1016             return anObj
1017
1018         ## Create a line, passing through the given point
1019         #  and parrallel to the given direction
1020         #  @param thePnt Point. The resulting line will pass through it.
1021         #  @param theDir Direction. The resulting line will be parallel to it.
1022         #  @return New GEOM.GEOM_Object, containing the created line.
1023         #
1024         #  @ref tui_creation_line "Example"
1025         def MakeLine(self,thePnt, theDir):
1026             """
1027             Create a line, passing through the given point
1028             and parrallel to the given direction
1029
1030             Parameters:
1031                 thePnt Point. The resulting line will pass through it.
1032                 theDir Direction. The resulting line will be parallel to it.
1033
1034             Returns:
1035                 New GEOM.GEOM_Object, containing the created line.
1036             """
1037             # Example: see GEOM_TestAll.py
1038             anObj = self.BasicOp.MakeLine(thePnt, theDir)
1039             RaiseIfFailed("MakeLine", self.BasicOp)
1040             return anObj
1041
1042         ## Create a line, passing through the given points
1043         #  @param thePnt1 First of two points, defining the line.
1044         #  @param thePnt2 Second of two points, defining the line.
1045         #  @return New GEOM.GEOM_Object, containing the created line.
1046         #
1047         #  @ref tui_creation_line "Example"
1048         def MakeLineTwoPnt(self,thePnt1, thePnt2):
1049             """
1050             Create a line, passing through the given points
1051
1052             Parameters:
1053                 thePnt1 First of two points, defining the line.
1054                 thePnt2 Second of two points, defining the line.
1055
1056             Returns:
1057                 New GEOM.GEOM_Object, containing the created line.
1058             """
1059             # Example: see GEOM_TestAll.py
1060             anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1061             RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1062             return anObj
1063
1064         ## Create a line on two faces intersection.
1065         #  @param theFace1 First of two faces, defining the line.
1066         #  @param theFace2 Second of two faces, defining the line.
1067         #  @return New GEOM.GEOM_Object, containing the created line.
1068         #
1069         #  @ref swig_MakeLineTwoFaces "Example"
1070         def MakeLineTwoFaces(self, theFace1, theFace2):
1071             """
1072             Create a line on two faces intersection.
1073
1074             Parameters:
1075                 theFace1 First of two faces, defining the line.
1076                 theFace2 Second of two faces, defining the line.
1077
1078             Returns:
1079                 New GEOM.GEOM_Object, containing the created line.
1080             """
1081             # Example: see GEOM_TestAll.py
1082             anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1083             RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1084             return anObj
1085
1086         ## Create a plane, passing through the given point
1087         #  and normal to the given vector.
1088         #  @param thePnt Point, the plane has to pass through.
1089         #  @param theVec Vector, defining the plane normal direction.
1090         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1091         #  @return New GEOM.GEOM_Object, containing the created plane.
1092         #
1093         #  @ref tui_creation_plane "Example"
1094         def MakePlane(self,thePnt, theVec, theTrimSize):
1095             """
1096             Create a plane, passing through the given point
1097             and normal to the given vector.
1098
1099             Parameters:
1100                 thePnt Point, the plane has to pass through.
1101                 theVec Vector, defining the plane normal direction.
1102                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1103
1104             Returns:    
1105                 New GEOM.GEOM_Object, containing the created plane.
1106             """
1107             # Example: see GEOM_TestAll.py
1108             theTrimSize, Parameters = ParseParameters(theTrimSize);
1109             anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1110             RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1111             anObj.SetParameters(Parameters)
1112             return anObj
1113
1114         ## Create a plane, passing through the three given points
1115         #  @param thePnt1 First of three points, defining the plane.
1116         #  @param thePnt2 Second of three points, defining the plane.
1117         #  @param thePnt3 Fird of three points, defining the plane.
1118         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1119         #  @return New GEOM.GEOM_Object, containing the created plane.
1120         #
1121         #  @ref tui_creation_plane "Example"
1122         def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
1123             """
1124             Create a plane, passing through the three given points
1125
1126             Parameters:
1127                 thePnt1 First of three points, defining the plane.
1128                 thePnt2 Second of three points, defining the plane.
1129                 thePnt3 Fird of three points, defining the plane.
1130                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1131
1132             Returns:
1133                 New GEOM.GEOM_Object, containing the created plane.
1134             """
1135             # Example: see GEOM_TestAll.py
1136             theTrimSize, Parameters = ParseParameters(theTrimSize);
1137             anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1138             RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1139             anObj.SetParameters(Parameters)
1140             return anObj
1141
1142         ## Create a plane, similar to the existing one, but with another size of representing face.
1143         #  @param theFace Referenced plane or LCS(Marker).
1144         #  @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1145         #  @return New GEOM.GEOM_Object, containing the created plane.
1146         #
1147         #  @ref tui_creation_plane "Example"
1148         def MakePlaneFace(self,theFace, theTrimSize):
1149             """
1150             Create a plane, similar to the existing one, but with another size of representing face.
1151
1152             Parameters:
1153                 theFace Referenced plane or LCS(Marker).
1154                 theTrimSize New half size of a side of quadrangle face, representing the plane.
1155
1156             Returns:
1157                 New GEOM.GEOM_Object, containing the created plane.
1158             """
1159             # Example: see GEOM_TestAll.py
1160             theTrimSize, Parameters = ParseParameters(theTrimSize);
1161             anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1162             RaiseIfFailed("MakePlaneFace", self.BasicOp)
1163             anObj.SetParameters(Parameters)
1164             return anObj
1165
1166         ## Create a plane, passing through the 2 vectors
1167         #  with center in a start point of the first vector.
1168         #  @param theVec1 Vector, defining center point and plane direction.
1169         #  @param theVec2 Vector, defining the plane normal direction.
1170         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1171         #  @return New GEOM.GEOM_Object, containing the created plane.
1172         #
1173         #  @ref tui_creation_plane "Example"
1174         def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
1175             """
1176             Create a plane, passing through the 2 vectors
1177             with center in a start point of the first vector.
1178
1179             Parameters:
1180                 theVec1 Vector, defining center point and plane direction.
1181                 theVec2 Vector, defining the plane normal direction.
1182                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1183
1184             Returns: 
1185                 New GEOM.GEOM_Object, containing the created plane.
1186             """
1187             # Example: see GEOM_TestAll.py
1188             theTrimSize, Parameters = ParseParameters(theTrimSize);
1189             anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1190             RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1191             anObj.SetParameters(Parameters)
1192             return anObj
1193
1194         ## Create a plane, based on a Local coordinate system.
1195         #  @param theLCS  coordinate system, defining plane.
1196         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1197         #  @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1198         #  @return New GEOM.GEOM_Object, containing the created plane.
1199         #
1200         #  @ref tui_creation_plane "Example"
1201         def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
1202             """
1203             Create a plane, based on a Local coordinate system.
1204
1205            Parameters: 
1206                 theLCS  coordinate system, defining plane.
1207                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1208                 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1209
1210             Returns: 
1211                 New GEOM.GEOM_Object, containing the created plane.
1212             """
1213             # Example: see GEOM_TestAll.py
1214             theTrimSize, Parameters = ParseParameters(theTrimSize);
1215             anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1216             RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1217             anObj.SetParameters(Parameters)
1218             return anObj
1219
1220         ## Create a local coordinate system.
1221         #  @param OX,OY,OZ Three coordinates of coordinate system origin.
1222         #  @param XDX,XDY,XDZ Three components of OX direction
1223         #  @param YDX,YDY,YDZ Three components of OY direction
1224         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1225         #
1226         #  @ref swig_MakeMarker "Example"
1227         def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
1228             """
1229             Create a local coordinate system.
1230
1231             Parameters: 
1232                 OX,OY,OZ Three coordinates of coordinate system origin.
1233                 XDX,XDY,XDZ Three components of OX direction
1234                 YDX,YDY,YDZ Three components of OY direction
1235
1236             Returns: 
1237                 New GEOM.GEOM_Object, containing the created coordinate system.
1238             """
1239             # Example: see GEOM_TestAll.py
1240             OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1241             anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1242             RaiseIfFailed("MakeMarker", self.BasicOp)
1243             anObj.SetParameters(Parameters)
1244             return anObj
1245
1246         ## Create a local coordinate system from shape.
1247         #  @param theShape The initial shape to detect the coordinate system.
1248         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1249         #
1250         #  @ref tui_creation_lcs "Example"
1251         def MakeMarkerFromShape(self, theShape):
1252             """
1253             Create a local coordinate system from shape.
1254
1255             Parameters:
1256                 theShape The initial shape to detect the coordinate system.
1257                 
1258             Returns: 
1259                 New GEOM.GEOM_Object, containing the created coordinate system.
1260             """
1261             anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1262             RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1263             return anObj
1264
1265         ## Create a local coordinate system from point and two vectors.
1266         #  @param theOrigin Point of coordinate system origin.
1267         #  @param theXVec Vector of X direction
1268         #  @param theYVec Vector of Y direction
1269         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1270         #
1271         #  @ref tui_creation_lcs "Example"
1272         def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
1273             """
1274             Create a local coordinate system from point and two vectors.
1275
1276             Parameters:
1277                 theOrigin Point of coordinate system origin.
1278                 theXVec Vector of X direction
1279                 theYVec Vector of Y direction
1280
1281             Returns: 
1282                 New GEOM.GEOM_Object, containing the created coordinate system.
1283
1284             """
1285             anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1286             RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1287             return anObj
1288
1289         # end of l3_basic_go
1290         ## @}
1291
1292         ## @addtogroup l4_curves
1293         ## @{
1294
1295         ##  Create an arc of circle, passing through three given points.
1296         #  @param thePnt1 Start point of the arc.
1297         #  @param thePnt2 Middle point of the arc.
1298         #  @param thePnt3 End point of the arc.
1299         #  @return New GEOM.GEOM_Object, containing the created arc.
1300         #
1301         #  @ref swig_MakeArc "Example"
1302         def MakeArc(self,thePnt1, thePnt2, thePnt3):
1303             """
1304             Create an arc of circle, passing through three given points.
1305
1306             Parameters:
1307                 thePnt1 Start point of the arc.
1308                 thePnt2 Middle point of the arc.
1309                 thePnt3 End point of the arc.
1310
1311             Returns: 
1312                 New GEOM.GEOM_Object, containing the created arc.
1313             """
1314             # Example: see GEOM_TestAll.py
1315             anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1316             RaiseIfFailed("MakeArc", self.CurvesOp)
1317             return anObj
1318
1319         ##  Create an arc of circle from a center and 2 points.
1320         #  @param thePnt1 Center of the arc
1321         #  @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1322         #  @param thePnt3 End point of the arc (Gives also a direction)
1323         #  @param theSense Orientation of the arc
1324         #  @return New GEOM.GEOM_Object, containing the created arc.
1325         #
1326         #  @ref swig_MakeArc "Example"
1327         def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
1328             """
1329             Create an arc of circle from a center and 2 points.
1330
1331             Parameters:
1332                 thePnt1 Center of the arc
1333                 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1334                 thePnt3 End point of the arc (Gives also a direction)
1335                 theSense Orientation of the arc
1336
1337             Returns:
1338                 New GEOM.GEOM_Object, containing the created arc.
1339             """
1340             # Example: see GEOM_TestAll.py
1341             anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1342             RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1343             return anObj
1344
1345         ##  Create an arc of ellipse, of center and two points.
1346         #  @param theCenter Center of the arc.
1347         #  @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1348         #  @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1349         #  @return New GEOM.GEOM_Object, containing the created arc.
1350         #
1351         #  @ref swig_MakeArc "Example"
1352         def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
1353             """
1354             Create an arc of ellipse, of center and two points.
1355
1356             Parameters:
1357                 theCenter Center of the arc.
1358                 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1359                 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1360
1361             Returns:
1362                 New GEOM.GEOM_Object, containing the created arc.
1363             """
1364             # Example: see GEOM_TestAll.py
1365             anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1366             RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1367             return anObj
1368
1369         ## Create a circle with given center, normal vector and radius.
1370         #  @param thePnt Circle center.
1371         #  @param theVec Vector, normal to the plane of the circle.
1372         #  @param theR Circle radius.
1373         #  @return New GEOM.GEOM_Object, containing the created circle.
1374         #
1375         #  @ref tui_creation_circle "Example"
1376         def MakeCircle(self, thePnt, theVec, theR):
1377             """
1378             Create a circle with given center, normal vector and radius.
1379
1380             Parameters:
1381                 thePnt Circle center.
1382                 theVec Vector, normal to the plane of the circle.
1383                 theR Circle radius.
1384
1385             Returns:
1386                 New GEOM.GEOM_Object, containing the created circle.
1387             """
1388             # Example: see GEOM_TestAll.py
1389             theR, Parameters = ParseParameters(theR)
1390             anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
1391             RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1392             anObj.SetParameters(Parameters)
1393             return anObj
1394
1395         ## Create a circle with given radius.
1396         #  Center of the circle will be in the origin of global
1397         #  coordinate system and normal vector will be codirected with Z axis
1398         #  @param theR Circle radius.
1399         #  @return New GEOM.GEOM_Object, containing the created circle.
1400         def MakeCircleR(self, theR):
1401             """
1402             Create a circle with given radius.
1403             Center of the circle will be in the origin of global
1404             coordinate system and normal vector will be codirected with Z axis
1405
1406             Parameters:
1407                 theR Circle radius.
1408
1409             Returns:
1410                 New GEOM.GEOM_Object, containing the created circle.
1411             """
1412             anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
1413             RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1414             return anObj
1415
1416         ## Create a circle, passing through three given points
1417         #  @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1418         #  @return New GEOM.GEOM_Object, containing the created circle.
1419         #
1420         #  @ref tui_creation_circle "Example"
1421         def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
1422             """
1423             Create a circle, passing through three given points
1424
1425             Parameters:
1426                 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1427
1428             Returns:
1429                 New GEOM.GEOM_Object, containing the created circle.
1430             """
1431             # Example: see GEOM_TestAll.py
1432             anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
1433             RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
1434             return anObj
1435
1436         ## Create a circle, with given point1 as center,
1437         #  passing through the point2 as radius and laying in the plane,
1438         #  defined by all three given points.
1439         #  @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1440         #  @return New GEOM.GEOM_Object, containing the created circle.
1441         #
1442         #  @ref swig_MakeCircle "Example"
1443         def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
1444             """
1445             Create a circle, with given point1 as center,
1446             passing through the point2 as radius and laying in the plane,
1447             defined by all three given points.
1448
1449             Parameters:
1450                 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1451
1452             Returns:
1453                 New GEOM.GEOM_Object, containing the created circle.
1454             """
1455             # Example: see GEOM_example6.py
1456             anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
1457             RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
1458             return anObj
1459
1460         ## Create an ellipse with given center, normal vector and radiuses.
1461         #  @param thePnt Ellipse center.
1462         #  @param theVec Vector, normal to the plane of the ellipse.
1463         #  @param theRMajor Major ellipse radius.
1464         #  @param theRMinor Minor ellipse radius.
1465         #  @param theVecMaj Vector, direction of the ellipse's main axis.
1466         #  @return New GEOM.GEOM_Object, containing the created ellipse.
1467         #
1468         #  @ref tui_creation_ellipse "Example"
1469         def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
1470             """
1471             Create an ellipse with given center, normal vector and radiuses.
1472
1473             Parameters:
1474                 thePnt Ellipse center.
1475                 theVec Vector, normal to the plane of the ellipse.
1476                 theRMajor Major ellipse radius.
1477                 theRMinor Minor ellipse radius.
1478                 theVecMaj Vector, direction of the ellipse's main axis.
1479
1480             Returns:    
1481                 New GEOM.GEOM_Object, containing the created ellipse.
1482             """
1483             # Example: see GEOM_TestAll.py
1484             theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
1485             if theVecMaj is not None:
1486                 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
1487             else:
1488                 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
1489                 pass
1490             RaiseIfFailed("MakeEllipse", self.CurvesOp)
1491             anObj.SetParameters(Parameters)
1492             return anObj
1493
1494         ## Create an ellipse with given radiuses.
1495         #  Center of the ellipse will be in the origin of global
1496         #  coordinate system and normal vector will be codirected with Z axis
1497         #  @param theRMajor Major ellipse radius.
1498         #  @param theRMinor Minor ellipse radius.
1499         #  @return New GEOM.GEOM_Object, containing the created ellipse.
1500         def MakeEllipseRR(self, theRMajor, theRMinor):
1501             """
1502             Create an ellipse with given radiuses.
1503             Center of the ellipse will be in the origin of global
1504             coordinate system and normal vector will be codirected with Z axis
1505
1506             Parameters:
1507                 theRMajor Major ellipse radius.
1508                 theRMinor Minor ellipse radius.
1509
1510             Returns:
1511                 New GEOM.GEOM_Object, containing the created ellipse.
1512             """
1513             anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
1514             RaiseIfFailed("MakeEllipse", self.CurvesOp)
1515             return anObj
1516
1517         ## Create a polyline on the set of points.
1518         #  @param thePoints Sequence of points for the polyline.
1519         #  @param theIsClosed If True, build a closed wire.
1520         #  @return New GEOM.GEOM_Object, containing the created polyline.
1521         #
1522         #  @ref tui_creation_curve "Example"
1523         def MakePolyline(self, thePoints, theIsClosed=False):
1524             """
1525             Create a polyline on the set of points.
1526
1527             Parameters:
1528                 thePoints Sequence of points for the polyline.
1529                 theIsClosed If True, build a closed wire.
1530
1531             Returns:
1532                 New GEOM.GEOM_Object, containing the created polyline.
1533             """
1534             # Example: see GEOM_TestAll.py
1535             anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
1536             RaiseIfFailed("MakePolyline", self.CurvesOp)
1537             return anObj
1538
1539         ## Create bezier curve on the set of points.
1540         #  @param thePoints Sequence of points for the bezier curve.
1541         #  @param theIsClosed If True, build a closed curve.
1542         #  @return New GEOM.GEOM_Object, containing the created bezier curve.
1543         #
1544         #  @ref tui_creation_curve "Example"
1545         def MakeBezier(self, thePoints, theIsClosed=False):
1546             """
1547             Create bezier curve on the set of points.
1548
1549             Parameters:
1550                 thePoints Sequence of points for the bezier curve.
1551                 theIsClosed If True, build a closed curve.
1552
1553             Returns:
1554                 New GEOM.GEOM_Object, containing the created bezier curve.
1555             """
1556             # Example: see GEOM_TestAll.py
1557             anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
1558             RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
1559             return anObj
1560
1561         ## Create B-Spline curve on the set of points.
1562         #  @param thePoints Sequence of points for the B-Spline curve.
1563         #  @param theIsClosed If True, build a closed curve.
1564         #  @param theDoReordering If TRUE, the algo does not follow the order of
1565         #                         \a thePoints but searches for the closest vertex.
1566         #  @return New GEOM.GEOM_Object, containing the created B-Spline curve.
1567         #
1568         #  @ref tui_creation_curve "Example"
1569         def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False):
1570             """
1571             Create B-Spline curve on the set of points.
1572
1573             Parameters:
1574                 thePoints Sequence of points for the B-Spline curve.
1575                 theIsClosed If True, build a closed curve.
1576                 theDoReordering If True, the algo does not follow the order of
1577                                 thePoints but searches for the closest vertex.
1578
1579             Returns:                     
1580                 New GEOM.GEOM_Object, containing the created B-Spline curve.
1581             """
1582             # Example: see GEOM_TestAll.py
1583             anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
1584             RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
1585             return anObj
1586
1587
1588         ## Creates a curve using the parametric definition of the basic points.
1589         #  @param thexExpr parametric equation of the coordinates X.
1590         #  @param theyExpr parametric equation of the coordinates Y.
1591         #  @param thezExpr parametric equation of the coordinates Z.
1592         #  @param theParamMin the minimal value of the parameter.
1593         #  @param theParamMax the maximum value of the parameter.
1594         #  @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
1595         #  @param theCurveType the type of the curve.
1596         #  @param theNewMethod flag for switching to the new method if the flag is set to false a deprecated method is used which can lead to a bug.
1597         #  @return New GEOM.GEOM_Object, containing the created curve.
1598         #
1599         #  @ref tui_creation_curve "Example"
1600         def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
1601                                 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False ):
1602             """
1603             Creates a curve using the parametric definition of the basic points.
1604
1605             Parameters:
1606                 thexExpr parametric equation of the coordinates X.
1607                 theyExpr parametric equation of the coordinates Y.
1608                 thezExpr parametric equation of the coordinates Z.
1609                 theParamMin the minimal value of the parameter.
1610                 theParamMax the maximum value of the parameter.
1611                 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
1612                 theCurveType the type of the curve.
1613                 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
1614                              method is used which can lead to a bug.
1615
1616             Returns:
1617                 New GEOM.GEOM_Object, containing the created curve.
1618             """
1619             theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
1620             if theNewMethod:
1621               anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
1622             else:
1623               anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)   
1624             RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
1625             anObj.SetParameters(Parameters)
1626             return anObj
1627             
1628
1629
1630         # end of l4_curves
1631         ## @}
1632
1633         ## @addtogroup l3_sketcher
1634         ## @{
1635
1636         ## Create a sketcher (wire or face), following the textual description,
1637         #  passed through <VAR>theCommand</VAR> argument. \n
1638         #  Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
1639         #  Format of the description string have to be the following:
1640         #
1641         #  "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
1642         #
1643         #  Where:
1644         #  - x1, y1 are coordinates of the first sketcher point (zero by default),
1645         #  - CMD is one of
1646         #     - "R angle" : Set the direction by angle
1647         #     - "D dx dy" : Set the direction by DX & DY
1648         #     .
1649         #       \n
1650         #     - "TT x y" : Create segment by point at X & Y
1651         #     - "T dx dy" : Create segment by point with DX & DY
1652         #     - "L length" : Create segment by direction & Length
1653         #     - "IX x" : Create segment by direction & Intersect. X
1654         #     - "IY y" : Create segment by direction & Intersect. Y
1655         #     .
1656         #       \n
1657         #     - "C radius length" : Create arc by direction, radius and length(in degree)
1658         #     - "AA x y": Create arc by point at X & Y
1659         #     - "A dx dy" : Create arc by point with DX & DY
1660         #     - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
1661         #     - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
1662         #     - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
1663         #     - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
1664         #     .
1665         #       \n
1666         #     - "WW" : Close Wire (to finish)
1667         #     - "WF" : Close Wire and build face (to finish)
1668         #     .
1669         #        \n
1670         #  - Flag1 (= reverse) is 0 or 2 ...
1671         #     - if 0 the drawn arc is the one of lower angle (< Pi)
1672         #     - if 2 the drawn arc ius the one of greater angle (> Pi)
1673         #     .
1674         #        \n
1675         #  - Flag2 (= control tolerance) is 0 or 1 ...
1676         #     - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
1677         #     - if 1 the wire is built only if the end point is on the arc
1678         #       with a tolerance of 10^-7 on the distance else the creation fails
1679         #
1680         #  @param theCommand String, defining the sketcher in local
1681         #                    coordinates of the working plane.
1682         #  @param theWorkingPlane Nine double values, defining origin,
1683         #                         OZ and OX directions of the working plane.
1684         #  @return New GEOM.GEOM_Object, containing the created wire.
1685         #
1686         #  @ref tui_sketcher_page "Example"
1687         def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
1688             """
1689             Create a sketcher (wire or face), following the textual description, passed
1690             through theCommand argument.
1691             Edges of the resulting wire or face will be arcs of circles and/or linear segments.
1692             Format of the description string have to be the following:
1693                 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
1694             Where:
1695             - x1, y1 are coordinates of the first sketcher point (zero by default),
1696             - CMD is one of
1697                - "R angle" : Set the direction by angle
1698                - "D dx dy" : Set the direction by DX & DY
1699                
1700                - "TT x y" : Create segment by point at X & Y
1701                - "T dx dy" : Create segment by point with DX & DY
1702                - "L length" : Create segment by direction & Length
1703                - "IX x" : Create segment by direction & Intersect. X
1704                - "IY y" : Create segment by direction & Intersect. Y
1705
1706                - "C radius length" : Create arc by direction, radius and length(in degree)
1707                - "AA x y": Create arc by point at X & Y
1708                - "A dx dy" : Create arc by point with DX & DY
1709                - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
1710                - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
1711                - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
1712                - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
1713
1714                - "WW" : Close Wire (to finish)
1715                - "WF" : Close Wire and build face (to finish)
1716             
1717             - Flag1 (= reverse) is 0 or 2 ...
1718                - if 0 the drawn arc is the one of lower angle (< Pi)
1719                - if 2 the drawn arc ius the one of greater angle (> Pi)
1720         
1721             - Flag2 (= control tolerance) is 0 or 1 ...
1722                - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
1723                - if 1 the wire is built only if the end point is on the arc
1724                  with a tolerance of 10^-7 on the distance else the creation fails
1725
1726             Parameters:
1727                 theCommand String, defining the sketcher in local
1728                            coordinates of the working plane.
1729                 theWorkingPlane Nine double values, defining origin,
1730                                 OZ and OX directions of the working plane.
1731
1732             Returns:
1733                 New GEOM.GEOM_Object, containing the created wire.
1734             """
1735             # Example: see GEOM_TestAll.py
1736             theCommand,Parameters = ParseSketcherCommand(theCommand)
1737             anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
1738             RaiseIfFailed("MakeSketcher", self.CurvesOp)
1739             anObj.SetParameters(Parameters)
1740             return anObj
1741
1742         ## Create a sketcher (wire or face), following the textual description,
1743         #  passed through <VAR>theCommand</VAR> argument. \n
1744         #  For format of the description string see MakeSketcher() method.\n
1745         #  @param theCommand String, defining the sketcher in local
1746         #                    coordinates of the working plane.
1747         #  @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1748         #  @return New GEOM.GEOM_Object, containing the created wire.
1749         #
1750         #  @ref tui_sketcher_page "Example"
1751         def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
1752             """
1753             Create a sketcher (wire or face), following the textual description,
1754             passed through theCommand argument.
1755             For format of the description string see geompy.MakeSketcher() method.
1756
1757             Parameters:
1758                 theCommand String, defining the sketcher in local
1759                            coordinates of the working plane.
1760                 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1761
1762             Returns:
1763                 New GEOM.GEOM_Object, containing the created wire.
1764             """
1765             theCommand,Parameters = ParseSketcherCommand(theCommand)
1766             anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
1767             RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
1768             anObj.SetParameters(Parameters)
1769             return anObj
1770
1771         ## Create a sketcher wire, following the numerical description,
1772         #  passed through <VAR>theCoordinates</VAR> argument. \n
1773         #  @param theCoordinates double values, defining points to create a wire,
1774         #                                                      passing from it.
1775         #  @return New GEOM.GEOM_Object, containing the created wire.
1776         #
1777         #  @ref tui_3dsketcher_page "Example"
1778         def Make3DSketcher(self, theCoordinates):
1779             """
1780             Create a sketcher wire, following the numerical description,
1781             passed through theCoordinates argument.
1782
1783             Parameters:
1784                 theCoordinates double values, defining points to create a wire,
1785                                passing from it.
1786
1787             Returns:
1788                 New GEOM_Object, containing the created wire.
1789             """
1790             theCoordinates,Parameters = ParseParameters(theCoordinates)
1791             anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
1792             RaiseIfFailed("Make3DSketcher", self.CurvesOp)
1793             anObj.SetParameters(Parameters)
1794             return anObj
1795
1796         ## Obtain a 3D sketcher interface
1797         #  @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
1798         #
1799         #  @ref tui_3dsketcher_page "Example"
1800         def Sketcher3D (self):
1801             """
1802             Obtain a 3D sketcher interface.
1803
1804             Example of usage:
1805                 sk = geompy.Sketcher3D()
1806                 sk.addPointsAbsolute(0,0,0, 70,0,0)
1807                 sk.addPointsRelative(0, 0, 130)
1808                 sk.addPointAnglesLength("OXY", 50, 0, 100)
1809                 sk.addPointAnglesLength("OXZ", 30, 80, 130)
1810                 sk.close()
1811                 a3D_Sketcher_1 = sk.wire()
1812             """
1813             sk = Sketcher3D (self)
1814             return sk
1815
1816         # end of l3_sketcher
1817         ## @}
1818
1819         ## @addtogroup l3_3d_primitives
1820         ## @{
1821
1822         ## Create a box by coordinates of two opposite vertices.
1823         #
1824         #  @param x1,y1,z1 double values, defining first point it.
1825         #  @param x2,y2,z2 double values, defining first point it.
1826         #
1827         #  @return New GEOM.GEOM_Object, containing the created box.
1828         #  @ref tui_creation_box "Example"
1829         def MakeBox (self, x1,y1,z1, x2,y2,z2):
1830             """
1831             Create a box by coordinates of two opposite vertices.
1832             
1833             Parameters:
1834                 x1,y1,z1 double values, defining first point.
1835                 x2,y2,z2 double values, defining second point.
1836                 
1837             Returns:
1838                 New GEOM.GEOM_Object, containing the created box.
1839             """
1840             # Example: see GEOM_TestAll.py
1841             pnt1 = self.MakeVertex(x1,y1,z1)
1842             pnt2 = self.MakeVertex(x2,y2,z2)
1843             return self.MakeBoxTwoPnt(pnt1,pnt2)
1844
1845         ## Create a box with specified dimensions along the coordinate axes
1846         #  and with edges, parallel to the coordinate axes.
1847         #  Center of the box will be at point (DX/2, DY/2, DZ/2).
1848         #  @param theDX Length of Box edges, parallel to OX axis.
1849         #  @param theDY Length of Box edges, parallel to OY axis.
1850         #  @param theDZ Length of Box edges, parallel to OZ axis.
1851         #  @return New GEOM.GEOM_Object, containing the created box.
1852         #
1853         #  @ref tui_creation_box "Example"
1854         def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
1855             """
1856             Create a box with specified dimensions along the coordinate axes
1857             and with edges, parallel to the coordinate axes.
1858             Center of the box will be at point (DX/2, DY/2, DZ/2).
1859
1860             Parameters:
1861                 theDX Length of Box edges, parallel to OX axis.
1862                 theDY Length of Box edges, parallel to OY axis.
1863                 theDZ Length of Box edges, parallel to OZ axis.
1864
1865             Returns:   
1866                 New GEOM.GEOM_Object, containing the created box.
1867             """
1868             # Example: see GEOM_TestAll.py
1869             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1870             anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
1871             RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
1872             anObj.SetParameters(Parameters)
1873             return anObj
1874
1875         ## Create a box with two specified opposite vertices,
1876         #  and with edges, parallel to the coordinate axes
1877         #  @param thePnt1 First of two opposite vertices.
1878         #  @param thePnt2 Second of two opposite vertices.
1879         #  @return New GEOM.GEOM_Object, containing the created box.
1880         #
1881         #  @ref tui_creation_box "Example"
1882         def MakeBoxTwoPnt(self,thePnt1, thePnt2):
1883             """
1884             Create a box with two specified opposite vertices,
1885             and with edges, parallel to the coordinate axes
1886
1887             Parameters:
1888                 thePnt1 First of two opposite vertices.
1889                 thePnt2 Second of two opposite vertices.
1890
1891             Returns:
1892                 New GEOM.GEOM_Object, containing the created box.
1893             """
1894             # Example: see GEOM_TestAll.py
1895             anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
1896             RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
1897             return anObj
1898
1899         ## Create a face with specified dimensions with edges parallel to coordinate axes.
1900         #  @param theH height of Face.
1901         #  @param theW width of Face.
1902         #  @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
1903         #  @return New GEOM.GEOM_Object, containing the created face.
1904         #
1905         #  @ref tui_creation_face "Example"
1906         def MakeFaceHW(self,theH, theW, theOrientation):
1907             """
1908             Create a face with specified dimensions with edges parallel to coordinate axes.
1909
1910             Parameters:
1911                 theH height of Face.
1912                 theW width of Face.
1913                 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
1914
1915             Returns:
1916                 New GEOM.GEOM_Object, containing the created face.
1917             """
1918             # Example: see GEOM_TestAll.py
1919             theH,theW,Parameters = ParseParameters(theH, theW)
1920             anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1921             RaiseIfFailed("MakeFaceHW", self.PrimOp)
1922             anObj.SetParameters(Parameters)
1923             return anObj
1924
1925         ## Create a face from another plane and two sizes,
1926         #  vertical size and horisontal size.
1927         #  @param theObj   Normale vector to the creating face or
1928         #  the face object.
1929         #  @param theH     Height (vertical size).
1930         #  @param theW     Width (horisontal size).
1931         #  @return New GEOM.GEOM_Object, containing the created face.
1932         #
1933         #  @ref tui_creation_face "Example"
1934         def MakeFaceObjHW(self, theObj, theH, theW):
1935             """
1936             Create a face from another plane and two sizes,
1937             vertical size and horisontal size.
1938
1939             Parameters:
1940                 theObj   Normale vector to the creating face or
1941                          the face object.
1942                 theH     Height (vertical size).
1943                 theW     Width (horisontal size).
1944
1945             Returns:
1946                 New GEOM_Object, containing the created face.
1947             """
1948             # Example: see GEOM_TestAll.py
1949             theH,theW,Parameters = ParseParameters(theH, theW)
1950             anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1951             RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1952             anObj.SetParameters(Parameters)
1953             return anObj
1954
1955         ## Create a disk with given center, normal vector and radius.
1956         #  @param thePnt Disk center.
1957         #  @param theVec Vector, normal to the plane of the disk.
1958         #  @param theR Disk radius.
1959         #  @return New GEOM.GEOM_Object, containing the created disk.
1960         #
1961         #  @ref tui_creation_disk "Example"
1962         def MakeDiskPntVecR(self,thePnt, theVec, theR):
1963             """
1964             Create a disk with given center, normal vector and radius.
1965
1966             Parameters:
1967                 thePnt Disk center.
1968                 theVec Vector, normal to the plane of the disk.
1969                 theR Disk radius.
1970
1971             Returns:    
1972                 New GEOM.GEOM_Object, containing the created disk.
1973             """
1974             # Example: see GEOM_TestAll.py
1975             theR,Parameters = ParseParameters(theR)
1976             anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1977             RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1978             anObj.SetParameters(Parameters)
1979             return anObj
1980
1981         ## Create a disk, passing through three given points
1982         #  @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1983         #  @return New GEOM.GEOM_Object, containing the created disk.
1984         #
1985         #  @ref tui_creation_disk "Example"
1986         def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1987             """
1988             Create a disk, passing through three given points
1989
1990             Parameters:
1991                 thePnt1,thePnt2,thePnt3 Points, defining the disk.
1992
1993             Returns:    
1994                 New GEOM.GEOM_Object, containing the created disk.
1995             """
1996             # Example: see GEOM_TestAll.py
1997             anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1998             RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1999             return anObj
2000
2001         ## Create a disk with specified dimensions along OX-OY coordinate axes.
2002         #  @param theR Radius of Face.
2003         #  @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2004         #  @return New GEOM.GEOM_Object, containing the created disk.
2005         #
2006         #  @ref tui_creation_face "Example"
2007         def MakeDiskR(self,theR, theOrientation):
2008             """
2009             Create a disk with specified dimensions along OX-OY coordinate axes.
2010
2011             Parameters:
2012                 theR Radius of Face.
2013                 theOrientation set the orientation belong axis OXY or OYZ or OZX
2014
2015             Returns: 
2016                 New GEOM.GEOM_Object, containing the created disk.
2017
2018             Example of usage:
2019                 Disk3 = geompy.MakeDiskR(100., 1)
2020             """
2021             # Example: see GEOM_TestAll.py
2022             theR,Parameters = ParseParameters(theR)
2023             anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2024             RaiseIfFailed("MakeDiskR", self.PrimOp)
2025             anObj.SetParameters(Parameters)
2026             return anObj
2027
2028         ## Create a cylinder with given base point, axis, radius and height.
2029         #  @param thePnt Central point of cylinder base.
2030         #  @param theAxis Cylinder axis.
2031         #  @param theR Cylinder radius.
2032         #  @param theH Cylinder height.
2033         #  @return New GEOM.GEOM_Object, containing the created cylinder.
2034         #
2035         #  @ref tui_creation_cylinder "Example"
2036         def MakeCylinder(self,thePnt, theAxis, theR, theH):
2037             """
2038             Create a cylinder with given base point, axis, radius and height.
2039
2040             Parameters:
2041                 thePnt Central point of cylinder base.
2042                 theAxis Cylinder axis.
2043                 theR Cylinder radius.
2044                 theH Cylinder height.
2045
2046             Returns: 
2047                 New GEOM.GEOM_Object, containing the created cylinder.
2048             """
2049             # Example: see GEOM_TestAll.py
2050             theR,theH,Parameters = ParseParameters(theR, theH)
2051             anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2052             RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2053             anObj.SetParameters(Parameters)
2054             return anObj
2055
2056         ## Create a cylinder with given radius and height at
2057         #  the origin of coordinate system. Axis of the cylinder
2058         #  will be collinear to the OZ axis of the coordinate system.
2059         #  @param theR Cylinder radius.
2060         #  @param theH Cylinder height.
2061         #  @return New GEOM.GEOM_Object, containing the created cylinder.
2062         #
2063         #  @ref tui_creation_cylinder "Example"
2064         def MakeCylinderRH(self,theR, theH):
2065             """
2066             Create a cylinder with given radius and height at
2067             the origin of coordinate system. Axis of the cylinder
2068             will be collinear to the OZ axis of the coordinate system.
2069
2070             Parameters:
2071                 theR Cylinder radius.
2072                 theH Cylinder height.
2073
2074             Returns:    
2075                 New GEOM.GEOM_Object, containing the created cylinder.
2076             """
2077             # Example: see GEOM_TestAll.py
2078             theR,theH,Parameters = ParseParameters(theR, theH)
2079             anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2080             RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2081             anObj.SetParameters(Parameters)
2082             return anObj
2083
2084         ## Create a sphere with given center and radius.
2085         #  @param thePnt Sphere center.
2086         #  @param theR Sphere radius.
2087         #  @return New GEOM.GEOM_Object, containing the created sphere.
2088         #
2089         #  @ref tui_creation_sphere "Example"
2090         def MakeSpherePntR(self, thePnt, theR):
2091             """
2092             Create a sphere with given center and radius.
2093
2094             Parameters:
2095                 thePnt Sphere center.
2096                 theR Sphere radius.
2097
2098             Returns:    
2099                 New GEOM.GEOM_Object, containing the created sphere.            
2100             """
2101             # Example: see GEOM_TestAll.py
2102             theR,Parameters = ParseParameters(theR)
2103             anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2104             RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2105             anObj.SetParameters(Parameters)
2106             return anObj
2107
2108         ## Create a sphere with given center and radius.
2109         #  @param x,y,z Coordinates of sphere center.
2110         #  @param theR Sphere radius.
2111         #  @return New GEOM.GEOM_Object, containing the created sphere.
2112         #
2113         #  @ref tui_creation_sphere "Example"
2114         def MakeSphere(self, x, y, z, theR):
2115             """
2116             Create a sphere with given center and radius.
2117
2118             Parameters: 
2119                 x,y,z Coordinates of sphere center.
2120                 theR Sphere radius.
2121
2122             Returns:
2123                 New GEOM.GEOM_Object, containing the created sphere.
2124             """
2125             # Example: see GEOM_TestAll.py
2126             point = self.MakeVertex(x, y, z)
2127             anObj = self.MakeSpherePntR(point, theR)
2128             return anObj
2129
2130         ## Create a sphere with given radius at the origin of coordinate system.
2131         #  @param theR Sphere radius.
2132         #  @return New GEOM.GEOM_Object, containing the created sphere.
2133         #
2134         #  @ref tui_creation_sphere "Example"
2135         def MakeSphereR(self, theR):
2136             """
2137             Create a sphere with given radius at the origin of coordinate system.
2138
2139             Parameters: 
2140                 theR Sphere radius.
2141
2142             Returns:
2143                 New GEOM.GEOM_Object, containing the created sphere.            
2144             """
2145             # Example: see GEOM_TestAll.py
2146             theR,Parameters = ParseParameters(theR)
2147             anObj = self.PrimOp.MakeSphereR(theR)
2148             RaiseIfFailed("MakeSphereR", self.PrimOp)
2149             anObj.SetParameters(Parameters)
2150             return anObj
2151
2152         ## Create a cone with given base point, axis, height and radiuses.
2153         #  @param thePnt Central point of the first cone base.
2154         #  @param theAxis Cone axis.
2155         #  @param theR1 Radius of the first cone base.
2156         #  @param theR2 Radius of the second cone base.
2157         #    \note If both radiuses are non-zero, the cone will be truncated.
2158         #    \note If the radiuses are equal, a cylinder will be created instead.
2159         #  @param theH Cone height.
2160         #  @return New GEOM.GEOM_Object, containing the created cone.
2161         #
2162         #  @ref tui_creation_cone "Example"
2163         def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
2164             """
2165             Create a cone with given base point, axis, height and radiuses.
2166
2167             Parameters: 
2168                 thePnt Central point of the first cone base.
2169                 theAxis Cone axis.
2170                 theR1 Radius of the first cone base.
2171                 theR2 Radius of the second cone base.
2172                 theH Cone height.
2173
2174             Note:
2175                 If both radiuses are non-zero, the cone will be truncated.
2176                 If the radiuses are equal, a cylinder will be created instead.
2177
2178             Returns:
2179                 New GEOM.GEOM_Object, containing the created cone.
2180             """
2181             # Example: see GEOM_TestAll.py
2182             theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2183             anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
2184             RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
2185             anObj.SetParameters(Parameters)
2186             return anObj
2187
2188         ## Create a cone with given height and radiuses at
2189         #  the origin of coordinate system. Axis of the cone will
2190         #  be collinear to the OZ axis of the coordinate system.
2191         #  @param theR1 Radius of the first cone base.
2192         #  @param theR2 Radius of the second cone base.
2193         #    \note If both radiuses are non-zero, the cone will be truncated.
2194         #    \note If the radiuses are equal, a cylinder will be created instead.
2195         #  @param theH Cone height.
2196         #  @return New GEOM.GEOM_Object, containing the created cone.
2197         #
2198         #  @ref tui_creation_cone "Example"
2199         def MakeConeR1R2H(self,theR1, theR2, theH):
2200             """
2201             Create a cone with given height and radiuses at
2202             the origin of coordinate system. Axis of the cone will
2203             be collinear to the OZ axis of the coordinate system.
2204
2205             Parameters: 
2206                 theR1 Radius of the first cone base.
2207                 theR2 Radius of the second cone base.
2208                 theH Cone height.
2209
2210             Note:
2211                 If both radiuses are non-zero, the cone will be truncated.
2212                 If the radiuses are equal, a cylinder will be created instead.
2213
2214             Returns:
2215                 New GEOM.GEOM_Object, containing the created cone.
2216             """
2217             # Example: see GEOM_TestAll.py
2218             theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2219             anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
2220             RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
2221             anObj.SetParameters(Parameters)
2222             return anObj
2223
2224         ## Create a torus with given center, normal vector and radiuses.
2225         #  @param thePnt Torus central point.
2226         #  @param theVec Torus axis of symmetry.
2227         #  @param theRMajor Torus major radius.
2228         #  @param theRMinor Torus minor radius.
2229         #  @return New GEOM.GEOM_Object, containing the created torus.
2230         #
2231         #  @ref tui_creation_torus "Example"
2232         def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
2233             """
2234             Create a torus with given center, normal vector and radiuses.
2235
2236             Parameters: 
2237                 thePnt Torus central point.
2238                 theVec Torus axis of symmetry.
2239                 theRMajor Torus major radius.
2240                 theRMinor Torus minor radius.
2241
2242            Returns:
2243                 New GEOM.GEOM_Object, containing the created torus.
2244             """
2245             # Example: see GEOM_TestAll.py
2246             theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
2247             anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
2248             RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
2249             anObj.SetParameters(Parameters)
2250             return anObj
2251
2252         ## Create a torus with given radiuses at the origin of coordinate system.
2253         #  @param theRMajor Torus major radius.
2254         #  @param theRMinor Torus minor radius.
2255         #  @return New GEOM.GEOM_Object, containing the created torus.
2256         #
2257         #  @ref tui_creation_torus "Example"
2258         def MakeTorusRR(self, theRMajor, theRMinor):
2259             """
2260            Create a torus with given radiuses at the origin of coordinate system.
2261
2262            Parameters: 
2263                 theRMajor Torus major radius.
2264                 theRMinor Torus minor radius.
2265
2266            Returns:
2267                 New GEOM.GEOM_Object, containing the created torus.            
2268             """
2269             # Example: see GEOM_TestAll.py
2270             theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
2271             anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
2272             RaiseIfFailed("MakeTorusRR", self.PrimOp)
2273             anObj.SetParameters(Parameters)
2274             return anObj
2275
2276         # end of l3_3d_primitives
2277         ## @}
2278
2279         ## @addtogroup l3_complex
2280         ## @{
2281
2282         ## Create a shape by extrusion of the base shape along a vector, defined by two points.
2283         #  @param theBase Base shape to be extruded.
2284         #  @param thePoint1 First end of extrusion vector.
2285         #  @param thePoint2 Second end of extrusion vector.
2286         #  @param theScaleFactor Use it to make prism with scaled second base.
2287         #                        Nagative value means not scaled second base.
2288         #  @return New GEOM.GEOM_Object, containing the created prism.
2289         #
2290         #  @ref tui_creation_prism "Example"
2291         def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0):
2292             """
2293             Create a shape by extrusion of the base shape along a vector, defined by two points.
2294
2295             Parameters: 
2296                 theBase Base shape to be extruded.
2297                 thePoint1 First end of extrusion vector.
2298                 thePoint2 Second end of extrusion vector.
2299                 theScaleFactor Use it to make prism with scaled second base.
2300                                Nagative value means not scaled second base.
2301
2302             Returns:
2303                 New GEOM.GEOM_Object, containing the created prism.
2304             """
2305             # Example: see GEOM_TestAll.py
2306             anObj = None
2307             Parameters = ""
2308             if theScaleFactor > 0:
2309                 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
2310                 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
2311             else:
2312                 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
2313             RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
2314             anObj.SetParameters(Parameters)
2315             return anObj
2316
2317         ## Create a shape by extrusion of the base shape along a
2318         #  vector, defined by two points, in 2 Ways (forward/backward).
2319         #  @param theBase Base shape to be extruded.
2320         #  @param thePoint1 First end of extrusion vector.
2321         #  @param thePoint2 Second end of extrusion vector.
2322         #  @return New GEOM.GEOM_Object, containing the created prism.
2323         #
2324         #  @ref tui_creation_prism "Example"
2325         def MakePrism2Ways(self, theBase, thePoint1, thePoint2):
2326             """
2327             Create a shape by extrusion of the base shape along a
2328             vector, defined by two points, in 2 Ways (forward/backward).
2329
2330             Parameters: 
2331                 theBase Base shape to be extruded.
2332                 thePoint1 First end of extrusion vector.
2333                 thePoint2 Second end of extrusion vector.
2334
2335             Returns:
2336                 New GEOM.GEOM_Object, containing the created prism.
2337             """
2338             # Example: see GEOM_TestAll.py
2339             anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
2340             RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
2341             return anObj
2342
2343         ## Create a shape by extrusion of the base shape along the vector,
2344         #  i.e. all the space, transfixed by the base shape during its translation
2345         #  along the vector on the given distance.
2346         #  @param theBase Base shape to be extruded.
2347         #  @param theVec Direction of extrusion.
2348         #  @param theH Prism dimension along theVec.
2349         #  @param theScaleFactor Use it to make prism with scaled second base.
2350         #                        Negative value means not scaled second base.
2351         #  @return New GEOM.GEOM_Object, containing the created prism.
2352         #
2353         #  @ref tui_creation_prism "Example"
2354         def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0):
2355             """
2356             Create a shape by extrusion of the base shape along the vector,
2357             i.e. all the space, transfixed by the base shape during its translation
2358             along the vector on the given distance.
2359
2360             Parameters: 
2361                 theBase Base shape to be extruded.
2362                 theVec Direction of extrusion.
2363                 theH Prism dimension along theVec.
2364                 theScaleFactor Use it to make prism with scaled second base.
2365                                Negative value means not scaled second base.
2366
2367             Returns:
2368                 New GEOM.GEOM_Object, containing the created prism.
2369             """
2370             # Example: see GEOM_TestAll.py
2371             anObj = None
2372             Parameters = ""
2373             if theScaleFactor > 0:
2374                 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
2375                 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
2376             else:
2377                 theH,Parameters = ParseParameters(theH)
2378                 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
2379             RaiseIfFailed("MakePrismVecH", self.PrimOp)
2380             anObj.SetParameters(Parameters)
2381             return anObj
2382
2383         ## Create a shape by extrusion of the base shape along the vector,
2384         #  i.e. all the space, transfixed by the base shape during its translation
2385         #  along the vector on the given distance in 2 Ways (forward/backward).
2386         #  @param theBase Base shape to be extruded.
2387         #  @param theVec Direction of extrusion.
2388         #  @param theH Prism dimension along theVec in forward direction.
2389         #  @return New GEOM.GEOM_Object, containing the created prism.
2390         #
2391         #  @ref tui_creation_prism "Example"
2392         def MakePrismVecH2Ways(self, theBase, theVec, theH):
2393             """
2394             Create a shape by extrusion of the base shape along the vector,
2395             i.e. all the space, transfixed by the base shape during its translation
2396             along the vector on the given distance in 2 Ways (forward/backward).
2397
2398             Parameters:
2399                 theBase Base shape to be extruded.
2400                 theVec Direction of extrusion.
2401                 theH Prism dimension along theVec in forward direction.
2402
2403             Returns:
2404                 New GEOM.GEOM_Object, containing the created prism.
2405             """
2406             # Example: see GEOM_TestAll.py
2407             theH,Parameters = ParseParameters(theH)
2408             anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
2409             RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
2410             anObj.SetParameters(Parameters)
2411             return anObj
2412
2413         ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
2414         #  @param theBase Base shape to be extruded.
2415         #  @param theDX, theDY, theDZ Directions of extrusion.
2416         #  @param theScaleFactor Use it to make prism with scaled second base.
2417         #                        Nagative value means not scaled second base.
2418         #  @return New GEOM.GEOM_Object, containing the created prism.
2419         #
2420         #  @ref tui_creation_prism "Example"
2421         def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0):
2422             """
2423             Create a shape by extrusion of the base shape along the dx, dy, dz direction
2424
2425             Parameters:
2426                 theBase Base shape to be extruded.
2427                 theDX, theDY, theDZ Directions of extrusion.
2428                 theScaleFactor Use it to make prism with scaled second base.
2429                                Nagative value means not scaled second base.
2430
2431             Returns: 
2432                 New GEOM.GEOM_Object, containing the created prism.
2433             """
2434             # Example: see GEOM_TestAll.py
2435             anObj = None
2436             Parameters = ""
2437             if theScaleFactor > 0:
2438                 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
2439                 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
2440             else:
2441                 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2442                 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
2443             RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
2444             anObj.SetParameters(Parameters)
2445             return anObj
2446
2447         ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
2448         #  i.e. all the space, transfixed by the base shape during its translation
2449         #  along the vector on the given distance in 2 Ways (forward/backward).
2450         #  @param theBase Base shape to be extruded.
2451         #  @param theDX, theDY, theDZ Directions of extrusion.
2452         #  @return New GEOM.GEOM_Object, containing the created prism.
2453         #
2454         #  @ref tui_creation_prism "Example"
2455         def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
2456             """
2457             Create a shape by extrusion of the base shape along the dx, dy, dz direction
2458             i.e. all the space, transfixed by the base shape during its translation
2459             along the vector on the given distance in 2 Ways (forward/backward).
2460
2461             Parameters:
2462                 theBase Base shape to be extruded.
2463                 theDX, theDY, theDZ Directions of extrusion.
2464
2465             Returns:
2466                 New GEOM.GEOM_Object, containing the created prism.
2467             """
2468             # Example: see GEOM_TestAll.py
2469             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2470             anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
2471             RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
2472             anObj.SetParameters(Parameters)
2473             return anObj
2474
2475         ## Create a shape by revolution of the base shape around the axis
2476         #  on the given angle, i.e. all the space, transfixed by the base
2477         #  shape during its rotation around the axis on the given angle.
2478         #  @param theBase Base shape to be rotated.
2479         #  @param theAxis Rotation axis.
2480         #  @param theAngle Rotation angle in radians.
2481         #  @return New GEOM.GEOM_Object, containing the created revolution.
2482         #
2483         #  @ref tui_creation_revolution "Example"
2484         def MakeRevolution(self, theBase, theAxis, theAngle):
2485             """
2486             Create a shape by revolution of the base shape around the axis
2487             on the given angle, i.e. all the space, transfixed by the base
2488             shape during its rotation around the axis on the given angle.
2489
2490             Parameters:
2491                 theBase Base shape to be rotated.
2492                 theAxis Rotation axis.
2493                 theAngle Rotation angle in radians.
2494
2495             Returns: 
2496                 New GEOM.GEOM_Object, containing the created revolution.
2497             """
2498             # Example: see GEOM_TestAll.py
2499             theAngle,Parameters = ParseParameters(theAngle)
2500             anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
2501             RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
2502             anObj.SetParameters(Parameters)
2503             return anObj
2504
2505         ## Create a shape by revolution of the base shape around the axis
2506         #  on the given angle, i.e. all the space, transfixed by the base
2507         #  shape during its rotation around the axis on the given angle in
2508         #  both directions (forward/backward)
2509         #  @param theBase Base shape to be rotated.
2510         #  @param theAxis Rotation axis.
2511         #  @param theAngle Rotation angle in radians.
2512         #  @return New GEOM.GEOM_Object, containing the created revolution.
2513         #
2514         #  @ref tui_creation_revolution "Example"
2515         def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
2516             """
2517             Create a shape by revolution of the base shape around the axis
2518             on the given angle, i.e. all the space, transfixed by the base
2519             shape during its rotation around the axis on the given angle in
2520             both directions (forward/backward).
2521
2522             Parameters:
2523                 theBase Base shape to be rotated.
2524                 theAxis Rotation axis.
2525                 theAngle Rotation angle in radians.
2526
2527             Returns: 
2528                 New GEOM.GEOM_Object, containing the created revolution.
2529             """
2530             theAngle,Parameters = ParseParameters(theAngle)
2531             anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
2532             RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
2533             anObj.SetParameters(Parameters)
2534             return anObj
2535
2536         ## Create a filling from the given compound of contours.
2537         #  @param theShape the compound of contours
2538         #  @param theMinDeg a minimal degree of BSpline surface to create
2539         #  @param theMaxDeg a maximal degree of BSpline surface to create
2540         #  @param theTol2D a 2d tolerance to be reached
2541         #  @param theTol3D a 3d tolerance to be reached
2542         #  @param theNbIter a number of iteration of approximation algorithm
2543         #  @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
2544         #  @param isApprox if True, BSpline curves are generated in the process
2545         #                  of surface construction. By default it is False, that means
2546         #                  the surface is created using given curves. The usage of
2547         #                  Approximation makes the algorithm work slower, but allows
2548         #                  building the surface for rather complex cases.
2549         #  @return New GEOM.GEOM_Object, containing the created filling surface.
2550         #
2551         #  @ref tui_creation_filling "Example"
2552         def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
2553                         theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0):
2554             """
2555             Create a filling from the given compound of contours.
2556
2557             Parameters:
2558                 theShape the compound of contours
2559                 theMinDeg a minimal degree of BSpline surface to create
2560                 theMaxDeg a maximal degree of BSpline surface to create
2561                 theTol2D a 2d tolerance to be reached
2562                 theTol3D a 3d tolerance to be reached
2563                 theNbIter a number of iteration of approximation algorithm
2564                 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
2565                 isApprox if True, BSpline curves are generated in the process
2566                          of surface construction. By default it is False, that means
2567                          the surface is created using given curves. The usage of
2568                          Approximation makes the algorithm work slower, but allows
2569                          building the surface for rather complex cases
2570
2571             Returns: 
2572                 New GEOM.GEOM_Object, containing the created filling surface.
2573
2574             Example of usage:
2575                 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
2576             """
2577             # Example: see GEOM_TestAll.py
2578             theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
2579             anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
2580                                             theTol2D, theTol3D, theNbIter,
2581                                             theMethod, isApprox)
2582             RaiseIfFailed("MakeFilling", self.PrimOp)
2583             anObj.SetParameters(Parameters)
2584             return anObj
2585
2586
2587         ## Create a filling from the given compound of contours.
2588         #  This method corresponds to MakeFilling with isApprox=True
2589         #  @param theShape the compound of contours
2590         #  @param theMinDeg a minimal degree of BSpline surface to create
2591         #  @param theMaxDeg a maximal degree of BSpline surface to create
2592         #  @param theTol3D a 3d tolerance to be reached
2593         #  @return New GEOM.GEOM_Object, containing the created filling surface.
2594         #
2595         #  @ref tui_creation_filling "Example"
2596         def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001):
2597             """
2598             Create a filling from the given compound of contours.
2599             This method corresponds to MakeFilling with isApprox=True
2600
2601             Parameters:
2602                 theShape the compound of contours
2603                 theMinDeg a minimal degree of BSpline surface to create
2604                 theMaxDeg a maximal degree of BSpline surface to create
2605                 theTol3D a 3d tolerance to be reached
2606
2607             Returns: 
2608                 New GEOM.GEOM_Object, containing the created filling surface.
2609
2610             Example of usage:
2611                 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
2612             """
2613             # Example: see GEOM_TestAll.py
2614             theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
2615             anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
2616                                             0, theTol3D, 0, GEOM.FOM_Default, True)
2617             RaiseIfFailed("MakeFillingNew", self.PrimOp)
2618             anObj.SetParameters(Parameters)
2619             return anObj
2620
2621         ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
2622         #  @param theSeqSections - set of specified sections.
2623         #  @param theModeSolid - mode defining building solid or shell
2624         #  @param thePreci - precision 3D used for smoothing
2625         #  @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
2626         #  @return New GEOM.GEOM_Object, containing the created shell or solid.
2627         #
2628         #  @ref swig_todo "Example"
2629         def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
2630             """
2631             Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
2632
2633             Parameters:
2634                 theSeqSections - set of specified sections.
2635                 theModeSolid - mode defining building solid or shell
2636                 thePreci - precision 3D used for smoothing
2637                 theRuled - mode defining type of the result surfaces (ruled or smoothed).
2638
2639             Returns:
2640                 New GEOM.GEOM_Object, containing the created shell or solid.
2641             """
2642             # Example: see GEOM_TestAll.py
2643             anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
2644             RaiseIfFailed("MakeThruSections", self.PrimOp)
2645             return anObj
2646
2647         ## Create a shape by extrusion of the base shape along
2648         #  the path shape. The path shape can be a wire or an edge.
2649         #  @param theBase Base shape to be extruded.
2650         #  @param thePath Path shape to extrude the base shape along it.
2651         #  @return New GEOM.GEOM_Object, containing the created pipe.
2652         #
2653         #  @ref tui_creation_pipe "Example"
2654         def MakePipe(self,theBase, thePath):
2655             """
2656             Create a shape by extrusion of the base shape along
2657             the path shape. The path shape can be a wire or an edge.
2658
2659             Parameters:
2660                 theBase Base shape to be extruded.
2661                 thePath Path shape to extrude the base shape along it.
2662
2663             Returns:
2664                 New GEOM.GEOM_Object, containing the created pipe.
2665             """
2666             # Example: see GEOM_TestAll.py
2667             anObj = self.PrimOp.MakePipe(theBase, thePath)
2668             RaiseIfFailed("MakePipe", self.PrimOp)
2669             return anObj
2670
2671         ## Create a shape by extrusion of the profile shape along
2672         #  the path shape. The path shape can be a wire or an edge.
2673         #  the several profiles can be specified in the several locations of path.
2674         #  @param theSeqBases - list of  Bases shape to be extruded.
2675         #  @param theLocations - list of locations on the path corresponding
2676         #                        specified list of the Bases shapes. Number of locations
2677         #                        should be equal to number of bases or list of locations can be empty.
2678         #  @param thePath - Path shape to extrude the base shape along it.
2679         #  @param theWithContact - the mode defining that the section is translated to be in
2680         #                          contact with the spine.
2681         #  @param theWithCorrection - defining that the section is rotated to be
2682         #                             orthogonal to the spine tangent in the correspondent point
2683         #  @return New GEOM.GEOM_Object, containing the created pipe.
2684         #
2685         #  @ref tui_creation_pipe_with_diff_sec "Example"
2686         def MakePipeWithDifferentSections(self, theSeqBases,
2687                                           theLocations, thePath,
2688                                           theWithContact, theWithCorrection):
2689             """
2690             Create a shape by extrusion of the profile shape along
2691             the path shape. The path shape can be a wire or an edge.
2692             the several profiles can be specified in the several locations of path.
2693
2694             Parameters:
2695                 theSeqBases - list of  Bases shape to be extruded.
2696                 theLocations - list of locations on the path corresponding
2697                                specified list of the Bases shapes. Number of locations
2698                                should be equal to number of bases or list of locations can be empty.
2699                 thePath - Path shape to extrude the base shape along it.
2700                 theWithContact - the mode defining that the section is translated to be in
2701                                  contact with the spine(0/1)
2702                 theWithCorrection - defining that the section is rotated to be
2703                                     orthogonal to the spine tangent in the correspondent point (0/1)
2704
2705             Returns:
2706                 New GEOM.GEOM_Object, containing the created pipe.
2707             """
2708             anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
2709                                                               theLocations, thePath,
2710                                                               theWithContact, theWithCorrection)
2711             RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
2712             return anObj
2713
2714         ## Create a shape by extrusion of the profile shape along
2715         #  the path shape. The path shape can be a wire or a edge.
2716         #  the several profiles can be specified in the several locations of path.
2717         #  @param theSeqBases - list of  Bases shape to be extruded. Base shape must be
2718         #                       shell or face. If number of faces in neighbour sections
2719         #                       aren't coincided result solid between such sections will
2720         #                       be created using external boundaries of this shells.
2721         #  @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
2722         #                          This list is used for searching correspondences between
2723         #                          faces in the sections. Size of this list must be equal
2724         #                          to size of list of base shapes.
2725         #  @param theLocations - list of locations on the path corresponding
2726         #                        specified list of the Bases shapes. Number of locations
2727         #                        should be equal to number of bases. First and last
2728         #                        locations must be coincided with first and last vertexes
2729         #                        of path correspondingly.
2730         #  @param thePath - Path shape to extrude the base shape along it.
2731         #  @param theWithContact - the mode defining that the section is translated to be in
2732         #                          contact with the spine.
2733         #  @param theWithCorrection - defining that the section is rotated to be
2734         #                             orthogonal to the spine tangent in the correspondent point
2735         #  @return New GEOM.GEOM_Object, containing the created solids.
2736         #
2737         #  @ref tui_creation_pipe_with_shell_sec "Example"
2738         def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
2739                                       theLocations, thePath,
2740                                       theWithContact, theWithCorrection):
2741             """
2742             Create a shape by extrusion of the profile shape along
2743             the path shape. The path shape can be a wire or a edge.
2744             the several profiles can be specified in the several locations of path.
2745
2746             Parameters:
2747                 theSeqBases - list of  Bases shape to be extruded. Base shape must be
2748                               shell or face. If number of faces in neighbour sections
2749                               aren't coincided result solid between such sections will
2750                               be created using external boundaries of this shells.
2751                 theSeqSubBases - list of corresponding sub-shapes of section shapes.
2752                                  This list is used for searching correspondences between
2753                                  faces in the sections. Size of this list must be equal
2754                                  to size of list of base shapes.
2755                 theLocations - list of locations on the path corresponding
2756                                specified list of the Bases shapes. Number of locations
2757                                should be equal to number of bases. First and last
2758                                locations must be coincided with first and last vertexes
2759                                of path correspondingly.
2760                 thePath - Path shape to extrude the base shape along it.
2761                 theWithContact - the mode defining that the section is translated to be in
2762                                  contact with the spine (0/1)
2763                 theWithCorrection - defining that the section is rotated to be
2764                                     orthogonal to the spine tangent in the correspondent point (0/1)
2765
2766             Returns:                           
2767                 New GEOM.GEOM_Object, containing the created solids.
2768             """
2769             anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
2770                                                           theLocations, thePath,
2771                                                           theWithContact, theWithCorrection)
2772             RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
2773             return anObj
2774
2775         ## Create a shape by extrusion of the profile shape along
2776         #  the path shape. This function is used only for debug pipe
2777         #  functionality - it is a version of function MakePipeWithShellSections()
2778         #  which give a possibility to recieve information about
2779         #  creating pipe between each pair of sections step by step.
2780         def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
2781                                              theLocations, thePath,
2782                                              theWithContact, theWithCorrection):
2783             """
2784             Create a shape by extrusion of the profile shape along
2785             the path shape. This function is used only for debug pipe
2786             functionality - it is a version of previous function
2787             geompy.MakePipeWithShellSections() which give a possibility to
2788             recieve information about creating pipe between each pair of
2789             sections step by step.
2790             """
2791             res = []
2792             nbsect = len(theSeqBases)
2793             nbsubsect = len(theSeqSubBases)
2794             #print "nbsect = ",nbsect
2795             for i in range(1,nbsect):
2796                 #print "  i = ",i
2797                 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
2798                 tmpLocations = [ theLocations[i-1], theLocations[i] ]
2799                 tmpSeqSubBases = []
2800                 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
2801                 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
2802                                                               tmpLocations, thePath,
2803                                                               theWithContact, theWithCorrection)
2804                 if self.PrimOp.IsDone() == 0:
2805                     print "Problems with pipe creation between ",i," and ",i+1," sections"
2806                     RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
2807                     break
2808                 else:
2809                     print "Pipe between ",i," and ",i+1," sections is OK"
2810                     res.append(anObj)
2811                     pass
2812                 pass
2813
2814             resc = self.MakeCompound(res)
2815             #resc = self.MakeSewing(res, 0.001)
2816             #print "resc: ",resc
2817             return resc
2818
2819         ## Create solids between given sections
2820         #  @param theSeqBases - list of sections (shell or face).
2821         #  @param theLocations - list of corresponding vertexes
2822         #  @return New GEOM.GEOM_Object, containing the created solids.
2823         #
2824         #  @ref tui_creation_pipe_without_path "Example"
2825         def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
2826             """
2827             Create solids between given sections
2828
2829             Parameters:
2830                 theSeqBases - list of sections (shell or face).
2831                 theLocations - list of corresponding vertexes
2832
2833             Returns:
2834                 New GEOM.GEOM_Object, containing the created solids.
2835             """
2836             anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
2837             RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
2838             return anObj
2839
2840         ## Create a shape by extrusion of the base shape along
2841         #  the path shape with constant bi-normal direction along the given vector.
2842         #  The path shape can be a wire or an edge.
2843         #  @param theBase Base shape to be extruded.
2844         #  @param thePath Path shape to extrude the base shape along it.
2845         #  @param theVec Vector defines a constant binormal direction to keep the
2846         #                same angle beetween the direction and the sections
2847         #                along the sweep surface.
2848         #  @return New GEOM.GEOM_Object, containing the created pipe.
2849         #
2850         #  @ref tui_creation_pipe "Example"
2851         def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
2852             """
2853             Create a shape by extrusion of the base shape along
2854             the path shape with constant bi-normal direction along the given vector.
2855             The path shape can be a wire or an edge.
2856
2857             Parameters:
2858                 theBase Base shape to be extruded.
2859                 thePath Path shape to extrude the base shape along it.
2860                 theVec Vector defines a constant binormal direction to keep the
2861                        same angle beetween the direction and the sections
2862                        along the sweep surface.
2863
2864             Returns:              
2865                 New GEOM.GEOM_Object, containing the created pipe.
2866             """
2867             # Example: see GEOM_TestAll.py
2868             anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
2869             RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
2870             return anObj
2871
2872         ## Build a middle path of a pipe-like shape.
2873         #  The path shape can be a wire or an edge.
2874         #  @param theShape It can be closed or unclosed pipe-like shell
2875         #                  or a pipe-like solid.
2876         #  @param theBase1, theBase2 Two bases of the supposed pipe. This
2877         #                            should be wires or faces of theShape.
2878         #  @note It is not assumed that exact or approximate copy of theShape
2879         #        can be obtained by applying existing Pipe operation on the
2880         #        resulting "Path" wire taking theBase1 as the base - it is not
2881         #        always possible; though in some particular cases it might work
2882         #        it is not guaranteed. Thus, RestorePath function should not be
2883         #        considered as an exact reverse operation of the Pipe.
2884         #  @return New GEOM.GEOM_Object, containing an edge or wire that represent
2885         #                                source pipe's "path".
2886         #
2887         #  @ref tui_creation_pipe_path "Example"
2888         def RestorePath (self, theShape, theBase1, theBase2):
2889             """
2890             Build a middle path of a pipe-like shape.
2891             The path shape can be a wire or an edge.
2892
2893             Parameters:
2894                 theShape It can be closed or unclosed pipe-like shell
2895                          or a pipe-like solid.
2896                 theBase1, theBase2 Two bases of the supposed pipe. This
2897                                    should be wires or faces of theShape.
2898
2899             Returns:
2900                 New GEOM_Object, containing an edge or wire that represent
2901                                  source pipe's path.
2902             """
2903             anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
2904             RaiseIfFailed("RestorePath", self.PrimOp)
2905             return anObj
2906
2907         ## Build a middle path of a pipe-like shape.
2908         #  The path shape can be a wire or an edge.
2909         #  @param theShape It can be closed or unclosed pipe-like shell
2910         #                  or a pipe-like solid.
2911         #  @param listEdges1, listEdges2 Two bases of the supposed pipe. This
2912         #                                should be lists of edges of theShape.
2913         #  @note It is not assumed that exact or approximate copy of theShape
2914         #        can be obtained by applying existing Pipe operation on the
2915         #        resulting "Path" wire taking theBase1 as the base - it is not
2916         #        always possible; though in some particular cases it might work
2917         #        it is not guaranteed. Thus, RestorePath function should not be
2918         #        considered as an exact reverse operation of the Pipe.
2919         #  @return New GEOM.GEOM_Object, containing an edge or wire that represent
2920         #                                source pipe's "path".
2921         #
2922         #  @ref tui_creation_pipe_path "Example"
2923         def RestorePathEdges (self, theShape, listEdges1, listEdges2):
2924             """
2925             Build a middle path of a pipe-like shape.
2926             The path shape can be a wire or an edge.
2927
2928             Parameters:
2929                 theShape It can be closed or unclosed pipe-like shell
2930                          or a pipe-like solid.
2931                 listEdges1, listEdges2 Two bases of the supposed pipe. This
2932                                        should be lists of edges of theShape.
2933
2934             Returns:
2935                 New GEOM_Object, containing an edge or wire that represent
2936                                  source pipe's path.
2937             """
2938             anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
2939             RaiseIfFailed("RestorePath", self.PrimOp)
2940             return anObj
2941
2942         # end of l3_complex
2943         ## @}
2944
2945         ## @addtogroup l3_advanced
2946         ## @{
2947
2948         ## Create a linear edge with specified ends.
2949         #  @param thePnt1 Point for the first end of edge.
2950         #  @param thePnt2 Point for the second end of edge.
2951         #  @return New GEOM.GEOM_Object, containing the created edge.
2952         #
2953         #  @ref tui_creation_edge "Example"
2954         def MakeEdge(self,thePnt1, thePnt2):
2955             """
2956             Create a linear edge with specified ends.
2957
2958             Parameters:
2959                 thePnt1 Point for the first end of edge.
2960                 thePnt2 Point for the second end of edge.
2961
2962             Returns:           
2963                 New GEOM.GEOM_Object, containing the created edge.
2964             """
2965             # Example: see GEOM_TestAll.py
2966             anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
2967             RaiseIfFailed("MakeEdge", self.ShapesOp)
2968             return anObj
2969
2970         ## Create a new edge, corresponding to the given length on the given curve.
2971         #  @param theRefCurve The referenced curve (edge).
2972         #  @param theLength Length on the referenced curve. It can be negative.
2973         #  @param theStartPoint Any point can be selected for it, the new edge will begin
2974         #                       at the end of \a theRefCurve, close to the selected point.
2975         #                       If None, start from the first point of \a theRefCurve.
2976         #  @return New GEOM.GEOM_Object, containing the created edge.
2977         #
2978         #  @ref tui_creation_edge "Example"
2979         def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
2980             """
2981             Create a new edge, corresponding to the given length on the given curve.
2982
2983             Parameters:
2984                 theRefCurve The referenced curve (edge).
2985                 theLength Length on the referenced curve. It can be negative.
2986                 theStartPoint Any point can be selected for it, the new edge will begin
2987                               at the end of theRefCurve, close to the selected point.
2988                               If None, start from the first point of theRefCurve.
2989
2990             Returns:              
2991                 New GEOM.GEOM_Object, containing the created edge.
2992             """
2993             # Example: see GEOM_TestAll.py
2994             theLength, Parameters = ParseParameters(theLength)
2995             anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
2996             RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
2997             anObj.SetParameters(Parameters)
2998             return anObj
2999
3000         ## Create an edge from specified wire.
3001         #  @param theWire source Wire
3002         #  @param theLinearTolerance linear tolerance value (default = 1e-07)
3003         #  @param theAngularTolerance angular tolerance value (default = 1e-12)
3004         #  @return New GEOM.GEOM_Object, containing the created edge.
3005         #
3006         #  @ref tui_creation_edge "Example"
3007         def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12):
3008             """
3009             Create an edge from specified wire.
3010
3011             Parameters:
3012                 theWire source Wire
3013                 theLinearTolerance linear tolerance value (default = 1e-07)
3014                 theAngularTolerance angular tolerance value (default = 1e-12)
3015
3016             Returns:
3017                 New GEOM.GEOM_Object, containing the created edge.
3018             """
3019             # Example: see GEOM_TestAll.py
3020             anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
3021             RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
3022             return anObj
3023
3024         ## Create a wire from the set of edges and wires.
3025         #  @param theEdgesAndWires List of edges and/or wires.
3026         #  @param theTolerance Maximum distance between vertices, that will be merged.
3027         #                      Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
3028         #  @return New GEOM.GEOM_Object, containing the created wire.
3029         #
3030         #  @ref tui_creation_wire "Example"
3031         def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
3032             """
3033             Create a wire from the set of edges and wires.
3034
3035             Parameters:
3036                 theEdgesAndWires List of edges and/or wires.
3037                 theTolerance Maximum distance between vertices, that will be merged.
3038                              Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
3039
3040             Returns:                    
3041                 New GEOM.GEOM_Object, containing the created wire.
3042             """
3043             # Example: see GEOM_TestAll.py
3044             anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
3045             RaiseIfFailed("MakeWire", self.ShapesOp)
3046             return anObj
3047
3048         ## Create a face on the given wire.
3049         #  @param theWire closed Wire or Edge to build the face on.
3050         #  @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3051         #                        If the tolerance of the obtained planar face is less
3052         #                        than 1e-06, this face will be returned, otherwise the
3053         #                        algorithm tries to build any suitable face on the given
3054         #                        wire and prints a warning message.
3055         #  @return New GEOM.GEOM_Object, containing the created face.
3056         #
3057         #  @ref tui_creation_face "Example"
3058         def MakeFace(self, theWire, isPlanarWanted):
3059             """
3060             Create a face on the given wire.
3061
3062             Parameters:
3063                 theWire closed Wire or Edge to build the face on.
3064                 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3065                                If the tolerance of the obtained planar face is less
3066                                than 1e-06, this face will be returned, otherwise the
3067                                algorithm tries to build any suitable face on the given
3068                                wire and prints a warning message.
3069
3070             Returns:
3071                 New GEOM.GEOM_Object, containing the created face.
3072             """
3073             # Example: see GEOM_TestAll.py
3074             anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
3075             if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
3076                 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
3077             else:
3078                 RaiseIfFailed("MakeFace", self.ShapesOp)
3079             return anObj
3080
3081         ## Create a face on the given wires set.
3082         #  @param theWires List of closed wires or edges to build the face on.
3083         #  @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3084         #                        If the tolerance of the obtained planar face is less
3085         #                        than 1e-06, this face will be returned, otherwise the
3086         #                        algorithm tries to build any suitable face on the given
3087         #                        wire and prints a warning message.
3088         #  @return New GEOM.GEOM_Object, containing the created face.
3089         #
3090         #  @ref tui_creation_face "Example"
3091         def MakeFaceWires(self, theWires, isPlanarWanted):
3092             """
3093             Create a face on the given wires set.
3094
3095             Parameters:
3096                 theWires List of closed wires or edges to build the face on.
3097                 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3098                                If the tolerance of the obtained planar face is less
3099                                than 1e-06, this face will be returned, otherwise the
3100                                algorithm tries to build any suitable face on the given
3101                                wire and prints a warning message.
3102
3103             Returns: 
3104                 New GEOM.GEOM_Object, containing the created face.
3105             """
3106             # Example: see GEOM_TestAll.py
3107             anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
3108             if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
3109                 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
3110             else:
3111                 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
3112             return anObj
3113
3114         ## See MakeFaceWires() method for details.
3115         #
3116         #  @ref tui_creation_face "Example 1"
3117         #  \n @ref swig_MakeFaces  "Example 2"
3118         def MakeFaces(self, theWires, isPlanarWanted):
3119             """
3120             See geompy.MakeFaceWires() method for details.
3121             """
3122             # Example: see GEOM_TestOthers.py
3123             anObj = self.MakeFaceWires(theWires, isPlanarWanted)
3124             return anObj
3125
3126         ## Create a shell from the set of faces and shells.
3127         #  @param theFacesAndShells List of faces and/or shells.
3128         #  @return New GEOM.GEOM_Object, containing the created shell.
3129         #
3130         #  @ref tui_creation_shell "Example"
3131         def MakeShell(self,theFacesAndShells):
3132             """
3133             Create a shell from the set of faces and shells.
3134
3135             Parameters:
3136                 theFacesAndShells List of faces and/or shells.
3137
3138             Returns:
3139                 New GEOM.GEOM_Object, containing the created shell.
3140             """
3141             # Example: see GEOM_TestAll.py
3142             anObj = self.ShapesOp.MakeShell(theFacesAndShells)
3143             RaiseIfFailed("MakeShell", self.ShapesOp)
3144             return anObj
3145
3146         ## Create a solid, bounded by the given shells.
3147         #  @param theShells Sequence of bounding shells.
3148         #  @return New GEOM.GEOM_Object, containing the created solid.
3149         #
3150         #  @ref tui_creation_solid "Example"
3151         def MakeSolid(self, theShells):
3152             """
3153             Create a solid, bounded by the given shells.
3154
3155             Parameters:
3156                 theShells Sequence of bounding shells.
3157
3158             Returns:
3159                 New GEOM.GEOM_Object, containing the created solid.
3160             """
3161             # Example: see GEOM_TestAll.py
3162             if len(theShells) == 1:
3163                 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
3164                 #if len(descr) > 0:
3165                 #    raise RuntimeError, "MakeSolidShells : " + descr
3166                 if descr == "WRN_SHAPE_UNCLOSED":
3167                     raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
3168             anObj = self.ShapesOp.MakeSolidShells(theShells)
3169             RaiseIfFailed("MakeSolidShells", self.ShapesOp)
3170             return anObj
3171
3172         ## Create a compound of the given shapes.
3173         #  @param theShapes List of shapes to put in compound.
3174         #  @return New GEOM.GEOM_Object, containing the created compound.
3175         #
3176         #  @ref tui_creation_compound "Example"
3177         def MakeCompound(self,theShapes):
3178             """
3179             Create a compound of the given shapes.
3180
3181             Parameters:
3182                 theShapes List of shapes to put in compound.
3183
3184             Returns:
3185                 New GEOM.GEOM_Object, containing the created compound.
3186             """
3187             # Example: see GEOM_TestAll.py
3188             anObj = self.ShapesOp.MakeCompound(theShapes)
3189             RaiseIfFailed("MakeCompound", self.ShapesOp)
3190             return anObj
3191
3192         # end of l3_advanced
3193         ## @}
3194
3195         ## @addtogroup l2_measure
3196         ## @{
3197
3198         ## Gives quantity of faces in the given shape.
3199         #  @param theShape Shape to count faces of.
3200         #  @return Quantity of faces.
3201         #
3202         #  @ref swig_NumberOf "Example"
3203         def NumberOfFaces(self, theShape):
3204             """
3205             Gives quantity of faces in the given shape.
3206
3207             Parameters:
3208                 theShape Shape to count faces of.
3209
3210             Returns:    
3211                 Quantity of faces.
3212             """
3213             # Example: see GEOM_TestOthers.py
3214             nb_faces = self.ShapesOp.NumberOfFaces(theShape)
3215             RaiseIfFailed("NumberOfFaces", self.ShapesOp)
3216             return nb_faces
3217
3218         ## Gives quantity of edges in the given shape.
3219         #  @param theShape Shape to count edges of.
3220         #  @return Quantity of edges.
3221         #
3222         #  @ref swig_NumberOf "Example"
3223         def NumberOfEdges(self, theShape):
3224             """
3225             Gives quantity of edges in the given shape.
3226
3227             Parameters:
3228                 theShape Shape to count edges of.
3229
3230             Returns:    
3231                 Quantity of edges.
3232             """
3233             # Example: see GEOM_TestOthers.py
3234             nb_edges = self.ShapesOp.NumberOfEdges(theShape)
3235             RaiseIfFailed("NumberOfEdges", self.ShapesOp)
3236             return nb_edges
3237
3238         ## Gives quantity of sub-shapes of type theShapeType in the given shape.
3239         #  @param theShape Shape to count sub-shapes of.
3240         #  @param theShapeType Type of sub-shapes to count (see ShapeType())
3241         #  @return Quantity of sub-shapes of given type.
3242         #
3243         #  @ref swig_NumberOf "Example"
3244         def NumberOfSubShapes(self, theShape, theShapeType):
3245             """
3246             Gives quantity of sub-shapes of type theShapeType in the given shape.
3247
3248             Parameters:
3249                 theShape Shape to count sub-shapes of.
3250                 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
3251
3252             Returns:
3253                 Quantity of sub-shapes of given type.
3254             """
3255             # Example: see GEOM_TestOthers.py
3256             nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
3257             RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
3258             return nb_ss
3259
3260         ## Gives quantity of solids in the given shape.
3261         #  @param theShape Shape to count solids in.
3262         #  @return Quantity of solids.
3263         #
3264         #  @ref swig_NumberOf "Example"
3265         def NumberOfSolids(self, theShape):
3266             """
3267             Gives quantity of solids in the given shape.
3268
3269             Parameters:
3270                 theShape Shape to count solids in.
3271
3272             Returns:
3273                 Quantity of solids.
3274             """
3275             # Example: see GEOM_TestOthers.py
3276             nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
3277             RaiseIfFailed("NumberOfSolids", self.ShapesOp)
3278             return nb_solids
3279
3280         # end of l2_measure
3281         ## @}
3282
3283         ## @addtogroup l3_healing
3284         ## @{
3285
3286         ## Reverses an orientation the given shape.
3287         #  @param theShape Shape to be reversed.
3288         #  @return The reversed copy of theShape.
3289         #
3290         #  @ref swig_ChangeOrientation "Example"
3291         def ChangeOrientation(self,theShape):
3292             """
3293             Reverses an orientation the given shape.
3294
3295             Parameters:
3296                 theShape Shape to be reversed.
3297
3298             Returns:   
3299                 The reversed copy of theShape.
3300             """
3301             # Example: see GEOM_TestAll.py
3302             anObj = self.ShapesOp.ChangeOrientation(theShape)
3303             RaiseIfFailed("ChangeOrientation", self.ShapesOp)
3304             return anObj
3305
3306         ## See ChangeOrientation() method for details.
3307         #
3308         #  @ref swig_OrientationChange "Example"
3309         def OrientationChange(self,theShape):
3310             """
3311             See geompy.ChangeOrientation method for details.
3312             """
3313             # Example: see GEOM_TestOthers.py
3314             anObj = self.ChangeOrientation(theShape)
3315             return anObj
3316
3317         # end of l3_healing
3318         ## @}
3319
3320         ## @addtogroup l4_obtain
3321         ## @{
3322
3323         ## Retrieve all free faces from the given shape.
3324         #  Free face is a face, which is not shared between two shells of the shape.
3325         #  @param theShape Shape to find free faces in.
3326         #  @return List of IDs of all free faces, contained in theShape.
3327         #
3328         #  @ref tui_measurement_tools_page "Example"
3329         def GetFreeFacesIDs(self,theShape):
3330             """
3331             Retrieve all free faces from the given shape.
3332             Free face is a face, which is not shared between two shells of the shape.
3333
3334             Parameters:
3335                 theShape Shape to find free faces in.
3336
3337             Returns:
3338                 List of IDs of all free faces, contained in theShape.
3339             """
3340             # Example: see GEOM_TestOthers.py
3341             anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
3342             RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
3343             return anIDs
3344
3345         ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
3346         #  @param theShape1 Shape to find sub-shapes in.
3347         #  @param theShape2 Shape to find shared sub-shapes with.
3348         #  @param theShapeType Type of sub-shapes to be retrieved.
3349         #  @return List of sub-shapes of theShape1, shared with theShape2.
3350         #
3351         #  @ref swig_GetSharedShapes "Example"
3352         def GetSharedShapes(self,theShape1, theShape2, theShapeType):
3353             """
3354             Get all sub-shapes of theShape1 of the given type, shared with theShape2.
3355
3356             Parameters:
3357                 theShape1 Shape to find sub-shapes in.
3358                 theShape2 Shape to find shared sub-shapes with.
3359                 theShapeType Type of sub-shapes to be retrieved.
3360
3361             Returns:
3362                 List of sub-shapes of theShape1, shared with theShape2.
3363             """
3364             # Example: see GEOM_TestOthers.py
3365             aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
3366             RaiseIfFailed("GetSharedShapes", self.ShapesOp)
3367             return aList
3368
3369         ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
3370         #  @param theShapes Shapes to find common sub-shapes of.
3371         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3372         #  @return List of objects, that are sub-shapes of all given shapes.
3373         #
3374         #  @ref swig_GetSharedShapes "Example"
3375         def GetSharedShapesMulti(self, theShapes, theShapeType):
3376             """
3377             Get all sub-shapes, shared by all shapes in the list theShapes.
3378
3379             Parameters:
3380                 theShapes Shapes to find common sub-shapes of.
3381                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3382
3383             Returns:    
3384                 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
3385             """
3386             # Example: see GEOM_TestOthers.py
3387             aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
3388             RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
3389             return aList
3390
3391         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3392         #  situated relatively the specified plane by the certain way,
3393         #  defined through <VAR>theState</VAR> parameter.
3394         #  @param theShape Shape to find sub-shapes of.
3395         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3396         #  @param theAx1 Vector (or line, or linear edge), specifying normal
3397         #                direction and location of the plane to find shapes on.
3398         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3399         #  @return List of all found sub-shapes.
3400         #
3401         #  @ref swig_GetShapesOnPlane "Example"
3402         def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
3403             """
3404             Find in theShape all sub-shapes of type theShapeType,
3405             situated relatively the specified plane by the certain way,
3406             defined through theState parameter.
3407
3408             Parameters:
3409                 theShape Shape to find sub-shapes of.
3410                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3411                 theAx1 Vector (or line, or linear edge), specifying normal
3412                        direction and location of the plane to find shapes on.
3413                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3414
3415             Returns:
3416                 List of all found sub-shapes.
3417             """
3418             # Example: see GEOM_TestOthers.py
3419             aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
3420             RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
3421             return aList
3422
3423         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3424         #  situated relatively the specified plane by the certain way,
3425         #  defined through <VAR>theState</VAR> parameter.
3426         #  @param theShape Shape to find sub-shapes of.
3427         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3428         #  @param theAx1 Vector (or line, or linear edge), specifying normal
3429         #                direction and location of the plane to find shapes on.
3430         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3431         #  @return List of all found sub-shapes indices.
3432         #
3433         #  @ref swig_GetShapesOnPlaneIDs "Example"
3434         def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
3435             """
3436             Find in theShape all sub-shapes of type theShapeType,
3437             situated relatively the specified plane by the certain way,
3438             defined through theState parameter.
3439
3440             Parameters:
3441                 theShape Shape to find sub-shapes of.
3442                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3443                 theAx1 Vector (or line, or linear edge), specifying normal
3444                        direction and location of the plane to find shapes on.
3445                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3446
3447             Returns:
3448                 List of all found sub-shapes indices.
3449             """
3450             # Example: see GEOM_TestOthers.py
3451             aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
3452             RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
3453             return aList
3454
3455         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3456         #  situated relatively the specified plane by the certain way,
3457         #  defined through <VAR>theState</VAR> parameter.
3458         #  @param theShape Shape to find sub-shapes of.
3459         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3460         #  @param theAx1 Vector (or line, or linear edge), specifying normal
3461         #                direction of the plane to find shapes on.
3462         #  @param thePnt Point specifying location of the plane to find shapes on.
3463         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3464         #  @return List of all found sub-shapes.
3465         #
3466         #  @ref swig_GetShapesOnPlaneWithLocation "Example"
3467         def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
3468             """
3469             Find in theShape all sub-shapes of type theShapeType,
3470             situated relatively the specified plane by the certain way,
3471             defined through theState parameter.
3472
3473             Parameters:
3474                 theShape Shape to find sub-shapes of.
3475                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3476                 theAx1 Vector (or line, or linear edge), specifying normal
3477                        direction and location of the plane to find shapes on.
3478                 thePnt Point specifying location of the plane to find shapes on.
3479                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3480
3481             Returns:
3482                 List of all found sub-shapes.
3483             """
3484             # Example: see GEOM_TestOthers.py
3485             aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
3486                                                                theAx1, thePnt, theState)
3487             RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
3488             return aList
3489
3490         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3491         #  situated relatively the specified plane by the certain way,
3492         #  defined through <VAR>theState</VAR> parameter.
3493         #  @param theShape Shape to find sub-shapes of.
3494         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3495         #  @param theAx1 Vector (or line, or linear edge), specifying normal
3496         #                direction of the plane to find shapes on.
3497         #  @param thePnt Point specifying location of the plane to find shapes on.
3498         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3499         #  @return List of all found sub-shapes indices.
3500         #
3501         #  @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
3502         def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
3503             """
3504             Find in theShape all sub-shapes of type theShapeType,
3505             situated relatively the specified plane by the certain way,
3506             defined through theState parameter.
3507
3508             Parameters:
3509                 theShape Shape to find sub-shapes of.
3510                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3511                 theAx1 Vector (or line, or linear edge), specifying normal
3512                        direction and location of the plane to find shapes on.
3513                 thePnt Point specifying location of the plane to find shapes on.
3514                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3515
3516             Returns:
3517                 List of all found sub-shapes indices.
3518             """
3519             # Example: see GEOM_TestOthers.py
3520             aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
3521                                                                   theAx1, thePnt, theState)
3522             RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
3523             return aList
3524
3525         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3526         #  the specified cylinder by the certain way, defined through \a theState parameter.
3527         #  @param theShape Shape to find sub-shapes of.
3528         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3529         #  @param theAxis Vector (or line, or linear edge), specifying
3530         #                 axis of the cylinder to find shapes on.
3531         #  @param theRadius Radius of the cylinder to find shapes on.
3532         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3533         #  @return List of all found sub-shapes.
3534         #
3535         #  @ref swig_GetShapesOnCylinder "Example"
3536         def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
3537             """
3538             Find in theShape all sub-shapes of type theShapeType, situated relatively
3539             the specified cylinder by the certain way, defined through theState parameter.
3540
3541             Parameters:
3542                 theShape Shape to find sub-shapes of.
3543                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3544                 theAxis Vector (or line, or linear edge), specifying
3545                         axis of the cylinder to find shapes on.
3546                 theRadius Radius of the cylinder to find shapes on.
3547                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3548
3549             Returns:
3550                 List of all found sub-shapes.
3551             """
3552             # Example: see GEOM_TestOthers.py
3553             aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
3554             RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
3555             return aList
3556
3557         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3558         #  the specified cylinder by the certain way, defined through \a theState parameter.
3559         #  @param theShape Shape to find sub-shapes of.
3560         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3561         #  @param theAxis Vector (or line, or linear edge), specifying
3562         #                 axis of the cylinder to find shapes on.
3563         #  @param theRadius Radius of the cylinder to find shapes on.
3564         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3565         #  @return List of all found sub-shapes indices.
3566         #
3567         #  @ref swig_GetShapesOnCylinderIDs "Example"
3568         def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
3569             """
3570             Find in theShape all sub-shapes of type theShapeType, situated relatively
3571             the specified cylinder by the certain way, defined through theState parameter.
3572
3573             Parameters:
3574                 theShape Shape to find sub-shapes of.
3575                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3576                 theAxis Vector (or line, or linear edge), specifying
3577                         axis of the cylinder to find shapes on.
3578                 theRadius Radius of the cylinder to find shapes on.
3579                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3580
3581             Returns:
3582                 List of all found sub-shapes indices.
3583             """
3584             # Example: see GEOM_TestOthers.py
3585             aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
3586             RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
3587             return aList
3588
3589         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3590         #  the specified cylinder by the certain way, defined through \a theState parameter.
3591         #  @param theShape Shape to find sub-shapes of.
3592         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3593         #  @param theAxis Vector (or line, or linear edge), specifying
3594         #                 axis of the cylinder to find shapes on.
3595         #  @param thePnt Point specifying location of the bottom of the cylinder.
3596         #  @param theRadius Radius of the cylinder to find shapes on.
3597         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3598         #  @return List of all found sub-shapes.
3599         #
3600         #  @ref swig_GetShapesOnCylinderWithLocation "Example"
3601         def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
3602             """
3603             Find in theShape all sub-shapes of type theShapeType, situated relatively
3604             the specified cylinder by the certain way, defined through theState parameter.
3605
3606             Parameters:
3607                 theShape Shape to find sub-shapes of.
3608                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3609                 theAxis Vector (or line, or linear edge), specifying
3610                         axis of the cylinder to find shapes on.
3611                 theRadius Radius of the cylinder to find shapes on.
3612                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3613
3614             Returns:
3615                 List of all found sub-shapes.
3616             """
3617             # Example: see GEOM_TestOthers.py
3618             aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
3619             RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
3620             return aList
3621
3622         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3623         #  the specified cylinder by the certain way, defined through \a theState parameter.
3624         #  @param theShape Shape to find sub-shapes of.
3625         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3626         #  @param theAxis Vector (or line, or linear edge), specifying
3627         #                 axis of the cylinder to find shapes on.
3628         #  @param thePnt Point specifying location of the bottom of the cylinder.
3629         #  @param theRadius Radius of the cylinder to find shapes on.
3630         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3631         #  @return List of all found sub-shapes indices
3632         #
3633         #  @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
3634         def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
3635             """
3636             Find in theShape all sub-shapes of type theShapeType, situated relatively
3637             the specified cylinder by the certain way, defined through theState parameter.
3638
3639             Parameters:
3640                 theShape Shape to find sub-shapes of.
3641                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3642                 theAxis Vector (or line, or linear edge), specifying
3643                         axis of the cylinder to find shapes on.
3644                 theRadius Radius of the cylinder to find shapes on.
3645                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3646
3647             Returns:
3648                 List of all found sub-shapes indices.            
3649             """
3650             # Example: see GEOM_TestOthers.py
3651             aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
3652             RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
3653             return aList
3654
3655         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3656         #  the specified sphere by the certain way, defined through \a theState parameter.
3657         #  @param theShape Shape to find sub-shapes of.
3658         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3659         #  @param theCenter Point, specifying center of the sphere to find shapes on.
3660         #  @param theRadius Radius of the sphere to find shapes on.
3661         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3662         #  @return List of all found sub-shapes.
3663         #
3664         #  @ref swig_GetShapesOnSphere "Example"
3665         def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
3666             """
3667             Find in theShape all sub-shapes of type theShapeType, situated relatively
3668             the specified sphere by the certain way, defined through theState parameter.
3669
3670             Parameters:
3671                 theShape Shape to find sub-shapes of.
3672                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3673                 theCenter Point, specifying center of the sphere to find shapes on.
3674                 theRadius Radius of the sphere to find shapes on.
3675                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3676
3677             Returns:
3678                 List of all found sub-shapes.
3679             """
3680             # Example: see GEOM_TestOthers.py
3681             aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
3682             RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
3683             return aList
3684
3685         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3686         #  the specified sphere by the certain way, defined through \a theState parameter.
3687         #  @param theShape Shape to find sub-shapes of.
3688         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3689         #  @param theCenter Point, specifying center of the sphere to find shapes on.
3690         #  @param theRadius Radius of the sphere to find shapes on.
3691         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3692         #  @return List of all found sub-shapes indices.
3693         #
3694         #  @ref swig_GetShapesOnSphereIDs "Example"
3695         def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
3696             """
3697             Find in theShape all sub-shapes of type theShapeType, situated relatively
3698             the specified sphere by the certain way, defined through theState parameter.
3699
3700             Parameters:
3701                 theShape Shape to find sub-shapes of.
3702                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3703                 theCenter Point, specifying center of the sphere to find shapes on.
3704                 theRadius Radius of the sphere to find shapes on.
3705                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3706
3707             Returns:
3708                 List of all found sub-shapes indices.
3709             """
3710             # Example: see GEOM_TestOthers.py
3711             aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
3712             RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
3713             return aList
3714
3715         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3716         #  the specified quadrangle by the certain way, defined through \a theState parameter.
3717         #  @param theShape Shape to find sub-shapes of.
3718         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3719         #  @param theTopLeftPoint Point, specifying top left corner of a quadrangle
3720         #  @param theTopRigthPoint Point, specifying top right corner of a quadrangle
3721         #  @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3722         #  @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3723         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3724         #  @return List of all found sub-shapes.
3725         #
3726         #  @ref swig_GetShapesOnQuadrangle "Example"
3727         def GetShapesOnQuadrangle(self, theShape, theShapeType,
3728                                   theTopLeftPoint, theTopRigthPoint,
3729                                   theBottomLeftPoint, theBottomRigthPoint, theState):
3730             """
3731             Find in theShape all sub-shapes of type theShapeType, situated relatively
3732             the specified quadrangle by the certain way, defined through theState parameter.
3733
3734             Parameters:
3735                 theShape Shape to find sub-shapes of.
3736                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3737                 theTopLeftPoint Point, specifying top left corner of a quadrangle
3738                 theTopRigthPoint Point, specifying top right corner of a quadrangle
3739                 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3740                 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3741                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3742
3743             Returns:
3744                 List of all found sub-shapes.
3745             """
3746             # Example: see GEOM_TestOthers.py
3747             aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
3748                                                         theTopLeftPoint, theTopRigthPoint,
3749                                                         theBottomLeftPoint, theBottomRigthPoint, theState)
3750             RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
3751             return aList
3752
3753         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3754         #  the specified quadrangle by the certain way, defined through \a theState parameter.
3755         #  @param theShape Shape to find sub-shapes of.
3756         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3757         #  @param theTopLeftPoint Point, specifying top left corner of a quadrangle
3758         #  @param theTopRigthPoint Point, specifying top right corner of a quadrangle
3759         #  @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3760         #  @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3761         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3762         #  @return List of all found sub-shapes indices.
3763         #
3764         #  @ref swig_GetShapesOnQuadrangleIDs "Example"
3765         def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
3766                                      theTopLeftPoint, theTopRigthPoint,
3767                                      theBottomLeftPoint, theBottomRigthPoint, theState):
3768             """
3769             Find in theShape all sub-shapes of type theShapeType, situated relatively
3770             the specified quadrangle by the certain way, defined through theState parameter.
3771
3772             Parameters:
3773                 theShape Shape to find sub-shapes of.
3774                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3775                 theTopLeftPoint Point, specifying top left corner of a quadrangle
3776                 theTopRigthPoint Point, specifying top right corner of a quadrangle
3777                 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3778                 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3779                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3780
3781             Returns:
3782                 List of all found sub-shapes indices.
3783             """
3784
3785             # Example: see GEOM_TestOthers.py
3786             aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
3787                                                            theTopLeftPoint, theTopRigthPoint,
3788                                                            theBottomLeftPoint, theBottomRigthPoint, theState)
3789             RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
3790             return aList
3791
3792         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3793         #  the specified \a theBox by the certain way, defined through \a theState parameter.
3794         #  @param theBox Shape for relative comparing.
3795         #  @param theShape Shape to find sub-shapes of.
3796         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3797         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3798         #  @return List of all found sub-shapes.
3799         #
3800         #  @ref swig_GetShapesOnBox "Example"
3801         def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
3802             """
3803             Find in theShape all sub-shapes of type theShapeType, situated relatively
3804             the specified theBox by the certain way, defined through theState parameter.
3805
3806             Parameters:
3807                 theBox Shape for relative comparing.
3808                 theShape Shape to find sub-shapes of.
3809                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3810                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3811
3812             Returns:
3813                 List of all found sub-shapes.
3814             """
3815             # Example: see GEOM_TestOthers.py
3816             aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
3817             RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
3818             return aList
3819
3820         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3821         #  the specified \a theBox by the certain way, defined through \a theState parameter.
3822         #  @param theBox Shape for relative comparing.
3823         #  @param theShape Shape to find sub-shapes of.
3824         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3825         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3826         #  @return List of all found sub-shapes indices.
3827         #
3828         #  @ref swig_GetShapesOnBoxIDs "Example"
3829         def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
3830             """
3831             Find in theShape all sub-shapes of type theShapeType, situated relatively
3832             the specified theBox by the certain way, defined through theState parameter.
3833
3834             Parameters:
3835                 theBox Shape for relative comparing.
3836                 theShape Shape to find sub-shapes of.
3837                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3838                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3839
3840             Returns:
3841                 List of all found sub-shapes indices.
3842             """
3843             # Example: see GEOM_TestOthers.py
3844             aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
3845             RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
3846             return aList
3847
3848         ## Find in \a theShape all sub-shapes of type \a theShapeType,
3849         #  situated relatively the specified \a theCheckShape by the
3850         #  certain way, defined through \a theState parameter.
3851         #  @param theCheckShape Shape for relative comparing. It must be a solid.
3852         #  @param theShape Shape to find sub-shapes of.
3853         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()) 
3854         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3855         #  @return List of all found sub-shapes.
3856         #
3857         #  @ref swig_GetShapesOnShape "Example"
3858         def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
3859             """
3860             Find in theShape all sub-shapes of type theShapeType,
3861             situated relatively the specified theCheckShape by the
3862             certain way, defined through theState parameter.
3863
3864             Parameters:
3865                 theCheckShape Shape for relative comparing. It must be a solid.
3866                 theShape Shape to find sub-shapes of.
3867                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3868                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3869
3870             Returns:
3871                 List of all found sub-shapes.
3872             """
3873             # Example: see GEOM_TestOthers.py
3874             aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
3875                                                    theShapeType, theState)
3876             RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
3877             return aList
3878
3879         ## Find in \a theShape all sub-shapes of type \a theShapeType,
3880         #  situated relatively the specified \a theCheckShape by the
3881         #  certain way, defined through \a theState parameter.
3882         #  @param theCheckShape Shape for relative comparing. It must be a solid.
3883         #  @param theShape Shape to find sub-shapes of.
3884         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3885         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3886         #  @return All found sub-shapes as compound.
3887         #
3888         #  @ref swig_GetShapesOnShapeAsCompound "Example"
3889         def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
3890             """
3891             Find in theShape all sub-shapes of type theShapeType,
3892             situated relatively the specified theCheckShape by the
3893             certain way, defined through theState parameter.
3894
3895             Parameters:
3896                 theCheckShape Shape for relative comparing. It must be a solid.
3897                 theShape Shape to find sub-shapes of.
3898                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3899                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3900
3901             Returns:
3902                 All found sub-shapes as compound.
3903             """
3904             # Example: see GEOM_TestOthers.py
3905             anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
3906                                                              theShapeType, theState)
3907             RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
3908             return anObj
3909
3910         ## Find in \a theShape all sub-shapes of type \a theShapeType,
3911         #  situated relatively the specified \a theCheckShape by the
3912         #  certain way, defined through \a theState parameter.
3913         #  @param theCheckShape Shape for relative comparing. It must be a solid.
3914         #  @param theShape Shape to find sub-shapes of.
3915         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3916         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3917         #  @return List of all found sub-shapes indices.
3918         #
3919         #  @ref swig_GetShapesOnShapeIDs "Example"
3920         def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
3921             """
3922             Find in theShape all sub-shapes of type theShapeType,
3923             situated relatively the specified theCheckShape by the
3924             certain way, defined through theState parameter.
3925
3926             Parameters:
3927                 theCheckShape Shape for relative comparing. It must be a solid.
3928                 theShape Shape to find sub-shapes of.
3929                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3930                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3931
3932             Returns:
3933                 List of all found sub-shapes indices.
3934             """
3935             # Example: see GEOM_TestOthers.py
3936             aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
3937                                                       theShapeType, theState)
3938             RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
3939             return aList
3940
3941         ## Get sub-shape(s) of theShapeWhere, which are
3942         #  coincident with \a theShapeWhat or could be a part of it.
3943         #  @param theShapeWhere Shape to find sub-shapes of.
3944         #  @param theShapeWhat Shape, specifying what to find.
3945         #  @param isNewImplementation implementation of GetInPlace functionality
3946         #             (default = False, old alghorithm based on shape properties)
3947         #  @return Group of all found sub-shapes or a single found sub-shape.
3948         #
3949         #  @note This function has a restriction on argument shapes.
3950         #        If \a theShapeWhere has curved parts with significantly
3951         #        outstanding centres (i.e. the mass centre of a part is closer to
3952         #        \a theShapeWhat than to the part), such parts will not be found.
3953         #        @image html get_in_place_lost_part.png
3954         #
3955         #  @ref swig_GetInPlace "Example"
3956         def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False):
3957             """
3958             Get sub-shape(s) of theShapeWhere, which are
3959             coincident with  theShapeWhat or could be a part of it.
3960
3961             Parameters:
3962                 theShapeWhere Shape to find sub-shapes of.
3963                 theShapeWhat Shape, specifying what to find.
3964                 isNewImplementation Implementation of GetInPlace functionality
3965                                     (default = False, old alghorithm based on shape properties)
3966
3967             Returns:
3968                 Group of all found sub-shapes or a single found sub-shape.
3969
3970                 
3971             Note:
3972                 This function has a restriction on argument shapes.
3973                 If theShapeWhere has curved parts with significantly
3974                 outstanding centres (i.e. the mass centre of a part is closer to
3975                 theShapeWhat than to the part), such parts will not be found.
3976             """
3977             # Example: see GEOM_TestOthers.py
3978             anObj = None
3979             if isNewImplementation:
3980                 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
3981             else:
3982                 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
3983                 pass
3984             RaiseIfFailed("GetInPlace", self.ShapesOp)
3985             return anObj
3986
3987         ## Get sub-shape(s) of \a theShapeWhere, which are
3988         #  coincident with \a theShapeWhat or could be a part of it.
3989         #
3990         #  Implementation of this method is based on a saved history of an operation,
3991         #  produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
3992         #  arguments (an argument shape or a sub-shape of an argument shape).
3993         #  The operation could be the Partition or one of boolean operations,
3994         #  performed on simple shapes (not on compounds).
3995         #
3996         #  @param theShapeWhere Shape to find sub-shapes of.
3997         #  @param theShapeWhat Shape, specifying what to find (must be in the
3998         #                      building history of the ShapeWhere).
3999         #  @return Group of all found sub-shapes or a single found sub-shape.
4000         #
4001         #  @ref swig_GetInPlace "Example"
4002         def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
4003             """
4004             Implementation of this method is based on a saved history of an operation,
4005             produced theShapeWhere. The theShapeWhat must be among this operation's
4006             arguments (an argument shape or a sub-shape of an argument shape).
4007             The operation could be the Partition or one of boolean operations,
4008             performed on simple shapes (not on compounds).
4009
4010             Parameters:
4011                 theShapeWhere Shape to find sub-shapes of.
4012                 theShapeWhat Shape, specifying what to find (must be in the
4013                                 building history of the ShapeWhere).
4014
4015             Returns:
4016                 Group of all found sub-shapes or a single found sub-shape.
4017             """
4018             # Example: see GEOM_TestOthers.py
4019             anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
4020             RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
4021             return anObj
4022
4023         ## Get sub-shape of theShapeWhere, which is
4024         #  equal to \a theShapeWhat.
4025         #  @param theShapeWhere Shape to find sub-shape of.
4026         #  @param theShapeWhat Shape, specifying what to find.
4027         #  @return New GEOM.GEOM_Object for found sub-shape.
4028         #
4029         #  @ref swig_GetSame "Example"
4030         def GetSame(self,theShapeWhere, theShapeWhat):
4031             """
4032             Get sub-shape of theShapeWhere, which is
4033             equal to theShapeWhat.
4034
4035             Parameters:
4036                 theShapeWhere Shape to find sub-shape of.
4037                 theShapeWhat Shape, specifying what to find.
4038
4039             Returns:
4040                 New GEOM.GEOM_Object for found sub-shape.
4041             """
4042             anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
4043             RaiseIfFailed("GetSame", self.ShapesOp)
4044             return anObj
4045
4046
4047         ## Get sub-shape indices of theShapeWhere, which is
4048         #  equal to \a theShapeWhat.
4049         #  @param theShapeWhere Shape to find sub-shape of.
4050         #  @param theShapeWhat Shape, specifying what to find.
4051         #  @return List of all found sub-shapes indices. 
4052         #
4053         #  @ref swig_GetSame "Example"
4054         def GetSameIDs(self,theShapeWhere, theShapeWhat):
4055             """
4056             Get sub-shape indices of theShapeWhere, which is
4057             equal to theShapeWhat.
4058
4059             Parameters:
4060                 theShapeWhere Shape to find sub-shape of.
4061                 theShapeWhat Shape, specifying what to find.
4062
4063             Returns:
4064                 List of all found sub-shapes indices.
4065             """
4066             anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
4067             RaiseIfFailed("GetSameIDs", self.ShapesOp)
4068             return anObj
4069
4070
4071         # end of l4_obtain
4072         ## @}
4073
4074         ## @addtogroup l4_access
4075         ## @{
4076
4077         ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
4078         #  of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
4079         #  @param aShape Shape to get sub-shape of.
4080         #  @param ListOfID List of sub-shapes indices.
4081         #  @return Found sub-shape.
4082         #
4083         #  @ref swig_all_decompose "Example"
4084         def GetSubShape(self, aShape, ListOfID):
4085             """
4086             Obtain a composite sub-shape of aShape, composed from sub-shapes
4087             of aShape, selected by their unique IDs inside aShape
4088
4089             Parameters:
4090                aShape Shape to get sub-shape of.
4091                ListOfID List of sub-shapes indices.
4092
4093             Returns:
4094                 Found sub-shape.
4095             """
4096             # Example: see GEOM_TestAll.py
4097             anObj = self.AddSubShape(aShape,ListOfID)
4098             return anObj
4099
4100         ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
4101         #  of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
4102         #  @param aShape Shape to get sub-shape of.
4103         #  @param aSubShape Sub-shapes of aShape.
4104         #  @return ID of found sub-shape.
4105         #
4106         #  @ref swig_all_decompose "Example"
4107         def GetSubShapeID(self, aShape, aSubShape):
4108             """
4109             Obtain unique ID of sub-shape aSubShape inside aShape
4110             of aShape, selected by their unique IDs inside aShape
4111
4112             Parameters:
4113                aShape Shape to get sub-shape of.
4114                aSubShape Sub-shapes of aShape.
4115
4116             Returns:
4117                ID of found sub-shape.
4118             """
4119             # Example: see GEOM_TestAll.py
4120             anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
4121             RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
4122             return anID
4123
4124         # end of l4_access
4125         ## @}
4126
4127         ## @addtogroup l4_decompose
4128         ## @{
4129
4130         ## Get all sub-shapes and groups of \a theShape,
4131         #  that were created already by any other methods.
4132         #  @param theShape Any shape.
4133         #  @param theGroupsOnly If this parameter is TRUE, only groups will be
4134         #                       returned, else all found sub-shapes and groups.
4135         #  @return List of existing sub-objects of \a theShape.
4136         #
4137         #  @ref swig_all_decompose "Example"
4138         def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
4139             """
4140             Get all sub-shapes and groups of theShape,
4141             that were created already by any other methods.
4142
4143             Parameters:
4144                 theShape Any shape.
4145                 theGroupsOnly If this parameter is TRUE, only groups will be
4146                                  returned, else all found sub-shapes and groups.
4147
4148             Returns:
4149                 List of existing sub-objects of theShape.
4150             """
4151             # Example: see GEOM_TestAll.py
4152             ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
4153             RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
4154             return ListObj
4155
4156         ## Get all groups of \a theShape,
4157         #  that were created already by any other methods.
4158         #  @param theShape Any shape.
4159         #  @return List of existing groups of \a theShape.
4160         #
4161         #  @ref swig_all_decompose "Example"
4162         def GetGroups(self, theShape):
4163             """
4164             Get all groups of theShape,
4165             that were created already by any other methods.
4166
4167             Parameters:
4168                 theShape Any shape.
4169
4170             Returns:
4171                 List of existing groups of theShape.
4172             """
4173             # Example: see GEOM_TestAll.py
4174             ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
4175             RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
4176             return ListObj
4177
4178         ## Explode a shape on sub-shapes of a given type.
4179         #  If the shape itself matches the type, it is also returned.
4180         #  @param aShape Shape to be exploded.
4181         #  @param aType Type of sub-shapes to be retrieved (see ShapeType()) 
4182         #  @return List of sub-shapes of type theShapeType, contained in theShape.
4183         #
4184         #  @ref swig_all_decompose "Example"
4185         def SubShapeAll(self, aShape, aType):
4186             """
4187             Explode a shape on sub-shapes of a given type.
4188             If the shape itself matches the type, it is also returned.
4189
4190             Parameters:
4191                 aShape Shape to be exploded.
4192                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType) 
4193
4194             Returns:
4195                 List of sub-shapes of type theShapeType, contained in theShape.
4196             """
4197             # Example: see GEOM_TestAll.py
4198             ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
4199             RaiseIfFailed("SubShapeAll", self.ShapesOp)
4200             return ListObj
4201
4202         ## Explode a shape on sub-shapes of a given type.
4203         #  @param aShape Shape to be exploded.
4204         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
4205         #  @return List of IDs of sub-shapes.
4206         #
4207         #  @ref swig_all_decompose "Example"
4208         def SubShapeAllIDs(self, aShape, aType):
4209             """
4210             Explode a shape on sub-shapes of a given type.
4211
4212             Parameters:
4213                 aShape Shape to be exploded (see geompy.ShapeType) 
4214                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4215
4216             Returns:
4217                 List of IDs of sub-shapes.
4218             """
4219             ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
4220             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4221             return ListObj
4222
4223         ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
4224         #  selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
4225         #  Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4226         #  @param aShape Shape to get sub-shape of.
4227         #  @param ListOfInd List of sub-shapes indices.
4228         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
4229         #  @return A compound of sub-shapes of aShape.
4230         #
4231         #  @ref swig_all_decompose "Example"
4232         def SubShape(self, aShape, aType, ListOfInd):
4233             """
4234             Obtain a compound of sub-shapes of aShape,
4235             selected by they indices in list of all sub-shapes of type aType.
4236             Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4237             
4238             Parameters:
4239                 aShape Shape to get sub-shape of.
4240                 ListOfID List of sub-shapes indices.
4241                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4242
4243             Returns:
4244                 A compound of sub-shapes of aShape.
4245             """
4246             # Example: see GEOM_TestAll.py
4247             ListOfIDs = []
4248             AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
4249             for ind in ListOfInd:
4250                 ListOfIDs.append(AllShapeIDsList[ind - 1])
4251             anObj = self.GetSubShape(aShape, ListOfIDs)
4252             return anObj
4253
4254         ## Explode a shape on sub-shapes of a given type.
4255         #  Sub-shapes will be sorted by coordinates of their gravity centers.
4256         #  If the shape itself matches the type, it is also returned.
4257         #  @param aShape Shape to be exploded.
4258         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
4259         #  @return List of sub-shapes of type theShapeType, contained in theShape.
4260         #
4261         #  @ref swig_SubShapeAllSorted "Example"
4262         def SubShapeAllSortedCentres(self, aShape, aType):
4263             """
4264             Explode a shape on sub-shapes of a given type.
4265             Sub-shapes will be sorted by coordinates of their gravity centers.
4266             If the shape itself matches the type, it is also returned.
4267
4268             Parameters: 
4269                 aShape Shape to be exploded.
4270                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4271
4272             Returns: 
4273                 List of sub-shapes of type theShapeType, contained in theShape.
4274             """
4275             # Example: see GEOM_TestAll.py
4276             ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
4277             RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
4278             return ListObj
4279
4280         ## Explode a shape on sub-shapes of a given type.
4281         #  Sub-shapes will be sorted by coordinates of their gravity centers.
4282         #  @param aShape Shape to be exploded.
4283         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
4284         #  @return List of IDs of sub-shapes.
4285         #
4286         #  @ref swig_all_decompose "Example"
4287         def SubShapeAllSortedCentresIDs(self, aShape, aType):
4288             """
4289             Explode a shape on sub-shapes of a given type.
4290             Sub-shapes will be sorted by coordinates of their gravity centers.
4291
4292             Parameters: 
4293                 aShape Shape to be exploded.
4294                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4295
4296             Returns: 
4297                 List of IDs of sub-shapes.
4298             """
4299             ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
4300             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4301             return ListIDs
4302
4303         ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
4304         #  selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
4305         #  Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4306         #  @param aShape Shape to get sub-shape of.
4307         #  @param ListOfInd List of sub-shapes indices.
4308         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
4309         #  @return A compound of sub-shapes of aShape.
4310         #
4311         #  @ref swig_all_decompose "Example"
4312         def SubShapeSortedCentres(self, aShape, aType, ListOfInd):
4313             """
4314             Obtain a compound of sub-shapes of aShape,
4315             selected by they indices in sorted list of all sub-shapes of type aType.
4316             Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4317
4318             Parameters:
4319                 aShape Shape to get sub-shape of.
4320                 ListOfID List of sub-shapes indices.
4321                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4322
4323             Returns:
4324                 A compound of sub-shapes of aShape.
4325             """
4326             # Example: see GEOM_TestAll.py
4327             ListOfIDs = []
4328             AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
4329             for ind in ListOfInd:
4330                 ListOfIDs.append(AllShapeIDsList[ind - 1])
4331             anObj = self.GetSubShape(aShape, ListOfIDs)
4332             return anObj
4333
4334         ## Extract shapes (excluding the main shape) of given type.
4335         #  @param aShape The shape.
4336         #  @param aType  The shape type (see ShapeType())
4337         #  @param isSorted Boolean flag to switch sorting on/off.
4338         #  @return List of sub-shapes of type aType, contained in aShape.
4339         #
4340         #  @ref swig_FilletChamfer "Example"
4341         def ExtractShapes(self, aShape, aType, isSorted = False):
4342             """
4343             Extract shapes (excluding the main shape) of given type.
4344
4345             Parameters:
4346                 aShape The shape.
4347                 aType  The shape type (see geompy.ShapeType)
4348                 isSorted Boolean flag to switch sorting on/off.
4349
4350             Returns:     
4351                 List of sub-shapes of type aType, contained in aShape.
4352             """
4353             # Example: see GEOM_TestAll.py
4354             ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
4355             RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
4356             return ListObj
4357
4358         ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
4359         #  @param aShape Main shape.
4360         #  @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
4361         #  @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
4362         #
4363         #  @ref swig_all_decompose "Example"
4364         def SubShapes(self, aShape, anIDs):
4365             """
4366             Get a set of sub-shapes defined by their unique IDs inside theMainShape
4367
4368             Parameters:
4369                 aShape Main shape.
4370                 anIDs List of unique IDs of sub-shapes inside theMainShape.
4371
4372             Returns:      
4373                 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
4374             """
4375             # Example: see GEOM_TestAll.py
4376             ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
4377             RaiseIfFailed("SubShapes", self.ShapesOp)
4378             return ListObj
4379
4380         # end of l4_decompose
4381         ## @}
4382
4383         ## @addtogroup l4_decompose_d
4384         ## @{
4385
4386         ## Deprecated method
4387         #  It works like SubShapeAllSortedCentres(), but wrongly
4388         #  defines centres of faces, shells and solids.
4389         def SubShapeAllSorted(self, aShape, aType):
4390             """
4391             Deprecated method
4392             It works like geompy.SubShapeAllSortedCentres, but wrongly
4393             defines centres of faces, shells and solids.
4394             """
4395             ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
4396             RaiseIfFailed("MakeExplode", self.ShapesOp)
4397             return ListObj
4398
4399         ## Deprecated method
4400         #  It works like SubShapeAllSortedCentresIDs(), but wrongly
4401         #  defines centres of faces, shells and solids.
4402         def SubShapeAllSortedIDs(self, aShape, aType):
4403             """
4404             Deprecated method
4405             It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
4406             defines centres of faces, shells and solids.
4407             """
4408             ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
4409             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4410             return ListIDs
4411
4412         ## Deprecated method
4413         #  It works like SubShapeSortedCentres(), but has a bug
4414         #  (wrongly defines centres of faces, shells and solids).
4415         def SubShapeSorted(self, aShape, aType, ListOfInd):
4416             """
4417             Deprecated method
4418             It works like geompy.SubShapeSortedCentres, but has a bug
4419             (wrongly defines centres of faces, shells and solids).
4420             """
4421             ListOfIDs = []
4422             AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
4423             for ind in ListOfInd:
4424                 ListOfIDs.append(AllShapeIDsList[ind - 1])
4425             anObj = self.GetSubShape(aShape, ListOfIDs)
4426             return anObj
4427
4428         # end of l4_decompose_d
4429         ## @}
4430
4431         ## @addtogroup l3_healing
4432         ## @{
4433
4434         ## Apply a sequence of Shape Healing operators to the given object.
4435         #  @param theShape Shape to be processed.
4436         #  @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
4437         #  @param theParameters List of names of parameters
4438         #                    ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
4439         #  @param theValues List of values of parameters, in the same order
4440         #                    as parameters are listed in <VAR>theParameters</VAR> list.
4441         #
4442         #
4443         #  <b> Operators and Parameters: </b> \n
4444         #
4445         #  * \b FixShape - corrects invalid shapes. \n
4446         #  - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
4447         #  - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
4448         #
4449         #  * \b FixFaceSize - removes small faces, such as spots and strips.\n
4450         #  - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
4451         #  - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
4452         #  - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
4453         #
4454         #  * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
4455         #    surfaces in segments using a certain angle. \n
4456         #  - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
4457         #    if Angle=180, four if Angle=90, etc). \n
4458         #  - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
4459         #
4460         #  * \b SplitClosedFaces - splits closed faces in segments.
4461         #    The number of segments depends on the number of splitting points.\n
4462         #  - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
4463         #
4464         #  * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
4465         #  - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
4466         #  - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
4467         #  - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
4468         #   This and the previous parameters can take the following values:\n
4469         #   \b Parametric \b Continuity \n
4470         #   \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
4471         #   are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
4472         #   \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
4473         #    ruling out sharp edges).\n
4474         #   \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces 
4475         #       are of the same magnitude).\n
4476         #   \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
4477         #    or surfaces (d/du C(u)) are the same at junction. \n
4478         #   \b Geometric \b Continuity \n
4479         #   \b G1: first derivatives are proportional at junction.\n
4480         #   The curve tangents thus have the same direction, but not necessarily the same magnitude.
4481         #      i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
4482         #   \b G2: first and second derivatives are proportional at junction.
4483         #   As the names imply, geometric continuity requires the geometry to be continuous, while parametric
4484         #    continuity requires that the underlying parameterization was continuous as well.
4485         #   Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
4486         #
4487         #  * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
4488         #  - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
4489         #  - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
4490         #  - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
4491         #  - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
4492         #       with the specified parameters.\n
4493         #  - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
4494         #       with the specified parameters.\n
4495         #  - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
4496         #  - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
4497         #  - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
4498         #  - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
4499         #
4500         #  * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
4501         #  - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
4502         #  - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
4503         #  - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
4504         #  - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
4505         #
4506         #  * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
4507         #  - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
4508         #
4509         #
4510         #  @return New GEOM.GEOM_Object, containing processed shape.
4511         #
4512         #  \n @ref tui_shape_processing "Example"
4513         def ProcessShape(self, theShape, theOperators, theParameters, theValues):
4514             """
4515             Apply a sequence of Shape Healing operators to the given object.
4516
4517             Parameters:
4518                 theShape Shape to be processed.
4519                 theValues List of values of parameters, in the same order
4520                           as parameters are listed in theParameters list.
4521                 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
4522                 theParameters List of names of parameters
4523                               ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
4524                  Operators and Parameters:
4525
4526                  * FixShape - corrects invalid shapes.
4527                      * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
4528                      * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
4529                  * FixFaceSize - removes small faces, such as spots and strips.
4530                      * FixFaceSize.Tolerance - defines minimum possible face size.
4531                      * DropSmallEdges - removes edges, which merge with neighbouring edges.
4532                      * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
4533                  * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
4534                                 in segments using a certain angle.
4535                      * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
4536                                           if Angle=180, four if Angle=90, etc).
4537                      * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
4538                  * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
4539                                       splitting points.
4540                      * SplitClosedFaces.NbSplitPoints - the number of splitting points.
4541                  * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
4542                      * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
4543                      * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
4544                      * SplitContinuity.CurveContinuity - required continuity for curves.
4545                        This and the previous parameters can take the following values:
4546                        
4547                        Parametric Continuity:
4548                        C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
4549                                                    coincidental. The curves or surfaces may still meet at an angle,
4550                                                    giving rise to a sharp corner or edge).
4551                        C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
4552                                                    are parallel, ruling out sharp edges).
4553                        C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
4554                                                   or surfaces are of the same magnitude).
4555                        CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
4556                           curves or surfaces (d/du C(u)) are the same at junction.
4557                           
4558                        Geometric Continuity:
4559                        G1: first derivatives are proportional at junction.
4560                            The curve tangents thus have the same direction, but not necessarily the same magnitude.
4561                            i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
4562                        G2: first and second derivatives are proportional at junction. As the names imply,
4563                            geometric continuity requires the geometry to be continuous, while parametric continuity requires
4564                            that the underlying parameterization was continuous as well. Parametric continuity of order n implies
4565                            geometric continuity of order n, but not vice-versa.
4566                  * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
4567                      * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
4568                      * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
4569                      * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
4570                      * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
4571                                                         the specified parameters.
4572                      * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
4573                                                         the specified parameters.
4574                      * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
4575                      * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
4576                      * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
4577                      * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
4578                  * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
4579                      * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
4580                      * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
4581                      * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
4582                      * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
4583                  * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
4584                      * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
4585
4586             Returns:
4587                 New GEOM.GEOM_Object, containing processed shape.
4588
4589             Note: For more information look through SALOME Geometry User's Guide->
4590                   -> Introduction to Geometry-> Repairing Operations-> Shape Processing
4591             """
4592             # Example: see GEOM_TestHealing.py
4593             theValues,Parameters = ParseList(theValues)
4594             anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
4595             # To avoid script failure in case of good argument shape
4596             if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
4597                 return theShape
4598             RaiseIfFailed("ProcessShape", self.HealOp)
4599             for string in (theOperators + theParameters):
4600                 Parameters = ":" + Parameters
4601                 pass
4602             anObj.SetParameters(Parameters)
4603             return anObj
4604
4605         ## Remove faces from the given object (shape).
4606         #  @param theObject Shape to be processed.
4607         #  @param theFaces Indices of faces to be removed, if EMPTY then the method
4608         #                  removes ALL faces of the given object.
4609         #  @return New GEOM.GEOM_Object, containing processed shape.
4610         #
4611         #  @ref tui_suppress_faces "Example"
4612         def SuppressFaces(self,theObject, theFaces):
4613             """
4614             Remove faces from the given object (shape).
4615
4616             Parameters:
4617                 theObject Shape to be processed.
4618                 theFaces Indices of faces to be removed, if EMPTY then the method
4619                          removes ALL faces of the given object.
4620
4621             Returns:
4622                 New GEOM.GEOM_Object, containing processed shape.
4623             """
4624             # Example: see GEOM_TestHealing.py
4625             anObj = self.HealOp.SuppressFaces(theObject, theFaces)
4626             RaiseIfFailed("SuppressFaces", self.HealOp)
4627             return anObj
4628
4629         ## Sewing of some shapes into single shape.
4630         #  @param ListShape Shapes to be processed.
4631         #  @param theTolerance Required tolerance value.
4632         #  @return New GEOM.GEOM_Object, containing processed shape.
4633         #
4634         #  @ref tui_sewing "Example"
4635         def MakeSewing(self, ListShape, theTolerance):
4636             """
4637             Sewing of some shapes into single shape.
4638
4639             Parameters:
4640                 ListShape Shapes to be processed.
4641                 theTolerance Required tolerance value.
4642
4643             Returns:
4644                 New GEOM.GEOM_Object, containing processed shape.
4645             """
4646             # Example: see GEOM_TestHealing.py
4647             comp = self.MakeCompound(ListShape)
4648             anObj = self.Sew(comp, theTolerance)
4649             return anObj
4650
4651         ## Sewing of the given object.
4652         #  @param theObject Shape to be processed.
4653         #  @param theTolerance Required tolerance value.
4654         #  @return New GEOM.GEOM_Object, containing processed shape.
4655         def Sew(self, theObject, theTolerance):
4656             """
4657             Sewing of the given object.
4658
4659             Parameters:
4660                 theObject Shape to be processed.
4661                 theTolerance Required tolerance value.
4662
4663             Returns:
4664                 New GEOM.GEOM_Object, containing processed shape.
4665             """
4666             # Example: see MakeSewing() above
4667             theTolerance,Parameters = ParseParameters(theTolerance)
4668             anObj = self.HealOp.Sew(theObject, theTolerance)
4669             RaiseIfFailed("Sew", self.HealOp)
4670             anObj.SetParameters(Parameters)
4671             return anObj
4672
4673         ## Remove internal wires and edges from the given object (face).
4674         #  @param theObject Shape to be processed.
4675         #  @param theWires Indices of wires to be removed, if EMPTY then the method
4676         #                  removes ALL internal wires of the given object.
4677         #  @return New GEOM.GEOM_Object, containing processed shape.
4678         #
4679         #  @ref tui_suppress_internal_wires "Example"
4680         def SuppressInternalWires(self,theObject, theWires):
4681             """
4682             Remove internal wires and edges from the given object (face).
4683
4684             Parameters:
4685                 theObject Shape to be processed.
4686                 theWires Indices of wires to be removed, if EMPTY then the method
4687                          removes ALL internal wires of the given object.
4688
4689             Returns:                
4690                 New GEOM.GEOM_Object, containing processed shape.
4691             """
4692             # Example: see GEOM_TestHealing.py
4693             anObj = self.HealOp.RemoveIntWires(theObject, theWires)
4694             RaiseIfFailed("RemoveIntWires", self.HealOp)
4695             return anObj
4696
4697         ## Remove internal closed contours (holes) from the given object.
4698         #  @param theObject Shape to be processed.
4699         #  @param theWires Indices of wires to be removed, if EMPTY then the method
4700         #                  removes ALL internal holes of the given object
4701         #  @return New GEOM.GEOM_Object, containing processed shape.
4702         #
4703         #  @ref tui_suppress_holes "Example"
4704         def SuppressHoles(self,theObject, theWires):
4705             """
4706             Remove internal closed contours (holes) from the given object.
4707
4708             Parameters:
4709                 theObject Shape to be processed.
4710                 theWires Indices of wires to be removed, if EMPTY then the method
4711                          removes ALL internal holes of the given object
4712
4713             Returns:    
4714                 New GEOM.GEOM_Object, containing processed shape.
4715             """
4716             # Example: see GEOM_TestHealing.py
4717             anObj = self.HealOp.FillHoles(theObject, theWires)
4718             RaiseIfFailed("FillHoles", self.HealOp)
4719             return anObj
4720
4721         ## Close an open wire.
4722         #  @param theObject Shape to be processed.
4723         #  @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
4724         #                  if [ ], then <VAR>theObject</VAR> itself is a wire.
4725         #  @param isCommonVertex If True  : closure by creation of a common vertex,
4726         #                        If False : closure by creation of an edge between ends.
4727         #  @return New GEOM.GEOM_Object, containing processed shape.
4728         #
4729         #  @ref tui_close_contour "Example"
4730         def CloseContour(self,theObject, theWires, isCommonVertex):
4731             """
4732             Close an open wire.
4733
4734             Parameters: 
4735                 theObject Shape to be processed.
4736                 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
4737                          if [ ], then theObject itself is a wire.
4738                 isCommonVertex If True  : closure by creation of a common vertex,
4739                                If False : closure by creation of an edge between ends.
4740
4741             Returns:                      
4742                 New GEOM.GEOM_Object, containing processed shape. 
4743             """
4744             # Example: see GEOM_TestHealing.py
4745             anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
4746             RaiseIfFailed("CloseContour", self.HealOp)
4747             return anObj
4748
4749         ## Addition of a point to a given edge object.
4750         #  @param theObject Shape to be processed.
4751         #  @param theEdgeIndex Index of edge to be divided within theObject's shape,
4752         #                      if -1, then theObject itself is the edge.
4753         #  @param theValue Value of parameter on edge or length parameter,
4754         #                  depending on \a isByParameter.
4755         #  @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
4756         #                       if FALSE : \a theValue is treated as a length parameter [0..1]
4757         #  @return New GEOM.GEOM_Object, containing processed shape.
4758         #
4759         #  @ref tui_add_point_on_edge "Example"
4760         def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
4761             """
4762             Addition of a point to a given edge object.
4763
4764             Parameters: 
4765                 theObject Shape to be processed.
4766                 theEdgeIndex Index of edge to be divided within theObject's shape,
4767                              if -1, then theObject itself is the edge.
4768                 theValue Value of parameter on edge or length parameter,
4769                          depending on isByParameter.
4770                 isByParameter If TRUE :  theValue is treated as a curve parameter [0..1],
4771                               if FALSE : theValue is treated as a length parameter [0..1]
4772
4773             Returns:  
4774                 New GEOM.GEOM_Object, containing processed shape.
4775             """
4776             # Example: see GEOM_TestHealing.py
4777             theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
4778             anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
4779             RaiseIfFailed("DivideEdge", self.HealOp)
4780             anObj.SetParameters(Parameters)
4781             return anObj
4782
4783         ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
4784         #  @param theWire Wire to minimize the number of C1 continuous edges in.
4785         #  @param theVertices A list of vertices to suppress. If the list
4786         #                     is empty, all vertices in a wire will be assumed.
4787         #  @return New GEOM.GEOM_Object with modified wire.
4788         #
4789         #  @ref tui_fuse_collinear_edges "Example"
4790         def FuseCollinearEdgesWithinWire(self, theWire, theVertices = []):
4791             """
4792             Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
4793
4794             Parameters: 
4795                 theWire Wire to minimize the number of C1 continuous edges in.
4796                 theVertices A list of vertices to suppress. If the list
4797                             is empty, all vertices in a wire will be assumed.
4798
4799             Returns:  
4800                 New GEOM.GEOM_Object with modified wire.
4801             """
4802             anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
4803             RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
4804             return anObj
4805
4806         ## Change orientation of the given object. Updates given shape.
4807         #  @param theObject Shape to be processed.
4808         #  @return Updated <var>theObject</var>
4809         #
4810         #  @ref swig_todo "Example"
4811         def ChangeOrientationShell(self,theObject):
4812             """
4813             Change orientation of the given object. Updates given shape.
4814
4815             Parameters: 
4816                 theObject Shape to be processed.
4817
4818             Returns:  
4819                 Updated theObject
4820             """
4821             theObject = self.HealOp.ChangeOrientation(theObject)
4822             RaiseIfFailed("ChangeOrientation", self.HealOp)
4823             pass
4824
4825         ## Change orientation of the given object.
4826         #  @param theObject Shape to be processed.
4827         #  @return New GEOM.GEOM_Object, containing processed shape.
4828         #
4829         #  @ref swig_todo "Example"
4830         def ChangeOrientationShellCopy(self, theObject):
4831             """
4832             Change orientation of the given object.
4833
4834             Parameters:
4835                 theObject Shape to be processed.
4836
4837             Returns:   
4838                 New GEOM.GEOM_Object, containing processed shape.
4839             """
4840             anObj = self.HealOp.ChangeOrientationCopy(theObject)
4841             RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
4842             return anObj
4843
4844         ## Try to limit tolerance of the given object by value \a theTolerance.
4845         #  @param theObject Shape to be processed.
4846         #  @param theTolerance Required tolerance value.
4847         #  @return New GEOM.GEOM_Object, containing processed shape.
4848         #
4849         #  @ref tui_limit_tolerance "Example"
4850         def LimitTolerance(self, theObject, theTolerance = 1e-07):
4851             """
4852             Try to limit tolerance of the given object by value theTolerance.
4853
4854             Parameters:
4855                 theObject Shape to be processed.
4856                 theTolerance Required tolerance value.
4857
4858             Returns:   
4859                 New GEOM.GEOM_Object, containing processed shape.
4860             """
4861             anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
4862             RaiseIfFailed("LimitTolerance", self.HealOp)
4863             return anObj
4864
4865         ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
4866         #  that constitute a free boundary of the given shape.
4867         #  @param theObject Shape to get free boundary of.
4868         #  @return [\a status, \a theClosedWires, \a theOpenWires]
4869         #  \n \a status: FALSE, if an error(s) occured during the method execution.
4870         #  \n \a theClosedWires: Closed wires on the free boundary of the given shape.
4871         #  \n \a theOpenWires: Open wires on the free boundary of the given shape.
4872         #
4873         #  @ref tui_measurement_tools_page "Example"
4874         def GetFreeBoundary(self, theObject):
4875             """
4876             Get a list of wires (wrapped in GEOM.GEOM_Object-s),
4877             that constitute a free boundary of the given shape.
4878
4879             Parameters:
4880                 theObject Shape to get free boundary of.
4881
4882             Returns: 
4883                 [status, theClosedWires, theOpenWires]
4884                  status: FALSE, if an error(s) occured during the method execution.
4885                  theClosedWires: Closed wires on the free boundary of the given shape.
4886                  theOpenWires: Open wires on the free boundary of the given shape.
4887             """
4888             # Example: see GEOM_TestHealing.py
4889             anObj = self.HealOp.GetFreeBoundary(theObject)
4890             RaiseIfFailed("GetFreeBoundary", self.HealOp)
4891             return anObj
4892
4893         ## Replace coincident faces in theShape by one face.
4894         #  @param theShape Initial shape.
4895         #  @param theTolerance Maximum distance between faces, which can be considered as coincident.
4896         #  @param doKeepNonSolids If FALSE, only solids will present in the result,
4897         #                         otherwise all initial shapes.
4898         #  @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
4899         #
4900         #  @ref tui_glue_faces "Example"
4901         def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
4902             """
4903             Replace coincident faces in theShape by one face.
4904
4905             Parameters:
4906                 theShape Initial shape.
4907                 theTolerance Maximum distance between faces, which can be considered as coincident.
4908                 doKeepNonSolids If FALSE, only solids will present in the result,
4909                                 otherwise all initial shapes.
4910
4911             Returns:
4912                 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
4913             """
4914             # Example: see GEOM_Spanner.py
4915             theTolerance,Parameters = ParseParameters(theTolerance)
4916             anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
4917             if anObj is None:
4918                 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
4919             anObj.SetParameters(Parameters)
4920             return anObj
4921
4922         ## Find coincident faces in theShape for possible gluing.
4923         #  @param theShape Initial shape.
4924         #  @param theTolerance Maximum distance between faces,
4925         #                      which can be considered as coincident.
4926         #  @return GEOM.ListOfGO
4927         #
4928         #  @ref tui_glue_faces "Example"
4929         def GetGlueFaces(self, theShape, theTolerance):
4930             """
4931             Find coincident faces in theShape for possible gluing.
4932
4933             Parameters:
4934                 theShape Initial shape.
4935                 theTolerance Maximum distance between faces,
4936                              which can be considered as coincident.
4937
4938             Returns:                    
4939                 GEOM.ListOfGO
4940             """
4941             anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
4942             RaiseIfFailed("GetGlueFaces", self.ShapesOp)
4943             return anObj
4944
4945         ## Replace coincident faces in theShape by one face
4946         #  in compliance with given list of faces
4947         #  @param theShape Initial shape.
4948         #  @param theTolerance Maximum distance between faces,
4949         #                      which can be considered as coincident.
4950         #  @param theFaces List of faces for gluing.
4951         #  @param doKeepNonSolids If FALSE, only solids will present in the result,
4952         #                         otherwise all initial shapes.
4953         #  @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
4954         #                        will be glued, otherwise only the edges,
4955         #                        belonging to <VAR>theFaces</VAR>.
4956         #  @return New GEOM.GEOM_Object, containing a copy of theShape
4957         #          without some faces.
4958         #
4959         #  @ref tui_glue_faces "Example"
4960         def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
4961                                 doKeepNonSolids=True, doGlueAllEdges=True):
4962             """
4963             Replace coincident faces in theShape by one face
4964             in compliance with given list of faces
4965
4966             Parameters:
4967                 theShape Initial shape.
4968                 theTolerance Maximum distance between faces,
4969                              which can be considered as coincident.
4970                 theFaces List of faces for gluing.
4971                 doKeepNonSolids If FALSE, only solids will present in the result,
4972                                 otherwise all initial shapes.
4973                 doGlueAllEdges If TRUE, all coincident edges of theShape
4974                                will be glued, otherwise only the edges,
4975                                belonging to theFaces.
4976
4977             Returns:
4978                 New GEOM.GEOM_Object, containing a copy of theShape
4979                     without some faces.
4980             """
4981             anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
4982                                                       doKeepNonSolids, doGlueAllEdges)
4983             if anObj is None:
4984                 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
4985             return anObj
4986
4987         ## Replace coincident edges in theShape by one edge.
4988         #  @param theShape Initial shape.
4989         #  @param theTolerance Maximum distance between edges, which can be considered as coincident.
4990         #  @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
4991         #
4992         #  @ref tui_glue_edges "Example"
4993         def MakeGlueEdges(self, theShape, theTolerance):
4994             """
4995             Replace coincident edges in theShape by one edge.
4996
4997             Parameters:
4998                 theShape Initial shape.
4999                 theTolerance Maximum distance between edges, which can be considered as coincident.
5000
5001             Returns:    
5002                 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
5003             """
5004             theTolerance,Parameters = ParseParameters(theTolerance)
5005             anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
5006             if anObj is None:
5007                 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
5008             anObj.SetParameters(Parameters)
5009             return anObj
5010
5011         ## Find coincident edges in theShape for possible gluing.
5012         #  @param theShape Initial shape.
5013         #  @param theTolerance Maximum distance between edges,
5014         #                      which can be considered as coincident.
5015         #  @return GEOM.ListOfGO
5016         #
5017         #  @ref tui_glue_edges "Example"
5018         def GetGlueEdges(self, theShape, theTolerance):
5019             """
5020             Find coincident edges in theShape for possible gluing.
5021
5022             Parameters:
5023                 theShape Initial shape.
5024                 theTolerance Maximum distance between edges,
5025                              which can be considered as coincident.
5026
5027             Returns:                         
5028                 GEOM.ListOfGO
5029             """
5030             anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
5031             RaiseIfFailed("GetGlueEdges", self.ShapesOp)
5032             return anObj
5033
5034         ## Replace coincident edges in theShape by one edge
5035         #  in compliance with given list of edges.
5036         #  @param theShape Initial shape.
5037         #  @param theTolerance Maximum distance between edges,
5038         #                      which can be considered as coincident.
5039         #  @param theEdges List of edges for gluing.
5040         #  @return New GEOM.GEOM_Object, containing a copy of theShape
5041         #          without some edges.
5042         #
5043         #  @ref tui_glue_edges "Example"
5044         def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges):
5045             """
5046             Replace coincident edges in theShape by one edge
5047             in compliance with given list of edges.
5048
5049             Parameters:
5050                 theShape Initial shape.
5051                 theTolerance Maximum distance between edges,
5052                              which can be considered as coincident.
5053                 theEdges List of edges for gluing.
5054
5055             Returns:  
5056                 New GEOM.GEOM_Object, containing a copy of theShape
5057                 without some edges.
5058             """
5059             anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
5060             if anObj is None:
5061                 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
5062             return anObj
5063
5064         # end of l3_healing
5065         ## @}
5066
5067         ## @addtogroup l3_boolean Boolean Operations
5068         ## @{
5069
5070         # -----------------------------------------------------------------------------
5071         # Boolean (Common, Cut, Fuse, Section)
5072         # -----------------------------------------------------------------------------
5073
5074         ## Perform one of boolean operations on two given shapes.
5075         #  @param theShape1 First argument for boolean operation.
5076         #  @param theShape2 Second argument for boolean operation.
5077         #  @param theOperation Indicates the operation to be done:\n
5078         #                      1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
5079         #  @return New GEOM.GEOM_Object, containing the result shape.
5080         #
5081         #  @ref tui_fuse "Example"
5082         def MakeBoolean(self,theShape1, theShape2, theOperation):
5083             """
5084             Perform one of boolean operations on two given shapes.
5085
5086             Parameters: 
5087                 theShape1 First argument for boolean operation.
5088                 theShape2 Second argument for boolean operation.
5089                 theOperation Indicates the operation to be done:
5090                              1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
5091
5092             Returns:   
5093                 New GEOM.GEOM_Object, containing the result shape.
5094             """
5095             # Example: see GEOM_TestAll.py
5096             anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
5097             RaiseIfFailed("MakeBoolean", self.BoolOp)
5098             return anObj
5099
5100         ## Perform Common boolean operation on two given shapes.
5101         #  @param theShape1 First argument for boolean operation.
5102         #  @param theShape2 Second argument for boolean operation.
5103         #  @return New GEOM.GEOM_Object, containing the result shape.
5104         #
5105         #  @ref tui_common "Example 1"
5106         #  \n @ref swig_MakeCommon "Example 2"
5107         def MakeCommon(self, theShape1, theShape2):
5108             """
5109             Perform Common boolean operation on two given shapes.
5110
5111             Parameters: 
5112                 theShape1 First argument for boolean operation.
5113                 theShape2 Second argument for boolean operation.
5114  
5115             Returns:   
5116                 New GEOM.GEOM_Object, containing the result shape.
5117             """
5118             # Example: see GEOM_TestOthers.py
5119             return self.MakeBoolean(theShape1, theShape2, 1)
5120
5121         ## Perform Cut boolean operation on two given shapes.
5122         #  @param theShape1 First argument for boolean operation.
5123         #  @param theShape2 Second argument for boolean operation.
5124         #  @return New GEOM.GEOM_Object, containing the result shape.
5125         #
5126         #  @ref tui_cut "Example 1"
5127         #  \n @ref swig_MakeCommon "Example 2"
5128         def MakeCut(self, theShape1, theShape2):
5129             """
5130             Perform Cut boolean operation on two given shapes.
5131
5132             Parameters: 
5133                 theShape1 First argument for boolean operation.
5134                 theShape2 Second argument for boolean operation.
5135  
5136             Returns:   
5137                 New GEOM.GEOM_Object, containing the result shape.
5138             
5139             """
5140             # Example: see GEOM_TestOthers.py
5141             return self.MakeBoolean(theShape1, theShape2, 2)
5142
5143         ## Perform Fuse boolean operation on two given shapes.
5144         #  @param theShape1 First argument for boolean operation.
5145         #  @param theShape2 Second argument for boolean operation.
5146         #  @return New GEOM.GEOM_Object, containing the result shape.
5147         #
5148         #  @ref tui_fuse "Example 1"
5149         #  \n @ref swig_MakeCommon "Example 2"
5150         def MakeFuse(self, theShape1, theShape2):
5151             """
5152             Perform Fuse boolean operation on two given shapes.
5153
5154             Parameters: 
5155                 theShape1 First argument for boolean operation.
5156                 theShape2 Second argument for boolean operation.
5157  
5158             Returns:   
5159                 New GEOM.GEOM_Object, containing the result shape.
5160             
5161             """
5162             # Example: see GEOM_TestOthers.py
5163             return self.MakeBoolean(theShape1, theShape2, 3)
5164
5165         ## Perform Section boolean operation on two given shapes.
5166         #  @param theShape1 First argument for boolean operation.
5167         #  @param theShape2 Second argument for boolean operation.
5168         #  @return New GEOM.GEOM_Object, containing the result shape.
5169         #
5170         #  @ref tui_section "Example 1"
5171         #  \n @ref swig_MakeCommon "Example 2"
5172         def MakeSection(self, theShape1, theShape2):
5173             """
5174             Perform Section boolean operation on two given shapes.
5175
5176             Parameters: 
5177                 theShape1 First argument for boolean operation.
5178                 theShape2 Second argument for boolean operation.
5179  
5180             Returns:   
5181                 New GEOM.GEOM_Object, containing the result shape.
5182             
5183             """
5184             # Example: see GEOM_TestOthers.py
5185             return self.MakeBoolean(theShape1, theShape2, 4)
5186
5187         # end of l3_boolean
5188         ## @}
5189
5190         ## @addtogroup l3_basic_op
5191         ## @{
5192
5193         ## Perform partition operation.
5194         #  @param ListShapes Shapes to be intersected.
5195         #  @param ListTools Shapes to intersect theShapes.
5196         #  @param Limit Type of resulting shapes (see ShapeType()).\n
5197         #         If this parameter is set to -1 ("Auto"), most appropriate shape limit
5198         #         type will be detected automatically.
5199         #  @param KeepNonlimitShapes if this parameter == 0, then only shapes of
5200         #                             target type (equal to Limit) are kept in the result,
5201         #                             else standalone shapes of lower dimension
5202         #                             are kept also (if they exist).
5203         #  @note Each compound from ListShapes and ListTools will be exploded
5204         #        in order to avoid possible intersection between shapes from this compound.
5205         #
5206         #  After implementation new version of PartitionAlgo (October 2006)
5207         #  other parameters are ignored by current functionality. They are kept
5208         #  in this function only for support old versions.
5209         #      @param ListKeepInside Shapes, outside which the results will be deleted.
5210         #         Each shape from theKeepInside must belong to theShapes also.
5211         #      @param ListRemoveInside Shapes, inside which the results will be deleted.
5212         #         Each shape from theRemoveInside must belong to theShapes also.
5213         #      @param RemoveWebs If TRUE, perform Glue 3D algorithm.
5214         #      @param ListMaterials Material indices for each shape. Make sence,
5215         #         only if theRemoveWebs is TRUE.
5216         #
5217         #  @return New GEOM.GEOM_Object, containing the result shapes.
5218         #
5219         #  @ref tui_partition "Example"
5220         def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
5221                           Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
5222                           KeepNonlimitShapes=0):
5223             """
5224             Perform partition operation.
5225
5226             Parameters: 
5227                 ListShapes Shapes to be intersected.
5228                 ListTools Shapes to intersect theShapes.
5229                 Limit Type of resulting shapes (see geompy.ShapeType)
5230                       If this parameter is set to -1 ("Auto"), most appropriate shape limit
5231                       type will be detected automatically.
5232                 KeepNonlimitShapes if this parameter == 0, then only shapes of
5233                                     target type (equal to Limit) are kept in the result,
5234                                     else standalone shapes of lower dimension
5235                                     are kept also (if they exist).
5236             Note:
5237                     Each compound from ListShapes and ListTools will be exploded
5238                     in order to avoid possible intersection between shapes from
5239                     this compound.
5240                     
5241             After implementation new version of PartitionAlgo (October 2006) other
5242             parameters are ignored by current functionality. They are kept in this
5243             function only for support old versions.
5244             
5245             Ignored parameters:
5246                 ListKeepInside Shapes, outside which the results will be deleted.
5247                                Each shape from theKeepInside must belong to theShapes also.
5248                 ListRemoveInside Shapes, inside which the results will be deleted.
5249                                  Each shape from theRemoveInside must belong to theShapes also.
5250                 RemoveWebs If TRUE, perform Glue 3D algorithm.
5251                 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
5252
5253             Returns:   
5254                 New GEOM.GEOM_Object, containing the result shapes.
5255             """
5256             # Example: see GEOM_TestAll.py
5257             if Limit == ShapeType["AUTO"]:
5258                 # automatic detection of the most appropriate shape limit type
5259                 lim = GEOM.SHAPE
5260                 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
5261                 Limit = EnumToLong(lim)
5262                 pass
5263             anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
5264                                               ListKeepInside, ListRemoveInside,
5265                                               Limit, RemoveWebs, ListMaterials,
5266                                               KeepNonlimitShapes);
5267             RaiseIfFailed("MakePartition", self.BoolOp)
5268             return anObj
5269
5270         ## Perform partition operation.
5271         #  This method may be useful if it is needed to make a partition for
5272         #  compound contains nonintersected shapes. Performance will be better
5273         #  since intersection between shapes from compound is not performed.
5274         #
5275         #  Description of all parameters as in previous method MakePartition()
5276         #
5277         #  @note Passed compounds (via ListShapes or via ListTools)
5278         #           have to consist of nonintersecting shapes.
5279         #
5280         #  @return New GEOM.GEOM_Object, containing the result shapes.
5281         #
5282         #  @ref swig_todo "Example"
5283         def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
5284                                                  ListKeepInside=[], ListRemoveInside=[],
5285                                                  Limit=ShapeType["AUTO"], RemoveWebs=0,
5286                                                  ListMaterials=[], KeepNonlimitShapes=0):
5287             """
5288             Perform partition operation.
5289             This method may be useful if it is needed to make a partition for
5290             compound contains nonintersected shapes. Performance will be better
5291             since intersection between shapes from compound is not performed.
5292
5293             Parameters: 
5294                 Description of all parameters as in method geompy.MakePartition
5295         
5296             NOTE:
5297                 Passed compounds (via ListShapes or via ListTools)
5298                 have to consist of nonintersecting shapes.
5299
5300             Returns:   
5301                 New GEOM.GEOM_Object, containing the result shapes.
5302             """
5303             if Limit == ShapeType["AUTO"]:
5304                 # automatic detection of the most appropriate shape limit type
5305                 lim = GEOM.SHAPE
5306                 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
5307                 Limit = EnumToLong(lim)
5308                 pass
5309             anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
5310                                                                      ListKeepInside, ListRemoveInside,
5311                                                                      Limit, RemoveWebs, ListMaterials,
5312                                                                      KeepNonlimitShapes);
5313             RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
5314             return anObj
5315
5316         ## See method MakePartition() for more information.
5317         #
5318         #  @ref tui_partition "Example 1"
5319         #  \n @ref swig_Partition "Example 2"
5320         def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
5321                       Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
5322                       KeepNonlimitShapes=0):
5323             """
5324             See method geompy.MakePartition for more information.
5325             """
5326             # Example: see GEOM_TestOthers.py
5327             anObj = self.MakePartition(ListShapes, ListTools,
5328                                        ListKeepInside, ListRemoveInside,
5329                                        Limit, RemoveWebs, ListMaterials,
5330                                        KeepNonlimitShapes);
5331             return anObj
5332
5333         ## Perform partition of the Shape with the Plane
5334         #  @param theShape Shape to be intersected.
5335         #  @param thePlane Tool shape, to intersect theShape.
5336         #  @return New GEOM.GEOM_Object, containing the result shape.
5337         #
5338         #  @ref tui_partition "Example"
5339         def MakeHalfPartition(self,theShape, thePlane):
5340             """
5341             Perform partition of the Shape with the Plane
5342
5343             Parameters: 
5344                 theShape Shape to be intersected.
5345                 thePlane Tool shape, to intersect theShape.
5346
5347             Returns:  
5348                 New GEOM.GEOM_Object, containing the result shape.
5349             """
5350             # Example: see GEOM_TestAll.py
5351             anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
5352             RaiseIfFailed("MakeHalfPartition", self.BoolOp)
5353             return anObj
5354
5355         # end of l3_basic_op
5356         ## @}
5357
5358         ## @addtogroup l3_transform
5359         ## @{
5360
5361         ## Translate the given object along the vector, specified
5362         #  by its end points, creating its copy before the translation.
5363         #  @param theObject The object to be translated.
5364         #  @param thePoint1 Start point of translation vector.
5365         #  @param thePoint2 End point of translation vector.
5366         #  @return New GEOM.GEOM_Object, containing the translated object.
5367         #
5368         #  @ref tui_translation "Example 1"
5369         #  \n @ref swig_MakeTranslationTwoPoints "Example 2"
5370         def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
5371             """
5372             Translate the given object along the vector, specified
5373             by its end points, creating its copy before the translation.
5374
5375             Parameters: 
5376                 theObject The object to be translated.
5377                 thePoint1 Start point of translation vector.
5378                 thePoint2 End point of translation vector.
5379
5380             Returns:  
5381                 New GEOM.GEOM_Object, containing the translated object.
5382             """
5383             # Example: see GEOM_TestAll.py
5384             anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
5385             RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
5386             return anObj
5387
5388         ## Translate the given object along the vector, specified by its components.
5389         #  @param theObject The object to be translated.
5390         #  @param theDX,theDY,theDZ Components of translation vector.
5391         #  @return Translated GEOM.GEOM_Object.
5392         #
5393         #  @ref tui_translation "Example"
5394         def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
5395             """
5396             Translate the given object along the vector, specified by its components.
5397
5398             Parameters: 
5399                 theObject The object to be translated.
5400                 theDX,theDY,theDZ Components of translation vector.
5401
5402             Returns: 
5403                 Translated GEOM.GEOM_Object.
5404             """
5405             # Example: see GEOM_TestAll.py
5406             theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
5407             anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
5408             anObj.SetParameters(Parameters)
5409             RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
5410             return anObj
5411
5412         ## Translate the given object along the vector, specified
5413         #  by its components, creating its copy before the translation.
5414         #  @param theObject The object to be translated.
5415         #  @param theDX,theDY,theDZ Components of translation vector.
5416         #  @return New GEOM.GEOM_Object, containing the translated object.
5417         #
5418         #  @ref tui_translation "Example"
5419         def MakeTranslation(self,theObject, theDX, theDY, theDZ):
5420             """
5421             Translate the given object along the vector, specified
5422             by its components, creating its copy before the translation.
5423
5424             Parameters: 
5425                 theObject The object to be translated.
5426                 theDX,theDY,theDZ Components of translation vector.
5427
5428             Returns: 
5429                 New GEOM.GEOM_Object, containing the translated object.
5430             """
5431             # Example: see GEOM_TestAll.py
5432             theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
5433             anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
5434             anObj.SetParameters(Parameters)
5435             RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
5436             return anObj
5437
5438         ## Translate the given object along the given vector,
5439         #  creating its copy before the translation.
5440         #  @param theObject The object to be translated.
5441         #  @param theVector The translation vector.
5442         #  @return New GEOM.GEOM_Object, containing the translated object.
5443         #
5444         #  @ref tui_translation "Example"
5445         def MakeTranslationVector(self,theObject, theVector):
5446             """
5447             Translate the given object along the given vector,
5448             creating its copy before the translation.
5449
5450             Parameters: 
5451                 theObject The object to be translated.
5452                 theVector The translation vector.
5453
5454             Returns: 
5455                 New GEOM.GEOM_Object, containing the translated object.
5456             """
5457             # Example: see GEOM_TestAll.py
5458             anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
5459             RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
5460             return anObj
5461
5462         ## Translate the given object along the given vector on given distance.
5463         #  @param theObject The object to be translated.
5464         #  @param theVector The translation vector.
5465         #  @param theDistance The translation distance.
5466         #  @param theCopy Flag used to translate object itself or create a copy.
5467         #  @return New GEOM.GEOM_Object, containing the translated object.
5468         #
5469         #  @ref tui_translation "Example"
5470         def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
5471             """
5472             Translate the given object along the given vector on given distance.
5473
5474             Parameters: 
5475                 theObject The object to be translated.
5476                 theVector The translation vector.
5477                 theDistance The translation distance.
5478                 theCopy Flag used to translate object itself or create a copy.
5479
5480             Returns: 
5481                 New GEOM.GEOM_Object, containing the translated object.
5482             """
5483             # Example: see GEOM_TestAll.py
5484             theDistance,Parameters = ParseParameters(theDistance)
5485             anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
5486             RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
5487             anObj.SetParameters(Parameters)
5488             return anObj
5489
5490         ## Translate the given object along the given vector on given distance,
5491         #  creating its copy before the translation.
5492         #  @param theObject The object to be translated.
5493         #  @param theVector The translation vector.
5494         #  @param theDistance The translation distance.
5495         #  @return New GEOM.GEOM_Object, containing the translated object.
5496         #
5497         #  @ref tui_translation "Example"
5498         def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
5499             """
5500             Translate the given object along the given vector on given distance,
5501             creating its copy before the translation.
5502
5503             Parameters:
5504                 theObject The object to be translated.
5505                 theVector The translation vector.
5506                 theDistance The translation distance.
5507
5508             Returns: 
5509                 New GEOM.GEOM_Object, containing the translated object.
5510             """
5511             # Example: see GEOM_TestAll.py
5512             theDistance,Parameters = ParseParameters(theDistance)
5513             anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
5514             RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
5515             anObj.SetParameters(Parameters)
5516             return anObj
5517
5518         ## Rotate the given object around the given axis on the given angle.
5519         #  @param theObject The object to be rotated.
5520         #  @param theAxis Rotation axis.
5521         #  @param theAngle Rotation angle in radians.
5522         #  @return New GEOM.GEOM_Object, containing the rotated object.
5523         #
5524         #  @ref tui_rotation "Example"
5525         def Rotate(self,theObject, theAxis, theAngle):
5526             """
5527             Rotate the given object around the given axis on the given angle.
5528
5529             Parameters:
5530                 theObject The object to be rotated.
5531                 theAxis Rotation axis.
5532                 theAngle Rotation angle in radians.
5533
5534             Returns: 
5535                 New GEOM.GEOM_Object, containing the rotated object.
5536             """
5537             # Example: see GEOM_TestAll.py
5538             flag = False
5539             if isinstance(theAngle,str):
5540                 flag = True
5541             theAngle, Parameters = ParseParameters(theAngle)
5542             if flag:
5543                 theAngle = theAngle*math.pi/180.0
5544             anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
5545             RaiseIfFailed("RotateCopy", self.TrsfOp)
5546             anObj.SetParameters(Parameters)
5547             return anObj
5548
5549         ## Rotate the given object around the given axis
5550         #  on the given angle, creating its copy before the rotatation.
5551         #  @param theObject The object to be rotated.
5552         #  @param theAxis Rotation axis.
5553         #  @param theAngle Rotation angle in radians.
5554         #  @return New GEOM.GEOM_Object, containing the rotated object.
5555         #
5556         #  @ref tui_rotation "Example"
5557         def MakeRotation(self,theObject, theAxis, theAngle):
5558             """
5559             Rotate the given object around the given axis
5560             on the given angle, creating its copy before the rotatation.
5561
5562             Parameters:
5563                 theObject The object to be rotated.
5564                 theAxis Rotation axis.
5565                 theAngle Rotation angle in radians.
5566
5567             Returns:
5568                 New GEOM.GEOM_Object, containing the rotated object.
5569             """
5570             # Example: see GEOM_TestAll.py
5571             flag = False
5572             if isinstance(theAngle,str):
5573                 flag = True
5574             theAngle, Parameters = ParseParameters(theAngle)
5575             if flag:
5576                 theAngle = theAngle*math.pi/180.0
5577             anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
5578             RaiseIfFailed("RotateCopy", self.TrsfOp)
5579             anObj.SetParameters(Parameters)
5580             return anObj
5581
5582         ## Rotate given object around vector perpendicular to plane
5583         #  containing three points, creating its copy before the rotatation.
5584         #  @param theObject The object to be rotated.
5585         #  @param theCentPoint central point the axis is the vector perpendicular to the plane
5586         #  containing the three points.
5587         #  @param thePoint1,thePoint2 in a perpendicular plane of the axis.
5588         #  @return New GEOM.GEOM_Object, containing the rotated object.
5589         #
5590         #  @ref tui_rotation "Example"
5591         def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
5592             """
5593             Rotate given object around vector perpendicular to plane
5594             containing three points, creating its copy before the rotatation.
5595
5596             Parameters:
5597                 theObject The object to be rotated.
5598                 theCentPoint central point  the axis is the vector perpendicular to the plane
5599                              containing the three points.
5600                 thePoint1,thePoint2  in a perpendicular plane of the axis.
5601
5602             Returns:
5603                 New GEOM.GEOM_Object, containing the rotated object.
5604             """
5605             # Example: see GEOM_TestAll.py
5606             anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
5607             RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
5608             return anObj
5609
5610         ## Scale the given object by the factor, creating its copy before the scaling.
5611         #  @param theObject The object to be scaled.
5612         #  @param thePoint Center point for scaling.
5613         #                  Passing None for it means scaling relatively the origin of global CS.
5614         #  @param theFactor Scaling factor value.
5615         #  @return New GEOM.GEOM_Object, containing the scaled shape.
5616         #
5617         #  @ref tui_scale "Example"
5618         def MakeScaleTransform(self, theObject, thePoint, theFactor):
5619             """
5620             Scale the given object by the factor, creating its copy before the scaling.
5621
5622             Parameters:
5623                 theObject The object to be scaled.
5624                 thePoint Center point for scaling.
5625                          Passing None for it means scaling relatively the origin of global CS.
5626                 theFactor Scaling factor value.
5627
5628             Returns:    
5629                 New GEOM.GEOM_Object, containing the scaled shape.
5630             """
5631             # Example: see GEOM_TestAll.py
5632             theFactor, Parameters = ParseParameters(theFactor)
5633             anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
5634             RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
5635             anObj.SetParameters(Parameters)
5636             return anObj
5637
5638         ## Scale the given object by different factors along coordinate axes,
5639         #  creating its copy before the scaling.
5640         #  @param theObject The object to be scaled.
5641         #  @param thePoint Center point for scaling.
5642         #                  Passing None for it means scaling relatively the origin of global CS.
5643         #  @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
5644         #  @return New GEOM.GEOM_Object, containing the scaled shape.
5645         #
5646         #  @ref swig_scale "Example"
5647         def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
5648             """
5649             Scale the given object by different factors along coordinate axes,
5650             creating its copy before the scaling.
5651
5652             Parameters:
5653                 theObject The object to be scaled.
5654                 thePoint Center point for scaling.
5655                             Passing None for it means scaling relatively the origin of global CS.
5656                 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
5657
5658             Returns:
5659                 New GEOM.GEOM_Object, containing the scaled shape.
5660             """
5661             # Example: see GEOM_TestAll.py
5662             theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
5663             anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
5664                                                         theFactorX, theFactorY, theFactorZ)
5665             RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
5666             anObj.SetParameters(Parameters)
5667             return anObj
5668
5669         ## Create an object, symmetrical
5670         #  to the given one relatively the given plane.
5671         #  @param theObject The object to be mirrored.
5672         #  @param thePlane Plane of symmetry.
5673         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
5674         #
5675         #  @ref tui_mirror "Example"
5676         def MakeMirrorByPlane(self,theObject, thePlane):
5677             """
5678             Create an object, symmetrical to the given one relatively the given plane.
5679
5680             Parameters:
5681                 theObject The object to be mirrored.
5682                 thePlane Plane of symmetry.
5683
5684             Returns:
5685                 New GEOM.GEOM_Object, containing the mirrored shape.
5686             """
5687             # Example: see GEOM_TestAll.py
5688             anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
5689             RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
5690             return anObj
5691
5692         ## Create an object, symmetrical
5693         #  to the given one relatively the given axis.
5694         #  @param theObject The object to be mirrored.
5695         #  @param theAxis Axis of symmetry.
5696         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
5697         #
5698         #  @ref tui_mirror "Example"
5699         def MakeMirrorByAxis(self,theObject, theAxis):
5700             """
5701             Create an object, symmetrical to the given one relatively the given axis.
5702
5703             Parameters:
5704                 theObject The object to be mirrored.
5705                 theAxis Axis of symmetry.
5706
5707             Returns: 
5708                 New GEOM.GEOM_Object, containing the mirrored shape.
5709             """
5710             # Example: see GEOM_TestAll.py
5711             anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
5712             RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
5713             return anObj
5714
5715         ## Create an object, symmetrical
5716         #  to the given one relatively the given point.
5717         #  @param theObject The object to be mirrored.
5718         #  @param thePoint Point of symmetry.
5719         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
5720         #
5721         #  @ref tui_mirror "Example"
5722         def MakeMirrorByPoint(self,theObject, thePoint):
5723             """
5724             Create an object, symmetrical
5725             to the given one relatively the given point.
5726
5727             Parameters:
5728                 theObject The object to be mirrored.
5729                 thePoint Point of symmetry.
5730
5731             Returns:  
5732                 New GEOM.GEOM_Object, containing the mirrored shape.
5733             """
5734             # Example: see GEOM_TestAll.py
5735             anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
5736             RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
5737             return anObj
5738
5739         ## Modify the Location of the given object by LCS,
5740         #  creating its copy before the setting.
5741         #  @param theObject The object to be displaced.
5742         #  @param theStartLCS Coordinate system to perform displacement from it.\n
5743         #                     If \a theStartLCS is NULL, displacement
5744         #                     will be performed from global CS.\n
5745         #                     If \a theObject itself is used as \a theStartLCS,
5746         #                     its location will be changed to \a theEndLCS.
5747         #  @param theEndLCS Coordinate system to perform displacement to it.
5748         #  @return New GEOM.GEOM_Object, containing the displaced shape.
5749         #
5750         #  @ref tui_modify_location "Example"
5751         def MakePosition(self,theObject, theStartLCS, theEndLCS):
5752             """
5753             Modify the Location of the given object by LCS, creating its copy before the setting.
5754
5755             Parameters:
5756                 theObject The object to be displaced.
5757                 theStartLCS Coordinate system to perform displacement from it.
5758                             If theStartLCS is NULL, displacement
5759                             will be performed from global CS.
5760                             If theObject itself is used as theStartLCS,
5761                             its location will be changed to theEndLCS.
5762                 theEndLCS Coordinate system to perform displacement to it.
5763
5764             Returns:  
5765                 New GEOM.GEOM_Object, containing the displaced shape.
5766
5767             Example of usage:
5768                 # create local coordinate systems
5769                 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
5770                 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
5771                 # modify the location of the given object
5772                 position = geompy.MakePosition(cylinder, cs1, cs2)
5773             """
5774             # Example: see GEOM_TestAll.py
5775             anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
5776             RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
5777             return anObj
5778
5779         ## Modify the Location of the given object by Path,
5780         #  @param  theObject The object to be displaced.
5781         #  @param  thePath Wire or Edge along that the object will be translated.
5782         #  @param  theDistance progress of Path (0 = start location, 1 = end of path location).
5783         #  @param  theCopy is to create a copy objects if true.
5784         #  @param  theReverse  0 - for usual direction, 1 - to reverse path direction.
5785         #  @return New GEOM.GEOM_Object, containing the displaced shape.
5786         #
5787         #  @ref tui_modify_location "Example"
5788         def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
5789             """
5790             Modify the Location of the given object by Path
5791
5792             Parameters:
5793                  theObject The object to be displaced.
5794                  thePath Wire or Edge along that the object will be translated.
5795                  theDistance progress of Path (0 = start location, 1 = end of path location).
5796                  theCopy is to create a copy objects if true.
5797                  theReverse  0 - for usual direction, 1 - to reverse path direction.
5798
5799             Returns:  
5800                 New GEOM.GEOM_Object, containing the displaced shape.
5801
5802             Example of usage:
5803                 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
5804             """
5805             # Example: see GEOM_TestAll.py
5806             anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
5807             RaiseIfFailed("PositionAlongPath", self.TrsfOp)
5808             return anObj
5809
5810         ## Create new object as offset of the given one.
5811         #  @param theObject The base object for the offset.
5812         #  @param theOffset Offset value.
5813         #  @return New GEOM.GEOM_Object, containing the offset object.
5814         #
5815         #  @ref tui_offset "Example"
5816         def MakeOffset(self,theObject, theOffset):
5817             """
5818             Create new object as offset of the given one.
5819
5820             Parameters:
5821                 theObject The base object for the offset.
5822                 theOffset Offset value.
5823
5824             Returns:  
5825                 New GEOM.GEOM_Object, containing the offset object.
5826
5827             Example of usage:
5828                  box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
5829                  # create a new object as offset of the given object
5830                  offset = geompy.MakeOffset(box, 70.)
5831             """
5832             # Example: see GEOM_TestAll.py
5833             theOffset, Parameters = ParseParameters(theOffset)
5834             anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
5835             RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
5836             anObj.SetParameters(Parameters)
5837             return anObj
5838
5839         ## Create new object as projection of the given one on a 2D surface.
5840         #  @param theSource The source object for the projection. It can be a point, edge or wire.
5841         #  @param theTarget The target object. It can be planar or cylindrical face.
5842         #  @return New GEOM.GEOM_Object, containing the projection.
5843         #
5844         #  @ref tui_projection "Example"
5845         def MakeProjection(self, theSource, theTarget):
5846             """
5847             Create new object as projection of the given one on a 2D surface.
5848
5849             Parameters:
5850                 theSource The source object for the projection. It can be a point, edge or wire.
5851                 theTarget The target object. It can be planar or cylindrical face.
5852
5853             Returns:  
5854                 New GEOM.GEOM_Object, containing the projection.
5855             """
5856             # Example: see GEOM_TestAll.py
5857             anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
5858             RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
5859             return anObj
5860
5861         # -----------------------------------------------------------------------------
5862         # Patterns
5863         # -----------------------------------------------------------------------------
5864
5865         ## Translate the given object along the given vector a given number times
5866         #  @param theObject The object to be translated.
5867         #  @param theVector Direction of the translation.
5868         #  @param theStep Distance to translate on.
5869         #  @param theNbTimes Quantity of translations to be done.
5870         #  @return New GEOM.GEOM_Object, containing compound of all
5871         #          the shapes, obtained after each translation.
5872         #
5873         #  @ref tui_multi_translation "Example"
5874         def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
5875             """
5876             Translate the given object along the given vector a given number times
5877
5878             Parameters:
5879                 theObject The object to be translated.
5880                 theVector Direction of the translation.
5881                 theStep Distance to translate on.
5882                 theNbTimes Quantity of translations to be done.
5883
5884             Returns:     
5885                 New GEOM.GEOM_Object, containing compound of all
5886                 the shapes, obtained after each translation.
5887
5888             Example of usage:
5889                 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
5890             """
5891             # Example: see GEOM_TestAll.py
5892             theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
5893             anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
5894             RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
5895             anObj.SetParameters(Parameters)
5896             return anObj
5897
5898         ## Conseqently apply two specified translations to theObject specified number of times.
5899         #  @param theObject The object to be translated.
5900         #  @param theVector1 Direction of the first translation.
5901         #  @param theStep1 Step of the first translation.
5902         #  @param theNbTimes1 Quantity of translations to be done along theVector1.
5903         #  @param theVector2 Direction of the second translation.
5904         #  @param theStep2 Step of the second translation.
5905         #  @param theNbTimes2 Quantity of translations to be done along theVector2.
5906         #  @return New GEOM.GEOM_Object, containing compound of all
5907         #          the shapes, obtained after each translation.
5908         #
5909         #  @ref tui_multi_translation "Example"
5910         def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
5911                                    theVector2, theStep2, theNbTimes2):
5912             """
5913             Conseqently apply two specified translations to theObject specified number of times.
5914
5915             Parameters:
5916                 theObject The object to be translated.
5917                 theVector1 Direction of the first translation.
5918                 theStep1 Step of the first translation.
5919                 theNbTimes1 Quantity of translations to be done along theVector1.
5920                 theVector2 Direction of the second translation.
5921                 theStep2 Step of the second translation.
5922                 theNbTimes2 Quantity of translations to be done along theVector2.
5923
5924             Returns:
5925                 New GEOM.GEOM_Object, containing compound of all
5926                 the shapes, obtained after each translation.
5927
5928             Example of usage:
5929                 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
5930             """
5931             # Example: see GEOM_TestAll.py
5932             theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
5933             anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
5934                                                  theVector2, theStep2, theNbTimes2)
5935             RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
5936             anObj.SetParameters(Parameters)
5937             return anObj
5938
5939         ## Rotate the given object around the given axis a given number times.
5940         #  Rotation angle will be 2*PI/theNbTimes.
5941         #  @param theObject The object to be rotated.
5942         #  @param theAxis The rotation axis.
5943         #  @param theNbTimes Quantity of rotations to be done.
5944         #  @return New GEOM.GEOM_Object, containing compound of all the
5945         #          shapes, obtained after each rotation.
5946         #
5947         #  @ref tui_multi_rotation "Example"
5948         def MultiRotate1D(self,theObject, theAxis, theNbTimes):
5949             """
5950             Rotate the given object around the given axis a given number times.
5951             Rotation angle will be 2*PI/theNbTimes.
5952
5953             Parameters:
5954                 theObject The object to be rotated.
5955                 theAxis The rotation axis.
5956                 theNbTimes Quantity of rotations to be done.
5957
5958             Returns:     
5959                 New GEOM.GEOM_Object, containing compound of all the
5960                 shapes, obtained after each rotation.
5961
5962             Example of usage:
5963                 rot1d = geompy.MultiRotate1D(prism, vect, 4)
5964             """
5965             # Example: see GEOM_TestAll.py
5966             theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
5967             anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
5968             RaiseIfFailed("MultiRotate1D", self.TrsfOp)
5969             anObj.SetParameters(Parameters)
5970             return anObj
5971
5972         ## Rotate the given object around the
5973         #  given axis on the given angle a given number
5974         #  times and multi-translate each rotation result.
5975         #  Translation direction passes through center of gravity
5976         #  of rotated shape and its projection on the rotation axis.
5977         #  @param theObject The object to be rotated.
5978         #  @param theAxis Rotation axis.
5979         #  @param theAngle Rotation angle in graduces.
5980         #  @param theNbTimes1 Quantity of rotations to be done.
5981         #  @param theStep Translation distance.
5982         #  @param theNbTimes2 Quantity of translations to be done.
5983         #  @return New GEOM.GEOM_Object, containing compound of all the
5984         #          shapes, obtained after each transformation.
5985         #
5986         #  @ref tui_multi_rotation "Example"
5987         def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
5988             """
5989             Rotate the given object around the
5990             given axis on the given angle a given number
5991             times and multi-translate each rotation result.
5992             Translation direction passes through center of gravity
5993             of rotated shape and its projection on the rotation axis.
5994
5995             Parameters:
5996                 theObject The object to be rotated.
5997                 theAxis Rotation axis.
5998                 theAngle Rotation angle in graduces.
5999                 theNbTimes1 Quantity of rotations to be done.
6000                 theStep Translation distance.
6001                 theNbTimes2 Quantity of translations to be done.
6002
6003             Returns:    
6004                 New GEOM.GEOM_Object, containing compound of all the
6005                 shapes, obtained after each transformation.
6006
6007             Example of usage:
6008                 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
6009             """
6010             # Example: see GEOM_TestAll.py
6011             theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
6012             anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
6013             RaiseIfFailed("MultiRotate2D", self.TrsfOp)
6014             anObj.SetParameters(Parameters)
6015             return anObj
6016
6017         ## The same, as MultiRotate1D(), but axis is given by direction and point
6018         #
6019         #  @ref swig_MakeMultiRotation "Example"
6020         def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
6021             """
6022             The same, as geompy.MultiRotate1D, but axis is given by direction and point
6023
6024             Example of usage:
6025                 pz = geompy.MakeVertex(0, 0, 100)
6026                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
6027                 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
6028             """
6029             # Example: see GEOM_TestOthers.py
6030             aVec = self.MakeLine(aPoint,aDir)
6031             anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
6032             return anObj
6033
6034         ## The same, as MultiRotate2D(), but axis is given by direction and point
6035         #
6036         #  @ref swig_MakeMultiRotation "Example"
6037         def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
6038             """
6039             The same, as MultiRotate2D(), but axis is given by direction and point
6040             
6041             Example of usage:
6042                 pz = geompy.MakeVertex(0, 0, 100)
6043                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
6044                 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
6045             """
6046             # Example: see GEOM_TestOthers.py
6047             aVec = self.MakeLine(aPoint,aDir)
6048             anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
6049             return anObj
6050
6051         # end of l3_transform
6052         ## @}
6053
6054         ## @addtogroup l3_local
6055         ## @{
6056
6057         ## Perform a fillet on all edges of the given shape.
6058         #  @param theShape Shape, to perform fillet on.
6059         #  @param theR Fillet radius.
6060         #  @return New GEOM.GEOM_Object, containing the result shape.
6061         #
6062         #  @ref tui_fillet "Example 1"
6063         #  \n @ref swig_MakeFilletAll "Example 2"
6064         def MakeFilletAll(self,theShape, theR):
6065             """
6066             Perform a fillet on all edges of the given shape.
6067
6068             Parameters:
6069                 theShape Shape, to perform fillet on.
6070                 theR Fillet radius.
6071
6072             Returns: 
6073                 New GEOM.GEOM_Object, containing the result shape.
6074
6075             Example of usage: 
6076                filletall = geompy.MakeFilletAll(prism, 10.) 
6077             """
6078             # Example: see GEOM_TestOthers.py
6079             theR,Parameters = ParseParameters(theR)
6080             anObj = self.LocalOp.MakeFilletAll(theShape, theR)
6081             RaiseIfFailed("MakeFilletAll", self.LocalOp)
6082             anObj.SetParameters(Parameters)
6083             return anObj
6084
6085         ## Perform a fillet on the specified edges/faces of the given shape
6086         #  @param theShape Shape, to perform fillet on.
6087         #  @param theR Fillet radius.
6088         #  @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
6089         #  @param theListShapes Global indices of edges/faces to perform fillet on.
6090         #    \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6091         #  @return New GEOM.GEOM_Object, containing the result shape.
6092         #
6093         #  @ref tui_fillet "Example"
6094         def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
6095             """
6096             Perform a fillet on the specified edges/faces of the given shape
6097
6098             Parameters:
6099                 theShape Shape, to perform fillet on.
6100                 theR Fillet radius.
6101                 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
6102                 theListShapes Global indices of edges/faces to perform fillet on.
6103
6104             Note:
6105                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6106
6107             Returns: 
6108                 New GEOM.GEOM_Object, containing the result shape.
6109
6110             Example of usage:
6111                 # get the list of IDs (IDList) for the fillet
6112                 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
6113                 IDlist_e = []
6114                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
6115                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
6116                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
6117                 # make a fillet on the specified edges of the given shape
6118                 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
6119             """
6120             # Example: see GEOM_TestAll.py
6121             theR,Parameters = ParseParameters(theR)
6122             anObj = None
6123             if theShapeType == ShapeType["EDGE"]:
6124                 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
6125                 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
6126             else:
6127                 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
6128                 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
6129             anObj.SetParameters(Parameters)
6130             return anObj
6131
6132         ## The same that MakeFillet() but with two Fillet Radius R1 and R2
6133         def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
6134             """
6135             The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
6136
6137             Example of usage:
6138                 # get the list of IDs (IDList) for the fillet
6139                 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
6140                 IDlist_e = []
6141                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
6142                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
6143                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
6144                 # make a fillet on the specified edges of the given shape
6145                 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
6146             """
6147             theR1,theR2,Parameters = ParseParameters(theR1,theR2)
6148             anObj = None
6149             if theShapeType == ShapeType["EDGE"]:
6150                 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
6151                 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
6152             else:
6153                 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
6154                 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
6155             anObj.SetParameters(Parameters)
6156             return anObj
6157
6158         ## Perform a fillet on the specified edges of the given shape
6159         #  @param theShape  Wire Shape to perform fillet on.
6160         #  @param theR  Fillet radius.
6161         #  @param theListOfVertexes Global indices of vertexes to perform fillet on.
6162         #    \note Global index of sub-shape can be obtained, using method GetSubShapeID()
6163         #    \note The list of vertices could be empty,
6164         #          in this case fillet will done done at all vertices in wire
6165         #  @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
6166         #         by the length of the edges, nearest to the fillet vertex.
6167         #         But sometimes the next edge is C1 continuous with the one, nearest to
6168         #         the fillet point, and such two (or more) edges can be united to allow
6169         #         bigger radius. Set this flag to TRUE to allow collinear edges union,
6170         #         thus ignoring the secant vertex (vertices).
6171         #  @return New GEOM.GEOM_Object, containing the result shape.
6172         #
6173         #  @ref tui_fillet2d "Example"
6174         def MakeFillet1D(self,theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True):
6175             """
6176             Perform a fillet on the specified edges of the given shape
6177
6178             Parameters:
6179                 theShape  Wire Shape to perform fillet on.
6180                 theR  Fillet radius.
6181                 theListOfVertexes Global indices of vertexes to perform fillet on.
6182                 doIgnoreSecantVertices If FALSE, fillet radius is always limited
6183                     by the length of the edges, nearest to the fillet vertex.
6184                     But sometimes the next edge is C1 continuous with the one, nearest to
6185                     the fillet point, and such two (or more) edges can be united to allow
6186                     bigger radius. Set this flag to TRUE to allow collinear edges union,
6187                     thus ignoring the secant vertex (vertices).
6188             Note:
6189                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6190
6191                 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
6192
6193             Returns: 
6194                 New GEOM.GEOM_Object, containing the result shape.
6195
6196             Example of usage:  
6197                 # create wire
6198                 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
6199                 # make fillet at given wire vertices with giver radius
6200                 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
6201             """
6202             # Example: see GEOM_TestAll.py
6203             theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
6204             anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
6205             RaiseIfFailed("MakeFillet1D", self.LocalOp)
6206             anObj.SetParameters(Parameters)
6207             return anObj
6208
6209         ## Perform a fillet at the specified vertices of the given face/shell.
6210         #  @param theShape Face or Shell shape to perform fillet on.
6211         #  @param theR Fillet radius.
6212         #  @param theListOfVertexes Global indices of vertexes to perform fillet on.
6213         #    \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6214         #  @return New GEOM.GEOM_Object, containing the result shape.
6215         #
6216         #  @ref tui_fillet2d "Example"
6217         def MakeFillet2D(self, theShape, theR, theListOfVertexes):
6218             """
6219             Perform a fillet at the specified vertices of the given face/shell.
6220
6221             Parameters:
6222                 theShape  Face or Shell shape to perform fillet on.
6223                 theR  Fillet radius.
6224                 theListOfVertexes Global indices of vertexes to perform fillet on.
6225             Note:
6226                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6227
6228             Returns: 
6229                 New GEOM.GEOM_Object, containing the result shape.
6230
6231             Example of usage:
6232                 face = geompy.MakeFaceHW(100, 100, 1)
6233                 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
6234             """
6235             # Example: see GEOM_TestAll.py
6236             theR,Parameters = ParseParameters(theR)
6237             anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
6238             RaiseIfFailed("MakeFillet2D", self.LocalOp)
6239             anObj.SetParameters(Parameters)
6240             return anObj
6241
6242         ## Perform a symmetric chamfer on all edges of the given shape.
6243         #  @param theShape Shape, to perform chamfer on.
6244         #  @param theD Chamfer size along each face.
6245         #  @return New GEOM.GEOM_Object, containing the result shape.
6246         #
6247         #  @ref tui_chamfer "Example 1"
6248         #  \n @ref swig_MakeChamferAll "Example 2"
6249         def MakeChamferAll(self,theShape, theD):
6250             """
6251             Perform a symmetric chamfer on all edges of the given shape.
6252
6253             Parameters:
6254                 theShape Shape, to perform chamfer on.
6255                 theD Chamfer size along each face.
6256
6257             Returns:     
6258                 New GEOM.GEOM_Object, containing the result shape.
6259
6260             Example of usage:
6261                 chamfer_all = geompy.MakeChamferAll(prism, 10.)
6262             """
6263             # Example: see GEOM_TestOthers.py
6264             theD,Parameters = ParseParameters(theD)
6265             anObj = self.LocalOp.MakeChamferAll(theShape, theD)
6266             RaiseIfFailed("MakeChamferAll", self.LocalOp)
6267             anObj.SetParameters(Parameters)
6268             return anObj
6269
6270         ## Perform a chamfer on edges, common to the specified faces,
6271         #  with distance D1 on the Face1
6272         #  @param theShape Shape, to perform chamfer on.
6273         #  @param theD1 Chamfer size along \a theFace1.
6274         #  @param theD2 Chamfer size along \a theFace2.
6275         #  @param theFace1,theFace2 Global indices of two faces of \a theShape.
6276         #    \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6277         #  @return New GEOM.GEOM_Object, containing the result shape.
6278         #
6279         #  @ref tui_chamfer "Example"
6280         def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
6281             """
6282             Perform a chamfer on edges, common to the specified faces,
6283             with distance D1 on the Face1
6284
6285             Parameters:
6286                 theShape Shape, to perform chamfer on.
6287                 theD1 Chamfer size along theFace1.
6288                 theD2 Chamfer size along theFace2.
6289                 theFace1,theFace2 Global indices of two faces of theShape.
6290
6291             Note:
6292                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6293
6294             Returns:      
6295                 New GEOM.GEOM_Object, containing the result shape.
6296
6297             Example of usage:
6298                 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
6299                 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
6300                 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
6301                 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
6302             """
6303             # Example: see GEOM_TestAll.py
6304             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6305             anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
6306             RaiseIfFailed("MakeChamferEdge", self.LocalOp)
6307             anObj.SetParameters(Parameters)
6308             return anObj
6309
6310         ## Perform a chamfer on edges
6311         #  @param theShape Shape, to perform chamfer on.
6312         #  @param theD Chamfer length
6313         #  @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6314         #  @param theFace1,theFace2 Global indices of two faces of \a theShape.
6315         #    \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6316         #  @return New GEOM.GEOM_Object, containing the result shape.
6317         def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
6318             """
6319             Perform a chamfer on edges
6320
6321             Parameters:
6322                 theShape Shape, to perform chamfer on.
6323                 theD1 Chamfer size along theFace1.
6324                 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
6325                 theFace1,theFace2 Global indices of two faces of theShape.
6326
6327             Note:
6328                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6329
6330             Returns:      
6331                 New GEOM.GEOM_Object, containing the result shape.
6332
6333             Example of usage:
6334                 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
6335                 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
6336                 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
6337                 ang = 30
6338                 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
6339             """
6340             flag = False
6341             if isinstance(theAngle,str):
6342                 flag = True
6343             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6344             if flag:
6345                 theAngle = theAngle*math.pi/180.0
6346             anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
6347             RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
6348             anObj.SetParameters(Parameters)
6349             return anObj
6350
6351         ## Perform a chamfer on all edges of the specified faces,
6352         #  with distance D1 on the first specified face (if several for one edge)
6353         #  @param theShape Shape, to perform chamfer on.
6354         #  @param theD1 Chamfer size along face from \a theFaces. If both faces,
6355         #               connected to the edge, are in \a theFaces, \a theD1
6356         #               will be get along face, which is nearer to \a theFaces beginning.
6357         #  @param theD2 Chamfer size along another of two faces, connected to the edge.
6358         #  @param theFaces Sequence of global indices of faces of \a theShape.
6359         #    \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6360         #  @return New GEOM.GEOM_Object, containing the result shape.
6361         #
6362         #  @ref tui_chamfer "Example"
6363         def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
6364             """
6365             Perform a chamfer on all edges of the specified faces,
6366             with distance D1 on the first specified face (if several for one edge)
6367
6368             Parameters:
6369                 theShape Shape, to perform chamfer on.
6370                 theD1 Chamfer size along face from  theFaces. If both faces,
6371                       connected to the edge, are in theFaces, theD1
6372                       will be get along face, which is nearer to theFaces beginning.
6373                 theD2 Chamfer size along another of two faces, connected to the edge.
6374                 theFaces Sequence of global indices of faces of theShape.
6375
6376                 
6377             Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
6378
6379             Returns:  
6380                 New GEOM.GEOM_Object, containing the result shape.
6381             """
6382             # Example: see GEOM_TestAll.py
6383             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6384             anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
6385             RaiseIfFailed("MakeChamferFaces", self.LocalOp)
6386             anObj.SetParameters(Parameters)
6387             return anObj
6388
6389         ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
6390         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6391         #
6392         #  @ref swig_FilletChamfer "Example"
6393         def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
6394             """
6395             The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
6396             theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6397             """
6398             flag = False
6399             if isinstance(theAngle,str):
6400                 flag = True
6401             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6402             if flag:
6403                 theAngle = theAngle*math.pi/180.0
6404             anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
6405             RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
6406             anObj.SetParameters(Parameters)
6407             return anObj
6408
6409         ## Perform a chamfer on edges,
6410         #  with distance D1 on the first specified face (if several for one edge)
6411         #  @param theShape Shape, to perform chamfer on.
6412         #  @param theD1,theD2 Chamfer size
6413         #  @param theEdges Sequence of edges of \a theShape.
6414         #  @return New GEOM.GEOM_Object, containing the result shape.
6415         #
6416         #  @ref swig_FilletChamfer "Example"
6417         def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
6418             """
6419             Perform a chamfer on edges,
6420             with distance D1 on the first specified face (if several for one edge)
6421             
6422             Parameters:
6423                 theShape Shape, to perform chamfer on.
6424                 theD1,theD2 Chamfer size
6425                 theEdges Sequence of edges of theShape.
6426
6427             Returns:
6428                 New GEOM.GEOM_Object, containing the result shape.
6429             """
6430             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6431             anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
6432             RaiseIfFailed("MakeChamferEdges", self.LocalOp)
6433             anObj.SetParameters(Parameters)
6434             return anObj
6435
6436         ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
6437         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6438         def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
6439             """
6440             The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
6441             theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6442             """
6443             flag = False
6444             if isinstance(theAngle,str):
6445                 flag = True
6446             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6447             if flag:
6448                 theAngle = theAngle*math.pi/180.0
6449             anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
6450             RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
6451             anObj.SetParameters(Parameters)
6452             return anObj
6453
6454         ## /sa MakeChamferEdge() and MakeChamferFaces()
6455         #
6456         #  @ref swig_MakeChamfer "Example"
6457         def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
6458             """
6459             See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
6460             """
6461             # Example: see GEOM_TestOthers.py
6462             anObj = None
6463             if aShapeType == ShapeType["EDGE"]:
6464                 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
6465             else:
6466                 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
6467             return anObj
6468             
6469         ## Remove material from a solid by extrusion of the base shape on the given distance.
6470         #  @param theInit Shape to remove material from. It must be a solid or 
6471         #  a compound made of a single solid.
6472         #  @param theBase Closed edge or wire defining the base shape to be extruded.
6473         #  @param theH Prism dimension along the normal to theBase
6474         #  @param theAngle Draft angle in degrees.
6475         #  @return New GEOM.GEOM_Object, containing the initial shape with removed material 
6476         #
6477         #  @ref tui_creation_prism "Example"
6478         def MakeExtrudedCut(self, theInit, theBase, theH, theAngle):
6479             """
6480             Add material to a solid by extrusion of the base shape on the given distance.
6481
6482             Parameters:
6483                 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
6484                 theBase Closed edge or wire defining the base shape to be extruded.
6485                 theH Prism dimension along the normal  to theBase
6486                 theAngle Draft angle in degrees.
6487
6488             Returns:
6489                 New GEOM.GEOM_Object,  containing the initial shape with removed material.
6490             """
6491             # Example: see GEOM_TestAll.py
6492             #theH,Parameters = ParseParameters(theH)
6493             anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
6494             RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
6495             #anObj.SetParameters(Parameters)
6496             return anObj   
6497             
6498         ## Add material to a solid by extrusion of the base shape on the given distance.
6499         #  @param theInit Shape to add material to. It must be a solid or 
6500         #  a compound made of a single solid.
6501         #  @param theBase Closed edge or wire defining the base shape to be extruded.
6502         #  @param theH Prism dimension along the normal to theBase
6503         #  @param theAngle Draft angle in degrees.
6504         #  @return New GEOM.GEOM_Object, containing the initial shape with added material 
6505         #
6506         #  @ref tui_creation_prism "Example"
6507         def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle):
6508             """
6509             Add material to a solid by extrusion of the base shape on the given distance.
6510
6511             Parameters:
6512                 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
6513                 theBase Closed edge or wire defining the base shape to be extruded.
6514                 theH Prism dimension along the normal  to theBase
6515                 theAngle Draft angle in degrees.
6516
6517             Returns:
6518                 New GEOM.GEOM_Object,  containing the initial shape with added material.
6519             """
6520             # Example: see GEOM_TestAll.py
6521             #theH,Parameters = ParseParameters(theH)
6522             anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
6523             RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
6524             #anObj.SetParameters(Parameters)
6525             return anObj   
6526
6527         # end of l3_local
6528         ## @}
6529
6530         ## @addtogroup l3_basic_op
6531         ## @{
6532
6533         ## Perform an Archimde operation on the given shape with given parameters.
6534         #  The object presenting the resulting face is returned.
6535         #  @param theShape Shape to be put in water.
6536         #  @param theWeight Weight og the shape.
6537         #  @param theWaterDensity Density of the water.
6538         #  @param theMeshDeflection Deflection of the mesh, using to compute the section.
6539         #  @return New GEOM.GEOM_Object, containing a section of \a theShape
6540         #          by a plane, corresponding to water level.
6541         #
6542         #  @ref tui_archimede "Example"
6543         def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
6544             """
6545             Perform an Archimde operation on the given shape with given parameters.
6546             The object presenting the resulting face is returned.
6547
6548             Parameters: 
6549                 theShape Shape to be put in water.
6550                 theWeight Weight og the shape.
6551                 theWaterDensity Density of the water.
6552                 theMeshDeflection Deflection of the mesh, using to compute the section.
6553
6554             Returns: 
6555                 New GEOM.GEOM_Object, containing a section of theShape
6556                 by a plane, corresponding to water level.
6557             """
6558             # Example: see GEOM_TestAll.py
6559             theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
6560               theWeight,theWaterDensity,theMeshDeflection)
6561             anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
6562             RaiseIfFailed("MakeArchimede", self.LocalOp)
6563             anObj.SetParameters(Parameters)
6564             return anObj
6565
6566         # end of l3_basic_op
6567         ## @}
6568
6569         ## @addtogroup l2_measure
6570         ## @{
6571
6572         ## Get point coordinates
6573         #  @return [x, y, z]
6574         #
6575         #  @ref tui_measurement_tools_page "Example"
6576         def PointCoordinates(self,Point):
6577             """
6578             Get point coordinates
6579
6580             Returns:
6581                 [x, y, z]
6582             """
6583             # Example: see GEOM_TestMeasures.py
6584             aTuple = self.MeasuOp.PointCoordinates(Point)
6585             RaiseIfFailed("PointCoordinates", self.MeasuOp)
6586             return aTuple
6587
6588         ## Get summarized length of all wires,
6589         #  area of surface and volume of the given shape.
6590         #  @param theShape Shape to define properties of.
6591         #  @return [theLength, theSurfArea, theVolume]\n
6592         #  theLength:   Summarized length of all wires of the given shape.\n
6593         #  theSurfArea: Area of surface of the given shape.\n
6594         #  theVolume:   Volume of the given shape.
6595         #
6596         #  @ref tui_measurement_tools_page "Example"
6597         def BasicProperties(self,theShape):
6598             """
6599             Get summarized length of all wires,
6600             area of surface and volume of the given shape.
6601
6602             Parameters: 
6603                 theShape Shape to define properties of.
6604
6605             Returns:
6606                 [theLength, theSurfArea, theVolume]
6607                  theLength:   Summarized length of all wires of the given shape.
6608                  theSurfArea: Area of surface of the given shape.
6609                  theVolume:   Volume of the given shape.
6610             """
6611             # Example: see GEOM_TestMeasures.py
6612             aTuple = self.MeasuOp.GetBasicProperties(theShape)
6613             RaiseIfFailed("GetBasicProperties", self.MeasuOp)
6614             return aTuple
6615
6616         ## Get parameters of bounding box of the given shape
6617         #  @param theShape Shape to obtain bounding box of.
6618         #  @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
6619         #  Xmin,Xmax: Limits of shape along OX axis.
6620         #  Ymin,Ymax: Limits of shape along OY axis.
6621         #  Zmin,Zmax: Limits of shape along OZ axis.
6622         #
6623         #  @ref tui_measurement_tools_page "Example"
6624         def BoundingBox(self,theShape):
6625             """
6626             Get parameters of bounding box of the given shape
6627
6628             Parameters: 
6629                 theShape Shape to obtain bounding box of.
6630
6631             Returns:
6632                 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
6633                  Xmin,Xmax: Limits of shape along OX axis.
6634                  Ymin,Ymax: Limits of shape along OY axis.
6635                  Zmin,Zmax: Limits of shape along OZ axis.
6636             """
6637             # Example: see GEOM_TestMeasures.py
6638             aTuple = self.MeasuOp.GetBoundingBox(theShape)
6639             RaiseIfFailed("GetBoundingBox", self.MeasuOp)
6640             return aTuple
6641
6642         ## Get inertia matrix and moments of inertia of theShape.
6643         #  @param theShape Shape to calculate inertia of.
6644         #  @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
6645         #  I(1-3)(1-3): Components of the inertia matrix of the given shape.
6646         #  Ix,Iy,Iz:    Moments of inertia of the given shape.
6647         #
6648         #  @ref tui_measurement_tools_page "Example"
6649         def Inertia(self,theShape):
6650             """
6651             Get inertia matrix and moments of inertia of theShape.
6652
6653             Parameters: 
6654                 theShape Shape to calculate inertia of.
6655
6656             Returns:
6657                 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
6658                  I(1-3)(1-3): Components of the inertia matrix of the given shape.
6659                  Ix,Iy,Iz:    Moments of inertia of the given shape.
6660             """
6661             # Example: see GEOM_TestMeasures.py
6662             aTuple = self.MeasuOp.GetInertia(theShape)
6663             RaiseIfFailed("GetInertia", self.MeasuOp)
6664             return aTuple
6665
6666         ## Get if coords are included in the shape (ST_IN or ST_ON)
6667         #  @param theShape Shape
6668         #  @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
6669         #  @param tolerance to be used (default is 1.0e-7)
6670         #  @return list_of_boolean = [res1, res2, ...]
6671         def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
6672             """
6673             Get if coords are included in the shape (ST_IN or ST_ON)
6674             
6675             Parameters: 
6676                 theShape Shape
6677                 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
6678                 tolerance to be used (default is 1.0e-7)
6679
6680             Returns:
6681                 list_of_boolean = [res1, res2, ...]
6682             """
6683             return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
6684
6685         ## Get minimal distance between the given shapes.
6686         #  @param theShape1,theShape2 Shapes to find minimal distance between.
6687         #  @return Value of the minimal distance between the given shapes.
6688         #
6689         #  @ref tui_measurement_tools_page "Example"
6690         def MinDistance(self, theShape1, theShape2):
6691             """
6692             Get minimal distance between the given shapes.
6693             
6694             Parameters: 
6695                 theShape1,theShape2 Shapes to find minimal distance between.
6696
6697             Returns:    
6698                 Value of the minimal distance between the given shapes.
6699             """
6700             # Example: see GEOM_TestMeasures.py
6701             aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
6702             RaiseIfFailed("GetMinDistance", self.MeasuOp)
6703             return aTuple[0]
6704
6705         ## Get minimal distance between the given shapes.
6706         #  @param theShape1,theShape2 Shapes to find minimal distance between.
6707         #  @return Value of the minimal distance between the given shapes.
6708         #
6709         #  @ref swig_all_measure "Example"
6710         def MinDistanceComponents(self, theShape1, theShape2):
6711             """
6712             Get minimal distance between the given shapes.
6713
6714             Parameters: 
6715                 theShape1,theShape2 Shapes to find minimal distance between.
6716
6717             Returns:  
6718                 Value of the minimal distance between the given shapes.
6719             """
6720             # Example: see GEOM_TestMeasures.py
6721             aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
6722             RaiseIfFailed("GetMinDistance", self.MeasuOp)
6723             aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
6724             return aRes
6725
6726         ## Get angle between the given shapes in degrees.
6727         #  @param theShape1,theShape2 Lines or linear edges to find angle between.
6728         #  @note If both arguments are vectors, the angle is computed in accordance
6729         #        with their orientations, otherwise the minimum angle is computed.
6730         #  @return Value of the angle between the given shapes in degrees.
6731         #
6732         #  @ref tui_measurement_tools_page "Example"
6733         def GetAngle(self, theShape1, theShape2):
6734             """
6735             Get angle between the given shapes in degrees.
6736
6737             Parameters: 
6738                 theShape1,theShape2 Lines or linear edges to find angle between.
6739
6740             Note:
6741                 If both arguments are vectors, the angle is computed in accordance
6742                 with their orientations, otherwise the minimum angle is computed.
6743
6744             Returns:  
6745                 Value of the angle between the given shapes in degrees.
6746             """
6747             # Example: see GEOM_TestMeasures.py
6748             anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
6749             RaiseIfFailed("GetAngle", self.MeasuOp)
6750             return anAngle
6751
6752         ## Get angle between the given shapes in radians.
6753         #  @param theShape1,theShape2 Lines or linear edges to find angle between.
6754         #  @note If both arguments are vectors, the angle is computed in accordance
6755         #        with their orientations, otherwise the minimum angle is computed.
6756         #  @return Value of the angle between the given shapes in radians.
6757         #
6758         #  @ref tui_measurement_tools_page "Example"
6759         def GetAngleRadians(self, theShape1, theShape2):
6760             """
6761             Get angle between the given shapes in radians.
6762
6763             Parameters: 
6764                 theShape1,theShape2 Lines or linear edges to find angle between.
6765
6766                 
6767             Note:
6768                 If both arguments are vectors, the angle is computed in accordance
6769                 with their orientations, otherwise the minimum angle is computed.
6770
6771             Returns:  
6772                 Value of the angle between the given shapes in radians.
6773             """
6774             # Example: see GEOM_TestMeasures.py
6775             anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
6776             RaiseIfFailed("GetAngle", self.MeasuOp)
6777             return anAngle
6778
6779         ## Get angle between the given vectors in degrees.
6780         #  @param theShape1,theShape2 Vectors to find angle between.
6781         #  @param theFlag If True, the normal vector is defined by the two vectors cross,
6782         #                 if False, the opposite vector to the normal vector is used.
6783         #  @return Value of the angle between the given vectors in degrees.
6784         #
6785         #  @ref tui_measurement_tools_page "Example"
6786         def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
6787             """
6788             Get angle between the given vectors in degrees.
6789
6790             Parameters: 
6791                 theShape1,theShape2 Vectors to find angle between.
6792                 theFlag If True, the normal vector is defined by the two vectors cross,
6793                         if False, the opposite vector to the normal vector is used.
6794
6795             Returns:  
6796                 Value of the angle between the given vectors in degrees.
6797             """
6798             anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
6799             if not theFlag:
6800                 anAngle = 360. - anAngle
6801             RaiseIfFailed("GetAngleVectors", self.MeasuOp)
6802             return anAngle
6803
6804         ## The same as GetAngleVectors, but the result is in radians.
6805         def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
6806             """
6807             Get angle between the given vectors in radians.
6808
6809             Parameters: 
6810                 theShape1,theShape2 Vectors to find angle between.
6811                 theFlag If True, the normal vector is defined by the two vectors cross,
6812                         if False, the opposite vector to the normal vector is used.
6813
6814             Returns:  
6815                 Value of the angle between the given vectors in radians.
6816             """
6817             anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
6818             return anAngle
6819
6820         ## @name Curve Curvature Measurement
6821         #  Methods for receiving radius of curvature of curves
6822         #  in the given point
6823         ## @{
6824
6825         ## Measure curvature of a curve at a point, set by parameter.
6826         #  @param theCurve a curve.
6827         #  @param theParam parameter.
6828         #  @return radius of curvature of \a theCurve.
6829         #
6830         #  @ref swig_todo "Example"
6831         def CurveCurvatureByParam(self, theCurve, theParam):
6832             """
6833             Measure curvature of a curve at a point, set by parameter.
6834
6835             Parameters: 
6836                 theCurve a curve.
6837                 theParam parameter.
6838
6839             Returns: 
6840                 radius of curvature of theCurve.
6841             """
6842             # Example: see GEOM_TestMeasures.py
6843             aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
6844             RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
6845             return aCurv
6846
6847         ## Measure curvature of a curve at a point.
6848         #  @param theCurve a curve.
6849         #  @param thePoint given point.
6850         #  @return radius of curvature of \a theCurve.
6851         #
6852         #  @ref swig_todo "Example"
6853         def CurveCurvatureByPoint(self, theCurve, thePoint):
6854             """
6855             Measure curvature of a curve at a point.
6856
6857             Parameters: 
6858                 theCurve a curve.
6859                 thePoint given point.
6860
6861             Returns: 
6862                 radius of curvature of theCurve.           
6863             """
6864             aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
6865             RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
6866             return aCurv
6867         ## @}
6868
6869         ## @name Surface Curvature Measurement
6870         #  Methods for receiving max and min radius of curvature of surfaces
6871         #  in the given point
6872         ## @{
6873
6874         ## Measure max radius of curvature of surface.
6875         #  @param theSurf the given surface.
6876         #  @param theUParam Value of U-parameter on the referenced surface.
6877         #  @param theVParam Value of V-parameter on the referenced surface.
6878         #  @return max radius of curvature of theSurf.
6879         #
6880         ## @ref swig_todo "Example"
6881         def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
6882             """
6883             Measure max radius of curvature of surface.
6884
6885             Parameters: 
6886                 theSurf the given surface.
6887                 theUParam Value of U-parameter on the referenced surface.
6888                 theVParam Value of V-parameter on the referenced surface.
6889                 
6890             Returns:     
6891                 max radius of curvature of theSurf.
6892             """
6893             # Example: see GEOM_TestMeasures.py
6894             aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
6895             RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
6896             return aSurf
6897
6898         ## Measure max radius of curvature of surface in the given point
6899         #  @param theSurf the given surface.
6900         #  @param thePoint given point.
6901         #  @return max radius of curvature of theSurf.
6902         #
6903         ## @ref swig_todo "Example"
6904         def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
6905             """
6906             Measure max radius of curvature of surface in the given point.
6907
6908             Parameters: 
6909                 theSurf the given surface.
6910                 thePoint given point.
6911                 
6912             Returns:     
6913                 max radius of curvature of theSurf.          
6914             """
6915             aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
6916             RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
6917             return aSurf
6918
6919         ## Measure min radius of curvature of surface.
6920         #  @param theSurf the given surface.
6921         #  @param theUParam Value of U-parameter on the referenced surface.
6922         #  @param theVParam Value of V-parameter on the referenced surface.
6923         #  @return min radius of curvature of theSurf.
6924         #   
6925         ## @ref swig_todo "Example"
6926         def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
6927             """
6928             Measure min radius of curvature of surface.
6929
6930             Parameters: 
6931                 theSurf the given surface.
6932                 theUParam Value of U-parameter on the referenced surface.
6933                 theVParam Value of V-parameter on the referenced surface.
6934                 
6935             Returns:     
6936                 Min radius of curvature of theSurf.
6937             """
6938             aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
6939             RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
6940             return aSurf
6941
6942         ## Measure min radius of curvature of surface in the given point
6943         #  @param theSurf the given surface.
6944         #  @param thePoint given point.
6945         #  @return min radius of curvature of theSurf.
6946         #
6947         ## @ref swig_todo "Example"
6948         def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
6949             """
6950             Measure min radius of curvature of surface in the given point.
6951
6952             Parameters: 
6953                 theSurf the given surface.
6954                 thePoint given point.
6955                 
6956             Returns:     
6957                 Min radius of curvature of theSurf.          
6958             """
6959             aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
6960             RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
6961             return aSurf
6962         ## @}
6963
6964         ## Get min and max tolerances of sub-shapes of theShape
6965         #  @param theShape Shape, to get tolerances of.
6966         #  @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
6967         #  FaceMin,FaceMax: Min and max tolerances of the faces.\n
6968         #  EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
6969         #  VertMin,VertMax: Min and max tolerances of the vertices.
6970         #
6971         #  @ref tui_measurement_tools_page "Example"
6972         def Tolerance(self,theShape):
6973             """
6974             Get min and max tolerances of sub-shapes of theShape
6975
6976             Parameters: 
6977                 theShape Shape, to get tolerances of.
6978
6979             Returns:    
6980                 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
6981                  FaceMin,FaceMax: Min and max tolerances of the faces.
6982                  EdgeMin,EdgeMax: Min and max tolerances of the edges.
6983                  VertMin,VertMax: Min and max tolerances of the vertices.
6984             """
6985             # Example: see GEOM_TestMeasures.py
6986             aTuple = self.MeasuOp.GetTolerance(theShape)
6987             RaiseIfFailed("GetTolerance", self.MeasuOp)
6988             return aTuple
6989
6990         ## Obtain description of the given shape (number of sub-shapes of each type)
6991         #  @param theShape Shape to be described.
6992         #  @return Description of the given shape.
6993         #
6994         #  @ref tui_measurement_tools_page "Example"
6995         def WhatIs(self,theShape):
6996             """
6997             Obtain description of the given shape (number of sub-shapes of each type)
6998
6999             Parameters:
7000                 theShape Shape to be described.
7001
7002             Returns:
7003                 Description of the given shape.
7004             """
7005             # Example: see GEOM_TestMeasures.py
7006             aDescr = self.MeasuOp.WhatIs(theShape)
7007             RaiseIfFailed("WhatIs", self.MeasuOp)
7008             return aDescr
7009
7010         ## Obtain quantity of shapes of the given type in \a theShape.
7011         #  If \a theShape is of type \a theType, it is also counted.
7012         #  @param theShape Shape to be described.
7013         #  @param theType the given ShapeType().
7014         #  @return Quantity of shapes of type \a theType in \a theShape.
7015         #
7016         #  @ref tui_measurement_tools_page "Example"
7017         def NbShapes (self, theShape, theType):
7018             """
7019             Obtain quantity of shapes of the given type in theShape.
7020             If theShape is of type theType, it is also counted.
7021
7022             Parameters:
7023                 theShape Shape to be described.
7024                 theType the given geompy.ShapeType
7025
7026             Returns:
7027                 Quantity of shapes of type theType in theShape.
7028             """
7029             # Example: see GEOM_TestMeasures.py
7030             listSh = self.SubShapeAllIDs(theShape, theType)
7031             Nb = len(listSh)
7032             t       = EnumToLong(theShape.GetShapeType())
7033             theType = EnumToLong(theType)
7034             if t == theType:
7035                 Nb = Nb + 1
7036                 pass
7037             return Nb
7038
7039         ## Obtain quantity of shapes of each type in \a theShape.
7040         #  The \a theShape is also counted.
7041         #  @param theShape Shape to be described.
7042         #  @return Dictionary of ShapeType() with bound quantities of shapes.
7043         #
7044         #  @ref tui_measurement_tools_page "Example"
7045         def ShapeInfo (self, theShape):
7046             """
7047             Obtain quantity of shapes of each type in theShape.
7048             The theShape is also counted.
7049
7050             Parameters:
7051                 theShape Shape to be described.
7052
7053             Returns:
7054                 Dictionary of geompy.ShapeType with bound quantities of shapes.
7055             """
7056             # Example: see GEOM_TestMeasures.py
7057             aDict = {}
7058             for typeSh in ShapeType:
7059                 if typeSh in ( "AUTO", "SHAPE" ): continue
7060                 listSh = self.SubShapeAllIDs(theShape, ShapeType[typeSh])
7061                 Nb = len(listSh)
7062                 if EnumToLong(theShape.GetShapeType()) == ShapeType[typeSh]:
7063                     Nb = Nb + 1
7064                     pass
7065                 aDict[typeSh] = Nb
7066                 pass
7067             return aDict
7068
7069         ## Get a point, situated at the centre of mass of theShape.
7070         #  @param theShape Shape to define centre of mass of.
7071         #  @return New GEOM.GEOM_Object, containing the created point.
7072         #
7073         #  @ref tui_measurement_tools_page "Example"
7074         def MakeCDG(self,theShape):
7075             """
7076             Get a point, situated at the centre of mass of theShape.
7077
7078             Parameters:
7079                 theShape Shape to define centre of mass of.
7080
7081             Returns:
7082                 New GEOM.GEOM_Object, containing the created point.
7083             """
7084             # Example: see GEOM_TestMeasures.py
7085             anObj = self.MeasuOp.GetCentreOfMass(theShape)
7086             RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
7087             return anObj
7088
7089         ## Get a vertex sub-shape by index depended with orientation.
7090         #  @param theShape Shape to find sub-shape.
7091         #  @param theIndex Index to find vertex by this index (starting from zero)
7092         #  @return New GEOM.GEOM_Object, containing the created vertex.
7093         #
7094         #  @ref tui_measurement_tools_page "Example"
7095         def GetVertexByIndex(self,theShape, theIndex):
7096             """
7097             Get a vertex sub-shape by index depended with orientation.
7098
7099             Parameters:
7100                 theShape Shape to find sub-shape.
7101                 theIndex Index to find vertex by this index (starting from zero)
7102
7103             Returns:
7104                 New GEOM.GEOM_Object, containing the created vertex.
7105             """
7106             # Example: see GEOM_TestMeasures.py
7107             anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
7108             RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
7109             return anObj
7110
7111         ## Get the first vertex of wire/edge depended orientation.
7112         #  @param theShape Shape to find first vertex.
7113         #  @return New GEOM.GEOM_Object, containing the created vertex.
7114         #
7115         #  @ref tui_measurement_tools_page "Example"
7116         def GetFirstVertex(self,theShape):
7117             """
7118             Get the first vertex of wire/edge depended orientation.
7119
7120             Parameters:
7121                 theShape Shape to find first vertex.
7122
7123             Returns:    
7124                 New GEOM.GEOM_Object, containing the created vertex.
7125             """
7126             # Example: see GEOM_TestMeasures.py
7127             anObj = self.GetVertexByIndex(theShape, 0)
7128             RaiseIfFailed("GetFirstVertex", self.MeasuOp)
7129             return anObj
7130
7131         ## Get the last vertex of wire/edge depended orientation.
7132         #  @param theShape Shape to find last vertex.
7133         #  @return New GEOM.GEOM_Object, containing the created vertex.
7134         #
7135         #  @ref tui_measurement_tools_page "Example"
7136         def GetLastVertex(self,theShape):
7137             """
7138             Get the last vertex of wire/edge depended orientation.
7139
7140             Parameters: 
7141                 theShape Shape to find last vertex.
7142
7143             Returns:   
7144                 New GEOM.GEOM_Object, containing the created vertex.
7145             """
7146             # Example: see GEOM_TestMeasures.py
7147             nb_vert =  self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
7148             anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
7149             RaiseIfFailed("GetLastVertex", self.MeasuOp)
7150             return anObj
7151
7152         ## Get a normale to the given face. If the point is not given,
7153         #  the normale is calculated at the center of mass.
7154         #  @param theFace Face to define normale of.
7155         #  @param theOptionalPoint Point to compute the normale at.
7156         #  @return New GEOM.GEOM_Object, containing the created vector.
7157         #
7158         #  @ref swig_todo "Example"
7159         def GetNormal(self, theFace, theOptionalPoint = None):
7160             """
7161             Get a normale to the given face. If the point is not given,
7162             the normale is calculated at the center of mass.
7163             
7164             Parameters: 
7165                 theFace Face to define normale of.
7166                 theOptionalPoint Point to compute the normale at.
7167
7168             Returns:   
7169                 New GEOM.GEOM_Object, containing the created vector.
7170             """
7171             # Example: see GEOM_TestMeasures.py
7172             anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
7173             RaiseIfFailed("GetNormal", self.MeasuOp)
7174             return anObj
7175
7176         ## Check a topology of the given shape.
7177         #  @param theShape Shape to check validity of.
7178         #  @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
7179         #                        if TRUE, the shape's geometry will be checked also.
7180         #  @param theReturnStatus If FALSE and if theShape is invalid, a description \n
7181         #                        of problem is printed.
7182         #                        if TRUE and if theShape is invalid, the description 
7183         #                        of problem is also returned.
7184         #  @return TRUE, if the shape "seems to be valid".
7185         #
7186         #  @ref tui_measurement_tools_page "Example"
7187         def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
7188             """
7189             Check a topology of the given shape.
7190
7191             Parameters: 
7192                 theShape Shape to check validity of.
7193                 theIsCheckGeom If FALSE, only the shape's topology will be checked,
7194                                if TRUE, the shape's geometry will be checked also.
7195                 theReturnStatus If FALSE and if theShape is invalid, a description
7196                                 of problem is printed.
7197                                 if TRUE and if theShape is invalid, the description 
7198                                 of problem is returned.
7199
7200             Returns:   
7201                 TRUE, if the shape "seems to be valid".
7202                 If theShape is invalid, prints a description of problem.
7203                 This description can also be returned.
7204             """
7205             # Example: see GEOM_TestMeasures.py
7206             if theIsCheckGeom:
7207                 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
7208                 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
7209             else:
7210                 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
7211                 RaiseIfFailed("CheckShape", self.MeasuOp)
7212             if IsValid == 0:
7213                 if theReturnStatus == 0:
7214                     print Status
7215             if theReturnStatus == 1:
7216               return (IsValid, Status)
7217             return IsValid
7218
7219         ## Detect self-intersections in the given shape.
7220         #  @param theShape Shape to check.
7221         #  @return TRUE, if the shape contains no self-intersections.
7222         #
7223         #  @ref tui_measurement_tools_page "Example"
7224         def CheckSelfIntersections(self, theShape):
7225             """
7226             Detect self-intersections in the given shape.
7227
7228             Parameters: 
7229                 theShape Shape to check.
7230
7231             Returns:   
7232                 TRUE, if the shape contains no self-intersections.
7233             """
7234             # Example: see GEOM_TestMeasures.py
7235             (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
7236             RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
7237             return IsValid
7238
7239         ## Get position (LCS) of theShape.
7240         #
7241         #  Origin of the LCS is situated at the shape's center of mass.
7242         #  Axes of the LCS are obtained from shape's location or,
7243         #  if the shape is a planar face, from position of its plane.
7244         #
7245         #  @param theShape Shape to calculate position of.
7246         #  @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
7247         #          Ox,Oy,Oz: Coordinates of shape's LCS origin.
7248         #          Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
7249         #          Xx,Xy,Xz: Coordinates of shape's LCS X direction.
7250         #
7251         #  @ref swig_todo "Example"
7252         def GetPosition(self,theShape):
7253             """
7254             Get position (LCS) of theShape.
7255             Origin of the LCS is situated at the shape's center of mass.
7256             Axes of the LCS are obtained from shape's location or,
7257             if the shape is a planar face, from position of its plane.
7258
7259             Parameters: 
7260                 theShape Shape to calculate position of.
7261
7262             Returns:  
7263                 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
7264                  Ox,Oy,Oz: Coordinates of shape's LCS origin.
7265                  Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
7266                  Xx,Xy,Xz: Coordinates of shape's LCS X direction.
7267             """
7268             # Example: see GEOM_TestMeasures.py
7269             aTuple = self.MeasuOp.GetPosition(theShape)
7270             RaiseIfFailed("GetPosition", self.MeasuOp)
7271             return aTuple
7272
7273         ## Get kind of theShape.
7274         #
7275         #  @param theShape Shape to get a kind of.
7276         #  @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
7277         #          and a list of parameters, describing the shape.
7278         #  @note  Concrete meaning of each value, returned via \a theIntegers
7279         #         or \a theDoubles list depends on the kind() of the shape.
7280         #
7281         #  @ref swig_todo "Example"
7282         def KindOfShape(self,theShape):
7283             """
7284             Get kind of theShape.
7285          
7286             Parameters: 
7287                 theShape Shape to get a kind of.
7288
7289             Returns:
7290                 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
7291                     and a list of parameters, describing the shape.
7292             Note:
7293                 Concrete meaning of each value, returned via theIntegers
7294                 or theDoubles list depends on the geompy.kind of the shape
7295             """
7296             # Example: see GEOM_TestMeasures.py
7297             aRoughTuple = self.MeasuOp.KindOfShape(theShape)
7298             RaiseIfFailed("KindOfShape", self.MeasuOp)
7299
7300             aKind  = aRoughTuple[0]
7301             anInts = aRoughTuple[1]
7302             aDbls  = aRoughTuple[2]
7303
7304             # Now there is no exception from this rule:
7305             aKindTuple = [aKind] + aDbls + anInts
7306
7307             # If they are we will regroup parameters for such kind of shape.
7308             # For example:
7309             #if aKind == kind.SOME_KIND:
7310             #    #  SOME_KIND     int int double int double double
7311             #    aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
7312
7313             return aKindTuple
7314
7315         # end of l2_measure
7316         ## @}
7317
7318         ## @addtogroup l2_import_export
7319         ## @{
7320
7321         ## Import a shape from the BREP or IGES or STEP file
7322         #  (depends on given format) with given name.
7323         #  @param theFileName The file, containing the shape.
7324         #  @param theFormatName Specify format for the file reading.
7325         #         Available formats can be obtained with InsertOp.ImportTranslators() method.
7326         #         If format 'IGES_SCALE' is used instead of 'IGES' or
7327         #            format 'STEP_SCALE' is used instead of 'STEP',
7328         #            length unit will be set to 'meter' and result model will be scaled.
7329         #  @return New GEOM.GEOM_Object, containing the imported shape.
7330         #
7331         #  @ref swig_Import_Export "Example"
7332         def ImportFile(self, theFileName, theFormatName):
7333             """
7334             Import a shape from the BREP or IGES or STEP file
7335             (depends on given format) with given name.
7336
7337             Parameters: 
7338                 theFileName The file, containing the shape.
7339                 theFormatName Specify format for the file reading.
7340                     Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
7341                     If format 'IGES_SCALE' is used instead of 'IGES' or
7342                        format 'STEP_SCALE' is used instead of 'STEP',
7343                        length unit will be set to 'meter' and result model will be scaled.
7344
7345             Returns:
7346                 New GEOM.GEOM_Object, containing the imported shape.
7347             """
7348             # Example: see GEOM_TestOthers.py
7349             anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
7350             RaiseIfFailed("Import", self.InsertOp)
7351             return anObj
7352
7353         ## Deprecated analog of ImportFile()
7354         def Import(self, theFileName, theFormatName):
7355             """
7356             Deprecated analog of geompy.ImportFile
7357             """
7358             print "WARNING: Function Import is deprecated, use ImportFile instead"
7359             anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
7360             RaiseIfFailed("Import", self.InsertOp)
7361             return anObj
7362
7363         ## Shortcut to ImportFile() for BREP format.
7364         #  Import a shape from the BREP file with given name.
7365         #  @param theFileName The file, containing the shape.
7366         #  @return New GEOM.GEOM_Object, containing the imported shape.
7367         #
7368         #  @ref swig_Import_Export "Example"
7369         def ImportBREP(self, theFileName):
7370             """
7371             geompy.ImportFile(...) function for BREP format
7372             Import a shape from the BREP file with given name.
7373
7374             Parameters: 
7375                 theFileName The file, containing the shape.
7376
7377             Returns:
7378                 New GEOM.GEOM_Object, containing the imported shape.
7379             """
7380             # Example: see GEOM_TestOthers.py
7381             return self.ImportFile(theFileName, "BREP")
7382
7383         ## Shortcut to ImportFile() for IGES format
7384         #  Import a shape from the IGES file with given name.
7385         #  @param theFileName The file, containing the shape.
7386         #  @param ignoreUnits If True, file length units will be ignored (set to 'meter')
7387         #                     and result model will be scaled, if its units are not meters.
7388         #                     If False (default), file length units will be taken into account.
7389         #  @return New GEOM.GEOM_Object, containing the imported shape.
7390         #
7391         #  @ref swig_Import_Export "Example"
7392         def ImportIGES(self, theFileName, ignoreUnits = False):
7393             """
7394             geompy.ImportFile(...) function for IGES format
7395
7396             Parameters:
7397                 theFileName The file, containing the shape.
7398                 ignoreUnits If True, file length units will be ignored (set to 'meter')
7399                             and result model will be scaled, if its units are not meters.
7400                             If False (default), file length units will be taken into account.
7401
7402             Returns:
7403                 New GEOM.GEOM_Object, containing the imported shape.
7404             """
7405             # Example: see GEOM_TestOthers.py
7406             if ignoreUnits:
7407                 return self.ImportFile(theFileName, "IGES_SCALE")
7408             return self.ImportFile(theFileName, "IGES")
7409
7410         ## Return length unit from given IGES file
7411         #  @param theFileName The file, containing the shape.
7412         #  @return String, containing the units name.
7413         #
7414         #  @ref swig_Import_Export "Example"
7415         def GetIGESUnit(self, theFileName):
7416             """
7417             Return length units from given IGES file
7418
7419             Parameters:
7420                 theFileName The file, containing the shape.
7421
7422             Returns:
7423                 String, containing the units name.
7424             """
7425             # Example: see GEOM_TestOthers.py
7426             aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
7427             return aUnitName
7428
7429         ## Shortcut to ImportFile() for STEP format
7430         #  Import a shape from the STEP file with given name.
7431         #  @param theFileName The file, containing the shape.
7432         #  @param ignoreUnits If True, file length units will be ignored (set to 'meter')
7433         #                     and result model will be scaled, if its units are not meters.
7434         #                     If False (default), file length units will be taken into account.
7435         #  @return New GEOM.GEOM_Object, containing the imported shape.
7436         #
7437         #  @ref swig_Import_Export "Example"
7438         def ImportSTEP(self, theFileName, ignoreUnits = False):
7439             """
7440             geompy.ImportFile(...) function for STEP format
7441
7442             Parameters:
7443                 theFileName The file, containing the shape.
7444                 ignoreUnits If True, file length units will be ignored (set to 'meter')
7445                             and result model will be scaled, if its units are not meters.
7446                             If False (default), file length units will be taken into account.
7447
7448             Returns:
7449                 New GEOM.GEOM_Object, containing the imported shape.
7450             """
7451             # Example: see GEOM_TestOthers.py
7452             if ignoreUnits:
7453                 return self.ImportFile(theFileName, "STEP_SCALE")
7454             return self.ImportFile(theFileName, "STEP")
7455
7456         ## Return length unit from given IGES or STEP file
7457         #  @param theFileName The file, containing the shape.
7458         #  @return String, containing the units name.
7459         #
7460         #  @ref swig_Import_Export "Example"
7461         def GetSTEPUnit(self, theFileName):
7462             """
7463             Return length units from given STEP file
7464
7465             Parameters:
7466                 theFileName The file, containing the shape.
7467
7468             Returns:
7469                 String, containing the units name.
7470             """
7471             # Example: see GEOM_TestOthers.py
7472             aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
7473             return aUnitName
7474
7475         ## Read a shape from the binary stream, containing its bounding representation (BRep).
7476         #  @note This method will not be dumped to the python script by DumpStudy functionality.
7477         #  @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
7478         #  @param theStream The BRep binary stream.
7479         #  @return New GEOM_Object, containing the shape, read from theStream.
7480         #
7481         #  @ref swig_Import_Export "Example"
7482         def RestoreShape (self, theStream):
7483             """
7484             Read a shape from the binary stream, containing its bounding representation (BRep).
7485
7486             Note:
7487                 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
7488
7489             Parameters: 
7490                 theStream The BRep binary stream.
7491
7492             Returns:
7493                 New GEOM_Object, containing the shape, read from theStream.
7494             """
7495             # Example: see GEOM_TestOthers.py
7496             anObj = self.InsertOp.RestoreShape(theStream)
7497             RaiseIfFailed("RestoreShape", self.InsertOp)
7498             return anObj
7499
7500         ## Export the given shape into a file with given name.
7501         #  @param theObject Shape to be stored in the file.
7502         #  @param theFileName Name of the file to store the given shape in.
7503         #  @param theFormatName Specify format for the shape storage.
7504         #         Available formats can be obtained with InsertOp.ImportTranslators() method.
7505         #
7506         #  @ref swig_Import_Export "Example"
7507         def Export(self, theObject, theFileName, theFormatName):
7508             """
7509             Export the given shape into a file with given name.
7510
7511             Parameters: 
7512                 theObject Shape to be stored in the file.
7513                 theFileName Name of the file to store the given shape in.
7514                 theFormatName Specify format for the shape storage.
7515                               Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
7516             """
7517             # Example: see GEOM_TestOthers.py
7518             self.InsertOp.Export(theObject, theFileName, theFormatName)
7519             if self.InsertOp.IsDone() == 0:
7520                 raise RuntimeError,  "Export : " + self.InsertOp.GetErrorCode()
7521                 pass
7522             pass
7523
7524         ## Shortcut to Export() for BREP format
7525         #
7526         #  @ref swig_Import_Export "Example"
7527         def ExportBREP(self,theObject, theFileName):
7528             """
7529             geompy.Export(...) function for BREP format
7530             """
7531             # Example: see GEOM_TestOthers.py
7532             return self.Export(theObject, theFileName, "BREP")
7533
7534         ## Shortcut to Export() for IGES format
7535         #
7536         #  @ref swig_Import_Export "Example"
7537         def ExportIGES(self,theObject, theFileName):
7538             """
7539             geompy.Export(...) function for IGES format
7540             """
7541             # Example: see GEOM_TestOthers.py
7542             return self.Export(theObject, theFileName, "IGES")
7543
7544         ## Shortcut to Export() for STEP format
7545         #
7546         #  @ref swig_Import_Export "Example"
7547         def ExportSTEP(self,theObject, theFileName):
7548             """
7549             geompy.Export(...) function for STEP format
7550             """
7551             # Example: see GEOM_TestOthers.py
7552             return self.Export(theObject, theFileName, "STEP")
7553
7554         # end of l2_import_export
7555         ## @}
7556
7557         ## @addtogroup l3_blocks
7558         ## @{
7559
7560         ## Create a quadrangle face from four edges. Order of Edges is not
7561         #  important. It is  not necessary that edges share the same vertex.
7562         #  @param E1,E2,E3,E4 Edges for the face bound.
7563         #  @return New GEOM.GEOM_Object, containing the created face.
7564         #
7565         #  @ref tui_building_by_blocks_page "Example"
7566         def MakeQuad(self,E1, E2, E3, E4):
7567             """
7568             Create a quadrangle face from four edges. Order of Edges is not
7569             important. It is  not necessary that edges share the same vertex.
7570
7571             Parameters: 
7572                 E1,E2,E3,E4 Edges for the face bound.
7573
7574             Returns: 
7575                 New GEOM.GEOM_Object, containing the created face.
7576
7577             Example of usage:               
7578                 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
7579             """
7580             # Example: see GEOM_Spanner.py
7581             anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
7582             RaiseIfFailed("MakeQuad", self.BlocksOp)
7583             return anObj
7584
7585         ## Create a quadrangle face on two edges.
7586         #  The missing edges will be built by creating the shortest ones.
7587         #  @param E1,E2 Two opposite edges for the face.
7588         #  @return New GEOM.GEOM_Object, containing the created face.
7589         #
7590         #  @ref tui_building_by_blocks_page "Example"
7591         def MakeQuad2Edges(self,E1, E2):
7592             """
7593             Create a quadrangle face on two edges.
7594             The missing edges will be built by creating the shortest ones.
7595
7596             Parameters: 
7597                 E1,E2 Two opposite edges for the face.
7598
7599             Returns: 
7600                 New GEOM.GEOM_Object, containing the created face.
7601             
7602             Example of usage:
7603                 # create vertices
7604                 p1 = geompy.MakeVertex(  0.,   0.,   0.)
7605                 p2 = geompy.MakeVertex(150.,  30.,   0.)
7606                 p3 = geompy.MakeVertex(  0., 120.,  50.)
7607                 p4 = geompy.MakeVertex(  0.,  40.,  70.)
7608                 # create edges
7609                 edge1 = geompy.MakeEdge(p1, p2)
7610                 edge2 = geompy.MakeEdge(p3, p4)
7611                 # create a quadrangle face from two edges
7612                 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
7613             """
7614             # Example: see GEOM_Spanner.py
7615             anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
7616             RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
7617             return anObj
7618
7619         ## Create a quadrangle face with specified corners.
7620         #  The missing edges will be built by creating the shortest ones.
7621         #  @param V1,V2,V3,V4 Corner vertices for the face.
7622         #  @return New GEOM.GEOM_Object, containing the created face.
7623         #
7624         #  @ref tui_building_by_blocks_page "Example 1"
7625         #  \n @ref swig_MakeQuad4Vertices "Example 2"
7626         def MakeQuad4Vertices(self,V1, V2, V3, V4):
7627             """
7628             Create a quadrangle face with specified corners.
7629             The missing edges will be built by creating the shortest ones.
7630
7631             Parameters: 
7632                 V1,V2,V3,V4 Corner vertices for the face.
7633
7634             Returns: 
7635                 New GEOM.GEOM_Object, containing the created face.
7636
7637             Example of usage:
7638                 # create vertices
7639                 p1 = geompy.MakeVertex(  0.,   0.,   0.)
7640                 p2 = geompy.MakeVertex(150.,  30.,   0.)
7641                 p3 = geompy.MakeVertex(  0., 120.,  50.)
7642                 p4 = geompy.MakeVertex(  0.,  40.,  70.)
7643                 # create a quadrangle from four points in its corners
7644                 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
7645             """
7646             # Example: see GEOM_Spanner.py
7647             anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
7648             RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
7649             return anObj
7650
7651         ## Create a hexahedral solid, bounded by the six given faces. Order of
7652         #  faces is not important. It is  not necessary that Faces share the same edge.
7653         #  @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
7654         #  @return New GEOM.GEOM_Object, containing the created solid.
7655         #
7656         #  @ref tui_building_by_blocks_page "Example 1"
7657         #  \n @ref swig_MakeHexa "Example 2"
7658         def MakeHexa(self,F1, F2, F3, F4, F5, F6):
7659             """
7660             Create a hexahedral solid, bounded by the six given faces. Order of
7661             faces is not important. It is  not necessary that Faces share the same edge.
7662
7663             Parameters: 
7664                 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
7665
7666             Returns:    
7667                 New GEOM.GEOM_Object, containing the created solid.
7668
7669             Example of usage:
7670                 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
7671             """
7672             # Example: see GEOM_Spanner.py
7673             anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
7674             RaiseIfFailed("MakeHexa", self.BlocksOp)
7675             return anObj
7676
7677         ## Create a hexahedral solid between two given faces.
7678         #  The missing faces will be built by creating the smallest ones.
7679         #  @param F1,F2 Two opposite faces for the hexahedral solid.
7680         #  @return New GEOM.GEOM_Object, containing the created solid.
7681         #
7682         #  @ref tui_building_by_blocks_page "Example 1"
7683         #  \n @ref swig_MakeHexa2Faces "Example 2"
7684         def MakeHexa2Faces(self,F1, F2):
7685             """
7686             Create a hexahedral solid between two given faces.
7687             The missing faces will be built by creating the smallest ones.
7688
7689             Parameters: 
7690                 F1,F2 Two opposite faces for the hexahedral solid.
7691
7692             Returns:
7693                 New GEOM.GEOM_Object, containing the created solid.
7694
7695             Example of usage:
7696                 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
7697             """
7698             # Example: see GEOM_Spanner.py
7699             anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
7700             RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
7701             return anObj
7702
7703         # end of l3_blocks
7704         ## @}
7705
7706         ## @addtogroup l3_blocks_op
7707         ## @{
7708
7709         ## Get a vertex, found in the given shape by its coordinates.
7710         #  @param theShape Block or a compound of blocks.
7711         #  @param theX,theY,theZ Coordinates of the sought vertex.
7712         #  @param theEpsilon Maximum allowed distance between the resulting
7713         #                    vertex and point with the given coordinates.
7714         #  @return New GEOM.GEOM_Object, containing the found vertex.
7715         #
7716         #  @ref swig_GetPoint "Example"
7717         def GetPoint(self, theShape, theX, theY, theZ, theEpsilon):
7718             """
7719             Get a vertex, found in the given shape by its coordinates.
7720
7721             Parameters: 
7722                 theShape Block or a compound of blocks.
7723                 theX,theY,theZ Coordinates of the sought vertex.
7724                 theEpsilon Maximum allowed distance between the resulting
7725                            vertex and point with the given coordinates.
7726
7727             Returns:                  
7728                 New GEOM.GEOM_Object, containing the found vertex.
7729
7730             Example of usage:
7731                 pnt = geompy.GetPoint(shape, -50,  50,  50, 0.01)
7732             """
7733             # Example: see GEOM_TestOthers.py
7734             anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
7735             RaiseIfFailed("GetPoint", self.BlocksOp)
7736             return anObj
7737
7738         ## Find a vertex of the given shape, which has minimal distance to the given point.
7739         #  @param theShape Any shape.
7740         #  @param thePoint Point, close to the desired vertex.
7741         #  @return New GEOM.GEOM_Object, containing the found vertex.
7742         #
7743         #  @ref swig_GetVertexNearPoint "Example"
7744         def GetVertexNearPoint(self, theShape, thePoint):
7745             """
7746             Find a vertex of the given shape, which has minimal distance to the given point.
7747
7748             Parameters: 
7749                 theShape Any shape.
7750                 thePoint Point, close to the desired vertex.
7751
7752             Returns:
7753                 New GEOM.GEOM_Object, containing the found vertex.
7754
7755             Example of usage:
7756                 pmidle = geompy.MakeVertex(50, 0, 50)
7757                 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
7758             """
7759             # Example: see GEOM_TestOthers.py
7760             anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
7761             RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
7762             return anObj
7763
7764         ## Get an edge, found in the given shape by two given vertices.
7765         #  @param theShape Block or a compound of blocks.
7766         #  @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
7767         #  @return New GEOM.GEOM_Object, containing the found edge.
7768         #
7769         #  @ref swig_GetEdge "Example"
7770         def GetEdge(self, theShape, thePoint1, thePoint2):
7771             """
7772             Get an edge, found in the given shape by two given vertices.
7773
7774             Parameters: 
7775                 theShape Block or a compound of blocks.
7776                 thePoint1,thePoint2 Points, close to the ends of the desired edge.
7777
7778             Returns:
7779                 New GEOM.GEOM_Object, containing the found edge.
7780             """
7781             # Example: see GEOM_Spanner.py
7782             anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
7783             RaiseIfFailed("GetEdge", self.BlocksOp)
7784             return anObj
7785
7786         ## Find an edge of the given shape, which has minimal distance to the given point.
7787         #  @param theShape Block or a compound of blocks.
7788         #  @param thePoint Point, close to the desired edge.
7789         #  @return New GEOM.GEOM_Object, containing the found edge.
7790         #
7791         #  @ref swig_GetEdgeNearPoint "Example"
7792         def GetEdgeNearPoint(self, theShape, thePoint):
7793             """
7794             Find an edge of the given shape, which has minimal distance to the given point.
7795
7796             Parameters: 
7797                 theShape Block or a compound of blocks.
7798                 thePoint Point, close to the desired edge.
7799
7800             Returns:
7801                 New GEOM.GEOM_Object, containing the found edge.
7802             """
7803             # Example: see GEOM_TestOthers.py
7804             anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
7805             RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
7806             return anObj
7807
7808         ## Returns a face, found in the given shape by four given corner vertices.
7809         #  @param theShape Block or a compound of blocks.
7810         #  @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
7811         #  @return New GEOM.GEOM_Object, containing the found face.
7812         #
7813         #  @ref swig_todo "Example"
7814         def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
7815             """
7816             Returns a face, found in the given shape by four given corner vertices.
7817
7818             Parameters:
7819                 theShape Block or a compound of blocks.
7820                 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
7821
7822             Returns:
7823                 New GEOM.GEOM_Object, containing the found face.
7824             """
7825             # Example: see GEOM_Spanner.py
7826             anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
7827             RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
7828             return anObj
7829
7830         ## Get a face of block, found in the given shape by two given edges.
7831         #  @param theShape Block or a compound of blocks.
7832         #  @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
7833         #  @return New GEOM.GEOM_Object, containing the found face.
7834         #
7835         #  @ref swig_todo "Example"
7836         def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
7837             """
7838             Get a face of block, found in the given shape by two given edges.
7839
7840             Parameters:
7841                 theShape Block or a compound of blocks.
7842                 theEdge1,theEdge2 Edges, close to the edges of the desired face.
7843
7844             Returns:
7845                 New GEOM.GEOM_Object, containing the found face.
7846             """
7847             # Example: see GEOM_Spanner.py
7848             anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
7849             RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
7850             return anObj
7851
7852         ## Find a face, opposite to the given one in the given block.
7853         #  @param theBlock Must be a hexahedral solid.
7854         #  @param theFace Face of \a theBlock, opposite to the desired face.
7855         #  @return New GEOM.GEOM_Object, containing the found face.
7856         #
7857         #  @ref swig_GetOppositeFace "Example"
7858         def GetOppositeFace(self,theBlock, theFace):
7859             """
7860             Find a face, opposite to the given one in the given block.
7861
7862             Parameters:
7863                 theBlock Must be a hexahedral solid.
7864                 theFace Face of theBlock, opposite to the desired face.
7865
7866             Returns: 
7867                 New GEOM.GEOM_Object, containing the found face.
7868             """
7869             # Example: see GEOM_Spanner.py
7870             anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
7871             RaiseIfFailed("GetOppositeFace", self.BlocksOp)
7872             return anObj
7873
7874         ## Find a face of the given shape, which has minimal distance to the given point.
7875         #  @param theShape Block or a compound of blocks.
7876         #  @param thePoint Point, close to the desired face.
7877         #  @return New GEOM.GEOM_Object, containing the found face.
7878         #
7879         #  @ref swig_GetFaceNearPoint "Example"
7880         def GetFaceNearPoint(self, theShape, thePoint):
7881             """
7882             Find a face of the given shape, which has minimal distance to the given point.
7883
7884             Parameters:
7885                 theShape Block or a compound of blocks.
7886                 thePoint Point, close to the desired face.
7887
7888             Returns:
7889                 New GEOM.GEOM_Object, containing the found face.
7890             """
7891             # Example: see GEOM_Spanner.py
7892             anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
7893             RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
7894             return anObj
7895
7896         ## Find a face of block, whose outside normale has minimal angle with the given vector.
7897         #  @param theBlock Block or a compound of blocks.
7898         #  @param theVector Vector, close to the normale of the desired face.
7899         #  @return New GEOM.GEOM_Object, containing the found face.
7900         #
7901         #  @ref swig_todo "Example"
7902         def GetFaceByNormale(self, theBlock, theVector):
7903             """
7904             Find a face of block, whose outside normale has minimal angle with the given vector.
7905
7906             Parameters:
7907                 theBlock Block or a compound of blocks.
7908                 theVector Vector, close to the normale of the desired face.
7909
7910             Returns:
7911                 New GEOM.GEOM_Object, containing the found face.
7912             """
7913             # Example: see GEOM_Spanner.py
7914             anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
7915             RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
7916             return anObj
7917
7918         ## Find all sub-shapes of type \a theShapeType of the given shape,
7919         #  which have minimal distance to the given point.
7920         #  @param theShape Any shape.
7921         #  @param thePoint Point, close to the desired shape.
7922         #  @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
7923         #  @param theTolerance The tolerance for distances comparison. All shapes
7924         #                      with distances to the given point in interval
7925         #                      [minimal_distance, minimal_distance + theTolerance] will be gathered.
7926         #  @return New GEOM_Object, containing a group of all found shapes.
7927         #
7928         #  @ref swig_GetShapesNearPoint "Example"
7929         def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07):
7930             """
7931             Find all sub-shapes of type theShapeType of the given shape,
7932             which have minimal distance to the given point.
7933
7934             Parameters:
7935                 theShape Any shape.
7936                 thePoint Point, close to the desired shape.
7937                 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
7938                 theTolerance The tolerance for distances comparison. All shapes
7939                                 with distances to the given point in interval
7940                                 [minimal_distance, minimal_distance + theTolerance] will be gathered.
7941
7942             Returns:
7943                 New GEOM_Object, containing a group of all found shapes.
7944             """
7945             # Example: see GEOM_TestOthers.py
7946             anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
7947             RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
7948             return anObj
7949
7950         # end of l3_blocks_op
7951         ## @}
7952
7953         ## @addtogroup l4_blocks_measure
7954         ## @{
7955
7956         ## Check, if the compound of blocks is given.
7957         #  To be considered as a compound of blocks, the
7958         #  given shape must satisfy the following conditions:
7959         #  - Each element of the compound should be a Block (6 faces and 12 edges).
7960         #  - A connection between two Blocks should be an entire quadrangle face or an entire edge.
7961         #  - The compound should be connexe.
7962         #  - The glue between two quadrangle faces should be applied.
7963         #  @param theCompound The compound to check.
7964         #  @return TRUE, if the given shape is a compound of blocks.
7965         #  If theCompound is not valid, prints all discovered errors.
7966         #
7967         #  @ref tui_measurement_tools_page "Example 1"
7968         #  \n @ref swig_CheckCompoundOfBlocks "Example 2"
7969         def CheckCompoundOfBlocks(self,theCompound):
7970             """
7971             Check, if the compound of blocks is given.
7972             To be considered as a compound of blocks, the
7973             given shape must satisfy the following conditions:
7974             - Each element of the compound should be a Block (6 faces and 12 edges).
7975             - A connection between two Blocks should be an entire quadrangle face or an entire edge.
7976             - The compound should be connexe.
7977             - The glue between two quadrangle faces should be applied.
7978
7979             Parameters:
7980                 theCompound The compound to check.
7981
7982             Returns:
7983                 TRUE, if the given shape is a compound of blocks.
7984                 If theCompound is not valid, prints all discovered errors.            
7985             """
7986             # Example: see GEOM_Spanner.py
7987             (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
7988             RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
7989             if IsValid == 0:
7990                 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
7991                 print Descr
7992             return IsValid
7993
7994         ## Retrieve all non blocks solids and faces from \a theShape.
7995         #  @param theShape The shape to explore.
7996         #  @return A tuple of two GEOM_Objects. The first object is a group of all
7997         #          non block solids (= not 6 faces, or with 6 faces, but with the
7998         #          presence of non-quadrangular faces). The second object is a
7999         #          group of all non quadrangular faces.
8000         #
8001         #  @ref tui_measurement_tools_page "Example 1"
8002         #  \n @ref swig_GetNonBlocks "Example 2"
8003         def GetNonBlocks (self, theShape):
8004             """
8005             Retrieve all non blocks solids and faces from theShape.
8006
8007             Parameters:
8008                 theShape The shape to explore.
8009
8010             Returns:
8011                 A tuple of two GEOM_Objects. The first object is a group of all
8012                 non block solids (= not 6 faces, or with 6 faces, but with the
8013                 presence of non-quadrangular faces). The second object is a
8014                 group of all non quadrangular faces.
8015
8016             Usage:
8017                 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
8018             """
8019             # Example: see GEOM_Spanner.py
8020             aTuple = self.BlocksOp.GetNonBlocks(theShape)
8021             RaiseIfFailed("GetNonBlocks", self.BlocksOp)
8022             return aTuple
8023
8024         ## Remove all seam and degenerated edges from \a theShape.
8025         #  Unite faces and edges, sharing one surface. It means that
8026         #  this faces must have references to one C++ surface object (handle).
8027         #  @param theShape The compound or single solid to remove irregular edges from.
8028         #  @param doUnionFaces If True, then unite faces. If False (the default value),
8029         #         do not unite faces.
8030         #  @return Improved shape.
8031         #
8032         #  @ref swig_RemoveExtraEdges "Example"
8033         def RemoveExtraEdges(self, theShape, doUnionFaces=False):
8034             """
8035             Remove all seam and degenerated edges from theShape.
8036             Unite faces and edges, sharing one surface. It means that
8037             this faces must have references to one C++ surface object (handle).
8038
8039             Parameters:
8040                 theShape The compound or single solid to remove irregular edges from.
8041                 doUnionFaces If True, then unite faces. If False (the default value),
8042                              do not unite faces.
8043
8044             Returns: 
8045                 Improved shape.
8046             """
8047             # Example: see GEOM_TestOthers.py
8048             nbFacesOptimum = -1 # -1 means do not unite faces
8049             if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
8050             anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
8051             RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
8052             return anObj
8053
8054         ## Check, if the given shape is a blocks compound.
8055         #  Fix all detected errors.
8056         #    \note Single block can be also fixed by this method.
8057         #  @param theShape The compound to check and improve.
8058         #  @return Improved compound.
8059         #
8060         #  @ref swig_CheckAndImprove "Example"
8061         def CheckAndImprove(self,theShape):
8062             """
8063             Check, if the given shape is a blocks compound.
8064             Fix all detected errors.
8065
8066             Note:
8067                 Single block can be also fixed by this method.
8068
8069             Parameters:
8070                 theShape The compound to check and improve.
8071
8072             Returns: 
8073                 Improved compound.
8074             """
8075             # Example: see GEOM_TestOthers.py
8076             anObj = self.BlocksOp.CheckAndImprove(theShape)
8077             RaiseIfFailed("CheckAndImprove", self.BlocksOp)
8078             return anObj
8079
8080         # end of l4_blocks_measure
8081         ## @}
8082
8083         ## @addtogroup l3_blocks_op
8084         ## @{
8085
8086         ## Get all the blocks, contained in the given compound.
8087         #  @param theCompound The compound to explode.
8088         #  @param theMinNbFaces If solid has lower number of faces, it is not a block.
8089         #  @param theMaxNbFaces If solid has higher number of faces, it is not a block.
8090         #    \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
8091         #  @return List of GEOM.GEOM_Object, containing the retrieved blocks.
8092         #
8093         #  @ref tui_explode_on_blocks "Example 1"
8094         #  \n @ref swig_MakeBlockExplode "Example 2"
8095         def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
8096             """
8097             Get all the blocks, contained in the given compound.
8098
8099             Parameters:
8100                 theCompound The compound to explode.
8101                 theMinNbFaces If solid has lower number of faces, it is not a block.
8102                 theMaxNbFaces If solid has higher number of faces, it is not a block.
8103
8104             Note:
8105                 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
8106
8107             Returns:  
8108                 List of GEOM.GEOM_Object, containing the retrieved blocks.
8109             """
8110             # Example: see GEOM_TestOthers.py
8111             theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
8112             aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
8113             RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
8114             for anObj in aList:
8115                 anObj.SetParameters(Parameters)
8116                 pass
8117             return aList
8118
8119         ## Find block, containing the given point inside its volume or on boundary.
8120         #  @param theCompound Compound, to find block in.
8121         #  @param thePoint Point, close to the desired block. If the point lays on
8122         #         boundary between some blocks, we return block with nearest center.
8123         #  @return New GEOM.GEOM_Object, containing the found block.
8124         #
8125         #  @ref swig_todo "Example"
8126         def GetBlockNearPoint(self,theCompound, thePoint):
8127             """
8128             Find block, containing the given point inside its volume or on boundary.
8129
8130             Parameters:
8131                 theCompound Compound, to find block in.
8132                 thePoint Point, close to the desired block. If the point lays on
8133                          boundary between some blocks, we return block with nearest center.
8134
8135             Returns:
8136                 New GEOM.GEOM_Object, containing the found block.
8137             """
8138             # Example: see GEOM_Spanner.py
8139             anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
8140             RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
8141             return anObj
8142
8143         ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
8144         #  @param theCompound Compound, to find block in.
8145         #  @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
8146         #  @return New GEOM.GEOM_Object, containing the found block.
8147         #
8148         #  @ref swig_GetBlockByParts "Example"
8149         def GetBlockByParts(self,theCompound, theParts):
8150             """
8151              Find block, containing all the elements, passed as the parts, or maximum quantity of them.
8152
8153              Parameters:
8154                 theCompound Compound, to find block in.
8155                 theParts List of faces and/or edges and/or vertices to be parts of the found block.
8156
8157             Returns: 
8158                 New GEOM_Object, containing the found block.
8159             """
8160             # Example: see GEOM_TestOthers.py
8161             anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
8162             RaiseIfFailed("GetBlockByParts", self.BlocksOp)
8163             return anObj
8164
8165         ## Return all blocks, containing all the elements, passed as the parts.
8166         #  @param theCompound Compound, to find blocks in.
8167         #  @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
8168         #  @return List of GEOM.GEOM_Object, containing the found blocks.
8169         #
8170         #  @ref swig_todo "Example"
8171         def GetBlocksByParts(self,theCompound, theParts):
8172             """
8173             Return all blocks, containing all the elements, passed as the parts.
8174
8175             Parameters:
8176                 theCompound Compound, to find blocks in.
8177                 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
8178
8179             Returns:
8180                 List of GEOM.GEOM_Object, containing the found blocks.
8181             """
8182             # Example: see GEOM_Spanner.py
8183             aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
8184             RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
8185             return aList
8186
8187         ## Multi-transformate block and glue the result.
8188         #  Transformation is defined so, as to superpose direction faces.
8189         #  @param Block Hexahedral solid to be multi-transformed.
8190         #  @param DirFace1 ID of First direction face.
8191         #  @param DirFace2 ID of Second direction face.
8192         #  @param NbTimes Quantity of transformations to be done.
8193         #    \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
8194         #  @return New GEOM.GEOM_Object, containing the result shape.
8195         #
8196         #  @ref tui_multi_transformation "Example"
8197         def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
8198             """
8199             Multi-transformate block and glue the result.
8200             Transformation is defined so, as to superpose direction faces.
8201
8202             Parameters:
8203                 Block Hexahedral solid to be multi-transformed.
8204                 DirFace1 ID of First direction face.
8205                 DirFace2 ID of Second direction face.
8206                 NbTimes Quantity of transformations to be done.
8207
8208             Note:
8209                 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
8210
8211             Returns:
8212                 New GEOM.GEOM_Object, containing the result shape.
8213             """
8214             # Example: see GEOM_Spanner.py
8215             DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
8216             anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
8217             RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
8218             anObj.SetParameters(Parameters)
8219             return anObj
8220
8221         ## Multi-transformate block and glue the result.
8222         #  @param Block Hexahedral solid to be multi-transformed.
8223         #  @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
8224         #  @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
8225         #  @param NbTimesU,NbTimesV Quantity of transformations to be done.
8226         #  @return New GEOM.GEOM_Object, containing the result shape.
8227         #
8228         #  @ref tui_multi_transformation "Example"
8229         def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
8230                                       DirFace1V, DirFace2V, NbTimesV):
8231             """
8232             Multi-transformate block and glue the result.
8233
8234             Parameters:
8235                 Block Hexahedral solid to be multi-transformed.
8236                 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
8237                 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
8238                 NbTimesU,NbTimesV Quantity of transformations to be done.
8239
8240             Returns:
8241                 New GEOM.GEOM_Object, containing the result shape.
8242             """
8243             # Example: see GEOM_Spanner.py
8244             DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
8245               DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
8246             anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
8247                                                             DirFace1V, DirFace2V, NbTimesV)
8248             RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
8249             anObj.SetParameters(Parameters)
8250             return anObj
8251
8252         ## Build all possible propagation groups.
8253         #  Propagation group is a set of all edges, opposite to one (main)
8254         #  edge of this group directly or through other opposite edges.
8255         #  Notion of Opposite Edge make sence only on quadrangle face.
8256         #  @param theShape Shape to build propagation groups on.
8257         #  @return List of GEOM.GEOM_Object, each of them is a propagation group.
8258         #
8259         #  @ref swig_Propagate "Example"
8260         def Propagate(self,theShape):
8261             """
8262             Build all possible propagation groups.
8263             Propagation group is a set of all edges, opposite to one (main)
8264             edge of this group directly or through other opposite edges.
8265             Notion of Opposite Edge make sence only on quadrangle face.
8266
8267             Parameters:
8268                 theShape Shape to build propagation groups on.
8269
8270             Returns:
8271                 List of GEOM.GEOM_Object, each of them is a propagation group.
8272             """
8273             # Example: see GEOM_TestOthers.py
8274             listChains = self.BlocksOp.Propagate(theShape)
8275             RaiseIfFailed("Propagate", self.BlocksOp)
8276             return listChains
8277
8278         # end of l3_blocks_op
8279         ## @}
8280
8281         ## @addtogroup l3_groups
8282         ## @{
8283
8284         ## Creates a new group which will store sub-shapes of theMainShape
8285         #  @param theMainShape is a GEOM object on which the group is selected
8286         #  @param theShapeType defines a shape type of the group (see GEOM::shape_type)
8287         #  @return a newly created GEOM group
8288         #
8289         #  @ref tui_working_with_groups_page "Example 1"
8290         #  \n @ref swig_CreateGroup "Example 2"
8291         def CreateGroup(self,theMainShape, theShapeType):
8292             """
8293             Creates a new group which will store sub-shapes of theMainShape
8294
8295             Parameters:
8296                theMainShape is a GEOM object on which the group is selected
8297                theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
8298                             "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
8299
8300             Returns:
8301                a newly created GEOM group
8302
8303             Example of usage:
8304                 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
8305                 
8306             """
8307             # Example: see GEOM_TestOthers.py
8308             anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
8309             RaiseIfFailed("CreateGroup", self.GroupOp)
8310             return anObj
8311
8312         ## Adds a sub-object with ID theSubShapeId to the group
8313         #  @param theGroup is a GEOM group to which the new sub-shape is added
8314         #  @param theSubShapeID is a sub-shape ID in the main object.
8315         #  \note Use method GetSubShapeID() to get an unique ID of the sub-shape
8316         #
8317         #  @ref tui_working_with_groups_page "Example"
8318         def AddObject(self,theGroup, theSubShapeID):
8319             """
8320             Adds a sub-object with ID theSubShapeId to the group
8321
8322             Parameters:
8323                 theGroup       is a GEOM group to which the new sub-shape is added
8324                 theSubShapeID  is a sub-shape ID in the main object.
8325
8326             Note:
8327                 Use method GetSubShapeID() to get an unique ID of the sub-shape 
8328             """
8329             # Example: see GEOM_TestOthers.py
8330             self.GroupOp.AddObject(theGroup, theSubShapeID)
8331             if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
8332                 RaiseIfFailed("AddObject", self.GroupOp)
8333                 pass
8334             pass
8335
8336         ## Removes a sub-object with ID \a theSubShapeId from the group
8337         #  @param theGroup is a GEOM group from which the new sub-shape is removed
8338         #  @param theSubShapeID is a sub-shape ID in the main object.
8339         #  \note Use method GetSubShapeID() to get an unique ID of the sub-shape
8340         #
8341         #  @ref tui_working_with_groups_page "Example"
8342         def RemoveObject(self,theGroup, theSubShapeID):
8343             """
8344             Removes a sub-object with ID theSubShapeId from the group
8345
8346             Parameters:
8347                 theGroup is a GEOM group from which the new sub-shape is removed
8348                 theSubShapeID is a sub-shape ID in the main object.
8349
8350             Note:
8351                 Use method GetSubShapeID() to get an unique ID of the sub-shape
8352             """
8353             # Example: see GEOM_TestOthers.py
8354             self.GroupOp.RemoveObject(theGroup, theSubShapeID)
8355             RaiseIfFailed("RemoveObject", self.GroupOp)
8356             pass
8357
8358         ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8359         #  @param theGroup is a GEOM group to which the new sub-shapes are added.
8360         #  @param theSubShapes is a list of sub-shapes to be added.
8361         #
8362         #  @ref tui_working_with_groups_page "Example"
8363         def UnionList (self,theGroup, theSubShapes):
8364             """
8365             Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8366
8367             Parameters:
8368                 theGroup is a GEOM group to which the new sub-shapes are added.
8369                 theSubShapes is a list of sub-shapes to be added.
8370             """
8371             # Example: see GEOM_TestOthers.py
8372             self.GroupOp.UnionList(theGroup, theSubShapes)
8373             RaiseIfFailed("UnionList", self.GroupOp)
8374             pass
8375
8376         ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8377         #  @param theGroup is a GEOM group to which the new sub-shapes are added.
8378         #  @param theSubShapes is a list of indices of sub-shapes to be added.
8379         #
8380         #  @ref swig_UnionIDs "Example"
8381         def UnionIDs(self,theGroup, theSubShapes):
8382             """
8383             Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8384
8385             Parameters:
8386                 theGroup is a GEOM group to which the new sub-shapes are added.
8387                 theSubShapes is a list of indices of sub-shapes to be added.
8388             """
8389             # Example: see GEOM_TestOthers.py
8390             self.GroupOp.UnionIDs(theGroup, theSubShapes)
8391             RaiseIfFailed("UnionIDs", self.GroupOp)
8392             pass
8393
8394         ## Removes from the group all the given shapes. No errors, if some shapes are not included.
8395         #  @param theGroup is a GEOM group from which the sub-shapes are removed.
8396         #  @param theSubShapes is a list of sub-shapes to be removed.
8397         #
8398         #  @ref tui_working_with_groups_page "Example"
8399         def DifferenceList (self,theGroup, theSubShapes):
8400             """
8401             Removes from the group all the given shapes. No errors, if some shapes are not included.
8402
8403             Parameters:
8404                 theGroup is a GEOM group from which the sub-shapes are removed.
8405                 theSubShapes is a list of sub-shapes to be removed.
8406             """
8407             # Example: see GEOM_TestOthers.py
8408             self.GroupOp.DifferenceList(theGroup, theSubShapes)
8409             RaiseIfFailed("DifferenceList", self.GroupOp)
8410             pass
8411
8412         ## Removes from the group all the given shapes. No errors, if some shapes are not included.
8413         #  @param theGroup is a GEOM group from which the sub-shapes are removed.
8414         #  @param theSubShapes is a list of indices of sub-shapes to be removed.
8415         #
8416         #  @ref swig_DifferenceIDs "Example"
8417         def DifferenceIDs(self,theGroup, theSubShapes):
8418             """
8419             Removes from the group all the given shapes. No errors, if some shapes are not included.
8420
8421             Parameters:
8422                 theGroup is a GEOM group from which the sub-shapes are removed.
8423                 theSubShapes is a list of indices of sub-shapes to be removed.
8424             """            
8425             # Example: see GEOM_TestOthers.py
8426             self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
8427             RaiseIfFailed("DifferenceIDs", self.GroupOp)
8428             pass
8429
8430         ## Union of two groups.
8431         #  New group is created. It will contain all entities
8432         #  which are present in groups theGroup1 and theGroup2.
8433         #  @param theGroup1, theGroup2 are the initial GEOM groups
8434         #                              to create the united group from.
8435         #  @return a newly created GEOM group.
8436         #  @ref tui_union_groups_anchor "Example"
8437         def UnionGroups (self, theGroup1, theGroup2):
8438             """
8439             Union of two groups.
8440             New group is created. It will contain all entities
8441             which are present in groups theGroup1 and theGroup2.
8442
8443             Parameters:
8444                 theGroup1, theGroup2 are the initial GEOM groups
8445                                      to create the united group from.
8446
8447             Returns:
8448                 a newly created GEOM group.
8449             """
8450             # Example: see GEOM_TestOthers.py
8451             aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
8452             RaiseIfFailed("UnionGroups", self.GroupOp)
8453             return aGroup
8454
8455         ## Intersection of two groups.
8456         #  New group is created. It will contain only those entities
8457         #  which are present in both groups theGroup1 and theGroup2.
8458         #  @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
8459         #  @return a newly created GEOM group.
8460         #  @ref tui_intersect_groups_anchor "Example"
8461         def IntersectGroups (self, theGroup1, theGroup2):
8462             """
8463             Intersection of two groups.
8464             New group is created. It will contain only those entities
8465             which are present in both groups theGroup1 and theGroup2.
8466
8467             Parameters:
8468                 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
8469
8470             Returns:
8471                 a newly created GEOM group.
8472             """
8473             # Example: see GEOM_TestOthers.py
8474             aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
8475             RaiseIfFailed("IntersectGroups", self.GroupOp)
8476             return aGroup
8477
8478         ## Cut of two groups.
8479         #  New group is created. It will contain entities which are
8480         #  present in group theGroup1 but are not present in group theGroup2.
8481         #  @param theGroup1 is a GEOM group to include elements of.
8482         #  @param theGroup2 is a GEOM group to exclude elements of.
8483         #  @return a newly created GEOM group.
8484         #  @ref tui_cut_groups_anchor "Example"
8485         def CutGroups (self, theGroup1, theGroup2):
8486             """
8487             Cut of two groups.
8488             New group is created. It will contain entities which are
8489             present in group theGroup1 but are not present in group theGroup2.
8490
8491             Parameters:
8492                 theGroup1 is a GEOM group to include elements of.
8493                 theGroup2 is a GEOM group to exclude elements of.
8494
8495             Returns:
8496                 a newly created GEOM group.
8497             """
8498             # Example: see GEOM_TestOthers.py
8499             aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
8500             RaiseIfFailed("CutGroups", self.GroupOp)
8501             return aGroup
8502
8503         ## Union of list of groups.
8504         #  New group is created. It will contain all entities that are
8505         #  present in groups listed in theGList.
8506         #  @param theGList is a list of GEOM groups to create the united group from.
8507         #  @return a newly created GEOM group.
8508         #  @ref tui_union_groups_anchor "Example"
8509         def UnionListOfGroups (self, theGList):
8510             """
8511             Union of list of groups.
8512             New group is created. It will contain all entities that are
8513             present in groups listed in theGList.
8514
8515             Parameters:
8516                 theGList is a list of GEOM groups to create the united group from.
8517
8518             Returns:
8519                 a newly created GEOM group.
8520             """
8521             # Example: see GEOM_TestOthers.py
8522             aGroup = self.GroupOp.UnionListOfGroups(theGList)
8523             RaiseIfFailed("UnionListOfGroups", self.GroupOp)
8524             return aGroup
8525
8526         ## Cut of lists of groups.
8527         #  New group is created. It will contain only entities
8528         #  which are present in groups listed in theGList1 but 
8529         #  are not present in groups from theGList2.
8530         #  @param theGList1 is a list of GEOM groups to include elements of.
8531         #  @param theGList2 is a list of GEOM groups to exclude elements of.
8532         #  @return a newly created GEOM group.
8533         #  @ref tui_intersect_groups_anchor "Example"
8534         def IntersectListOfGroups (self, theGList):
8535             """
8536             Cut of lists of groups.
8537             New group is created. It will contain only entities
8538             which are present in groups listed in theGList1 but 
8539             are not present in groups from theGList2.
8540
8541             Parameters:
8542                 theGList1 is a list of GEOM groups to include elements of.
8543                 theGList2 is a list of GEOM groups to exclude elements of.
8544
8545             Returns:
8546                 a newly created GEOM group.
8547             """
8548             # Example: see GEOM_TestOthers.py
8549             aGroup = self.GroupOp.IntersectListOfGroups(theGList)
8550             RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
8551             return aGroup
8552
8553         ## Cut of lists of groups.
8554         #  New group is created. It will contain only entities
8555         #  which are present in groups listed in theGList1 but 
8556         #  are not present in groups from theGList2.
8557         #  @param theGList1 is a list of GEOM groups to include elements of.
8558         #  @param theGList2 is a list of GEOM groups to exclude elements of.
8559         #  @return a newly created GEOM group.
8560         #  @ref tui_cut_groups_anchor "Example"
8561         def CutListOfGroups (self, theGList1, theGList2):
8562             """
8563             Cut of lists of groups.
8564             New group is created. It will contain only entities
8565             which are present in groups listed in theGList1 but 
8566             are not present in groups from theGList2.
8567
8568             Parameters:
8569                 theGList1 is a list of GEOM groups to include elements of.
8570                 theGList2 is a list of GEOM groups to exclude elements of.
8571
8572             Returns:
8573                 a newly created GEOM group.
8574             """
8575             # Example: see GEOM_TestOthers.py
8576             aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
8577             RaiseIfFailed("CutListOfGroups", self.GroupOp)
8578             return aGroup
8579
8580         ## Returns a list of sub-objects ID stored in the group
8581         #  @param theGroup is a GEOM group for which a list of IDs is requested
8582         #
8583         #  @ref swig_GetObjectIDs "Example"
8584         def GetObjectIDs(self,theGroup):
8585             """
8586             Returns a list of sub-objects ID stored in the group
8587
8588             Parameters:
8589                 theGroup is a GEOM group for which a list of IDs is requested
8590             """
8591             # Example: see GEOM_TestOthers.py
8592             ListIDs = self.GroupOp.GetObjects(theGroup)
8593             RaiseIfFailed("GetObjects", self.GroupOp)
8594             return ListIDs
8595
8596         ## Returns a type of sub-objects stored in the group
8597         #  @param theGroup is a GEOM group which type is returned.
8598         #
8599         #  @ref swig_GetType "Example"
8600         def GetType(self,theGroup):
8601             """
8602             Returns a type of sub-objects stored in the group
8603
8604             Parameters:
8605                 theGroup is a GEOM group which type is returned.
8606             """
8607             # Example: see GEOM_TestOthers.py
8608             aType = self.GroupOp.GetType(theGroup)
8609             RaiseIfFailed("GetType", self.GroupOp)
8610             return aType
8611
8612         ## Convert a type of geom object from id to string value
8613         #  @param theId is a GEOM obect type id.
8614         #  @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
8615         #  @ref swig_GetType "Example"
8616         def ShapeIdToType(self, theId):
8617             """
8618             Convert a type of geom object from id to string value
8619
8620             Parameters:
8621                 theId is a GEOM obect type id.
8622                 
8623             Returns:
8624                 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
8625             """
8626             if theId == 0:
8627                 return "COPY"
8628             if theId == 1:
8629                 return "IMPORT"
8630             if theId == 2:
8631                 return "POINT"
8632             if theId == 3:
8633                 return "VECTOR"
8634             if theId == 4:
8635                 return "PLANE"
8636             if theId == 5:
8637                 return "LINE"
8638             if theId == 6:
8639                 return "TORUS"
8640             if theId == 7:
8641                 return "BOX"
8642             if theId == 8:
8643                 return "CYLINDER"
8644             if theId == 9:
8645                 return "CONE"
8646             if theId == 10:
8647                 return "SPHERE"
8648             if theId == 11:
8649                 return "PRISM"
8650             if theId == 12:
8651                 return "REVOLUTION"
8652             if theId == 13:
8653                 return "BOOLEAN"
8654             if theId == 14:
8655                 return "PARTITION"
8656             if theId == 15:
8657                 return "POLYLINE"
8658             if theId == 16:
8659                 return "CIRCLE"
8660             if theId == 17:
8661                 return "SPLINE"
8662             if theId == 18:
8663                 return "ELLIPSE"
8664             if theId == 19:
8665                 return "CIRC_ARC"
8666             if theId == 20:
8667                 return "FILLET"
8668             if theId == 21:
8669                 return "CHAMFER"
8670             if theId == 22:
8671                 return "EDGE"
8672             if theId == 23:
8673                 return "WIRE"
8674             if theId == 24:
8675                 return "FACE"
8676             if theId == 25:
8677                 return "SHELL"
8678             if theId == 26:
8679                 return "SOLID"
8680             if theId == 27:
8681                 return "COMPOUND"
8682             if theId == 28:
8683                 return "SUBSHAPE"
8684             if theId == 29:
8685                 return "PIPE"
8686             if theId == 30:
8687                 return "ARCHIMEDE"
8688             if theId == 31:
8689                 return "FILLING"
8690             if theId == 32:
8691                 return "EXPLODE"
8692             if theId == 33:
8693                 return "GLUED"
8694             if theId == 34:
8695                 return "SKETCHER"
8696             if theId == 35:
8697                 return "CDG"
8698             if theId == 36:
8699                 return "FREE_BOUNDS"
8700             if theId == 37:
8701                 return "GROUP"
8702             if theId == 38:
8703                 return "BLOCK"
8704             if theId == 39:
8705                 return "MARKER"
8706             if theId == 40:
8707                 return "THRUSECTIONS"
8708             if theId == 41:
8709                 return "COMPOUNDFILTER"
8710             if theId == 42:
8711                 return "SHAPES_ON_SHAPE"
8712             if theId == 43:
8713                 return "ELLIPSE_ARC"
8714             if theId == 44:
8715                 return "3DSKETCHER"
8716             if theId == 45:
8717                 return "FILLET_2D"
8718             if theId == 46:
8719                 return "FILLET_1D"
8720             if theId == 201:
8721                 return "PIPETSHAPE"
8722             return "Shape Id not exist."
8723
8724         ## Returns a main shape associated with the group
8725         #  @param theGroup is a GEOM group for which a main shape object is requested
8726         #  @return a GEOM object which is a main shape for theGroup
8727         #
8728         #  @ref swig_GetMainShape "Example"
8729         def GetMainShape(self,theGroup):
8730             """
8731             Returns a main shape associated with the group
8732
8733             Parameters:
8734                 theGroup is a GEOM group for which a main shape object is requested
8735
8736             Returns:
8737                 a GEOM object which is a main shape for theGroup
8738
8739             Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
8740             """
8741             # Example: see GEOM_TestOthers.py
8742             anObj = self.GroupOp.GetMainShape(theGroup)
8743             RaiseIfFailed("GetMainShape", self.GroupOp)
8744             return anObj
8745
8746         ## Create group of edges of theShape, whose length is in range [min_length, max_length].
8747         #  If include_min/max == 0, edges with length == min/max_length will not be included in result.
8748         #  @param theShape given shape (see GEOM.GEOM_Object)
8749         #  @param min_length minimum length of edges of theShape
8750         #  @param max_length maximum length of edges of theShape
8751         #  @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8752         #  @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8753         #  @return a newly created GEOM group of edges
8754         #  @@ref swig_todo "Example"
8755         def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
8756             """
8757             Create group of edges of theShape, whose length is in range [min_length, max_length].
8758             If include_min/max == 0, edges with length == min/max_length will not be included in result.
8759
8760             Parameters:
8761                 theShape given shape
8762                 min_length minimum length of edges of theShape
8763                 max_length maximum length of edges of theShape
8764                 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8765                 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8766
8767              Returns:
8768                 a newly created GEOM group of edges.
8769             """
8770             edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
8771             edges_in_range = []
8772             for edge in edges:
8773                 Props = self.BasicProperties(edge)
8774                 if min_length <= Props[0] and Props[0] <= max_length:
8775                     if (not include_min) and (min_length == Props[0]):
8776                         skip = 1
8777                     else:
8778                         if (not include_max) and (Props[0] == max_length):
8779                             skip = 1
8780                         else:
8781                             edges_in_range.append(edge)
8782
8783             if len(edges_in_range) <= 0:
8784                 print "No edges found by given criteria"
8785                 return 0
8786
8787             group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
8788             self.UnionList(group_edges, edges_in_range)
8789
8790             return group_edges
8791
8792         ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
8793         #  If include_min/max == 0, edges with length == min/max_length will not be included in result.
8794         #  @param min_length minimum length of edges of selected shape
8795         #  @param max_length maximum length of edges of selected shape
8796         #  @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8797         #  @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8798         #  @return a newly created GEOM group of edges
8799         #  @ref swig_todo "Example"
8800         def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
8801             """
8802             Create group of edges of selected shape, whose length is in range [min_length, max_length].
8803             If include_min/max == 0, edges with length == min/max_length will not be included in result.
8804
8805             Parameters:
8806                 min_length minimum length of edges of selected shape
8807                 max_length maximum length of edges of selected shape
8808                 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8809                 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8810
8811              Returns:
8812                 a newly created GEOM group of edges.
8813             """
8814             nb_selected = sg.SelectedCount()
8815             if nb_selected < 1:
8816                 print "Select a shape before calling this function, please."
8817                 return 0
8818             if nb_selected > 1:
8819                 print "Only one shape must be selected"
8820                 return 0
8821
8822             id_shape = sg.getSelected(0)
8823             shape = IDToObject( id_shape )
8824
8825             group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
8826
8827             left_str  = " < "
8828             right_str = " < "
8829             if include_min: left_str  = " <= "
8830             if include_max: right_str  = " <= "
8831
8832             self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
8833                                     + left_str + "length" + right_str + `max_length`)
8834
8835             sg.updateObjBrowser(1)
8836
8837             return group_edges
8838
8839         # end of l3_groups
8840         ## @}
8841
8842         ## @addtogroup l4_advanced
8843         ## @{
8844
8845         ## Create a T-shape object with specified caracteristics for the main
8846         #  and the incident pipes (radius, width, half-length).
8847         #  The extremities of the main pipe are located on junctions points P1 and P2.
8848         #  The extremity of the incident pipe is located on junction point P3.
8849         #  If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8850         #  the main plane of the T-shape is XOY.
8851         #  @param theR1 Internal radius of main pipe
8852         #  @param theW1 Width of main pipe
8853         #  @param theL1 Half-length of main pipe
8854         #  @param theR2 Internal radius of incident pipe (R2 < R1)
8855         #  @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8856         #  @param theL2 Half-length of incident pipe
8857         #  @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8858         #  @param theP1 1st junction point of main pipe
8859         #  @param theP2 2nd junction point of main pipe
8860         #  @param theP3 Junction point of incident pipe
8861         #  @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8862         #
8863         #  @ref tui_creation_pipetshape "Example"
8864         def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8865             """
8866             Create a T-shape object with specified caracteristics for the main
8867             and the incident pipes (radius, width, half-length).
8868             The extremities of the main pipe are located on junctions points P1 and P2.
8869             The extremity of the incident pipe is located on junction point P3.
8870             If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8871             the main plane of the T-shape is XOY.
8872
8873             Paremeters:
8874                 theR1 Internal radius of main pipe
8875                 theW1 Width of main pipe
8876                 theL1 Half-length of main pipe
8877                 theR2 Internal radius of incident pipe (R2 < R1)
8878                 theW2 Width of incident pipe (R2+W2 < R1+W1)
8879                 theL2 Half-length of incident pipe
8880                 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8881                 theP1 1st junction point of main pipe
8882                 theP2 2nd junction point of main pipe
8883                 theP3 Junction point of incident pipe
8884
8885             Returns:
8886                 List of GEOM_Object, containing the created shape and propagation groups.
8887
8888             Example of usage:
8889                 # create PipeTShape object
8890                 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
8891                 # create PipeTShape object with position
8892                 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
8893             """
8894             theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)        
8895             if (theP1 and theP2 and theP3):
8896                 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
8897             else:
8898                 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
8899             RaiseIfFailed("MakePipeTShape", self.AdvOp)
8900             if Parameters: anObj[0].SetParameters(Parameters)
8901             return anObj
8902
8903         ## Create a T-shape object with chamfer and with specified caracteristics for the main
8904         #  and the incident pipes (radius, width, half-length). The chamfer is
8905         #  created on the junction of the pipes.
8906         #  The extremities of the main pipe are located on junctions points P1 and P2.
8907         #  The extremity of the incident pipe is located on junction point P3.
8908         #  If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8909         #  the main plane of the T-shape is XOY.
8910         #  @param theR1 Internal radius of main pipe
8911         #  @param theW1 Width of main pipe
8912         #  @param theL1 Half-length of main pipe
8913         #  @param theR2 Internal radius of incident pipe (R2 < R1)
8914         #  @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8915         #  @param theL2 Half-length of incident pipe
8916         #  @param theH Height of the chamfer.
8917         #  @param theW Width of the chamfer.
8918         #  @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8919         #  @param theP1 1st junction point of main pipe
8920         #  @param theP2 2nd junction point of main pipe
8921         #  @param theP3 Junction point of incident pipe
8922         #  @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8923         #
8924         #  @ref tui_creation_pipetshape "Example"
8925         def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8926             """
8927             Create a T-shape object with chamfer and with specified caracteristics for the main
8928             and the incident pipes (radius, width, half-length). The chamfer is
8929             created on the junction of the pipes.
8930             The extremities of the main pipe are located on junctions points P1 and P2.
8931             The extremity of the incident pipe is located on junction point P3.
8932             If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8933             the main plane of the T-shape is XOY.
8934
8935             Paremeters:
8936                 theR1 Internal radius of main pipe
8937                 theW1 Width of main pipe
8938                 theL1 Half-length of main pipe
8939                 theR2 Internal radius of incident pipe (R2 < R1)
8940                 theW2 Width of incident pipe (R2+W2 < R1+W1)
8941                 theL2 Half-length of incident pipe
8942                 theH Height of the chamfer.
8943                 theW Width of the chamfer.
8944                 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8945                 theP1 1st junction point of main pipe
8946                 theP2 2nd junction point of main pipe
8947                 theP3 Junction point of incident pipe
8948
8949             Returns:
8950                 List of GEOM_Object, containing the created shape and propagation groups.
8951
8952             Example of usage:
8953                 # create PipeTShape with chamfer object
8954                 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
8955                 # create PipeTShape with chamfer object with position
8956                 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
8957             """
8958             theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
8959             if (theP1 and theP2 and theP3):
8960               anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
8961             else:
8962               anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
8963             RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
8964             if Parameters: anObj[0].SetParameters(Parameters)
8965             return anObj
8966
8967         ## Create a T-shape object with fillet and with specified caracteristics for the main
8968         #  and the incident pipes (radius, width, half-length). The fillet is
8969         #  created on the junction of the pipes.
8970         #  The extremities of the main pipe are located on junctions points P1 and P2.
8971         #  The extremity of the incident pipe is located on junction point P3.
8972         #  If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8973         #  the main plane of the T-shape is XOY.
8974         #  @param theR1 Internal radius of main pipe
8975         #  @param theW1 Width of main pipe
8976         #  @param theL1 Half-length of main pipe
8977         #  @param theR2 Internal radius of incident pipe (R2 < R1)
8978         #  @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8979         #  @param theL2 Half-length of incident pipe
8980         #  @param theRF Radius of curvature of fillet.
8981         #  @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8982         #  @param theP1 1st junction point of main pipe
8983         #  @param theP2 2nd junction point of main pipe
8984         #  @param theP3 Junction point of incident pipe
8985         #  @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8986         #
8987         #  @ref tui_creation_pipetshape "Example"
8988         def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8989             """
8990             Create a T-shape object with fillet and with specified caracteristics for the main
8991             and the incident pipes (radius, width, half-length). The fillet is
8992             created on the junction of the pipes.
8993             The extremities of the main pipe are located on junctions points P1 and P2.
8994             The extremity of the incident pipe is located on junction point P3.
8995
8996             Paremeters:
8997                 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8998                 the main plane of the T-shape is XOY.
8999                 theR1 Internal radius of main pipe
9000                 theW1 Width of main pipe
9001                 heL1 Half-length of main pipe
9002                 theR2 Internal radius of incident pipe (R2 < R1)
9003                 theW2 Width of incident pipe (R2+W2 < R1+W1)
9004                 theL2 Half-length of incident pipe
9005                 theRF Radius of curvature of fillet.
9006                 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
9007                 theP1 1st junction point of main pipe
9008                 theP2 2nd junction point of main pipe
9009                 theP3 Junction point of incident pipe
9010                 
9011             Returns:
9012                 List of GEOM_Object, containing the created shape and propagation groups.
9013                 
9014             Example of usage:
9015                 # create PipeTShape with fillet object
9016                 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
9017                 # create PipeTShape with fillet object with position
9018                 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
9019         
9020             """
9021             theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
9022             if (theP1 and theP2 and theP3):
9023               anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
9024             else:
9025               anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
9026             RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
9027             if Parameters: anObj[0].SetParameters(Parameters)
9028             return anObj
9029
9030         ## This function allows creating a disk already divided into blocks. It
9031         #  can be used to create divided pipes for later meshing in hexaedra.
9032         #  @param theR Radius of the disk
9033         #  @param theOrientation Orientation of the plane on which the disk will be built
9034         #         1 = XOY, 2 = OYZ, 3 = OZX
9035         #  @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
9036         #  @return New GEOM_Object, containing the created shape.
9037         #
9038         #  @ref tui_creation_divideddisk "Example"
9039         def MakeDividedDisk(self, theR, theOrientation, thePattern ):
9040             theR, Parameters = ParseParameters(theR)
9041             anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
9042             RaiseIfFailed("MakeDividedDisk", self.AdvOp)
9043             if Parameters: anObj.SetParameters(Parameters)
9044             return anObj
9045             
9046         ## This function allows creating a disk already divided into blocks. It
9047         #  can be used to create divided pipes for later meshing in hexaedra.
9048         #  @param theCenter Center of the disk
9049         #  @param theVector Normal vector to the plane of the created disk
9050         #  @param theRadius Radius of the disk
9051         #  @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
9052         #  @return New GEOM_Object, containing the created shape.
9053         #
9054         #  @ref tui_creation_divideddisk "Example"
9055         def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern):
9056             theRadius, Parameters = ParseParameters(theRadius)
9057             anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
9058             RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
9059             if Parameters: anObj.SetParameters(Parameters)
9060             return anObj
9061
9062         ## Builds a cylinder prepared for hexa meshes
9063         #  @param theR Radius of the cylinder
9064         #  @param theH Height of the cylinder
9065         #  @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
9066         #  @return New GEOM_Object, containing the created shape.
9067         #
9068         #  @ref tui_creation_dividedcylinder "Example"
9069         def MakeDividedCylinder(self, theR, theH, thePattern):
9070             theR, theH, Parameters = ParseParameters(theR, theH)
9071             anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
9072             RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
9073             if Parameters: anObj.SetParameters(Parameters)
9074             return anObj
9075
9076         ## Export a shape to XAO Format
9077         #  @param theExportingShape Shape to export
9078         #  @param theFileName The name of the exported file
9079         #  @param thelGroups List of groups to export
9080         #  @param thelFields List of fields to export
9081         #  @return New GEOM_Object, containing the created shape.
9082         #
9083         #  @ref tui_creation_exportxao "Example"
9084         def ExportXAO(self, theExportingShape, theFileName, thelGroups, thelFields):
9085             theExportingShape, theFileName, thelGroups, thelFields, Parameters = ParseParameters(theExportingShape, theFileName, thelGroups, thelFields)
9086             isGood = self.ImpExpOp.ExportXAO(theExportingShape, theFileName, thelGroups, thelFields)
9087             RaiseIfFailed("ExportXAO", self.ImpExpOp)
9088             #if Parameters: anObj.SetParameters(Parameters)
9089             return isGood
9090
9091         #@@ insert new functions before this line @@ do not remove this line @@#
9092
9093         # end of l4_advanced
9094         ## @}
9095
9096         ## Create a copy of the given object
9097         #
9098         #  @param theOriginal geometry object for copy
9099         #  @return unique object identifier
9100         #  @ingroup l1_geompy_auxiliary
9101         #  @ref swig_MakeCopy "Example"
9102         def MakeCopy(self,theOriginal):
9103             """
9104             Create a copy of the given object
9105
9106             Paremeters:
9107                 theOriginal geometry object for copy
9108
9109             Returns:
9110                 unique object identifier
9111
9112             Example of usage: Copy = geompy.MakeCopy(Box)
9113             """
9114             # Example: see GEOM_TestAll.py
9115             anObj = self.InsertOp.MakeCopy(theOriginal)
9116             RaiseIfFailed("MakeCopy", self.InsertOp)
9117             return anObj
9118
9119         ## Add Path to load python scripts from
9120         #  @param Path a path to load python scripts from
9121         #  @ingroup l1_geompy_auxiliary
9122         def addPath(self,Path):
9123             """
9124             Add Path to load python scripts from
9125
9126             Parameters:
9127                 Path a path to load python scripts from
9128             """
9129             if (sys.path.count(Path) < 1):
9130                 sys.path.append(Path)
9131                 pass
9132             pass
9133
9134         ## Load marker texture from the file
9135         #  @param Path a path to the texture file
9136         #  @return unique texture identifier
9137         #  @ingroup l1_geompy_auxiliary
9138         def LoadTexture(self, Path):
9139             """
9140             Load marker texture from the file
9141             
9142             Parameters:
9143                 Path a path to the texture file
9144                 
9145             Returns:
9146                 unique texture identifier
9147             """
9148             # Example: see GEOM_TestAll.py
9149             ID = self.InsertOp.LoadTexture(Path)
9150             RaiseIfFailed("LoadTexture", self.InsertOp)
9151             return ID
9152
9153         ## Get internal name of the object based on its study entry
9154         #  @note This method does not provide an unique identifier of the geometry object.
9155         #  @note This is internal function of GEOM component, though it can be used outside it for 
9156         #  appropriate reason (e.g. for identification of geometry object).
9157         #  @param obj geometry object
9158         #  @return unique object identifier
9159         #  @ingroup l1_geompy_auxiliary
9160         def getObjectID(self, obj):
9161             """
9162             Get internal name of the object based on its study entry.
9163             Note: this method does not provide an unique identifier of the geometry object.
9164             It is an internal function of GEOM component, though it can be used outside GEOM for 
9165             appropriate reason (e.g. for identification of geometry object).
9166
9167             Parameters:
9168                 obj geometry object
9169
9170             Returns:
9171                 unique object identifier
9172             """
9173             ID = ""
9174             entry = salome.ObjectToID(obj)
9175             if entry is not None:
9176                 lst = entry.split(":")
9177                 if len(lst) > 0:
9178                     ID = lst[-1] # -1 means last item in the list            
9179                     return "GEOM_" + ID
9180             return ID
9181                 
9182             
9183
9184         ## Add marker texture. @a Width and @a Height parameters
9185         #  specify width and height of the texture in pixels.
9186         #  If @a RowData is @c True, @a Texture parameter should represent texture data
9187         #  packed into the byte array. If @a RowData is @c False (default), @a Texture
9188         #  parameter should be unpacked string, in which '1' symbols represent opaque
9189         #  pixels and '0' represent transparent pixels of the texture bitmap.
9190         #
9191         #  @param Width texture width in pixels
9192         #  @param Height texture height in pixels
9193         #  @param Texture texture data
9194         #  @param RowData if @c True, @a Texture data are packed in the byte stream
9195         #  @return unique texture identifier
9196         #  @ingroup l1_geompy_auxiliary
9197         def AddTexture(self, Width, Height, Texture, RowData=False):
9198             """
9199             Add marker texture. Width and Height parameters
9200             specify width and height of the texture in pixels.
9201             If RowData is True, Texture parameter should represent texture data
9202             packed into the byte array. If RowData is False (default), Texture
9203             parameter should be unpacked string, in which '1' symbols represent opaque
9204             pixels and '0' represent transparent pixels of the texture bitmap.
9205
9206             Parameters:
9207                 Width texture width in pixels
9208                 Height texture height in pixels
9209                 Texture texture data
9210                 RowData if True, Texture data are packed in the byte stream
9211
9212             Returns:
9213                 return unique texture identifier
9214             """
9215             if not RowData: Texture = PackData(Texture)
9216             ID = self.InsertOp.AddTexture(Width, Height, Texture)
9217             RaiseIfFailed("AddTexture", self.InsertOp)
9218             return ID
9219
9220 import omniORB
9221 #Register the new proxy for GEOM_Gen
9222 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)