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