Salome HOME
0022686: [CEA 1268] Explode a shape into edges sorted in a row from a starting point
[modules/geom.git] / src / GEOM_SWIG / geomBuilder.py
1 #  -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2014  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, or (at your option) any later version.
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
21 #  GEOM GEOM_SWIG : binding of C++ implementation with Python
22 #  File   : geomBuilder.py
23 #  Author : Paul RASCLE, EDF
24 #  Module : GEOM
25
26 """
27     \namespace geomBuilder
28     \brief Module geomBuilder
29 """
30
31 ##
32 ## @defgroup geomBuilder geomBuilder Python module
33 ## @{
34 ##
35 ## @details
36 ##
37 ## By default, all functions of geomBuilder Python module do not publish
38 ## resulting geometrical objects. This can be done in the Python script
39 ## by means of \ref geomBuilder.geomBuilder.addToStudy() "addToStudy()"
40 ## or \ref geomBuilder.geomBuilder.addToStudyInFather() "addToStudyInFather()"
41 ## functions.
42 ##
43 ## However, it is possible to publish result data in the study
44 ## automatically. For this, almost each function of
45 ## \ref geomBuilder.geomBuilder "geomBuilder" class has
46 ## an additional @a theName parameter (@c None by default).
47 ## As soon as non-empty string value is passed to this parameter,
48 ## the result object is published in the study automatically.
49 ##
50 ## For example, consider the following Python script:
51 ##
52 ## @code
53 ## import salome
54 ## from salome.geom import geomBuilder
55 ## geompy = geomBuilder.New(salome.myStudy)
56 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
57 ## geompy.addToStudy(box, "box")             # explicit publishing
58 ## @endcode
59 ##
60 ## Last two lines can be replaced by one-line instruction:
61 ##
62 ## @code
63 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
64 ## @endcode
65 ##
66 ## ... or simply
67 ##
68 ## @code
69 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
70 ## @endcode
71 ##
72 ## Note, that some functions produce more than one geometrical objects. For example,
73 ## \ref geomBuilder.geomBuilder.GetNonBlocks() "GetNonBlocks()" function returns two objects:
74 ## group of all non-hexa solids and group of all non-quad faces.
75 ## For such functions it is possible to specify separate names for results.
76 ##
77 ## For example
78 ##
79 ## @code
80 ## # create and publish cylinder
81 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
82 ## # get non blocks from cylinder
83 ## g1, g2 = geompy.GetNonBlocks(cyl, "nonblock")
84 ## @endcode
85 ##
86 ## Above example will publish both result compounds (first with non-hexa solids and
87 ## second with non-quad faces) as two items, both named "nonblock".
88 ## However, if second command is invoked as
89 ##
90 ## @code
91 ## g1, g2 = geompy.GetNonBlocks(cyl, ("nonhexa", "nonquad"))
92 ## @endcode
93 ##
94 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
95 ##
96 ## Automatic publication of all results can be also enabled/disabled by means of the function
97 ## \ref geomBuilder.geomBuilder.addToStudyAuto() "addToStudyAuto()". The automatic publishing
98 ## is managed by the numeric parameter passed to this function:
99 ## - if @a maxNbSubShapes = 0, automatic publishing is disabled.
100 ## - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
101 ##   maximum number of sub-shapes allowed for publishing is unlimited; any negative
102 ##   value passed as parameter has the same effect.
103 ## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
104 ##   maximum number of sub-shapes allowed for publishing is set to specified value.
105 ##
106 ## When automatic publishing is enabled, you even do not need to pass @a theName parameter
107 ## to the functions creating objects, instead default names will be used. However, you
108 ## can always change the behavior, by passing explicit name to the @a theName parameter
109 ## and it will be used instead default one.
110 ## The publishing of the collections of objects will be done according to the above
111 ## mentioned rules (maximum allowed number of sub-shapes).
112 ##
113 ## For example:
114 ##
115 ## @code
116 ## import salome
117 ## from salome.geom import geomBuilder
118 ## geompy = geomBuilder.New(salome.myStudy)
119 ## geompy.addToStudyAuto() # enable automatic publication
120 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
121 ## # the box is created and published in the study with default name
122 ## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
123 ## vertices = geompy.SubShapeAll(box, geomBuilder.ShapeType['VERTEX'])
124 ## # only 5 first vertices will be published, with default names
125 ## print len(vertices)
126 ## # note, that result value still containes all 8 vertices
127 ## geompy.addToStudyAuto(-1) # disable automatic publication
128 ## @endcode
129 ##
130 ## This feature can be used, for example, for debugging purposes.
131 ##
132 ## @note
133 ## - Use automatic publication feature with caution. When it is enabled, any function of
134 ##   \ref geomBuilder.geomBuilder "geomBuilder" class publishes the results in the study,
135 ##   that can lead to the huge size of the study data tree.
136 ##   For example, repeating call of \ref geomBuilder.geomBuilder.SubShapeAll() "SubShapeAll()"
137 ##   command on the same main shape each time will publish all child objects, that will lead
138 ##   to a lot of duplicated items in the study.
139 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
140 ##   shape was also published before. Otherwise, sub-shapes are published as top-level objects.
141 ## - Some functions of \ref geomBuilder.geomBuilder "geomBuilder" class do not have
142 ##   \a theName parameter (and, thus, do not support automatic publication).
143 ##   For example, some transformation operations like
144 ##   \ref geomBuilder.geomBuilder.TranslateDXDYDZ() "TranslateDXDYDZ()".
145 ##   Refer to the documentation to check if some function has such possibility.
146 ##
147 ## It is possible to customize the representation of the geometrical
148 ## data in the data tree; this can be done by using folders. A folder can
149 ## be created in the study tree using function
150 ## \ref geomBuilder.geomBuilder.NewFolder() "NewFolder()"
151 ## (by default it is created under the "Geometry" root object).
152 ## As soon as folder is created, any published geometry object
153 ## can be moved into it.
154 ##
155 ## For example:
156 ##
157 ## @code
158 ## import salome
159 ## from salome.geom import geomBuilder
160 ## geompy = geomBuilder.New(salome.myStudy)
161 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
162 ## # the box was created and published in the study
163 ## folder = geompy.NewFolder("Primitives")
164 ## # an empty "Primitives" folder was created under default "Geometry" root object
165 ## geompy.PutToFolder(box, folder)
166 ## # the box was moved into "Primitives" folder
167 ## @endcode
168 ##
169 ## Subfolders are also can be created by specifying another folder as a parent:
170 ##
171 ## @code
172 ## subfolder = geompy.NewFolder("3D", folder)
173 ## # "3D" folder was created under "Primitives" folder
174 ## @endcode
175 ##
176 ## @note
177 ## - Folder container is just a representation layer object that
178 ## deals with already published objects only. So, any geometry object
179 ## should be published in the study (for example, with
180 ## \ref geomBuilder.geomBuilder.PutToFolder() "addToStudy()" function)
181 ## BEFORE moving it into any existing folder.
182 ## - \ref geomBuilder.geomBuilder.PutToFolder() "PutToFolder()" function
183 ## does not change physical position of geometry object in the study tree,
184 ## it only affects on the representation of the data tree.
185 ## - It is impossible to publish geometry object using any folder as father.
186 ##
187 ##  \defgroup l1_publish_data
188 ##  \defgroup l1_geomBuilder_auxiliary
189 ##  \defgroup l1_geomBuilder_purpose
190 ## @}
191
192 ## @defgroup l1_publish_data Publishing results in SALOME study
193
194 ## @defgroup l1_geomBuilder_auxiliary Auxiliary data structures and methods
195
196 ## @defgroup l1_geomBuilder_purpose   All package methods, grouped by their purpose
197 ## @{
198 ##   @defgroup l2_import_export Importing/exporting geometrical objects
199 ##   @defgroup l2_creating      Creating geometrical objects
200 ##   @{
201 ##     @defgroup l3_basic_go      Creating Basic Geometric Objects
202 ##     @{
203 ##       @defgroup l4_curves        Creating Curves
204
205 ##     @}
206 ##     @defgroup l3_3d_primitives Creating 3D Primitives
207 ##     @defgroup l3_complex       Creating Complex Objects
208 ##     @defgroup l3_groups        Working with groups
209 ##     @defgroup l3_blocks        Building by blocks
210 ##     @{
211 ##       @defgroup l4_blocks_measure Check and Improve
212
213 ##     @}
214 ##     @defgroup l3_sketcher      Sketcher
215 ##     @defgroup l3_advanced      Creating Advanced Geometrical Objects
216 ##     @{
217 ##       @defgroup l4_decompose     Decompose objects
218 ##       @defgroup l4_decompose_d   Decompose objects deprecated methods
219 ##       @defgroup l4_access        Access to sub-shapes by their unique IDs inside the main shape
220 ##       @defgroup l4_obtain        Access to sub-shapes by a criteria
221 ##       @defgroup l4_advanced      Advanced objects creation functions
222
223 ##     @}
224
225 ##   @}
226 ##   @defgroup l2_transforming  Transforming geometrical objects
227 ##   @{
228 ##     @defgroup l3_basic_op      Basic Operations
229 ##     @defgroup l3_boolean       Boolean Operations
230 ##     @defgroup l3_transform     Transformation Operations
231 ##     @defgroup l3_transform_d   Transformation Operations deprecated methods
232 ##     @defgroup l3_local         Local Operations (Fillet, Chamfer and other Features)
233 ##     @defgroup l3_blocks_op     Blocks Operations
234 ##     @defgroup l3_healing       Repairing Operations
235 ##     @defgroup l3_restore_ss    Restore presentation parameters and a tree of sub-shapes
236
237 ##   @}
238 ##   @defgroup l2_measure       Using measurement tools
239 ##   @defgroup l2_field         Field on Geometry
240
241 ## @}
242
243 # initialize SALOME session in try/except block
244 # to avoid problems in some cases, e.g. when generating documentation
245 try:
246     import salome
247     salome.salome_init()
248     from salome import *
249 except:
250     pass
251
252 from salome_notebook import *
253
254 import GEOM
255 import math
256 import os
257 import functools
258
259 from salome.geom.gsketcher import Sketcher3D, Sketcher2D, Polyline2D
260
261 # service function
262 def _toListOfNames(_names, _size=-1):
263     l = []
264     import types
265     if type(_names) in [types.ListType, types.TupleType]:
266         for i in _names: l.append(i)
267     elif _names:
268         l.append(_names)
269     if l and len(l) < _size:
270         for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
271     return l
272
273 # Decorator function to manage transactions for all geometric operations.
274 def ManageTransactions(theOpeName):
275     def MTDecorator(theFunction):
276         # To keep the original function name an documentation.
277         @functools.wraps(theFunction)
278         def OpenCallClose(self, *args, **kwargs):
279             # Open transaction
280             anOperation = getattr(self, theOpeName)
281             anOperation.StartOperation()
282             try:
283                 # Call the function
284                 res = theFunction(self, *args, **kwargs)
285                 # Commit transaction
286                 anOperation.FinishOperation()
287                 return res
288             except:
289                 # Abort transaction
290                 anOperation.AbortOperation()
291                 raise
292         return OpenCallClose
293     return MTDecorator
294
295 ## Raise an Error, containing the Method_name, if Operation is Failed
296 ## @ingroup l1_geomBuilder_auxiliary
297 def RaiseIfFailed (Method_name, Operation):
298     if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
299         raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
300
301 ## Return list of variables value from salome notebook
302 ## @ingroup l1_geomBuilder_auxiliary
303 def ParseParameters(*parameters):
304     Result = []
305     StringResult = []
306     for parameter in parameters:
307         if isinstance(parameter, list):
308             lResults = ParseParameters(*parameter)
309             if len(lResults) > 0:
310                 Result.append(lResults[:-1])
311                 StringResult += lResults[-1].split(":")
312                 pass
313             pass
314         else:
315             if isinstance(parameter,str):
316                 if notebook.isVariable(parameter):
317                     Result.append(notebook.get(parameter))
318                 else:
319                     raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
320                 pass
321             else:
322                 Result.append(parameter)
323                 pass
324             StringResult.append(str(parameter))
325             pass
326         pass
327     if Result:
328         Result.append(":".join(StringResult))
329     else:
330         Result = ":".join(StringResult)
331     return Result
332
333 ## Return list of variables value from salome notebook
334 ## @ingroup l1_geomBuilder_auxiliary
335 def ParseList(list):
336     Result = []
337     StringResult = ""
338     for parameter in list:
339         if isinstance(parameter,str) and notebook.isVariable(parameter):
340             Result.append(str(notebook.get(parameter)))
341             pass
342         else:
343             Result.append(str(parameter))
344             pass
345
346         StringResult = StringResult + str(parameter)
347         StringResult = StringResult + ":"
348         pass
349     StringResult = StringResult[:len(StringResult)-1]
350     return Result, StringResult
351
352 ## Return list of variables value from salome notebook
353 ## @ingroup l1_geomBuilder_auxiliary
354 def ParseSketcherCommand(command):
355     Result = ""
356     StringResult = ""
357     sections = command.split(":")
358     for section in sections:
359         parameters = section.split(" ")
360         paramIndex = 1
361         for parameter in parameters:
362             if paramIndex > 1 and parameter.find("'") != -1:
363                 parameter = parameter.replace("'","")
364                 if notebook.isVariable(parameter):
365                     Result = Result + str(notebook.get(parameter)) + " "
366                     pass
367                 else:
368                     raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
369                     pass
370                 pass
371             else:
372                 Result = Result + str(parameter) + " "
373                 pass
374             if paramIndex > 1:
375                 StringResult = StringResult + parameter
376                 StringResult = StringResult + ":"
377                 pass
378             paramIndex = paramIndex + 1
379             pass
380         Result = Result[:len(Result)-1] + ":"
381         pass
382     Result = Result[:len(Result)-1]
383     return Result, StringResult
384
385 ## Helper function which can be used to pack the passed string to the byte data.
386 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
387 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
388 ## For example,
389 ## \code
390 ## val = PackData("10001110") # val = 0xAE
391 ## val = PackData("1")        # val = 0x80
392 ## \endcode
393 ## @param data unpacked data - a string containing '1' and '0' symbols
394 ## @return data packed to the byte stream
395 ## @ingroup l1_geomBuilder_auxiliary
396 def PackData(data):
397     """
398     Helper function which can be used to pack the passed string to the byte data.
399     Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
400     If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
401
402     Parameters:
403         data unpacked data - a string containing '1' and '0' symbols
404
405     Returns:
406         data packed to the byte stream
407
408     Example of usage:
409         val = PackData("10001110") # val = 0xAE
410         val = PackData("1")        # val = 0x80
411     """
412     bytes = len(data)/8
413     if len(data)%8: bytes += 1
414     res = ""
415     for b in range(bytes):
416         d = data[b*8:(b+1)*8]
417         val = 0
418         for i in range(8):
419             val *= 2
420             if i < len(d):
421                 if d[i] == "1": val += 1
422                 elif d[i] != "0":
423                     raise "Invalid symbol %s" % d[i]
424                 pass
425             pass
426         res += chr(val)
427         pass
428     return res
429
430 ## Read bitmap texture from the text file.
431 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
432 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
433 ## The function returns width and height of the pixmap in pixels and byte stream representing
434 ## texture bitmap itself.
435 ##
436 ## This function can be used to read the texture to the byte stream in order to pass it to
437 ## the AddTexture() function of geomBuilder class.
438 ## For example,
439 ## \code
440 ## from salome.geom import geomBuilder
441 ## geompy = geomBuilder.New(salome.myStudy)
442 ## texture = geompy.readtexture('mytexture.dat')
443 ## texture = geompy.AddTexture(*texture)
444 ## obj.SetMarkerTexture(texture)
445 ## \endcode
446 ## @param fname texture file name
447 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
448 ## @ingroup l1_geomBuilder_auxiliary
449 def ReadTexture(fname):
450     """
451     Read bitmap texture from the text file.
452     In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
453     A zero symbol ('0') represents transparent pixel of the texture bitmap.
454     The function returns width and height of the pixmap in pixels and byte stream representing
455     texture bitmap itself.
456     This function can be used to read the texture to the byte stream in order to pass it to
457     the AddTexture() function of geomBuilder class.
458
459     Parameters:
460         fname texture file name
461
462     Returns:
463         sequence of tree values: texture's width, height in pixels and its byte stream
464
465     Example of usage:
466         from salome.geom import geomBuilder
467         geompy = geomBuilder.New(salome.myStudy)
468         texture = geompy.readtexture('mytexture.dat')
469         texture = geompy.AddTexture(*texture)
470         obj.SetMarkerTexture(texture)
471     """
472     try:
473         f = open(fname)
474         lines = [ l.strip() for l in f.readlines()]
475         f.close()
476         maxlen = 0
477         if lines: maxlen = max([len(x) for x in lines])
478         lenbytes = maxlen/8
479         if maxlen%8: lenbytes += 1
480         bytedata=""
481         for line in lines:
482             if len(line)%8:
483                 lenline = (len(line)/8+1)*8
484                 pass
485             else:
486                 lenline = (len(line)/8)*8
487                 pass
488             for i in range(lenline/8):
489                 byte=""
490                 for j in range(8):
491                     if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
492                     else: byte += "0"
493                     pass
494                 bytedata += PackData(byte)
495                 pass
496             for i in range(lenline/8, lenbytes):
497                 bytedata += PackData("0")
498             pass
499         return lenbytes*8, len(lines), bytedata
500     except:
501         pass
502     return 0, 0, ""
503
504 ## Returns a long value from enumeration type
505 #  Can be used for CORBA enumerator types like GEOM.shape_type
506 #  @param theItem enumeration type
507 #  @ingroup l1_geomBuilder_auxiliary
508 def EnumToLong(theItem):
509     """
510     Returns a long value from enumeration type
511     Can be used for CORBA enumerator types like geomBuilder.ShapeType
512
513     Parameters:
514         theItem enumeration type
515     """
516     ret = theItem
517     if hasattr(theItem, "_v"): ret = theItem._v
518     return ret
519
520 ## Information about closed/unclosed state of shell or wire
521 #  @ingroup l1_geomBuilder_auxiliary
522 class info:
523     """
524     Information about closed/unclosed state of shell or wire
525     """
526     UNKNOWN  = 0
527     CLOSED   = 1
528     UNCLOSED = 2
529
530 ## Private class used to bind calls of plugin operations to geomBuilder
531 class PluginOperation:
532   def __init__(self, operation, function):
533     self.operation = operation
534     self.function = function
535     pass
536
537   @ManageTransactions("operation")
538   def __call__(self, *args):
539     res = self.function(self.operation, *args)
540     RaiseIfFailed(self.function.__name__, self.operation)
541     return res
542
543 # Warning: geom is a singleton
544 geom = None
545 engine = None
546 doLcc = False
547 created = False
548
549 class geomBuilder(object, GEOM._objref_GEOM_Gen):
550
551         ## Enumeration ShapeType as a dictionary. \n
552         ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
553         #  @ingroup l1_geomBuilder_auxiliary
554         ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
555
556         ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
557         #  and a list of parameters, describing the shape.
558         #  List of parameters, describing the shape:
559         #  - COMPOUND:            [nb_solids  nb_faces  nb_edges  nb_vertices]
560         #  - COMPSOLID:           [nb_solids  nb_faces  nb_edges  nb_vertices]
561         #
562         #  - SHELL:       [info.CLOSED / info.UNCLOSED  nb_faces  nb_edges  nb_vertices]
563         #
564         #  - WIRE:        [info.CLOSED / info.UNCLOSED nb_edges  nb_vertices]
565         #
566         #  - SPHERE:       [xc yc zc            R]
567         #  - CYLINDER:     [xb yb zb  dx dy dz  R         H]
568         #  - BOX:          [xc yc zc                      ax ay az]
569         #  - ROTATED_BOX:  [xc yc zc  zx zy zz  xx xy xz  ax ay az]
570         #  - TORUS:        [xc yc zc  dx dy dz  R_1  R_2]
571         #  - CONE:         [xb yb zb  dx dy dz  R_1  R_2  H]
572         #  - POLYHEDRON:                       [nb_faces  nb_edges  nb_vertices]
573         #  - SOLID:                            [nb_faces  nb_edges  nb_vertices]
574         #
575         #  - SPHERE2D:     [xc yc zc            R]
576         #  - CYLINDER2D:   [xb yb zb  dx dy dz  R         H]
577         #  - TORUS2D:      [xc yc zc  dx dy dz  R_1  R_2]
578         #  - CONE2D:       [xc yc zc  dx dy dz  R_1  R_2  H]
579         #  - DISK_CIRCLE:  [xc yc zc  dx dy dz  R]
580         #  - DISK_ELLIPSE: [xc yc zc  dx dy dz  R_1  R_2]
581         #  - POLYGON:      [xo yo zo  dx dy dz            nb_edges  nb_vertices]
582         #  - PLANE:        [xo yo zo  dx dy dz]
583         #  - PLANAR:       [xo yo zo  dx dy dz            nb_edges  nb_vertices]
584         #  - FACE:                                       [nb_edges  nb_vertices]
585         #
586         #  - CIRCLE:       [xc yc zc  dx dy dz  R]
587         #  - ARC_CIRCLE:   [xc yc zc  dx dy dz  R         x1 y1 z1  x2 y2 z2]
588         #  - ELLIPSE:      [xc yc zc  dx dy dz  R_1  R_2]
589         #  - ARC_ELLIPSE:  [xc yc zc  dx dy dz  R_1  R_2  x1 y1 z1  x2 y2 z2]
590         #  - LINE:         [xo yo zo  dx dy dz]
591         #  - SEGMENT:      [x1 y1 z1  x2 y2 z2]
592         #  - EDGE:                                                 [nb_vertices]
593         #
594         #  - VERTEX:       [x  y  z]
595         #  @ingroup l1_geomBuilder_auxiliary
596         kind = GEOM.GEOM_IKindOfShape
597
598         def __new__(cls):
599             global engine
600             global geom
601             global doLcc
602             global created
603             #print "==== __new__ ", engine, geom, doLcc, created
604             if geom is None:
605                 # geom engine is either retrieved from engine, or created
606                 geom = engine
607                 # Following test avoids a recursive loop
608                 if doLcc:
609                     if geom is not None:
610                         # geom engine not created: existing engine found
611                         doLcc = False
612                     if doLcc and not created:
613                         doLcc = False
614                         # FindOrLoadComponent called:
615                         # 1. CORBA resolution of server
616                         # 2. the __new__ method is called again
617                         #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
618                         geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
619                         #print "====1 ",geom
620                 else:
621                     # FindOrLoadComponent not called
622                     if geom is None:
623                         # geomBuilder instance is created from lcc.FindOrLoadComponent
624                         #print "==== super ", engine, geom, doLcc, created
625                         geom = super(geomBuilder,cls).__new__(cls)
626                         #print "====2 ",geom
627                     else:
628                         # geom engine not created: existing engine found
629                         #print "==== existing ", engine, geom, doLcc, created
630                         pass
631                 #print "return geom 1 ", geom
632                 return geom
633
634             #print "return geom 2 ", geom
635             return geom
636
637         def __init__(self):
638             global created
639             #print "-------- geomBuilder __init__ --- ", created, self
640             if not created:
641               created = True
642               GEOM._objref_GEOM_Gen.__init__(self)
643               self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
644               self.myBuilder = None
645               self.myStudyId = 0
646               self.father    = None
647
648               self.BasicOp  = None
649               self.CurvesOp = None
650               self.PrimOp   = None
651               self.ShapesOp = None
652               self.HealOp   = None
653               self.InsertOp = None
654               self.BoolOp   = None
655               self.TrsfOp   = None
656               self.LocalOp  = None
657               self.MeasuOp  = None
658               self.BlocksOp = None
659               self.GroupOp  = None
660               self.FieldOp  = None
661             pass
662
663         ## Process object publication in the study, as follows:
664         #  - if @a theName is specified (not None), the object is published in the study
665         #    with this name, not taking into account "auto-publishing" option;
666         #  - if @a theName is NOT specified, the object is published in the study
667         #    (using default name, which can be customized using @a theDefaultName parameter)
668         #    only if auto-publishing is switched on.
669         #
670         #  @param theObj  object, a subject for publishing
671         #  @param theName object name for study
672         #  @param theDefaultName default name for the auto-publishing
673         #
674         #  @sa addToStudyAuto()
675         def _autoPublish(self, theObj, theName, theDefaultName="noname"):
676             # ---
677             def _item_name(_names, _defname, _idx=-1):
678                 if not _names: _names = _defname
679                 if type(_names) in [types.ListType, types.TupleType]:
680                     if _idx >= 0:
681                         if _idx >= len(_names) or not _names[_idx]:
682                             if type(_defname) not in [types.ListType, types.TupleType]:
683                                 _name = "%s_%d"%(_defname, _idx+1)
684                             elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
685                                 _name = _defname[_idx]
686                             else:
687                                 _name = "%noname_%d"%(dn, _idx+1)
688                             pass
689                         else:
690                             _name = _names[_idx]
691                         pass
692                     else:
693                         # must be wrong  usage
694                         _name = _names[0]
695                     pass
696                 else:
697                     if _idx >= 0:
698                         _name = "%s_%d"%(_names, _idx+1)
699                     else:
700                         _name = _names
701                     pass
702                 return _name
703             # ---
704             def _publish( _name, _obj ):
705                 fatherObj = None
706                 if isinstance( _obj, GEOM._objref_GEOM_Field ):
707                     fatherObj = _obj.GetShape()
708                 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
709                     fatherObj = _obj.GetField()
710                 elif not _obj.IsMainShape():
711                     fatherObj = _obj.GetMainShape()
712                     pass
713                 if fatherObj and fatherObj.GetStudyEntry():
714                     self.addToStudyInFather(fatherObj, _obj, _name)
715                 else:
716                     self.addToStudy(_obj, _name)
717                     pass
718                 return
719             # ---
720             if not theObj:
721                 return # null object
722             if not theName and not self.myMaxNbSubShapesAllowed:
723                 return # nothing to do: auto-publishing is disabled
724             if not theName and not theDefaultName:
725                 return # neither theName nor theDefaultName is given
726             import types
727             if type(theObj) in [types.ListType, types.TupleType]:
728                 # list of objects is being published
729                 idx = 0
730                 for obj in theObj:
731                     if not obj: continue # bad object
732                     name = _item_name(theName, theDefaultName, idx)
733                     _publish( name, obj )
734                     idx = idx+1
735                     if not theName and idx == self.myMaxNbSubShapesAllowed: break
736                     pass
737                 pass
738             else:
739                 # single object is published
740                 name = _item_name(theName, theDefaultName)
741                 _publish( name, theObj )
742             pass
743
744         ## @addtogroup l1_geomBuilder_auxiliary
745         ## @{
746         def init_geom(self,theStudy):
747             self.myStudy = theStudy
748             self.myStudyId = self.myStudy._get_StudyId()
749             self.myBuilder = self.myStudy.NewBuilder()
750             self.father = self.myStudy.FindComponent("GEOM")
751             notebook.myStudy = theStudy
752             if self.father is None:
753                 self.father = self.myBuilder.NewComponent("GEOM")
754                 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
755                 FName = A1._narrow(SALOMEDS.AttributeName)
756                 FName.SetValue("Geometry")
757                 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
758                 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
759                 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
760                 self.myBuilder.DefineComponentInstance(self.father,self)
761                 pass
762             self.BasicOp  = self.GetIBasicOperations    (self.myStudyId)
763             self.CurvesOp = self.GetICurvesOperations   (self.myStudyId)
764             self.PrimOp   = self.GetI3DPrimOperations   (self.myStudyId)
765             self.ShapesOp = self.GetIShapesOperations   (self.myStudyId)
766             self.HealOp   = self.GetIHealingOperations  (self.myStudyId)
767             self.InsertOp = self.GetIInsertOperations   (self.myStudyId)
768             self.BoolOp   = self.GetIBooleanOperations  (self.myStudyId)
769             self.TrsfOp   = self.GetITransformOperations(self.myStudyId)
770             self.LocalOp  = self.GetILocalOperations    (self.myStudyId)
771             self.MeasuOp  = self.GetIMeasureOperations  (self.myStudyId)
772             self.BlocksOp = self.GetIBlocksOperations   (self.myStudyId)
773             self.GroupOp  = self.GetIGroupOperations    (self.myStudyId)
774             self.FieldOp  = self.GetIFieldOperations    (self.myStudyId)
775
776             # set GEOM as root in the use case tree
777             self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
778             self.myUseCaseBuilder.SetRootCurrent()
779             self.myUseCaseBuilder.Append(self.father)
780             pass
781
782         def GetPluginOperations(self, studyID, libraryName):
783             op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
784             return op
785
786         ## Enable / disable results auto-publishing
787         #
788         #  The automatic publishing is managed in the following way:
789         #  - if @a maxNbSubShapes = 0, automatic publishing is disabled.
790         #  - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
791         #  maximum number of sub-shapes allowed for publishing is unlimited; any negative
792         #  value passed as parameter has the same effect.
793         #  - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
794         #  maximum number of sub-shapes allowed for publishing is set to specified value.
795         #
796         #  @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
797         #  @ingroup l1_publish_data
798         def addToStudyAuto(self, maxNbSubShapes=-1):
799             """
800             Enable / disable results auto-publishing
801
802             The automatic publishing is managed in the following way:
803             - if @a maxNbSubShapes = 0, automatic publishing is disabled;
804             - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
805             maximum number of sub-shapes allowed for publishing is unlimited; any negative
806             value passed as parameter has the same effect.
807             - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
808             maximum number of sub-shapes allowed for publishing is set to this value.
809
810             Parameters:
811                 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
812
813             Example of usage:
814                 geompy.addToStudyAuto()   # enable auto-publishing
815                 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
816                 geompy.addToStudyAuto(0)  # disable auto-publishing
817             """
818             self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
819             pass
820
821         ## Dump component to the Python script
822         #  This method overrides IDL function to allow default values for the parameters.
823         def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
824             """
825             Dump component to the Python script
826             This method overrides IDL function to allow default values for the parameters.
827             """
828             return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
829
830         ## Get name for sub-shape aSubObj of shape aMainObj
831         #
832         # @ref swig_SubShapeName "Example"
833         @ManageTransactions("ShapesOp")
834         def SubShapeName(self,aSubObj, aMainObj):
835             """
836             Get name for sub-shape aSubObj of shape aMainObj
837             """
838             # Example: see GEOM_TestAll.py
839
840             #aSubId  = orb.object_to_string(aSubObj)
841             #aMainId = orb.object_to_string(aMainObj)
842             #index = gg.getIndexTopology(aSubId, aMainId)
843             #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
844             index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
845             name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
846             return name
847
848         ## Publish in study aShape with name aName
849         #
850         #  \param aShape the shape to be published
851         #  \param aName  the name for the shape
852         #  \param doRestoreSubShapes if True, finds and publishes also
853         #         sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
854         #         and published sub-shapes of arguments
855         #  \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
856         #                                                  these arguments description
857         #  \return study entry of the published shape in form of string
858         #
859         #  @ingroup l1_publish_data
860         #  @ref swig_all_addtostudy "Example"
861         def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
862                        theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
863             """
864             Publish in study aShape with name aName
865
866             Parameters:
867                 aShape the shape to be published
868                 aName  the name for the shape
869                 doRestoreSubShapes if True, finds and publishes also
870                                    sub-shapes of aShape, corresponding to its arguments
871                                    and published sub-shapes of arguments
872                 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
873                                                          these arguments description
874
875             Returns:
876                 study entry of the published shape in form of string
877
878             Example of usage:
879                 id_block1 = geompy.addToStudy(Block1, "Block 1")
880             """
881             # Example: see GEOM_TestAll.py
882             try:
883                 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
884                 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
885                 if doRestoreSubShapes:
886                     self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
887                                             theFindMethod, theInheritFirstArg, True )
888             except:
889                 print "addToStudy() failed"
890                 return ""
891             return aShape.GetStudyEntry()
892
893         ## Publish in study aShape with name aName as sub-object of previously published aFather
894         #  \param aFather previously published object
895         #  \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
896         #  \param aName  the name for the shape
897         #
898         #  \return study entry of the published shape in form of string
899         #
900         #  @ingroup l1_publish_data
901         #  @ref swig_all_addtostudyInFather "Example"
902         def addToStudyInFather(self, aFather, aShape, aName):
903             """
904             Publish in study aShape with name aName as sub-object of previously published aFather
905
906             Parameters:
907                 aFather previously published object
908                 aShape the shape to be published as sub-object of aFather
909                 aName  the name for the shape
910
911             Returns:
912                 study entry of the published shape in form of string
913             """
914             # Example: see GEOM_TestAll.py
915             try:
916                 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
917                 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
918             except:
919                 print "addToStudyInFather() failed"
920                 return ""
921             return aShape.GetStudyEntry()
922
923         ## Unpublish object in study
924         #
925         #  \param obj the object to be unpublished
926         def hideInStudy(self, obj):
927             """
928             Unpublish object in study
929
930             Parameters:
931                 obj the object to be unpublished
932             """
933             ior = salome.orb.object_to_string(obj)
934             aSObject = self.myStudy.FindObjectIOR(ior)
935             if aSObject is not None:
936                 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
937                 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
938                 drwAttribute.SetDrawable(False)
939                 # hide references if any
940                 vso = self.myStudy.FindDependances(aSObject);
941                 for refObj in vso :
942                     genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
943                     drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
944                     drwAttribute.SetDrawable(False)
945                     pass
946                 pass
947
948         # end of l1_geomBuilder_auxiliary
949         ## @}
950
951         ## @addtogroup l3_restore_ss
952         ## @{
953
954         ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
955         #  To be used from python scripts out of addToStudy() (non-default usage)
956         #  \param theObject published GEOM.GEOM_Object, arguments of which will be published
957         #  \param theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
958         #                   If this list is empty, all operation arguments will be published
959         #  \param theFindMethod method to search sub-shapes, corresponding to arguments and
960         #                       their sub-shapes. Value from enumeration GEOM.find_shape_method.
961         #  \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
962         #                            Do not publish sub-shapes in place of arguments, but only
963         #                            in place of sub-shapes of the first argument,
964         #                            because the whole shape corresponds to the first argument.
965         #                            Mainly to be used after transformations, but it also can be
966         #                            usefull after partition with one object shape, and some other
967         #                            operations, where only the first argument has to be considered.
968         #                            If theObject has only one argument shape, this flag is automatically
969         #                            considered as True, not regarding really passed value.
970         #  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
971         #                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
972         #  \return list of published sub-shapes
973         #
974         #  @ref tui_restore_prs_params "Example"
975         def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
976                               theInheritFirstArg=False, theAddPrefix=True):
977             """
978             Publish sub-shapes, standing for arguments and sub-shapes of arguments
979             To be used from python scripts out of geompy.addToStudy (non-default usage)
980
981             Parameters:
982                 theObject published GEOM.GEOM_Object, arguments of which will be published
983                 theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
984                           If this list is empty, all operation arguments will be published
985                 theFindMethod method to search sub-shapes, corresponding to arguments and
986                               their sub-shapes. Value from enumeration GEOM.find_shape_method.
987                 theInheritFirstArg set properties of the first argument for theObject.
988                                    Do not publish sub-shapes in place of arguments, but only
989                                    in place of sub-shapes of the first argument,
990                                    because the whole shape corresponds to the first argument.
991                                    Mainly to be used after transformations, but it also can be
992                                    usefull after partition with one object shape, and some other
993                                    operations, where only the first argument has to be considered.
994                                    If theObject has only one argument shape, this flag is automatically
995                                    considered as True, not regarding really passed value.
996                 theAddPrefix add prefix "from_" to names of restored sub-shapes,
997                              and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
998             Returns:
999                 list of published sub-shapes
1000             """
1001             # Example: see GEOM_TestAll.py
1002             return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
1003                                           theFindMethod, theInheritFirstArg, theAddPrefix)
1004
1005         ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1006         #  To be used from python scripts out of addToStudy() (non-default usage)
1007         #  \param theObject published GEOM.GEOM_Object, arguments of which will be published
1008         #  \param theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
1009         #                   If this list is empty, all operation arguments will be published
1010         #  \param theFindMethod method to search sub-shapes, corresponding to arguments and
1011         #                       their sub-shapes. Value from enumeration GEOM::find_shape_method.
1012         #  \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1013         #                            Do not publish sub-shapes in place of arguments, but only
1014         #                            in place of sub-shapes of the first argument,
1015         #                            because the whole shape corresponds to the first argument.
1016         #                            Mainly to be used after transformations, but it also can be
1017         #                            usefull after partition with one object shape, and some other
1018         #                            operations, where only the first argument has to be considered.
1019         #                            If theObject has only one argument shape, this flag is automatically
1020         #                            considered as True, not regarding really passed value.
1021         #  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1022         #                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1023         #  \return list of published sub-shapes
1024         #
1025         #  @ref tui_restore_prs_params "Example"
1026         def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1027                                    theInheritFirstArg=False, theAddPrefix=True):
1028             """
1029             Publish sub-shapes, standing for arguments and sub-shapes of arguments
1030             To be used from python scripts out of geompy.addToStudy() (non-default usage)
1031
1032             Parameters:
1033                 theObject published GEOM.GEOM_Object, arguments of which will be published
1034                 theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
1035                           If this list is empty, all operation arguments will be published
1036                 theFindMethod method to search sub-shapes, corresponding to arguments and
1037                               their sub-shapes. Value from enumeration GEOM::find_shape_method.
1038                 theInheritFirstArg set properties of the first argument for theObject.
1039                                    Do not publish sub-shapes in place of arguments, but only
1040                                    in place of sub-shapes of the first argument,
1041                                    because the whole shape corresponds to the first argument.
1042                                    Mainly to be used after transformations, but it also can be
1043                                    usefull after partition with one object shape, and some other
1044                                    operations, where only the first argument has to be considered.
1045                                    If theObject has only one argument shape, this flag is automatically
1046                                    considered as True, not regarding really passed value.
1047                 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1048                              and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1049
1050             Returns:
1051                 list of published sub-shapes
1052             """
1053             # Example: see GEOM_TestAll.py
1054             return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1055                                                theFindMethod, theInheritFirstArg, theAddPrefix)
1056
1057         # end of l3_restore_ss
1058         ## @}
1059
1060         ## @addtogroup l3_basic_go
1061         ## @{
1062
1063         ## Create point by three coordinates.
1064         #  @param theX The X coordinate of the point.
1065         #  @param theY The Y coordinate of the point.
1066         #  @param theZ The Z coordinate of the point.
1067         #  @param theName Object name; when specified, this parameter is used
1068         #         for result publication in the study. Otherwise, if automatic
1069         #         publication is switched on, default value is used for result name.
1070         #
1071         #  @return New GEOM.GEOM_Object, containing the created point.
1072         #
1073         #  @ref tui_creation_point "Example"
1074         @ManageTransactions("BasicOp")
1075         def MakeVertex(self, theX, theY, theZ, theName=None):
1076             """
1077             Create point by three coordinates.
1078
1079             Parameters:
1080                 theX The X coordinate of the point.
1081                 theY The Y coordinate of the point.
1082                 theZ The Z coordinate of the point.
1083                 theName Object name; when specified, this parameter is used
1084                         for result publication in the study. Otherwise, if automatic
1085                         publication is switched on, default value is used for result name.
1086
1087             Returns:
1088                 New GEOM.GEOM_Object, containing the created point.
1089             """
1090             # Example: see GEOM_TestAll.py
1091             theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1092             anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1093             RaiseIfFailed("MakePointXYZ", self.BasicOp)
1094             anObj.SetParameters(Parameters)
1095             self._autoPublish(anObj, theName, "vertex")
1096             return anObj
1097
1098         ## Create a point, distant from the referenced point
1099         #  on the given distances along the coordinate axes.
1100         #  @param theReference The referenced point.
1101         #  @param theX Displacement from the referenced point along OX axis.
1102         #  @param theY Displacement from the referenced point along OY axis.
1103         #  @param theZ Displacement from the referenced point along OZ axis.
1104         #  @param theName Object name; when specified, this parameter is used
1105         #         for result publication in the study. Otherwise, if automatic
1106         #         publication is switched on, default value is used for result name.
1107         #
1108         #  @return New GEOM.GEOM_Object, containing the created point.
1109         #
1110         #  @ref tui_creation_point "Example"
1111         @ManageTransactions("BasicOp")
1112         def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1113             """
1114             Create a point, distant from the referenced point
1115             on the given distances along the coordinate axes.
1116
1117             Parameters:
1118                 theReference The referenced point.
1119                 theX Displacement from the referenced point along OX axis.
1120                 theY Displacement from the referenced point along OY axis.
1121                 theZ Displacement from the referenced point along OZ axis.
1122                 theName Object name; when specified, this parameter is used
1123                         for result publication in the study. Otherwise, if automatic
1124                         publication is switched on, default value is used for result name.
1125
1126             Returns:
1127                 New GEOM.GEOM_Object, containing the created point.
1128             """
1129             # Example: see GEOM_TestAll.py
1130             theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1131             anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1132             RaiseIfFailed("MakePointWithReference", self.BasicOp)
1133             anObj.SetParameters(Parameters)
1134             self._autoPublish(anObj, theName, "vertex")
1135             return anObj
1136
1137         ## Create a point, corresponding to the given parameter on the given curve.
1138         #  @param theRefCurve The referenced curve.
1139         #  @param theParameter Value of parameter on the referenced curve.
1140         #  @param theName Object name; when specified, this parameter is used
1141         #         for result publication in the study. Otherwise, if automatic
1142         #         publication is switched on, default value is used for result name.
1143         #
1144         #  @return New GEOM.GEOM_Object, containing the created point.
1145         #
1146         #  @ref tui_creation_point "Example"
1147         @ManageTransactions("BasicOp")
1148         def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1149             """
1150             Create a point, corresponding to the given parameter on the given curve.
1151
1152             Parameters:
1153                 theRefCurve The referenced curve.
1154                 theParameter Value of parameter on the referenced curve.
1155                 theName Object name; when specified, this parameter is used
1156                         for result publication in the study. Otherwise, if automatic
1157                         publication is switched on, default value is used for result name.
1158
1159             Returns:
1160                 New GEOM.GEOM_Object, containing the created point.
1161
1162             Example of usage:
1163                 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1164             """
1165             # Example: see GEOM_TestAll.py
1166             theParameter, Parameters = ParseParameters(theParameter)
1167             anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1168             RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1169             anObj.SetParameters(Parameters)
1170             self._autoPublish(anObj, theName, "vertex")
1171             return anObj
1172
1173         ## Create a point by projection give coordinates on the given curve
1174         #  @param theRefCurve The referenced curve.
1175         #  @param theX X-coordinate in 3D space
1176         #  @param theY Y-coordinate in 3D space
1177         #  @param theZ Z-coordinate in 3D space
1178         #  @param theName Object name; when specified, this parameter is used
1179         #         for result publication in the study. Otherwise, if automatic
1180         #         publication is switched on, default value is used for result name.
1181         #
1182         #  @return New GEOM.GEOM_Object, containing the created point.
1183         #
1184         #  @ref tui_creation_point "Example"
1185         @ManageTransactions("BasicOp")
1186         def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1187             """
1188             Create a point by projection give coordinates on the given curve
1189
1190             Parameters:
1191                 theRefCurve The referenced curve.
1192                 theX X-coordinate in 3D space
1193                 theY Y-coordinate in 3D space
1194                 theZ Z-coordinate in 3D space
1195                 theName Object name; when specified, this parameter is used
1196                         for result publication in the study. Otherwise, if automatic
1197                         publication is switched on, default value is used for result name.
1198
1199             Returns:
1200                 New GEOM.GEOM_Object, containing the created point.
1201
1202             Example of usage:
1203                 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1204             """
1205             # Example: see GEOM_TestAll.py
1206             theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1207             anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1208             RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1209             anObj.SetParameters(Parameters)
1210             self._autoPublish(anObj, theName, "vertex")
1211             return anObj
1212
1213         ## Create a point, corresponding to the given length on the given curve.
1214         #  @param theRefCurve The referenced curve.
1215         #  @param theLength Length on the referenced curve. It can be negative.
1216         #  @param theStartPoint Point allowing to choose the direction for the calculation
1217         #                       of the length. If None, start from the first point of theRefCurve.
1218         #  @param theName Object name; when specified, this parameter is used
1219         #         for result publication in the study. Otherwise, if automatic
1220         #         publication is switched on, default value is used for result name.
1221         #
1222         #  @return New GEOM.GEOM_Object, containing the created point.
1223         #
1224         #  @ref tui_creation_point "Example"
1225         @ManageTransactions("BasicOp")
1226         def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1227             """
1228             Create a point, corresponding to the given length on the given curve.
1229
1230             Parameters:
1231                 theRefCurve The referenced curve.
1232                 theLength Length on the referenced curve. It can be negative.
1233                 theStartPoint Point allowing to choose the direction for the calculation
1234                               of the length. If None, start from the first point of theRefCurve.
1235                 theName Object name; when specified, this parameter is used
1236                         for result publication in the study. Otherwise, if automatic
1237                         publication is switched on, default value is used for result name.
1238
1239             Returns:
1240                 New GEOM.GEOM_Object, containing the created point.
1241             """
1242             # Example: see GEOM_TestAll.py
1243             theLength, Parameters = ParseParameters(theLength)
1244             anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1245             RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1246             anObj.SetParameters(Parameters)
1247             self._autoPublish(anObj, theName, "vertex")
1248             return anObj
1249
1250         ## Create a point, corresponding to the given parameters on the
1251         #    given surface.
1252         #  @param theRefSurf The referenced surface.
1253         #  @param theUParameter Value of U-parameter on the referenced surface.
1254         #  @param theVParameter Value of V-parameter on the referenced surface.
1255         #  @param theName Object name; when specified, this parameter is used
1256         #         for result publication in the study. Otherwise, if automatic
1257         #         publication is switched on, default value is used for result name.
1258         #
1259         #  @return New GEOM.GEOM_Object, containing the created point.
1260         #
1261         #  @ref swig_MakeVertexOnSurface "Example"
1262         @ManageTransactions("BasicOp")
1263         def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1264             """
1265             Create a point, corresponding to the given parameters on the
1266             given surface.
1267
1268             Parameters:
1269                 theRefSurf The referenced surface.
1270                 theUParameter Value of U-parameter on the referenced surface.
1271                 theVParameter Value of V-parameter on the referenced surface.
1272                 theName Object name; when specified, this parameter is used
1273                         for result publication in the study. Otherwise, if automatic
1274                         publication is switched on, default value is used for result name.
1275
1276             Returns:
1277                 New GEOM.GEOM_Object, containing the created point.
1278
1279             Example of usage:
1280                 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1281             """
1282             theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1283             # Example: see GEOM_TestAll.py
1284             anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1285             RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1286             anObj.SetParameters(Parameters);
1287             self._autoPublish(anObj, theName, "vertex")
1288             return anObj
1289
1290         ## Create a point by projection give coordinates on the given surface
1291         #  @param theRefSurf The referenced surface.
1292         #  @param theX X-coordinate in 3D space
1293         #  @param theY Y-coordinate in 3D space
1294         #  @param theZ Z-coordinate in 3D space
1295         #  @param theName Object name; when specified, this parameter is used
1296         #         for result publication in the study. Otherwise, if automatic
1297         #         publication is switched on, default value is used for result name.
1298         #
1299         #  @return New GEOM.GEOM_Object, containing the created point.
1300         #
1301         #  @ref swig_MakeVertexOnSurfaceByCoord "Example"
1302         @ManageTransactions("BasicOp")
1303         def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1304             """
1305             Create a point by projection give coordinates on the given surface
1306
1307             Parameters:
1308                 theRefSurf The referenced surface.
1309                 theX X-coordinate in 3D space
1310                 theY Y-coordinate in 3D space
1311                 theZ Z-coordinate in 3D space
1312                 theName Object name; when specified, this parameter is used
1313                         for result publication in the study. Otherwise, if automatic
1314                         publication is switched on, default value is used for result name.
1315
1316             Returns:
1317                 New GEOM.GEOM_Object, containing the created point.
1318
1319             Example of usage:
1320                 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1321             """
1322             theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1323             # Example: see GEOM_TestAll.py
1324             anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1325             RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1326             anObj.SetParameters(Parameters);
1327             self._autoPublish(anObj, theName, "vertex")
1328             return anObj
1329
1330         ## Create a point, which lays on the given face.
1331         #  The point will lay in arbitrary place of the face.
1332         #  The only condition on it is a non-zero distance to the face boundary.
1333         #  Such point can be used to uniquely identify the face inside any
1334         #  shape in case, when the shape does not contain overlapped faces.
1335         #  @param theFace The referenced face.
1336         #  @param theName Object name; when specified, this parameter is used
1337         #         for result publication in the study. Otherwise, if automatic
1338         #         publication is switched on, default value is used for result name.
1339         #
1340         #  @return New GEOM.GEOM_Object, containing the created point.
1341         #
1342         #  @ref swig_MakeVertexInsideFace "Example"
1343         @ManageTransactions("BasicOp")
1344         def MakeVertexInsideFace (self, theFace, theName=None):
1345             """
1346             Create a point, which lays on the given face.
1347             The point will lay in arbitrary place of the face.
1348             The only condition on it is a non-zero distance to the face boundary.
1349             Such point can be used to uniquely identify the face inside any
1350             shape in case, when the shape does not contain overlapped faces.
1351
1352             Parameters:
1353                 theFace The referenced face.
1354                 theName Object name; when specified, this parameter is used
1355                         for result publication in the study. Otherwise, if automatic
1356                         publication is switched on, default value is used for result name.
1357
1358             Returns:
1359                 New GEOM.GEOM_Object, containing the created point.
1360
1361             Example of usage:
1362                 p_on_face = geompy.MakeVertexInsideFace(Face)
1363             """
1364             # Example: see GEOM_TestAll.py
1365             anObj = self.BasicOp.MakePointOnFace(theFace)
1366             RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1367             self._autoPublish(anObj, theName, "vertex")
1368             return anObj
1369
1370         ## Create a point on intersection of two lines.
1371         #  @param theRefLine1, theRefLine2 The referenced lines.
1372         #  @param theName Object name; when specified, this parameter is used
1373         #         for result publication in the study. Otherwise, if automatic
1374         #         publication is switched on, default value is used for result name.
1375         #
1376         #  @return New GEOM.GEOM_Object, containing the created point.
1377         #
1378         #  @ref swig_MakeVertexOnLinesIntersection "Example"
1379         @ManageTransactions("BasicOp")
1380         def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1381             """
1382             Create a point on intersection of two lines.
1383
1384             Parameters:
1385                 theRefLine1, theRefLine2 The referenced lines.
1386                 theName Object name; when specified, this parameter is used
1387                         for result publication in the study. Otherwise, if automatic
1388                         publication is switched on, default value is used for result name.
1389
1390             Returns:
1391                 New GEOM.GEOM_Object, containing the created point.
1392             """
1393             # Example: see GEOM_TestAll.py
1394             anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1395             RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1396             self._autoPublish(anObj, theName, "vertex")
1397             return anObj
1398
1399         ## Create a tangent, corresponding to the given parameter on the given curve.
1400         #  @param theRefCurve The referenced curve.
1401         #  @param theParameter Value of parameter on the referenced curve.
1402         #  @param theName Object name; when specified, this parameter is used
1403         #         for result publication in the study. Otherwise, if automatic
1404         #         publication is switched on, default value is used for result name.
1405         #
1406         #  @return New GEOM.GEOM_Object, containing the created tangent.
1407         #
1408         #  @ref swig_MakeTangentOnCurve "Example"
1409         @ManageTransactions("BasicOp")
1410         def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1411             """
1412             Create a tangent, corresponding to the given parameter on the given curve.
1413
1414             Parameters:
1415                 theRefCurve The referenced curve.
1416                 theParameter Value of parameter on the referenced curve.
1417                 theName Object name; when specified, this parameter is used
1418                         for result publication in the study. Otherwise, if automatic
1419                         publication is switched on, default value is used for result name.
1420
1421             Returns:
1422                 New GEOM.GEOM_Object, containing the created tangent.
1423
1424             Example of usage:
1425                 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1426             """
1427             anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1428             RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1429             self._autoPublish(anObj, theName, "tangent")
1430             return anObj
1431
1432         ## Create a tangent plane, corresponding to the given parameter on the given face.
1433         #  @param theFace The face for which tangent plane should be built.
1434         #  @param theParameterV vertical value of the center point (0.0 - 1.0).
1435         #  @param theParameterU horisontal value of the center point (0.0 - 1.0).
1436         #  @param theTrimSize the size of plane.
1437         #  @param theName Object name; when specified, this parameter is used
1438         #         for result publication in the study. Otherwise, if automatic
1439         #         publication is switched on, default value is used for result name.
1440         #
1441         #  @return New GEOM.GEOM_Object, containing the created tangent.
1442         #
1443         #  @ref swig_MakeTangentPlaneOnFace "Example"
1444         @ManageTransactions("BasicOp")
1445         def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1446             """
1447             Create a tangent plane, corresponding to the given parameter on the given face.
1448
1449             Parameters:
1450                 theFace The face for which tangent plane should be built.
1451                 theParameterV vertical value of the center point (0.0 - 1.0).
1452                 theParameterU horisontal value of the center point (0.0 - 1.0).
1453                 theTrimSize the size of plane.
1454                 theName Object name; when specified, this parameter is used
1455                         for result publication in the study. Otherwise, if automatic
1456                         publication is switched on, default value is used for result name.
1457
1458            Returns:
1459                 New GEOM.GEOM_Object, containing the created tangent.
1460
1461            Example of usage:
1462                 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1463             """
1464             anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1465             RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1466             self._autoPublish(anObj, theName, "tangent")
1467             return anObj
1468
1469         ## Create a vector with the given components.
1470         #  @param theDX X component of the vector.
1471         #  @param theDY Y component of the vector.
1472         #  @param theDZ Z component of the vector.
1473         #  @param theName Object name; when specified, this parameter is used
1474         #         for result publication in the study. Otherwise, if automatic
1475         #         publication is switched on, default value is used for result name.
1476         #
1477         #  @return New GEOM.GEOM_Object, containing the created vector.
1478         #
1479         #  @ref tui_creation_vector "Example"
1480         @ManageTransactions("BasicOp")
1481         def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1482             """
1483             Create a vector with the given components.
1484
1485             Parameters:
1486                 theDX X component of the vector.
1487                 theDY Y component of the vector.
1488                 theDZ Z component of the vector.
1489                 theName Object name; when specified, this parameter is used
1490                         for result publication in the study. Otherwise, if automatic
1491                         publication is switched on, default value is used for result name.
1492
1493             Returns:
1494                 New GEOM.GEOM_Object, containing the created vector.
1495             """
1496             # Example: see GEOM_TestAll.py
1497             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1498             anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1499             RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1500             anObj.SetParameters(Parameters)
1501             self._autoPublish(anObj, theName, "vector")
1502             return anObj
1503
1504         ## Create a vector between two points.
1505         #  @param thePnt1 Start point for the vector.
1506         #  @param thePnt2 End point for the vector.
1507         #  @param theName Object name; when specified, this parameter is used
1508         #         for result publication in the study. Otherwise, if automatic
1509         #         publication is switched on, default value is used for result name.
1510         #
1511         #  @return New GEOM.GEOM_Object, containing the created vector.
1512         #
1513         #  @ref tui_creation_vector "Example"
1514         @ManageTransactions("BasicOp")
1515         def MakeVector(self, thePnt1, thePnt2, theName=None):
1516             """
1517             Create a vector between two points.
1518
1519             Parameters:
1520                 thePnt1 Start point for the vector.
1521                 thePnt2 End point for the vector.
1522                 theName Object name; when specified, this parameter is used
1523                         for result publication in the study. Otherwise, if automatic
1524                         publication is switched on, default value is used for result name.
1525
1526             Returns:
1527                 New GEOM.GEOM_Object, containing the created vector.
1528             """
1529             # Example: see GEOM_TestAll.py
1530             anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1531             RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1532             self._autoPublish(anObj, theName, "vector")
1533             return anObj
1534
1535         ## Create a line, passing through the given point
1536         #  and parrallel to the given direction
1537         #  @param thePnt Point. The resulting line will pass through it.
1538         #  @param theDir Direction. The resulting line will be parallel to it.
1539         #  @param theName Object name; when specified, this parameter is used
1540         #         for result publication in the study. Otherwise, if automatic
1541         #         publication is switched on, default value is used for result name.
1542         #
1543         #  @return New GEOM.GEOM_Object, containing the created line.
1544         #
1545         #  @ref tui_creation_line "Example"
1546         @ManageTransactions("BasicOp")
1547         def MakeLine(self, thePnt, theDir, theName=None):
1548             """
1549             Create a line, passing through the given point
1550             and parrallel to the given direction
1551
1552             Parameters:
1553                 thePnt Point. The resulting line will pass through it.
1554                 theDir Direction. The resulting line will be parallel to it.
1555                 theName Object name; when specified, this parameter is used
1556                         for result publication in the study. Otherwise, if automatic
1557                         publication is switched on, default value is used for result name.
1558
1559             Returns:
1560                 New GEOM.GEOM_Object, containing the created line.
1561             """
1562             # Example: see GEOM_TestAll.py
1563             anObj = self.BasicOp.MakeLine(thePnt, theDir)
1564             RaiseIfFailed("MakeLine", self.BasicOp)
1565             self._autoPublish(anObj, theName, "line")
1566             return anObj
1567
1568         ## Create a line, passing through the given points
1569         #  @param thePnt1 First of two points, defining the line.
1570         #  @param thePnt2 Second of two points, defining the line.
1571         #  @param theName Object name; when specified, this parameter is used
1572         #         for result publication in the study. Otherwise, if automatic
1573         #         publication is switched on, default value is used for result name.
1574         #
1575         #  @return New GEOM.GEOM_Object, containing the created line.
1576         #
1577         #  @ref tui_creation_line "Example"
1578         @ManageTransactions("BasicOp")
1579         def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1580             """
1581             Create a line, passing through the given points
1582
1583             Parameters:
1584                 thePnt1 First of two points, defining the line.
1585                 thePnt2 Second of two points, defining the line.
1586                 theName Object name; when specified, this parameter is used
1587                         for result publication in the study. Otherwise, if automatic
1588                         publication is switched on, default value is used for result name.
1589
1590             Returns:
1591                 New GEOM.GEOM_Object, containing the created line.
1592             """
1593             # Example: see GEOM_TestAll.py
1594             anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1595             RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1596             self._autoPublish(anObj, theName, "line")
1597             return anObj
1598
1599         ## Create a line on two faces intersection.
1600         #  @param theFace1 First of two faces, defining the line.
1601         #  @param theFace2 Second of two faces, defining the line.
1602         #  @param theName Object name; when specified, this parameter is used
1603         #         for result publication in the study. Otherwise, if automatic
1604         #         publication is switched on, default value is used for result name.
1605         #
1606         #  @return New GEOM.GEOM_Object, containing the created line.
1607         #
1608         #  @ref swig_MakeLineTwoFaces "Example"
1609         @ManageTransactions("BasicOp")
1610         def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1611             """
1612             Create a line on two faces intersection.
1613
1614             Parameters:
1615                 theFace1 First of two faces, defining the line.
1616                 theFace2 Second of two faces, defining the line.
1617                 theName Object name; when specified, this parameter is used
1618                         for result publication in the study. Otherwise, if automatic
1619                         publication is switched on, default value is used for result name.
1620
1621             Returns:
1622                 New GEOM.GEOM_Object, containing the created line.
1623             """
1624             # Example: see GEOM_TestAll.py
1625             anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1626             RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1627             self._autoPublish(anObj, theName, "line")
1628             return anObj
1629
1630         ## Create a plane, passing through the given point
1631         #  and normal to the given vector.
1632         #  @param thePnt Point, the plane has to pass through.
1633         #  @param theVec Vector, defining the plane normal direction.
1634         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1635         #  @param theName Object name; when specified, this parameter is used
1636         #         for result publication in the study. Otherwise, if automatic
1637         #         publication is switched on, default value is used for result name.
1638         #
1639         #  @return New GEOM.GEOM_Object, containing the created plane.
1640         #
1641         #  @ref tui_creation_plane "Example"
1642         @ManageTransactions("BasicOp")
1643         def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1644             """
1645             Create a plane, passing through the given point
1646             and normal to the given vector.
1647
1648             Parameters:
1649                 thePnt Point, the plane has to pass through.
1650                 theVec Vector, defining the plane normal direction.
1651                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1652                 theName Object name; when specified, this parameter is used
1653                         for result publication in the study. Otherwise, if automatic
1654                         publication is switched on, default value is used for result name.
1655
1656             Returns:
1657                 New GEOM.GEOM_Object, containing the created plane.
1658             """
1659             # Example: see GEOM_TestAll.py
1660             theTrimSize, Parameters = ParseParameters(theTrimSize);
1661             anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1662             RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1663             anObj.SetParameters(Parameters)
1664             self._autoPublish(anObj, theName, "plane")
1665             return anObj
1666
1667         ## Create a plane, passing through the three given points
1668         #  @param thePnt1 First of three points, defining the plane.
1669         #  @param thePnt2 Second of three points, defining the plane.
1670         #  @param thePnt3 Fird of three points, defining the plane.
1671         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1672         #  @param theName Object name; when specified, this parameter is used
1673         #         for result publication in the study. Otherwise, if automatic
1674         #         publication is switched on, default value is used for result name.
1675         #
1676         #  @return New GEOM.GEOM_Object, containing the created plane.
1677         #
1678         #  @ref tui_creation_plane "Example"
1679         @ManageTransactions("BasicOp")
1680         def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1681             """
1682             Create a plane, passing through the three given points
1683
1684             Parameters:
1685                 thePnt1 First of three points, defining the plane.
1686                 thePnt2 Second of three points, defining the plane.
1687                 thePnt3 Fird of three points, defining the plane.
1688                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1689                 theName Object name; when specified, this parameter is used
1690                         for result publication in the study. Otherwise, if automatic
1691                         publication is switched on, default value is used for result name.
1692
1693             Returns:
1694                 New GEOM.GEOM_Object, containing the created plane.
1695             """
1696             # Example: see GEOM_TestAll.py
1697             theTrimSize, Parameters = ParseParameters(theTrimSize);
1698             anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1699             RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1700             anObj.SetParameters(Parameters)
1701             self._autoPublish(anObj, theName, "plane")
1702             return anObj
1703
1704         ## Create a plane, similar to the existing one, but with another size of representing face.
1705         #  @param theFace Referenced plane or LCS(Marker).
1706         #  @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1707         #  @param theName Object name; when specified, this parameter is used
1708         #         for result publication in the study. Otherwise, if automatic
1709         #         publication is switched on, default value is used for result name.
1710         #
1711         #  @return New GEOM.GEOM_Object, containing the created plane.
1712         #
1713         #  @ref tui_creation_plane "Example"
1714         @ManageTransactions("BasicOp")
1715         def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1716             """
1717             Create a plane, similar to the existing one, but with another size of representing face.
1718
1719             Parameters:
1720                 theFace Referenced plane or LCS(Marker).
1721                 theTrimSize New half size of a side of quadrangle face, representing the plane.
1722                 theName Object name; when specified, this parameter is used
1723                         for result publication in the study. Otherwise, if automatic
1724                         publication is switched on, default value is used for result name.
1725
1726             Returns:
1727                 New GEOM.GEOM_Object, containing the created plane.
1728             """
1729             # Example: see GEOM_TestAll.py
1730             theTrimSize, Parameters = ParseParameters(theTrimSize);
1731             anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1732             RaiseIfFailed("MakePlaneFace", self.BasicOp)
1733             anObj.SetParameters(Parameters)
1734             self._autoPublish(anObj, theName, "plane")
1735             return anObj
1736
1737         ## Create a plane, passing through the 2 vectors
1738         #  with center in a start point of the first vector.
1739         #  @param theVec1 Vector, defining center point and plane direction.
1740         #  @param theVec2 Vector, defining the plane normal direction.
1741         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1742         #  @param theName Object name; when specified, this parameter is used
1743         #         for result publication in the study. Otherwise, if automatic
1744         #         publication is switched on, default value is used for result name.
1745         #
1746         #  @return New GEOM.GEOM_Object, containing the created plane.
1747         #
1748         #  @ref tui_creation_plane "Example"
1749         @ManageTransactions("BasicOp")
1750         def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1751             """
1752             Create a plane, passing through the 2 vectors
1753             with center in a start point of the first vector.
1754
1755             Parameters:
1756                 theVec1 Vector, defining center point and plane direction.
1757                 theVec2 Vector, defining the plane normal direction.
1758                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1759                 theName Object name; when specified, this parameter is used
1760                         for result publication in the study. Otherwise, if automatic
1761                         publication is switched on, default value is used for result name.
1762
1763             Returns:
1764                 New GEOM.GEOM_Object, containing the created plane.
1765             """
1766             # Example: see GEOM_TestAll.py
1767             theTrimSize, Parameters = ParseParameters(theTrimSize);
1768             anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1769             RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1770             anObj.SetParameters(Parameters)
1771             self._autoPublish(anObj, theName, "plane")
1772             return anObj
1773
1774         ## Create a plane, based on a Local coordinate system.
1775         #  @param theLCS  coordinate system, defining plane.
1776         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1777         #  @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1778         #  @param theName Object name; when specified, this parameter is used
1779         #         for result publication in the study. Otherwise, if automatic
1780         #         publication is switched on, default value is used for result name.
1781         #
1782         #  @return New GEOM.GEOM_Object, containing the created plane.
1783         #
1784         #  @ref tui_creation_plane "Example"
1785         @ManageTransactions("BasicOp")
1786         def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1787             """
1788             Create a plane, based on a Local coordinate system.
1789
1790            Parameters:
1791                 theLCS  coordinate system, defining plane.
1792                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1793                 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1794                 theName Object name; when specified, this parameter is used
1795                         for result publication in the study. Otherwise, if automatic
1796                         publication is switched on, default value is used for result name.
1797
1798             Returns:
1799                 New GEOM.GEOM_Object, containing the created plane.
1800             """
1801             # Example: see GEOM_TestAll.py
1802             theTrimSize, Parameters = ParseParameters(theTrimSize);
1803             anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1804             RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1805             anObj.SetParameters(Parameters)
1806             self._autoPublish(anObj, theName, "plane")
1807             return anObj
1808
1809         ## Create a local coordinate system.
1810         #  @param OX,OY,OZ Three coordinates of coordinate system origin.
1811         #  @param XDX,XDY,XDZ Three components of OX direction
1812         #  @param YDX,YDY,YDZ Three components of OY direction
1813         #  @param theName Object name; when specified, this parameter is used
1814         #         for result publication in the study. Otherwise, if automatic
1815         #         publication is switched on, default value is used for result name.
1816         #
1817         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1818         #
1819         #  @ref swig_MakeMarker "Example"
1820         @ManageTransactions("BasicOp")
1821         def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1822             """
1823             Create a local coordinate system.
1824
1825             Parameters:
1826                 OX,OY,OZ Three coordinates of coordinate system origin.
1827                 XDX,XDY,XDZ Three components of OX direction
1828                 YDX,YDY,YDZ Three components of OY direction
1829                 theName Object name; when specified, this parameter is used
1830                         for result publication in the study. Otherwise, if automatic
1831                         publication is switched on, default value is used for result name.
1832
1833             Returns:
1834                 New GEOM.GEOM_Object, containing the created coordinate system.
1835             """
1836             # Example: see GEOM_TestAll.py
1837             OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1838             anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1839             RaiseIfFailed("MakeMarker", self.BasicOp)
1840             anObj.SetParameters(Parameters)
1841             self._autoPublish(anObj, theName, "lcs")
1842             return anObj
1843
1844         ## Create a local coordinate system from shape.
1845         #  @param theShape The initial shape to detect the coordinate system.
1846         #  @param theName Object name; when specified, this parameter is used
1847         #         for result publication in the study. Otherwise, if automatic
1848         #         publication is switched on, default value is used for result name.
1849         #
1850         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1851         #
1852         #  @ref tui_creation_lcs "Example"
1853         @ManageTransactions("BasicOp")
1854         def MakeMarkerFromShape(self, theShape, theName=None):
1855             """
1856             Create a local coordinate system from shape.
1857
1858             Parameters:
1859                 theShape The initial shape to detect the coordinate system.
1860                 theName Object name; when specified, this parameter is used
1861                         for result publication in the study. Otherwise, if automatic
1862                         publication is switched on, default value is used for result name.
1863
1864             Returns:
1865                 New GEOM.GEOM_Object, containing the created coordinate system.
1866             """
1867             anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1868             RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1869             self._autoPublish(anObj, theName, "lcs")
1870             return anObj
1871
1872         ## Create a local coordinate system from point and two vectors.
1873         #  @param theOrigin Point of coordinate system origin.
1874         #  @param theXVec Vector of X direction
1875         #  @param theYVec Vector of Y direction
1876         #  @param theName Object name; when specified, this parameter is used
1877         #         for result publication in the study. Otherwise, if automatic
1878         #         publication is switched on, default value is used for result name.
1879         #
1880         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1881         #
1882         #  @ref tui_creation_lcs "Example"
1883         @ManageTransactions("BasicOp")
1884         def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1885             """
1886             Create a local coordinate system from point and two vectors.
1887
1888             Parameters:
1889                 theOrigin Point of coordinate system origin.
1890                 theXVec Vector of X direction
1891                 theYVec Vector of Y direction
1892                 theName Object name; when specified, this parameter is used
1893                         for result publication in the study. Otherwise, if automatic
1894                         publication is switched on, default value is used for result name.
1895
1896             Returns:
1897                 New GEOM.GEOM_Object, containing the created coordinate system.
1898
1899             """
1900             anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1901             RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1902             self._autoPublish(anObj, theName, "lcs")
1903             return anObj
1904
1905         # end of l3_basic_go
1906         ## @}
1907
1908         ## @addtogroup l4_curves
1909         ## @{
1910
1911         ##  Create an arc of circle, passing through three given points.
1912         #  @param thePnt1 Start point of the arc.
1913         #  @param thePnt2 Middle point of the arc.
1914         #  @param thePnt3 End point of the arc.
1915         #  @param theName Object name; when specified, this parameter is used
1916         #         for result publication in the study. Otherwise, if automatic
1917         #         publication is switched on, default value is used for result name.
1918         #
1919         #  @return New GEOM.GEOM_Object, containing the created arc.
1920         #
1921         #  @ref swig_MakeArc "Example"
1922         @ManageTransactions("CurvesOp")
1923         def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1924             """
1925             Create an arc of circle, passing through three given points.
1926
1927             Parameters:
1928                 thePnt1 Start point of the arc.
1929                 thePnt2 Middle point of the arc.
1930                 thePnt3 End point of the arc.
1931                 theName Object name; when specified, this parameter is used
1932                         for result publication in the study. Otherwise, if automatic
1933                         publication is switched on, default value is used for result name.
1934
1935             Returns:
1936                 New GEOM.GEOM_Object, containing the created arc.
1937             """
1938             # Example: see GEOM_TestAll.py
1939             anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1940             RaiseIfFailed("MakeArc", self.CurvesOp)
1941             self._autoPublish(anObj, theName, "arc")
1942             return anObj
1943
1944         ##  Create an arc of circle from a center and 2 points.
1945         #  @param thePnt1 Center of the arc
1946         #  @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1947         #  @param thePnt3 End point of the arc (Gives also a direction)
1948         #  @param theSense Orientation of the arc
1949         #  @param theName Object name; when specified, this parameter is used
1950         #         for result publication in the study. Otherwise, if automatic
1951         #         publication is switched on, default value is used for result name.
1952         #
1953         #  @return New GEOM.GEOM_Object, containing the created arc.
1954         #
1955         #  @ref swig_MakeArc "Example"
1956         @ManageTransactions("CurvesOp")
1957         def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1958             """
1959             Create an arc of circle from a center and 2 points.
1960
1961             Parameters:
1962                 thePnt1 Center of the arc
1963                 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1964                 thePnt3 End point of the arc (Gives also a direction)
1965                 theSense Orientation of the arc
1966                 theName Object name; when specified, this parameter is used
1967                         for result publication in the study. Otherwise, if automatic
1968                         publication is switched on, default value is used for result name.
1969
1970             Returns:
1971                 New GEOM.GEOM_Object, containing the created arc.
1972             """
1973             # Example: see GEOM_TestAll.py
1974             anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1975             RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1976             self._autoPublish(anObj, theName, "arc")
1977             return anObj
1978
1979         ##  Create an arc of ellipse, of center and two points.
1980         #  @param theCenter Center of the arc.
1981         #  @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1982         #  @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1983         #  @param theName Object name; when specified, this parameter is used
1984         #         for result publication in the study. Otherwise, if automatic
1985         #         publication is switched on, default value is used for result name.
1986         #
1987         #  @return New GEOM.GEOM_Object, containing the created arc.
1988         #
1989         #  @ref swig_MakeArc "Example"
1990         @ManageTransactions("CurvesOp")
1991         def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
1992             """
1993             Create an arc of ellipse, of center and two points.
1994
1995             Parameters:
1996                 theCenter Center of the arc.
1997                 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1998                 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1999                 theName Object name; when specified, this parameter is used
2000                         for result publication in the study. Otherwise, if automatic
2001                         publication is switched on, default value is used for result name.
2002
2003             Returns:
2004                 New GEOM.GEOM_Object, containing the created arc.
2005             """
2006             # Example: see GEOM_TestAll.py
2007             anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2008             RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2009             self._autoPublish(anObj, theName, "arc")
2010             return anObj
2011
2012         ## Create a circle with given center, normal vector and radius.
2013         #  @param thePnt Circle center.
2014         #  @param theVec Vector, normal to the plane of the circle.
2015         #  @param theR Circle radius.
2016         #  @param theName Object name; when specified, this parameter is used
2017         #         for result publication in the study. Otherwise, if automatic
2018         #         publication is switched on, default value is used for result name.
2019         #
2020         #  @return New GEOM.GEOM_Object, containing the created circle.
2021         #
2022         #  @ref tui_creation_circle "Example"
2023         @ManageTransactions("CurvesOp")
2024         def MakeCircle(self, thePnt, theVec, theR, theName=None):
2025             """
2026             Create a circle with given center, normal vector and radius.
2027
2028             Parameters:
2029                 thePnt Circle center.
2030                 theVec Vector, normal to the plane of the circle.
2031                 theR Circle radius.
2032                 theName Object name; when specified, this parameter is used
2033                         for result publication in the study. Otherwise, if automatic
2034                         publication is switched on, default value is used for result name.
2035
2036             Returns:
2037                 New GEOM.GEOM_Object, containing the created circle.
2038             """
2039             # Example: see GEOM_TestAll.py
2040             theR, Parameters = ParseParameters(theR)
2041             anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2042             RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2043             anObj.SetParameters(Parameters)
2044             self._autoPublish(anObj, theName, "circle")
2045             return anObj
2046
2047         ## Create a circle with given radius.
2048         #  Center of the circle will be in the origin of global
2049         #  coordinate system and normal vector will be codirected with Z axis
2050         #  @param theR Circle radius.
2051         #  @param theName Object name; when specified, this parameter is used
2052         #         for result publication in the study. Otherwise, if automatic
2053         #         publication is switched on, default value is used for result name.
2054         #
2055         #  @return New GEOM.GEOM_Object, containing the created circle.
2056         @ManageTransactions("CurvesOp")
2057         def MakeCircleR(self, theR, theName=None):
2058             """
2059             Create a circle with given radius.
2060             Center of the circle will be in the origin of global
2061             coordinate system and normal vector will be codirected with Z axis
2062
2063             Parameters:
2064                 theR Circle radius.
2065                 theName Object name; when specified, this parameter is used
2066                         for result publication in the study. Otherwise, if automatic
2067                         publication is switched on, default value is used for result name.
2068
2069             Returns:
2070                 New GEOM.GEOM_Object, containing the created circle.
2071             """
2072             anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2073             RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2074             self._autoPublish(anObj, theName, "circle")
2075             return anObj
2076
2077         ## Create a circle, passing through three given points
2078         #  @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2079         #  @param theName Object name; when specified, this parameter is used
2080         #         for result publication in the study. Otherwise, if automatic
2081         #         publication is switched on, default value is used for result name.
2082         #
2083         #  @return New GEOM.GEOM_Object, containing the created circle.
2084         #
2085         #  @ref tui_creation_circle "Example"
2086         @ManageTransactions("CurvesOp")
2087         def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2088             """
2089             Create a circle, passing through three given points
2090
2091             Parameters:
2092                 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2093                 theName Object name; when specified, this parameter is used
2094                         for result publication in the study. Otherwise, if automatic
2095                         publication is switched on, default value is used for result name.
2096
2097             Returns:
2098                 New GEOM.GEOM_Object, containing the created circle.
2099             """
2100             # Example: see GEOM_TestAll.py
2101             anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2102             RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2103             self._autoPublish(anObj, theName, "circle")
2104             return anObj
2105
2106         ## Create a circle, with given point1 as center,
2107         #  passing through the point2 as radius and laying in the plane,
2108         #  defined by all three given points.
2109         #  @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2110         #  @param theName Object name; when specified, this parameter is used
2111         #         for result publication in the study. Otherwise, if automatic
2112         #         publication is switched on, default value is used for result name.
2113         #
2114         #  @return New GEOM.GEOM_Object, containing the created circle.
2115         #
2116         #  @ref swig_MakeCircle "Example"
2117         @ManageTransactions("CurvesOp")
2118         def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2119             """
2120             Create a circle, with given point1 as center,
2121             passing through the point2 as radius and laying in the plane,
2122             defined by all three given points.
2123
2124             Parameters:
2125                 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2126                 theName Object name; when specified, this parameter is used
2127                         for result publication in the study. Otherwise, if automatic
2128                         publication is switched on, default value is used for result name.
2129
2130             Returns:
2131                 New GEOM.GEOM_Object, containing the created circle.
2132             """
2133             # Example: see GEOM_example6.py
2134             anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2135             RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2136             self._autoPublish(anObj, theName, "circle")
2137             return anObj
2138
2139         ## Create an ellipse with given center, normal vector and radiuses.
2140         #  @param thePnt Ellipse center.
2141         #  @param theVec Vector, normal to the plane of the ellipse.
2142         #  @param theRMajor Major ellipse radius.
2143         #  @param theRMinor Minor ellipse radius.
2144         #  @param theVecMaj Vector, direction of the ellipse's main axis.
2145         #  @param theName Object name; when specified, this parameter is used
2146         #         for result publication in the study. Otherwise, if automatic
2147         #         publication is switched on, default value is used for result name.
2148         #
2149         #  @return New GEOM.GEOM_Object, containing the created ellipse.
2150         #
2151         #  @ref tui_creation_ellipse "Example"
2152         @ManageTransactions("CurvesOp")
2153         def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2154             """
2155             Create an ellipse with given center, normal vector and radiuses.
2156
2157             Parameters:
2158                 thePnt Ellipse center.
2159                 theVec Vector, normal to the plane of the ellipse.
2160                 theRMajor Major ellipse radius.
2161                 theRMinor Minor ellipse radius.
2162                 theVecMaj Vector, direction of the ellipse's main axis.
2163                 theName Object name; when specified, this parameter is used
2164                         for result publication in the study. Otherwise, if automatic
2165                         publication is switched on, default value is used for result name.
2166
2167             Returns:
2168                 New GEOM.GEOM_Object, containing the created ellipse.
2169             """
2170             # Example: see GEOM_TestAll.py
2171             theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2172             if theVecMaj is not None:
2173                 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2174             else:
2175                 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2176                 pass
2177             RaiseIfFailed("MakeEllipse", self.CurvesOp)
2178             anObj.SetParameters(Parameters)
2179             self._autoPublish(anObj, theName, "ellipse")
2180             return anObj
2181
2182         ## Create an ellipse with given radiuses.
2183         #  Center of the ellipse will be in the origin of global
2184         #  coordinate system and normal vector will be codirected with Z axis
2185         #  @param theRMajor Major ellipse radius.
2186         #  @param theRMinor Minor ellipse radius.
2187         #  @param theName Object name; when specified, this parameter is used
2188         #         for result publication in the study. Otherwise, if automatic
2189         #         publication is switched on, default value is used for result name.
2190         #
2191         #  @return New GEOM.GEOM_Object, containing the created ellipse.
2192         @ManageTransactions("CurvesOp")
2193         def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2194             """
2195             Create an ellipse with given radiuses.
2196             Center of the ellipse will be in the origin of global
2197             coordinate system and normal vector will be codirected with Z axis
2198
2199             Parameters:
2200                 theRMajor Major ellipse radius.
2201                 theRMinor Minor ellipse radius.
2202                 theName Object name; when specified, this parameter is used
2203                         for result publication in the study. Otherwise, if automatic
2204                         publication is switched on, default value is used for result name.
2205
2206             Returns:
2207             New GEOM.GEOM_Object, containing the created ellipse.
2208             """
2209             anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2210             RaiseIfFailed("MakeEllipse", self.CurvesOp)
2211             self._autoPublish(anObj, theName, "ellipse")
2212             return anObj
2213
2214         ## Create a polyline on the set of points.
2215         #  @param thePoints Sequence of points for the polyline.
2216         #  @param theIsClosed If True, build a closed wire.
2217         #  @param theName Object name; when specified, this parameter is used
2218         #         for result publication in the study. Otherwise, if automatic
2219         #         publication is switched on, default value is used for result name.
2220         #
2221         #  @return New GEOM.GEOM_Object, containing the created polyline.
2222         #
2223         #  @ref tui_creation_curve "Example"
2224         @ManageTransactions("CurvesOp")
2225         def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2226             """
2227             Create a polyline on the set of points.
2228
2229             Parameters:
2230                 thePoints Sequence of points for the polyline.
2231                 theIsClosed If True, build a closed wire.
2232                 theName Object name; when specified, this parameter is used
2233                         for result publication in the study. Otherwise, if automatic
2234                         publication is switched on, default value is used for result name.
2235
2236             Returns:
2237                 New GEOM.GEOM_Object, containing the created polyline.
2238             """
2239             # Example: see GEOM_TestAll.py
2240             anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2241             RaiseIfFailed("MakePolyline", self.CurvesOp)
2242             self._autoPublish(anObj, theName, "polyline")
2243             return anObj
2244
2245         ## Create bezier curve on the set of points.
2246         #  @param thePoints Sequence of points for the bezier curve.
2247         #  @param theIsClosed If True, build a closed curve.
2248         #  @param theName Object name; when specified, this parameter is used
2249         #         for result publication in the study. Otherwise, if automatic
2250         #         publication is switched on, default value is used for result name.
2251         #
2252         #  @return New GEOM.GEOM_Object, containing the created bezier curve.
2253         #
2254         #  @ref tui_creation_curve "Example"
2255         @ManageTransactions("CurvesOp")
2256         def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2257             """
2258             Create bezier curve on the set of points.
2259
2260             Parameters:
2261                 thePoints Sequence of points for the bezier curve.
2262                 theIsClosed If True, build a closed curve.
2263                 theName Object name; when specified, this parameter is used
2264                         for result publication in the study. Otherwise, if automatic
2265                         publication is switched on, default value is used for result name.
2266
2267             Returns:
2268                 New GEOM.GEOM_Object, containing the created bezier curve.
2269             """
2270             # Example: see GEOM_TestAll.py
2271             anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2272             RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2273             self._autoPublish(anObj, theName, "bezier")
2274             return anObj
2275
2276         ## Create B-Spline curve on the set of points.
2277         #  @param thePoints Sequence of points for the B-Spline curve.
2278         #  @param theIsClosed If True, build a closed curve.
2279         #  @param theDoReordering If TRUE, the algo does not follow the order of
2280         #                         \a thePoints but searches for the closest vertex.
2281         #  @param theName Object name; when specified, this parameter is used
2282         #         for result publication in the study. Otherwise, if automatic
2283         #         publication is switched on, default value is used for result name.
2284         #
2285         #  @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2286         #
2287         #  @ref tui_creation_curve "Example"
2288         @ManageTransactions("CurvesOp")
2289         def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2290             """
2291             Create B-Spline curve on the set of points.
2292
2293             Parameters:
2294                 thePoints Sequence of points for the B-Spline curve.
2295                 theIsClosed If True, build a closed curve.
2296                 theDoReordering If True, the algo does not follow the order of
2297                                 thePoints but searches for the closest vertex.
2298                 theName Object name; when specified, this parameter is used
2299                         for result publication in the study. Otherwise, if automatic
2300                         publication is switched on, default value is used for result name.
2301
2302             Returns:
2303                 New GEOM.GEOM_Object, containing the created B-Spline curve.
2304             """
2305             # Example: see GEOM_TestAll.py
2306             anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2307             RaiseIfFailed("MakeInterpol", self.CurvesOp)
2308             self._autoPublish(anObj, theName, "bspline")
2309             return anObj
2310
2311         ## Create B-Spline curve on the set of points.
2312         #  @param thePoints Sequence of points for the B-Spline curve.
2313         #  @param theFirstVec Vector object, defining the curve direction at its first point.
2314         #  @param theLastVec Vector object, defining the curve direction at its last point.
2315         #  @param theName Object name; when specified, this parameter is used
2316         #         for result publication in the study. Otherwise, if automatic
2317         #         publication is switched on, default value is used for result name.
2318         #
2319         #  @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2320         #
2321         #  @ref tui_creation_curve "Example"
2322         @ManageTransactions("CurvesOp")
2323         def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2324             """
2325             Create B-Spline curve on the set of points.
2326
2327             Parameters:
2328                 thePoints Sequence of points for the B-Spline curve.
2329                 theFirstVec Vector object, defining the curve direction at its first point.
2330                 theLastVec Vector object, defining the curve direction at its last point.
2331                 theName Object name; when specified, this parameter is used
2332                         for result publication in the study. Otherwise, if automatic
2333                         publication is switched on, default value is used for result name.
2334
2335             Returns:
2336                 New GEOM.GEOM_Object, containing the created B-Spline curve.
2337             """
2338             # Example: see GEOM_TestAll.py
2339             anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2340             RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2341             self._autoPublish(anObj, theName, "bspline")
2342             return anObj
2343
2344         ## Creates a curve using the parametric definition of the basic points.
2345         #  @param thexExpr parametric equation of the coordinates X.
2346         #  @param theyExpr parametric equation of the coordinates Y.
2347         #  @param thezExpr parametric equation of the coordinates Z.
2348         #  @param theParamMin the minimal value of the parameter.
2349         #  @param theParamMax the maximum value of the parameter.
2350         #  @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2351         #  @param theCurveType the type of the curve,
2352         #         one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2353         #  @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.
2354         #  @param theName Object name; when specified, this parameter is used
2355         #         for result publication in the study. Otherwise, if automatic
2356         #         publication is switched on, default value is used for result name.
2357         #
2358         #  @return New GEOM.GEOM_Object, containing the created curve.
2359         #
2360         #  @ref tui_creation_curve "Example"
2361         @ManageTransactions("CurvesOp")
2362         def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2363                                 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2364             """
2365             Creates a curve using the parametric definition of the basic points.
2366
2367             Parameters:
2368                 thexExpr parametric equation of the coordinates X.
2369                 theyExpr parametric equation of the coordinates Y.
2370                 thezExpr parametric equation of the coordinates Z.
2371                 theParamMin the minimal value of the parameter.
2372                 theParamMax the maximum value of the parameter.
2373                 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2374                 theCurveType the type of the curve,
2375                              one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2376                 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2377                              method is used which can lead to a bug.
2378                 theName Object name; when specified, this parameter is used
2379                         for result publication in the study. Otherwise, if automatic
2380                         publication is switched on, default value is used for result name.
2381
2382             Returns:
2383                 New GEOM.GEOM_Object, containing the created curve.
2384             """
2385             theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2386             if theNewMethod:
2387               anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2388             else:
2389               anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2390             RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2391             anObj.SetParameters(Parameters)
2392             self._autoPublish(anObj, theName, "curve")
2393             return anObj
2394
2395         ## Create an isoline curve on a face.
2396         #  @param theFace the face for which an isoline is created.
2397         #  @param IsUIsoline True for U-isoline creation; False for V-isoline
2398         #         creation.
2399         #  @param theParameter the U parameter for U-isoline or V parameter
2400         #         for V-isoline.
2401         #  @param theName Object name; when specified, this parameter is used
2402         #         for result publication in the study. Otherwise, if automatic
2403         #         publication is switched on, default value is used for result name.
2404         #
2405         #  @return New GEOM.GEOM_Object, containing the created isoline edge or
2406         #          a compound of edges.
2407         #
2408         #  @ref tui_creation_curve "Example"
2409         @ManageTransactions("CurvesOp")
2410         def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2411             """
2412             Create an isoline curve on a face.
2413
2414             Parameters:
2415                 theFace the face for which an isoline is created.
2416                 IsUIsoline True for U-isoline creation; False for V-isoline
2417                            creation.
2418                 theParameter the U parameter for U-isoline or V parameter
2419                              for V-isoline.
2420                 theName Object name; when specified, this parameter is used
2421                         for result publication in the study. Otherwise, if automatic
2422                         publication is switched on, default value is used for result name.
2423
2424             Returns:
2425                 New GEOM.GEOM_Object, containing the created isoline edge or a
2426                 compound of edges.
2427             """
2428             # Example: see GEOM_TestAll.py
2429             anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2430             RaiseIfFailed("MakeIsoline", self.CurvesOp)
2431             if IsUIsoline:
2432                 self._autoPublish(anObj, theName, "U-Isoline")
2433             else:
2434                 self._autoPublish(anObj, theName, "V-Isoline")
2435             return anObj
2436
2437         # end of l4_curves
2438         ## @}
2439
2440         ## @addtogroup l3_sketcher
2441         ## @{
2442
2443         ## Create a sketcher (wire or face), following the textual description,
2444         #  passed through <VAR>theCommand</VAR> argument. \n
2445         #  Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2446         #  Format of the description string have to be the following:
2447         #
2448         #  "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2449         #
2450         #  Where:
2451         #  - x1, y1 are coordinates of the first sketcher point (zero by default),
2452         #  - CMD is one of
2453         #     - "R angle" : Set the direction by angle
2454         #     - "D dx dy" : Set the direction by DX & DY
2455         #     .
2456         #       \n
2457         #     - "TT x y" : Create segment by point at X & Y
2458         #     - "T dx dy" : Create segment by point with DX & DY
2459         #     - "L length" : Create segment by direction & Length
2460         #     - "IX x" : Create segment by direction & Intersect. X
2461         #     - "IY y" : Create segment by direction & Intersect. Y
2462         #     .
2463         #       \n
2464         #     - "C radius length" : Create arc by direction, radius and length(in degree)
2465         #     - "AA x y": Create arc by point at X & Y
2466         #     - "A dx dy" : Create arc by point with DX & DY
2467         #     - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2468         #     - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2469         #     - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2470         #     - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2471         #     .
2472         #       \n
2473         #     - "WW" : Close Wire (to finish)
2474         #     - "WF" : Close Wire and build face (to finish)
2475         #     .
2476         #        \n
2477         #  - Flag1 (= reverse) is 0 or 2 ...
2478         #     - if 0 the drawn arc is the one of lower angle (< Pi)
2479         #     - if 2 the drawn arc ius the one of greater angle (> Pi)
2480         #     .
2481         #        \n
2482         #  - Flag2 (= control tolerance) is 0 or 1 ...
2483         #     - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2484         #     - if 1 the wire is built only if the end point is on the arc
2485         #       with a tolerance of 10^-7 on the distance else the creation fails
2486         #
2487         #  @param theCommand String, defining the sketcher in local
2488         #                    coordinates of the working plane.
2489         #  @param theWorkingPlane Nine double values, defining origin,
2490         #                         OZ and OX directions of the working plane.
2491         #  @param theName Object name; when specified, this parameter is used
2492         #         for result publication in the study. Otherwise, if automatic
2493         #         publication is switched on, default value is used for result name.
2494         #
2495         #  @return New GEOM.GEOM_Object, containing the created wire.
2496         #
2497         #  @ref tui_sketcher_page "Example"
2498         @ManageTransactions("CurvesOp")
2499         def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2500             """
2501             Create a sketcher (wire or face), following the textual description, passed
2502             through theCommand argument.
2503             Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2504             Format of the description string have to be the following:
2505                 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2506             Where:
2507             - x1, y1 are coordinates of the first sketcher point (zero by default),
2508             - CMD is one of
2509                - "R angle" : Set the direction by angle
2510                - "D dx dy" : Set the direction by DX & DY
2511
2512                - "TT x y" : Create segment by point at X & Y
2513                - "T dx dy" : Create segment by point with DX & DY
2514                - "L length" : Create segment by direction & Length
2515                - "IX x" : Create segment by direction & Intersect. X
2516                - "IY y" : Create segment by direction & Intersect. Y
2517
2518                - "C radius length" : Create arc by direction, radius and length(in degree)
2519                - "AA x y": Create arc by point at X & Y
2520                - "A dx dy" : Create arc by point with DX & DY
2521                - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2522                - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2523                - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2524                - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2525
2526                - "WW" : Close Wire (to finish)
2527                - "WF" : Close Wire and build face (to finish)
2528
2529             - Flag1 (= reverse) is 0 or 2 ...
2530                - if 0 the drawn arc is the one of lower angle (< Pi)
2531                - if 2 the drawn arc ius the one of greater angle (> Pi)
2532
2533             - Flag2 (= control tolerance) is 0 or 1 ...
2534                - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2535                - if 1 the wire is built only if the end point is on the arc
2536                  with a tolerance of 10^-7 on the distance else the creation fails
2537
2538             Parameters:
2539                 theCommand String, defining the sketcher in local
2540                            coordinates of the working plane.
2541                 theWorkingPlane Nine double values, defining origin,
2542                                 OZ and OX directions of the working plane.
2543                 theName Object name; when specified, this parameter is used
2544                         for result publication in the study. Otherwise, if automatic
2545                         publication is switched on, default value is used for result name.
2546
2547             Returns:
2548                 New GEOM.GEOM_Object, containing the created wire.
2549             """
2550             # Example: see GEOM_TestAll.py
2551             theCommand,Parameters = ParseSketcherCommand(theCommand)
2552             anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2553             RaiseIfFailed("MakeSketcher", self.CurvesOp)
2554             anObj.SetParameters(Parameters)
2555             self._autoPublish(anObj, theName, "wire")
2556             return anObj
2557
2558         ## Create a sketcher (wire or face), following the textual description,
2559         #  passed through <VAR>theCommand</VAR> argument. \n
2560         #  For format of the description string see MakeSketcher() method.\n
2561         #  @param theCommand String, defining the sketcher in local
2562         #                    coordinates of the working plane.
2563         #  @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2564         #  @param theName Object name; when specified, this parameter is used
2565         #         for result publication in the study. Otherwise, if automatic
2566         #         publication is switched on, default value is used for result name.
2567         #
2568         #  @return New GEOM.GEOM_Object, containing the created wire.
2569         #
2570         #  @ref tui_sketcher_page "Example"
2571         @ManageTransactions("CurvesOp")
2572         def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2573             """
2574             Create a sketcher (wire or face), following the textual description,
2575             passed through theCommand argument.
2576             For format of the description string see geompy.MakeSketcher() method.
2577
2578             Parameters:
2579                 theCommand String, defining the sketcher in local
2580                            coordinates of the working plane.
2581                 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2582                 theName Object name; when specified, this parameter is used
2583                         for result publication in the study. Otherwise, if automatic
2584                         publication is switched on, default value is used for result name.
2585
2586             Returns:
2587                 New GEOM.GEOM_Object, containing the created wire.
2588             """
2589             theCommand,Parameters = ParseSketcherCommand(theCommand)
2590             anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2591             RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2592             anObj.SetParameters(Parameters)
2593             self._autoPublish(anObj, theName, "wire")
2594             return anObj
2595
2596         ## Obtain a 2D sketcher interface
2597         #  @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2598         def Sketcher2D (self):
2599             """
2600             Obtain a 2D sketcher interface.
2601
2602             Example of usage:
2603                sk = geompy.Sketcher2D()
2604                sk.addPoint(20, 20)
2605                sk.addSegmentRelative(15, 70)
2606                sk.addSegmentPerpY(50)
2607                sk.addArcRadiusRelative(25, 15, 14.5, 0)
2608                sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2609                sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2610                sk.close()
2611                Sketch_1 = sk.wire(geomObj_1)
2612             """
2613             sk = Sketcher2D (self)
2614             return sk
2615
2616         ## Create a sketcher wire, following the numerical description,
2617         #  passed through <VAR>theCoordinates</VAR> argument. \n
2618         #  @param theCoordinates double values, defining points to create a wire,
2619         #                                                      passing from it.
2620         #  @param theName Object name; when specified, this parameter is used
2621         #         for result publication in the study. Otherwise, if automatic
2622         #         publication is switched on, default value is used for result name.
2623         #
2624         #  @return New GEOM.GEOM_Object, containing the created wire.
2625         #
2626         #  @ref tui_3dsketcher_page "Example"
2627         @ManageTransactions("CurvesOp")
2628         def Make3DSketcher(self, theCoordinates, theName=None):
2629             """
2630             Create a sketcher wire, following the numerical description,
2631             passed through theCoordinates argument.
2632
2633             Parameters:
2634                 theCoordinates double values, defining points to create a wire,
2635                                passing from it.
2636                 theName Object name; when specified, this parameter is used
2637                         for result publication in the study. Otherwise, if automatic
2638                         publication is switched on, default value is used for result name.
2639
2640             Returns:
2641                 New GEOM_Object, containing the created wire.
2642             """
2643             theCoordinates,Parameters = ParseParameters(theCoordinates)
2644             anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2645             RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2646             anObj.SetParameters(Parameters)
2647             self._autoPublish(anObj, theName, "wire")
2648             return anObj
2649
2650         ## Obtain a 3D sketcher interface
2651         #  @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2652         #
2653         #  @ref tui_3dsketcher_page "Example"
2654         def Sketcher3D (self):
2655             """
2656             Obtain a 3D sketcher interface.
2657
2658             Example of usage:
2659                 sk = geompy.Sketcher3D()
2660                 sk.addPointsAbsolute(0,0,0, 70,0,0)
2661                 sk.addPointsRelative(0, 0, 130)
2662                 sk.addPointAnglesLength("OXY", 50, 0, 100)
2663                 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2664                 sk.close()
2665                 a3D_Sketcher_1 = sk.wire()
2666             """
2667             sk = Sketcher3D (self)
2668             return sk
2669
2670         ## Obtain a 2D polyline creation interface
2671         #  @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2672         #
2673         #  @ref tui_3dsketcher_page "Example"
2674         def Polyline2D (self):
2675             """
2676             Obtain a 2D polyline creation interface.
2677
2678             Example of usage:
2679                 pl = geompy.Polyline2D()
2680                 pl.addSection("section 1", GEOM.Polyline, True)
2681                 pl.addPoints(0, 0, 10, 0, 10, 10)
2682                 pl.addSection("section 2", GEOM.Interpolation, False)
2683                 pl.addPoints(20, 0, 30, 0, 30, 10)
2684                 resultObj = pl.result(WorkingPlane)
2685             """
2686             pl = Polyline2D (self)
2687             return pl
2688
2689         # end of l3_sketcher
2690         ## @}
2691
2692         ## @addtogroup l3_3d_primitives
2693         ## @{
2694
2695         ## Create a box by coordinates of two opposite vertices.
2696         #
2697         #  @param x1,y1,z1 double values, defining first point it.
2698         #  @param x2,y2,z2 double values, defining first point it.
2699         #  @param theName Object name; when specified, this parameter is used
2700         #         for result publication in the study. Otherwise, if automatic
2701         #         publication is switched on, default value is used for result name.
2702         #
2703         #  @return New GEOM.GEOM_Object, containing the created box.
2704         #
2705         #  @ref tui_creation_box "Example"
2706         def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2707             """
2708             Create a box by coordinates of two opposite vertices.
2709
2710             Parameters:
2711                 x1,y1,z1 double values, defining first point.
2712                 x2,y2,z2 double values, defining second point.
2713                 theName Object name; when specified, this parameter is used
2714                         for result publication in the study. Otherwise, if automatic
2715                         publication is switched on, default value is used for result name.
2716
2717             Returns:
2718                 New GEOM.GEOM_Object, containing the created box.
2719             """
2720             # Example: see GEOM_TestAll.py
2721             pnt1 = self.MakeVertex(x1,y1,z1)
2722             pnt2 = self.MakeVertex(x2,y2,z2)
2723             # note: auto-publishing is done in self.MakeBoxTwoPnt()
2724             return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2725
2726         ## Create a box with specified dimensions along the coordinate axes
2727         #  and with edges, parallel to the coordinate axes.
2728         #  Center of the box will be at point (DX/2, DY/2, DZ/2).
2729         #  @param theDX Length of Box edges, parallel to OX axis.
2730         #  @param theDY Length of Box edges, parallel to OY axis.
2731         #  @param theDZ Length of Box edges, parallel to OZ axis.
2732         #  @param theName Object name; when specified, this parameter is used
2733         #         for result publication in the study. Otherwise, if automatic
2734         #         publication is switched on, default value is used for result name.
2735         #
2736         #  @return New GEOM.GEOM_Object, containing the created box.
2737         #
2738         #  @ref tui_creation_box "Example"
2739         @ManageTransactions("PrimOp")
2740         def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2741             """
2742             Create a box with specified dimensions along the coordinate axes
2743             and with edges, parallel to the coordinate axes.
2744             Center of the box will be at point (DX/2, DY/2, DZ/2).
2745
2746             Parameters:
2747                 theDX Length of Box edges, parallel to OX axis.
2748                 theDY Length of Box edges, parallel to OY axis.
2749                 theDZ Length of Box edges, parallel to OZ axis.
2750                 theName Object name; when specified, this parameter is used
2751                         for result publication in the study. Otherwise, if automatic
2752                         publication is switched on, default value is used for result name.
2753
2754             Returns:
2755                 New GEOM.GEOM_Object, containing the created box.
2756             """
2757             # Example: see GEOM_TestAll.py
2758             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2759             anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2760             RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2761             anObj.SetParameters(Parameters)
2762             self._autoPublish(anObj, theName, "box")
2763             return anObj
2764
2765         ## Create a box with two specified opposite vertices,
2766         #  and with edges, parallel to the coordinate axes
2767         #  @param thePnt1 First of two opposite vertices.
2768         #  @param thePnt2 Second of two opposite vertices.
2769         #  @param theName Object name; when specified, this parameter is used
2770         #         for result publication in the study. Otherwise, if automatic
2771         #         publication is switched on, default value is used for result name.
2772         #
2773         #  @return New GEOM.GEOM_Object, containing the created box.
2774         #
2775         #  @ref tui_creation_box "Example"
2776         @ManageTransactions("PrimOp")
2777         def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2778             """
2779             Create a box with two specified opposite vertices,
2780             and with edges, parallel to the coordinate axes
2781
2782             Parameters:
2783                 thePnt1 First of two opposite vertices.
2784                 thePnt2 Second of two opposite vertices.
2785                 theName Object name; when specified, this parameter is used
2786                         for result publication in the study. Otherwise, if automatic
2787                         publication is switched on, default value is used for result name.
2788
2789             Returns:
2790                 New GEOM.GEOM_Object, containing the created box.
2791             """
2792             # Example: see GEOM_TestAll.py
2793             anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2794             RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2795             self._autoPublish(anObj, theName, "box")
2796             return anObj
2797
2798         ## Create a face with specified dimensions with edges parallel to coordinate axes.
2799         #  @param theH height of Face.
2800         #  @param theW width of Face.
2801         #  @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2802         #  @param theName Object name; when specified, this parameter is used
2803         #         for result publication in the study. Otherwise, if automatic
2804         #         publication is switched on, default value is used for result name.
2805         #
2806         #  @return New GEOM.GEOM_Object, containing the created face.
2807         #
2808         #  @ref tui_creation_face "Example"
2809         @ManageTransactions("PrimOp")
2810         def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2811             """
2812             Create a face with specified dimensions with edges parallel to coordinate axes.
2813
2814             Parameters:
2815                 theH height of Face.
2816                 theW width of Face.
2817                 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2818                 theName Object name; when specified, this parameter is used
2819                         for result publication in the study. Otherwise, if automatic
2820                         publication is switched on, default value is used for result name.
2821
2822             Returns:
2823                 New GEOM.GEOM_Object, containing the created face.
2824             """
2825             # Example: see GEOM_TestAll.py
2826             theH,theW,Parameters = ParseParameters(theH, theW)
2827             anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2828             RaiseIfFailed("MakeFaceHW", self.PrimOp)
2829             anObj.SetParameters(Parameters)
2830             self._autoPublish(anObj, theName, "rectangle")
2831             return anObj
2832
2833         ## Create a face from another plane and two sizes,
2834         #  vertical size and horisontal size.
2835         #  @param theObj   Normale vector to the creating face or
2836         #  the face object.
2837         #  @param theH     Height (vertical size).
2838         #  @param theW     Width (horisontal size).
2839         #  @param theName Object name; when specified, this parameter is used
2840         #         for result publication in the study. Otherwise, if automatic
2841         #         publication is switched on, default value is used for result name.
2842         #
2843         #  @return New GEOM.GEOM_Object, containing the created face.
2844         #
2845         #  @ref tui_creation_face "Example"
2846         @ManageTransactions("PrimOp")
2847         def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2848             """
2849             Create a face from another plane and two sizes,
2850             vertical size and horisontal size.
2851
2852             Parameters:
2853                 theObj   Normale vector to the creating face or
2854                          the face object.
2855                 theH     Height (vertical size).
2856                 theW     Width (horisontal size).
2857                 theName Object name; when specified, this parameter is used
2858                         for result publication in the study. Otherwise, if automatic
2859                         publication is switched on, default value is used for result name.
2860
2861             Returns:
2862                 New GEOM_Object, containing the created face.
2863             """
2864             # Example: see GEOM_TestAll.py
2865             theH,theW,Parameters = ParseParameters(theH, theW)
2866             anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2867             RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2868             anObj.SetParameters(Parameters)
2869             self._autoPublish(anObj, theName, "rectangle")
2870             return anObj
2871
2872         ## Create a disk with given center, normal vector and radius.
2873         #  @param thePnt Disk center.
2874         #  @param theVec Vector, normal to the plane of the disk.
2875         #  @param theR Disk radius.
2876         #  @param theName Object name; when specified, this parameter is used
2877         #         for result publication in the study. Otherwise, if automatic
2878         #         publication is switched on, default value is used for result name.
2879         #
2880         #  @return New GEOM.GEOM_Object, containing the created disk.
2881         #
2882         #  @ref tui_creation_disk "Example"
2883         @ManageTransactions("PrimOp")
2884         def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2885             """
2886             Create a disk with given center, normal vector and radius.
2887
2888             Parameters:
2889                 thePnt Disk center.
2890                 theVec Vector, normal to the plane of the disk.
2891                 theR Disk radius.
2892                 theName Object name; when specified, this parameter is used
2893                         for result publication in the study. Otherwise, if automatic
2894                         publication is switched on, default value is used for result name.
2895
2896             Returns:
2897                 New GEOM.GEOM_Object, containing the created disk.
2898             """
2899             # Example: see GEOM_TestAll.py
2900             theR,Parameters = ParseParameters(theR)
2901             anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2902             RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2903             anObj.SetParameters(Parameters)
2904             self._autoPublish(anObj, theName, "disk")
2905             return anObj
2906
2907         ## Create a disk, passing through three given points
2908         #  @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2909         #  @param theName Object name; when specified, this parameter is used
2910         #         for result publication in the study. Otherwise, if automatic
2911         #         publication is switched on, default value is used for result name.
2912         #
2913         #  @return New GEOM.GEOM_Object, containing the created disk.
2914         #
2915         #  @ref tui_creation_disk "Example"
2916         @ManageTransactions("PrimOp")
2917         def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2918             """
2919             Create a disk, passing through three given points
2920
2921             Parameters:
2922                 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2923                 theName Object name; when specified, this parameter is used
2924                         for result publication in the study. Otherwise, if automatic
2925                         publication is switched on, default value is used for result name.
2926
2927             Returns:
2928                 New GEOM.GEOM_Object, containing the created disk.
2929             """
2930             # Example: see GEOM_TestAll.py
2931             anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2932             RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2933             self._autoPublish(anObj, theName, "disk")
2934             return anObj
2935
2936         ## Create a disk with specified dimensions along OX-OY coordinate axes.
2937         #  @param theR Radius of Face.
2938         #  @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2939         #  @param theName Object name; when specified, this parameter is used
2940         #         for result publication in the study. Otherwise, if automatic
2941         #         publication is switched on, default value is used for result name.
2942         #
2943         #  @return New GEOM.GEOM_Object, containing the created disk.
2944         #
2945         #  @ref tui_creation_face "Example"
2946         @ManageTransactions("PrimOp")
2947         def MakeDiskR(self, theR, theOrientation, theName=None):
2948             """
2949             Create a disk with specified dimensions along OX-OY coordinate axes.
2950
2951             Parameters:
2952                 theR Radius of Face.
2953                 theOrientation set the orientation belong axis OXY or OYZ or OZX
2954                 theName Object name; when specified, this parameter is used
2955                         for result publication in the study. Otherwise, if automatic
2956                         publication is switched on, default value is used for result name.
2957
2958             Returns:
2959                 New GEOM.GEOM_Object, containing the created disk.
2960
2961             Example of usage:
2962                 Disk3 = geompy.MakeDiskR(100., 1)
2963             """
2964             # Example: see GEOM_TestAll.py
2965             theR,Parameters = ParseParameters(theR)
2966             anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2967             RaiseIfFailed("MakeDiskR", self.PrimOp)
2968             anObj.SetParameters(Parameters)
2969             self._autoPublish(anObj, theName, "disk")
2970             return anObj
2971
2972         ## Create a cylinder with given base point, axis, radius and height.
2973         #  @param thePnt Central point of cylinder base.
2974         #  @param theAxis Cylinder axis.
2975         #  @param theR Cylinder radius.
2976         #  @param theH Cylinder height.
2977         #  @param theName Object name; when specified, this parameter is used
2978         #         for result publication in the study. Otherwise, if automatic
2979         #         publication is switched on, default value is used for result name.
2980         #
2981         #  @return New GEOM.GEOM_Object, containing the created cylinder.
2982         #
2983         #  @ref tui_creation_cylinder "Example"
2984         @ManageTransactions("PrimOp")
2985         def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2986             """
2987             Create a cylinder with given base point, axis, radius and height.
2988
2989             Parameters:
2990                 thePnt Central point of cylinder base.
2991                 theAxis Cylinder axis.
2992                 theR Cylinder radius.
2993                 theH Cylinder height.
2994                 theName Object name; when specified, this parameter is used
2995                         for result publication in the study. Otherwise, if automatic
2996                         publication is switched on, default value is used for result name.
2997
2998             Returns:
2999                 New GEOM.GEOM_Object, containing the created cylinder.
3000             """
3001             # Example: see GEOM_TestAll.py
3002             theR,theH,Parameters = ParseParameters(theR, theH)
3003             anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3004             RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3005             anObj.SetParameters(Parameters)
3006             self._autoPublish(anObj, theName, "cylinder")
3007             return anObj
3008             
3009         ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3010         #  @param thePnt Central point of cylinder base.
3011         #  @param theAxis Cylinder axis.
3012         #  @param theR Cylinder radius.
3013         #  @param theH Cylinder height.
3014         #  @param theA Cylinder angle in radians.
3015         #  @param theName Object name; when specified, this parameter is used
3016         #         for result publication in the study. Otherwise, if automatic
3017         #         publication is switched on, default value is used for result name.
3018         #
3019         #  @return New GEOM.GEOM_Object, containing the created cylinder.
3020         #
3021         #  @ref tui_creation_cylinder "Example"
3022         @ManageTransactions("PrimOp")
3023         def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3024             """
3025             Create a portion of cylinder with given base point, axis, radius, height and angle.
3026
3027             Parameters:
3028                 thePnt Central point of cylinder base.
3029                 theAxis Cylinder axis.
3030                 theR Cylinder radius.
3031                 theH Cylinder height.
3032                 theA Cylinder angle in radians.
3033                 theName Object name; when specified, this parameter is used
3034                         for result publication in the study. Otherwise, if automatic
3035                         publication is switched on, default value is used for result name.
3036
3037             Returns:
3038                 New GEOM.GEOM_Object, containing the created cylinder.
3039             """
3040             # Example: see GEOM_TestAll.py
3041             flag = False
3042             if isinstance(theA,str):
3043                 flag = True
3044             theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3045             if flag:
3046                 theA = theA*math.pi/180.
3047             anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3048             RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3049             anObj.SetParameters(Parameters)
3050             self._autoPublish(anObj, theName, "cylinder")
3051             return anObj
3052
3053         ## Create a cylinder with given radius and height at
3054         #  the origin of coordinate system. Axis of the cylinder
3055         #  will be collinear to the OZ axis of the coordinate system.
3056         #  @param theR Cylinder radius.
3057         #  @param theH Cylinder height.
3058         #  @param theName Object name; when specified, this parameter is used
3059         #         for result publication in the study. Otherwise, if automatic
3060         #         publication is switched on, default value is used for result name.
3061         #
3062         #  @return New GEOM.GEOM_Object, containing the created cylinder.
3063         #
3064         #  @ref tui_creation_cylinder "Example"
3065         @ManageTransactions("PrimOp")
3066         def MakeCylinderRH(self, theR, theH, theName=None):
3067             """
3068             Create a cylinder with given radius and height at
3069             the origin of coordinate system. Axis of the cylinder
3070             will be collinear to the OZ axis of the coordinate system.
3071
3072             Parameters:
3073                 theR Cylinder radius.
3074                 theH Cylinder height.
3075                 theName Object name; when specified, this parameter is used
3076                         for result publication in the study. Otherwise, if automatic
3077                         publication is switched on, default value is used for result name.
3078
3079             Returns:
3080                 New GEOM.GEOM_Object, containing the created cylinder.
3081             """
3082             # Example: see GEOM_TestAll.py
3083             theR,theH,Parameters = ParseParameters(theR, theH)
3084             anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3085             RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3086             anObj.SetParameters(Parameters)
3087             self._autoPublish(anObj, theName, "cylinder")
3088             return anObj
3089             
3090         ## Create a portion of cylinder with given radius, height and angle at
3091         #  the origin of coordinate system. Axis of the cylinder
3092         #  will be collinear to the OZ axis of the coordinate system.
3093         #  @param theR Cylinder radius.
3094         #  @param theH Cylinder height.
3095         #  @param theA Cylinder angle in radians.
3096         #  @param theName Object name; when specified, this parameter is used
3097         #         for result publication in the study. Otherwise, if automatic
3098         #         publication is switched on, default value is used for result name.
3099         #
3100         #  @return New GEOM.GEOM_Object, containing the created cylinder.
3101         #
3102         #  @ref tui_creation_cylinder "Example"
3103         @ManageTransactions("PrimOp")
3104         def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3105             """
3106             Create a portion of cylinder with given radius, height and angle at
3107             the origin of coordinate system. Axis of the cylinder
3108             will be collinear to the OZ axis of the coordinate system.
3109
3110             Parameters:
3111                 theR Cylinder radius.
3112                 theH Cylinder height.
3113                 theA Cylinder angle in radians.
3114                 theName Object name; when specified, this parameter is used
3115                         for result publication in the study. Otherwise, if automatic
3116                         publication is switched on, default value is used for result name.
3117
3118             Returns:
3119                 New GEOM.GEOM_Object, containing the created cylinder.
3120             """
3121             # Example: see GEOM_TestAll.py
3122             flag = False
3123             if isinstance(theA,str):
3124                 flag = True
3125             theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3126             if flag:
3127                 theA = theA*math.pi/180.
3128             anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3129             RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3130             anObj.SetParameters(Parameters)
3131             self._autoPublish(anObj, theName, "cylinder")
3132             return anObj
3133
3134         ## Create a sphere with given center and radius.
3135         #  @param thePnt Sphere center.
3136         #  @param theR Sphere radius.
3137         #  @param theName Object name; when specified, this parameter is used
3138         #         for result publication in the study. Otherwise, if automatic
3139         #         publication is switched on, default value is used for result name.
3140         #
3141         #  @return New GEOM.GEOM_Object, containing the created sphere.
3142         #
3143         #  @ref tui_creation_sphere "Example"
3144         @ManageTransactions("PrimOp")
3145         def MakeSpherePntR(self, thePnt, theR, theName=None):
3146             """
3147             Create a sphere with given center and radius.
3148
3149             Parameters:
3150                 thePnt Sphere center.
3151                 theR Sphere radius.
3152                 theName Object name; when specified, this parameter is used
3153                         for result publication in the study. Otherwise, if automatic
3154                         publication is switched on, default value is used for result name.
3155
3156             Returns:
3157                 New GEOM.GEOM_Object, containing the created sphere.
3158             """
3159             # Example: see GEOM_TestAll.py
3160             theR,Parameters = ParseParameters(theR)
3161             anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3162             RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3163             anObj.SetParameters(Parameters)
3164             self._autoPublish(anObj, theName, "sphere")
3165             return anObj
3166
3167         ## Create a sphere with given center and radius.
3168         #  @param x,y,z Coordinates of sphere center.
3169         #  @param theR Sphere radius.
3170         #  @param theName Object name; when specified, this parameter is used
3171         #         for result publication in the study. Otherwise, if automatic
3172         #         publication is switched on, default value is used for result name.
3173         #
3174         #  @return New GEOM.GEOM_Object, containing the created sphere.
3175         #
3176         #  @ref tui_creation_sphere "Example"
3177         def MakeSphere(self, x, y, z, theR, theName=None):
3178             """
3179             Create a sphere with given center and radius.
3180
3181             Parameters:
3182                 x,y,z Coordinates of sphere center.
3183                 theR Sphere radius.
3184                 theName Object name; when specified, this parameter is used
3185                         for result publication in the study. Otherwise, if automatic
3186                         publication is switched on, default value is used for result name.
3187
3188             Returns:
3189                 New GEOM.GEOM_Object, containing the created sphere.
3190             """
3191             # Example: see GEOM_TestAll.py
3192             point = self.MakeVertex(x, y, z)
3193             # note: auto-publishing is done in self.MakeSpherePntR()
3194             anObj = self.MakeSpherePntR(point, theR, theName)
3195             return anObj
3196
3197         ## Create a sphere with given radius at the origin of coordinate system.
3198         #  @param theR Sphere radius.
3199         #  @param theName Object name; when specified, this parameter is used
3200         #         for result publication in the study. Otherwise, if automatic
3201         #         publication is switched on, default value is used for result name.
3202         #
3203         #  @return New GEOM.GEOM_Object, containing the created sphere.
3204         #
3205         #  @ref tui_creation_sphere "Example"
3206         @ManageTransactions("PrimOp")
3207         def MakeSphereR(self, theR, theName=None):
3208             """
3209             Create a sphere with given radius at the origin of coordinate system.
3210
3211             Parameters:
3212                 theR Sphere radius.
3213                 theName Object name; when specified, this parameter is used
3214                         for result publication in the study. Otherwise, if automatic
3215                         publication is switched on, default value is used for result name.
3216
3217             Returns:
3218                 New GEOM.GEOM_Object, containing the created sphere.
3219             """
3220             # Example: see GEOM_TestAll.py
3221             theR,Parameters = ParseParameters(theR)
3222             anObj = self.PrimOp.MakeSphereR(theR)
3223             RaiseIfFailed("MakeSphereR", self.PrimOp)
3224             anObj.SetParameters(Parameters)
3225             self._autoPublish(anObj, theName, "sphere")
3226             return anObj
3227
3228         ## Create a cone with given base point, axis, height and radiuses.
3229         #  @param thePnt Central point of the first cone base.
3230         #  @param theAxis Cone axis.
3231         #  @param theR1 Radius of the first cone base.
3232         #  @param theR2 Radius of the second cone base.
3233         #    \note If both radiuses are non-zero, the cone will be truncated.
3234         #    \note If the radiuses are equal, a cylinder will be created instead.
3235         #  @param theH Cone height.
3236         #  @param theName Object name; when specified, this parameter is used
3237         #         for result publication in the study. Otherwise, if automatic
3238         #         publication is switched on, default value is used for result name.
3239         #
3240         #  @return New GEOM.GEOM_Object, containing the created cone.
3241         #
3242         #  @ref tui_creation_cone "Example"
3243         @ManageTransactions("PrimOp")
3244         def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3245             """
3246             Create a cone with given base point, axis, height and radiuses.
3247
3248             Parameters:
3249                 thePnt Central point of the first cone base.
3250                 theAxis Cone axis.
3251                 theR1 Radius of the first cone base.
3252                 theR2 Radius of the second cone base.
3253                 theH Cone height.
3254                 theName Object name; when specified, this parameter is used
3255                         for result publication in the study. Otherwise, if automatic
3256                         publication is switched on, default value is used for result name.
3257
3258             Note:
3259                 If both radiuses are non-zero, the cone will be truncated.
3260                 If the radiuses are equal, a cylinder will be created instead.
3261
3262             Returns:
3263                 New GEOM.GEOM_Object, containing the created cone.
3264             """
3265             # Example: see GEOM_TestAll.py
3266             theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3267             anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3268             RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3269             anObj.SetParameters(Parameters)
3270             self._autoPublish(anObj, theName, "cone")
3271             return anObj
3272
3273         ## Create a cone with given height and radiuses at
3274         #  the origin of coordinate system. Axis of the cone will
3275         #  be collinear to the OZ axis of the coordinate system.
3276         #  @param theR1 Radius of the first cone base.
3277         #  @param theR2 Radius of the second cone base.
3278         #    \note If both radiuses are non-zero, the cone will be truncated.
3279         #    \note If the radiuses are equal, a cylinder will be created instead.
3280         #  @param theH Cone height.
3281         #  @param theName Object name; when specified, this parameter is used
3282         #         for result publication in the study. Otherwise, if automatic
3283         #         publication is switched on, default value is used for result name.
3284         #
3285         #  @return New GEOM.GEOM_Object, containing the created cone.
3286         #
3287         #  @ref tui_creation_cone "Example"
3288         @ManageTransactions("PrimOp")
3289         def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3290             """
3291             Create a cone with given height and radiuses at
3292             the origin of coordinate system. Axis of the cone will
3293             be collinear to the OZ axis of the coordinate system.
3294
3295             Parameters:
3296                 theR1 Radius of the first cone base.
3297                 theR2 Radius of the second cone base.
3298                 theH Cone height.
3299                 theName Object name; when specified, this parameter is used
3300                         for result publication in the study. Otherwise, if automatic
3301                         publication is switched on, default value is used for result name.
3302
3303             Note:
3304                 If both radiuses are non-zero, the cone will be truncated.
3305                 If the radiuses are equal, a cylinder will be created instead.
3306
3307             Returns:
3308                 New GEOM.GEOM_Object, containing the created cone.
3309             """
3310             # Example: see GEOM_TestAll.py
3311             theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3312             anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3313             RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3314             anObj.SetParameters(Parameters)
3315             self._autoPublish(anObj, theName, "cone")
3316             return anObj
3317
3318         ## Create a torus with given center, normal vector and radiuses.
3319         #  @param thePnt Torus central point.
3320         #  @param theVec Torus axis of symmetry.
3321         #  @param theRMajor Torus major radius.
3322         #  @param theRMinor Torus minor radius.
3323         #  @param theName Object name; when specified, this parameter is used
3324         #         for result publication in the study. Otherwise, if automatic
3325         #         publication is switched on, default value is used for result name.
3326         #
3327         #  @return New GEOM.GEOM_Object, containing the created torus.
3328         #
3329         #  @ref tui_creation_torus "Example"
3330         @ManageTransactions("PrimOp")
3331         def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3332             """
3333             Create a torus with given center, normal vector and radiuses.
3334
3335             Parameters:
3336                 thePnt Torus central point.
3337                 theVec Torus axis of symmetry.
3338                 theRMajor Torus major radius.
3339                 theRMinor Torus minor radius.
3340                 theName Object name; when specified, this parameter is used
3341                         for result publication in the study. Otherwise, if automatic
3342                         publication is switched on, default value is used for result name.
3343
3344            Returns:
3345                 New GEOM.GEOM_Object, containing the created torus.
3346             """
3347             # Example: see GEOM_TestAll.py
3348             theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3349             anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3350             RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3351             anObj.SetParameters(Parameters)
3352             self._autoPublish(anObj, theName, "torus")
3353             return anObj
3354
3355         ## Create a torus with given radiuses at the origin of coordinate system.
3356         #  @param theRMajor Torus major radius.
3357         #  @param theRMinor Torus minor radius.
3358         #  @param theName Object name; when specified, this parameter is used
3359         #         for result publication in the study. Otherwise, if automatic
3360         #         publication is switched on, default value is used for result name.
3361         #
3362         #  @return New GEOM.GEOM_Object, containing the created torus.
3363         #
3364         #  @ref tui_creation_torus "Example"
3365         @ManageTransactions("PrimOp")
3366         def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3367             """
3368            Create a torus with given radiuses at the origin of coordinate system.
3369
3370            Parameters:
3371                 theRMajor Torus major radius.
3372                 theRMinor Torus minor radius.
3373                 theName Object name; when specified, this parameter is used
3374                         for result publication in the study. Otherwise, if automatic
3375                         publication is switched on, default value is used for result name.
3376
3377            Returns:
3378                 New GEOM.GEOM_Object, containing the created torus.
3379             """
3380             # Example: see GEOM_TestAll.py
3381             theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3382             anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3383             RaiseIfFailed("MakeTorusRR", self.PrimOp)
3384             anObj.SetParameters(Parameters)
3385             self._autoPublish(anObj, theName, "torus")
3386             return anObj
3387
3388         # end of l3_3d_primitives
3389         ## @}
3390
3391         ## @addtogroup l3_complex
3392         ## @{
3393
3394         ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3395         #  @param theBase Base shape to be extruded.
3396         #  @param thePoint1 First end of extrusion vector.
3397         #  @param thePoint2 Second end of extrusion vector.
3398         #  @param theScaleFactor Use it to make prism with scaled second base.
3399         #                        Nagative value means not scaled second base.
3400         #  @param theName Object name; when specified, this parameter is used
3401         #         for result publication in the study. Otherwise, if automatic
3402         #         publication is switched on, default value is used for result name.
3403         #
3404         #  @return New GEOM.GEOM_Object, containing the created prism.
3405         #
3406         #  @ref tui_creation_prism "Example"
3407         @ManageTransactions("PrimOp")
3408         def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3409             """
3410             Create a shape by extrusion of the base shape along a vector, defined by two points.
3411
3412             Parameters:
3413                 theBase Base shape to be extruded.
3414                 thePoint1 First end of extrusion vector.
3415                 thePoint2 Second end of extrusion vector.
3416                 theScaleFactor Use it to make prism with scaled second base.
3417                                Nagative value means not scaled second base.
3418                 theName Object name; when specified, this parameter is used
3419                         for result publication in the study. Otherwise, if automatic
3420                         publication is switched on, default value is used for result name.
3421
3422             Returns:
3423                 New GEOM.GEOM_Object, containing the created prism.
3424             """
3425             # Example: see GEOM_TestAll.py
3426             anObj = None
3427             Parameters = ""
3428             if theScaleFactor > 0:
3429                 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3430                 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3431             else:
3432                 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3433             RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3434             anObj.SetParameters(Parameters)
3435             self._autoPublish(anObj, theName, "prism")
3436             return anObj
3437
3438         ## Create a shape by extrusion of the base shape along a
3439         #  vector, defined by two points, in 2 Ways (forward/backward).
3440         #  @param theBase Base shape to be extruded.
3441         #  @param thePoint1 First end of extrusion vector.
3442         #  @param thePoint2 Second end of extrusion vector.
3443         #  @param theName Object name; when specified, this parameter is used
3444         #         for result publication in the study. Otherwise, if automatic
3445         #         publication is switched on, default value is used for result name.
3446         #
3447         #  @return New GEOM.GEOM_Object, containing the created prism.
3448         #
3449         #  @ref tui_creation_prism "Example"
3450         @ManageTransactions("PrimOp")
3451         def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3452             """
3453             Create a shape by extrusion of the base shape along a
3454             vector, defined by two points, in 2 Ways (forward/backward).
3455
3456             Parameters:
3457                 theBase Base shape to be extruded.
3458                 thePoint1 First end of extrusion vector.
3459                 thePoint2 Second end of extrusion vector.
3460                 theName Object name; when specified, this parameter is used
3461                         for result publication in the study. Otherwise, if automatic
3462                         publication is switched on, default value is used for result name.
3463
3464             Returns:
3465                 New GEOM.GEOM_Object, containing the created prism.
3466             """
3467             # Example: see GEOM_TestAll.py
3468             anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3469             RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3470             self._autoPublish(anObj, theName, "prism")
3471             return anObj
3472
3473         ## Create a shape by extrusion of the base shape along the vector,
3474         #  i.e. all the space, transfixed by the base shape during its translation
3475         #  along the vector on the given distance.
3476         #  @param theBase Base shape to be extruded.
3477         #  @param theVec Direction of extrusion.
3478         #  @param theH Prism dimension along theVec.
3479         #  @param theScaleFactor Use it to make prism with scaled second base.
3480         #                        Negative value means not scaled second base.
3481         #  @param theName Object name; when specified, this parameter is used
3482         #         for result publication in the study. Otherwise, if automatic
3483         #         publication is switched on, default value is used for result name.
3484         #
3485         #  @return New GEOM.GEOM_Object, containing the created prism.
3486         #
3487         #  @ref tui_creation_prism "Example"
3488         @ManageTransactions("PrimOp")
3489         def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3490             """
3491             Create a shape by extrusion of the base shape along the vector,
3492             i.e. all the space, transfixed by the base shape during its translation
3493             along the vector on the given distance.
3494
3495             Parameters:
3496                 theBase Base shape to be extruded.
3497                 theVec Direction of extrusion.
3498                 theH Prism dimension along theVec.
3499                 theScaleFactor Use it to make prism with scaled second base.
3500                                Negative value means not scaled second base.
3501                 theName Object name; when specified, this parameter is used
3502                         for result publication in the study. Otherwise, if automatic
3503                         publication is switched on, default value is used for result name.
3504
3505             Returns:
3506                 New GEOM.GEOM_Object, containing the created prism.
3507             """
3508             # Example: see GEOM_TestAll.py
3509             anObj = None
3510             Parameters = ""
3511             if theScaleFactor > 0:
3512                 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3513                 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3514             else:
3515                 theH,Parameters = ParseParameters(theH)
3516                 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3517             RaiseIfFailed("MakePrismVecH", self.PrimOp)
3518             anObj.SetParameters(Parameters)
3519             self._autoPublish(anObj, theName, "prism")
3520             return anObj
3521
3522         ## Create a shape by extrusion of the base shape along the vector,
3523         #  i.e. all the space, transfixed by the base shape during its translation
3524         #  along the vector on the given distance in 2 Ways (forward/backward).
3525         #  @param theBase Base shape to be extruded.
3526         #  @param theVec Direction of extrusion.
3527         #  @param theH Prism dimension along theVec in forward direction.
3528         #  @param theName Object name; when specified, this parameter is used
3529         #         for result publication in the study. Otherwise, if automatic
3530         #         publication is switched on, default value is used for result name.
3531         #
3532         #  @return New GEOM.GEOM_Object, containing the created prism.
3533         #
3534         #  @ref tui_creation_prism "Example"
3535         @ManageTransactions("PrimOp")
3536         def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3537             """
3538             Create a shape by extrusion of the base shape along the vector,
3539             i.e. all the space, transfixed by the base shape during its translation
3540             along the vector on the given distance in 2 Ways (forward/backward).
3541
3542             Parameters:
3543                 theBase Base shape to be extruded.
3544                 theVec Direction of extrusion.
3545                 theH Prism dimension along theVec in forward direction.
3546                 theName Object name; when specified, this parameter is used
3547                         for result publication in the study. Otherwise, if automatic
3548                         publication is switched on, default value is used for result name.
3549
3550             Returns:
3551                 New GEOM.GEOM_Object, containing the created prism.
3552             """
3553             # Example: see GEOM_TestAll.py
3554             theH,Parameters = ParseParameters(theH)
3555             anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3556             RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3557             anObj.SetParameters(Parameters)
3558             self._autoPublish(anObj, theName, "prism")
3559             return anObj
3560
3561         ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3562         #  @param theBase Base shape to be extruded.
3563         #  @param theDX, theDY, theDZ Directions of extrusion.
3564         #  @param theScaleFactor Use it to make prism with scaled second base.
3565         #                        Nagative value means not scaled second base.
3566         #  @param theName Object name; when specified, this parameter is used
3567         #         for result publication in the study. Otherwise, if automatic
3568         #         publication is switched on, default value is used for result name.
3569         #
3570         #  @return New GEOM.GEOM_Object, containing the created prism.
3571         #
3572         #  @ref tui_creation_prism "Example"
3573         @ManageTransactions("PrimOp")
3574         def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3575             """
3576             Create a shape by extrusion of the base shape along the dx, dy, dz direction
3577
3578             Parameters:
3579                 theBase Base shape to be extruded.
3580                 theDX, theDY, theDZ Directions of extrusion.
3581                 theScaleFactor Use it to make prism with scaled second base.
3582                                Nagative value means not scaled second base.
3583                 theName Object name; when specified, this parameter is used
3584                         for result publication in the study. Otherwise, if automatic
3585                         publication is switched on, default value is used for result name.
3586
3587             Returns:
3588                 New GEOM.GEOM_Object, containing the created prism.
3589             """
3590             # Example: see GEOM_TestAll.py
3591             anObj = None
3592             Parameters = ""
3593             if theScaleFactor > 0:
3594                 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3595                 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3596             else:
3597                 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3598                 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3599             RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3600             anObj.SetParameters(Parameters)
3601             self._autoPublish(anObj, theName, "prism")
3602             return anObj
3603
3604         ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3605         #  i.e. all the space, transfixed by the base shape during its translation
3606         #  along the vector on the given distance in 2 Ways (forward/backward).
3607         #  @param theBase Base shape to be extruded.
3608         #  @param theDX, theDY, theDZ Directions of extrusion.
3609         #  @param theName Object name; when specified, this parameter is used
3610         #         for result publication in the study. Otherwise, if automatic
3611         #         publication is switched on, default value is used for result name.
3612         #
3613         #  @return New GEOM.GEOM_Object, containing the created prism.
3614         #
3615         #  @ref tui_creation_prism "Example"
3616         @ManageTransactions("PrimOp")
3617         def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3618             """
3619             Create a shape by extrusion of the base shape along the dx, dy, dz direction
3620             i.e. all the space, transfixed by the base shape during its translation
3621             along the vector on the given distance in 2 Ways (forward/backward).
3622
3623             Parameters:
3624                 theBase Base shape to be extruded.
3625                 theDX, theDY, theDZ Directions of extrusion.
3626                 theName Object name; when specified, this parameter is used
3627                         for result publication in the study. Otherwise, if automatic
3628                         publication is switched on, default value is used for result name.
3629
3630             Returns:
3631                 New GEOM.GEOM_Object, containing the created prism.
3632             """
3633             # Example: see GEOM_TestAll.py
3634             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3635             anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3636             RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3637             anObj.SetParameters(Parameters)
3638             self._autoPublish(anObj, theName, "prism")
3639             return anObj
3640
3641         ## Create a shape by revolution of the base shape around the axis
3642         #  on the given angle, i.e. all the space, transfixed by the base
3643         #  shape during its rotation around the axis on the given angle.
3644         #  @param theBase Base shape to be rotated.
3645         #  @param theAxis Rotation axis.
3646         #  @param theAngle Rotation angle in radians.
3647         #  @param theName Object name; when specified, this parameter is used
3648         #         for result publication in the study. Otherwise, if automatic
3649         #         publication is switched on, default value is used for result name.
3650         #
3651         #  @return New GEOM.GEOM_Object, containing the created revolution.
3652         #
3653         #  @ref tui_creation_revolution "Example"
3654         @ManageTransactions("PrimOp")
3655         def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3656             """
3657             Create a shape by revolution of the base shape around the axis
3658             on the given angle, i.e. all the space, transfixed by the base
3659             shape during its rotation around the axis on the given angle.
3660
3661             Parameters:
3662                 theBase Base shape to be rotated.
3663                 theAxis Rotation axis.
3664                 theAngle Rotation angle in radians.
3665                 theName Object name; when specified, this parameter is used
3666                         for result publication in the study. Otherwise, if automatic
3667                         publication is switched on, default value is used for result name.
3668
3669             Returns:
3670                 New GEOM.GEOM_Object, containing the created revolution.
3671             """
3672             # Example: see GEOM_TestAll.py
3673             theAngle,Parameters = ParseParameters(theAngle)
3674             anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3675             RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3676             anObj.SetParameters(Parameters)
3677             self._autoPublish(anObj, theName, "revolution")
3678             return anObj
3679
3680         ## Create a shape by revolution of the base shape around the axis
3681         #  on the given angle, i.e. all the space, transfixed by the base
3682         #  shape during its rotation around the axis on the given angle in
3683         #  both directions (forward/backward)
3684         #  @param theBase Base shape to be rotated.
3685         #  @param theAxis Rotation axis.
3686         #  @param theAngle Rotation angle in radians.
3687         #  @param theName Object name; when specified, this parameter is used
3688         #         for result publication in the study. Otherwise, if automatic
3689         #         publication is switched on, default value is used for result name.
3690         #
3691         #  @return New GEOM.GEOM_Object, containing the created revolution.
3692         #
3693         #  @ref tui_creation_revolution "Example"
3694         @ManageTransactions("PrimOp")
3695         def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3696             """
3697             Create a shape by revolution of the base shape around the axis
3698             on the given angle, i.e. all the space, transfixed by the base
3699             shape during its rotation around the axis on the given angle in
3700             both directions (forward/backward).
3701
3702             Parameters:
3703                 theBase Base shape to be rotated.
3704                 theAxis Rotation axis.
3705                 theAngle Rotation angle in radians.
3706                 theName Object name; when specified, this parameter is used
3707                         for result publication in the study. Otherwise, if automatic
3708                         publication is switched on, default value is used for result name.
3709
3710             Returns:
3711                 New GEOM.GEOM_Object, containing the created revolution.
3712             """
3713             theAngle,Parameters = ParseParameters(theAngle)
3714             anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3715             RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3716             anObj.SetParameters(Parameters)
3717             self._autoPublish(anObj, theName, "revolution")
3718             return anObj
3719
3720         ## Create a filling from the given compound of contours.
3721         #  @param theShape the compound of contours
3722         #  @param theMinDeg a minimal degree of BSpline surface to create
3723         #  @param theMaxDeg a maximal degree of BSpline surface to create
3724         #  @param theTol2D a 2d tolerance to be reached
3725         #  @param theTol3D a 3d tolerance to be reached
3726         #  @param theNbIter a number of iteration of approximation algorithm
3727         #  @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3728         #  @param isApprox if True, BSpline curves are generated in the process
3729         #                  of surface construction. By default it is False, that means
3730         #                  the surface is created using given curves. The usage of
3731         #                  Approximation makes the algorithm work slower, but allows
3732         #                  building the surface for rather complex cases.
3733         #  @param theName Object name; when specified, this parameter is used
3734         #         for result publication in the study. Otherwise, if automatic
3735         #         publication is switched on, default value is used for result name.
3736         #
3737         #  @return New GEOM.GEOM_Object, containing the created filling surface.
3738         #
3739         #  @ref tui_creation_filling "Example"
3740         @ManageTransactions("PrimOp")
3741         def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3742                         theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3743             """
3744             Create a filling from the given compound of contours.
3745
3746             Parameters:
3747                 theShape the compound of contours
3748                 theMinDeg a minimal degree of BSpline surface to create
3749                 theMaxDeg a maximal degree of BSpline surface to create
3750                 theTol2D a 2d tolerance to be reached
3751                 theTol3D a 3d tolerance to be reached
3752                 theNbIter a number of iteration of approximation algorithm
3753                 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3754                 isApprox if True, BSpline curves are generated in the process
3755                          of surface construction. By default it is False, that means
3756                          the surface is created using given curves. The usage of
3757                          Approximation makes the algorithm work slower, but allows
3758                          building the surface for rather complex cases
3759                 theName Object name; when specified, this parameter is used
3760                         for result publication in the study. Otherwise, if automatic
3761                         publication is switched on, default value is used for result name.
3762
3763             Returns:
3764                 New GEOM.GEOM_Object, containing the created filling surface.
3765
3766             Example of usage:
3767                 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3768             """
3769             # Example: see GEOM_TestAll.py
3770             theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3771             anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3772                                             theTol2D, theTol3D, theNbIter,
3773                                             theMethod, isApprox)
3774             RaiseIfFailed("MakeFilling", self.PrimOp)
3775             anObj.SetParameters(Parameters)
3776             self._autoPublish(anObj, theName, "filling")
3777             return anObj
3778
3779
3780         ## Create a filling from the given compound of contours.
3781         #  This method corresponds to MakeFilling with isApprox=True
3782         #  @param theShape the compound of contours
3783         #  @param theMinDeg a minimal degree of BSpline surface to create
3784         #  @param theMaxDeg a maximal degree of BSpline surface to create
3785         #  @param theTol3D a 3d tolerance to be reached
3786         #  @param theName Object name; when specified, this parameter is used
3787         #         for result publication in the study. Otherwise, if automatic
3788         #         publication is switched on, default value is used for result name.
3789         #
3790         #  @return New GEOM.GEOM_Object, containing the created filling surface.
3791         #
3792         #  @ref tui_creation_filling "Example"
3793         @ManageTransactions("PrimOp")
3794         def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3795             """
3796             Create a filling from the given compound of contours.
3797             This method corresponds to MakeFilling with isApprox=True
3798
3799             Parameters:
3800                 theShape the compound of contours
3801                 theMinDeg a minimal degree of BSpline surface to create
3802                 theMaxDeg a maximal degree of BSpline surface to create
3803                 theTol3D a 3d tolerance to be reached
3804                 theName Object name; when specified, this parameter is used
3805                         for result publication in the study. Otherwise, if automatic
3806                         publication is switched on, default value is used for result name.
3807
3808             Returns:
3809                 New GEOM.GEOM_Object, containing the created filling surface.
3810
3811             Example of usage:
3812                 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3813             """
3814             # Example: see GEOM_TestAll.py
3815             theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3816             anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3817                                             0, theTol3D, 0, GEOM.FOM_Default, True)
3818             RaiseIfFailed("MakeFillingNew", self.PrimOp)
3819             anObj.SetParameters(Parameters)
3820             self._autoPublish(anObj, theName, "filling")
3821             return anObj
3822
3823         ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3824         #  @param theSeqSections - set of specified sections.
3825         #  @param theModeSolid - mode defining building solid or shell
3826         #  @param thePreci - precision 3D used for smoothing
3827         #  @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3828         #  @param theName Object name; when specified, this parameter is used
3829         #         for result publication in the study. Otherwise, if automatic
3830         #         publication is switched on, default value is used for result name.
3831         #
3832         #  @return New GEOM.GEOM_Object, containing the created shell or solid.
3833         #
3834         #  @ref swig_todo "Example"
3835         @ManageTransactions("PrimOp")
3836         def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3837             """
3838             Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3839
3840             Parameters:
3841                 theSeqSections - set of specified sections.
3842                 theModeSolid - mode defining building solid or shell
3843                 thePreci - precision 3D used for smoothing
3844                 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3845                 theName Object name; when specified, this parameter is used
3846                         for result publication in the study. Otherwise, if automatic
3847                         publication is switched on, default value is used for result name.
3848
3849             Returns:
3850                 New GEOM.GEOM_Object, containing the created shell or solid.
3851             """
3852             # Example: see GEOM_TestAll.py
3853             anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3854             RaiseIfFailed("MakeThruSections", self.PrimOp)
3855             self._autoPublish(anObj, theName, "filling")
3856             return anObj
3857
3858         ## Create a shape by extrusion of the base shape along
3859         #  the path shape. The path shape can be a wire or an edge.
3860         #  @param theBase Base shape to be extruded.
3861         #  @param thePath Path shape to extrude the base shape along it.
3862         #  @param theName Object name; when specified, this parameter is used
3863         #         for result publication in the study. Otherwise, if automatic
3864         #         publication is switched on, default value is used for result name.
3865         #
3866         #  @return New GEOM.GEOM_Object, containing the created pipe.
3867         #
3868         #  @ref tui_creation_pipe "Example"
3869         @ManageTransactions("PrimOp")
3870         def MakePipe(self, theBase, thePath, theName=None):
3871             """
3872             Create a shape by extrusion of the base shape along
3873             the path shape. The path shape can be a wire or an edge.
3874
3875             Parameters:
3876                 theBase Base shape to be extruded.
3877                 thePath Path shape to extrude the base shape along it.
3878                 theName Object name; when specified, this parameter is used
3879                         for result publication in the study. Otherwise, if automatic
3880                         publication is switched on, default value is used for result name.
3881
3882             Returns:
3883                 New GEOM.GEOM_Object, containing the created pipe.
3884             """
3885             # Example: see GEOM_TestAll.py
3886             anObj = self.PrimOp.MakePipe(theBase, thePath)
3887             RaiseIfFailed("MakePipe", self.PrimOp)
3888             self._autoPublish(anObj, theName, "pipe")
3889             return anObj
3890
3891         ## Create a shape by extrusion of the profile shape along
3892         #  the path shape. The path shape can be a wire or an edge.
3893         #  the several profiles can be specified in the several locations of path.
3894         #  @param theSeqBases - list of  Bases shape to be extruded.
3895         #  @param theLocations - list of locations on the path corresponding
3896         #                        specified list of the Bases shapes. Number of locations
3897         #                        should be equal to number of bases or list of locations can be empty.
3898         #  @param thePath - Path shape to extrude the base shape along it.
3899         #  @param theWithContact - the mode defining that the section is translated to be in
3900         #                          contact with the spine.
3901         #  @param theWithCorrection - defining that the section is rotated to be
3902         #                             orthogonal to the spine tangent in the correspondent point
3903         #  @param theName Object name; when specified, this parameter is used
3904         #         for result publication in the study. Otherwise, if automatic
3905         #         publication is switched on, default value is used for result name.
3906         #
3907         #  @return New GEOM.GEOM_Object, containing the created pipe.
3908         #
3909         #  @ref tui_creation_pipe_with_diff_sec "Example"
3910         @ManageTransactions("PrimOp")
3911         def MakePipeWithDifferentSections(self, theSeqBases,
3912                                           theLocations, thePath,
3913                                           theWithContact, theWithCorrection, theName=None):
3914             """
3915             Create a shape by extrusion of the profile shape along
3916             the path shape. The path shape can be a wire or an edge.
3917             the several profiles can be specified in the several locations of path.
3918
3919             Parameters:
3920                 theSeqBases - list of  Bases shape to be extruded.
3921                 theLocations - list of locations on the path corresponding
3922                                specified list of the Bases shapes. Number of locations
3923                                should be equal to number of bases or list of locations can be empty.
3924                 thePath - Path shape to extrude the base shape along it.
3925                 theWithContact - the mode defining that the section is translated to be in
3926                                  contact with the spine(0/1)
3927                 theWithCorrection - defining that the section is rotated to be
3928                                     orthogonal to the spine tangent in the correspondent point (0/1)
3929                 theName Object name; when specified, this parameter is used
3930                         for result publication in the study. Otherwise, if automatic
3931                         publication is switched on, default value is used for result name.
3932
3933             Returns:
3934                 New GEOM.GEOM_Object, containing the created pipe.
3935             """
3936             anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3937                                                               theLocations, thePath,
3938                                                               theWithContact, theWithCorrection)
3939             RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3940             self._autoPublish(anObj, theName, "pipe")
3941             return anObj
3942
3943         ## Create a shape by extrusion of the profile shape along
3944         #  the path shape. The path shape can be a wire or a edge.
3945         #  the several profiles can be specified in the several locations of path.
3946         #  @param theSeqBases - list of  Bases shape to be extruded. Base shape must be
3947         #                       shell or face. If number of faces in neighbour sections
3948         #                       aren't coincided result solid between such sections will
3949         #                       be created using external boundaries of this shells.
3950         #  @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3951         #                          This list is used for searching correspondences between
3952         #                          faces in the sections. Size of this list must be equal
3953         #                          to size of list of base shapes.
3954         #  @param theLocations - list of locations on the path corresponding
3955         #                        specified list of the Bases shapes. Number of locations
3956         #                        should be equal to number of bases. First and last
3957         #                        locations must be coincided with first and last vertexes
3958         #                        of path correspondingly.
3959         #  @param thePath - Path shape to extrude the base shape along it.
3960         #  @param theWithContact - the mode defining that the section is translated to be in
3961         #                          contact with the spine.
3962         #  @param theWithCorrection - defining that the section is rotated to be
3963         #                             orthogonal to the spine tangent in the correspondent point
3964         #  @param theName Object name; when specified, this parameter is used
3965         #         for result publication in the study. Otherwise, if automatic
3966         #         publication is switched on, default value is used for result name.
3967         #
3968         #  @return New GEOM.GEOM_Object, containing the created solids.
3969         #
3970         #  @ref tui_creation_pipe_with_shell_sec "Example"
3971         @ManageTransactions("PrimOp")
3972         def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3973                                       theLocations, thePath,
3974                                       theWithContact, theWithCorrection, theName=None):
3975             """
3976             Create a shape by extrusion of the profile shape along
3977             the path shape. The path shape can be a wire or a edge.
3978             the several profiles can be specified in the several locations of path.
3979
3980             Parameters:
3981                 theSeqBases - list of  Bases shape to be extruded. Base shape must be
3982                               shell or face. If number of faces in neighbour sections
3983                               aren't coincided result solid between such sections will
3984                               be created using external boundaries of this shells.
3985                 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3986                                  This list is used for searching correspondences between
3987                                  faces in the sections. Size of this list must be equal
3988                                  to size of list of base shapes.
3989                 theLocations - list of locations on the path corresponding
3990                                specified list of the Bases shapes. Number of locations
3991                                should be equal to number of bases. First and last
3992                                locations must be coincided with first and last vertexes
3993                                of path correspondingly.
3994                 thePath - Path shape to extrude the base shape along it.
3995                 theWithContact - the mode defining that the section is translated to be in
3996                                  contact with the spine (0/1)
3997                 theWithCorrection - defining that the section is rotated to be
3998                                     orthogonal to the spine tangent in the correspondent point (0/1)
3999                 theName Object name; when specified, this parameter is used
4000                         for result publication in the study. Otherwise, if automatic
4001                         publication is switched on, default value is used for result name.
4002
4003             Returns:
4004                 New GEOM.GEOM_Object, containing the created solids.
4005             """
4006             anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4007                                                           theLocations, thePath,
4008                                                           theWithContact, theWithCorrection)
4009             RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4010             self._autoPublish(anObj, theName, "pipe")
4011             return anObj
4012
4013         ## Create a shape by extrusion of the profile shape along
4014         #  the path shape. This function is used only for debug pipe
4015         #  functionality - it is a version of function MakePipeWithShellSections()
4016         #  which give a possibility to recieve information about
4017         #  creating pipe between each pair of sections step by step.
4018         @ManageTransactions("PrimOp")
4019         def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4020                                              theLocations, thePath,
4021                                              theWithContact, theWithCorrection, theName=None):
4022             """
4023             Create a shape by extrusion of the profile shape along
4024             the path shape. This function is used only for debug pipe
4025             functionality - it is a version of previous function
4026             geompy.MakePipeWithShellSections() which give a possibility to
4027             recieve information about creating pipe between each pair of
4028             sections step by step.
4029             """
4030             res = []
4031             nbsect = len(theSeqBases)
4032             nbsubsect = len(theSeqSubBases)
4033             #print "nbsect = ",nbsect
4034             for i in range(1,nbsect):
4035                 #print "  i = ",i
4036                 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4037                 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4038                 tmpSeqSubBases = []
4039                 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4040                 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4041                                                               tmpLocations, thePath,
4042                                                               theWithContact, theWithCorrection)
4043                 if self.PrimOp.IsDone() == 0:
4044                     print "Problems with pipe creation between ",i," and ",i+1," sections"
4045                     RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4046                     break
4047                 else:
4048                     print "Pipe between ",i," and ",i+1," sections is OK"
4049                     res.append(anObj)
4050                     pass
4051                 pass
4052
4053             resc = self.MakeCompound(res)
4054             #resc = self.MakeSewing(res, 0.001)
4055             #print "resc: ",resc
4056             self._autoPublish(resc, theName, "pipe")
4057             return resc
4058
4059         ## Create solids between given sections
4060         #  @param theSeqBases - list of sections (shell or face).
4061         #  @param theLocations - list of corresponding vertexes
4062         #  @param theName Object name; when specified, this parameter is used
4063         #         for result publication in the study. Otherwise, if automatic
4064         #         publication is switched on, default value is used for result name.
4065         #
4066         #  @return New GEOM.GEOM_Object, containing the created solids.
4067         #
4068         #  @ref tui_creation_pipe_without_path "Example"
4069         @ManageTransactions("PrimOp")
4070         def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
4071             """
4072             Create solids between given sections
4073
4074             Parameters:
4075                 theSeqBases - list of sections (shell or face).
4076                 theLocations - list of corresponding vertexes
4077                 theName Object name; when specified, this parameter is used
4078                         for result publication in the study. Otherwise, if automatic
4079                         publication is switched on, default value is used for result name.
4080
4081             Returns:
4082                 New GEOM.GEOM_Object, containing the created solids.
4083             """
4084             anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
4085             RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4086             self._autoPublish(anObj, theName, "pipe")
4087             return anObj
4088
4089         ## Create a shape by extrusion of the base shape along
4090         #  the path shape with constant bi-normal direction along the given vector.
4091         #  The path shape can be a wire or an edge.
4092         #  @param theBase Base shape to be extruded.
4093         #  @param thePath Path shape to extrude the base shape along it.
4094         #  @param theVec Vector defines a constant binormal direction to keep the
4095         #                same angle beetween the direction and the sections
4096         #                along the sweep surface.
4097         #  @param theName Object name; when specified, this parameter is used
4098         #         for result publication in the study. Otherwise, if automatic
4099         #         publication is switched on, default value is used for result name.
4100         #
4101         #  @return New GEOM.GEOM_Object, containing the created pipe.
4102         #
4103         #  @ref tui_creation_pipe "Example"
4104         @ManageTransactions("PrimOp")
4105         def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
4106             """
4107             Create a shape by extrusion of the base shape along
4108             the path shape with constant bi-normal direction along the given vector.
4109             The path shape can be a wire or an edge.
4110
4111             Parameters:
4112                 theBase Base shape to be extruded.
4113                 thePath Path shape to extrude the base shape along it.
4114                 theVec Vector defines a constant binormal direction to keep the
4115                        same angle beetween the direction and the sections
4116                        along the sweep surface.
4117                 theName Object name; when specified, this parameter is used
4118                         for result publication in the study. Otherwise, if automatic
4119                         publication is switched on, default value is used for result name.
4120
4121             Returns:
4122                 New GEOM.GEOM_Object, containing the created pipe.
4123             """
4124             # Example: see GEOM_TestAll.py
4125             anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
4126             RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4127             self._autoPublish(anObj, theName, "pipe")
4128             return anObj
4129
4130         ## Makes a thick solid from a face or a shell
4131         #  @param theShape Face or Shell to be thicken
4132         #  @param theThickness Thickness of the resulting solid
4133         #  @param theName Object name; when specified, this parameter is used
4134         #         for result publication in the study. Otherwise, if automatic
4135         #         publication is switched on, default value is used for result name.
4136         #
4137         #  @return New GEOM.GEOM_Object, containing the created solid
4138         #
4139         @ManageTransactions("PrimOp")
4140         def MakeThickSolid(self, theShape, theThickness, theName=None):
4141             """
4142             Make a thick solid from a face or a shell
4143
4144             Parameters:
4145                  theShape Face or Shell to be thicken
4146                  theThickness Thickness of the resulting solid
4147                  theName Object name; when specified, this parameter is used
4148                  for result publication in the study. Otherwise, if automatic
4149                  publication is switched on, default value is used for result name.
4150
4151             Returns:
4152                 New GEOM.GEOM_Object, containing the created solid
4153             """
4154             # Example: see GEOM_TestAll.py
4155             anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
4156             RaiseIfFailed("MakeThickening", self.PrimOp)
4157             self._autoPublish(anObj, theName, "pipe")
4158             return anObj
4159
4160
4161         ## Modifies a face or a shell to make it a thick solid
4162         #  @param theShape Face or Shell to be thicken
4163         #  @param theThickness Thickness of the resulting solid
4164         #
4165         #  @return The modified shape
4166         #
4167         @ManageTransactions("PrimOp")
4168         def Thicken(self, theShape, theThickness):
4169             """
4170             Modifies a face or a shell to make it a thick solid
4171
4172             Parameters:
4173                 theBase Base shape to be extruded.
4174                 thePath Path shape to extrude the base shape along it.
4175                 theName Object name; when specified, this parameter is used
4176                         for result publication in the study. Otherwise, if automatic
4177                         publication is switched on, default value is used for result name.
4178
4179             Returns:
4180                 The modified shape
4181             """
4182             # Example: see GEOM_TestAll.py
4183             anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
4184             RaiseIfFailed("MakeThickening", self.PrimOp)
4185             return anObj
4186
4187         ## Build a middle path of a pipe-like shape.
4188         #  The path shape can be a wire or an edge.
4189         #  @param theShape It can be closed or unclosed pipe-like shell
4190         #                  or a pipe-like solid.
4191         #  @param theBase1, theBase2 Two bases of the supposed pipe. This
4192         #                            should be wires or faces of theShape.
4193         #  @param theName Object name; when specified, this parameter is used
4194         #         for result publication in the study. Otherwise, if automatic
4195         #         publication is switched on, default value is used for result name.
4196         #
4197         #  @note It is not assumed that exact or approximate copy of theShape
4198         #        can be obtained by applying existing Pipe operation on the
4199         #        resulting "Path" wire taking theBase1 as the base - it is not
4200         #        always possible; though in some particular cases it might work
4201         #        it is not guaranteed. Thus, RestorePath function should not be
4202         #        considered as an exact reverse operation of the Pipe.
4203         #
4204         #  @return New GEOM.GEOM_Object, containing an edge or wire that represent
4205         #                                source pipe's "path".
4206         #
4207         #  @ref tui_creation_pipe_path "Example"
4208         @ManageTransactions("PrimOp")
4209         def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4210             """
4211             Build a middle path of a pipe-like shape.
4212             The path shape can be a wire or an edge.
4213
4214             Parameters:
4215                 theShape It can be closed or unclosed pipe-like shell
4216                          or a pipe-like solid.
4217                 theBase1, theBase2 Two bases of the supposed pipe. This
4218                                    should be wires or faces of theShape.
4219                 theName Object name; when specified, this parameter is used
4220                         for result publication in the study. Otherwise, if automatic
4221                         publication is switched on, default value is used for result name.
4222
4223             Returns:
4224                 New GEOM_Object, containing an edge or wire that represent
4225                                  source pipe's path.
4226             """
4227             anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4228             RaiseIfFailed("RestorePath", self.PrimOp)
4229             self._autoPublish(anObj, theName, "path")
4230             return anObj
4231
4232         ## Build a middle path of a pipe-like shape.
4233         #  The path shape can be a wire or an edge.
4234         #  @param theShape It can be closed or unclosed pipe-like shell
4235         #                  or a pipe-like solid.
4236         #  @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4237         #                                should be lists of edges of theShape.
4238         #  @param theName Object name; when specified, this parameter is used
4239         #         for result publication in the study. Otherwise, if automatic
4240         #         publication is switched on, default value is used for result name.
4241         #
4242         #  @note It is not assumed that exact or approximate copy of theShape
4243         #        can be obtained by applying existing Pipe operation on the
4244         #        resulting "Path" wire taking theBase1 as the base - it is not
4245         #        always possible; though in some particular cases it might work
4246         #        it is not guaranteed. Thus, RestorePath function should not be
4247         #        considered as an exact reverse operation of the Pipe.
4248         #
4249         #  @return New GEOM.GEOM_Object, containing an edge or wire that represent
4250         #                                source pipe's "path".
4251         #
4252         #  @ref tui_creation_pipe_path "Example"
4253         @ManageTransactions("PrimOp")
4254         def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4255             """
4256             Build a middle path of a pipe-like shape.
4257             The path shape can be a wire or an edge.
4258
4259             Parameters:
4260                 theShape It can be closed or unclosed pipe-like shell
4261                          or a pipe-like solid.
4262                 listEdges1, listEdges2 Two bases of the supposed pipe. This
4263                                        should be lists of edges of theShape.
4264                 theName Object name; when specified, this parameter is used
4265                         for result publication in the study. Otherwise, if automatic
4266                         publication is switched on, default value is used for result name.
4267
4268             Returns:
4269                 New GEOM_Object, containing an edge or wire that represent
4270                                  source pipe's path.
4271             """
4272             anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4273             RaiseIfFailed("RestorePath", self.PrimOp)
4274             self._autoPublish(anObj, theName, "path")
4275             return anObj
4276
4277         # end of l3_complex
4278         ## @}
4279
4280         ## @addtogroup l3_advanced
4281         ## @{
4282
4283         ## Create a linear edge with specified ends.
4284         #  @param thePnt1 Point for the first end of edge.
4285         #  @param thePnt2 Point for the second end of edge.
4286         #  @param theName Object name; when specified, this parameter is used
4287         #         for result publication in the study. Otherwise, if automatic
4288         #         publication is switched on, default value is used for result name.
4289         #
4290         #  @return New GEOM.GEOM_Object, containing the created edge.
4291         #
4292         #  @ref tui_creation_edge "Example"
4293         @ManageTransactions("ShapesOp")
4294         def MakeEdge(self, thePnt1, thePnt2, theName=None):
4295             """
4296             Create a linear edge with specified ends.
4297
4298             Parameters:
4299                 thePnt1 Point for the first end of edge.
4300                 thePnt2 Point for the second end of edge.
4301                 theName Object name; when specified, this parameter is used
4302                         for result publication in the study. Otherwise, if automatic
4303                         publication is switched on, default value is used for result name.
4304
4305             Returns:
4306                 New GEOM.GEOM_Object, containing the created edge.
4307             """
4308             # Example: see GEOM_TestAll.py
4309             anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4310             RaiseIfFailed("MakeEdge", self.ShapesOp)
4311             self._autoPublish(anObj, theName, "edge")
4312             return anObj
4313
4314         ## Create a new edge, corresponding to the given length on the given curve.
4315         #  @param theRefCurve The referenced curve (edge).
4316         #  @param theLength Length on the referenced curve. It can be negative.
4317         #  @param theStartPoint Any point can be selected for it, the new edge will begin
4318         #                       at the end of \a theRefCurve, close to the selected point.
4319         #                       If None, start from the first point of \a theRefCurve.
4320         #  @param theName Object name; when specified, this parameter is used
4321         #         for result publication in the study. Otherwise, if automatic
4322         #         publication is switched on, default value is used for result name.
4323         #
4324         #  @return New GEOM.GEOM_Object, containing the created edge.
4325         #
4326         #  @ref tui_creation_edge "Example"
4327         @ManageTransactions("ShapesOp")
4328         def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4329             """
4330             Create a new edge, corresponding to the given length on the given curve.
4331
4332             Parameters:
4333                 theRefCurve The referenced curve (edge).
4334                 theLength Length on the referenced curve. It can be negative.
4335                 theStartPoint Any point can be selected for it, the new edge will begin
4336                               at the end of theRefCurve, close to the selected point.
4337                               If None, start from the first point of theRefCurve.
4338                 theName Object name; when specified, this parameter is used
4339                         for result publication in the study. Otherwise, if automatic
4340                         publication is switched on, default value is used for result name.
4341
4342             Returns:
4343                 New GEOM.GEOM_Object, containing the created edge.
4344             """
4345             # Example: see GEOM_TestAll.py
4346             theLength, Parameters = ParseParameters(theLength)
4347             anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4348             RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4349             anObj.SetParameters(Parameters)
4350             self._autoPublish(anObj, theName, "edge")
4351             return anObj
4352
4353         ## Create an edge from specified wire.
4354         #  @param theWire source Wire
4355         #  @param theLinearTolerance linear tolerance value (default = 1e-07)
4356         #  @param theAngularTolerance angular tolerance value (default = 1e-12)
4357         #  @param theName Object name; when specified, this parameter is used
4358         #         for result publication in the study. Otherwise, if automatic
4359         #         publication is switched on, default value is used for result name.
4360         #
4361         #  @return New GEOM.GEOM_Object, containing the created edge.
4362         #
4363         #  @ref tui_creation_edge "Example"
4364         @ManageTransactions("ShapesOp")
4365         def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4366             """
4367             Create an edge from specified wire.
4368
4369             Parameters:
4370                 theWire source Wire
4371                 theLinearTolerance linear tolerance value (default = 1e-07)
4372                 theAngularTolerance angular tolerance value (default = 1e-12)
4373                 theName Object name; when specified, this parameter is used
4374                         for result publication in the study. Otherwise, if automatic
4375                         publication is switched on, default value is used for result name.
4376
4377             Returns:
4378                 New GEOM.GEOM_Object, containing the created edge.
4379             """
4380             # Example: see GEOM_TestAll.py
4381             anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4382             RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4383             self._autoPublish(anObj, theName, "edge")
4384             return anObj
4385
4386         ## Create a wire from the set of edges and wires.
4387         #  @param theEdgesAndWires List of edges and/or wires.
4388         #  @param theTolerance Maximum distance between vertices, that will be merged.
4389         #                      Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4390         #  @param theName Object name; when specified, this parameter is used
4391         #         for result publication in the study. Otherwise, if automatic
4392         #         publication is switched on, default value is used for result name.
4393         #
4394         #  @return New GEOM.GEOM_Object, containing the created wire.
4395         #
4396         #  @ref tui_creation_wire "Example"
4397         @ManageTransactions("ShapesOp")
4398         def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4399             """
4400             Create a wire from the set of edges and wires.
4401
4402             Parameters:
4403                 theEdgesAndWires List of edges and/or wires.
4404                 theTolerance Maximum distance between vertices, that will be merged.
4405                              Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4406                 theName Object name; when specified, this parameter is used
4407                         for result publication in the study. Otherwise, if automatic
4408                         publication is switched on, default value is used for result name.
4409
4410             Returns:
4411                 New GEOM.GEOM_Object, containing the created wire.
4412             """
4413             # Example: see GEOM_TestAll.py
4414             anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4415             RaiseIfFailed("MakeWire", self.ShapesOp)
4416             self._autoPublish(anObj, theName, "wire")
4417             return anObj
4418
4419         ## Create a face on the given wire.
4420         #  @param theWire closed Wire or Edge to build the face on.
4421         #  @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4422         #                        If the tolerance of the obtained planar face is less
4423         #                        than 1e-06, this face will be returned, otherwise the
4424         #                        algorithm tries to build any suitable face on the given
4425         #                        wire and prints a warning message.
4426         #  @param theName Object name; when specified, this parameter is used
4427         #         for result publication in the study. Otherwise, if automatic
4428         #         publication is switched on, default value is used for result name.
4429         #
4430         #  @return New GEOM.GEOM_Object, containing the created face.
4431         #
4432         #  @ref tui_creation_face "Example"
4433         @ManageTransactions("ShapesOp")
4434         def MakeFace(self, theWire, isPlanarWanted, theName=None):
4435             """
4436             Create a face on the given wire.
4437
4438             Parameters:
4439                 theWire closed Wire or Edge to build the face on.
4440                 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4441                                If the tolerance of the obtained planar face is less
4442                                than 1e-06, this face will be returned, otherwise the
4443                                algorithm tries to build any suitable face on the given
4444                                wire and prints a warning message.
4445                 theName Object name; when specified, this parameter is used
4446                         for result publication in the study. Otherwise, if automatic
4447                         publication is switched on, default value is used for result name.
4448
4449             Returns:
4450                 New GEOM.GEOM_Object, containing the created face.
4451             """
4452             # Example: see GEOM_TestAll.py
4453             anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4454             if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4455                 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4456             else:
4457                 RaiseIfFailed("MakeFace", self.ShapesOp)
4458             self._autoPublish(anObj, theName, "face")
4459             return anObj
4460
4461         ## Create a face on the given wires set.
4462         #  @param theWires List of closed wires or edges to build the face on.
4463         #  @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4464         #                        If the tolerance of the obtained planar face is less
4465         #                        than 1e-06, this face will be returned, otherwise the
4466         #                        algorithm tries to build any suitable face on the given
4467         #                        wire and prints a warning message.
4468         #  @param theName Object name; when specified, this parameter is used
4469         #         for result publication in the study. Otherwise, if automatic
4470         #         publication is switched on, default value is used for result name.
4471         #
4472         #  @return New GEOM.GEOM_Object, containing the created face.
4473         #
4474         #  @ref tui_creation_face "Example"
4475         @ManageTransactions("ShapesOp")
4476         def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4477             """
4478             Create a face on the given wires set.
4479
4480             Parameters:
4481                 theWires List of closed wires or edges to build the face on.
4482                 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4483                                If the tolerance of the obtained planar face is less
4484                                than 1e-06, this face will be returned, otherwise the
4485                                algorithm tries to build any suitable face on the given
4486                                wire and prints a warning message.
4487                 theName Object name; when specified, this parameter is used
4488                         for result publication in the study. Otherwise, if automatic
4489                         publication is switched on, default value is used for result name.
4490
4491             Returns:
4492                 New GEOM.GEOM_Object, containing the created face.
4493             """
4494             # Example: see GEOM_TestAll.py
4495             anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4496             if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4497                 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4498             else:
4499                 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4500             self._autoPublish(anObj, theName, "face")
4501             return anObj
4502
4503         ## See MakeFaceWires() method for details.
4504         #
4505         #  @ref tui_creation_face "Example 1"
4506         #  \n @ref swig_MakeFaces  "Example 2"
4507         def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4508             """
4509             See geompy.MakeFaceWires() method for details.
4510             """
4511             # Example: see GEOM_TestOthers.py
4512             # note: auto-publishing is done in self.MakeFaceWires()
4513             anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4514             return anObj
4515
4516         ## Create a shell from the set of faces and shells.
4517         #  @param theFacesAndShells List of faces and/or shells.
4518         #  @param theName Object name; when specified, this parameter is used
4519         #         for result publication in the study. Otherwise, if automatic
4520         #         publication is switched on, default value is used for result name.
4521         #
4522         #  @return New GEOM.GEOM_Object, containing the created shell.
4523         #
4524         #  @ref tui_creation_shell "Example"
4525         @ManageTransactions("ShapesOp")
4526         def MakeShell(self, theFacesAndShells, theName=None):
4527             """
4528             Create a shell from the set of faces and shells.
4529
4530             Parameters:
4531                 theFacesAndShells List of faces and/or shells.
4532                 theName Object name; when specified, this parameter is used
4533                         for result publication in the study. Otherwise, if automatic
4534                         publication is switched on, default value is used for result name.
4535
4536             Returns:
4537                 New GEOM.GEOM_Object, containing the created shell.
4538             """
4539             # Example: see GEOM_TestAll.py
4540             anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4541             RaiseIfFailed("MakeShell", self.ShapesOp)
4542             self._autoPublish(anObj, theName, "shell")
4543             return anObj
4544
4545         ## Create a solid, bounded by the given shells.
4546         #  @param theShells Sequence of bounding shells.
4547         #  @param theName Object name; when specified, this parameter is used
4548         #         for result publication in the study. Otherwise, if automatic
4549         #         publication is switched on, default value is used for result name.
4550         #
4551         #  @return New GEOM.GEOM_Object, containing the created solid.
4552         #
4553         #  @ref tui_creation_solid "Example"
4554         @ManageTransactions("ShapesOp")
4555         def MakeSolid(self, theShells, theName=None):
4556             """
4557             Create a solid, bounded by the given shells.
4558
4559             Parameters:
4560                 theShells Sequence of bounding shells.
4561                 theName Object name; when specified, this parameter is used
4562                         for result publication in the study. Otherwise, if automatic
4563                         publication is switched on, default value is used for result name.
4564
4565             Returns:
4566                 New GEOM.GEOM_Object, containing the created solid.
4567             """
4568             # Example: see GEOM_TestAll.py
4569             if len(theShells) == 1:
4570                 descr = self._IsGoodForSolid(theShells[0])
4571                 #if len(descr) > 0:
4572                 #    raise RuntimeError, "MakeSolidShells : " + descr
4573                 if descr == "WRN_SHAPE_UNCLOSED":
4574                     raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4575             anObj = self.ShapesOp.MakeSolidShells(theShells)
4576             RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4577             self._autoPublish(anObj, theName, "solid")
4578             return anObj
4579
4580         ## Create a compound of the given shapes.
4581         #  @param theShapes List of shapes to put in compound.
4582         #  @param theName Object name; when specified, this parameter is used
4583         #         for result publication in the study. Otherwise, if automatic
4584         #         publication is switched on, default value is used for result name.
4585         #
4586         #  @return New GEOM.GEOM_Object, containing the created compound.
4587         #
4588         #  @ref tui_creation_compound "Example"
4589         @ManageTransactions("ShapesOp")
4590         def MakeCompound(self, theShapes, theName=None):
4591             """
4592             Create a compound of the given shapes.
4593
4594             Parameters:
4595                 theShapes List of shapes to put in compound.
4596                 theName Object name; when specified, this parameter is used
4597                         for result publication in the study. Otherwise, if automatic
4598                         publication is switched on, default value is used for result name.
4599
4600             Returns:
4601                 New GEOM.GEOM_Object, containing the created compound.
4602             """
4603             # Example: see GEOM_TestAll.py
4604             anObj = self.ShapesOp.MakeCompound(theShapes)
4605             RaiseIfFailed("MakeCompound", self.ShapesOp)
4606             self._autoPublish(anObj, theName, "compound")
4607             return anObj
4608
4609         # end of l3_advanced
4610         ## @}
4611
4612         ## @addtogroup l2_measure
4613         ## @{
4614
4615         ## Gives quantity of faces in the given shape.
4616         #  @param theShape Shape to count faces of.
4617         #  @return Quantity of faces.
4618         #
4619         #  @ref swig_NumberOf "Example"
4620         @ManageTransactions("ShapesOp")
4621         def NumberOfFaces(self, theShape):
4622             """
4623             Gives quantity of faces in the given shape.
4624
4625             Parameters:
4626                 theShape Shape to count faces of.
4627
4628             Returns:
4629                 Quantity of faces.
4630             """
4631             # Example: see GEOM_TestOthers.py
4632             nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4633             RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4634             return nb_faces
4635
4636         ## Gives quantity of edges in the given shape.
4637         #  @param theShape Shape to count edges of.
4638         #  @return Quantity of edges.
4639         #
4640         #  @ref swig_NumberOf "Example"
4641         @ManageTransactions("ShapesOp")
4642         def NumberOfEdges(self, theShape):
4643             """
4644             Gives quantity of edges in the given shape.
4645
4646             Parameters:
4647                 theShape Shape to count edges of.
4648
4649             Returns:
4650                 Quantity of edges.
4651             """
4652             # Example: see GEOM_TestOthers.py
4653             nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4654             RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4655             return nb_edges
4656
4657         ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4658         #  @param theShape Shape to count sub-shapes of.
4659         #  @param theShapeType Type of sub-shapes to count (see ShapeType())
4660         #  @return Quantity of sub-shapes of given type.
4661         #
4662         #  @ref swig_NumberOf "Example"
4663         @ManageTransactions("ShapesOp")
4664         def NumberOfSubShapes(self, theShape, theShapeType):
4665             """
4666             Gives quantity of sub-shapes of type theShapeType in the given shape.
4667
4668             Parameters:
4669                 theShape Shape to count sub-shapes of.
4670                 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4671
4672             Returns:
4673                 Quantity of sub-shapes of given type.
4674             """
4675             # Example: see GEOM_TestOthers.py
4676             nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4677             RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4678             return nb_ss
4679
4680         ## Gives quantity of solids in the given shape.
4681         #  @param theShape Shape to count solids in.
4682         #  @return Quantity of solids.
4683         #
4684         #  @ref swig_NumberOf "Example"
4685         @ManageTransactions("ShapesOp")
4686         def NumberOfSolids(self, theShape):
4687             """
4688             Gives quantity of solids in the given shape.
4689
4690             Parameters:
4691                 theShape Shape to count solids in.
4692
4693             Returns:
4694                 Quantity of solids.
4695             """
4696             # Example: see GEOM_TestOthers.py
4697             nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4698             RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4699             return nb_solids
4700
4701         # end of l2_measure
4702         ## @}
4703
4704         ## @addtogroup l3_healing
4705         ## @{
4706
4707         ## Reverses an orientation the given shape.
4708         #  @param theShape Shape to be reversed.
4709         #  @param theName Object name; when specified, this parameter is used
4710         #         for result publication in the study. Otherwise, if automatic
4711         #         publication is switched on, default value is used for result name.
4712         #
4713         #  @return The reversed copy of theShape.
4714         #
4715         #  @ref swig_ChangeOrientation "Example"
4716         @ManageTransactions("ShapesOp")
4717         def ChangeOrientation(self, theShape, theName=None):
4718             """
4719             Reverses an orientation the given shape.
4720
4721             Parameters:
4722                 theShape Shape to be reversed.
4723                 theName Object name; when specified, this parameter is used
4724                         for result publication in the study. Otherwise, if automatic
4725                         publication is switched on, default value is used for result name.
4726
4727             Returns:
4728                 The reversed copy of theShape.
4729             """
4730             # Example: see GEOM_TestAll.py
4731             anObj = self.ShapesOp.ChangeOrientation(theShape)
4732             RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4733             self._autoPublish(anObj, theName, "reversed")
4734             return anObj
4735
4736         ## See ChangeOrientation() method for details.
4737         #
4738         #  @ref swig_OrientationChange "Example"
4739         def OrientationChange(self, theShape, theName=None):
4740             """
4741             See geompy.ChangeOrientation method for details.
4742             """
4743             # Example: see GEOM_TestOthers.py
4744             # note: auto-publishing is done in self.ChangeOrientation()
4745             anObj = self.ChangeOrientation(theShape, theName)
4746             return anObj
4747
4748         # end of l3_healing
4749         ## @}
4750
4751         ## @addtogroup l4_obtain
4752         ## @{
4753
4754         ## Retrieve all free faces from the given shape.
4755         #  Free face is a face, which is not shared between two shells of the shape.
4756         #  @param theShape Shape to find free faces in.
4757         #  @return List of IDs of all free faces, contained in theShape.
4758         #
4759         #  @ref tui_measurement_tools_page "Example"
4760         @ManageTransactions("ShapesOp")
4761         def GetFreeFacesIDs(self,theShape):
4762             """
4763             Retrieve all free faces from the given shape.
4764             Free face is a face, which is not shared between two shells of the shape.
4765
4766             Parameters:
4767                 theShape Shape to find free faces in.
4768
4769             Returns:
4770                 List of IDs of all free faces, contained in theShape.
4771             """
4772             # Example: see GEOM_TestOthers.py
4773             anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4774             RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4775             return anIDs
4776
4777         ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4778         #  @param theShape1 Shape to find sub-shapes in.
4779         #  @param theShape2 Shape to find shared sub-shapes with.
4780         #  @param theShapeType Type of sub-shapes to be retrieved.
4781         #  @param theName Object name; when specified, this parameter is used
4782         #         for result publication in the study. Otherwise, if automatic
4783         #         publication is switched on, default value is used for result name.
4784         #
4785         #  @return List of sub-shapes of theShape1, shared with theShape2.
4786         #
4787         #  @ref swig_GetSharedShapes "Example"
4788         @ManageTransactions("ShapesOp")
4789         def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4790             """
4791             Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4792
4793             Parameters:
4794                 theShape1 Shape to find sub-shapes in.
4795                 theShape2 Shape to find shared sub-shapes with.
4796                 theShapeType Type of sub-shapes to be retrieved.
4797                 theName Object name; when specified, this parameter is used
4798                         for result publication in the study. Otherwise, if automatic
4799                         publication is switched on, default value is used for result name.
4800
4801             Returns:
4802                 List of sub-shapes of theShape1, shared with theShape2.
4803             """
4804             # Example: see GEOM_TestOthers.py
4805             aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4806             RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4807             self._autoPublish(aList, theName, "shared")
4808             return aList
4809
4810         ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4811         #  @param theShapes Shapes to find common sub-shapes of.
4812         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4813         #  @param theName Object name; when specified, this parameter is used
4814         #         for result publication in the study. Otherwise, if automatic
4815         #         publication is switched on, default value is used for result name.
4816         #
4817         #  @return List of objects, that are sub-shapes of all given shapes.
4818         #
4819         #  @ref swig_GetSharedShapes "Example"
4820         @ManageTransactions("ShapesOp")
4821         def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4822             """
4823             Get all sub-shapes, shared by all shapes in the list theShapes.
4824
4825             Parameters:
4826                 theShapes Shapes to find common sub-shapes of.
4827                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4828                 theName Object name; when specified, this parameter is used
4829                         for result publication in the study. Otherwise, if automatic
4830                         publication is switched on, default value is used for result name.
4831
4832             Returns:
4833                 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4834             """
4835             # Example: see GEOM_TestOthers.py
4836             aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4837             RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4838             self._autoPublish(aList, theName, "shared")
4839             return aList
4840
4841         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4842         #  situated relatively the specified plane by the certain way,
4843         #  defined through <VAR>theState</VAR> parameter.
4844         #  @param theShape Shape to find sub-shapes of.
4845         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4846         #  @param theAx1 Vector (or line, or linear edge), specifying normal
4847         #                direction and location of the plane to find shapes on.
4848         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4849         #  @param theName Object name; when specified, this parameter is used
4850         #         for result publication in the study. Otherwise, if automatic
4851         #         publication is switched on, default value is used for result name.
4852         #
4853         #  @return List of all found sub-shapes.
4854         #
4855         #  @ref swig_GetShapesOnPlane "Example"
4856         @ManageTransactions("ShapesOp")
4857         def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4858             """
4859             Find in theShape all sub-shapes of type theShapeType,
4860             situated relatively the specified plane by the certain way,
4861             defined through theState parameter.
4862
4863             Parameters:
4864                 theShape Shape to find sub-shapes of.
4865                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4866                 theAx1 Vector (or line, or linear edge), specifying normal
4867                        direction and location of the plane to find shapes on.
4868                 theState The state of the sub-shapes to find (see GEOM::shape_state)
4869                 theName Object name; when specified, this parameter is used
4870                         for result publication in the study. Otherwise, if automatic
4871                         publication is switched on, default value is used for result name.
4872
4873             Returns:
4874                 List of all found sub-shapes.
4875             """
4876             # Example: see GEOM_TestOthers.py
4877             aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4878             RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4879             self._autoPublish(aList, theName, "shapeOnPlane")
4880             return aList
4881
4882         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4883         #  situated relatively the specified plane by the certain way,
4884         #  defined through <VAR>theState</VAR> parameter.
4885         #  @param theShape Shape to find sub-shapes of.
4886         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4887         #  @param theAx1 Vector (or line, or linear edge), specifying normal
4888         #                direction and location of the plane to find shapes on.
4889         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4890         #
4891         #  @return List of all found sub-shapes indices.
4892         #
4893         #  @ref swig_GetShapesOnPlaneIDs "Example"
4894         @ManageTransactions("ShapesOp")
4895         def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4896             """
4897             Find in theShape all sub-shapes of type theShapeType,
4898             situated relatively the specified plane by the certain way,
4899             defined through theState parameter.
4900
4901             Parameters:
4902                 theShape Shape to find sub-shapes of.
4903                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4904                 theAx1 Vector (or line, or linear edge), specifying normal
4905                        direction and location of the plane to find shapes on.
4906                 theState The state of the sub-shapes to find (see GEOM::shape_state)
4907
4908             Returns:
4909                 List of all found sub-shapes indices.
4910             """
4911             # Example: see GEOM_TestOthers.py
4912             aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4913             RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4914             return aList
4915
4916         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4917         #  situated relatively the specified plane by the certain way,
4918         #  defined through <VAR>theState</VAR> parameter.
4919         #  @param theShape Shape to find sub-shapes of.
4920         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4921         #  @param theAx1 Vector (or line, or linear edge), specifying normal
4922         #                direction of the plane to find shapes on.
4923         #  @param thePnt Point specifying location of the plane to find shapes on.
4924         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4925         #  @param theName Object name; when specified, this parameter is used
4926         #         for result publication in the study. Otherwise, if automatic
4927         #         publication is switched on, default value is used for result name.
4928         #
4929         #  @return List of all found sub-shapes.
4930         #
4931         #  @ref swig_GetShapesOnPlaneWithLocation "Example"
4932         @ManageTransactions("ShapesOp")
4933         def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4934             """
4935             Find in theShape all sub-shapes of type theShapeType,
4936             situated relatively the specified plane by the certain way,
4937             defined through theState parameter.
4938
4939             Parameters:
4940                 theShape Shape to find sub-shapes of.
4941                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4942                 theAx1 Vector (or line, or linear edge), specifying normal
4943                        direction and location of the plane to find shapes on.
4944                 thePnt Point specifying location of the plane to find shapes on.
4945                 theState The state of the sub-shapes to find (see GEOM::shape_state)
4946                 theName Object name; when specified, this parameter is used
4947                         for result publication in the study. Otherwise, if automatic
4948                         publication is switched on, default value is used for result name.
4949
4950             Returns:
4951                 List of all found sub-shapes.
4952             """
4953             # Example: see GEOM_TestOthers.py
4954             aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4955                                                                theAx1, thePnt, theState)
4956             RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4957             self._autoPublish(aList, theName, "shapeOnPlane")
4958             return aList
4959
4960         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4961         #  situated relatively the specified plane by the certain way,
4962         #  defined through <VAR>theState</VAR> parameter.
4963         #  @param theShape Shape to find sub-shapes of.
4964         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4965         #  @param theAx1 Vector (or line, or linear edge), specifying normal
4966         #                direction of the plane to find shapes on.
4967         #  @param thePnt Point specifying location of the plane to find shapes on.
4968         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4969         #
4970         #  @return List of all found sub-shapes indices.
4971         #
4972         #  @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4973         @ManageTransactions("ShapesOp")
4974         def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4975             """
4976             Find in theShape all sub-shapes of type theShapeType,
4977             situated relatively the specified plane by the certain way,
4978             defined through theState parameter.
4979
4980             Parameters:
4981                 theShape Shape to find sub-shapes of.
4982                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4983                 theAx1 Vector (or line, or linear edge), specifying normal
4984                        direction and location of the plane to find shapes on.
4985                 thePnt Point specifying location of the plane to find shapes on.
4986                 theState The state of the sub-shapes to find (see GEOM::shape_state)
4987
4988             Returns:
4989                 List of all found sub-shapes indices.
4990             """
4991             # Example: see GEOM_TestOthers.py
4992             aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4993                                                                   theAx1, thePnt, theState)
4994             RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4995             return aList
4996
4997         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4998         #  the specified cylinder by the certain way, defined through \a theState parameter.
4999         #  @param theShape Shape to find sub-shapes of.
5000         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5001         #  @param theAxis Vector (or line, or linear edge), specifying
5002         #                 axis of the cylinder to find shapes on.
5003         #  @param theRadius Radius of the cylinder to find shapes on.
5004         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5005         #  @param theName Object name; when specified, this parameter is used
5006         #         for result publication in the study. Otherwise, if automatic
5007         #         publication is switched on, default value is used for result name.
5008         #
5009         #  @return List of all found sub-shapes.
5010         #
5011         #  @ref swig_GetShapesOnCylinder "Example"
5012         @ManageTransactions("ShapesOp")
5013         def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5014             """
5015             Find in theShape all sub-shapes of type theShapeType, situated relatively
5016             the specified cylinder by the certain way, defined through theState parameter.
5017
5018             Parameters:
5019                 theShape Shape to find sub-shapes of.
5020                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5021                 theAxis Vector (or line, or linear edge), specifying
5022                         axis of the cylinder to find shapes on.
5023                 theRadius Radius of the cylinder to find shapes on.
5024                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5025                 theName Object name; when specified, this parameter is used
5026                         for result publication in the study. Otherwise, if automatic
5027                         publication is switched on, default value is used for result name.
5028
5029             Returns:
5030                 List of all found sub-shapes.
5031             """
5032             # Example: see GEOM_TestOthers.py
5033             aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5034             RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5035             self._autoPublish(aList, theName, "shapeOnCylinder")
5036             return aList
5037
5038         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5039         #  the specified cylinder by the certain way, defined through \a theState parameter.
5040         #  @param theShape Shape to find sub-shapes of.
5041         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5042         #  @param theAxis Vector (or line, or linear edge), specifying
5043         #                 axis of the cylinder to find shapes on.
5044         #  @param theRadius Radius of the cylinder to find shapes on.
5045         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5046         #
5047         #  @return List of all found sub-shapes indices.
5048         #
5049         #  @ref swig_GetShapesOnCylinderIDs "Example"
5050         @ManageTransactions("ShapesOp")
5051         def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5052             """
5053             Find in theShape all sub-shapes of type theShapeType, situated relatively
5054             the specified cylinder by the certain way, defined through theState parameter.
5055
5056             Parameters:
5057                 theShape Shape to find sub-shapes of.
5058                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5059                 theAxis Vector (or line, or linear edge), specifying
5060                         axis of the cylinder to find shapes on.
5061                 theRadius Radius of the cylinder to find shapes on.
5062                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5063
5064             Returns:
5065                 List of all found sub-shapes indices.
5066             """
5067             # Example: see GEOM_TestOthers.py
5068             aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5069             RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5070             return aList
5071
5072         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5073         #  the specified cylinder by the certain way, defined through \a theState parameter.
5074         #  @param theShape Shape to find sub-shapes of.
5075         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5076         #  @param theAxis Vector (or line, or linear edge), specifying
5077         #                 axis of the cylinder to find shapes on.
5078         #  @param thePnt Point specifying location of the bottom of the cylinder.
5079         #  @param theRadius Radius of the cylinder to find shapes on.
5080         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5081         #  @param theName Object name; when specified, this parameter is used
5082         #         for result publication in the study. Otherwise, if automatic
5083         #         publication is switched on, default value is used for result name.
5084         #
5085         #  @return List of all found sub-shapes.
5086         #
5087         #  @ref swig_GetShapesOnCylinderWithLocation "Example"
5088         @ManageTransactions("ShapesOp")
5089         def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5090             """
5091             Find in theShape all sub-shapes of type theShapeType, situated relatively
5092             the specified cylinder by the certain way, defined through theState parameter.
5093
5094             Parameters:
5095                 theShape Shape to find sub-shapes of.
5096                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5097                 theAxis Vector (or line, or linear edge), specifying
5098                         axis of the cylinder to find shapes on.
5099                 theRadius Radius of the cylinder to find shapes on.
5100                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5101                 theName Object name; when specified, this parameter is used
5102                         for result publication in the study. Otherwise, if automatic
5103                         publication is switched on, default value is used for result name.
5104
5105             Returns:
5106                 List of all found sub-shapes.
5107             """
5108             # Example: see GEOM_TestOthers.py
5109             aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5110             RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5111             self._autoPublish(aList, theName, "shapeOnCylinder")
5112             return aList
5113
5114         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5115         #  the specified cylinder by the certain way, defined through \a theState parameter.
5116         #  @param theShape Shape to find sub-shapes of.
5117         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5118         #  @param theAxis Vector (or line, or linear edge), specifying
5119         #                 axis of the cylinder to find shapes on.
5120         #  @param thePnt Point specifying location of the bottom of the cylinder.
5121         #  @param theRadius Radius of the cylinder to find shapes on.
5122         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5123         #
5124         #  @return List of all found sub-shapes indices
5125         #
5126         #  @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5127         @ManageTransactions("ShapesOp")
5128         def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5129             """
5130             Find in theShape all sub-shapes of type theShapeType, situated relatively
5131             the specified cylinder by the certain way, defined through theState parameter.
5132
5133             Parameters:
5134                 theShape Shape to find sub-shapes of.
5135                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5136                 theAxis Vector (or line, or linear edge), specifying
5137                         axis of the cylinder to find shapes on.
5138                 theRadius Radius of the cylinder to find shapes on.
5139                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5140
5141             Returns:
5142                 List of all found sub-shapes indices.
5143             """
5144             # Example: see GEOM_TestOthers.py
5145             aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5146             RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5147             return aList
5148
5149         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5150         #  the specified sphere by the certain way, defined through \a theState parameter.
5151         #  @param theShape Shape to find sub-shapes of.
5152         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5153         #  @param theCenter Point, specifying center of the sphere to find shapes on.
5154         #  @param theRadius Radius of the sphere to find shapes on.
5155         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5156         #  @param theName Object name; when specified, this parameter is used
5157         #         for result publication in the study. Otherwise, if automatic
5158         #         publication is switched on, default value is used for result name.
5159         #
5160         #  @return List of all found sub-shapes.
5161         #
5162         #  @ref swig_GetShapesOnSphere "Example"
5163         @ManageTransactions("ShapesOp")
5164         def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5165             """
5166             Find in theShape all sub-shapes of type theShapeType, situated relatively
5167             the specified sphere by the certain way, defined through theState parameter.
5168
5169             Parameters:
5170                 theShape Shape to find sub-shapes of.
5171                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5172                 theCenter Point, specifying center of the sphere to find shapes on.
5173                 theRadius Radius of the sphere to find shapes on.
5174                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5175                 theName Object name; when specified, this parameter is used
5176                         for result publication in the study. Otherwise, if automatic
5177                         publication is switched on, default value is used for result name.
5178
5179             Returns:
5180                 List of all found sub-shapes.
5181             """
5182             # Example: see GEOM_TestOthers.py
5183             aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5184             RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5185             self._autoPublish(aList, theName, "shapeOnSphere")
5186             return aList
5187
5188         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5189         #  the specified sphere by the certain way, defined through \a theState parameter.
5190         #  @param theShape Shape to find sub-shapes of.
5191         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5192         #  @param theCenter Point, specifying center of the sphere to find shapes on.
5193         #  @param theRadius Radius of the sphere to find shapes on.
5194         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5195         #
5196         #  @return List of all found sub-shapes indices.
5197         #
5198         #  @ref swig_GetShapesOnSphereIDs "Example"
5199         @ManageTransactions("ShapesOp")
5200         def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5201             """
5202             Find in theShape all sub-shapes of type theShapeType, situated relatively
5203             the specified sphere by the certain way, defined through theState parameter.
5204
5205             Parameters:
5206                 theShape Shape to find sub-shapes of.
5207                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5208                 theCenter Point, specifying center of the sphere to find shapes on.
5209                 theRadius Radius of the sphere to find shapes on.
5210                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5211
5212             Returns:
5213                 List of all found sub-shapes indices.
5214             """
5215             # Example: see GEOM_TestOthers.py
5216             aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5217             RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5218             return aList
5219
5220         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5221         #  the specified quadrangle by the certain way, defined through \a theState parameter.
5222         #  @param theShape Shape to find sub-shapes of.
5223         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5224         #  @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5225         #  @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5226         #  @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5227         #  @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5228         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5229         #  @param theName Object name; when specified, this parameter is used
5230         #         for result publication in the study. Otherwise, if automatic
5231         #         publication is switched on, default value is used for result name.
5232         #
5233         #  @return List of all found sub-shapes.
5234         #
5235         #  @ref swig_GetShapesOnQuadrangle "Example"
5236         @ManageTransactions("ShapesOp")
5237         def GetShapesOnQuadrangle(self, theShape, theShapeType,
5238                                   theTopLeftPoint, theTopRigthPoint,
5239                                   theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5240             """
5241             Find in theShape all sub-shapes of type theShapeType, situated relatively
5242             the specified quadrangle by the certain way, defined through theState parameter.
5243
5244             Parameters:
5245                 theShape Shape to find sub-shapes of.
5246                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5247                 theTopLeftPoint Point, specifying top left corner of a quadrangle
5248                 theTopRigthPoint Point, specifying top right corner of a quadrangle
5249                 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5250                 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5251                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5252                 theName Object name; when specified, this parameter is used
5253                         for result publication in the study. Otherwise, if automatic
5254                         publication is switched on, default value is used for result name.
5255
5256             Returns:
5257                 List of all found sub-shapes.
5258             """
5259             # Example: see GEOM_TestOthers.py
5260             aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5261                                                         theTopLeftPoint, theTopRigthPoint,
5262                                                         theBottomLeftPoint, theBottomRigthPoint, theState)
5263             RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5264             self._autoPublish(aList, theName, "shapeOnQuadrangle")
5265             return aList
5266
5267         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5268         #  the specified quadrangle by the certain way, defined through \a theState parameter.
5269         #  @param theShape Shape to find sub-shapes of.
5270         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5271         #  @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5272         #  @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5273         #  @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5274         #  @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5275         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5276         #
5277         #  @return List of all found sub-shapes indices.
5278         #
5279         #  @ref swig_GetShapesOnQuadrangleIDs "Example"
5280         @ManageTransactions("ShapesOp")
5281         def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5282                                      theTopLeftPoint, theTopRigthPoint,
5283                                      theBottomLeftPoint, theBottomRigthPoint, theState):
5284             """
5285             Find in theShape all sub-shapes of type theShapeType, situated relatively
5286             the specified quadrangle by the certain way, defined through theState parameter.
5287
5288             Parameters:
5289                 theShape Shape to find sub-shapes of.
5290                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5291                 theTopLeftPoint Point, specifying top left corner of a quadrangle
5292                 theTopRigthPoint Point, specifying top right corner of a quadrangle
5293                 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5294                 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5295                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5296
5297             Returns:
5298                 List of all found sub-shapes indices.
5299             """
5300
5301             # Example: see GEOM_TestOthers.py
5302             aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5303                                                            theTopLeftPoint, theTopRigthPoint,
5304                                                            theBottomLeftPoint, theBottomRigthPoint, theState)
5305             RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5306             return aList
5307
5308         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5309         #  the specified \a theBox by the certain way, defined through \a theState parameter.
5310         #  @param theBox Shape for relative comparing.
5311         #  @param theShape Shape to find sub-shapes of.
5312         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5313         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5314         #  @param theName Object name; when specified, this parameter is used
5315         #         for result publication in the study. Otherwise, if automatic
5316         #         publication is switched on, default value is used for result name.
5317         #
5318         #  @return List of all found sub-shapes.
5319         #
5320         #  @ref swig_GetShapesOnBox "Example"
5321         @ManageTransactions("ShapesOp")
5322         def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5323             """
5324             Find in theShape all sub-shapes of type theShapeType, situated relatively
5325             the specified theBox by the certain way, defined through theState parameter.
5326
5327             Parameters:
5328                 theBox Shape for relative comparing.
5329                 theShape Shape to find sub-shapes of.
5330                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5331                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5332                 theName Object name; when specified, this parameter is used
5333                         for result publication in the study. Otherwise, if automatic
5334                         publication is switched on, default value is used for result name.
5335
5336             Returns:
5337                 List of all found sub-shapes.
5338             """
5339             # Example: see GEOM_TestOthers.py
5340             aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5341             RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5342             self._autoPublish(aList, theName, "shapeOnBox")
5343             return aList
5344
5345         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5346         #  the specified \a theBox by the certain way, defined through \a theState parameter.
5347         #  @param theBox Shape for relative comparing.
5348         #  @param theShape Shape to find sub-shapes of.
5349         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5350         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5351         #
5352         #  @return List of all found sub-shapes indices.
5353         #
5354         #  @ref swig_GetShapesOnBoxIDs "Example"
5355         @ManageTransactions("ShapesOp")
5356         def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5357             """
5358             Find in theShape all sub-shapes of type theShapeType, situated relatively
5359             the specified theBox by the certain way, defined through theState parameter.
5360
5361             Parameters:
5362                 theBox Shape for relative comparing.
5363                 theShape Shape to find sub-shapes of.
5364                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5365                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5366
5367             Returns:
5368                 List of all found sub-shapes indices.
5369             """
5370             # Example: see GEOM_TestOthers.py
5371             aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5372             RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5373             return aList
5374
5375         ## Find in \a theShape all sub-shapes of type \a theShapeType,
5376         #  situated relatively the specified \a theCheckShape by the
5377         #  certain way, defined through \a theState parameter.
5378         #  @param theCheckShape Shape for relative comparing. It must be a solid.
5379         #  @param theShape Shape to find sub-shapes of.
5380         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5381         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5382         #  @param theName Object name; when specified, this parameter is used
5383         #         for result publication in the study. Otherwise, if automatic
5384         #         publication is switched on, default value is used for result name.
5385         #
5386         #  @return List of all found sub-shapes.
5387         #
5388         #  @ref swig_GetShapesOnShape "Example"
5389         @ManageTransactions("ShapesOp")
5390         def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5391             """
5392             Find in theShape all sub-shapes of type theShapeType,
5393             situated relatively the specified theCheckShape by the
5394             certain way, defined through theState parameter.
5395
5396             Parameters:
5397                 theCheckShape Shape for relative comparing. It must be a solid.
5398                 theShape Shape to find sub-shapes of.
5399                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5400                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5401                 theName Object name; when specified, this parameter is used
5402                         for result publication in the study. Otherwise, if automatic
5403                         publication is switched on, default value is used for result name.
5404
5405             Returns:
5406                 List of all found sub-shapes.
5407             """
5408             # Example: see GEOM_TestOthers.py
5409             aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5410                                                    theShapeType, theState)
5411             RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5412             self._autoPublish(aList, theName, "shapeOnShape")
5413             return aList
5414
5415         ## Find in \a theShape all sub-shapes of type \a theShapeType,
5416         #  situated relatively the specified \a theCheckShape by the
5417         #  certain way, defined through \a theState parameter.
5418         #  @param theCheckShape Shape for relative comparing. It must be a solid.
5419         #  @param theShape Shape to find sub-shapes of.
5420         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5421         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5422         #  @param theName Object name; when specified, this parameter is used
5423         #         for result publication in the study. Otherwise, if automatic
5424         #         publication is switched on, default value is used for result name.
5425         #
5426         #  @return All found sub-shapes as compound.
5427         #
5428         #  @ref swig_GetShapesOnShapeAsCompound "Example"
5429         @ManageTransactions("ShapesOp")
5430         def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5431             """
5432             Find in theShape all sub-shapes of type theShapeType,
5433             situated relatively the specified theCheckShape by the
5434             certain way, defined through theState parameter.
5435
5436             Parameters:
5437                 theCheckShape Shape for relative comparing. It must be a solid.
5438                 theShape Shape to find sub-shapes of.
5439                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5440                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5441                 theName Object name; when specified, this parameter is used
5442                         for result publication in the study. Otherwise, if automatic
5443                         publication is switched on, default value is used for result name.
5444
5445             Returns:
5446                 All found sub-shapes as compound.
5447             """
5448             # Example: see GEOM_TestOthers.py
5449             anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5450                                                              theShapeType, theState)
5451             RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5452             self._autoPublish(anObj, theName, "shapeOnShape")
5453             return anObj
5454
5455         ## Find in \a theShape all sub-shapes of type \a theShapeType,
5456         #  situated relatively the specified \a theCheckShape by the
5457         #  certain way, defined through \a theState parameter.
5458         #  @param theCheckShape Shape for relative comparing. It must be a solid.
5459         #  @param theShape Shape to find sub-shapes of.
5460         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5461         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5462         #
5463         #  @return List of all found sub-shapes indices.
5464         #
5465         #  @ref swig_GetShapesOnShapeIDs "Example"
5466         @ManageTransactions("ShapesOp")
5467         def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5468             """
5469             Find in theShape all sub-shapes of type theShapeType,
5470             situated relatively the specified theCheckShape by the
5471             certain way, defined through theState parameter.
5472
5473             Parameters:
5474                 theCheckShape Shape for relative comparing. It must be a solid.
5475                 theShape Shape to find sub-shapes of.
5476                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5477                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5478
5479             Returns:
5480                 List of all found sub-shapes indices.
5481             """
5482             # Example: see GEOM_TestOthers.py
5483             aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5484                                                       theShapeType, theState)
5485             RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5486             return aList
5487
5488         ## Get sub-shape(s) of theShapeWhere, which are
5489         #  coincident with \a theShapeWhat or could be a part of it.
5490         #  @param theShapeWhere Shape to find sub-shapes of.
5491         #  @param theShapeWhat Shape, specifying what to find.
5492         #  @param isNewImplementation implementation of GetInPlace functionality
5493         #             (default = False, old alghorithm based on shape properties)
5494         #  @param theName Object name; when specified, this parameter is used
5495         #         for result publication in the study. Otherwise, if automatic
5496         #         publication is switched on, default value is used for result name.
5497         #
5498         #  @return Group of all found sub-shapes or a single found sub-shape.
5499         #
5500         #  @note This function has a restriction on argument shapes.
5501         #        If \a theShapeWhere has curved parts with significantly
5502         #        outstanding centres (i.e. the mass centre of a part is closer to
5503         #        \a theShapeWhat than to the part), such parts will not be found.
5504         #        @image html get_in_place_lost_part.png
5505         #
5506         #  @ref swig_GetInPlace "Example"
5507         @ManageTransactions("ShapesOp")
5508         def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5509             """
5510             Get sub-shape(s) of theShapeWhere, which are
5511             coincident with  theShapeWhat or could be a part of it.
5512
5513             Parameters:
5514                 theShapeWhere Shape to find sub-shapes of.
5515                 theShapeWhat Shape, specifying what to find.
5516                 isNewImplementation Implementation of GetInPlace functionality
5517                                     (default = False, old alghorithm based on shape properties)
5518                 theName Object name; when specified, this parameter is used
5519                         for result publication in the study. Otherwise, if automatic
5520                         publication is switched on, default value is used for result name.
5521
5522             Returns:
5523                 Group of all found sub-shapes or a single found sub-shape.
5524
5525
5526             Note:
5527                 This function has a restriction on argument shapes.
5528                 If theShapeWhere has curved parts with significantly
5529                 outstanding centres (i.e. the mass centre of a part is closer to
5530                 theShapeWhat than to the part), such parts will not be found.
5531             """
5532             # Example: see GEOM_TestOthers.py
5533             anObj = None
5534             if isNewImplementation:
5535                 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5536             else:
5537                 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5538                 pass
5539             RaiseIfFailed("GetInPlace", self.ShapesOp)
5540             self._autoPublish(anObj, theName, "inplace")
5541             return anObj
5542
5543         ## Get sub-shape(s) of \a theShapeWhere, which are
5544         #  coincident with \a theShapeWhat or could be a part of it.
5545         #
5546         #  Implementation of this method is based on a saved history of an operation,
5547         #  produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5548         #  arguments (an argument shape or a sub-shape of an argument shape).
5549         #  The operation could be the Partition or one of boolean operations,
5550         #  performed on simple shapes (not on compounds).
5551         #
5552         #  @param theShapeWhere Shape to find sub-shapes of.
5553         #  @param theShapeWhat Shape, specifying what to find (must be in the
5554         #                      building history of the ShapeWhere).
5555         #  @param theName Object name; when specified, this parameter is used
5556         #         for result publication in the study. Otherwise, if automatic
5557         #         publication is switched on, default value is used for result name.
5558         #
5559         #  @return Group of all found sub-shapes or a single found sub-shape.
5560         #
5561         #  @ref swig_GetInPlace "Example"
5562         @ManageTransactions("ShapesOp")
5563         def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5564             """
5565             Implementation of this method is based on a saved history of an operation,
5566             produced theShapeWhere. The theShapeWhat must be among this operation's
5567             arguments (an argument shape or a sub-shape of an argument shape).
5568             The operation could be the Partition or one of boolean operations,
5569             performed on simple shapes (not on compounds).
5570
5571             Parameters:
5572                 theShapeWhere Shape to find sub-shapes of.
5573                 theShapeWhat Shape, specifying what to find (must be in the
5574                                 building history of the ShapeWhere).
5575                 theName Object name; when specified, this parameter is used
5576                         for result publication in the study. Otherwise, if automatic
5577                         publication is switched on, default value is used for result name.
5578
5579             Returns:
5580                 Group of all found sub-shapes or a single found sub-shape.
5581             """
5582             # Example: see GEOM_TestOthers.py
5583             anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5584             RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5585             self._autoPublish(anObj, theName, "inplace")
5586             return anObj
5587
5588         ## Get sub-shape of theShapeWhere, which is
5589         #  equal to \a theShapeWhat.
5590         #  @param theShapeWhere Shape to find sub-shape of.
5591         #  @param theShapeWhat Shape, specifying what to find.
5592         #  @param theName Object name; when specified, this parameter is used
5593         #         for result publication in the study. Otherwise, if automatic
5594         #         publication is switched on, default value is used for result name.
5595         #
5596         #  @return New GEOM.GEOM_Object for found sub-shape.
5597         #
5598         #  @ref swig_GetSame "Example"
5599         @ManageTransactions("ShapesOp")
5600         def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5601             """
5602             Get sub-shape of theShapeWhere, which is
5603             equal to theShapeWhat.
5604
5605             Parameters:
5606                 theShapeWhere Shape to find sub-shape of.
5607                 theShapeWhat Shape, specifying what to find.
5608                 theName Object name; when specified, this parameter is used
5609                         for result publication in the study. Otherwise, if automatic
5610                         publication is switched on, default value is used for result name.
5611
5612             Returns:
5613                 New GEOM.GEOM_Object for found sub-shape.
5614             """
5615             anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5616             RaiseIfFailed("GetSame", self.ShapesOp)
5617             self._autoPublish(anObj, theName, "sameShape")
5618             return anObj
5619
5620
5621         ## Get sub-shape indices of theShapeWhere, which is
5622         #  equal to \a theShapeWhat.
5623         #  @param theShapeWhere Shape to find sub-shape of.
5624         #  @param theShapeWhat Shape, specifying what to find.
5625         #  @return List of all found sub-shapes indices.
5626         #
5627         #  @ref swig_GetSame "Example"
5628         @ManageTransactions("ShapesOp")
5629         def GetSameIDs(self, theShapeWhere, theShapeWhat):
5630             """
5631             Get sub-shape indices of theShapeWhere, which is
5632             equal to theShapeWhat.
5633
5634             Parameters:
5635                 theShapeWhere Shape to find sub-shape of.
5636                 theShapeWhat Shape, specifying what to find.
5637
5638             Returns:
5639                 List of all found sub-shapes indices.
5640             """
5641             anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5642             RaiseIfFailed("GetSameIDs", self.ShapesOp)
5643             return anObj
5644
5645
5646         # end of l4_obtain
5647         ## @}
5648
5649         ## @addtogroup l4_access
5650         ## @{
5651
5652         ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5653         #  of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5654         #  @param aShape Shape to get sub-shape of.
5655         #  @param ListOfID List of sub-shapes indices.
5656         #  @param theName Object name; when specified, this parameter is used
5657         #         for result publication in the study. Otherwise, if automatic
5658         #         publication is switched on, default value is used for result name.
5659         #
5660         #  @return Found sub-shape.
5661         #
5662         #  @ref swig_all_decompose "Example"
5663         def GetSubShape(self, aShape, ListOfID, theName=None):
5664             """
5665             Obtain a composite sub-shape of aShape, composed from sub-shapes
5666             of aShape, selected by their unique IDs inside aShape
5667
5668             Parameters:
5669                 aShape Shape to get sub-shape of.
5670                 ListOfID List of sub-shapes indices.
5671                 theName Object name; when specified, this parameter is used
5672                         for result publication in the study. Otherwise, if automatic
5673                         publication is switched on, default value is used for result name.
5674
5675             Returns:
5676                 Found sub-shape.
5677             """
5678             # Example: see GEOM_TestAll.py
5679             anObj = self.AddSubShape(aShape,ListOfID)
5680             self._autoPublish(anObj, theName, "subshape")
5681             return anObj
5682
5683         ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5684         #  of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5685         #  @param aShape Shape to get sub-shape of.
5686         #  @param aSubShape Sub-shapes of aShape.
5687         #  @return ID of found sub-shape.
5688         #
5689         #  @ref swig_all_decompose "Example"
5690         @ManageTransactions("LocalOp")
5691         def GetSubShapeID(self, aShape, aSubShape):
5692             """
5693             Obtain unique ID of sub-shape aSubShape inside aShape
5694             of aShape, selected by their unique IDs inside aShape
5695
5696             Parameters:
5697                aShape Shape to get sub-shape of.
5698                aSubShape Sub-shapes of aShape.
5699
5700             Returns:
5701                ID of found sub-shape.
5702             """
5703             # Example: see GEOM_TestAll.py
5704             anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5705             RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5706             return anID
5707
5708         ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5709         #  This function is provided for performance purpose. The complexity is O(n) with n
5710         #  the number of subobjects of aShape
5711         #  @param aShape Shape to get sub-shape of.
5712         #  @param aSubShapes Sub-shapes of aShape.
5713         #  @return list of IDs of found sub-shapes.
5714         #
5715         #  @ref swig_all_decompose "Example"
5716         @ManageTransactions("ShapesOp")
5717         def GetSubShapesIDs(self, aShape, aSubShapes):
5718             """
5719             Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5720             This function is provided for performance purpose. The complexity is O(n) with n
5721             the number of subobjects of aShape
5722
5723             Parameters:
5724                aShape Shape to get sub-shape of.
5725                aSubShapes Sub-shapes of aShape.
5726
5727             Returns:
5728                List of IDs of found sub-shape.
5729             """
5730             # Example: see GEOM_TestAll.py
5731             anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5732             RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5733             return anIDs
5734
5735         # end of l4_access
5736         ## @}
5737
5738         ## @addtogroup l4_decompose
5739         ## @{
5740
5741         ## Get all sub-shapes and groups of \a theShape,
5742         #  that were created already by any other methods.
5743         #  @param theShape Any shape.
5744         #  @param theGroupsOnly If this parameter is TRUE, only groups will be
5745         #                       returned, else all found sub-shapes and groups.
5746         #  @return List of existing sub-objects of \a theShape.
5747         #
5748         #  @ref swig_all_decompose "Example"
5749         @ManageTransactions("ShapesOp")
5750         def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5751             """
5752             Get all sub-shapes and groups of theShape,
5753             that were created already by any other methods.
5754
5755             Parameters:
5756                 theShape Any shape.
5757                 theGroupsOnly If this parameter is TRUE, only groups will be
5758                                  returned, else all found sub-shapes and groups.
5759
5760             Returns:
5761                 List of existing sub-objects of theShape.
5762             """
5763             # Example: see GEOM_TestAll.py
5764             ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5765             RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5766             return ListObj
5767
5768         ## Get all groups of \a theShape,
5769         #  that were created already by any other methods.
5770         #  @param theShape Any shape.
5771         #  @return List of existing groups of \a theShape.
5772         #
5773         #  @ref swig_all_decompose "Example"
5774         @ManageTransactions("ShapesOp")
5775         def GetGroups(self, theShape):
5776             """
5777             Get all groups of theShape,
5778             that were created already by any other methods.
5779
5780             Parameters:
5781                 theShape Any shape.
5782
5783             Returns:
5784                 List of existing groups of theShape.
5785             """
5786             # Example: see GEOM_TestAll.py
5787             ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5788             RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5789             return ListObj
5790
5791         ## Explode a shape on sub-shapes of a given type.
5792         #  If the shape itself matches the type, it is also returned.
5793         #  @param aShape Shape to be exploded.
5794         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
5795         #  @param theName Object name; when specified, this parameter is used
5796         #         for result publication in the study. Otherwise, if automatic
5797         #         publication is switched on, default value is used for result name.
5798         #
5799         #  @return List of sub-shapes of type theShapeType, contained in theShape.
5800         #
5801         #  @ref swig_all_decompose "Example"
5802         @ManageTransactions("ShapesOp")
5803         def SubShapeAll(self, aShape, aType, theName=None):
5804             """
5805             Explode a shape on sub-shapes of a given type.
5806             If the shape itself matches the type, it is also returned.
5807
5808             Parameters:
5809                 aShape Shape to be exploded.
5810                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5811                 theName Object name; when specified, this parameter is used
5812                         for result publication in the study. Otherwise, if automatic
5813                         publication is switched on, default value is used for result name.
5814
5815             Returns:
5816                 List of sub-shapes of type theShapeType, contained in theShape.
5817             """
5818             # Example: see GEOM_TestAll.py
5819             ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5820             RaiseIfFailed("SubShapeAll", self.ShapesOp)
5821             self._autoPublish(ListObj, theName, "subshape")
5822             return ListObj
5823
5824         ## Explode a shape on sub-shapes of a given type.
5825         #  @param aShape Shape to be exploded.
5826         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
5827         #  @return List of IDs of sub-shapes.
5828         #
5829         #  @ref swig_all_decompose "Example"
5830         @ManageTransactions("ShapesOp")
5831         def SubShapeAllIDs(self, aShape, aType):
5832             """
5833             Explode a shape on sub-shapes of a given type.
5834
5835             Parameters:
5836                 aShape Shape to be exploded (see geompy.ShapeType)
5837                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5838
5839             Returns:
5840                 List of IDs of sub-shapes.
5841             """
5842             ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5843             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5844             return ListObj
5845
5846         ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5847         #  selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5848         #  Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5849         #  @param aShape Shape to get sub-shape of.
5850         #  @param ListOfInd List of sub-shapes indices.
5851         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
5852         #  @param theName Object name; when specified, this parameter is used
5853         #         for result publication in the study. Otherwise, if automatic
5854         #         publication is switched on, default value is used for result name.
5855         #
5856         #  @return A compound of sub-shapes of aShape.
5857         #
5858         #  @ref swig_all_decompose "Example"
5859         def SubShape(self, aShape, aType, ListOfInd, theName=None):
5860             """
5861             Obtain a compound of sub-shapes of aShape,
5862             selected by their indices in list of all sub-shapes of type aType.
5863             Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5864
5865             Parameters:
5866                 aShape Shape to get sub-shape of.
5867                 ListOfID List of sub-shapes indices.
5868                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5869                 theName Object name; when specified, this parameter is used
5870                         for result publication in the study. Otherwise, if automatic
5871                         publication is switched on, default value is used for result name.
5872
5873             Returns:
5874                 A compound of sub-shapes of aShape.
5875             """
5876             # Example: see GEOM_TestAll.py
5877             ListOfIDs = []
5878             AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5879             for ind in ListOfInd:
5880                 ListOfIDs.append(AllShapeIDsList[ind - 1])
5881             # note: auto-publishing is done in self.GetSubShape()
5882             anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5883             return anObj
5884
5885         ## Explode a shape on sub-shapes of a given type.
5886         #  Sub-shapes will be sorted taking into account their gravity centers,
5887         #  to provide stable order of sub-shapes.
5888         #  If the shape itself matches the type, it is also returned.
5889         #  @param aShape Shape to be exploded.
5890         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
5891         #  @param theName Object name; when specified, this parameter is used
5892         #         for result publication in the study. Otherwise, if automatic
5893         #         publication is switched on, default value is used for result name.
5894         #
5895         #  @return List of sub-shapes of type theShapeType, contained in theShape.
5896         #
5897         #  @ref swig_SubShapeAllSorted "Example"
5898         @ManageTransactions("ShapesOp")
5899         def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5900             """
5901             Explode a shape on sub-shapes of a given type.
5902             Sub-shapes will be sorted taking into account their gravity centers,
5903             to provide stable order of sub-shapes.
5904             If the shape itself matches the type, it is also returned.
5905
5906             Parameters:
5907                 aShape Shape to be exploded.
5908                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5909                 theName Object name; when specified, this parameter is used
5910                         for result publication in the study. Otherwise, if automatic
5911                         publication is switched on, default value is used for result name.
5912
5913             Returns:
5914                 List of sub-shapes of type theShapeType, contained in theShape.
5915             """
5916             # Example: see GEOM_TestAll.py
5917             ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5918             RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5919             self._autoPublish(ListObj, theName, "subshape")
5920             return ListObj
5921
5922         ## Explode a shape on sub-shapes of a given type.
5923         #  Sub-shapes will be sorted taking into account their gravity centers,
5924         #  to provide stable order of sub-shapes.
5925         #  @param aShape Shape to be exploded.
5926         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
5927         #  @return List of IDs of sub-shapes.
5928         #
5929         #  @ref swig_all_decompose "Example"
5930         @ManageTransactions("ShapesOp")
5931         def SubShapeAllSortedCentresIDs(self, aShape, aType):
5932             """
5933             Explode a shape on sub-shapes of a given type.
5934             Sub-shapes will be sorted taking into account their gravity centers,
5935             to provide stable order of sub-shapes.
5936
5937             Parameters:
5938                 aShape Shape to be exploded.
5939                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5940
5941             Returns:
5942                 List of IDs of sub-shapes.
5943             """
5944             ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5945             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5946             return ListIDs
5947
5948         ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5949         #  selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5950         #  Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5951         #  @param aShape Shape to get sub-shape of.
5952         #  @param ListOfInd List of sub-shapes indices.
5953         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
5954         #  @param theName Object name; when specified, this parameter is used
5955         #         for result publication in the study. Otherwise, if automatic
5956         #         publication is switched on, default value is used for result name.
5957         #
5958         #  @return A compound of sub-shapes of aShape.
5959         #
5960         #  @ref swig_all_decompose "Example"
5961         def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5962             """
5963             Obtain a compound of sub-shapes of aShape,
5964             selected by they indices in sorted list of all sub-shapes of type aType.
5965             Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5966
5967             Parameters:
5968                 aShape Shape to get sub-shape of.
5969                 ListOfID List of sub-shapes indices.
5970                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5971                 theName Object name; when specified, this parameter is used
5972                         for result publication in the study. Otherwise, if automatic
5973                         publication is switched on, default value is used for result name.
5974
5975             Returns:
5976                 A compound of sub-shapes of aShape.
5977             """
5978             # Example: see GEOM_TestAll.py
5979             ListOfIDs = []
5980             AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5981             for ind in ListOfInd:
5982                 ListOfIDs.append(AllShapeIDsList[ind - 1])
5983             # note: auto-publishing is done in self.GetSubShape()
5984             anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5985             return anObj
5986
5987         ## Extract shapes (excluding the main shape) of given type.
5988         #  @param aShape The shape.
5989         #  @param aType  The shape type (see ShapeType())
5990         #  @param isSorted Boolean flag to switch sorting on/off.
5991         #  @param theName Object name; when specified, this parameter is used
5992         #         for result publication in the study. Otherwise, if automatic
5993         #         publication is switched on, default value is used for result name.
5994         #
5995         #  @return List of sub-shapes of type aType, contained in aShape.
5996         #
5997         #  @ref swig_FilletChamfer "Example"
5998         @ManageTransactions("ShapesOp")
5999         def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6000             """
6001             Extract shapes (excluding the main shape) of given type.
6002
6003             Parameters:
6004                 aShape The shape.
6005                 aType  The shape type (see geompy.ShapeType)
6006                 isSorted Boolean flag to switch sorting on/off.
6007                 theName Object name; when specified, this parameter is used
6008                         for result publication in the study. Otherwise, if automatic
6009                         publication is switched on, default value is used for result name.
6010
6011             Returns:
6012                 List of sub-shapes of type aType, contained in aShape.
6013             """
6014             # Example: see GEOM_TestAll.py
6015             ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6016             RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6017             self._autoPublish(ListObj, theName, "subshape")
6018             return ListObj
6019
6020         ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6021         #  @param aShape Main shape.
6022         #  @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6023         #  @param theName Object name; when specified, this parameter is used
6024         #         for result publication in the study. Otherwise, if automatic
6025         #         publication is switched on, default value is used for result name.
6026         #  @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6027         #
6028         #  @ref swig_all_decompose "Example"
6029         @ManageTransactions("ShapesOp")
6030         def SubShapes(self, aShape, anIDs, theName=None):
6031             """
6032             Get a set of sub-shapes defined by their unique IDs inside theMainShape
6033
6034             Parameters:
6035                 aShape Main shape.
6036                 anIDs List of unique IDs of sub-shapes inside theMainShape.
6037                 theName Object name; when specified, this parameter is used
6038                         for result publication in the study. Otherwise, if automatic
6039                         publication is switched on, default value is used for result name.
6040
6041             Returns:
6042                 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6043             """
6044             # Example: see GEOM_TestAll.py
6045             ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6046             RaiseIfFailed("SubShapes", self.ShapesOp)
6047             self._autoPublish(ListObj, theName, "subshape")
6048             return ListObj
6049
6050         ## Explode a shape into edges sorted in a row from a starting point.
6051         #  @param theShape the shape to be exploded on edges.
6052         #  @param theStartPoint the starting point.
6053         #  @param theName Object name; when specified, this parameter is used
6054         #         for result publication in the study. Otherwise, if automatic
6055         #         publication is switched on, default value is used for result name.
6056         #  @return List of GEOM.GEOM_Object that is actually an ordered list
6057         #          of edges sorted in a row from a starting point.
6058         #
6059         #  @ref swig_GetSubShapeEdgeSorted "Example"
6060         @ManageTransactions("ShapesOp")
6061         def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
6062             """
6063             Explode a shape into edges sorted in a row from a starting point.
6064
6065             Parameters:
6066                 theShape the shape to be exploded on edges.
6067                 theStartPoint the starting point.
6068                 theName Object name; when specified, this parameter is used
6069                         for result publication in the study. Otherwise, if automatic
6070                         publication is switched on, default value is used for result name.
6071
6072             Returns:
6073                 List of GEOM.GEOM_Object that is actually an ordered list
6074                 of edges sorted in a row from a starting point.
6075             """
6076             # Example: see GEOM_TestAll.py
6077             ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
6078             RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
6079             self._autoPublish(ListObj, theName, "SortedEdges")
6080             return ListObj
6081
6082         # end of l4_decompose
6083         ## @}
6084
6085         ## @addtogroup l4_decompose_d
6086         ## @{
6087
6088         ## Deprecated method
6089         #  It works like SubShapeAllSortedCentres(), but wrongly
6090         #  defines centres of faces, shells and solids.
6091         @ManageTransactions("ShapesOp")
6092         def SubShapeAllSorted(self, aShape, aType, theName=None):
6093             """
6094             Deprecated method
6095             It works like geompy.SubShapeAllSortedCentres, but wrongly
6096             defines centres of faces, shells and solids.
6097             """
6098             ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6099             RaiseIfFailed("MakeExplode", self.ShapesOp)
6100             self._autoPublish(ListObj, theName, "subshape")
6101             return ListObj
6102
6103         ## Deprecated method
6104         #  It works like SubShapeAllSortedCentresIDs(), but wrongly
6105         #  defines centres of faces, shells and solids.
6106         @ManageTransactions("ShapesOp")
6107         def SubShapeAllSortedIDs(self, aShape, aType):
6108             """
6109             Deprecated method
6110             It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6111             defines centres of faces, shells and solids.
6112             """
6113             ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6114             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6115             return ListIDs
6116
6117         ## Deprecated method
6118         #  It works like SubShapeSortedCentres(), but has a bug
6119         #  (wrongly defines centres of faces, shells and solids).
6120         def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6121             """
6122             Deprecated method
6123             It works like geompy.SubShapeSortedCentres, but has a bug
6124             (wrongly defines centres of faces, shells and solids).
6125             """
6126             ListOfIDs = []
6127             AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6128             for ind in ListOfInd:
6129                 ListOfIDs.append(AllShapeIDsList[ind - 1])
6130             # note: auto-publishing is done in self.GetSubShape()
6131             anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6132             return anObj
6133
6134         # end of l4_decompose_d
6135         ## @}
6136
6137         ## @addtogroup l3_healing
6138         ## @{
6139
6140         ## Apply a sequence of Shape Healing operators to the given object.
6141         #  @param theShape Shape to be processed.
6142         #  @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6143         #  @param theParameters List of names of parameters
6144         #                    ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6145         #  @param theValues List of values of parameters, in the same order
6146         #                    as parameters are listed in <VAR>theParameters</VAR> list.
6147         #  @param theName Object name; when specified, this parameter is used
6148         #         for result publication in the study. Otherwise, if automatic
6149         #         publication is switched on, default value is used for result name.
6150         #
6151         #  <b> Operators and Parameters: </b> \n
6152         #
6153         #  * \b FixShape - corrects invalid shapes. \n
6154         #  - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6155         #  - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6156         #
6157         #  * \b FixFaceSize - removes small faces, such as spots and strips.\n
6158         #  - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6159         #  - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6160         #  - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6161         #
6162         #  * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6163         #    surfaces in segments using a certain angle. \n
6164         #  - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6165         #    if Angle=180, four if Angle=90, etc). \n
6166         #  - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6167         #
6168         #  * \b SplitClosedFaces - splits closed faces in segments.
6169         #    The number of segments depends on the number of splitting points.\n
6170         #  - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6171         #
6172         #  * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6173         #  - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6174         #  - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6175         #  - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6176         #   This and the previous parameters can take the following values:\n
6177         #   \b Parametric \b Continuity \n
6178         #   \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6179         #   are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6180         #   \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6181         #    ruling out sharp edges).\n
6182         #   \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6183         #       are of the same magnitude).\n
6184         #   \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6185         #    or surfaces (d/du C(u)) are the same at junction. \n
6186         #   \b Geometric \b Continuity \n
6187         #   \b G1: first derivatives are proportional at junction.\n
6188         #   The curve tangents thus have the same direction, but not necessarily the same magnitude.
6189         #      i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6190         #   \b G2: first and second derivatives are proportional at junction.
6191         #   As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6192         #    continuity requires that the underlying parameterization was continuous as well.
6193         #   Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6194         #
6195         #  * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6196         #  - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6197         #  - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6198         #  - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6199         #  - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6200         #       with the specified parameters.\n
6201         #  - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6202         #       with the specified parameters.\n
6203         #  - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6204         #  - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6205         #  - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6206         #  - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6207         #
6208         #  * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6209         #  - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6210         #  - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6211         #  - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6212         #  - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6213         #
6214         #  * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6215         #  - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6216         #
6217         #
6218         #  @return New GEOM.GEOM_Object, containing processed shape.
6219         #
6220         #  \n @ref tui_shape_processing "Example"
6221         @ManageTransactions("HealOp")
6222         def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6223             """
6224             Apply a sequence of Shape Healing operators to the given object.
6225
6226             Parameters:
6227                 theShape Shape to be processed.
6228                 theValues List of values of parameters, in the same order
6229                           as parameters are listed in theParameters list.
6230                 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6231                 theParameters List of names of parameters
6232                               ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6233                 theName Object name; when specified, this parameter is used
6234                         for result publication in the study. Otherwise, if automatic
6235                         publication is switched on, default value is used for result name.
6236
6237                 Operators and Parameters:
6238
6239                  * FixShape - corrects invalid shapes.
6240                      * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6241                      * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6242                  * FixFaceSize - removes small faces, such as spots and strips.
6243                      * FixFaceSize.Tolerance - defines minimum possible face size.
6244                      * DropSmallEdges - removes edges, which merge with neighbouring edges.
6245                      * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6246                  * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6247                                 in segments using a certain angle.
6248                      * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6249                                           if Angle=180, four if Angle=90, etc).
6250                      * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6251                  * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6252                                       splitting points.
6253                      * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6254                  * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6255                      * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6256                      * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6257                      * SplitContinuity.CurveContinuity - required continuity for curves.
6258                        This and the previous parameters can take the following values:
6259
6260                        Parametric Continuity:
6261                        C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6262                                                    coincidental. The curves or surfaces may still meet at an angle,
6263                                                    giving rise to a sharp corner or edge).
6264                        C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6265                                                    are parallel, ruling out sharp edges).
6266                        C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6267                                                   or surfaces are of the same magnitude).
6268                        CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6269                           curves or surfaces (d/du C(u)) are the same at junction.
6270
6271                        Geometric Continuity:
6272                        G1: first derivatives are proportional at junction.
6273                            The curve tangents thus have the same direction, but not necessarily the same magnitude.
6274                            i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6275                        G2: first and second derivatives are proportional at junction. As the names imply,
6276                            geometric continuity requires the geometry to be continuous, while parametric continuity requires
6277                            that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6278                            geometric continuity of order n, but not vice-versa.
6279                  * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6280                      * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6281                      * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6282                      * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6283                      * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6284                                                         the specified parameters.
6285                      * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6286                                                         the specified parameters.
6287                      * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6288                      * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6289                      * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6290                      * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6291                  * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6292                      * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6293                      * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6294                      * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6295                      * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6296                  * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6297                      * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6298
6299             Returns:
6300                 New GEOM.GEOM_Object, containing processed shape.
6301
6302             Note: For more information look through SALOME Geometry User's Guide->
6303                   -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6304             """
6305             # Example: see GEOM_TestHealing.py
6306             theValues,Parameters = ParseList(theValues)
6307             anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6308             # To avoid script failure in case of good argument shape
6309             if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6310                 return theShape
6311             RaiseIfFailed("ProcessShape", self.HealOp)
6312             for string in (theOperators + theParameters):
6313                 Parameters = ":" + Parameters
6314                 pass
6315             anObj.SetParameters(Parameters)
6316             self._autoPublish(anObj, theName, "healed")
6317             return anObj
6318
6319         ## Remove faces from the given object (shape).
6320         #  @param theObject Shape to be processed.
6321         #  @param theFaces Indices of faces to be removed, if EMPTY then the method
6322         #                  removes ALL faces of the given object.
6323         #  @param theName Object name; when specified, this parameter is used
6324         #         for result publication in the study. Otherwise, if automatic
6325         #         publication is switched on, default value is used for result name.
6326         #
6327         #  @return New GEOM.GEOM_Object, containing processed shape.
6328         #
6329         #  @ref tui_suppress_faces "Example"
6330         @ManageTransactions("HealOp")
6331         def SuppressFaces(self, theObject, theFaces, theName=None):
6332             """
6333             Remove faces from the given object (shape).
6334
6335             Parameters:
6336                 theObject Shape to be processed.
6337                 theFaces Indices of faces to be removed, if EMPTY then the method
6338                          removes ALL faces of the given object.
6339                 theName Object name; when specified, this parameter is used
6340                         for result publication in the study. Otherwise, if automatic
6341                         publication is switched on, default value is used for result name.
6342
6343             Returns:
6344                 New GEOM.GEOM_Object, containing processed shape.
6345             """
6346             # Example: see GEOM_TestHealing.py
6347             anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6348             RaiseIfFailed("SuppressFaces", self.HealOp)
6349             self._autoPublish(anObj, theName, "suppressFaces")
6350             return anObj
6351
6352         ## Sewing of some shapes into single shape.
6353         #  @param ListShape Shapes to be processed.
6354         #  @param theTolerance Required tolerance value.
6355         #  @param AllowNonManifold Flag that allows non-manifold sewing.
6356         #  @param theName Object name; when specified, this parameter is used
6357         #         for result publication in the study. Otherwise, if automatic
6358         #         publication is switched on, default value is used for result name.
6359         #
6360         #  @return New GEOM.GEOM_Object, containing processed shape.
6361         #
6362         #  @ref tui_sewing "Example"
6363         def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6364             """
6365             Sewing of some shapes into single shape.
6366
6367             Parameters:
6368                 ListShape Shapes to be processed.
6369                 theTolerance Required tolerance value.
6370                 AllowNonManifold Flag that allows non-manifold sewing.
6371                 theName Object name; when specified, this parameter is used
6372                         for result publication in the study. Otherwise, if automatic
6373                         publication is switched on, default value is used for result name.
6374
6375             Returns:
6376                 New GEOM.GEOM_Object, containing processed shape.
6377             """
6378             # Example: see GEOM_TestHealing.py
6379             comp = self.MakeCompound(ListShape)
6380             # note: auto-publishing is done in self.Sew()
6381             anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
6382             return anObj
6383
6384         ## Sewing of the given object.
6385         #  @param theObject Shape to be processed.
6386         #  @param theTolerance Required tolerance value.
6387         #  @param AllowNonManifold Flag that allows non-manifold sewing.
6388         #  @param theName Object name; when specified, this parameter is used
6389         #         for result publication in the study. Otherwise, if automatic
6390         #         publication is switched on, default value is used for result name.
6391         #
6392         #  @return New GEOM.GEOM_Object, containing processed shape.
6393         @ManageTransactions("HealOp")
6394         def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6395             """
6396             Sewing of the given object.
6397
6398             Parameters:
6399                 theObject Shape to be processed.
6400                 theTolerance Required tolerance value.
6401                 AllowNonManifold Flag that allows non-manifold sewing.
6402                 theName Object name; when specified, this parameter is used
6403                         for result publication in the study. Otherwise, if automatic
6404                         publication is switched on, default value is used for result name.
6405
6406             Returns:
6407                 New GEOM.GEOM_Object, containing processed shape.
6408             """
6409             # Example: see MakeSewing() above
6410             theTolerance,Parameters = ParseParameters(theTolerance)
6411             if AllowNonManifold:
6412                 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6413             else:
6414                 anObj = self.HealOp.Sew(theObject, theTolerance)
6415             # To avoid script failure in case of good argument shape
6416             if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6417                 return theObject
6418             RaiseIfFailed("Sew", self.HealOp)
6419             anObj.SetParameters(Parameters)
6420             self._autoPublish(anObj, theName, "sewed")
6421             return anObj
6422
6423         ## Rebuild the topology of theCompound of solids by removing
6424         #  of the faces that are shared by several solids.
6425         #  @param theCompound Shape to be processed.
6426         #  @param theName Object name; when specified, this parameter is used
6427         #         for result publication in the study. Otherwise, if automatic
6428         #         publication is switched on, default value is used for result name.
6429         #
6430         #  @return New GEOM.GEOM_Object, containing processed shape.
6431         #
6432         #  @ref tui_remove_webs "Example"
6433         @ManageTransactions("HealOp")
6434         def RemoveInternalFaces (self, theCompound, theName=None):
6435             """
6436             Rebuild the topology of theCompound of solids by removing
6437             of the faces that are shared by several solids.
6438
6439             Parameters:
6440                 theCompound Shape to be processed.
6441                 theName Object name; when specified, this parameter is used
6442                         for result publication in the study. Otherwise, if automatic
6443                         publication is switched on, default value is used for result name.
6444
6445             Returns:
6446                 New GEOM.GEOM_Object, containing processed shape.
6447             """
6448             # Example: see GEOM_TestHealing.py
6449             anObj = self.HealOp.RemoveInternalFaces(theCompound)
6450             RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6451             self._autoPublish(anObj, theName, "removeWebs")
6452             return anObj
6453
6454         ## Remove internal wires and edges from the given object (face).
6455         #  @param theObject Shape to be processed.
6456         #  @param theWires Indices of wires to be removed, if EMPTY then the method
6457         #                  removes ALL internal wires of the given object.
6458         #  @param theName Object name; when specified, this parameter is used
6459         #         for result publication in the study. Otherwise, if automatic
6460         #         publication is switched on, default value is used for result name.
6461         #
6462         #  @return New GEOM.GEOM_Object, containing processed shape.
6463         #
6464         #  @ref tui_suppress_internal_wires "Example"
6465         @ManageTransactions("HealOp")
6466         def SuppressInternalWires(self, theObject, theWires, theName=None):
6467             """
6468             Remove internal wires and edges from the given object (face).
6469
6470             Parameters:
6471                 theObject Shape to be processed.
6472                 theWires Indices of wires to be removed, if EMPTY then the method
6473                          removes ALL internal wires of the given object.
6474                 theName Object name; when specified, this parameter is used
6475                         for result publication in the study. Otherwise, if automatic
6476                         publication is switched on, default value is used for result name.
6477
6478             Returns:
6479                 New GEOM.GEOM_Object, containing processed shape.
6480             """
6481             # Example: see GEOM_TestHealing.py
6482             anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6483             RaiseIfFailed("RemoveIntWires", self.HealOp)
6484             self._autoPublish(anObj, theName, "suppressWires")
6485             return anObj
6486
6487         ## Remove internal closed contours (holes) from the given object.
6488         #  @param theObject Shape to be processed.
6489         #  @param theWires Indices of wires to be removed, if EMPTY then the method
6490         #                  removes ALL internal holes of the given object
6491         #  @param theName Object name; when specified, this parameter is used
6492         #         for result publication in the study. Otherwise, if automatic
6493         #         publication is switched on, default value is used for result name.
6494         #
6495         #  @return New GEOM.GEOM_Object, containing processed shape.
6496         #
6497         #  @ref tui_suppress_holes "Example"
6498         @ManageTransactions("HealOp")
6499         def SuppressHoles(self, theObject, theWires, theName=None):
6500             """
6501             Remove internal closed contours (holes) from the given object.
6502
6503             Parameters:
6504                 theObject Shape to be processed.
6505                 theWires Indices of wires to be removed, if EMPTY then the method
6506                          removes ALL internal holes of the given object
6507                 theName Object name; when specified, this parameter is used
6508                         for result publication in the study. Otherwise, if automatic
6509                         publication is switched on, default value is used for result name.
6510
6511             Returns:
6512                 New GEOM.GEOM_Object, containing processed shape.
6513             """
6514             # Example: see GEOM_TestHealing.py
6515             anObj = self.HealOp.FillHoles(theObject, theWires)
6516             RaiseIfFailed("FillHoles", self.HealOp)
6517             self._autoPublish(anObj, theName, "suppressHoles")
6518             return anObj
6519
6520         ## Close an open wire.
6521         #  @param theObject Shape to be processed.
6522         #  @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6523         #                  if [ ], then <VAR>theObject</VAR> itself is a wire.
6524         #  @param isCommonVertex If True  : closure by creation of a common vertex,
6525         #                        If False : closure by creation of an edge between ends.
6526         #  @param theName Object name; when specified, this parameter is used
6527         #         for result publication in the study. Otherwise, if automatic
6528         #         publication is switched on, default value is used for result name.
6529         #
6530         #  @return New GEOM.GEOM_Object, containing processed shape.
6531         #
6532         #  @ref tui_close_contour "Example"
6533         @ManageTransactions("HealOp")
6534         def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6535             """
6536             Close an open wire.
6537
6538             Parameters:
6539                 theObject Shape to be processed.
6540                 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6541                          if [ ], then theObject itself is a wire.
6542                 isCommonVertex If True  : closure by creation of a common vertex,
6543                                If False : closure by creation of an edge between ends.
6544                 theName Object name; when specified, this parameter is used
6545                         for result publication in the study. Otherwise, if automatic
6546                         publication is switched on, default value is used for result name.
6547
6548             Returns:
6549                 New GEOM.GEOM_Object, containing processed shape.
6550             """
6551             # Example: see GEOM_TestHealing.py
6552             anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6553             RaiseIfFailed("CloseContour", self.HealOp)
6554             self._autoPublish(anObj, theName, "closeContour")
6555             return anObj
6556
6557         ## Addition of a point to a given edge object.
6558         #  @param theObject Shape to be processed.
6559         #  @param theEdgeIndex Index of edge to be divided within theObject's shape,
6560         #                      if -1, then theObject itself is the edge.
6561         #  @param theValue Value of parameter on edge or length parameter,
6562         #                  depending on \a isByParameter.
6563         #  @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6564         #                       if FALSE : \a theValue is treated as a length parameter [0..1]
6565         #  @param theName Object name; when specified, this parameter is used
6566         #         for result publication in the study. Otherwise, if automatic
6567         #         publication is switched on, default value is used for result name.
6568         #
6569         #  @return New GEOM.GEOM_Object, containing processed shape.
6570         #
6571         #  @ref tui_add_point_on_edge "Example"
6572         @ManageTransactions("HealOp")
6573         def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6574             """
6575             Addition of a point to a given edge object.
6576
6577             Parameters:
6578                 theObject Shape to be processed.
6579                 theEdgeIndex Index of edge to be divided within theObject's shape,
6580                              if -1, then theObject itself is the edge.
6581                 theValue Value of parameter on edge or length parameter,
6582                          depending on isByParameter.
6583                 isByParameter If TRUE :  theValue is treated as a curve parameter [0..1],
6584                               if FALSE : theValue is treated as a length parameter [0..1]
6585                 theName Object name; when specified, this parameter is used
6586                         for result publication in the study. Otherwise, if automatic
6587                         publication is switched on, default value is used for result name.
6588
6589             Returns:
6590                 New GEOM.GEOM_Object, containing processed shape.
6591             """
6592             # Example: see GEOM_TestHealing.py
6593             theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6594             anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6595             RaiseIfFailed("DivideEdge", self.HealOp)
6596             anObj.SetParameters(Parameters)
6597             self._autoPublish(anObj, theName, "divideEdge")
6598             return anObj
6599
6600         ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6601         #  @param theWire Wire to minimize the number of C1 continuous edges in.
6602         #  @param theVertices A list of vertices to suppress. If the list
6603         #                     is empty, all vertices in a wire will be assumed.
6604         #  @param theName Object name; when specified, this parameter is used
6605         #         for result publication in the study. Otherwise, if automatic
6606         #         publication is switched on, default value is used for result name.
6607         #
6608         #  @return New GEOM.GEOM_Object with modified wire.
6609         #
6610         #  @ref tui_fuse_collinear_edges "Example"
6611         @ManageTransactions("HealOp")
6612         def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6613             """
6614             Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6615
6616             Parameters:
6617                 theWire Wire to minimize the number of C1 continuous edges in.
6618                 theVertices A list of vertices to suppress. If the list
6619                             is empty, all vertices in a wire will be assumed.
6620                 theName Object name; when specified, this parameter is used
6621                         for result publication in the study. Otherwise, if automatic
6622                         publication is switched on, default value is used for result name.
6623
6624             Returns:
6625                 New GEOM.GEOM_Object with modified wire.
6626             """
6627             anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6628             RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6629             self._autoPublish(anObj, theName, "fuseEdges")
6630             return anObj
6631
6632         ## Change orientation of the given object. Updates given shape.
6633         #  @param theObject Shape to be processed.
6634         #  @return Updated <var>theObject</var>
6635         #
6636         #  @ref swig_todo "Example"
6637         @ManageTransactions("HealOp")
6638         def ChangeOrientationShell(self,theObject):
6639             """
6640             Change orientation of the given object. Updates given shape.
6641
6642             Parameters:
6643                 theObject Shape to be processed.
6644
6645             Returns:
6646                 Updated theObject
6647             """
6648             theObject = self.HealOp.ChangeOrientation(theObject)
6649             RaiseIfFailed("ChangeOrientation", self.HealOp)
6650             pass
6651
6652         ## Change orientation of the given object.
6653         #  @param theObject Shape to be processed.
6654         #  @param theName Object name; when specified, this parameter is used
6655         #         for result publication in the study. Otherwise, if automatic
6656         #         publication is switched on, default value is used for result name.
6657         #
6658         #  @return New GEOM.GEOM_Object, containing processed shape.
6659         #
6660         #  @ref swig_todo "Example"
6661         @ManageTransactions("HealOp")
6662         def ChangeOrientationShellCopy(self, theObject, theName=None):
6663             """
6664             Change orientation of the given object.
6665
6666             Parameters:
6667                 theObject Shape to be processed.
6668                 theName Object name; when specified, this parameter is used
6669                         for result publication in the study. Otherwise, if automatic
6670                         publication is switched on, default value is used for result name.
6671
6672             Returns:
6673                 New GEOM.GEOM_Object, containing processed shape.
6674             """
6675             anObj = self.HealOp.ChangeOrientationCopy(theObject)
6676             RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6677             self._autoPublish(anObj, theName, "reversed")
6678             return anObj
6679
6680         ## Try to limit tolerance of the given object by value \a theTolerance.
6681         #  @param theObject Shape to be processed.
6682         #  @param theTolerance Required tolerance value.
6683         #  @param theName Object name; when specified, this parameter is used
6684         #         for result publication in the study. Otherwise, if automatic
6685         #         publication is switched on, default value is used for result name.
6686         #
6687         #  @return New GEOM.GEOM_Object, containing processed shape.
6688         #
6689         #  @ref tui_limit_tolerance "Example"
6690         @ManageTransactions("HealOp")
6691         def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6692             """
6693             Try to limit tolerance of the given object by value theTolerance.
6694
6695             Parameters:
6696                 theObject Shape to be processed.
6697                 theTolerance Required tolerance value.
6698                 theName Object name; when specified, this parameter is used
6699                         for result publication in the study. Otherwise, if automatic
6700                         publication is switched on, default value is used for result name.
6701
6702             Returns:
6703                 New GEOM.GEOM_Object, containing processed shape.
6704             """
6705             anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6706             RaiseIfFailed("LimitTolerance", self.HealOp)
6707             self._autoPublish(anObj, theName, "limitTolerance")
6708             return anObj
6709
6710         ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6711         #  that constitute a free boundary of the given shape.
6712         #  @param theObject Shape to get free boundary of.
6713         #  @param theName Object name; when specified, this parameter is used
6714         #         for result publication in the study. Otherwise, if automatic
6715         #         publication is switched on, default value is used for result name.
6716         #
6717         #  @return [\a status, \a theClosedWires, \a theOpenWires]
6718         #  \n \a status: FALSE, if an error(s) occured during the method execution.
6719         #  \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6720         #  \n \a theOpenWires: Open wires on the free boundary of the given shape.
6721         #
6722         #  @ref tui_measurement_tools_page "Example"
6723         @ManageTransactions("HealOp")
6724         def GetFreeBoundary(self, theObject, theName=None):
6725             """
6726             Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6727             that constitute a free boundary of the given shape.
6728
6729             Parameters:
6730                 theObject Shape to get free boundary of.
6731                 theName Object name; when specified, this parameter is used
6732                         for result publication in the study. Otherwise, if automatic
6733                         publication is switched on, default value is used for result name.
6734
6735             Returns:
6736                 [status, theClosedWires, theOpenWires]
6737                  status: FALSE, if an error(s) occured during the method execution.
6738                  theClosedWires: Closed wires on the free boundary of the given shape.
6739                  theOpenWires: Open wires on the free boundary of the given shape.
6740             """
6741             # Example: see GEOM_TestHealing.py
6742             anObj = self.HealOp.GetFreeBoundary(theObject)
6743             RaiseIfFailed("GetFreeBoundary", self.HealOp)
6744             self._autoPublish(anObj[1], theName, "closedWire")
6745             self._autoPublish(anObj[2], theName, "openWire")
6746             return anObj
6747
6748         ## Replace coincident faces in theShape by one face.
6749         #  @param theShape Initial shape.
6750         #  @param theTolerance Maximum distance between faces, which can be considered as coincident.
6751         #  @param doKeepNonSolids If FALSE, only solids will present in the result,
6752         #                         otherwise all initial shapes.
6753         #  @param theName Object name; when specified, this parameter is used
6754         #         for result publication in the study. Otherwise, if automatic
6755         #         publication is switched on, default value is used for result name.
6756         #
6757         #  @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6758         #
6759         #  @ref tui_glue_faces "Example"
6760         @ManageTransactions("ShapesOp")
6761         def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6762             """
6763             Replace coincident faces in theShape by one face.
6764
6765             Parameters:
6766                 theShape Initial shape.
6767                 theTolerance Maximum distance between faces, which can be considered as coincident.
6768                 doKeepNonSolids If FALSE, only solids will present in the result,
6769                                 otherwise all initial shapes.
6770                 theName Object name; when specified, this parameter is used
6771                         for result publication in the study. Otherwise, if automatic
6772                         publication is switched on, default value is used for result name.
6773
6774             Returns:
6775                 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6776             """
6777             # Example: see GEOM_Spanner.py
6778             theTolerance,Parameters = ParseParameters(theTolerance)
6779             anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6780             if anObj is None:
6781                 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6782             anObj.SetParameters(Parameters)
6783             self._autoPublish(anObj, theName, "glueFaces")
6784             return anObj
6785
6786         ## Find coincident faces in theShape for possible gluing.
6787         #  @param theShape Initial shape.
6788         #  @param theTolerance Maximum distance between faces,
6789         #                      which can be considered as coincident.
6790         #  @param theName Object name; when specified, this parameter is used
6791         #         for result publication in the study. Otherwise, if automatic
6792         #         publication is switched on, default value is used for result name.
6793         #
6794         #  @return GEOM.ListOfGO
6795         #
6796         #  @ref tui_glue_faces "Example"
6797         @ManageTransactions("ShapesOp")
6798         def GetGlueFaces(self, theShape, theTolerance, theName=None):
6799             """
6800             Find coincident faces in theShape for possible gluing.
6801
6802             Parameters:
6803                 theShape Initial shape.
6804                 theTolerance Maximum distance between faces,
6805                              which can be considered as coincident.
6806                 theName Object name; when specified, this parameter is used
6807                         for result publication in the study. Otherwise, if automatic
6808                         publication is switched on, default value is used for result name.
6809
6810             Returns:
6811                 GEOM.ListOfGO
6812             """
6813             anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6814             RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6815             self._autoPublish(anObj, theName, "facesToGlue")
6816             return anObj
6817
6818         ## Replace coincident faces in theShape by one face
6819         #  in compliance with given list of faces
6820         #  @param theShape Initial shape.
6821         #  @param theTolerance Maximum distance between faces,
6822         #                      which can be considered as coincident.
6823         #  @param theFaces List of faces for gluing.
6824         #  @param doKeepNonSolids If FALSE, only solids will present in the result,
6825         #                         otherwise all initial shapes.
6826         #  @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6827         #                        will be glued, otherwise only the edges,
6828         #                        belonging to <VAR>theFaces</VAR>.
6829         #  @param theName Object name; when specified, this parameter is used
6830         #         for result publication in the study. Otherwise, if automatic
6831         #         publication is switched on, default value is used for result name.
6832         #
6833         #  @return New GEOM.GEOM_Object, containing a copy of theShape
6834         #          without some faces.
6835         #
6836         #  @ref tui_glue_faces "Example"
6837         @ManageTransactions("ShapesOp")
6838         def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6839                                 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6840             """
6841             Replace coincident faces in theShape by one face
6842             in compliance with given list of faces
6843
6844             Parameters:
6845                 theShape Initial shape.
6846                 theTolerance Maximum distance between faces,
6847                              which can be considered as coincident.
6848                 theFaces List of faces for gluing.
6849                 doKeepNonSolids If FALSE, only solids will present in the result,
6850                                 otherwise all initial shapes.
6851                 doGlueAllEdges If TRUE, all coincident edges of theShape
6852                                will be glued, otherwise only the edges,
6853                                belonging to theFaces.
6854                 theName Object name; when specified, this parameter is used
6855                         for result publication in the study. Otherwise, if automatic
6856                         publication is switched on, default value is used for result name.
6857
6858             Returns:
6859                 New GEOM.GEOM_Object, containing a copy of theShape
6860                     without some faces.
6861             """
6862             anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6863                                                       doKeepNonSolids, doGlueAllEdges)
6864             if anObj is None:
6865                 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6866             self._autoPublish(anObj, theName, "glueFaces")
6867             return anObj
6868
6869         ## Replace coincident edges in theShape by one edge.
6870         #  @param theShape Initial shape.
6871         #  @param theTolerance Maximum distance between edges, which can be considered as coincident.
6872         #  @param theName Object name; when specified, this parameter is used
6873         #         for result publication in the study. Otherwise, if automatic
6874         #         publication is switched on, default value is used for result name.
6875         #
6876         #  @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6877         #
6878         #  @ref tui_glue_edges "Example"
6879         @ManageTransactions("ShapesOp")
6880         def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6881             """
6882             Replace coincident edges in theShape by one edge.
6883
6884             Parameters:
6885                 theShape Initial shape.
6886                 theTolerance Maximum distance between edges, which can be considered as coincident.
6887                 theName Object name; when specified, this parameter is used
6888                         for result publication in the study. Otherwise, if automatic
6889                         publication is switched on, default value is used for result name.
6890
6891             Returns:
6892                 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6893             """
6894             theTolerance,Parameters = ParseParameters(theTolerance)
6895             anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6896             if anObj is None:
6897                 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6898             anObj.SetParameters(Parameters)
6899             self._autoPublish(anObj, theName, "glueEdges")
6900             return anObj
6901
6902         ## Find coincident edges in theShape for possible gluing.
6903         #  @param theShape Initial shape.
6904         #  @param theTolerance Maximum distance between edges,
6905         #                      which can be considered as coincident.
6906         #  @param theName Object name; when specified, this parameter is used
6907         #         for result publication in the study. Otherwise, if automatic
6908         #         publication is switched on, default value is used for result name.
6909         #
6910         #  @return GEOM.ListOfGO
6911         #
6912         #  @ref tui_glue_edges "Example"
6913         @ManageTransactions("ShapesOp")
6914         def GetGlueEdges(self, theShape, theTolerance, theName=None):
6915             """
6916             Find coincident edges in theShape for possible gluing.
6917
6918             Parameters:
6919                 theShape Initial shape.
6920                 theTolerance Maximum distance between edges,
6921                              which can be considered as coincident.
6922                 theName Object name; when specified, this parameter is used
6923                         for result publication in the study. Otherwise, if automatic
6924                         publication is switched on, default value is used for result name.
6925
6926             Returns:
6927                 GEOM.ListOfGO
6928             """
6929             anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6930             RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6931             self._autoPublish(anObj, theName, "edgesToGlue")
6932             return anObj
6933
6934         ## Replace coincident edges in theShape by one edge
6935         #  in compliance with given list of edges.
6936         #  @param theShape Initial shape.
6937         #  @param theTolerance Maximum distance between edges,
6938         #                      which can be considered as coincident.
6939         #  @param theEdges List of edges for gluing.
6940         #  @param theName Object name; when specified, this parameter is used
6941         #         for result publication in the study. Otherwise, if automatic
6942         #         publication is switched on, default value is used for result name.
6943         #
6944         #  @return New GEOM.GEOM_Object, containing a copy of theShape
6945         #          without some edges.
6946         #
6947         #  @ref tui_glue_edges "Example"
6948         @ManageTransactions("ShapesOp")
6949         def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6950             """
6951             Replace coincident edges in theShape by one edge
6952             in compliance with given list of edges.
6953
6954             Parameters:
6955                 theShape Initial shape.
6956                 theTolerance Maximum distance between edges,
6957                              which can be considered as coincident.
6958                 theEdges List of edges for gluing.
6959                 theName Object name; when specified, this parameter is used
6960                         for result publication in the study. Otherwise, if automatic
6961                         publication is switched on, default value is used for result name.
6962
6963             Returns:
6964                 New GEOM.GEOM_Object, containing a copy of theShape
6965                 without some edges.
6966             """
6967             anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6968             if anObj is None:
6969                 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6970             self._autoPublish(anObj, theName, "glueEdges")
6971             return anObj
6972
6973         # end of l3_healing
6974         ## @}
6975
6976         ## @addtogroup l3_boolean Boolean Operations
6977         ## @{
6978
6979         # -----------------------------------------------------------------------------
6980         # Boolean (Common, Cut, Fuse, Section)
6981         # -----------------------------------------------------------------------------
6982
6983         ## Perform one of boolean operations on two given shapes.
6984         #  @param theShape1 First argument for boolean operation.
6985         #  @param theShape2 Second argument for boolean operation.
6986         #  @param theOperation Indicates the operation to be done:\n
6987         #                      1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6988         #  @param checkSelfInte The flag that tells if the arguments should
6989         #         be checked for self-intersection prior to the operation.
6990         #  @param theName Object name; when specified, this parameter is used
6991         #         for result publication in the study. Otherwise, if automatic
6992         #         publication is switched on, default value is used for result name.
6993         #
6994         #  @note This algorithm doesn't find all types of self-intersections.
6995         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6996         #        vertex/face and edge/face intersections. Face/face
6997         #        intersections detection is switched off as it is a
6998         #        time-consuming operation that gives an impact on performance.
6999         #        To find all self-intersections please use
7000         #        CheckSelfIntersections() method.
7001         #
7002         #  @return New GEOM.GEOM_Object, containing the result shape.
7003         #
7004         #  @ref tui_fuse "Example"
7005         @ManageTransactions("BoolOp")
7006         def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
7007             """
7008             Perform one of boolean operations on two given shapes.
7009
7010             Parameters:
7011                 theShape1 First argument for boolean operation.
7012                 theShape2 Second argument for boolean operation.
7013                 theOperation Indicates the operation to be done:
7014                              1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7015                 checkSelfInte The flag that tells if the arguments should
7016                               be checked for self-intersection prior to
7017                               the operation.
7018                 theName Object name; when specified, this parameter is used
7019                         for result publication in the study. Otherwise, if automatic
7020                         publication is switched on, default value is used for result name.
7021
7022             Note:
7023                     This algorithm doesn't find all types of self-intersections.
7024                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7025                     vertex/face and edge/face intersections. Face/face
7026                     intersections detection is switched off as it is a
7027                     time-consuming operation that gives an impact on performance.
7028                     To find all self-intersections please use
7029                     CheckSelfIntersections() method.
7030
7031             Returns:
7032                 New GEOM.GEOM_Object, containing the result shape.
7033             """
7034             # Example: see GEOM_TestAll.py
7035             anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7036             RaiseIfFailed("MakeBoolean", self.BoolOp)
7037             def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7038             self._autoPublish(anObj, theName, def_names[theOperation])
7039             return anObj
7040
7041         ## Perform Common boolean operation on two given shapes.
7042         #  @param theShape1 First argument for boolean operation.
7043         #  @param theShape2 Second argument for boolean operation.
7044         #  @param checkSelfInte The flag that tells if the arguments should
7045         #         be checked for self-intersection prior to the operation.
7046         #  @param theName Object name; when specified, this parameter is used
7047         #         for result publication in the study. Otherwise, if automatic
7048         #         publication is switched on, default value is used for result name.
7049         #
7050         #  @note This algorithm doesn't find all types of self-intersections.
7051         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7052         #        vertex/face and edge/face intersections. Face/face
7053         #        intersections detection is switched off as it is a
7054         #        time-consuming operation that gives an impact on performance.
7055         #        To find all self-intersections please use
7056         #        CheckSelfIntersections() method.
7057         #
7058         #  @return New GEOM.GEOM_Object, containing the result shape.
7059         #
7060         #  @ref tui_common "Example 1"
7061         #  \n @ref swig_MakeCommon "Example 2"
7062         def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7063             """
7064             Perform Common boolean operation on two given shapes.
7065
7066             Parameters:
7067                 theShape1 First argument for boolean operation.
7068                 theShape2 Second argument for boolean operation.
7069                 checkSelfInte The flag that tells if the arguments should
7070                               be checked for self-intersection prior to
7071                               the operation.
7072                 theName Object name; when specified, this parameter is used
7073                         for result publication in the study. Otherwise, if automatic
7074                         publication is switched on, default value is used for result name.
7075
7076             Note:
7077                     This algorithm doesn't find all types of self-intersections.
7078                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7079                     vertex/face and edge/face intersections. Face/face
7080                     intersections detection is switched off as it is a
7081                     time-consuming operation that gives an impact on performance.
7082                     To find all self-intersections please use
7083                     CheckSelfIntersections() method.
7084
7085             Returns:
7086                 New GEOM.GEOM_Object, containing the result shape.
7087             """
7088             # Example: see GEOM_TestOthers.py
7089             # note: auto-publishing is done in self.MakeBoolean()
7090             return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7091
7092         ## Perform Cut boolean operation on two given shapes.
7093         #  @param theShape1 First argument for boolean operation.
7094         #  @param theShape2 Second argument for boolean operation.
7095         #  @param checkSelfInte The flag that tells if the arguments should
7096         #         be checked for self-intersection prior to the operation.
7097         #  @param theName Object name; when specified, this parameter is used
7098         #         for result publication in the study. Otherwise, if automatic
7099         #         publication is switched on, default value is used for result name.
7100         #
7101         #  @note This algorithm doesn't find all types of self-intersections.
7102         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7103         #        vertex/face and edge/face intersections. Face/face
7104         #        intersections detection is switched off as it is a
7105         #        time-consuming operation that gives an impact on performance.
7106         #        To find all self-intersections please use
7107         #        CheckSelfIntersections() method.
7108         #
7109         #  @return New GEOM.GEOM_Object, containing the result shape.
7110         #
7111         #  @ref tui_cut "Example 1"
7112         #  \n @ref swig_MakeCommon "Example 2"
7113         def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7114             """
7115             Perform Cut boolean operation on two given shapes.
7116
7117             Parameters:
7118                 theShape1 First argument for boolean operation.
7119                 theShape2 Second argument for boolean operation.
7120                 checkSelfInte The flag that tells if the arguments should
7121                               be checked for self-intersection prior to
7122                               the operation.
7123                 theName Object name; when specified, this parameter is used
7124                         for result publication in the study. Otherwise, if automatic
7125                         publication is switched on, default value is used for result name.
7126
7127             Note:
7128                     This algorithm doesn't find all types of self-intersections.
7129                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7130                     vertex/face and edge/face intersections. Face/face
7131                     intersections detection is switched off as it is a
7132                     time-consuming operation that gives an impact on performance.
7133                     To find all self-intersections please use
7134                     CheckSelfIntersections() method.
7135
7136             Returns:
7137                 New GEOM.GEOM_Object, containing the result shape.
7138
7139             """
7140             # Example: see GEOM_TestOthers.py
7141             # note: auto-publishing is done in self.MakeBoolean()
7142             return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7143
7144         ## Perform Fuse boolean operation on two given shapes.
7145         #  @param theShape1 First argument for boolean operation.
7146         #  @param theShape2 Second argument for boolean operation.
7147         #  @param checkSelfInte The flag that tells if the arguments should
7148         #         be checked for self-intersection prior to the operation.
7149         #  @param rmExtraEdges The flag that tells if Remove Extra Edges
7150         #         operation should be performed during the operation.
7151         #  @param theName Object name; when specified, this parameter is used
7152         #         for result publication in the study. Otherwise, if automatic
7153         #         publication is switched on, default value is used for result name.
7154         #
7155         #  @note This algorithm doesn't find all types of self-intersections.
7156         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7157         #        vertex/face and edge/face intersections. Face/face
7158         #        intersections detection is switched off as it is a
7159         #        time-consuming operation that gives an impact on performance.
7160         #        To find all self-intersections please use
7161         #        CheckSelfIntersections() method.
7162         #
7163         #  @return New GEOM.GEOM_Object, containing the result shape.
7164         #
7165         #  @ref tui_fuse "Example 1"
7166         #  \n @ref swig_MakeCommon "Example 2"
7167         @ManageTransactions("BoolOp")
7168         def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7169                      rmExtraEdges=False, theName=None):
7170             """
7171             Perform Fuse boolean operation on two given shapes.
7172
7173             Parameters:
7174                 theShape1 First argument for boolean operation.
7175                 theShape2 Second argument for boolean operation.
7176                 checkSelfInte The flag that tells if the arguments should
7177                               be checked for self-intersection prior to
7178                               the operation.
7179                 rmExtraEdges The flag that tells if Remove Extra Edges
7180                              operation should be performed during the operation.
7181                 theName Object name; when specified, this parameter is used
7182                         for result publication in the study. Otherwise, if automatic
7183                         publication is switched on, default value is used for result name.
7184
7185             Note:
7186                     This algorithm doesn't find all types of self-intersections.
7187                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7188                     vertex/face and edge/face intersections. Face/face
7189                     intersections detection is switched off as it is a
7190                     time-consuming operation that gives an impact on performance.
7191                     To find all self-intersections please use
7192                     CheckSelfIntersections() method.
7193
7194             Returns:
7195                 New GEOM.GEOM_Object, containing the result shape.
7196
7197             """
7198             # Example: see GEOM_TestOthers.py
7199             anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7200                                          checkSelfInte, rmExtraEdges)
7201             RaiseIfFailed("MakeFuse", self.BoolOp)
7202             self._autoPublish(anObj, theName, "fuse")
7203             return anObj
7204
7205         ## Perform Section boolean operation on two given shapes.
7206         #  @param theShape1 First argument for boolean operation.
7207         #  @param theShape2 Second argument for boolean operation.
7208         #  @param checkSelfInte The flag that tells if the arguments should
7209         #         be checked for self-intersection prior to the operation.
7210         #  @param theName Object name; when specified, this parameter is used
7211         #         for result publication in the study. Otherwise, if automatic
7212         #         publication is switched on, default value is used for result name.
7213         #
7214         #  @note This algorithm doesn't find all types of self-intersections.
7215         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7216         #        vertex/face and edge/face intersections. Face/face
7217         #        intersections detection is switched off as it is a
7218         #        time-consuming operation that gives an impact on performance.
7219         #        To find all self-intersections please use
7220         #        CheckSelfIntersections() method.
7221         #
7222         #  @return New GEOM.GEOM_Object, containing the result shape.
7223         #
7224         #  @ref tui_section "Example 1"
7225         #  \n @ref swig_MakeCommon "Example 2"
7226         def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7227             """
7228             Perform Section boolean operation on two given shapes.
7229
7230             Parameters:
7231                 theShape1 First argument for boolean operation.
7232                 theShape2 Second argument for boolean operation.
7233                 checkSelfInte The flag that tells if the arguments should
7234                               be checked for self-intersection prior to
7235                               the operation.
7236                 theName Object name; when specified, this parameter is used
7237                         for result publication in the study. Otherwise, if automatic
7238                         publication is switched on, default value is used for result name.
7239
7240             Note:
7241                     This algorithm doesn't find all types of self-intersections.
7242                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7243                     vertex/face and edge/face intersections. Face/face
7244                     intersections detection is switched off as it is a
7245                     time-consuming operation that gives an impact on performance.
7246                     To find all self-intersections please use
7247                     CheckSelfIntersections() method.
7248
7249             Returns:
7250                 New GEOM.GEOM_Object, containing the result shape.
7251
7252             """
7253             # Example: see GEOM_TestOthers.py
7254             # note: auto-publishing is done in self.MakeBoolean()
7255             return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7256
7257         ## Perform Fuse boolean operation on the list of shapes.
7258         #  @param theShapesList Shapes to be fused.
7259         #  @param checkSelfInte The flag that tells if the arguments should
7260         #         be checked for self-intersection prior to the operation.
7261         #  @param rmExtraEdges The flag that tells if Remove Extra Edges
7262         #         operation should be performed during the operation.
7263         #  @param theName Object name; when specified, this parameter is used
7264         #         for result publication in the study. Otherwise, if automatic
7265         #         publication is switched on, default value is used for result name.
7266         #
7267         #  @note This algorithm doesn't find all types of self-intersections.
7268         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7269         #        vertex/face and edge/face intersections. Face/face
7270         #        intersections detection is switched off as it is a
7271         #        time-consuming operation that gives an impact on performance.
7272         #        To find all self-intersections please use
7273         #        CheckSelfIntersections() method.
7274         #
7275         #  @return New GEOM.GEOM_Object, containing the result shape.
7276         #
7277         #  @ref tui_fuse "Example 1"
7278         #  \n @ref swig_MakeCommon "Example 2"
7279         @ManageTransactions("BoolOp")
7280         def MakeFuseList(self, theShapesList, checkSelfInte=False,
7281                          rmExtraEdges=False, theName=None):
7282             """
7283             Perform Fuse boolean operation on the list of shapes.
7284
7285             Parameters:
7286                 theShapesList Shapes to be fused.
7287                 checkSelfInte The flag that tells if the arguments should
7288                               be checked for self-intersection prior to
7289                               the operation.
7290                 rmExtraEdges The flag that tells if Remove Extra Edges
7291                              operation should be performed during the operation.
7292                 theName Object name; when specified, this parameter is used
7293                         for result publication in the study. Otherwise, if automatic
7294                         publication is switched on, default value is used for result name.
7295
7296             Note:
7297                     This algorithm doesn't find all types of self-intersections.
7298                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7299                     vertex/face and edge/face intersections. Face/face
7300                     intersections detection is switched off as it is a
7301                     time-consuming operation that gives an impact on performance.
7302                     To find all self-intersections please use
7303                     CheckSelfIntersections() method.
7304
7305             Returns:
7306                 New GEOM.GEOM_Object, containing the result shape.
7307
7308             """
7309             # Example: see GEOM_TestOthers.py
7310             anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7311                                              rmExtraEdges)
7312             RaiseIfFailed("MakeFuseList", self.BoolOp)
7313             self._autoPublish(anObj, theName, "fuse")
7314             return anObj
7315
7316         ## Perform Common boolean operation on the list of shapes.
7317         #  @param theShapesList Shapes for Common operation.
7318         #  @param checkSelfInte The flag that tells if the arguments should
7319         #         be checked for self-intersection prior to the operation.
7320         #  @param theName Object name; when specified, this parameter is used
7321         #         for result publication in the study. Otherwise, if automatic
7322         #         publication is switched on, default value is used for result name.
7323         #
7324         #  @note This algorithm doesn't find all types of self-intersections.
7325         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7326         #        vertex/face and edge/face intersections. Face/face
7327         #        intersections detection is switched off as it is a
7328         #        time-consuming operation that gives an impact on performance.
7329         #        To find all self-intersections please use
7330         #        CheckSelfIntersections() method.
7331         #
7332         #  @return New GEOM.GEOM_Object, containing the result shape.
7333         #
7334         #  @ref tui_common "Example 1"
7335         #  \n @ref swig_MakeCommon "Example 2"
7336         @ManageTransactions("BoolOp")
7337         def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7338             """
7339             Perform Common boolean operation on the list of shapes.
7340
7341             Parameters:
7342                 theShapesList Shapes for Common operation.
7343                 checkSelfInte The flag that tells if the arguments should
7344                               be checked for self-intersection prior to
7345                               the operation.
7346                 theName Object name; when specified, this parameter is used
7347                         for result publication in the study. Otherwise, if automatic
7348                         publication is switched on, default value is used for result name.
7349
7350             Note:
7351                     This algorithm doesn't find all types of self-intersections.
7352                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7353                     vertex/face and edge/face intersections. Face/face
7354                     intersections detection is switched off as it is a
7355                     time-consuming operation that gives an impact on performance.
7356                     To find all self-intersections please use
7357                     CheckSelfIntersections() method.
7358
7359             Returns:
7360                 New GEOM.GEOM_Object, containing the result shape.
7361
7362             """
7363             # Example: see GEOM_TestOthers.py
7364             anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7365             RaiseIfFailed("MakeCommonList", self.BoolOp)
7366             self._autoPublish(anObj, theName, "common")
7367             return anObj
7368
7369         ## Perform Cut boolean operation on one object and the list of tools.
7370         #  @param theMainShape The object of the operation.
7371         #  @param theShapesList The list of tools of the operation.
7372         #  @param checkSelfInte The flag that tells if the arguments should
7373         #         be checked for self-intersection prior to the operation.
7374         #  @param theName Object name; when specified, this parameter is used
7375         #         for result publication in the study. Otherwise, if automatic
7376         #         publication is switched on, default value is used for result name.
7377         #
7378         #  @note This algorithm doesn't find all types of self-intersections.
7379         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7380         #        vertex/face and edge/face intersections. Face/face
7381         #        intersections detection is switched off as it is a
7382         #        time-consuming operation that gives an impact on performance.
7383         #        To find all self-intersections please use
7384         #        CheckSelfIntersections() method.
7385         #
7386         #  @return New GEOM.GEOM_Object, containing the result shape.
7387         #
7388         #  @ref tui_cut "Example 1"
7389         #  \n @ref swig_MakeCommon "Example 2"
7390         @ManageTransactions("BoolOp")
7391         def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7392             """
7393             Perform Cut boolean operation on one object and the list of tools.
7394
7395             Parameters:
7396                 theMainShape The object of the operation.
7397                 theShapesList The list of tools of the operation.
7398                 checkSelfInte The flag that tells if the arguments should
7399                               be checked for self-intersection prior to
7400                               the operation.
7401                 theName Object name; when specified, this parameter is used
7402                         for result publication in the study. Otherwise, if automatic
7403                         publication is switched on, default value is used for result name.
7404
7405             Note:
7406                     This algorithm doesn't find all types of self-intersections.
7407                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7408                     vertex/face and edge/face intersections. Face/face
7409                     intersections detection is switched off as it is a
7410                     time-consuming operation that gives an impact on performance.
7411                     To find all self-intersections please use
7412                     CheckSelfIntersections() method.
7413
7414             Returns:
7415                 New GEOM.GEOM_Object, containing the result shape.
7416
7417             """
7418             # Example: see GEOM_TestOthers.py
7419             anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7420             RaiseIfFailed("MakeCutList", self.BoolOp)
7421             self._autoPublish(anObj, theName, "cut")
7422             return anObj
7423
7424         # end of l3_boolean
7425         ## @}
7426
7427         ## @addtogroup l3_basic_op
7428         ## @{
7429
7430         ## Perform partition operation.
7431         #  @param ListShapes Shapes to be intersected.
7432         #  @param ListTools Shapes to intersect theShapes.
7433         #  @param Limit Type of resulting shapes (see ShapeType()).\n
7434         #         If this parameter is set to -1 ("Auto"), most appropriate shape limit
7435         #         type will be detected automatically.
7436         #  @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7437         #                             target type (equal to Limit) are kept in the result,
7438         #                             else standalone shapes of lower dimension
7439         #                             are kept also (if they exist).
7440         #
7441         #  @param theName Object name; when specified, this parameter is used
7442         #         for result publication in the study. Otherwise, if automatic
7443         #         publication is switched on, default value is used for result name.
7444         #
7445         #  @note Each compound from ListShapes and ListTools will be exploded
7446         #        in order to avoid possible intersection between shapes from this compound.
7447         #
7448         #  After implementation new version of PartitionAlgo (October 2006)
7449         #  other parameters are ignored by current functionality. They are kept
7450         #  in this function only for support old versions.
7451         #      @param ListKeepInside Shapes, outside which the results will be deleted.
7452         #         Each shape from theKeepInside must belong to theShapes also.
7453         #      @param ListRemoveInside Shapes, inside which the results will be deleted.
7454         #         Each shape from theRemoveInside must belong to theShapes also.
7455         #      @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7456         #      @param ListMaterials Material indices for each shape. Make sence,
7457         #         only if theRemoveWebs is TRUE.
7458         #
7459         #  @return New GEOM.GEOM_Object, containing the result shapes.
7460         #
7461         #  @ref tui_partition "Example"
7462         @ManageTransactions("BoolOp")
7463         def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7464                           Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7465                           KeepNonlimitShapes=0, theName=None):
7466             """
7467             Perform partition operation.
7468
7469             Parameters:
7470                 ListShapes Shapes to be intersected.
7471                 ListTools Shapes to intersect theShapes.
7472                 Limit Type of resulting shapes (see geompy.ShapeType)
7473                       If this parameter is set to -1 ("Auto"), most appropriate shape limit
7474                       type will be detected automatically.
7475                 KeepNonlimitShapes if this parameter == 0, then only shapes of
7476                                     target type (equal to Limit) are kept in the result,
7477                                     else standalone shapes of lower dimension
7478                                     are kept also (if they exist).
7479
7480                 theName Object name; when specified, this parameter is used
7481                         for result publication in the study. Otherwise, if automatic
7482                         publication is switched on, default value is used for result name.
7483             Note:
7484                     Each compound from ListShapes and ListTools will be exploded
7485                     in order to avoid possible intersection between shapes from
7486                     this compound.
7487
7488             After implementation new version of PartitionAlgo (October 2006) other
7489             parameters are ignored by current functionality. They are kept in this
7490             function only for support old versions.
7491
7492             Ignored parameters:
7493                 ListKeepInside Shapes, outside which the results will be deleted.
7494                                Each shape from theKeepInside must belong to theShapes also.
7495                 ListRemoveInside Shapes, inside which the results will be deleted.
7496                                  Each shape from theRemoveInside must belong to theShapes also.
7497                 RemoveWebs If TRUE, perform Glue 3D algorithm.
7498                 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7499
7500             Returns:
7501                 New GEOM.GEOM_Object, containing the result shapes.
7502             """
7503             # Example: see GEOM_TestAll.py
7504             if Limit == self.ShapeType["AUTO"]:
7505                 # automatic detection of the most appropriate shape limit type
7506                 lim = GEOM.SHAPE
7507                 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7508                 Limit = EnumToLong(lim)
7509                 pass
7510             anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7511                                               ListKeepInside, ListRemoveInside,
7512                                               Limit, RemoveWebs, ListMaterials,
7513                                               KeepNonlimitShapes);
7514             RaiseIfFailed("MakePartition", self.BoolOp)
7515             self._autoPublish(anObj, theName, "partition")
7516             return anObj
7517
7518         ## Perform partition operation.
7519         #  This method may be useful if it is needed to make a partition for
7520         #  compound contains nonintersected shapes. Performance will be better
7521         #  since intersection between shapes from compound is not performed.
7522         #
7523         #  Description of all parameters as in previous method MakePartition().
7524         #  One additional parameter is provided:
7525         #  @param checkSelfInte The flag that tells if the arguments should
7526         #         be checked for self-intersection prior to the operation.
7527         #
7528         #  @note This algorithm doesn't find all types of self-intersections.
7529         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7530         #        vertex/face and edge/face intersections. Face/face
7531         #        intersections detection is switched off as it is a
7532         #        time-consuming operation that gives an impact on performance.
7533         #        To find all self-intersections please use
7534         #        CheckSelfIntersections() method.
7535         #
7536         #  @note Passed compounds (via ListShapes or via ListTools)
7537         #           have to consist of nonintersecting shapes.
7538         #
7539         #  @return New GEOM.GEOM_Object, containing the result shapes.
7540         #
7541         #  @ref swig_todo "Example"
7542         @ManageTransactions("BoolOp")
7543         def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7544                                                  ListKeepInside=[], ListRemoveInside=[],
7545                                                  Limit=ShapeType["AUTO"], RemoveWebs=0,
7546                                                  ListMaterials=[], KeepNonlimitShapes=0,
7547                                                  checkSelfInte=False, theName=None):
7548             """
7549             Perform partition operation.
7550             This method may be useful if it is needed to make a partition for
7551             compound contains nonintersected shapes. Performance will be better
7552             since intersection between shapes from compound is not performed.
7553
7554             Parameters:
7555                 Description of all parameters as in method geompy.MakePartition.
7556                 One additional parameter is provided:
7557                 checkSelfInte The flag that tells if the arguments should
7558                               be checked for self-intersection prior to
7559                               the operation.
7560
7561             Note:
7562                     This algorithm doesn't find all types of self-intersections.
7563                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7564                     vertex/face and edge/face intersections. Face/face
7565                     intersections detection is switched off as it is a
7566                     time-consuming operation that gives an impact on performance.
7567                     To find all self-intersections please use
7568                     CheckSelfIntersections() method.
7569
7570             NOTE:
7571                 Passed compounds (via ListShapes or via ListTools)
7572                 have to consist of nonintersecting shapes.
7573
7574             Returns:
7575                 New GEOM.GEOM_Object, containing the result shapes.
7576             """
7577             if Limit == self.ShapeType["AUTO"]:
7578                 # automatic detection of the most appropriate shape limit type
7579                 lim = GEOM.SHAPE
7580                 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7581                 Limit = EnumToLong(lim)
7582                 pass
7583             anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7584                                                                      ListKeepInside, ListRemoveInside,
7585                                                                      Limit, RemoveWebs, ListMaterials,
7586                                                                      KeepNonlimitShapes, checkSelfInte);
7587             RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7588             self._autoPublish(anObj, theName, "partition")
7589             return anObj
7590
7591         ## See method MakePartition() for more information.
7592         #
7593         #  @ref tui_partition "Example 1"
7594         #  \n @ref swig_Partition "Example 2"
7595         def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7596                       Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7597                       KeepNonlimitShapes=0, theName=None):
7598             """
7599             See method geompy.MakePartition for more information.
7600             """
7601             # Example: see GEOM_TestOthers.py
7602             # note: auto-publishing is done in self.MakePartition()
7603             anObj = self.MakePartition(ListShapes, ListTools,
7604                                        ListKeepInside, ListRemoveInside,
7605                                        Limit, RemoveWebs, ListMaterials,
7606                                        KeepNonlimitShapes, theName);
7607             return anObj
7608
7609         ## Perform partition of the Shape with the Plane
7610         #  @param theShape Shape to be intersected.
7611         #  @param thePlane Tool shape, to intersect theShape.
7612         #  @param theName Object name; when specified, this parameter is used
7613         #         for result publication in the study. Otherwise, if automatic
7614         #         publication is switched on, default value is used for result name.
7615         #
7616         #  @return New GEOM.GEOM_Object, containing the result shape.
7617         #
7618         #  @ref tui_partition "Example"
7619         @ManageTransactions("BoolOp")
7620         def MakeHalfPartition(self, theShape, thePlane, theName=None):
7621             """
7622             Perform partition of the Shape with the Plane
7623
7624             Parameters:
7625                 theShape Shape to be intersected.
7626                 thePlane Tool shape, to intersect theShape.
7627                 theName Object name; when specified, this parameter is used
7628                         for result publication in the study. Otherwise, if automatic
7629                         publication is switched on, default value is used for result name.
7630
7631             Returns:
7632                 New GEOM.GEOM_Object, containing the result shape.
7633             """
7634             # Example: see GEOM_TestAll.py
7635             anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7636             RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7637             self._autoPublish(anObj, theName, "partition")
7638             return anObj
7639
7640         # end of l3_basic_op
7641         ## @}
7642
7643         ## @addtogroup l3_transform
7644         ## @{
7645
7646         ## Translate the given object along the vector, specified
7647         #  by its end points.
7648         #  @param theObject The object to be translated.
7649         #  @param thePoint1 Start point of translation vector.
7650         #  @param thePoint2 End point of translation vector.
7651         #  @param theCopy Flag used to translate object itself or create a copy.
7652         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7653         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7654         @ManageTransactions("TrsfOp")
7655         def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7656             """
7657             Translate the given object along the vector, specified by its end points.
7658
7659             Parameters:
7660                 theObject The object to be translated.
7661                 thePoint1 Start point of translation vector.
7662                 thePoint2 End point of translation vector.
7663                 theCopy Flag used to translate object itself or create a copy.
7664
7665             Returns:
7666                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7667                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7668             """
7669             if theCopy:
7670                 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7671             else:
7672                 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7673             RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7674             return anObj
7675
7676         ## Translate the given object along the vector, specified
7677         #  by its end points, creating its copy before the translation.
7678         #  @param theObject The object to be translated.
7679         #  @param thePoint1 Start point of translation vector.
7680         #  @param thePoint2 End point of translation vector.
7681         #  @param theName Object name; when specified, this parameter is used
7682         #         for result publication in the study. Otherwise, if automatic
7683         #         publication is switched on, default value is used for result name.
7684         #
7685         #  @return New GEOM.GEOM_Object, containing the translated object.
7686         #
7687         #  @ref tui_translation "Example 1"
7688         #  \n @ref swig_MakeTranslationTwoPoints "Example 2"
7689         @ManageTransactions("TrsfOp")
7690         def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7691             """
7692             Translate the given object along the vector, specified
7693             by its end points, creating its copy before the translation.
7694
7695             Parameters:
7696                 theObject The object to be translated.
7697                 thePoint1 Start point of translation vector.
7698                 thePoint2 End point of translation vector.
7699                 theName Object name; when specified, this parameter is used
7700                         for result publication in the study. Otherwise, if automatic
7701                         publication is switched on, default value is used for result name.
7702
7703             Returns:
7704                 New GEOM.GEOM_Object, containing the translated object.
7705             """
7706             # Example: see GEOM_TestAll.py
7707             anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7708             RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7709             self._autoPublish(anObj, theName, "translated")
7710             return anObj
7711
7712         ## Translate the given object along the vector, specified by its components.
7713         #  @param theObject The object to be translated.
7714         #  @param theDX,theDY,theDZ Components of translation vector.
7715         #  @param theCopy Flag used to translate object itself or create a copy.
7716         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7717         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7718         #
7719         #  @ref tui_translation "Example"
7720         @ManageTransactions("TrsfOp")
7721         def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7722             """
7723             Translate the given object along the vector, specified by its components.
7724
7725             Parameters:
7726                 theObject The object to be translated.
7727                 theDX,theDY,theDZ Components of translation vector.
7728                 theCopy Flag used to translate object itself or create a copy.
7729
7730             Returns:
7731                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7732                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7733             """
7734             # Example: see GEOM_TestAll.py
7735             theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7736             if theCopy:
7737                 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7738             else:
7739                 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7740             anObj.SetParameters(Parameters)
7741             RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7742             return anObj
7743
7744         ## Translate the given object along the vector, specified
7745         #  by its components, creating its copy before the translation.
7746         #  @param theObject The object to be translated.
7747         #  @param theDX,theDY,theDZ Components of translation vector.
7748         #  @param theName Object name; when specified, this parameter is used
7749         #         for result publication in the study. Otherwise, if automatic
7750         #         publication is switched on, default value is used for result name.
7751         #
7752         #  @return New GEOM.GEOM_Object, containing the translated object.
7753         #
7754         #  @ref tui_translation "Example"
7755         @ManageTransactions("TrsfOp")
7756         def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7757             """
7758             Translate the given object along the vector, specified
7759             by its components, creating its copy before the translation.
7760
7761             Parameters:
7762                 theObject The object to be translated.
7763                 theDX,theDY,theDZ Components of translation vector.
7764                 theName Object name; when specified, this parameter is used
7765                         for result publication in the study. Otherwise, if automatic
7766                         publication is switched on, default value is used for result name.
7767
7768             Returns:
7769                 New GEOM.GEOM_Object, containing the translated object.
7770             """
7771             # Example: see GEOM_TestAll.py
7772             theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7773             anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7774             anObj.SetParameters(Parameters)
7775             RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7776             self._autoPublish(anObj, theName, "translated")
7777             return anObj
7778
7779         ## Translate the given object along the given vector.
7780         #  @param theObject The object to be translated.
7781         #  @param theVector The translation vector.
7782         #  @param theCopy Flag used to translate object itself or create a copy.
7783         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7784         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7785         @ManageTransactions("TrsfOp")
7786         def TranslateVector(self, theObject, theVector, theCopy=False):
7787             """
7788             Translate the given object along the given vector.
7789
7790             Parameters:
7791                 theObject The object to be translated.
7792                 theVector The translation vector.
7793                 theCopy Flag used to translate object itself or create a copy.
7794
7795             Returns:
7796                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7797                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7798             """
7799             if theCopy:
7800                 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7801             else:
7802                 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7803             RaiseIfFailed("TranslateVector", self.TrsfOp)
7804             return anObj
7805
7806         ## Translate the given object along the given vector,
7807         #  creating its copy before the translation.
7808         #  @param theObject The object to be translated.
7809         #  @param theVector The translation vector.
7810         #  @param theName Object name; when specified, this parameter is used
7811         #         for result publication in the study. Otherwise, if automatic
7812         #         publication is switched on, default value is used for result name.
7813         #
7814         #  @return New GEOM.GEOM_Object, containing the translated object.
7815         #
7816         #  @ref tui_translation "Example"
7817         @ManageTransactions("TrsfOp")
7818         def MakeTranslationVector(self, theObject, theVector, theName=None):
7819             """
7820             Translate the given object along the given vector,
7821             creating its copy before the translation.
7822
7823             Parameters:
7824                 theObject The object to be translated.
7825                 theVector The translation vector.
7826                 theName Object name; when specified, this parameter is used
7827                         for result publication in the study. Otherwise, if automatic
7828                         publication is switched on, default value is used for result name.
7829
7830             Returns:
7831                 New GEOM.GEOM_Object, containing the translated object.
7832             """
7833             # Example: see GEOM_TestAll.py
7834             anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7835             RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7836             self._autoPublish(anObj, theName, "translated")
7837             return anObj
7838
7839         ## Translate the given object along the given vector on given distance.
7840         #  @param theObject The object to be translated.
7841         #  @param theVector The translation vector.
7842         #  @param theDistance The translation distance.
7843         #  @param theCopy Flag used to translate object itself or create a copy.
7844         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7845         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7846         #
7847         #  @ref tui_translation "Example"
7848         @ManageTransactions("TrsfOp")
7849         def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7850             """
7851             Translate the given object along the given vector on given distance.
7852
7853             Parameters:
7854                 theObject The object to be translated.
7855                 theVector The translation vector.
7856                 theDistance The translation distance.
7857                 theCopy Flag used to translate object itself or create a copy.
7858
7859             Returns:
7860                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7861                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7862             """
7863             # Example: see GEOM_TestAll.py
7864             theDistance,Parameters = ParseParameters(theDistance)
7865             anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7866             RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7867             anObj.SetParameters(Parameters)
7868             return anObj
7869
7870         ## Translate the given object along the given vector on given distance,
7871         #  creating its copy before the translation.
7872         #  @param theObject The object to be translated.
7873         #  @param theVector The translation vector.
7874         #  @param theDistance The translation distance.
7875         #  @param theName Object name; when specified, this parameter is used
7876         #         for result publication in the study. Otherwise, if automatic
7877         #         publication is switched on, default value is used for result name.
7878         #
7879         #  @return New GEOM.GEOM_Object, containing the translated object.
7880         #
7881         #  @ref tui_translation "Example"
7882         @ManageTransactions("TrsfOp")
7883         def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7884             """
7885             Translate the given object along the given vector on given distance,
7886             creating its copy before the translation.
7887
7888             Parameters:
7889                 theObject The object to be translated.
7890                 theVector The translation vector.
7891                 theDistance The translation distance.
7892                 theName Object name; when specified, this parameter is used
7893                         for result publication in the study. Otherwise, if automatic
7894                         publication is switched on, default value is used for result name.
7895
7896             Returns:
7897                 New GEOM.GEOM_Object, containing the translated object.
7898             """
7899             # Example: see GEOM_TestAll.py
7900             theDistance,Parameters = ParseParameters(theDistance)
7901             anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7902             RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7903             anObj.SetParameters(Parameters)
7904             self._autoPublish(anObj, theName, "translated")
7905             return anObj
7906
7907         ## Rotate the given object around the given axis on the given angle.
7908         #  @param theObject The object to be rotated.
7909         #  @param theAxis Rotation axis.
7910         #  @param theAngle Rotation angle in radians.
7911         #  @param theCopy Flag used to rotate object itself or create a copy.
7912         #
7913         #  @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7914         #  new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7915         #
7916         #  @ref tui_rotation "Example"
7917         @ManageTransactions("TrsfOp")
7918         def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7919             """
7920             Rotate the given object around the given axis on the given angle.
7921
7922             Parameters:
7923                 theObject The object to be rotated.
7924                 theAxis Rotation axis.
7925                 theAngle Rotation angle in radians.
7926                 theCopy Flag used to rotate object itself or create a copy.
7927
7928             Returns:
7929                 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7930                 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7931             """
7932             # Example: see GEOM_TestAll.py
7933             flag = False
7934             if isinstance(theAngle,str):
7935                 flag = True
7936             theAngle, Parameters = ParseParameters(theAngle)
7937             if flag:
7938                 theAngle = theAngle*math.pi/180.0
7939             if theCopy:
7940                 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7941             else:
7942                 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7943             RaiseIfFailed("Rotate", self.TrsfOp)
7944             anObj.SetParameters(Parameters)
7945             return anObj
7946
7947         ## Rotate the given object around the given axis
7948         #  on the given angle, creating its copy before the rotation.
7949         #  @param theObject The object to be rotated.
7950         #  @param theAxis Rotation axis.
7951         #  @param theAngle Rotation angle in radians.
7952         #  @param theName Object name; when specified, this parameter is used
7953         #         for result publication in the study. Otherwise, if automatic
7954         #         publication is switched on, default value is used for result name.
7955         #
7956         #  @return New GEOM.GEOM_Object, containing the rotated object.
7957         #
7958         #  @ref tui_rotation "Example"
7959         @ManageTransactions("TrsfOp")
7960         def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7961             """
7962             Rotate the given object around the given axis
7963             on the given angle, creating its copy before the rotatation.
7964
7965             Parameters:
7966                 theObject The object to be rotated.
7967                 theAxis Rotation axis.
7968                 theAngle Rotation angle in radians.
7969                 theName Object name; when specified, this parameter is used
7970                         for result publication in the study. Otherwise, if automatic
7971                         publication is switched on, default value is used for result name.
7972
7973             Returns:
7974                 New GEOM.GEOM_Object, containing the rotated object.
7975             """
7976             # Example: see GEOM_TestAll.py
7977             flag = False
7978             if isinstance(theAngle,str):
7979                 flag = True
7980             theAngle, Parameters = ParseParameters(theAngle)
7981             if flag:
7982                 theAngle = theAngle*math.pi/180.0
7983             anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7984             RaiseIfFailed("RotateCopy", self.TrsfOp)
7985             anObj.SetParameters(Parameters)
7986             self._autoPublish(anObj, theName, "rotated")
7987             return anObj
7988
7989         ## Rotate given object around vector perpendicular to plane
7990         #  containing three points.
7991         #  @param theObject The object to be rotated.
7992         #  @param theCentPoint central point the axis is the vector perpendicular to the plane
7993         #  containing the three points.
7994         #  @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7995         #  @param theCopy Flag used to rotate object itself or create a copy.
7996         #  @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7997         #  new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7998         @ManageTransactions("TrsfOp")
7999         def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
8000             """
8001             Rotate given object around vector perpendicular to plane
8002             containing three points.
8003
8004             Parameters:
8005                 theObject The object to be rotated.
8006                 theCentPoint central point  the axis is the vector perpendicular to the plane
8007                              containing the three points.
8008                 thePoint1,thePoint2 points in a perpendicular plane of the axis.
8009                 theCopy Flag used to rotate object itself or create a copy.
8010
8011             Returns:
8012                 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8013                 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8014             """
8015             if theCopy:
8016                 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8017             else:
8018                 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
8019             RaiseIfFailed("RotateThreePoints", self.TrsfOp)
8020             return anObj
8021
8022         ## Rotate given object around vector perpendicular to plane
8023         #  containing three points, creating its copy before the rotatation.
8024         #  @param theObject The object to be rotated.
8025         #  @param theCentPoint central point the axis is the vector perpendicular to the plane
8026         #  containing the three points.
8027         #  @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8028         #  @param theName Object name; when specified, this parameter is used
8029         #         for result publication in the study. Otherwise, if automatic
8030         #         publication is switched on, default value is used for result name.
8031         #
8032         #  @return New GEOM.GEOM_Object, containing the rotated object.
8033         #
8034         #  @ref tui_rotation "Example"
8035         @ManageTransactions("TrsfOp")
8036         def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8037             """
8038             Rotate given object around vector perpendicular to plane
8039             containing three points, creating its copy before the rotatation.
8040
8041             Parameters:
8042                 theObject The object to be rotated.
8043                 theCentPoint central point  the axis is the vector perpendicular to the plane
8044                              containing the three points.
8045                 thePoint1,thePoint2  in a perpendicular plane of the axis.
8046                 theName Object name; when specified, this parameter is used
8047                         for result publication in the study. Otherwise, if automatic
8048                         publication is switched on, default value is used for result name.
8049
8050             Returns:
8051                 New GEOM.GEOM_Object, containing the rotated object.
8052             """
8053             # Example: see GEOM_TestAll.py
8054             anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8055             RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8056             self._autoPublish(anObj, theName, "rotated")
8057             return anObj
8058
8059         ## Scale the given object by the specified factor.
8060         #  @param theObject The object to be scaled.
8061         #  @param thePoint Center point for scaling.
8062         #                  Passing None for it means scaling relatively the origin of global CS.
8063         #  @param theFactor Scaling factor value.
8064         #  @param theCopy Flag used to scale object itself or create a copy.
8065         #  @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8066         #  new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8067         @ManageTransactions("TrsfOp")
8068         def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8069             """
8070             Scale the given object by the specified factor.
8071
8072             Parameters:
8073                 theObject The object to be scaled.
8074                 thePoint Center point for scaling.
8075                          Passing None for it means scaling relatively the origin of global CS.
8076                 theFactor Scaling factor value.
8077                 theCopy Flag used to scale object itself or create a copy.
8078
8079             Returns:
8080                 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8081                 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8082             """
8083             # Example: see GEOM_TestAll.py
8084             theFactor, Parameters = ParseParameters(theFactor)
8085             if theCopy:
8086                 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8087             else:
8088                 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8089             RaiseIfFailed("Scale", self.TrsfOp)
8090             anObj.SetParameters(Parameters)
8091             return anObj
8092
8093         ## Scale the given object by the factor, creating its copy before the scaling.
8094         #  @param theObject The object to be scaled.
8095         #  @param thePoint Center point for scaling.
8096         #                  Passing None for it means scaling relatively the origin of global CS.
8097         #  @param theFactor Scaling factor value.
8098         #  @param theName Object name; when specified, this parameter is used
8099         #         for result publication in the study. Otherwise, if automatic
8100         #         publication is switched on, default value is used for result name.
8101         #
8102         #  @return New GEOM.GEOM_Object, containing the scaled shape.
8103         #
8104         #  @ref tui_scale "Example"
8105         @ManageTransactions("TrsfOp")
8106         def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8107             """
8108             Scale the given object by the factor, creating its copy before the scaling.
8109
8110             Parameters:
8111                 theObject The object to be scaled.
8112                 thePoint Center point for scaling.
8113                          Passing None for it means scaling relatively the origin of global CS.
8114                 theFactor Scaling factor value.
8115                 theName Object name; when specified, this parameter is used
8116                         for result publication in the study. Otherwise, if automatic
8117                         publication is switched on, default value is used for result name.
8118
8119             Returns:
8120                 New GEOM.GEOM_Object, containing the scaled shape.
8121             """
8122             # Example: see GEOM_TestAll.py
8123             theFactor, Parameters = ParseParameters(theFactor)
8124             anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8125             RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8126             anObj.SetParameters(Parameters)
8127             self._autoPublish(anObj, theName, "scaled")
8128             return anObj
8129
8130         ## Scale the given object by different factors along coordinate axes.
8131         #  @param theObject The object to be scaled.
8132         #  @param thePoint Center point for scaling.
8133         #                  Passing None for it means scaling relatively the origin of global CS.
8134         #  @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8135         #  @param theCopy Flag used to scale object itself or create a copy.
8136         #  @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8137         #  new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8138         @ManageTransactions("TrsfOp")
8139         def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8140             """
8141             Scale the given object by different factors along coordinate axes.
8142
8143             Parameters:
8144                 theObject The object to be scaled.
8145                 thePoint Center point for scaling.
8146                             Passing None for it means scaling relatively the origin of global CS.
8147                 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8148                 theCopy Flag used to scale object itself or create a copy.
8149
8150             Returns:
8151                 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8152                 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8153             """
8154             # Example: see GEOM_TestAll.py
8155             theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8156             if theCopy:
8157                 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8158                                                             theFactorX, theFactorY, theFactorZ)
8159             else:
8160                 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8161                                                         theFactorX, theFactorY, theFactorZ)
8162             RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8163             anObj.SetParameters(Parameters)
8164             return anObj
8165
8166         ## Scale the given object by different factors along coordinate axes,
8167         #  creating its copy before the scaling.
8168         #  @param theObject The object to be scaled.
8169         #  @param thePoint Center point for scaling.
8170         #                  Passing None for it means scaling relatively the origin of global CS.
8171         #  @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8172         #  @param theName Object name; when specified, this parameter is used
8173         #         for result publication in the study. Otherwise, if automatic
8174         #         publication is switched on, default value is used for result name.
8175         #
8176         #  @return New GEOM.GEOM_Object, containing the scaled shape.
8177         #
8178         #  @ref swig_scale "Example"
8179         @ManageTransactions("TrsfOp")
8180         def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8181             """
8182             Scale the given object by different factors along coordinate axes,
8183             creating its copy before the scaling.
8184
8185             Parameters:
8186                 theObject The object to be scaled.
8187                 thePoint Center point for scaling.
8188                             Passing None for it means scaling relatively the origin of global CS.
8189                 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8190                 theName Object name; when specified, this parameter is used
8191                         for result publication in the study. Otherwise, if automatic
8192                         publication is switched on, default value is used for result name.
8193
8194             Returns:
8195                 New GEOM.GEOM_Object, containing the scaled shape.
8196             """
8197             # Example: see GEOM_TestAll.py
8198             theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8199             anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8200                                                         theFactorX, theFactorY, theFactorZ)
8201             RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8202             anObj.SetParameters(Parameters)
8203             self._autoPublish(anObj, theName, "scaled")
8204             return anObj
8205
8206         ## Mirror an object relatively the given plane.
8207         #  @param theObject The object to be mirrored.
8208         #  @param thePlane Plane of symmetry.
8209         #  @param theCopy Flag used to mirror object itself or create a copy.
8210         #  @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8211         #  new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8212         @ManageTransactions("TrsfOp")
8213         def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8214             """
8215             Mirror an object relatively the given plane.
8216
8217             Parameters:
8218                 theObject The object to be mirrored.
8219                 thePlane Plane of symmetry.
8220                 theCopy Flag used to mirror object itself or create a copy.
8221
8222             Returns:
8223                 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8224                 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8225             """
8226             if theCopy:
8227                 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8228             else:
8229                 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8230             RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8231             return anObj
8232
8233         ## Create an object, symmetrical
8234         #  to the given one relatively the given plane.
8235         #  @param theObject The object to be mirrored.
8236         #  @param thePlane Plane of symmetry.
8237         #  @param theName Object name; when specified, this parameter is used
8238         #         for result publication in the study. Otherwise, if automatic
8239         #         publication is switched on, default value is used for result name.
8240         #
8241         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
8242         #
8243         #  @ref tui_mirror "Example"
8244         @ManageTransactions("TrsfOp")
8245         def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8246             """
8247             Create an object, symmetrical to the given one relatively the given plane.
8248
8249             Parameters:
8250                 theObject The object to be mirrored.
8251                 thePlane Plane of symmetry.
8252                 theName Object name; when specified, this parameter is used
8253                         for result publication in the study. Otherwise, if automatic
8254                         publication is switched on, default value is used for result name.
8255
8256             Returns:
8257                 New GEOM.GEOM_Object, containing the mirrored shape.
8258             """
8259             # Example: see GEOM_TestAll.py
8260             anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8261             RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8262             self._autoPublish(anObj, theName, "mirrored")
8263             return anObj
8264
8265         ## Mirror an object relatively the given axis.
8266         #  @param theObject The object to be mirrored.
8267         #  @param theAxis Axis of symmetry.
8268         #  @param theCopy Flag used to mirror object itself or create a copy.
8269         #  @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8270         #  new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8271         @ManageTransactions("TrsfOp")
8272         def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8273             """
8274             Mirror an object relatively the given axis.
8275
8276             Parameters:
8277                 theObject The object to be mirrored.
8278                 theAxis Axis of symmetry.
8279                 theCopy Flag used to mirror object itself or create a copy.
8280
8281             Returns:
8282                 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8283                 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8284             """
8285             if theCopy:
8286                 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8287             else:
8288                 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8289             RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8290             return anObj
8291
8292         ## Create an object, symmetrical
8293         #  to the given one relatively the given axis.
8294         #  @param theObject The object to be mirrored.
8295         #  @param theAxis Axis of symmetry.
8296         #  @param theName Object name; when specified, this parameter is used
8297         #         for result publication in the study. Otherwise, if automatic
8298         #         publication is switched on, default value is used for result name.
8299         #
8300         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
8301         #
8302         #  @ref tui_mirror "Example"
8303         @ManageTransactions("TrsfOp")
8304         def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8305             """
8306             Create an object, symmetrical to the given one relatively the given axis.
8307
8308             Parameters:
8309                 theObject The object to be mirrored.
8310                 theAxis Axis of symmetry.
8311                 theName Object name; when specified, this parameter is used
8312                         for result publication in the study. Otherwise, if automatic
8313                         publication is switched on, default value is used for result name.
8314
8315             Returns:
8316                 New GEOM.GEOM_Object, containing the mirrored shape.
8317             """
8318             # Example: see GEOM_TestAll.py
8319             anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8320             RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8321             self._autoPublish(anObj, theName, "mirrored")
8322             return anObj
8323
8324         ## Mirror an object relatively the given point.
8325         #  @param theObject The object to be mirrored.
8326         #  @param thePoint Point of symmetry.
8327         #  @param theCopy Flag used to mirror object itself or create a copy.
8328         #  @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8329         #  new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8330         @ManageTransactions("TrsfOp")
8331         def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8332             """
8333             Mirror an object relatively the given point.
8334
8335             Parameters:
8336                 theObject The object to be mirrored.
8337                 thePoint Point of symmetry.
8338                 theCopy Flag used to mirror object itself or create a copy.
8339
8340             Returns:
8341                 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8342                 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8343             """
8344             # Example: see GEOM_TestAll.py
8345             if theCopy:
8346                 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8347             else:
8348                 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8349             RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8350             return anObj
8351
8352         ## Create an object, symmetrical
8353         #  to the given one relatively the given point.
8354         #  @param theObject The object to be mirrored.
8355         #  @param thePoint Point of symmetry.
8356         #  @param theName Object name; when specified, this parameter is used
8357         #         for result publication in the study. Otherwise, if automatic
8358         #         publication is switched on, default value is used for result name.
8359         #
8360         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
8361         #
8362         #  @ref tui_mirror "Example"
8363         @ManageTransactions("TrsfOp")
8364         def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8365             """
8366             Create an object, symmetrical
8367             to the given one relatively the given point.
8368
8369             Parameters:
8370                 theObject The object to be mirrored.
8371                 thePoint Point of symmetry.
8372                 theName Object name; when specified, this parameter is used
8373                         for result publication in the study. Otherwise, if automatic
8374                         publication is switched on, default value is used for result name.
8375
8376             Returns:
8377                 New GEOM.GEOM_Object, containing the mirrored shape.
8378             """
8379             # Example: see GEOM_TestAll.py
8380             anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8381             RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8382             self._autoPublish(anObj, theName, "mirrored")
8383             return anObj
8384
8385         ## Modify the location of the given object.
8386         #  @param theObject The object to be displaced.
8387         #  @param theStartLCS Coordinate system to perform displacement from it.\n
8388         #                     If \a theStartLCS is NULL, displacement
8389         #                     will be performed from global CS.\n
8390         #                     If \a theObject itself is used as \a theStartLCS,
8391         #                     its location will be changed to \a theEndLCS.
8392         #  @param theEndLCS Coordinate system to perform displacement to it.
8393         #  @param theCopy Flag used to displace object itself or create a copy.
8394         #  @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8395         #  new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8396         @ManageTransactions("TrsfOp")
8397         def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8398             """
8399             Modify the Location of the given object by LCS, creating its copy before the setting.
8400
8401             Parameters:
8402                 theObject The object to be displaced.
8403                 theStartLCS Coordinate system to perform displacement from it.
8404                             If theStartLCS is NULL, displacement
8405                             will be performed from global CS.
8406                             If theObject itself is used as theStartLCS,
8407                             its location will be changed to theEndLCS.
8408                 theEndLCS Coordinate system to perform displacement to it.
8409                 theCopy Flag used to displace object itself or create a copy.
8410
8411             Returns:
8412                 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8413                 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8414             """
8415             # Example: see GEOM_TestAll.py
8416             if theCopy:
8417                 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8418             else:
8419                 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8420             RaiseIfFailed("Displace", self.TrsfOp)
8421             return anObj
8422
8423         ## Modify the Location of the given object by LCS,
8424         #  creating its copy before the setting.
8425         #  @param theObject The object to be displaced.
8426         #  @param theStartLCS Coordinate system to perform displacement from it.\n
8427         #                     If \a theStartLCS is NULL, displacement
8428         #                     will be performed from global CS.\n
8429         #                     If \a theObject itself is used as \a theStartLCS,
8430         #                     its location will be changed to \a theEndLCS.
8431         #  @param theEndLCS Coordinate system to perform displacement to it.
8432         #  @param theName Object name; when specified, this parameter is used
8433         #         for result publication in the study. Otherwise, if automatic
8434         #         publication is switched on, default value is used for result name.
8435         #
8436         #  @return New GEOM.GEOM_Object, containing the displaced shape.
8437         #
8438         #  @ref tui_modify_location "Example"
8439         @ManageTransactions("TrsfOp")
8440         def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8441             """
8442             Modify the Location of the given object by LCS, creating its copy before the setting.
8443
8444             Parameters:
8445                 theObject The object to be displaced.
8446                 theStartLCS Coordinate system to perform displacement from it.
8447                             If theStartLCS is NULL, displacement
8448                             will be performed from global CS.
8449                             If theObject itself is used as theStartLCS,
8450                             its location will be changed to theEndLCS.
8451                 theEndLCS Coordinate system to perform displacement to it.
8452                 theName Object name; when specified, this parameter is used
8453                         for result publication in the study. Otherwise, if automatic
8454                         publication is switched on, default value is used for result name.
8455
8456             Returns:
8457                 New GEOM.GEOM_Object, containing the displaced shape.
8458
8459             Example of usage:
8460                 # create local coordinate systems
8461                 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8462                 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8463                 # modify the location of the given object
8464                 position = geompy.MakePosition(cylinder, cs1, cs2)
8465             """
8466             # Example: see GEOM_TestAll.py
8467             anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8468             RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8469             self._autoPublish(anObj, theName, "displaced")
8470             return anObj
8471
8472         ## Modify the Location of the given object by Path.
8473         #  @param  theObject The object to be displaced.
8474         #  @param  thePath Wire or Edge along that the object will be translated.
8475         #  @param  theDistance progress of Path (0 = start location, 1 = end of path location).
8476         #  @param  theCopy is to create a copy objects if true.
8477         #  @param  theReverse  0 - for usual direction, 1 - to reverse path direction.
8478         #  @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8479         #          new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8480         #
8481         #  @ref tui_modify_location "Example"
8482         @ManageTransactions("TrsfOp")
8483         def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8484             """
8485             Modify the Location of the given object by Path.
8486
8487             Parameters:
8488                  theObject The object to be displaced.
8489                  thePath Wire or Edge along that the object will be translated.
8490                  theDistance progress of Path (0 = start location, 1 = end of path location).
8491                  theCopy is to create a copy objects if true.
8492                  theReverse  0 - for usual direction, 1 - to reverse path direction.
8493
8494             Returns:
8495                  Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8496                  new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8497
8498             Example of usage:
8499                 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8500             """
8501             # Example: see GEOM_TestAll.py
8502             anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8503             RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8504             return anObj
8505
8506         ## Modify the Location of the given object by Path, creating its copy before the operation.
8507         #  @param theObject The object to be displaced.
8508         #  @param thePath Wire or Edge along that the object will be translated.
8509         #  @param theDistance progress of Path (0 = start location, 1 = end of path location).
8510         #  @param theReverse  0 - for usual direction, 1 - to reverse path direction.
8511         #  @param theName Object name; when specified, this parameter is used
8512         #         for result publication in the study. Otherwise, if automatic
8513         #         publication is switched on, default value is used for result name.
8514         #
8515         #  @return New GEOM.GEOM_Object, containing the displaced shape.
8516         @ManageTransactions("TrsfOp")
8517         def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8518             """
8519             Modify the Location of the given object by Path, creating its copy before the operation.
8520
8521             Parameters:
8522                  theObject The object to be displaced.
8523                  thePath Wire or Edge along that the object will be translated.
8524                  theDistance progress of Path (0 = start location, 1 = end of path location).
8525                  theReverse  0 - for usual direction, 1 - to reverse path direction.
8526                  theName Object name; when specified, this parameter is used
8527                          for result publication in the study. Otherwise, if automatic
8528                          publication is switched on, default value is used for result name.
8529
8530             Returns:
8531                 New GEOM.GEOM_Object, containing the displaced shape.
8532             """
8533             # Example: see GEOM_TestAll.py
8534             anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8535             RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8536             self._autoPublish(anObj, theName, "displaced")
8537             return anObj
8538
8539         ## Offset given shape.
8540         #  @param theObject The base object for the offset.
8541         #  @param theOffset Offset value.
8542         #  @param theCopy Flag used to offset object itself or create a copy.
8543         #  @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8544         #  new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8545         @ManageTransactions("TrsfOp")
8546         def Offset(self, theObject, theOffset, theCopy=False):
8547             """
8548             Offset given shape.
8549
8550             Parameters:
8551                 theObject The base object for the offset.
8552                 theOffset Offset value.
8553                 theCopy Flag used to offset object itself or create a copy.
8554
8555             Returns:
8556                 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8557                 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8558             """
8559             theOffset, Parameters = ParseParameters(theOffset)
8560             if theCopy:
8561                 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8562             else:
8563                 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8564             RaiseIfFailed("Offset", self.TrsfOp)
8565             anObj.SetParameters(Parameters)
8566             return anObj
8567
8568         ## Create new object as offset of the given one.
8569         #  @param theObject The base object for the offset.
8570         #  @param theOffset Offset value.
8571         #  @param theName Object name; when specified, this parameter is used
8572         #         for result publication in the study. Otherwise, if automatic
8573         #         publication is switched on, default value is used for result name.
8574         #
8575         #  @return New GEOM.GEOM_Object, containing the offset object.
8576         #
8577         #  @ref tui_offset "Example"
8578         @ManageTransactions("TrsfOp")
8579         def MakeOffset(self, theObject, theOffset, theName=None):
8580             """
8581             Create new object as offset of the given one.
8582
8583             Parameters:
8584                 theObject The base object for the offset.
8585                 theOffset Offset value.
8586                 theName Object name; when specified, this parameter is used
8587                         for result publication in the study. Otherwise, if automatic
8588                         publication is switched on, default value is used for result name.
8589
8590             Returns:
8591                 New GEOM.GEOM_Object, containing the offset object.
8592
8593             Example of usage:
8594                  box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8595                  # create a new object as offset of the given object
8596                  offset = geompy.MakeOffset(box, 70.)
8597             """
8598             # Example: see GEOM_TestAll.py
8599             theOffset, Parameters = ParseParameters(theOffset)
8600             anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8601             RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8602             anObj.SetParameters(Parameters)
8603             self._autoPublish(anObj, theName, "offset")
8604             return anObj
8605
8606         ## Create new object as projection of the given one on a 2D surface.
8607         #  @param theSource The source object for the projection. It can be a point, edge or wire.
8608         #  @param theTarget The target object. It can be planar or cylindrical face.
8609         #  @param theName Object name; when specified, this parameter is used
8610         #         for result publication in the study. Otherwise, if automatic
8611         #         publication is switched on, default value is used for result name.
8612         #
8613         #  @return New GEOM.GEOM_Object, containing the projection.
8614         #
8615         #  @ref tui_projection "Example"
8616         @ManageTransactions("TrsfOp")
8617         def MakeProjection(self, theSource, theTarget, theName=None):
8618             """
8619             Create new object as projection of the given one on a 2D surface.
8620
8621             Parameters:
8622                 theSource The source object for the projection. It can be a point, edge or wire.
8623                 theTarget The target object. It can be planar or cylindrical face.
8624                 theName Object name; when specified, this parameter is used
8625                         for result publication in the study. Otherwise, if automatic
8626                         publication is switched on, default value is used for result name.
8627
8628             Returns:
8629                 New GEOM.GEOM_Object, containing the projection.
8630             """
8631             # Example: see GEOM_TestAll.py
8632             anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8633             RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8634             self._autoPublish(anObj, theName, "projection")
8635             return anObj
8636
8637         ## Create a projection projection of the given point on a wire or an edge.
8638         #  If there are no solutions or there are 2 or more solutions It throws an
8639         #  exception.
8640         #  @param thePoint the point to be projected.
8641         #  @param theWire the wire. The edge is accepted as well.
8642         #  @param theName Object name; when specified, this parameter is used
8643         #         for result publication in the study. Otherwise, if automatic
8644         #         publication is switched on, default value is used for result name.
8645         #
8646         #  @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8647         #  \n \a u: The parameter of projection point on edge.
8648         #  \n \a PointOnEdge: The projection point.
8649         #  \n \a EdgeInWireIndex: The index of an edge in a wire.
8650         #
8651         #  @ref tui_projection "Example"
8652         @ManageTransactions("TrsfOp")
8653         def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8654             """
8655             Create a projection projection of the given point on a wire or an edge.
8656             If there are no solutions or there are 2 or more solutions It throws an
8657             exception.
8658
8659             Parameters:
8660                 thePoint the point to be projected.
8661                 theWire the wire. The edge is accepted as well.
8662                 theName Object name; when specified, this parameter is used
8663                         for result publication in the study. Otherwise, if automatic
8664                         publication is switched on, default value is used for result name.
8665
8666             Returns:
8667                 [u, PointOnEdge, EdgeInWireIndex]
8668                  u: The parameter of projection point on edge.
8669                  PointOnEdge: The projection point.
8670                  EdgeInWireIndex: The index of an edge in a wire.
8671             """
8672             # Example: see GEOM_TestAll.py
8673             anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8674             RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8675             self._autoPublish(anObj[1], theName, "projection")
8676             return anObj
8677
8678         # -----------------------------------------------------------------------------
8679         # Patterns
8680         # -----------------------------------------------------------------------------
8681
8682         ## Translate the given object along the given vector a given number times
8683         #  @param theObject The object to be translated.
8684         #  @param theVector Direction of the translation. DX if None.
8685         #  @param theStep Distance to translate on.
8686         #  @param theNbTimes Quantity of translations to be done.
8687         #  @param theName Object name; when specified, this parameter is used
8688         #         for result publication in the study. Otherwise, if automatic
8689         #         publication is switched on, default value is used for result name.
8690         #
8691         #  @return New GEOM.GEOM_Object, containing compound of all
8692         #          the shapes, obtained after each translation.
8693         #
8694         #  @ref tui_multi_translation "Example"
8695         @ManageTransactions("TrsfOp")
8696         def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8697             """
8698             Translate the given object along the given vector a given number times
8699
8700             Parameters:
8701                 theObject The object to be translated.
8702                 theVector Direction of the translation. DX if None.
8703                 theStep Distance to translate on.
8704                 theNbTimes Quantity of translations to be done.
8705                 theName Object name; when specified, this parameter is used
8706                         for result publication in the study. Otherwise, if automatic
8707                         publication is switched on, default value is used for result name.
8708
8709             Returns:
8710                 New GEOM.GEOM_Object, containing compound of all
8711                 the shapes, obtained after each translation.
8712
8713             Example of usage:
8714                 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8715             """
8716             # Example: see GEOM_TestAll.py
8717             theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8718             anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8719             RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8720             anObj.SetParameters(Parameters)
8721             self._autoPublish(anObj, theName, "multitranslation")
8722             return anObj
8723
8724         ## Conseqently apply two specified translations to theObject specified number of times.
8725         #  @param theObject The object to be translated.
8726         #  @param theVector1 Direction of the first translation. DX if None.
8727         #  @param theStep1 Step of the first translation.
8728         #  @param theNbTimes1 Quantity of translations to be done along theVector1.
8729         #  @param theVector2 Direction of the second translation. DY if None.
8730         #  @param theStep2 Step of the second translation.
8731         #  @param theNbTimes2 Quantity of translations to be done along theVector2.
8732         #  @param theName Object name; when specified, this parameter is used
8733         #         for result publication in the study. Otherwise, if automatic
8734         #         publication is switched on, default value is used for result name.
8735         #
8736         #  @return New GEOM.GEOM_Object, containing compound of all
8737         #          the shapes, obtained after each translation.
8738         #
8739         #  @ref tui_multi_translation "Example"
8740         @ManageTransactions("TrsfOp")
8741         def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8742                                    theVector2, theStep2, theNbTimes2, theName=None):
8743             """
8744             Conseqently apply two specified translations to theObject specified number of times.
8745
8746             Parameters:
8747                 theObject The object to be translated.
8748                 theVector1 Direction of the first translation. DX if None.
8749                 theStep1 Step of the first translation.
8750                 theNbTimes1 Quantity of translations to be done along theVector1.
8751                 theVector2 Direction of the second translation. DY if None.
8752                 theStep2 Step of the second translation.
8753                 theNbTimes2 Quantity of translations to be done along theVector2.
8754                 theName Object name; when specified, this parameter is used
8755                         for result publication in the study. Otherwise, if automatic
8756                         publication is switched on, default value is used for result name.
8757
8758             Returns:
8759                 New GEOM.GEOM_Object, containing compound of all
8760                 the shapes, obtained after each translation.
8761
8762             Example of usage:
8763                 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8764             """
8765             # Example: see GEOM_TestAll.py
8766             theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8767             anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8768                                                  theVector2, theStep2, theNbTimes2)
8769             RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8770             anObj.SetParameters(Parameters)
8771             self._autoPublish(anObj, theName, "multitranslation")
8772             return anObj
8773
8774         ## Rotate the given object around the given axis a given number times.
8775         #  Rotation angle will be 2*PI/theNbTimes.
8776         #  @param theObject The object to be rotated.
8777         #  @param theAxis The rotation axis. DZ if None.
8778         #  @param theNbTimes Quantity of rotations to be done.
8779         #  @param theName Object name; when specified, this parameter is used
8780         #         for result publication in the study. Otherwise, if automatic
8781         #         publication is switched on, default value is used for result name.
8782         #
8783         #  @return New GEOM.GEOM_Object, containing compound of all the
8784         #          shapes, obtained after each rotation.
8785         #
8786         #  @ref tui_multi_rotation "Example"
8787         @ManageTransactions("TrsfOp")
8788         def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8789             """
8790             Rotate the given object around the given axis a given number times.
8791             Rotation angle will be 2*PI/theNbTimes.
8792
8793             Parameters:
8794                 theObject The object to be rotated.
8795                 theAxis The rotation axis. DZ if None.
8796                 theNbTimes Quantity of rotations to be done.
8797                 theName Object name; when specified, this parameter is used
8798                         for result publication in the study. Otherwise, if automatic
8799                         publication is switched on, default value is used for result name.
8800
8801             Returns:
8802                 New GEOM.GEOM_Object, containing compound of all the
8803                 shapes, obtained after each rotation.
8804
8805             Example of usage:
8806                 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8807             """
8808             # Example: see GEOM_TestAll.py
8809             theNbTimes, Parameters = ParseParameters(theNbTimes)
8810             anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8811             RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8812             anObj.SetParameters(Parameters)
8813             self._autoPublish(anObj, theName, "multirotation")
8814             return anObj
8815
8816         ## Rotate the given object around the given axis
8817         #  a given number times on the given angle.
8818         #  @param theObject The object to be rotated.
8819         #  @param theAxis The rotation axis. DZ if None.
8820         #  @param theAngleStep Rotation angle in radians.
8821         #  @param theNbTimes Quantity of rotations to be done.
8822         #  @param theName Object name; when specified, this parameter is used
8823         #         for result publication in the study. Otherwise, if automatic
8824         #         publication is switched on, default value is used for result name.
8825         #
8826         #  @return New GEOM.GEOM_Object, containing compound of all the
8827         #          shapes, obtained after each rotation.
8828         #
8829         #  @ref tui_multi_rotation "Example"
8830         @ManageTransactions("TrsfOp")
8831         def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8832             """
8833             Rotate the given object around the given axis
8834             a given number times on the given angle.
8835
8836             Parameters:
8837                 theObject The object to be rotated.
8838                 theAxis The rotation axis. DZ if None.
8839                 theAngleStep Rotation angle in radians.
8840                 theNbTimes Quantity of rotations to be done.
8841                 theName Object name; when specified, this parameter is used
8842                         for result publication in the study. Otherwise, if automatic
8843                         publication is switched on, default value is used for result name.
8844
8845             Returns:
8846                 New GEOM.GEOM_Object, containing compound of all the
8847                 shapes, obtained after each rotation.
8848
8849             Example of usage:
8850                 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8851             """
8852             # Example: see GEOM_TestAll.py
8853             theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8854             anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8855             RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8856             anObj.SetParameters(Parameters)
8857             self._autoPublish(anObj, theName, "multirotation")
8858             return anObj
8859
8860         ## Rotate the given object around the given axis a given
8861         #  number times and multi-translate each rotation result.
8862         #  Rotation angle will be 2*PI/theNbTimes1.
8863         #  Translation direction passes through center of gravity
8864         #  of rotated shape and its projection on the rotation axis.
8865         #  @param theObject The object to be rotated.
8866         #  @param theAxis Rotation axis. DZ if None.
8867         #  @param theNbTimes1 Quantity of rotations to be done.
8868         #  @param theRadialStep Translation distance.
8869         #  @param theNbTimes2 Quantity of translations to be done.
8870         #  @param theName Object name; when specified, this parameter is used
8871         #         for result publication in the study. Otherwise, if automatic
8872         #         publication is switched on, default value is used for result name.
8873         #
8874         #  @return New GEOM.GEOM_Object, containing compound of all the
8875         #          shapes, obtained after each transformation.
8876         #
8877         #  @ref tui_multi_rotation "Example"
8878         @ManageTransactions("TrsfOp")
8879         def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8880             """
8881             Rotate the given object around the
8882             given axis on the given angle a given number
8883             times and multi-translate each rotation result.
8884             Translation direction passes through center of gravity
8885             of rotated shape and its projection on the rotation axis.
8886
8887             Parameters:
8888                 theObject The object to be rotated.
8889                 theAxis Rotation axis. DZ if None.
8890                 theNbTimes1 Quantity of rotations to be done.
8891                 theRadialStep Translation distance.
8892                 theNbTimes2 Quantity of translations to be done.
8893                 theName Object name; when specified, this parameter is used
8894                         for result publication in the study. Otherwise, if automatic
8895                         publication is switched on, default value is used for result name.
8896
8897             Returns:
8898                 New GEOM.GEOM_Object, containing compound of all the
8899                 shapes, obtained after each transformation.
8900
8901             Example of usage:
8902                 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8903             """
8904             # Example: see GEOM_TestAll.py
8905             theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8906             anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8907             RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8908             anObj.SetParameters(Parameters)
8909             self._autoPublish(anObj, theName, "multirotation")
8910             return anObj
8911
8912         ## Rotate the given object around the
8913         #  given axis on the given angle a given number
8914         #  times and multi-translate each rotation result.
8915         #  Translation direction passes through center of gravity
8916         #  of rotated shape and its projection on the rotation axis.
8917         #  @param theObject The object to be rotated.
8918         #  @param theAxis Rotation axis. DZ if None.
8919         #  @param theAngleStep Rotation angle in radians.
8920         #  @param theNbTimes1 Quantity of rotations to be done.
8921         #  @param theRadialStep Translation distance.
8922         #  @param theNbTimes2 Quantity of translations to be done.
8923         #  @param theName Object name; when specified, this parameter is used
8924         #         for result publication in the study. Otherwise, if automatic
8925         #         publication is switched on, default value is used for result name.
8926         #
8927         #  @return New GEOM.GEOM_Object, containing compound of all the
8928         #          shapes, obtained after each transformation.
8929         #
8930         #  @ref tui_multi_rotation "Example"
8931         @ManageTransactions("TrsfOp")
8932         def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8933             """
8934             Rotate the given object around the
8935             given axis on the given angle a given number
8936             times and multi-translate each rotation result.
8937             Translation direction passes through center of gravity
8938             of rotated shape and its projection on the rotation axis.
8939
8940             Parameters:
8941                 theObject The object to be rotated.
8942                 theAxis Rotation axis. DZ if None.
8943                 theAngleStep Rotation angle in radians.
8944                 theNbTimes1 Quantity of rotations to be done.
8945                 theRadialStep Translation distance.
8946                 theNbTimes2 Quantity of translations to be done.
8947                 theName Object name; when specified, this parameter is used
8948                         for result publication in the study. Otherwise, if automatic
8949                         publication is switched on, default value is used for result name.
8950
8951             Returns:
8952                 New GEOM.GEOM_Object, containing compound of all the
8953                 shapes, obtained after each transformation.
8954
8955             Example of usage:
8956                 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8957             """
8958             # Example: see GEOM_TestAll.py
8959             theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8960             anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8961             RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8962             anObj.SetParameters(Parameters)
8963             self._autoPublish(anObj, theName, "multirotation")
8964             return anObj
8965
8966         ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8967         #
8968         #  @ref swig_MakeMultiRotation "Example"
8969         def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8970             """
8971             The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8972
8973             Example of usage:
8974                 pz = geompy.MakeVertex(0, 0, 100)
8975                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8976                 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8977             """
8978             # Example: see GEOM_TestOthers.py
8979             aVec = self.MakeLine(aPoint,aDir)
8980             # note: auto-publishing is done in self.MultiRotate1D()
8981             anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8982             return anObj
8983
8984         ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8985         #
8986         #  @ref swig_MakeMultiRotation "Example"
8987         def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8988             """
8989             The same, as geompy.MultiRotate1D, but axis is given by direction and point
8990
8991             Example of usage:
8992                 pz = geompy.MakeVertex(0, 0, 100)
8993                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8994                 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8995             """
8996             # Example: see GEOM_TestOthers.py
8997             aVec = self.MakeLine(aPoint,aDir)
8998             # note: auto-publishing is done in self.MultiRotate1D()
8999             anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9000             return anObj
9001
9002         ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9003         #
9004         #  @ref swig_MakeMultiRotation "Example"
9005         def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9006             """
9007             The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9008
9009             Example of usage:
9010                 pz = geompy.MakeVertex(0, 0, 100)
9011                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9012                 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9013             """
9014             # Example: see GEOM_TestOthers.py
9015             aVec = self.MakeLine(aPoint,aDir)
9016             # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9017             anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9018             return anObj
9019
9020         ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9021         #
9022         #  @ref swig_MakeMultiRotation "Example"
9023         def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9024             """
9025             The same, as MultiRotate2DByStep(), but axis is given by direction and point
9026
9027             Example of usage:
9028                 pz = geompy.MakeVertex(0, 0, 100)
9029                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9030                 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9031             """
9032             # Example: see GEOM_TestOthers.py
9033             aVec = self.MakeLine(aPoint,aDir)
9034             # note: auto-publishing is done in self.MultiRotate2D()
9035             anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9036             return anObj
9037
9038         # end of l3_transform
9039         ## @}
9040
9041         ## @addtogroup l3_transform_d
9042         ## @{
9043
9044         ## Deprecated method. Use MultiRotate1DNbTimes instead.
9045         def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9046             """
9047             Deprecated method. Use MultiRotate1DNbTimes instead.
9048             """
9049             print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
9050             return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9051
9052         ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9053         #  This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9054         @ManageTransactions("TrsfOp")
9055         def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9056             """
9057             The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9058             This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9059
9060             Example of usage:
9061                 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9062             """
9063             print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
9064             theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9065             anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9066             RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9067             anObj.SetParameters(Parameters)
9068             self._autoPublish(anObj, theName, "multirotation")
9069             return anObj
9070
9071         ## The same, as MultiRotate1D(), but axis is given by direction and point
9072         #  This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9073         def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9074             """
9075             The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9076             This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9077
9078             Example of usage:
9079                 pz = geompy.MakeVertex(0, 0, 100)
9080                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9081                 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9082             """
9083             print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
9084             aVec = self.MakeLine(aPoint,aDir)
9085             # note: auto-publishing is done in self.MultiRotate1D()
9086             anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9087             return anObj
9088
9089         ## The same, as MultiRotate2D(), but axis is given by direction and point
9090         #  This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9091         def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9092             """
9093             The same, as MultiRotate2D(), but axis is given by direction and point
9094             This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9095
9096             Example of usage:
9097                 pz = geompy.MakeVertex(0, 0, 100)
9098                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9099                 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
9100             """
9101             print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
9102             aVec = self.MakeLine(aPoint,aDir)
9103             # note: auto-publishing is done in self.MultiRotate2D()
9104             anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9105             return anObj
9106
9107         # end of l3_transform_d
9108         ## @}
9109
9110         ## @addtogroup l3_local
9111         ## @{
9112
9113         ## Perform a fillet on all edges of the given shape.
9114         #  @param theShape Shape, to perform fillet on.
9115         #  @param theR Fillet radius.
9116         #  @param theName Object name; when specified, this parameter is used
9117         #         for result publication in the study. Otherwise, if automatic
9118         #         publication is switched on, default value is used for result name.
9119         #
9120         #  @return New GEOM.GEOM_Object, containing the result shape.
9121         #
9122         #  @ref tui_fillet "Example 1"
9123         #  \n @ref swig_MakeFilletAll "Example 2"
9124         @ManageTransactions("LocalOp")
9125         def MakeFilletAll(self, theShape, theR, theName=None):
9126             """
9127             Perform a fillet on all edges of the given shape.
9128
9129             Parameters:
9130                 theShape Shape, to perform fillet on.
9131                 theR Fillet radius.
9132                 theName Object name; when specified, this parameter is used
9133                         for result publication in the study. Otherwise, if automatic
9134                         publication is switched on, default value is used for result name.
9135
9136             Returns:
9137                 New GEOM.GEOM_Object, containing the result shape.
9138
9139             Example of usage:
9140                filletall = geompy.MakeFilletAll(prism, 10.)
9141             """
9142             # Example: see GEOM_TestOthers.py
9143             theR,Parameters = ParseParameters(theR)
9144             anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9145             RaiseIfFailed("MakeFilletAll", self.LocalOp)
9146             anObj.SetParameters(Parameters)
9147             self._autoPublish(anObj, theName, "fillet")
9148             return anObj
9149
9150         ## Perform a fillet on the specified edges/faces of the given shape
9151         #  @param theShape Shape, to perform fillet on.
9152         #  @param theR Fillet radius.
9153         #  @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9154         #  @param theListShapes Global indices of edges/faces to perform fillet on.
9155         #  @param theName Object name; when specified, this parameter is used
9156         #         for result publication in the study. Otherwise, if automatic
9157         #         publication is switched on, default value is used for result name.
9158         #
9159         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9160         #
9161         #  @return New GEOM.GEOM_Object, containing the result shape.
9162         #
9163         #  @ref tui_fillet "Example"
9164         @ManageTransactions("LocalOp")
9165         def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9166             """
9167             Perform a fillet on the specified edges/faces of the given shape
9168
9169             Parameters:
9170                 theShape Shape, to perform fillet on.
9171                 theR Fillet radius.
9172                 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9173                 theListShapes Global indices of edges/faces to perform fillet on.
9174                 theName Object name; when specified, this parameter is used
9175                         for result publication in the study. Otherwise, if automatic
9176                         publication is switched on, default value is used for result name.
9177
9178             Note:
9179                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9180
9181             Returns:
9182                 New GEOM.GEOM_Object, containing the result shape.
9183
9184             Example of usage:
9185                 # get the list of IDs (IDList) for the fillet
9186                 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9187                 IDlist_e = []
9188                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9189                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9190                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9191                 # make a fillet on the specified edges of the given shape
9192                 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9193             """
9194             # Example: see GEOM_TestAll.py
9195             theR,Parameters = ParseParameters(theR)
9196             anObj = None
9197             if theShapeType == self.ShapeType["EDGE"]:
9198                 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9199                 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9200             else:
9201                 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9202                 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9203             anObj.SetParameters(Parameters)
9204             self._autoPublish(anObj, theName, "fillet")
9205             return anObj
9206
9207         ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9208         @ManageTransactions("LocalOp")
9209         def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9210             """
9211             The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9212
9213             Example of usage:
9214                 # get the list of IDs (IDList) for the fillet
9215                 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9216                 IDlist_e = []
9217                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9218                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9219                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9220                 # make a fillet on the specified edges of the given shape
9221                 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9222             """
9223             theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9224             anObj = None
9225             if theShapeType == self.ShapeType["EDGE"]:
9226                 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9227                 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9228             else:
9229                 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9230                 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9231             anObj.SetParameters(Parameters)
9232             self._autoPublish(anObj, theName, "fillet")
9233             return anObj
9234
9235         ## Perform a fillet on the specified edges of the given shape
9236         #  @param theShape  Wire Shape to perform fillet on.
9237         #  @param theR  Fillet radius.
9238         #  @param theListOfVertexes Global indices of vertexes to perform fillet on.
9239         #    \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9240         #    \note The list of vertices could be empty,
9241         #          in this case fillet will done done at all vertices in wire
9242         #  @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9243         #         by the length of the edges, nearest to the fillet vertex.
9244         #         But sometimes the next edge is C1 continuous with the one, nearest to
9245         #         the fillet point, and such two (or more) edges can be united to allow
9246         #         bigger radius. Set this flag to TRUE to allow collinear edges union,
9247         #         thus ignoring the secant vertex (vertices).
9248         #  @param theName Object name; when specified, this parameter is used
9249         #         for result publication in the study. Otherwise, if automatic
9250         #         publication is switched on, default value is used for result name.
9251         #
9252         #  @return New GEOM.GEOM_Object, containing the result shape.
9253         #
9254         #  @ref tui_fillet2d "Example"
9255         @ManageTransactions("LocalOp")
9256         def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9257             """
9258             Perform a fillet on the specified edges of the given shape
9259
9260             Parameters:
9261                 theShape  Wire Shape to perform fillet on.
9262                 theR  Fillet radius.
9263                 theListOfVertexes Global indices of vertexes to perform fillet on.
9264                 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9265                     by the length of the edges, nearest to the fillet vertex.
9266                     But sometimes the next edge is C1 continuous with the one, nearest to
9267                     the fillet point, and such two (or more) edges can be united to allow
9268                     bigger radius. Set this flag to TRUE to allow collinear edges union,
9269                     thus ignoring the secant vertex (vertices).
9270                 theName Object name; when specified, this parameter is used
9271                         for result publication in the study. Otherwise, if automatic
9272                         publication is switched on, default value is used for result name.
9273             Note:
9274                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9275
9276                 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9277
9278             Returns:
9279                 New GEOM.GEOM_Object, containing the result shape.
9280
9281             Example of usage:
9282                 # create wire
9283                 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9284                 # make fillet at given wire vertices with giver radius
9285                 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9286             """
9287             # Example: see GEOM_TestAll.py
9288             theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9289             anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9290             RaiseIfFailed("MakeFillet1D", self.LocalOp)
9291             anObj.SetParameters(Parameters)
9292             self._autoPublish(anObj, theName, "fillet")
9293             return anObj
9294
9295         ## Perform a fillet at the specified vertices of the given face/shell.
9296         #  @param theShape Face or Shell shape to perform fillet on.
9297         #  @param theR Fillet radius.
9298         #  @param theListOfVertexes Global indices of vertexes to perform fillet on.
9299         #  @param theName Object name; when specified, this parameter is used
9300         #         for result publication in the study. Otherwise, if automatic
9301         #         publication is switched on, default value is used for result name.
9302         #
9303         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9304         #
9305         #  @return New GEOM.GEOM_Object, containing the result shape.
9306         #
9307         #  @ref tui_fillet2d "Example"
9308         @ManageTransactions("LocalOp")
9309         def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9310             """
9311             Perform a fillet at the specified vertices of the given face/shell.
9312
9313             Parameters:
9314                 theShape  Face or Shell shape to perform fillet on.
9315                 theR  Fillet radius.
9316                 theListOfVertexes Global indices of vertexes to perform fillet on.
9317                 theName Object name; when specified, this parameter is used
9318                         for result publication in the study. Otherwise, if automatic
9319                         publication is switched on, default value is used for result name.
9320             Note:
9321                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9322
9323             Returns:
9324                 New GEOM.GEOM_Object, containing the result shape.
9325
9326             Example of usage:
9327                 face = geompy.MakeFaceHW(100, 100, 1)
9328                 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9329             """
9330             # Example: see GEOM_TestAll.py
9331             theR,Parameters = ParseParameters(theR)
9332             anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9333             RaiseIfFailed("MakeFillet2D", self.LocalOp)
9334             anObj.SetParameters(Parameters)
9335             self._autoPublish(anObj, theName, "fillet")
9336             return anObj
9337
9338         ## Perform a symmetric chamfer on all edges of the given shape.
9339         #  @param theShape Shape, to perform chamfer on.
9340         #  @param theD Chamfer size along each face.
9341         #  @param theName Object name; when specified, this parameter is used
9342         #         for result publication in the study. Otherwise, if automatic
9343         #         publication is switched on, default value is used for result name.
9344         #
9345         #  @return New GEOM.GEOM_Object, containing the result shape.
9346         #
9347         #  @ref tui_chamfer "Example 1"
9348         #  \n @ref swig_MakeChamferAll "Example 2"
9349         @ManageTransactions("LocalOp")
9350         def MakeChamferAll(self, theShape, theD, theName=None):
9351             """
9352             Perform a symmetric chamfer on all edges of the given shape.
9353
9354             Parameters:
9355                 theShape Shape, to perform chamfer on.
9356                 theD Chamfer size along each face.
9357                 theName Object name; when specified, this parameter is used
9358                         for result publication in the study. Otherwise, if automatic
9359                         publication is switched on, default value is used for result name.
9360
9361             Returns:
9362                 New GEOM.GEOM_Object, containing the result shape.
9363
9364             Example of usage:
9365                 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9366             """
9367             # Example: see GEOM_TestOthers.py
9368             theD,Parameters = ParseParameters(theD)
9369             anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9370             RaiseIfFailed("MakeChamferAll", self.LocalOp)
9371             anObj.SetParameters(Parameters)
9372             self._autoPublish(anObj, theName, "chamfer")
9373             return anObj
9374
9375         ## Perform a chamfer on edges, common to the specified faces,
9376         #  with distance D1 on the Face1
9377         #  @param theShape Shape, to perform chamfer on.
9378         #  @param theD1 Chamfer size along \a theFace1.
9379         #  @param theD2 Chamfer size along \a theFace2.
9380         #  @param theFace1,theFace2 Global indices of two faces of \a theShape.
9381         #  @param theName Object name; when specified, this parameter is used
9382         #         for result publication in the study. Otherwise, if automatic
9383         #         publication is switched on, default value is used for result name.
9384         #
9385         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9386         #
9387         #  @return New GEOM.GEOM_Object, containing the result shape.
9388         #
9389         #  @ref tui_chamfer "Example"
9390         @ManageTransactions("LocalOp")
9391         def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9392             """
9393             Perform a chamfer on edges, common to the specified faces,
9394             with distance D1 on the Face1
9395
9396             Parameters:
9397                 theShape Shape, to perform chamfer on.
9398                 theD1 Chamfer size along theFace1.
9399                 theD2 Chamfer size along theFace2.
9400                 theFace1,theFace2 Global indices of two faces of theShape.
9401                 theName Object name; when specified, this parameter is used
9402                         for result publication in the study. Otherwise, if automatic
9403                         publication is switched on, default value is used for result name.
9404
9405             Note:
9406                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9407
9408             Returns:
9409                 New GEOM.GEOM_Object, containing the result shape.
9410
9411             Example of usage:
9412                 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9413                 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9414                 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9415                 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9416             """
9417             # Example: see GEOM_TestAll.py
9418             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9419             anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9420             RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9421             anObj.SetParameters(Parameters)
9422             self._autoPublish(anObj, theName, "chamfer")
9423             return anObj
9424
9425         ## Perform a chamfer on edges
9426         #  @param theShape Shape, to perform chamfer on.
9427         #  @param theD Chamfer length
9428         #  @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9429         #  @param theFace1,theFace2 Global indices of two faces of \a theShape.
9430         #  @param theName Object name; when specified, this parameter is used
9431         #         for result publication in the study. Otherwise, if automatic
9432         #         publication is switched on, default value is used for result name.
9433         #
9434         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9435         #
9436         #  @return New GEOM.GEOM_Object, containing the result shape.
9437         @ManageTransactions("LocalOp")
9438         def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9439             """
9440             Perform a chamfer on edges
9441
9442             Parameters:
9443                 theShape Shape, to perform chamfer on.
9444                 theD1 Chamfer size along theFace1.
9445                 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9446                 theFace1,theFace2 Global indices of two faces of theShape.
9447                 theName Object name; when specified, this parameter is used
9448                         for result publication in the study. Otherwise, if automatic
9449                         publication is switched on, default value is used for result name.
9450
9451             Note:
9452                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9453
9454             Returns:
9455                 New GEOM.GEOM_Object, containing the result shape.
9456
9457             Example of usage:
9458                 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9459                 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9460                 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9461                 ang = 30
9462                 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9463             """
9464             flag = False
9465             if isinstance(theAngle,str):
9466                 flag = True
9467             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9468             if flag:
9469                 theAngle = theAngle*math.pi/180.0
9470             anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9471             RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9472             anObj.SetParameters(Parameters)
9473             self._autoPublish(anObj, theName, "chamfer")
9474             return anObj
9475
9476         ## Perform a chamfer on all edges of the specified faces,
9477         #  with distance D1 on the first specified face (if several for one edge)
9478         #  @param theShape Shape, to perform chamfer on.
9479         #  @param theD1 Chamfer size along face from \a theFaces. If both faces,
9480         #               connected to the edge, are in \a theFaces, \a theD1
9481         #               will be get along face, which is nearer to \a theFaces beginning.
9482         #  @param theD2 Chamfer size along another of two faces, connected to the edge.
9483         #  @param theFaces Sequence of global indices of faces of \a theShape.
9484         #  @param theName Object name; when specified, this parameter is used
9485         #         for result publication in the study. Otherwise, if automatic
9486         #         publication is switched on, default value is used for result name.
9487         #
9488         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9489         #
9490         #  @return New GEOM.GEOM_Object, containing the result shape.
9491         #
9492         #  @ref tui_chamfer "Example"
9493         @ManageTransactions("LocalOp")
9494         def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9495             """
9496             Perform a chamfer on all edges of the specified faces,
9497             with distance D1 on the first specified face (if several for one edge)
9498
9499             Parameters:
9500                 theShape Shape, to perform chamfer on.
9501                 theD1 Chamfer size along face from  theFaces. If both faces,
9502                       connected to the edge, are in theFaces, theD1
9503                       will be get along face, which is nearer to theFaces beginning.
9504                 theD2 Chamfer size along another of two faces, connected to the edge.
9505                 theFaces Sequence of global indices of faces of theShape.
9506                 theName Object name; when specified, this parameter is used
9507                         for result publication in the study. Otherwise, if automatic
9508                         publication is switched on, default value is used for result name.
9509
9510             Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9511
9512             Returns:
9513                 New GEOM.GEOM_Object, containing the result shape.
9514             """
9515             # Example: see GEOM_TestAll.py
9516             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9517             anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9518             RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9519             anObj.SetParameters(Parameters)
9520             self._autoPublish(anObj, theName, "chamfer")
9521             return anObj
9522
9523         ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9524         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9525         #
9526         #  @ref swig_FilletChamfer "Example"
9527         @ManageTransactions("LocalOp")
9528         def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9529             """
9530             The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9531             theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9532             """
9533             flag = False
9534             if isinstance(theAngle,str):
9535                 flag = True
9536             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9537             if flag:
9538                 theAngle = theAngle*math.pi/180.0
9539             anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9540             RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9541             anObj.SetParameters(Parameters)
9542             self._autoPublish(anObj, theName, "chamfer")
9543             return anObj
9544
9545         ## Perform a chamfer on edges,
9546         #  with distance D1 on the first specified face (if several for one edge)
9547         #  @param theShape Shape, to perform chamfer on.
9548         #  @param theD1,theD2 Chamfer size
9549         #  @param theEdges Sequence of edges of \a theShape.
9550         #  @param theName Object name; when specified, this parameter is used
9551         #         for result publication in the study. Otherwise, if automatic
9552         #         publication is switched on, default value is used for result name.
9553         #
9554         #  @return New GEOM.GEOM_Object, containing the result shape.
9555         #
9556         #  @ref swig_FilletChamfer "Example"
9557         @ManageTransactions("LocalOp")
9558         def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9559             """
9560             Perform a chamfer on edges,
9561             with distance D1 on the first specified face (if several for one edge)
9562
9563             Parameters:
9564                 theShape Shape, to perform chamfer on.
9565                 theD1,theD2 Chamfer size
9566                 theEdges Sequence of edges of theShape.
9567                 theName Object name; when specified, this parameter is used
9568                         for result publication in the study. Otherwise, if automatic
9569                         publication is switched on, default value is used for result name.
9570
9571             Returns:
9572                 New GEOM.GEOM_Object, containing the result shape.
9573             """
9574             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9575             anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9576             RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9577             anObj.SetParameters(Parameters)
9578             self._autoPublish(anObj, theName, "chamfer")
9579             return anObj
9580
9581         ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9582         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9583         @ManageTransactions("LocalOp")
9584         def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9585             """
9586             The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9587             theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9588             """
9589             flag = False
9590             if isinstance(theAngle,str):
9591                 flag = True
9592             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9593             if flag:
9594                 theAngle = theAngle*math.pi/180.0
9595             anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9596             RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9597             anObj.SetParameters(Parameters)
9598             self._autoPublish(anObj, theName, "chamfer")
9599             return anObj
9600
9601         ## @sa MakeChamferEdge(), MakeChamferFaces()
9602         #
9603         #  @ref swig_MakeChamfer "Example"
9604         def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9605             """
9606             See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9607             """
9608             # Example: see GEOM_TestOthers.py
9609             anObj = None
9610             # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9611             if aShapeType == self.ShapeType["EDGE"]:
9612                 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9613             else:
9614                 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9615             return anObj
9616
9617         ## Remove material from a solid by extrusion of the base shape on the given distance.
9618         #  @param theInit Shape to remove material from. It must be a solid or
9619         #  a compound made of a single solid.
9620         #  @param theBase Closed edge or wire defining the base shape to be extruded.
9621         #  @param theH Prism dimension along the normal to theBase
9622         #  @param theAngle Draft angle in degrees.
9623         #  @param theName Object name; when specified, this parameter is used
9624         #         for result publication in the study. Otherwise, if automatic
9625         #         publication is switched on, default value is used for result name.
9626         #
9627         #  @return New GEOM.GEOM_Object, containing the initial shape with removed material
9628         #
9629         #  @ref tui_creation_prism "Example"
9630         @ManageTransactions("PrimOp")
9631         def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9632             """
9633             Add material to a solid by extrusion of the base shape on the given distance.
9634
9635             Parameters:
9636                 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9637                 theBase Closed edge or wire defining the base shape to be extruded.
9638                 theH Prism dimension along the normal  to theBase
9639                 theAngle Draft angle in degrees.
9640                 theName Object name; when specified, this parameter is used
9641                         for result publication in the study. Otherwise, if automatic
9642                         publication is switched on, default value is used for result name.
9643
9644             Returns:
9645                 New GEOM.GEOM_Object,  containing the initial shape with removed material.
9646             """
9647             # Example: see GEOM_TestAll.py
9648             #theH,Parameters = ParseParameters(theH)
9649             anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9650             RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9651             #anObj.SetParameters(Parameters)
9652             self._autoPublish(anObj, theName, "extrudedCut")
9653             return anObj
9654
9655         ## Add material to a solid by extrusion of the base shape on the given distance.
9656         #  @param theInit Shape to add material to. It must be a solid or
9657         #  a compound made of a single solid.
9658         #  @param theBase Closed edge or wire defining the base shape to be extruded.
9659         #  @param theH Prism dimension along the normal to theBase
9660         #  @param theAngle Draft angle in degrees.
9661         #  @param theName Object name; when specified, this parameter is used
9662         #         for result publication in the study. Otherwise, if automatic
9663         #         publication is switched on, default value is used for result name.
9664         #
9665         #  @return New GEOM.GEOM_Object, containing the initial shape with added material
9666         #
9667         #  @ref tui_creation_prism "Example"
9668         @ManageTransactions("PrimOp")
9669         def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9670             """
9671             Add material to a solid by extrusion of the base shape on the given distance.
9672
9673             Parameters:
9674                 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9675                 theBase Closed edge or wire defining the base shape to be extruded.
9676                 theH Prism dimension along the normal  to theBase
9677                 theAngle Draft angle in degrees.
9678                 theName Object name; when specified, this parameter is used
9679                         for result publication in the study. Otherwise, if automatic
9680                         publication is switched on, default value is used for result name.
9681
9682             Returns:
9683                 New GEOM.GEOM_Object,  containing the initial shape with added material.
9684             """
9685             # Example: see GEOM_TestAll.py
9686             #theH,Parameters = ParseParameters(theH)
9687             anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9688             RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9689             #anObj.SetParameters(Parameters)
9690             self._autoPublish(anObj, theName, "extrudedBoss")
9691             return anObj
9692
9693         # end of l3_local
9694         ## @}
9695
9696         ## @addtogroup l3_basic_op
9697         ## @{
9698
9699         ## Perform an Archimde operation on the given shape with given parameters.
9700         #  The object presenting the resulting face is returned.
9701         #  @param theShape Shape to be put in water.
9702         #  @param theWeight Weight og the shape.
9703         #  @param theWaterDensity Density of the water.
9704         #  @param theMeshDeflection Deflection of the mesh, using to compute the section.
9705         #  @param theName Object name; when specified, this parameter is used
9706         #         for result publication in the study. Otherwise, if automatic
9707         #         publication is switched on, default value is used for result name.
9708         #
9709         #  @return New GEOM.GEOM_Object, containing a section of \a theShape
9710         #          by a plane, corresponding to water level.
9711         #
9712         #  @ref tui_archimede "Example"
9713         @ManageTransactions("LocalOp")
9714         def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9715             """
9716             Perform an Archimde operation on the given shape with given parameters.
9717             The object presenting the resulting face is returned.
9718
9719             Parameters:
9720                 theShape Shape to be put in water.
9721                 theWeight Weight og the shape.
9722                 theWaterDensity Density of the water.
9723                 theMeshDeflection Deflection of the mesh, using to compute the section.
9724                 theName Object name; when specified, this parameter is used
9725                         for result publication in the study. Otherwise, if automatic
9726                         publication is switched on, default value is used for result name.
9727
9728             Returns:
9729                 New GEOM.GEOM_Object, containing a section of theShape
9730                 by a plane, corresponding to water level.
9731             """
9732             # Example: see GEOM_TestAll.py
9733             theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9734               theWeight,theWaterDensity,theMeshDeflection)
9735             anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9736             RaiseIfFailed("MakeArchimede", self.LocalOp)
9737             anObj.SetParameters(Parameters)
9738             self._autoPublish(anObj, theName, "archimede")
9739             return anObj
9740
9741         # end of l3_basic_op
9742         ## @}
9743
9744         ## @addtogroup l2_measure
9745         ## @{
9746
9747         ## Get point coordinates
9748         #  @return [x, y, z]
9749         #
9750         #  @ref tui_measurement_tools_page "Example"
9751         @ManageTransactions("MeasuOp")
9752         def PointCoordinates(self,Point):
9753             """
9754             Get point coordinates
9755
9756             Returns:
9757                 [x, y, z]
9758             """
9759             # Example: see GEOM_TestMeasures.py
9760             aTuple = self.MeasuOp.PointCoordinates(Point)
9761             RaiseIfFailed("PointCoordinates", self.MeasuOp)
9762             return aTuple
9763
9764         ## Get vector coordinates
9765         #  @return [x, y, z]
9766         #
9767         #  @ref tui_measurement_tools_page "Example"
9768         def VectorCoordinates(self,Vector):
9769             """
9770             Get vector coordinates
9771
9772             Returns:
9773                 [x, y, z]
9774             """
9775
9776             p1=self.GetFirstVertex(Vector)
9777             p2=self.GetLastVertex(Vector)
9778
9779             X1=self.PointCoordinates(p1)
9780             X2=self.PointCoordinates(p2)
9781
9782             return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9783
9784
9785         ## Compute cross product
9786         #  @return vector w=u^v
9787         #
9788         #  @ref tui_measurement_tools_page "Example"
9789         def CrossProduct(self, Vector1, Vector2):
9790             """
9791             Compute cross product
9792
9793             Returns: vector w=u^v
9794             """
9795             u=self.VectorCoordinates(Vector1)
9796             v=self.VectorCoordinates(Vector2)
9797             w=self.MakeVectorDXDYDZ(u[1]*v[2]-u[2]*v[1], u[2]*v[0]-u[0]*v[2], u[0]*v[1]-u[1]*v[0])
9798
9799             return w
9800
9801         ## Compute cross product
9802         #  @return dot product  p=u.v
9803         #
9804         #  @ref tui_measurement_tools_page "Example"
9805         def DotProduct(self, Vector1, Vector2):
9806             """
9807             Compute cross product
9808
9809             Returns: dot product  p=u.v
9810             """
9811             u=self.VectorCoordinates(Vector1)
9812             v=self.VectorCoordinates(Vector2)
9813             p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9814
9815             return p
9816
9817
9818         ## Get summarized length of all wires,
9819         #  area of surface and volume of the given shape.
9820         #  @param theShape Shape to define properties of.
9821         #  @return [theLength, theSurfArea, theVolume]\n
9822         #  theLength:   Summarized length of all wires of the given shape.\n
9823         #  theSurfArea: Area of surface of the given shape.\n
9824         #  theVolume:   Volume of the given shape.
9825         #
9826         #  @ref tui_measurement_tools_page "Example"
9827         @ManageTransactions("MeasuOp")
9828         def BasicProperties(self,theShape):
9829             """
9830             Get summarized length of all wires,
9831             area of surface and volume of the given shape.
9832
9833             Parameters:
9834                 theShape Shape to define properties of.
9835
9836             Returns:
9837                 [theLength, theSurfArea, theVolume]
9838                  theLength:   Summarized length of all wires of the given shape.
9839                  theSurfArea: Area of surface of the given shape.
9840                  theVolume:   Volume of the given shape.
9841             """
9842             # Example: see GEOM_TestMeasures.py
9843             aTuple = self.MeasuOp.GetBasicProperties(theShape)
9844             RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9845             return aTuple
9846
9847         ## Get parameters of bounding box of the given shape
9848         #  @param theShape Shape to obtain bounding box of.
9849         #  @param precise TRUE for precise computation; FALSE for fast one.
9850         #  @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9851         #  Xmin,Xmax: Limits of shape along OX axis.
9852         #  Ymin,Ymax: Limits of shape along OY axis.
9853         #  Zmin,Zmax: Limits of shape along OZ axis.
9854         #
9855         #  @ref tui_measurement_tools_page "Example"
9856         @ManageTransactions("MeasuOp")
9857         def BoundingBox (self, theShape, precise=False):
9858             """
9859             Get parameters of bounding box of the given shape
9860
9861             Parameters:
9862                 theShape Shape to obtain bounding box of.
9863                 precise TRUE for precise computation; FALSE for fast one.
9864
9865             Returns:
9866                 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9867                  Xmin,Xmax: Limits of shape along OX axis.
9868                  Ymin,Ymax: Limits of shape along OY axis.
9869                  Zmin,Zmax: Limits of shape along OZ axis.
9870             """
9871             # Example: see GEOM_TestMeasures.py
9872             aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9873             RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9874             return aTuple
9875
9876         ## Get bounding box of the given shape
9877         #  @param theShape Shape to obtain bounding box of.
9878         #  @param precise TRUE for precise computation; FALSE for fast one.
9879         #  @param theName Object name; when specified, this parameter is used
9880         #         for result publication in the study. Otherwise, if automatic
9881         #         publication is switched on, default value is used for result name.
9882         #
9883         #  @return New GEOM.GEOM_Object, containing the created box.
9884         #
9885         #  @ref tui_measurement_tools_page "Example"
9886         @ManageTransactions("MeasuOp")
9887         def MakeBoundingBox (self, theShape, precise=False, theName=None):
9888             """
9889             Get bounding box of the given shape
9890
9891             Parameters:
9892                 theShape Shape to obtain bounding box of.
9893                 precise TRUE for precise computation; FALSE for fast one.
9894                 theName Object name; when specified, this parameter is used
9895                         for result publication in the study. Otherwise, if automatic
9896                         publication is switched on, default value is used for result name.
9897
9898             Returns:
9899                 New GEOM.GEOM_Object, containing the created box.
9900             """
9901             # Example: see GEOM_TestMeasures.py
9902             anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9903             RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9904             self._autoPublish(anObj, theName, "bndbox")
9905             return anObj
9906
9907         ## Get inertia matrix and moments of inertia of theShape.
9908         #  @param theShape Shape to calculate inertia of.
9909         #  @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9910         #  I(1-3)(1-3): Components of the inertia matrix of the given shape.
9911         #  Ix,Iy,Iz:    Moments of inertia of the given shape.
9912         #
9913         #  @ref tui_measurement_tools_page "Example"
9914         @ManageTransactions("MeasuOp")
9915         def Inertia(self,theShape):
9916             """
9917             Get inertia matrix and moments of inertia of theShape.
9918
9919             Parameters:
9920                 theShape Shape to calculate inertia of.
9921
9922             Returns:
9923                 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9924                  I(1-3)(1-3): Components of the inertia matrix of the given shape.
9925                  Ix,Iy,Iz:    Moments of inertia of the given shape.
9926             """
9927             # Example: see GEOM_TestMeasures.py
9928             aTuple = self.MeasuOp.GetInertia(theShape)
9929             RaiseIfFailed("GetInertia", self.MeasuOp)
9930             return aTuple
9931
9932         ## Get if coords are included in the shape (ST_IN or ST_ON)
9933         #  @param theShape Shape
9934         #  @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9935         #  @param tolerance to be used (default is 1.0e-7)
9936         #  @return list_of_boolean = [res1, res2, ...]
9937         @ManageTransactions("MeasuOp")
9938         def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9939             """
9940             Get if coords are included in the shape (ST_IN or ST_ON)
9941
9942             Parameters:
9943                 theShape Shape
9944                 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9945                 tolerance to be used (default is 1.0e-7)
9946
9947             Returns:
9948                 list_of_boolean = [res1, res2, ...]
9949             """
9950             return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9951
9952         ## Get minimal distance between the given shapes.
9953         #  @param theShape1,theShape2 Shapes to find minimal distance between.
9954         #  @return Value of the minimal distance between the given shapes.
9955         #
9956         #  @ref tui_measurement_tools_page "Example"
9957         @ManageTransactions("MeasuOp")
9958         def MinDistance(self, theShape1, theShape2):
9959             """
9960             Get minimal distance between the given shapes.
9961
9962             Parameters:
9963                 theShape1,theShape2 Shapes to find minimal distance between.
9964
9965             Returns:
9966                 Value of the minimal distance between the given shapes.
9967             """
9968             # Example: see GEOM_TestMeasures.py
9969             aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9970             RaiseIfFailed("GetMinDistance", self.MeasuOp)
9971             return aTuple[0]
9972
9973         ## Get minimal distance between the given shapes.
9974         #  @param theShape1,theShape2 Shapes to find minimal distance between.
9975         #  @return Value of the minimal distance between the given shapes, in form of list
9976         #          [Distance, DX, DY, DZ].
9977         #
9978         #  @ref swig_all_measure "Example"
9979         @ManageTransactions("MeasuOp")
9980         def MinDistanceComponents(self, theShape1, theShape2):
9981             """
9982             Get minimal distance between the given shapes.
9983
9984             Parameters:
9985                 theShape1,theShape2 Shapes to find minimal distance between.
9986
9987             Returns:
9988                 Value of the minimal distance between the given shapes, in form of list
9989                 [Distance, DX, DY, DZ]
9990             """
9991             # Example: see GEOM_TestMeasures.py
9992             aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9993             RaiseIfFailed("GetMinDistance", self.MeasuOp)
9994             aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9995             return aRes
9996
9997         ## Get closest points of the given shapes.
9998         #  @param theShape1,theShape2 Shapes to find closest points of.
9999         #  @return The number of found solutions (-1 in case of infinite number of
10000         #          solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10001         #
10002         #  @ref tui_measurement_tools_page "Example"
10003         @ManageTransactions("MeasuOp")
10004         def ClosestPoints (self, theShape1, theShape2):
10005             """
10006             Get closest points of the given shapes.
10007
10008             Parameters:
10009                 theShape1,theShape2 Shapes to find closest points of.
10010
10011             Returns:
10012                 The number of found solutions (-1 in case of infinite number of
10013                 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10014             """
10015             # Example: see GEOM_TestMeasures.py
10016             aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10017             RaiseIfFailed("ClosestPoints", self.MeasuOp)
10018             return aTuple
10019
10020         ## Get angle between the given shapes in degrees.
10021         #  @param theShape1,theShape2 Lines or linear edges to find angle between.
10022         #  @note If both arguments are vectors, the angle is computed in accordance
10023         #        with their orientations, otherwise the minimum angle is computed.
10024         #  @return Value of the angle between the given shapes in degrees.
10025         #
10026         #  @ref tui_measurement_tools_page "Example"
10027         @ManageTransactions("MeasuOp")
10028         def GetAngle(self, theShape1, theShape2):
10029             """
10030             Get angle between the given shapes in degrees.
10031
10032             Parameters:
10033                 theShape1,theShape2 Lines or linear edges to find angle between.
10034
10035             Note:
10036                 If both arguments are vectors, the angle is computed in accordance
10037                 with their orientations, otherwise the minimum angle is computed.
10038
10039             Returns:
10040                 Value of the angle between the given shapes in degrees.
10041             """
10042             # Example: see GEOM_TestMeasures.py
10043             anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10044             RaiseIfFailed("GetAngle", self.MeasuOp)
10045             return anAngle
10046
10047         ## Get angle between the given shapes in radians.
10048         #  @param theShape1,theShape2 Lines or linear edges to find angle between.
10049         #  @note If both arguments are vectors, the angle is computed in accordance
10050         #        with their orientations, otherwise the minimum angle is computed.
10051         #  @return Value of the angle between the given shapes in radians.
10052         #
10053         #  @ref tui_measurement_tools_page "Example"
10054         @ManageTransactions("MeasuOp")
10055         def GetAngleRadians(self, theShape1, theShape2):
10056             """
10057             Get angle between the given shapes in radians.
10058
10059             Parameters:
10060                 theShape1,theShape2 Lines or linear edges to find angle between.
10061
10062
10063             Note:
10064                 If both arguments are vectors, the angle is computed in accordance
10065                 with their orientations, otherwise the minimum angle is computed.
10066
10067             Returns:
10068                 Value of the angle between the given shapes in radians.
10069             """
10070             # Example: see GEOM_TestMeasures.py
10071             anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10072             RaiseIfFailed("GetAngle", self.MeasuOp)
10073             return anAngle
10074
10075         ## Get angle between the given vectors in degrees.
10076         #  @param theShape1,theShape2 Vectors to find angle between.
10077         #  @param theFlag If True, the normal vector is defined by the two vectors cross,
10078         #                 if False, the opposite vector to the normal vector is used.
10079         #  @return Value of the angle between the given vectors in degrees.
10080         #
10081         #  @ref tui_measurement_tools_page "Example"
10082         @ManageTransactions("MeasuOp")
10083         def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10084             """
10085             Get angle between the given vectors in degrees.
10086
10087             Parameters:
10088                 theShape1,theShape2 Vectors to find angle between.
10089                 theFlag If True, the normal vector is defined by the two vectors cross,
10090                         if False, the opposite vector to the normal vector is used.
10091
10092             Returns:
10093                 Value of the angle between the given vectors in degrees.
10094             """
10095             anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
10096             if not theFlag:
10097                 anAngle = 360. - anAngle
10098             RaiseIfFailed("GetAngleVectors", self.MeasuOp)
10099             return anAngle
10100
10101         ## The same as GetAngleVectors, but the result is in radians.
10102         def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
10103             """
10104             Get angle between the given vectors in radians.
10105
10106             Parameters:
10107                 theShape1,theShape2 Vectors to find angle between.
10108                 theFlag If True, the normal vector is defined by the two vectors cross,
10109                         if False, the opposite vector to the normal vector is used.
10110
10111             Returns:
10112                 Value of the angle between the given vectors in radians.
10113             """
10114             anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
10115             return anAngle
10116
10117         ## @name Curve Curvature Measurement
10118         #  Methods for receiving radius of curvature of curves
10119         #  in the given point
10120         ## @{
10121
10122         ## Measure curvature of a curve at a point, set by parameter.
10123         #  @param theCurve a curve.
10124         #  @param theParam parameter.
10125         #  @return radius of curvature of \a theCurve.
10126         #
10127         #  @ref swig_todo "Example"
10128         @ManageTransactions("MeasuOp")
10129         def CurveCurvatureByParam(self, theCurve, theParam):
10130             """
10131             Measure curvature of a curve at a point, set by parameter.
10132
10133             Parameters:
10134                 theCurve a curve.
10135                 theParam parameter.
10136
10137             Returns:
10138                 radius of curvature of theCurve.
10139             """
10140             # Example: see GEOM_TestMeasures.py
10141             aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10142             RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10143             return aCurv
10144
10145         ## Measure curvature of a curve at a point.
10146         #  @param theCurve a curve.
10147         #  @param thePoint given point.
10148         #  @return radius of curvature of \a theCurve.
10149         #
10150         #  @ref swig_todo "Example"
10151         @ManageTransactions("MeasuOp")
10152         def CurveCurvatureByPoint(self, theCurve, thePoint):
10153             """
10154             Measure curvature of a curve at a point.
10155
10156             Parameters:
10157                 theCurve a curve.
10158                 thePoint given point.
10159
10160             Returns:
10161                 radius of curvature of theCurve.
10162             """
10163             aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10164             RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10165             return aCurv
10166         ## @}
10167
10168         ## @name Surface Curvature Measurement
10169         #  Methods for receiving max and min radius of curvature of surfaces
10170         #  in the given point
10171         ## @{
10172
10173         ## Measure max radius of curvature of surface.
10174         #  @param theSurf the given surface.
10175         #  @param theUParam Value of U-parameter on the referenced surface.
10176         #  @param theVParam Value of V-parameter on the referenced surface.
10177         #  @return max radius of curvature of theSurf.
10178         #
10179         ## @ref swig_todo "Example"
10180         @ManageTransactions("MeasuOp")
10181         def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10182             """
10183             Measure max radius of curvature of surface.
10184
10185             Parameters:
10186                 theSurf the given surface.
10187                 theUParam Value of U-parameter on the referenced surface.
10188                 theVParam Value of V-parameter on the referenced surface.
10189
10190             Returns:
10191                 max radius of curvature of theSurf.
10192             """
10193             # Example: see GEOM_TestMeasures.py
10194             aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10195             RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10196             return aSurf
10197
10198         ## Measure max radius of curvature of surface in the given point
10199         #  @param theSurf the given surface.
10200         #  @param thePoint given point.
10201         #  @return max radius of curvature of theSurf.
10202         #
10203         ## @ref swig_todo "Example"
10204         @ManageTransactions("MeasuOp")
10205         def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10206             """
10207             Measure max radius of curvature of surface in the given point.
10208
10209             Parameters:
10210                 theSurf the given surface.
10211                 thePoint given point.
10212
10213             Returns:
10214                 max radius of curvature of theSurf.
10215             """
10216             aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10217             RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10218             return aSurf
10219
10220         ## Measure min radius of curvature of surface.
10221         #  @param theSurf the given surface.
10222         #  @param theUParam Value of U-parameter on the referenced surface.
10223         #  @param theVParam Value of V-parameter on the referenced surface.
10224         #  @return min radius of curvature of theSurf.
10225         #
10226         ## @ref swig_todo "Example"
10227         @ManageTransactions("MeasuOp")
10228         def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10229             """
10230             Measure min radius of curvature of surface.
10231
10232             Parameters:
10233                 theSurf the given surface.
10234                 theUParam Value of U-parameter on the referenced surface.
10235                 theVParam Value of V-parameter on the referenced surface.
10236
10237             Returns:
10238                 Min radius of curvature of theSurf.
10239             """
10240             aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10241             RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10242             return aSurf
10243
10244         ## Measure min radius of curvature of surface in the given point
10245         #  @param theSurf the given surface.
10246         #  @param thePoint given point.
10247         #  @return min radius of curvature of theSurf.
10248         #
10249         ## @ref swig_todo "Example"
10250         @ManageTransactions("MeasuOp")
10251         def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10252             """
10253             Measure min radius of curvature of surface in the given point.
10254
10255             Parameters:
10256                 theSurf the given surface.
10257                 thePoint given point.
10258
10259             Returns:
10260                 Min radius of curvature of theSurf.
10261             """
10262             aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10263             RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10264             return aSurf
10265         ## @}
10266
10267         ## Get min and max tolerances of sub-shapes of theShape
10268         #  @param theShape Shape, to get tolerances of.
10269         #  @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10270         #  FaceMin,FaceMax: Min and max tolerances of the faces.\n
10271         #  EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10272         #  VertMin,VertMax: Min and max tolerances of the vertices.
10273         #
10274         #  @ref tui_measurement_tools_page "Example"
10275         @ManageTransactions("MeasuOp")
10276         def Tolerance(self,theShape):
10277             """
10278             Get min and max tolerances of sub-shapes of theShape
10279
10280             Parameters:
10281                 theShape Shape, to get tolerances of.
10282
10283             Returns:
10284                 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10285                  FaceMin,FaceMax: Min and max tolerances of the faces.
10286                  EdgeMin,EdgeMax: Min and max tolerances of the edges.
10287                  VertMin,VertMax: Min and max tolerances of the vertices.
10288             """
10289             # Example: see GEOM_TestMeasures.py
10290             aTuple = self.MeasuOp.GetTolerance(theShape)
10291             RaiseIfFailed("GetTolerance", self.MeasuOp)
10292             return aTuple
10293
10294         ## Obtain description of the given shape (number of sub-shapes of each type)
10295         #  @param theShape Shape to be described.
10296         #  @return Description of the given shape.
10297         #
10298         #  @ref tui_measurement_tools_page "Example"
10299         @ManageTransactions("MeasuOp")
10300         def WhatIs(self,theShape):
10301             """
10302             Obtain description of the given shape (number of sub-shapes of each type)
10303
10304             Parameters:
10305                 theShape Shape to be described.
10306
10307             Returns:
10308                 Description of the given shape.
10309             """
10310             # Example: see GEOM_TestMeasures.py
10311             aDescr = self.MeasuOp.WhatIs(theShape)
10312             RaiseIfFailed("WhatIs", self.MeasuOp)
10313             return aDescr
10314
10315         ## Obtain quantity of shapes of the given type in \a theShape.
10316         #  If \a theShape is of type \a theType, it is also counted.
10317         #  @param theShape Shape to be described.
10318         #  @param theType the given ShapeType().
10319         #  @return Quantity of shapes of type \a theType in \a theShape.
10320         #
10321         #  @ref tui_measurement_tools_page "Example"
10322         def NbShapes (self, theShape, theType):
10323             """
10324             Obtain quantity of shapes of the given type in theShape.
10325             If theShape is of type theType, it is also counted.
10326
10327             Parameters:
10328                 theShape Shape to be described.
10329                 theType the given geompy.ShapeType
10330
10331             Returns:
10332                 Quantity of shapes of type theType in theShape.
10333             """
10334             # Example: see GEOM_TestMeasures.py
10335             listSh = self.SubShapeAllIDs(theShape, theType)
10336             Nb = len(listSh)
10337             return Nb
10338
10339         ## Obtain quantity of shapes of each type in \a theShape.
10340         #  The \a theShape is also counted.
10341         #  @param theShape Shape to be described.
10342         #  @return Dictionary of ShapeType() with bound quantities of shapes.
10343         #
10344         #  @ref tui_measurement_tools_page "Example"
10345         def ShapeInfo (self, theShape):
10346             """
10347             Obtain quantity of shapes of each type in theShape.
10348             The theShape is also counted.
10349
10350             Parameters:
10351                 theShape Shape to be described.
10352
10353             Returns:
10354                 Dictionary of geompy.ShapeType with bound quantities of shapes.
10355             """
10356             # Example: see GEOM_TestMeasures.py
10357             aDict = {}
10358             for typeSh in self.ShapeType:
10359                 if typeSh in ( "AUTO", "SHAPE" ): continue
10360                 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10361                 Nb = len(listSh)
10362                 aDict[typeSh] = Nb
10363                 pass
10364             return aDict
10365
10366         def GetCreationInformation(self, theShape):
10367             info = theShape.GetCreationInformation()
10368             # operationName
10369             opName = info.operationName
10370             if not opName: opName = "no info available"
10371             res = "Operation: " + opName
10372             # parameters
10373             for parVal in info.params:
10374                 res += " \n %s = %s" % ( parVal.name, parVal.value )
10375             return res
10376
10377         ## Get a point, situated at the centre of mass of theShape.
10378         #  @param theShape Shape to define centre of mass of.
10379         #  @param theName Object name; when specified, this parameter is used
10380         #         for result publication in the study. Otherwise, if automatic
10381         #         publication is switched on, default value is used for result name.
10382         #
10383         #  @return New GEOM.GEOM_Object, containing the created point.
10384         #
10385         #  @ref tui_measurement_tools_page "Example"
10386         @ManageTransactions("MeasuOp")
10387         def MakeCDG(self, theShape, theName=None):
10388             """
10389             Get a point, situated at the centre of mass of theShape.
10390
10391             Parameters:
10392                 theShape Shape to define centre of mass of.
10393                 theName Object name; when specified, this parameter is used
10394                         for result publication in the study. Otherwise, if automatic
10395                         publication is switched on, default value is used for result name.
10396
10397             Returns:
10398                 New GEOM.GEOM_Object, containing the created point.
10399             """
10400             # Example: see GEOM_TestMeasures.py
10401             anObj = self.MeasuOp.GetCentreOfMass(theShape)
10402             RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10403             self._autoPublish(anObj, theName, "centerOfMass")
10404             return anObj
10405
10406         ## Get a vertex sub-shape by index depended with orientation.
10407         #  @param theShape Shape to find sub-shape.
10408         #  @param theIndex Index to find vertex by this index (starting from zero)
10409         #  @param theName Object name; when specified, this parameter is used
10410         #         for result publication in the study. Otherwise, if automatic
10411         #         publication is switched on, default value is used for result name.
10412         #
10413         #  @return New GEOM.GEOM_Object, containing the created vertex.
10414         #
10415         #  @ref tui_measurement_tools_page "Example"
10416         @ManageTransactions("MeasuOp")
10417         def GetVertexByIndex(self, theShape, theIndex, theName=None):
10418             """
10419             Get a vertex sub-shape by index depended with orientation.
10420
10421             Parameters:
10422                 theShape Shape to find sub-shape.
10423                 theIndex Index to find vertex by this index (starting from zero)
10424                 theName Object name; when specified, this parameter is used
10425                         for result publication in the study. Otherwise, if automatic
10426                         publication is switched on, default value is used for result name.
10427
10428             Returns:
10429                 New GEOM.GEOM_Object, containing the created vertex.
10430             """
10431             # Example: see GEOM_TestMeasures.py
10432             anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10433             RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10434             self._autoPublish(anObj, theName, "vertex")
10435             return anObj
10436
10437         ## Get the first vertex of wire/edge depended orientation.
10438         #  @param theShape Shape to find first vertex.
10439         #  @param theName Object name; when specified, this parameter is used
10440         #         for result publication in the study. Otherwise, if automatic
10441         #         publication is switched on, default value is used for result name.
10442         #
10443         #  @return New GEOM.GEOM_Object, containing the created vertex.
10444         #
10445         #  @ref tui_measurement_tools_page "Example"
10446         def GetFirstVertex(self, theShape, theName=None):
10447             """
10448             Get the first vertex of wire/edge depended orientation.
10449
10450             Parameters:
10451                 theShape Shape to find first vertex.
10452                 theName Object name; when specified, this parameter is used
10453                         for result publication in the study. Otherwise, if automatic
10454                         publication is switched on, default value is used for result name.
10455
10456             Returns:
10457                 New GEOM.GEOM_Object, containing the created vertex.
10458             """
10459             # Example: see GEOM_TestMeasures.py
10460             # note: auto-publishing is done in self.GetVertexByIndex()
10461             return self.GetVertexByIndex(theShape, 0, theName)
10462
10463         ## Get the last vertex of wire/edge depended orientation.
10464         #  @param theShape Shape to find last vertex.
10465         #  @param theName Object name; when specified, this parameter is used
10466         #         for result publication in the study. Otherwise, if automatic
10467         #         publication is switched on, default value is used for result name.
10468         #
10469         #  @return New GEOM.GEOM_Object, containing the created vertex.
10470         #
10471         #  @ref tui_measurement_tools_page "Example"
10472         def GetLastVertex(self, theShape, theName=None):
10473             """
10474             Get the last vertex of wire/edge depended orientation.
10475
10476             Parameters:
10477                 theShape Shape to find last vertex.
10478                 theName Object name; when specified, this parameter is used
10479                         for result publication in the study. Otherwise, if automatic
10480                         publication is switched on, default value is used for result name.
10481
10482             Returns:
10483                 New GEOM.GEOM_Object, containing the created vertex.
10484             """
10485             # Example: see GEOM_TestMeasures.py
10486             nb_vert =  self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10487             # note: auto-publishing is done in self.GetVertexByIndex()
10488             return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10489
10490         ## Get a normale to the given face. If the point is not given,
10491         #  the normale is calculated at the center of mass.
10492         #  @param theFace Face to define normale of.
10493         #  @param theOptionalPoint Point to compute the normale at.
10494         #  @param theName Object name; when specified, this parameter is used
10495         #         for result publication in the study. Otherwise, if automatic
10496         #         publication is switched on, default value is used for result name.
10497         #
10498         #  @return New GEOM.GEOM_Object, containing the created vector.
10499         #
10500         #  @ref swig_todo "Example"
10501         @ManageTransactions("MeasuOp")
10502         def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10503             """
10504             Get a normale to the given face. If the point is not given,
10505             the normale is calculated at the center of mass.
10506
10507             Parameters:
10508                 theFace Face to define normale of.
10509                 theOptionalPoint Point to compute the normale at.
10510                 theName Object name; when specified, this parameter is used
10511                         for result publication in the study. Otherwise, if automatic
10512                         publication is switched on, default value is used for result name.
10513
10514             Returns:
10515                 New GEOM.GEOM_Object, containing the created vector.
10516             """
10517             # Example: see GEOM_TestMeasures.py
10518             anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10519             RaiseIfFailed("GetNormal", self.MeasuOp)
10520             self._autoPublish(anObj, theName, "normal")
10521             return anObj
10522
10523         ## Print shape errors obtained from CheckShape.
10524         #  @param theShape Shape that was checked.
10525         #  @param theShapeErrors the shape errors obtained by CheckShape.
10526         #  @param theReturnStatus If 0 the description of problem is printed.
10527         #                         If 1 the description of problem is returned.
10528         #  @return If theReturnStatus is equal to 1 the description is returned.
10529         #          Otherwise doesn't return anything.
10530         #
10531         #  @ref tui_measurement_tools_page "Example"
10532         @ManageTransactions("MeasuOp")
10533         def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10534             """
10535             Print shape errors obtained from CheckShape.
10536
10537             Parameters:
10538                 theShape Shape that was checked.
10539                 theShapeErrors the shape errors obtained by CheckShape.
10540                 theReturnStatus If 0 the description of problem is printed.
10541                                 If 1 the description of problem is returned.
10542
10543             Returns:
10544                 If theReturnStatus is equal to 1 the description is returned.
10545                   Otherwise doesn't return anything.
10546             """
10547             # Example: see GEOM_TestMeasures.py
10548             Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10549             if theReturnStatus == 1:
10550                 return Descr
10551             print Descr
10552             pass
10553
10554         ## Check a topology of the given shape.
10555         #  @param theShape Shape to check validity of.
10556         #  @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10557         #                        if TRUE, the shape's geometry will be checked also.
10558         #  @param theReturnStatus If 0 and if theShape is invalid, a description
10559         #                         of problem is printed.
10560         #                         If 1 isValid flag and the description of
10561         #                         problem is returned.
10562         #                         If 2 isValid flag and the list of error data
10563         #                         is returned.
10564         #  @return TRUE, if the shape "seems to be valid".
10565         #          If theShape is invalid, prints a description of problem.
10566         #          If theReturnStatus is equal to 1 the description is returned
10567         #          along with IsValid flag.
10568         #          If theReturnStatus is equal to 2 the list of error data is
10569         #          returned along with IsValid flag.
10570         #
10571         #  @ref tui_measurement_tools_page "Example"
10572         @ManageTransactions("MeasuOp")
10573         def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10574             """
10575             Check a topology of the given shape.
10576
10577             Parameters:
10578                 theShape Shape to check validity of.
10579                 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10580                                if TRUE, the shape's geometry will be checked also.
10581                 theReturnStatus If 0 and if theShape is invalid, a description
10582                                 of problem is printed.
10583                                 If 1 IsValid flag and the description of
10584                                 problem is returned.
10585                                 If 2 IsValid flag and the list of error data
10586                                 is returned.
10587
10588             Returns:
10589                 TRUE, if the shape "seems to be valid".
10590                 If theShape is invalid, prints a description of problem.
10591                 If theReturnStatus is equal to 1 the description is returned
10592                 along with IsValid flag.
10593                 If theReturnStatus is equal to 2 the list of error data is
10594                 returned along with IsValid flag.
10595             """
10596             # Example: see GEOM_TestMeasures.py
10597             if theIsCheckGeom:
10598                 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10599                 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10600             else:
10601                 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
10602                 RaiseIfFailed("CheckShape", self.MeasuOp)
10603             if IsValid == 0:
10604                 if theReturnStatus == 0:
10605                     Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10606                     print Descr
10607             if theReturnStatus == 1:
10608               Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10609               return (IsValid, Descr)
10610             elif theReturnStatus == 2:
10611               return (IsValid, ShapeErrors)
10612             return IsValid
10613
10614         ## Detect self-intersections in the given shape.
10615         #  @param theShape Shape to check.
10616         #  @return TRUE, if the shape contains no self-intersections.
10617         #
10618         #  @ref tui_measurement_tools_page "Example"
10619         @ManageTransactions("MeasuOp")
10620         def CheckSelfIntersections(self, theShape):
10621             """
10622             Detect self-intersections in the given shape.
10623
10624             Parameters:
10625                 theShape Shape to check.
10626
10627             Returns:
10628                 TRUE, if the shape contains no self-intersections.
10629             """
10630             # Example: see GEOM_TestMeasures.py
10631             (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
10632             RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10633             return IsValid
10634
10635         ## Get position (LCS) of theShape.
10636         #
10637         #  Origin of the LCS is situated at the shape's center of mass.
10638         #  Axes of the LCS are obtained from shape's location or,
10639         #  if the shape is a planar face, from position of its plane.
10640         #
10641         #  @param theShape Shape to calculate position of.
10642         #  @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10643         #          Ox,Oy,Oz: Coordinates of shape's LCS origin.
10644         #          Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10645         #          Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10646         #
10647         #  @ref swig_todo "Example"
10648         @ManageTransactions("MeasuOp")
10649         def GetPosition(self,theShape):
10650             """
10651             Get position (LCS) of theShape.
10652             Origin of the LCS is situated at the shape's center of mass.
10653             Axes of the LCS are obtained from shape's location or,
10654             if the shape is a planar face, from position of its plane.
10655
10656             Parameters:
10657                 theShape Shape to calculate position of.
10658
10659             Returns:
10660                 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10661                  Ox,Oy,Oz: Coordinates of shape's LCS origin.
10662                  Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10663                  Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10664             """
10665             # Example: see GEOM_TestMeasures.py
10666             aTuple = self.MeasuOp.GetPosition(theShape)
10667             RaiseIfFailed("GetPosition", self.MeasuOp)
10668             return aTuple
10669
10670         ## Get kind of theShape.
10671         #
10672         #  @param theShape Shape to get a kind of.
10673         #  @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10674         #          and a list of parameters, describing the shape.
10675         #  @note  Concrete meaning of each value, returned via \a theIntegers
10676         #         or \a theDoubles list depends on the kind() of the shape.
10677         #
10678         #  @ref swig_todo "Example"
10679         @ManageTransactions("MeasuOp")
10680         def KindOfShape(self,theShape):
10681             """
10682             Get kind of theShape.
10683
10684             Parameters:
10685                 theShape Shape to get a kind of.
10686
10687             Returns:
10688                 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10689                     and a list of parameters, describing the shape.
10690             Note:
10691                 Concrete meaning of each value, returned via theIntegers
10692                 or theDoubles list depends on the geompy.kind of the shape
10693             """
10694             # Example: see GEOM_TestMeasures.py
10695             aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10696             RaiseIfFailed("KindOfShape", self.MeasuOp)
10697
10698             aKind  = aRoughTuple[0]
10699             anInts = aRoughTuple[1]
10700             aDbls  = aRoughTuple[2]
10701
10702             # Now there is no exception from this rule:
10703             aKindTuple = [aKind] + aDbls + anInts
10704
10705             # If they are we will regroup parameters for such kind of shape.
10706             # For example:
10707             #if aKind == kind.SOME_KIND:
10708             #    #  SOME_KIND     int int double int double double
10709             #    aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10710
10711             return aKindTuple
10712
10713         ## Returns the string that describes if the shell is good for solid.
10714         #  This is a support method for MakeSolid.
10715         #
10716         #  @param theShell the shell to be checked.
10717         #  @return Returns a string that describes the shell validity for
10718         #          solid construction.
10719         @ManageTransactions("MeasuOp")
10720         def _IsGoodForSolid(self, theShell):
10721             """
10722             Returns the string that describes if the shell is good for solid.
10723             This is a support method for MakeSolid.
10724
10725             Parameter:
10726                 theShell the shell to be checked.
10727
10728             Returns:
10729                 Returns a string that describes the shell validity for
10730                 solid construction.
10731             """
10732             aDescr = self.MeasuOp.IsGoodForSolid(theShell)
10733             return aDescr
10734
10735         # end of l2_measure
10736         ## @}
10737
10738         ## @addtogroup l2_import_export
10739         ## @{
10740
10741         ## Import a shape from the BREP, IGES, STEP or other file
10742         #  (depends on given format) with given name.
10743         #
10744         #  Note: this function is deprecated, it is kept for backward compatibility only
10745         #  Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
10746         #
10747         #  @param theFileName The file, containing the shape.
10748         #  @param theFormatName Specify format for the file reading.
10749         #         Available formats can be obtained with InsertOp.ImportTranslators() method.
10750         #         If format 'IGES_SCALE' is used instead of 'IGES' or
10751         #            format 'STEP_SCALE' is used instead of 'STEP',
10752         #            length unit will be set to 'meter' and result model will be scaled.
10753         #  @param theName Object name; when specified, this parameter is used
10754         #         for result publication in the study. Otherwise, if automatic
10755         #         publication is switched on, default value is used for result name.
10756         #
10757         #  @return New GEOM.GEOM_Object, containing the imported shape.
10758         #          If material names are imported it returns the list of
10759         #          objects. The first one is the imported object followed by
10760         #          material groups.
10761         #  @note Auto publishing is allowed for the shape itself. Imported
10762         #        material groups are not automatically published.
10763         #
10764         #  @ref swig_Import_Export "Example"
10765         @ManageTransactions("InsertOp")
10766         def ImportFile(self, theFileName, theFormatName, theName=None):
10767             """
10768             Import a shape from the BREP, IGES, STEP or other file
10769             (depends on given format) with given name.
10770
10771             Note: this function is deprecated, it is kept for backward compatibility only
10772             Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
10773
10774             Parameters: 
10775                 theFileName The file, containing the shape.
10776                 theFormatName Specify format for the file reading.
10777                     Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10778                     If format 'IGES_SCALE' is used instead of 'IGES' or
10779                        format 'STEP_SCALE' is used instead of 'STEP',
10780                        length unit will be set to 'meter' and result model will be scaled.
10781                 theName Object name; when specified, this parameter is used
10782                         for result publication in the study. Otherwise, if automatic
10783                         publication is switched on, default value is used for result name.
10784
10785             Returns:
10786                 New GEOM.GEOM_Object, containing the imported shape.
10787                 If material names are imported it returns the list of
10788                 objects. The first one is the imported object followed by
10789                 material groups.
10790             Note:
10791                 Auto publishing is allowed for the shape itself. Imported
10792                 material groups are not automatically published.
10793             """
10794             # Example: see GEOM_TestOthers.py
10795             print """
10796             WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
10797             where <FormatName> is a name of desirable format for importing.
10798             """
10799             aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10800             RaiseIfFailed("ImportFile", self.InsertOp)
10801             aNbObj = len(aListObj)
10802             if aNbObj > 0:
10803                 self._autoPublish(aListObj[0], theName, "imported")
10804             if aNbObj == 1:
10805                 return aListObj[0]
10806             return aListObj
10807
10808         ## Deprecated analog of ImportFile()
10809         def Import(self, theFileName, theFormatName, theName=None):
10810             """
10811             Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10812             """
10813             # note: auto-publishing is done in self.ImportFile()
10814             return self.ImportFile(theFileName, theFormatName, theName)
10815
10816         ## Read a shape from the binary stream, containing its bounding representation (BRep).
10817         #  @note This method will not be dumped to the python script by DumpStudy functionality.
10818         #  @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10819         #  @param theStream The BRep binary stream.
10820         #  @param theName Object name; when specified, this parameter is used
10821         #         for result publication in the study. Otherwise, if automatic
10822         #         publication is switched on, default value is used for result name.
10823         #
10824         #  @return New GEOM_Object, containing the shape, read from theStream.
10825         #
10826         #  @ref swig_Import_Export "Example"
10827         @ManageTransactions("InsertOp")
10828         def RestoreShape (self, theStream, theName=None):
10829             """
10830             Read a shape from the binary stream, containing its bounding representation (BRep).
10831
10832             Note:
10833                 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10834
10835             Parameters:
10836                 theStream The BRep binary stream.
10837                 theName Object name; when specified, this parameter is used
10838                         for result publication in the study. Otherwise, if automatic
10839                         publication is switched on, default value is used for result name.
10840
10841             Returns:
10842                 New GEOM_Object, containing the shape, read from theStream.
10843             """
10844             # Example: see GEOM_TestOthers.py
10845             anObj = self.InsertOp.RestoreShape(theStream)
10846             RaiseIfFailed("RestoreShape", self.InsertOp)
10847             self._autoPublish(anObj, theName, "restored")
10848             return anObj
10849
10850         ## Export the given shape into a file with given name.
10851         #
10852         #  Note: this function is deprecated, it is kept for backward compatibility only
10853         #  Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
10854         #
10855         #  @param theObject Shape to be stored in the file.
10856         #  @param theFileName Name of the file to store the given shape in.
10857         #  @param theFormatName Specify format for the shape storage.
10858         #         Available formats can be obtained with
10859         #         geompy.InsertOp.ExportTranslators()[0] method.
10860         #
10861         #  @ref swig_Import_Export "Example"
10862         @ManageTransactions("InsertOp")
10863         def Export(self, theObject, theFileName, theFormatName):
10864             """
10865             Export the given shape into a file with given name.
10866
10867             Note: this function is deprecated, it is kept for backward compatibility only
10868             Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
10869             
10870             Parameters: 
10871                 theObject Shape to be stored in the file.
10872                 theFileName Name of the file to store the given shape in.
10873                 theFormatName Specify format for the shape storage.
10874                               Available formats can be obtained with
10875                               geompy.InsertOp.ExportTranslators()[0] method.
10876             """
10877             # Example: see GEOM_TestOthers.py
10878             print """
10879             WARNING: Function Export is deprecated, use Export<FormatName> instead,
10880             where <FormatName> is a name of desirable format for exporting.
10881             """
10882             self.InsertOp.Export(theObject, theFileName, theFormatName)
10883             if self.InsertOp.IsDone() == 0:
10884                 raise RuntimeError,  "Export : " + self.InsertOp.GetErrorCode()
10885                 pass
10886             pass
10887
10888         # end of l2_import_export
10889         ## @}
10890
10891         ## @addtogroup l3_blocks
10892         ## @{
10893
10894         ## Create a quadrangle face from four edges. Order of Edges is not
10895         #  important. It is  not necessary that edges share the same vertex.
10896         #  @param E1,E2,E3,E4 Edges for the face bound.
10897         #  @param theName Object name; when specified, this parameter is used
10898         #         for result publication in the study. Otherwise, if automatic
10899         #         publication is switched on, default value is used for result name.
10900         #
10901         #  @return New GEOM.GEOM_Object, containing the created face.
10902         #
10903         #  @ref tui_building_by_blocks_page "Example"
10904         @ManageTransactions("BlocksOp")
10905         def MakeQuad(self, E1, E2, E3, E4, theName=None):
10906             """
10907             Create a quadrangle face from four edges. Order of Edges is not
10908             important. It is  not necessary that edges share the same vertex.
10909
10910             Parameters:
10911                 E1,E2,E3,E4 Edges for the face bound.
10912                 theName Object name; when specified, this parameter is used
10913                         for result publication in the study. Otherwise, if automatic
10914                         publication is switched on, default value is used for result name.
10915
10916             Returns:
10917                 New GEOM.GEOM_Object, containing the created face.
10918
10919             Example of usage:
10920                 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10921             """
10922             # Example: see GEOM_Spanner.py
10923             anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10924             RaiseIfFailed("MakeQuad", self.BlocksOp)
10925             self._autoPublish(anObj, theName, "quad")
10926             return anObj
10927
10928         ## Create a quadrangle face on two edges.
10929         #  The missing edges will be built by creating the shortest ones.
10930         #  @param E1,E2 Two opposite edges for the face.
10931         #  @param theName Object name; when specified, this parameter is used
10932         #         for result publication in the study. Otherwise, if automatic
10933         #         publication is switched on, default value is used for result name.
10934         #
10935         #  @return New GEOM.GEOM_Object, containing the created face.
10936         #
10937         #  @ref tui_building_by_blocks_page "Example"
10938         @ManageTransactions("BlocksOp")
10939         def MakeQuad2Edges(self, E1, E2, theName=None):
10940             """
10941             Create a quadrangle face on two edges.
10942             The missing edges will be built by creating the shortest ones.
10943
10944             Parameters:
10945                 E1,E2 Two opposite edges for the face.
10946                 theName Object name; when specified, this parameter is used
10947                         for result publication in the study. Otherwise, if automatic
10948                         publication is switched on, default value is used for result name.
10949
10950             Returns:
10951                 New GEOM.GEOM_Object, containing the created face.
10952
10953             Example of usage:
10954                 # create vertices
10955                 p1 = geompy.MakeVertex(  0.,   0.,   0.)
10956                 p2 = geompy.MakeVertex(150.,  30.,   0.)
10957                 p3 = geompy.MakeVertex(  0., 120.,  50.)
10958                 p4 = geompy.MakeVertex(  0.,  40.,  70.)
10959                 # create edges
10960                 edge1 = geompy.MakeEdge(p1, p2)
10961                 edge2 = geompy.MakeEdge(p3, p4)
10962                 # create a quadrangle face from two edges
10963                 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10964             """
10965             # Example: see GEOM_Spanner.py
10966             anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10967             RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10968             self._autoPublish(anObj, theName, "quad")
10969             return anObj
10970
10971         ## Create a quadrangle face with specified corners.
10972         #  The missing edges will be built by creating the shortest ones.
10973         #  @param V1,V2,V3,V4 Corner vertices for the face.
10974         #  @param theName Object name; when specified, this parameter is used
10975         #         for result publication in the study. Otherwise, if automatic
10976         #         publication is switched on, default value is used for result name.
10977         #
10978         #  @return New GEOM.GEOM_Object, containing the created face.
10979         #
10980         #  @ref tui_building_by_blocks_page "Example 1"
10981         #  \n @ref swig_MakeQuad4Vertices "Example 2"
10982         @ManageTransactions("BlocksOp")
10983         def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10984             """
10985             Create a quadrangle face with specified corners.
10986             The missing edges will be built by creating the shortest ones.
10987
10988             Parameters:
10989                 V1,V2,V3,V4 Corner vertices for the face.
10990                 theName Object name; when specified, this parameter is used
10991                         for result publication in the study. Otherwise, if automatic
10992                         publication is switched on, default value is used for result name.
10993
10994             Returns:
10995                 New GEOM.GEOM_Object, containing the created face.
10996
10997             Example of usage:
10998                 # create vertices
10999                 p1 = geompy.MakeVertex(  0.,   0.,   0.)
11000                 p2 = geompy.MakeVertex(150.,  30.,   0.)
11001                 p3 = geompy.MakeVertex(  0., 120.,  50.)
11002                 p4 = geompy.MakeVertex(  0.,  40.,  70.)
11003                 # create a quadrangle from four points in its corners
11004                 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
11005             """
11006             # Example: see GEOM_Spanner.py
11007             anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
11008             RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
11009             self._autoPublish(anObj, theName, "quad")
11010             return anObj
11011
11012         ## Create a hexahedral solid, bounded by the six given faces. Order of
11013         #  faces is not important. It is  not necessary that Faces share the same edge.
11014         #  @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11015         #  @param theName Object name; when specified, this parameter is used
11016         #         for result publication in the study. Otherwise, if automatic
11017         #         publication is switched on, default value is used for result name.
11018         #
11019         #  @return New GEOM.GEOM_Object, containing the created solid.
11020         #
11021         #  @ref tui_building_by_blocks_page "Example 1"
11022         #  \n @ref swig_MakeHexa "Example 2"
11023         @ManageTransactions("BlocksOp")
11024         def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
11025             """
11026             Create a hexahedral solid, bounded by the six given faces. Order of
11027             faces is not important. It is  not necessary that Faces share the same edge.
11028
11029             Parameters:
11030                 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11031                 theName Object name; when specified, this parameter is used
11032                         for result publication in the study. Otherwise, if automatic
11033                         publication is switched on, default value is used for result name.
11034
11035             Returns:
11036                 New GEOM.GEOM_Object, containing the created solid.
11037
11038             Example of usage:
11039                 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
11040             """
11041             # Example: see GEOM_Spanner.py
11042             anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
11043             RaiseIfFailed("MakeHexa", self.BlocksOp)
11044             self._autoPublish(anObj, theName, "hexa")
11045             return anObj
11046
11047         ## Create a hexahedral solid between two given faces.
11048         #  The missing faces will be built by creating the smallest ones.
11049         #  @param F1,F2 Two opposite faces for the hexahedral solid.
11050         #  @param theName Object name; when specified, this parameter is used
11051         #         for result publication in the study. Otherwise, if automatic
11052         #         publication is switched on, default value is used for result name.
11053         #
11054         #  @return New GEOM.GEOM_Object, containing the created solid.
11055         #
11056         #  @ref tui_building_by_blocks_page "Example 1"
11057         #  \n @ref swig_MakeHexa2Faces "Example 2"
11058         @ManageTransactions("BlocksOp")
11059         def MakeHexa2Faces(self, F1, F2, theName=None):
11060             """
11061             Create a hexahedral solid between two given faces.
11062             The missing faces will be built by creating the smallest ones.
11063
11064             Parameters:
11065                 F1,F2 Two opposite faces for the hexahedral solid.
11066                 theName Object name; when specified, this parameter is used
11067                         for result publication in the study. Otherwise, if automatic
11068                         publication is switched on, default value is used for result name.
11069
11070             Returns:
11071                 New GEOM.GEOM_Object, containing the created solid.
11072
11073             Example of usage:
11074                 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11075             """
11076             # Example: see GEOM_Spanner.py
11077             anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11078             RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11079             self._autoPublish(anObj, theName, "hexa")
11080             return anObj
11081
11082         # end of l3_blocks
11083         ## @}
11084
11085         ## @addtogroup l3_blocks_op
11086         ## @{
11087
11088         ## Get a vertex, found in the given shape by its coordinates.
11089         #  @param theShape Block or a compound of blocks.
11090         #  @param theX,theY,theZ Coordinates of the sought vertex.
11091         #  @param theEpsilon Maximum allowed distance between the resulting
11092         #                    vertex and point with the given coordinates.
11093         #  @param theName Object name; when specified, this parameter is used
11094         #         for result publication in the study. Otherwise, if automatic
11095         #         publication is switched on, default value is used for result name.
11096         #
11097         #  @return New GEOM.GEOM_Object, containing the found vertex.
11098         #
11099         #  @ref swig_GetPoint "Example"
11100         @ManageTransactions("BlocksOp")
11101         def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11102             """
11103             Get a vertex, found in the given shape by its coordinates.
11104
11105             Parameters:
11106                 theShape Block or a compound of blocks.
11107                 theX,theY,theZ Coordinates of the sought vertex.
11108                 theEpsilon Maximum allowed distance between the resulting
11109                            vertex and point with the given coordinates.
11110                 theName Object name; when specified, this parameter is used
11111                         for result publication in the study. Otherwise, if automatic
11112                         publication is switched on, default value is used for result name.
11113
11114             Returns:
11115                 New GEOM.GEOM_Object, containing the found vertex.
11116
11117             Example of usage:
11118                 pnt = geompy.GetPoint(shape, -50,  50,  50, 0.01)
11119             """
11120             # Example: see GEOM_TestOthers.py
11121             anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11122             RaiseIfFailed("GetPoint", self.BlocksOp)
11123             self._autoPublish(anObj, theName, "vertex")
11124             return anObj
11125
11126         ## Find a vertex of the given shape, which has minimal distance to the given point.
11127         #  @param theShape Any shape.
11128         #  @param thePoint Point, close to the desired vertex.
11129         #  @param theName Object name; when specified, this parameter is used
11130         #         for result publication in the study. Otherwise, if automatic
11131         #         publication is switched on, default value is used for result name.
11132         #
11133         #  @return New GEOM.GEOM_Object, containing the found vertex.
11134         #
11135         #  @ref swig_GetVertexNearPoint "Example"
11136         @ManageTransactions("BlocksOp")
11137         def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11138             """
11139             Find a vertex of the given shape, which has minimal distance to the given point.
11140
11141             Parameters:
11142                 theShape Any shape.
11143                 thePoint Point, close to the desired vertex.
11144                 theName Object name; when specified, this parameter is used
11145                         for result publication in the study. Otherwise, if automatic
11146                         publication is switched on, default value is used for result name.
11147
11148             Returns:
11149                 New GEOM.GEOM_Object, containing the found vertex.
11150
11151             Example of usage:
11152                 pmidle = geompy.MakeVertex(50, 0, 50)
11153                 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11154             """
11155             # Example: see GEOM_TestOthers.py
11156             anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11157             RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11158             self._autoPublish(anObj, theName, "vertex")
11159             return anObj
11160
11161         ## Get an edge, found in the given shape by two given vertices.
11162         #  @param theShape Block or a compound of blocks.
11163         #  @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11164         #  @param theName Object name; when specified, this parameter is used
11165         #         for result publication in the study. Otherwise, if automatic
11166         #         publication is switched on, default value is used for result name.
11167         #
11168         #  @return New GEOM.GEOM_Object, containing the found edge.
11169         #
11170         #  @ref swig_GetEdge "Example"
11171         @ManageTransactions("BlocksOp")
11172         def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11173             """
11174             Get an edge, found in the given shape by two given vertices.
11175
11176             Parameters:
11177                 theShape Block or a compound of blocks.
11178                 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11179                 theName Object name; when specified, this parameter is used
11180                         for result publication in the study. Otherwise, if automatic
11181                         publication is switched on, default value is used for result name.
11182
11183             Returns:
11184                 New GEOM.GEOM_Object, containing the found edge.
11185             """
11186             # Example: see GEOM_Spanner.py
11187             anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11188             RaiseIfFailed("GetEdge", self.BlocksOp)
11189             self._autoPublish(anObj, theName, "edge")
11190             return anObj
11191
11192         ## Find an edge of the given shape, which has minimal distance to the given point.
11193         #  @param theShape Block or a compound of blocks.
11194         #  @param thePoint Point, close to the desired edge.
11195         #  @param theName Object name; when specified, this parameter is used
11196         #         for result publication in the study. Otherwise, if automatic
11197         #         publication is switched on, default value is used for result name.
11198         #
11199         #  @return New GEOM.GEOM_Object, containing the found edge.
11200         #
11201         #  @ref swig_GetEdgeNearPoint "Example"
11202         @ManageTransactions("BlocksOp")
11203         def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11204             """
11205             Find an edge of the given shape, which has minimal distance to the given point.
11206
11207             Parameters:
11208                 theShape Block or a compound of blocks.
11209                 thePoint Point, close to the desired edge.
11210                 theName Object name; when specified, this parameter is used
11211                         for result publication in the study. Otherwise, if automatic
11212                         publication is switched on, default value is used for result name.
11213
11214             Returns:
11215                 New GEOM.GEOM_Object, containing the found edge.
11216             """
11217             # Example: see GEOM_TestOthers.py
11218             anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11219             RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11220             self._autoPublish(anObj, theName, "edge")
11221             return anObj
11222
11223         ## Returns a face, found in the given shape by four given corner vertices.
11224         #  @param theShape Block or a compound of blocks.
11225         #  @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11226         #  @param theName Object name; when specified, this parameter is used
11227         #         for result publication in the study. Otherwise, if automatic
11228         #         publication is switched on, default value is used for result name.
11229         #
11230         #  @return New GEOM.GEOM_Object, containing the found face.
11231         #
11232         #  @ref swig_todo "Example"
11233         @ManageTransactions("BlocksOp")
11234         def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11235             """
11236             Returns a face, found in the given shape by four given corner vertices.
11237
11238             Parameters:
11239                 theShape Block or a compound of blocks.
11240                 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11241                 theName Object name; when specified, this parameter is used
11242                         for result publication in the study. Otherwise, if automatic
11243                         publication is switched on, default value is used for result name.
11244
11245             Returns:
11246                 New GEOM.GEOM_Object, containing the found face.
11247             """
11248             # Example: see GEOM_Spanner.py
11249             anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11250             RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11251             self._autoPublish(anObj, theName, "face")
11252             return anObj
11253
11254         ## Get a face of block, found in the given shape by two given edges.
11255         #  @param theShape Block or a compound of blocks.
11256         #  @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
11257         #  @param theName Object name; when specified, this parameter is used
11258         #         for result publication in the study. Otherwise, if automatic
11259         #         publication is switched on, default value is used for result name.
11260         #
11261         #  @return New GEOM.GEOM_Object, containing the found face.
11262         #
11263         #  @ref swig_todo "Example"
11264         @ManageTransactions("BlocksOp")
11265         def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11266             """
11267             Get a face of block, found in the given shape by two given edges.
11268
11269             Parameters:
11270                 theShape Block or a compound of blocks.
11271                 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11272                 theName Object name; when specified, this parameter is used
11273                         for result publication in the study. Otherwise, if automatic
11274                         publication is switched on, default value is used for result name.
11275
11276             Returns:
11277                 New GEOM.GEOM_Object, containing the found face.
11278             """
11279             # Example: see GEOM_Spanner.py
11280             anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11281             RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11282             self._autoPublish(anObj, theName, "face")
11283             return anObj
11284
11285         ## Find a face, opposite to the given one in the given block.
11286         #  @param theBlock Must be a hexahedral solid.
11287         #  @param theFace Face of \a theBlock, opposite to the desired face.
11288         #  @param theName Object name; when specified, this parameter is used
11289         #         for result publication in the study. Otherwise, if automatic
11290         #         publication is switched on, default value is used for result name.
11291         #
11292         #  @return New GEOM.GEOM_Object, containing the found face.
11293         #
11294         #  @ref swig_GetOppositeFace "Example"
11295         @ManageTransactions("BlocksOp")
11296         def GetOppositeFace(self, theBlock, theFace, theName=None):
11297             """
11298             Find a face, opposite to the given one in the given block.
11299
11300             Parameters:
11301                 theBlock Must be a hexahedral solid.
11302                 theFace Face of theBlock, opposite to the desired face.
11303                 theName Object name; when specified, this parameter is used
11304                         for result publication in the study. Otherwise, if automatic
11305                         publication is switched on, default value is used for result name.
11306
11307             Returns:
11308                 New GEOM.GEOM_Object, containing the found face.
11309             """
11310             # Example: see GEOM_Spanner.py
11311             anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11312             RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11313             self._autoPublish(anObj, theName, "face")
11314             return anObj
11315
11316         ## Find a face of the given shape, which has minimal distance to the given point.
11317         #  @param theShape Block or a compound of blocks.
11318         #  @param thePoint Point, close to the desired face.
11319         #  @param theName Object name; when specified, this parameter is used
11320         #         for result publication in the study. Otherwise, if automatic
11321         #         publication is switched on, default value is used for result name.
11322         #
11323         #  @return New GEOM.GEOM_Object, containing the found face.
11324         #
11325         #  @ref swig_GetFaceNearPoint "Example"
11326         @ManageTransactions("BlocksOp")
11327         def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11328             """
11329             Find a face of the given shape, which has minimal distance to the given point.
11330
11331             Parameters:
11332                 theShape Block or a compound of blocks.
11333                 thePoint Point, close to the desired face.
11334                 theName Object name; when specified, this parameter is used
11335                         for result publication in the study. Otherwise, if automatic
11336                         publication is switched on, default value is used for result name.
11337
11338             Returns:
11339                 New GEOM.GEOM_Object, containing the found face.
11340             """
11341             # Example: see GEOM_Spanner.py
11342             anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11343             RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11344             self._autoPublish(anObj, theName, "face")
11345             return anObj
11346
11347         ## Find a face of block, whose outside normale has minimal angle with the given vector.
11348         #  @param theBlock Block or a compound of blocks.
11349         #  @param theVector Vector, close to the normale of the desired face.
11350         #  @param theName Object name; when specified, this parameter is used
11351         #         for result publication in the study. Otherwise, if automatic
11352         #         publication is switched on, default value is used for result name.
11353         #
11354         #  @return New GEOM.GEOM_Object, containing the found face.
11355         #
11356         #  @ref swig_todo "Example"
11357         @ManageTransactions("BlocksOp")
11358         def GetFaceByNormale(self, theBlock, theVector, theName=None):
11359             """
11360             Find a face of block, whose outside normale has minimal angle with the given vector.
11361
11362             Parameters:
11363                 theBlock Block or a compound of blocks.
11364                 theVector Vector, close to the normale of the desired face.
11365                 theName Object name; when specified, this parameter is used
11366                         for result publication in the study. Otherwise, if automatic
11367                         publication is switched on, default value is used for result name.
11368
11369             Returns:
11370                 New GEOM.GEOM_Object, containing the found face.
11371             """
11372             # Example: see GEOM_Spanner.py
11373             anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11374             RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11375             self._autoPublish(anObj, theName, "face")
11376             return anObj
11377
11378         ## Find all sub-shapes of type \a theShapeType of the given shape,
11379         #  which have minimal distance to the given point.
11380         #  @param theShape Any shape.
11381         #  @param thePoint Point, close to the desired shape.
11382         #  @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11383         #  @param theTolerance The tolerance for distances comparison. All shapes
11384         #                      with distances to the given point in interval
11385         #                      [minimal_distance, minimal_distance + theTolerance] will be gathered.
11386         #  @param theName Object name; when specified, this parameter is used
11387         #         for result publication in the study. Otherwise, if automatic
11388         #         publication is switched on, default value is used for result name.
11389         #
11390         #  @return New GEOM_Object, containing a group of all found shapes.
11391         #
11392         #  @ref swig_GetShapesNearPoint "Example"
11393         @ManageTransactions("BlocksOp")
11394         def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11395             """
11396             Find all sub-shapes of type theShapeType of the given shape,
11397             which have minimal distance to the given point.
11398
11399             Parameters:
11400                 theShape Any shape.
11401                 thePoint Point, close to the desired shape.
11402                 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11403                 theTolerance The tolerance for distances comparison. All shapes
11404                                 with distances to the given point in interval
11405                                 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11406                 theName Object name; when specified, this parameter is used
11407                         for result publication in the study. Otherwise, if automatic
11408                         publication is switched on, default value is used for result name.
11409
11410             Returns:
11411                 New GEOM_Object, containing a group of all found shapes.
11412             """
11413             # Example: see GEOM_TestOthers.py
11414             anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11415             RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11416             self._autoPublish(anObj, theName, "group")
11417             return anObj
11418
11419         # end of l3_blocks_op
11420         ## @}
11421
11422         ## @addtogroup l4_blocks_measure
11423         ## @{
11424
11425         ## Check, if the compound of blocks is given.
11426         #  To be considered as a compound of blocks, the
11427         #  given shape must satisfy the following conditions:
11428         #  - Each element of the compound should be a Block (6 faces and 12 edges).
11429         #  - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11430         #  - The compound should be connexe.
11431         #  - The glue between two quadrangle faces should be applied.
11432         #  @param theCompound The compound to check.
11433         #  @return TRUE, if the given shape is a compound of blocks.
11434         #  If theCompound is not valid, prints all discovered errors.
11435         #
11436         #  @ref tui_measurement_tools_page "Example 1"
11437         #  \n @ref swig_CheckCompoundOfBlocks "Example 2"
11438         @ManageTransactions("BlocksOp")
11439         def CheckCompoundOfBlocks(self,theCompound):
11440             """
11441             Check, if the compound of blocks is given.
11442             To be considered as a compound of blocks, the
11443             given shape must satisfy the following conditions:
11444             - Each element of the compound should be a Block (6 faces and 12 edges).
11445             - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11446             - The compound should be connexe.
11447             - The glue between two quadrangle faces should be applied.
11448
11449             Parameters:
11450                 theCompound The compound to check.
11451
11452             Returns:
11453                 TRUE, if the given shape is a compound of blocks.
11454                 If theCompound is not valid, prints all discovered errors.
11455             """
11456             # Example: see GEOM_Spanner.py
11457             (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11458             RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11459             if IsValid == 0:
11460                 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11461                 print Descr
11462             return IsValid
11463
11464         ## Retrieve all non blocks solids and faces from \a theShape.
11465         #  @param theShape The shape to explore.
11466         #  @param theName Object name; when specified, this parameter is used
11467         #         for result publication in the study. Otherwise, if automatic
11468         #         publication is switched on, default value is used for result name.
11469         #
11470         #  @return A tuple of two GEOM_Objects. The first object is a group of all
11471         #          non block solids (= not 6 faces, or with 6 faces, but with the
11472         #          presence of non-quadrangular faces). The second object is a
11473         #          group of all non quadrangular faces.
11474         #
11475         #  @ref tui_measurement_tools_page "Example 1"
11476         #  \n @ref swig_GetNonBlocks "Example 2"
11477         @ManageTransactions("BlocksOp")
11478         def GetNonBlocks (self, theShape, theName=None):
11479             """
11480             Retrieve all non blocks solids and faces from theShape.
11481
11482             Parameters:
11483                 theShape The shape to explore.
11484                 theName Object name; when specified, this parameter is used
11485                         for result publication in the study. Otherwise, if automatic
11486                         publication is switched on, default value is used for result name.
11487
11488             Returns:
11489                 A tuple of two GEOM_Objects. The first object is a group of all
11490                 non block solids (= not 6 faces, or with 6 faces, but with the
11491                 presence of non-quadrangular faces). The second object is a
11492                 group of all non quadrangular faces.
11493
11494             Usage:
11495                 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11496             """
11497             # Example: see GEOM_Spanner.py
11498             aTuple = self.BlocksOp.GetNonBlocks(theShape)
11499             RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11500             self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11501             return aTuple
11502
11503         ## Remove all seam and degenerated edges from \a theShape.
11504         #  Unite faces and edges, sharing one surface. It means that
11505         #  this faces must have references to one C++ surface object (handle).
11506         #  @param theShape The compound or single solid to remove irregular edges from.
11507         #  @param doUnionFaces If True, then unite faces. If False (the default value),
11508         #         do not unite faces.
11509         #  @param theName Object name; when specified, this parameter is used
11510         #         for result publication in the study. Otherwise, if automatic
11511         #         publication is switched on, default value is used for result name.
11512         #
11513         #  @return Improved shape.
11514         #
11515         #  @ref swig_RemoveExtraEdges "Example"
11516         @ManageTransactions("BlocksOp")
11517         def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11518             """
11519             Remove all seam and degenerated edges from theShape.
11520             Unite faces and edges, sharing one surface. It means that
11521             this faces must have references to one C++ surface object (handle).
11522
11523             Parameters:
11524                 theShape The compound or single solid to remove irregular edges from.
11525                 doUnionFaces If True, then unite faces. If False (the default value),
11526                              do not unite faces.
11527                 theName Object name; when specified, this parameter is used
11528                         for result publication in the study. Otherwise, if automatic
11529                         publication is switched on, default value is used for result name.
11530
11531             Returns:
11532                 Improved shape.
11533             """
11534             # Example: see GEOM_TestOthers.py
11535             nbFacesOptimum = -1 # -1 means do not unite faces
11536             if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11537             anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11538             RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11539             self._autoPublish(anObj, theName, "removeExtraEdges")
11540             return anObj
11541
11542         ## Performs union faces of \a theShape
11543         #  Unite faces sharing one surface. It means that
11544         #  these faces must have references to one C++ surface object (handle).
11545         #  @param theShape The compound or single solid that contains faces
11546         #         to perform union.
11547         #  @param theName Object name; when specified, this parameter is used
11548         #         for result publication in the study. Otherwise, if automatic
11549         #         publication is switched on, default value is used for result name.
11550         #
11551         #  @return Improved shape.
11552         #
11553         #  @ref swig_UnionFaces "Example"
11554         @ManageTransactions("BlocksOp")
11555         def UnionFaces(self, theShape, theName=None):
11556             """
11557             Performs union faces of theShape.
11558             Unite faces sharing one surface. It means that
11559             these faces must have references to one C++ surface object (handle).
11560
11561             Parameters:
11562                 theShape The compound or single solid that contains faces
11563                          to perform union.
11564                 theName Object name; when specified, this parameter is used
11565                         for result publication in the study. Otherwise, if automatic
11566                         publication is switched on, default value is used for result name.
11567
11568             Returns:
11569                 Improved shape.
11570             """
11571             # Example: see GEOM_TestOthers.py
11572             anObj = self.BlocksOp.UnionFaces(theShape)
11573             RaiseIfFailed("UnionFaces", self.BlocksOp)
11574             self._autoPublish(anObj, theName, "unionFaces")
11575             return anObj
11576
11577         ## Check, if the given shape is a blocks compound.
11578         #  Fix all detected errors.
11579         #    \note Single block can be also fixed by this method.
11580         #  @param theShape The compound to check and improve.
11581         #  @param theName Object name; when specified, this parameter is used
11582         #         for result publication in the study. Otherwise, if automatic
11583         #         publication is switched on, default value is used for result name.
11584         #
11585         #  @return Improved compound.
11586         #
11587         #  @ref swig_CheckAndImprove "Example"
11588         @ManageTransactions("BlocksOp")
11589         def CheckAndImprove(self, theShape, theName=None):
11590             """
11591             Check, if the given shape is a blocks compound.
11592             Fix all detected errors.
11593
11594             Note:
11595                 Single block can be also fixed by this method.
11596
11597             Parameters:
11598                 theShape The compound to check and improve.
11599                 theName Object name; when specified, this parameter is used
11600                         for result publication in the study. Otherwise, if automatic
11601                         publication is switched on, default value is used for result name.
11602
11603             Returns:
11604                 Improved compound.
11605             """
11606             # Example: see GEOM_TestOthers.py
11607             anObj = self.BlocksOp.CheckAndImprove(theShape)
11608             RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11609             self._autoPublish(anObj, theName, "improved")
11610             return anObj
11611
11612         # end of l4_blocks_measure
11613         ## @}
11614
11615         ## @addtogroup l3_blocks_op
11616         ## @{
11617
11618         ## Get all the blocks, contained in the given compound.
11619         #  @param theCompound The compound to explode.
11620         #  @param theMinNbFaces If solid has lower number of faces, it is not a block.
11621         #  @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11622         #  @param theName Object name; when specified, this parameter is used
11623         #         for result publication in the study. Otherwise, if automatic
11624         #         publication is switched on, default value is used for result name.
11625         #
11626         #  @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11627         #
11628         #  @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11629         #
11630         #  @ref tui_explode_on_blocks "Example 1"
11631         #  \n @ref swig_MakeBlockExplode "Example 2"
11632         @ManageTransactions("BlocksOp")
11633         def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11634             """
11635             Get all the blocks, contained in the given compound.
11636
11637             Parameters:
11638                 theCompound The compound to explode.
11639                 theMinNbFaces If solid has lower number of faces, it is not a block.
11640                 theMaxNbFaces If solid has higher number of faces, it is not a block.
11641                 theName Object name; when specified, this parameter is used
11642                         for result publication in the study. Otherwise, if automatic
11643                         publication is switched on, default value is used for result name.
11644
11645             Note:
11646                 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11647
11648             Returns:
11649                 List of GEOM.GEOM_Object, containing the retrieved blocks.
11650             """
11651             # Example: see GEOM_TestOthers.py
11652             theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11653             aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11654             RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11655             for anObj in aList:
11656                 anObj.SetParameters(Parameters)
11657                 pass
11658             self._autoPublish(aList, theName, "block")
11659             return aList
11660
11661         ## Find block, containing the given point inside its volume or on boundary.
11662         #  @param theCompound Compound, to find block in.
11663         #  @param thePoint Point, close to the desired block. If the point lays on
11664         #         boundary between some blocks, we return block with nearest center.
11665         #  @param theName Object name; when specified, this parameter is used
11666         #         for result publication in the study. Otherwise, if automatic
11667         #         publication is switched on, default value is used for result name.
11668         #
11669         #  @return New GEOM.GEOM_Object, containing the found block.
11670         #
11671         #  @ref swig_todo "Example"
11672         @ManageTransactions("BlocksOp")
11673         def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11674             """
11675             Find block, containing the given point inside its volume or on boundary.
11676
11677             Parameters:
11678                 theCompound Compound, to find block in.
11679                 thePoint Point, close to the desired block. If the point lays on
11680                          boundary between some blocks, we return block with nearest center.
11681                 theName Object name; when specified, this parameter is used
11682                         for result publication in the study. Otherwise, if automatic
11683                         publication is switched on, default value is used for result name.
11684
11685             Returns:
11686                 New GEOM.GEOM_Object, containing the found block.
11687             """
11688             # Example: see GEOM_Spanner.py
11689             anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11690             RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11691             self._autoPublish(anObj, theName, "block")
11692             return anObj
11693
11694         ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11695         #  @param theCompound Compound, to find block in.
11696         #  @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11697         #  @param theName Object name; when specified, this parameter is used
11698         #         for result publication in the study. Otherwise, if automatic
11699         #         publication is switched on, default value is used for result name.
11700         #
11701         #  @return New GEOM.GEOM_Object, containing the found block.
11702         #
11703         #  @ref swig_GetBlockByParts "Example"
11704         @ManageTransactions("BlocksOp")
11705         def GetBlockByParts(self, theCompound, theParts, theName=None):
11706             """
11707              Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11708
11709              Parameters:
11710                 theCompound Compound, to find block in.
11711                 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11712                 theName Object name; when specified, this parameter is used
11713                         for result publication in the study. Otherwise, if automatic
11714                         publication is switched on, default value is used for result name.
11715
11716             Returns:
11717                 New GEOM_Object, containing the found block.
11718             """
11719             # Example: see GEOM_TestOthers.py
11720             anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11721             RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11722             self._autoPublish(anObj, theName, "block")
11723             return anObj
11724
11725         ## Return all blocks, containing all the elements, passed as the parts.
11726         #  @param theCompound Compound, to find blocks in.
11727         #  @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11728         #  @param theName Object name; when specified, this parameter is used
11729         #         for result publication in the study. Otherwise, if automatic
11730         #         publication is switched on, default value is used for result name.
11731         #
11732         #  @return List of GEOM.GEOM_Object, containing the found blocks.
11733         #
11734         #  @ref swig_todo "Example"
11735         @ManageTransactions("BlocksOp")
11736         def GetBlocksByParts(self, theCompound, theParts, theName=None):
11737             """
11738             Return all blocks, containing all the elements, passed as the parts.
11739
11740             Parameters:
11741                 theCompound Compound, to find blocks in.
11742                 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11743                 theName Object name; when specified, this parameter is used
11744                         for result publication in the study. Otherwise, if automatic
11745                         publication is switched on, default value is used for result name.
11746
11747             Returns:
11748                 List of GEOM.GEOM_Object, containing the found blocks.
11749             """
11750             # Example: see GEOM_Spanner.py
11751             aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11752             RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11753             self._autoPublish(aList, theName, "block")
11754             return aList
11755
11756         ## Multi-transformate block and glue the result.
11757         #  Transformation is defined so, as to superpose direction faces.
11758         #  @param Block Hexahedral solid to be multi-transformed.
11759         #  @param DirFace1 ID of First direction face.
11760         #  @param DirFace2 ID of Second direction face.
11761         #  @param NbTimes Quantity of transformations to be done.
11762         #  @param theName Object name; when specified, this parameter is used
11763         #         for result publication in the study. Otherwise, if automatic
11764         #         publication is switched on, default value is used for result name.
11765         #
11766         #  @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11767         #
11768         #  @return New GEOM.GEOM_Object, containing the result shape.
11769         #
11770         #  @ref tui_multi_transformation "Example"
11771         @ManageTransactions("BlocksOp")
11772         def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11773             """
11774             Multi-transformate block and glue the result.
11775             Transformation is defined so, as to superpose direction faces.
11776
11777             Parameters:
11778                 Block Hexahedral solid to be multi-transformed.
11779                 DirFace1 ID of First direction face.
11780                 DirFace2 ID of Second direction face.
11781                 NbTimes Quantity of transformations to be done.
11782                 theName Object name; when specified, this parameter is used
11783                         for result publication in the study. Otherwise, if automatic
11784                         publication is switched on, default value is used for result name.
11785
11786             Note:
11787                 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11788
11789             Returns:
11790                 New GEOM.GEOM_Object, containing the result shape.
11791             """
11792             # Example: see GEOM_Spanner.py
11793             DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11794             anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11795             RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11796             anObj.SetParameters(Parameters)
11797             self._autoPublish(anObj, theName, "transformed")
11798             return anObj
11799
11800         ## Multi-transformate block and glue the result.
11801         #  @param Block Hexahedral solid to be multi-transformed.
11802         #  @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11803         #  @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11804         #  @param NbTimesU,NbTimesV Quantity of transformations to be done.
11805         #  @param theName Object name; when specified, this parameter is used
11806         #         for result publication in the study. Otherwise, if automatic
11807         #         publication is switched on, default value is used for result name.
11808         #
11809         #  @return New GEOM.GEOM_Object, containing the result shape.
11810         #
11811         #  @ref tui_multi_transformation "Example"
11812         @ManageTransactions("BlocksOp")
11813         def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11814                                       DirFace1V, DirFace2V, NbTimesV, theName=None):
11815             """
11816             Multi-transformate block and glue the result.
11817
11818             Parameters:
11819                 Block Hexahedral solid to be multi-transformed.
11820                 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11821                 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11822                 NbTimesU,NbTimesV Quantity of transformations to be done.
11823                 theName Object name; when specified, this parameter is used
11824                         for result publication in the study. Otherwise, if automatic
11825                         publication is switched on, default value is used for result name.
11826
11827             Returns:
11828                 New GEOM.GEOM_Object, containing the result shape.
11829             """
11830             # Example: see GEOM_Spanner.py
11831             DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11832               DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11833             anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11834                                                             DirFace1V, DirFace2V, NbTimesV)
11835             RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11836             anObj.SetParameters(Parameters)
11837             self._autoPublish(anObj, theName, "transformed")
11838             return anObj
11839
11840         ## Build all possible propagation groups.
11841         #  Propagation group is a set of all edges, opposite to one (main)
11842         #  edge of this group directly or through other opposite edges.
11843         #  Notion of Opposite Edge make sence only on quadrangle face.
11844         #  @param theShape Shape to build propagation groups on.
11845         #  @param theName Object name; when specified, this parameter is used
11846         #         for result publication in the study. Otherwise, if automatic
11847         #         publication is switched on, default value is used for result name.
11848         #
11849         #  @return List of GEOM.GEOM_Object, each of them is a propagation group.
11850         #
11851         #  @ref swig_Propagate "Example"
11852         @ManageTransactions("BlocksOp")
11853         def Propagate(self, theShape, theName=None):
11854             """
11855             Build all possible propagation groups.
11856             Propagation group is a set of all edges, opposite to one (main)
11857             edge of this group directly or through other opposite edges.
11858             Notion of Opposite Edge make sence only on quadrangle face.
11859
11860             Parameters:
11861                 theShape Shape to build propagation groups on.
11862                 theName Object name; when specified, this parameter is used
11863                         for result publication in the study. Otherwise, if automatic
11864                         publication is switched on, default value is used for result name.
11865
11866             Returns:
11867                 List of GEOM.GEOM_Object, each of them is a propagation group.
11868             """
11869             # Example: see GEOM_TestOthers.py
11870             listChains = self.BlocksOp.Propagate(theShape)
11871             RaiseIfFailed("Propagate", self.BlocksOp)
11872             self._autoPublish(listChains, theName, "propagate")
11873             return listChains
11874
11875         # end of l3_blocks_op
11876         ## @}
11877
11878         ## @addtogroup l3_groups
11879         ## @{
11880
11881         ## Creates a new group which will store sub-shapes of theMainShape
11882         #  @param theMainShape is a GEOM object on which the group is selected
11883         #  @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11884         #  @param theName Object name; when specified, this parameter is used
11885         #         for result publication in the study. Otherwise, if automatic
11886         #         publication is switched on, default value is used for result name.
11887         #
11888         #  @return a newly created GEOM group (GEOM.GEOM_Object)
11889         #
11890         #  @ref tui_working_with_groups_page "Example 1"
11891         #  \n @ref swig_CreateGroup "Example 2"
11892         @ManageTransactions("GroupOp")
11893         def CreateGroup(self, theMainShape, theShapeType, theName=None):
11894             """
11895             Creates a new group which will store sub-shapes of theMainShape
11896
11897             Parameters:
11898                theMainShape is a GEOM object on which the group is selected
11899                theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11900                             "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11901                 theName Object name; when specified, this parameter is used
11902                         for result publication in the study. Otherwise, if automatic
11903                         publication is switched on, default value is used for result name.
11904
11905             Returns:
11906                a newly created GEOM group
11907
11908             Example of usage:
11909                 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11910
11911             """
11912             # Example: see GEOM_TestOthers.py
11913             anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11914             RaiseIfFailed("CreateGroup", self.GroupOp)
11915             self._autoPublish(anObj, theName, "group")
11916             return anObj
11917
11918         ## Adds a sub-object with ID theSubShapeId to the group
11919         #  @param theGroup is a GEOM group to which the new sub-shape is added
11920         #  @param theSubShapeID is a sub-shape ID in the main object.
11921         #  \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11922         #
11923         #  @ref tui_working_with_groups_page "Example"
11924         @ManageTransactions("GroupOp")
11925         def AddObject(self,theGroup, theSubShapeID):
11926             """
11927             Adds a sub-object with ID theSubShapeId to the group
11928
11929             Parameters:
11930                 theGroup       is a GEOM group to which the new sub-shape is added
11931                 theSubShapeID  is a sub-shape ID in the main object.
11932
11933             Note:
11934                 Use method GetSubShapeID() to get an unique ID of the sub-shape
11935             """
11936             # Example: see GEOM_TestOthers.py
11937             self.GroupOp.AddObject(theGroup, theSubShapeID)
11938             if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11939                 RaiseIfFailed("AddObject", self.GroupOp)
11940                 pass
11941             pass
11942
11943         ## Removes a sub-object with ID \a theSubShapeId from the group
11944         #  @param theGroup is a GEOM group from which the new sub-shape is removed
11945         #  @param theSubShapeID is a sub-shape ID in the main object.
11946         #  \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11947         #
11948         #  @ref tui_working_with_groups_page "Example"
11949         @ManageTransactions("GroupOp")
11950         def RemoveObject(self,theGroup, theSubShapeID):
11951             """
11952             Removes a sub-object with ID theSubShapeId from the group
11953
11954             Parameters:
11955                 theGroup is a GEOM group from which the new sub-shape is removed
11956                 theSubShapeID is a sub-shape ID in the main object.
11957
11958             Note:
11959                 Use method GetSubShapeID() to get an unique ID of the sub-shape
11960             """
11961             # Example: see GEOM_TestOthers.py
11962             self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11963             RaiseIfFailed("RemoveObject", self.GroupOp)
11964             pass
11965
11966         ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11967         #  @param theGroup is a GEOM group to which the new sub-shapes are added.
11968         #  @param theSubShapes is a list of sub-shapes to be added.
11969         #
11970         #  @ref tui_working_with_groups_page "Example"
11971         @ManageTransactions("GroupOp")
11972         def UnionList (self,theGroup, theSubShapes):
11973             """
11974             Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11975
11976             Parameters:
11977                 theGroup is a GEOM group to which the new sub-shapes are added.
11978                 theSubShapes is a list of sub-shapes to be added.
11979             """
11980             # Example: see GEOM_TestOthers.py
11981             self.GroupOp.UnionList(theGroup, theSubShapes)
11982             RaiseIfFailed("UnionList", self.GroupOp)
11983             pass
11984
11985         ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11986         #  @param theGroup is a GEOM group to which the new sub-shapes are added.
11987         #  @param theSubShapes is a list of indices of sub-shapes to be added.
11988         #
11989         #  @ref swig_UnionIDs "Example"
11990         @ManageTransactions("GroupOp")
11991         def UnionIDs(self,theGroup, theSubShapes):
11992             """
11993             Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11994
11995             Parameters:
11996                 theGroup is a GEOM group to which the new sub-shapes are added.
11997                 theSubShapes is a list of indices of sub-shapes to be added.
11998             """
11999             # Example: see GEOM_TestOthers.py
12000             self.GroupOp.UnionIDs(theGroup, theSubShapes)
12001             RaiseIfFailed("UnionIDs", self.GroupOp)
12002             pass
12003
12004         ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12005         #  @param theGroup is a GEOM group from which the sub-shapes are removed.
12006         #  @param theSubShapes is a list of sub-shapes to be removed.
12007         #
12008         #  @ref tui_working_with_groups_page "Example"
12009         @ManageTransactions("GroupOp")
12010         def DifferenceList (self,theGroup, theSubShapes):
12011             """
12012             Removes from the group all the given shapes. No errors, if some shapes are not included.
12013
12014             Parameters:
12015                 theGroup is a GEOM group from which the sub-shapes are removed.
12016                 theSubShapes is a list of sub-shapes to be removed.
12017             """
12018             # Example: see GEOM_TestOthers.py
12019             self.GroupOp.DifferenceList(theGroup, theSubShapes)
12020             RaiseIfFailed("DifferenceList", self.GroupOp)
12021             pass
12022
12023         ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12024         #  @param theGroup is a GEOM group from which the sub-shapes are removed.
12025         #  @param theSubShapes is a list of indices of sub-shapes to be removed.
12026         #
12027         #  @ref swig_DifferenceIDs "Example"
12028         @ManageTransactions("GroupOp")
12029         def DifferenceIDs(self,theGroup, theSubShapes):
12030             """
12031             Removes from the group all the given shapes. No errors, if some shapes are not included.
12032
12033             Parameters:
12034                 theGroup is a GEOM group from which the sub-shapes are removed.
12035                 theSubShapes is a list of indices of sub-shapes to be removed.
12036             """
12037             # Example: see GEOM_TestOthers.py
12038             self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
12039             RaiseIfFailed("DifferenceIDs", self.GroupOp)
12040             pass
12041
12042         ## Union of two groups.
12043         #  New group is created. It will contain all entities
12044         #  which are present in groups theGroup1 and theGroup2.
12045         #  @param theGroup1, theGroup2 are the initial GEOM groups
12046         #                              to create the united group from.
12047         #  @param theName Object name; when specified, this parameter is used
12048         #         for result publication in the study. Otherwise, if automatic
12049         #         publication is switched on, default value is used for result name.
12050         #
12051         #  @return a newly created GEOM group.
12052         #
12053         #  @ref tui_union_groups_anchor "Example"
12054         @ManageTransactions("GroupOp")
12055         def UnionGroups (self, theGroup1, theGroup2, theName=None):
12056             """
12057             Union of two groups.
12058             New group is created. It will contain all entities
12059             which are present in groups theGroup1 and theGroup2.
12060
12061             Parameters:
12062                 theGroup1, theGroup2 are the initial GEOM groups
12063                                      to create the united group from.
12064                 theName Object name; when specified, this parameter is used
12065                         for result publication in the study. Otherwise, if automatic
12066                         publication is switched on, default value is used for result name.
12067
12068             Returns:
12069                 a newly created GEOM group.
12070             """
12071             # Example: see GEOM_TestOthers.py
12072             aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12073             RaiseIfFailed("UnionGroups", self.GroupOp)
12074             self._autoPublish(aGroup, theName, "group")
12075             return aGroup
12076
12077         ## Intersection of two groups.
12078         #  New group is created. It will contain only those entities
12079         #  which are present in both groups theGroup1 and theGroup2.
12080         #  @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12081         #  @param theName Object name; when specified, this parameter is used
12082         #         for result publication in the study. Otherwise, if automatic
12083         #         publication is switched on, default value is used for result name.
12084         #
12085         #  @return a newly created GEOM group.
12086         #
12087         #  @ref tui_intersect_groups_anchor "Example"
12088         @ManageTransactions("GroupOp")
12089         def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12090             """
12091             Intersection of two groups.
12092             New group is created. It will contain only those entities
12093             which are present in both groups theGroup1 and theGroup2.
12094
12095             Parameters:
12096                 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12097                 theName Object name; when specified, this parameter is used
12098                         for result publication in the study. Otherwise, if automatic
12099                         publication is switched on, default value is used for result name.
12100
12101             Returns:
12102                 a newly created GEOM group.
12103             """
12104             # Example: see GEOM_TestOthers.py
12105             aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12106             RaiseIfFailed("IntersectGroups", self.GroupOp)
12107             self._autoPublish(aGroup, theName, "group")
12108             return aGroup
12109
12110         ## Cut of two groups.
12111         #  New group is created. It will contain entities which are
12112         #  present in group theGroup1 but are not present in group theGroup2.
12113         #  @param theGroup1 is a GEOM group to include elements of.
12114         #  @param theGroup2 is a GEOM group to exclude elements of.
12115         #  @param theName Object name; when specified, this parameter is used
12116         #         for result publication in the study. Otherwise, if automatic
12117         #         publication is switched on, default value is used for result name.
12118         #
12119         #  @return a newly created GEOM group.
12120         #
12121         #  @ref tui_cut_groups_anchor "Example"
12122         @ManageTransactions("GroupOp")
12123         def CutGroups (self, theGroup1, theGroup2, theName=None):
12124             """
12125             Cut of two groups.
12126             New group is created. It will contain entities which are
12127             present in group theGroup1 but are not present in group theGroup2.
12128
12129             Parameters:
12130                 theGroup1 is a GEOM group to include elements of.
12131                 theGroup2 is a GEOM group to exclude elements of.
12132                 theName Object name; when specified, this parameter is used
12133                         for result publication in the study. Otherwise, if automatic
12134                         publication is switched on, default value is used for result name.
12135
12136             Returns:
12137                 a newly created GEOM group.
12138             """
12139             # Example: see GEOM_TestOthers.py
12140             aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12141             RaiseIfFailed("CutGroups", self.GroupOp)
12142             self._autoPublish(aGroup, theName, "group")
12143             return aGroup
12144
12145         ## Union of list of groups.
12146         #  New group is created. It will contain all entities that are
12147         #  present in groups listed in theGList.
12148         #  @param theGList is a list of GEOM groups to create the united group from.
12149         #  @param theName Object name; when specified, this parameter is used
12150         #         for result publication in the study. Otherwise, if automatic
12151         #         publication is switched on, default value is used for result name.
12152         #
12153         #  @return a newly created GEOM group.
12154         #
12155         #  @ref tui_union_groups_anchor "Example"
12156         @ManageTransactions("GroupOp")
12157         def UnionListOfGroups (self, theGList, theName=None):
12158             """
12159             Union of list of groups.
12160             New group is created. It will contain all entities that are
12161             present in groups listed in theGList.
12162
12163             Parameters:
12164                 theGList is a list of GEOM groups to create the united group from.
12165                 theName Object name; when specified, this parameter is used
12166                         for result publication in the study. Otherwise, if automatic
12167                         publication is switched on, default value is used for result name.
12168
12169             Returns:
12170                 a newly created GEOM group.
12171             """
12172             # Example: see GEOM_TestOthers.py
12173             aGroup = self.GroupOp.UnionListOfGroups(theGList)
12174             RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12175             self._autoPublish(aGroup, theName, "group")
12176             return aGroup
12177
12178         ## Cut of lists of groups.
12179         #  New group is created. It will contain only entities
12180         #  which are present in groups listed in theGList.
12181         #  @param theGList is a list of GEOM groups to include elements of.
12182         #  @param theName Object name; when specified, this parameter is used
12183         #         for result publication in the study. Otherwise, if automatic
12184         #         publication is switched on, default value is used for result name.
12185         #
12186         #  @return a newly created GEOM group.
12187         #
12188         #  @ref tui_intersect_groups_anchor "Example"
12189         @ManageTransactions("GroupOp")
12190         def IntersectListOfGroups (self, theGList, theName=None):
12191             """
12192             Cut of lists of groups.
12193             New group is created. It will contain only entities
12194             which are present in groups listed in theGList.
12195
12196             Parameters:
12197                 theGList is a list of GEOM groups to include elements of.
12198                 theName Object name; when specified, this parameter is used
12199                         for result publication in the study. Otherwise, if automatic
12200                         publication is switched on, default value is used for result name.
12201
12202             Returns:
12203                 a newly created GEOM group.
12204             """
12205             # Example: see GEOM_TestOthers.py
12206             aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12207             RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12208             self._autoPublish(aGroup, theName, "group")
12209             return aGroup
12210
12211         ## Cut of lists of groups.
12212         #  New group is created. It will contain only entities
12213         #  which are present in groups listed in theGList1 but
12214         #  are not present in groups from theGList2.
12215         #  @param theGList1 is a list of GEOM groups to include elements of.
12216         #  @param theGList2 is a list of GEOM groups to exclude elements of.
12217         #  @param theName Object name; when specified, this parameter is used
12218         #         for result publication in the study. Otherwise, if automatic
12219         #         publication is switched on, default value is used for result name.
12220         #
12221         #  @return a newly created GEOM group.
12222         #
12223         #  @ref tui_cut_groups_anchor "Example"
12224         @ManageTransactions("GroupOp")
12225         def CutListOfGroups (self, theGList1, theGList2, theName=None):
12226             """
12227             Cut of lists of groups.
12228             New group is created. It will contain only entities
12229             which are present in groups listed in theGList1 but
12230             are not present in groups from theGList2.
12231
12232             Parameters:
12233                 theGList1 is a list of GEOM groups to include elements of.
12234                 theGList2 is a list of GEOM groups to exclude elements of.
12235                 theName Object name; when specified, this parameter is used
12236                         for result publication in the study. Otherwise, if automatic
12237                         publication is switched on, default value is used for result name.
12238
12239             Returns:
12240                 a newly created GEOM group.
12241             """
12242             # Example: see GEOM_TestOthers.py
12243             aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12244             RaiseIfFailed("CutListOfGroups", self.GroupOp)
12245             self._autoPublish(aGroup, theName, "group")
12246             return aGroup
12247
12248         ## Returns a list of sub-objects ID stored in the group
12249         #  @param theGroup is a GEOM group for which a list of IDs is requested
12250         #
12251         #  @ref swig_GetObjectIDs "Example"
12252         @ManageTransactions("GroupOp")
12253         def GetObjectIDs(self,theGroup):
12254             """
12255             Returns a list of sub-objects ID stored in the group
12256
12257             Parameters:
12258                 theGroup is a GEOM group for which a list of IDs is requested
12259             """
12260             # Example: see GEOM_TestOthers.py
12261             ListIDs = self.GroupOp.GetObjects(theGroup)
12262             RaiseIfFailed("GetObjects", self.GroupOp)
12263             return ListIDs
12264
12265         ## Returns a type of sub-objects stored in the group
12266         #  @param theGroup is a GEOM group which type is returned.
12267         #
12268         #  @ref swig_GetType "Example"
12269         @ManageTransactions("GroupOp")
12270         def GetType(self,theGroup):
12271             """
12272             Returns a type of sub-objects stored in the group
12273
12274             Parameters:
12275                 theGroup is a GEOM group which type is returned.
12276             """
12277             # Example: see GEOM_TestOthers.py
12278             aType = self.GroupOp.GetType(theGroup)
12279             RaiseIfFailed("GetType", self.GroupOp)
12280             return aType
12281
12282         ## Convert a type of geom object from id to string value
12283         #  @param theId is a GEOM obect type id.
12284         #  @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12285         #  @ref swig_GetType "Example"
12286         def ShapeIdToType(self, theId):
12287             """
12288             Convert a type of geom object from id to string value
12289
12290             Parameters:
12291                 theId is a GEOM obect type id.
12292
12293             Returns:
12294                 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12295             """
12296             if theId == 0:
12297                 return "COPY"
12298             if theId == 1:
12299                 return "IMPORT"
12300             if theId == 2:
12301                 return "POINT"
12302             if theId == 3:
12303                 return "VECTOR"
12304             if theId == 4:
12305                 return "PLANE"
12306             if theId == 5:
12307                 return "LINE"
12308             if theId == 6:
12309                 return "TORUS"
12310             if theId == 7:
12311                 return "BOX"
12312             if theId == 8:
12313                 return "CYLINDER"
12314             if theId == 9:
12315                 return "CONE"
12316             if theId == 10:
12317                 return "SPHERE"
12318             if theId == 11:
12319                 return "PRISM"
12320             if theId == 12:
12321                 return "REVOLUTION"
12322             if theId == 13:
12323                 return "BOOLEAN"
12324             if theId == 14:
12325                 return "PARTITION"
12326             if theId == 15:
12327                 return "POLYLINE"
12328             if theId == 16:
12329                 return "CIRCLE"
12330             if theId == 17:
12331                 return "SPLINE"
12332             if theId == 18:
12333                 return "ELLIPSE"
12334             if theId == 19:
12335                 return "CIRC_ARC"
12336             if theId == 20:
12337                 return "FILLET"
12338             if theId == 21:
12339                 return "CHAMFER"
12340             if theId == 22:
12341                 return "EDGE"
12342             if theId == 23:
12343                 return "WIRE"
12344             if theId == 24:
12345                 return "FACE"
12346             if theId == 25:
12347                 return "SHELL"
12348             if theId == 26:
12349                 return "SOLID"
12350             if theId == 27:
12351                 return "COMPOUND"
12352             if theId == 28:
12353                 return "SUBSHAPE"
12354             if theId == 29:
12355                 return "PIPE"
12356             if theId == 30:
12357                 return "ARCHIMEDE"
12358             if theId == 31:
12359                 return "FILLING"
12360             if theId == 32:
12361                 return "EXPLODE"
12362             if theId == 33:
12363                 return "GLUED"
12364             if theId == 34:
12365                 return "SKETCHER"
12366             if theId == 35:
12367                 return "CDG"
12368             if theId == 36:
12369                 return "FREE_BOUNDS"
12370             if theId == 37:
12371                 return "GROUP"
12372             if theId == 38:
12373                 return "BLOCK"
12374             if theId == 39:
12375                 return "MARKER"
12376             if theId == 40:
12377                 return "THRUSECTIONS"
12378             if theId == 41:
12379                 return "COMPOUNDFILTER"
12380             if theId == 42:
12381                 return "SHAPES_ON_SHAPE"
12382             if theId == 43:
12383                 return "ELLIPSE_ARC"
12384             if theId == 44:
12385                 return "3DSKETCHER"
12386             if theId == 45:
12387                 return "FILLET_2D"
12388             if theId == 46:
12389                 return "FILLET_1D"
12390             if theId == 201:
12391                 return "PIPETSHAPE"
12392             return "Shape Id not exist."
12393
12394         ## Returns a main shape associated with the group
12395         #  @param theGroup is a GEOM group for which a main shape object is requested
12396         #  @return a GEOM object which is a main shape for theGroup
12397         #
12398         #  @ref swig_GetMainShape "Example"
12399         @ManageTransactions("GroupOp")
12400         def GetMainShape(self,theGroup):
12401             """
12402             Returns a main shape associated with the group
12403
12404             Parameters:
12405                 theGroup is a GEOM group for which a main shape object is requested
12406
12407             Returns:
12408                 a GEOM object which is a main shape for theGroup
12409
12410             Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12411             """
12412             # Example: see GEOM_TestOthers.py
12413             anObj = self.GroupOp.GetMainShape(theGroup)
12414             RaiseIfFailed("GetMainShape", self.GroupOp)
12415             return anObj
12416
12417         ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12418         #  If include_min/max == 0, edges with length == min/max_length will not be included in result.
12419         #  @param theShape given shape (see GEOM.GEOM_Object)
12420         #  @param min_length minimum length of edges of theShape
12421         #  @param max_length maximum length of edges of theShape
12422         #  @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12423         #  @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12424         #  @param theName Object name; when specified, this parameter is used
12425         #         for result publication in the study. Otherwise, if automatic
12426         #         publication is switched on, default value is used for result name.
12427         #
12428         #  @return a newly created GEOM group of edges
12429         #
12430         #  @@ref swig_todo "Example"
12431         def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12432             """
12433             Create group of edges of theShape, whose length is in range [min_length, max_length].
12434             If include_min/max == 0, edges with length == min/max_length will not be included in result.
12435
12436             Parameters:
12437                 theShape given shape
12438                 min_length minimum length of edges of theShape
12439                 max_length maximum length of edges of theShape
12440                 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12441                 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12442                 theName Object name; when specified, this parameter is used
12443                         for result publication in the study. Otherwise, if automatic
12444                         publication is switched on, default value is used for result name.
12445
12446              Returns:
12447                 a newly created GEOM group of edges.
12448             """
12449             edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12450             edges_in_range = []
12451             for edge in edges:
12452                 Props = self.BasicProperties(edge)
12453                 if min_length <= Props[0] and Props[0] <= max_length:
12454                     if (not include_min) and (min_length == Props[0]):
12455                         skip = 1
12456                     else:
12457                         if (not include_max) and (Props[0] == max_length):
12458                             skip = 1
12459                         else:
12460                             edges_in_range.append(edge)
12461
12462             if len(edges_in_range) <= 0:
12463                 print "No edges found by given criteria"
12464                 return None
12465
12466             # note: auto-publishing is done in self.CreateGroup()
12467             group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12468             self.UnionList(group_edges, edges_in_range)
12469
12470             return group_edges
12471
12472         ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12473         #  If include_min/max == 0, edges with length == min/max_length will not be included in result.
12474         #  @param min_length minimum length of edges of selected shape
12475         #  @param max_length maximum length of edges of selected shape
12476         #  @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12477         #  @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12478         #  @return a newly created GEOM group of edges
12479         #  @ref swig_todo "Example"
12480         def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12481             """
12482             Create group of edges of selected shape, whose length is in range [min_length, max_length].
12483             If include_min/max == 0, edges with length == min/max_length will not be included in result.
12484
12485             Parameters:
12486                 min_length minimum length of edges of selected shape
12487                 max_length maximum length of edges of selected shape
12488                 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12489                 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12490
12491              Returns:
12492                 a newly created GEOM group of edges.
12493             """
12494             nb_selected = sg.SelectedCount()
12495             if nb_selected < 1:
12496                 print "Select a shape before calling this function, please."
12497                 return 0
12498             if nb_selected > 1:
12499                 print "Only one shape must be selected"
12500                 return 0
12501
12502             id_shape = sg.getSelected(0)
12503             shape = IDToObject( id_shape )
12504
12505             group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12506
12507             left_str  = " < "
12508             right_str = " < "
12509             if include_min: left_str  = " <= "
12510             if include_max: right_str  = " <= "
12511
12512             self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12513                                     + left_str + "length" + right_str + `max_length`)
12514
12515             sg.updateObjBrowser(1)
12516
12517             return group_edges
12518
12519         # end of l3_groups
12520         ## @}
12521
12522         #@@ insert new functions before this line @@ do not remove this line @@#
12523
12524         ## Create a copy of the given object
12525         #
12526         #  @param theOriginal geometry object for copy
12527         #  @param theName Object name; when specified, this parameter is used
12528         #         for result publication in the study. Otherwise, if automatic
12529         #         publication is switched on, default value is used for result name.
12530         #
12531         #  @return New GEOM_Object, containing the copied shape.
12532         #
12533         #  @ingroup l1_geomBuilder_auxiliary
12534         #  @ref swig_MakeCopy "Example"
12535         @ManageTransactions("InsertOp")
12536         def MakeCopy(self, theOriginal, theName=None):
12537             """
12538             Create a copy of the given object
12539
12540             Parameters:
12541                 theOriginal geometry object for copy
12542                 theName Object name; when specified, this parameter is used
12543                         for result publication in the study. Otherwise, if automatic
12544                         publication is switched on, default value is used for result name.
12545
12546             Returns:
12547                 New GEOM_Object, containing the copied shape.
12548
12549             Example of usage: Copy = geompy.MakeCopy(Box)
12550             """
12551             # Example: see GEOM_TestAll.py
12552             anObj = self.InsertOp.MakeCopy(theOriginal)
12553             RaiseIfFailed("MakeCopy", self.InsertOp)
12554             self._autoPublish(anObj, theName, "copy")
12555             return anObj
12556
12557         ## Add Path to load python scripts from
12558         #  @param Path a path to load python scripts from
12559         #  @ingroup l1_geomBuilder_auxiliary
12560         def addPath(self,Path):
12561             """
12562             Add Path to load python scripts from
12563
12564             Parameters:
12565                 Path a path to load python scripts from
12566             """
12567             if (sys.path.count(Path) < 1):
12568                 sys.path.append(Path)
12569                 pass
12570             pass
12571
12572         ## Load marker texture from the file
12573         #  @param Path a path to the texture file
12574         #  @return unique texture identifier
12575         #  @ingroup l1_geomBuilder_auxiliary
12576         @ManageTransactions("InsertOp")
12577         def LoadTexture(self, Path):
12578             """
12579             Load marker texture from the file
12580
12581             Parameters:
12582                 Path a path to the texture file
12583
12584             Returns:
12585                 unique texture identifier
12586             """
12587             # Example: see GEOM_TestAll.py
12588             ID = self.InsertOp.LoadTexture(Path)
12589             RaiseIfFailed("LoadTexture", self.InsertOp)
12590             return ID
12591
12592         ## Get internal name of the object based on its study entry
12593         #  @note This method does not provide an unique identifier of the geometry object.
12594         #  @note This is internal function of GEOM component, though it can be used outside it for
12595         #  appropriate reason (e.g. for identification of geometry object).
12596         #  @param obj geometry object
12597         #  @return unique object identifier
12598         #  @ingroup l1_geomBuilder_auxiliary
12599         def getObjectID(self, obj):
12600             """
12601             Get internal name of the object based on its study entry.
12602             Note: this method does not provide an unique identifier of the geometry object.
12603             It is an internal function of GEOM component, though it can be used outside GEOM for
12604             appropriate reason (e.g. for identification of geometry object).
12605
12606             Parameters:
12607                 obj geometry object
12608
12609             Returns:
12610                 unique object identifier
12611             """
12612             ID = ""
12613             entry = salome.ObjectToID(obj)
12614             if entry is not None:
12615                 lst = entry.split(":")
12616                 if len(lst) > 0:
12617                     ID = lst[-1] # -1 means last item in the list
12618                     return "GEOM_" + ID
12619             return ID
12620
12621
12622
12623         ## Add marker texture. @a Width and @a Height parameters
12624         #  specify width and height of the texture in pixels.
12625         #  If @a RowData is @c True, @a Texture parameter should represent texture data
12626         #  packed into the byte array. If @a RowData is @c False (default), @a Texture
12627         #  parameter should be unpacked string, in which '1' symbols represent opaque
12628         #  pixels and '0' represent transparent pixels of the texture bitmap.
12629         #
12630         #  @param Width texture width in pixels
12631         #  @param Height texture height in pixels
12632         #  @param Texture texture data
12633         #  @param RowData if @c True, @a Texture data are packed in the byte stream
12634         #  @return unique texture identifier
12635         #  @ingroup l1_geomBuilder_auxiliary
12636         @ManageTransactions("InsertOp")
12637         def AddTexture(self, Width, Height, Texture, RowData=False):
12638             """
12639             Add marker texture. Width and Height parameters
12640             specify width and height of the texture in pixels.
12641             If RowData is True, Texture parameter should represent texture data
12642             packed into the byte array. If RowData is False (default), Texture
12643             parameter should be unpacked string, in which '1' symbols represent opaque
12644             pixels and '0' represent transparent pixels of the texture bitmap.
12645
12646             Parameters:
12647                 Width texture width in pixels
12648                 Height texture height in pixels
12649                 Texture texture data
12650                 RowData if True, Texture data are packed in the byte stream
12651
12652             Returns:
12653                 return unique texture identifier
12654             """
12655             if not RowData: Texture = PackData(Texture)
12656             ID = self.InsertOp.AddTexture(Width, Height, Texture)
12657             RaiseIfFailed("AddTexture", self.InsertOp)
12658             return ID
12659
12660         ## Creates a new folder object. It is a container for any GEOM objects.
12661         #  @param Name name of the container
12662         #  @param Father parent object. If None,
12663         #         folder under 'Geometry' root object will be created.
12664         #  @return a new created folder
12665         #  @ingroup l1_publish_data
12666         def NewFolder(self, Name, Father=None):
12667             """
12668             Create a new folder object. It is an auxiliary container for any GEOM objects.
12669
12670             Parameters:
12671                 Name name of the container
12672                 Father parent object. If None,
12673                 folder under 'Geometry' root object will be created.
12674
12675             Returns:
12676                 a new created folder
12677             """
12678             if not Father: Father = self.father
12679             return self.CreateFolder(Name, Father)
12680
12681         ## Move object to the specified folder
12682         #  @param Object object to move
12683         #  @param Folder target folder
12684         #  @ingroup l1_publish_data
12685         def PutToFolder(self, Object, Folder):
12686             """
12687             Move object to the specified folder
12688
12689             Parameters:
12690                 Object object to move
12691                 Folder target folder
12692             """
12693             self.MoveToFolder(Object, Folder)
12694             pass
12695
12696         ## Move list of objects to the specified folder
12697         #  @param ListOfSO list of objects to move
12698         #  @param Folder target folder
12699         #  @ingroup l1_publish_data
12700         def PutListToFolder(self, ListOfSO, Folder):
12701             """
12702             Move list of objects to the specified folder
12703
12704             Parameters:
12705                 ListOfSO list of objects to move
12706                 Folder target folder
12707             """
12708             self.MoveListToFolder(ListOfSO, Folder)
12709             pass
12710
12711         ## @addtogroup l2_field
12712         ## @{
12713
12714         ## Creates a field
12715         #  @param shape the shape the field lies on
12716         #  @param name the field name
12717         #  @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
12718         #  @param dimension dimension of the shape the field lies on
12719         #         0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12720         #  @param componentNames names of components
12721         #  @return a created field
12722         @ManageTransactions("FieldOp")
12723         def CreateField(self, shape, name, type, dimension, componentNames):
12724             """
12725             Creates a field
12726
12727             Parameters:
12728                 shape the shape the field lies on
12729                 name  the field name
12730                 type  type of field data
12731                 dimension dimension of the shape the field lies on
12732                           0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12733                 componentNames names of components
12734
12735             Returns:
12736                 a created field
12737             """
12738             if isinstance( type, int ):
12739                 if type < 0 or type > 3:
12740                     raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
12741                 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
12742
12743             f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
12744             RaiseIfFailed("CreateField", self.FieldOp)
12745             global geom
12746             geom._autoPublish( f, "", name)
12747             return f
12748
12749         ## Removes a field from the GEOM component
12750         #  @param field the field to remove
12751         def RemoveField(self, field):
12752             "Removes a field from the GEOM component"
12753             global geom
12754             if isinstance( field, GEOM._objref_GEOM_Field ):
12755                 geom.RemoveObject( field )
12756             elif isinstance( field, geomField ):
12757                 geom.RemoveObject( field.field )
12758             else:
12759                 raise RuntimeError, "RemoveField() : the object is not a field"
12760             return
12761
12762         ## Returns number of fields on a shape
12763         @ManageTransactions("FieldOp")
12764         def CountFields(self, shape):
12765             "Returns number of fields on a shape"
12766             nb = self.FieldOp.CountFields( shape )
12767             RaiseIfFailed("CountFields", self.FieldOp)
12768             return nb
12769
12770         ## Returns all fields on a shape
12771         @ManageTransactions("FieldOp")
12772         def GetFields(self, shape):
12773             "Returns all fields on a shape"
12774             ff = self.FieldOp.GetFields( shape )
12775             RaiseIfFailed("GetFields", self.FieldOp)
12776             return ff
12777
12778         ## Returns a field on a shape by its name
12779         @ManageTransactions("FieldOp")
12780         def GetField(self, shape, name):
12781             "Returns a field on a shape by its name"
12782             f = self.FieldOp.GetField( shape, name )
12783             RaiseIfFailed("GetField", self.FieldOp)
12784             return f
12785
12786         # end of l2_field
12787         ## @}
12788
12789
12790 import omniORB
12791 # Register the new proxy for GEOM_Gen
12792 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12793
12794
12795 ## Field on Geometry
12796 #  @ingroup l2_field
12797 class geomField( GEOM._objref_GEOM_Field ):
12798
12799     def __init__(self):
12800         GEOM._objref_GEOM_Field.__init__(self)
12801         self.field = GEOM._objref_GEOM_Field
12802         return
12803
12804     ## Returns the shape the field lies on
12805     def getShape(self):
12806         "Returns the shape the field lies on"
12807         return self.field.GetShape(self)
12808
12809     ## Returns the field name
12810     def getName(self):
12811         "Returns the field name"
12812         return self.field.GetName(self)
12813
12814     ## Returns type of field data as integer [0-3]
12815     def getType(self):
12816         "Returns type of field data"
12817         return self.field.GetDataType(self)._v
12818
12819     ## Returns type of field data:
12820     #  one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
12821     def getTypeEnum(self):
12822         "Returns type of field data"
12823         return self.field.GetDataType(self)
12824
12825     ## Returns dimension of the shape the field lies on:
12826     #  0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12827     def getDimension(self):
12828         """Returns dimension of the shape the field lies on:
12829         0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
12830         return self.field.GetDimension(self)
12831
12832     ## Returns names of components
12833     def getComponents(self):
12834         "Returns names of components"
12835         return self.field.GetComponents(self)
12836
12837     ## Adds a time step to the field
12838     #  @param step the time step number further used as the step identifier
12839     #  @param stamp the time step time
12840     #  @param values the values of the time step
12841     def addStep(self, step, stamp, values):
12842         "Adds a time step to the field"
12843         stp = self.field.AddStep( self, step, stamp )
12844         if not stp:
12845             raise RuntimeError, \
12846                   "Field.addStep() : Error: step %s already exists in this field"%step
12847         global geom
12848         geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
12849         self.setValues( step, values )
12850         return stp
12851
12852     ## Remove a time step from the field
12853     def removeStep(self,step):
12854         "Remove a time step from the field"
12855         stepSO = None
12856         try:
12857             stepObj = self.field.GetStep( self, step )
12858             if stepObj:
12859                 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
12860         except:
12861             #import traceback
12862             #traceback.print_exc()
12863             pass
12864         self.field.RemoveStep( self, step )
12865         if stepSO:
12866             geom.myBuilder.RemoveObjectWithChildren( stepSO )
12867         return
12868
12869     ## Returns number of time steps in the field
12870     def countSteps(self):
12871         "Returns number of time steps in the field"
12872         return self.field.CountSteps(self)
12873
12874     ## Returns a list of time step IDs in the field
12875     def getSteps(self):
12876         "Returns a list of time step IDs in the field"
12877         return self.field.GetSteps(self)
12878
12879     ## Returns a time step by its ID
12880     def getStep(self,step):
12881         "Returns a time step by its ID"
12882         stp = self.field.GetStep(self, step)
12883         if not stp:
12884             raise RuntimeError, "Step %s is missing from this field"%step
12885         return stp
12886
12887     ## Returns the time of the field step
12888     def getStamp(self,step):
12889         "Returns the time of the field step"
12890         return self.getStep(step).GetStamp()
12891
12892     ## Changes the time of the field step
12893     def setStamp(self, step, stamp):
12894         "Changes the time of the field step"
12895         return self.getStep(step).SetStamp(stamp)
12896
12897     ## Returns values of the field step
12898     def getValues(self, step):
12899         "Returns values of the field step"
12900         return self.getStep(step).GetValues()
12901
12902     ## Changes values of the field step
12903     def setValues(self, step, values):
12904         "Changes values of the field step"
12905         stp = self.getStep(step)
12906         errBeg = "Field.setValues(values) : Error: "
12907         try:
12908             ok = stp.SetValues( values )
12909         except Exception, e:
12910             excStr = str(e)
12911             if excStr.find("WrongPythonType") > 0:
12912                 raise RuntimeError, errBeg +\
12913                       "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
12914             raise RuntimeError, errBeg + str(e)
12915         if not ok:
12916             nbOK = self.field.GetArraySize(self)
12917             nbKO = len(values)
12918             if nbOK != nbKO:
12919                 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
12920             else:
12921                 raise RuntimeError, errBeg + "failed"
12922         return
12923
12924     pass # end of class geomField
12925
12926 # Register the new proxy for GEOM_Field
12927 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
12928
12929
12930 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
12931 #  interface to GEOM operations.
12932 #
12933 #  Typical use is:
12934 #  \code
12935 #    import salome
12936 #    salome.salome_init()
12937 #    from salome.geom import geomBuilder
12938 #    geompy = geomBuilder.New(salome.myStudy)
12939 #  \endcode
12940 #  @param  study     SALOME study, generally obtained by salome.myStudy.
12941 #  @param  instance  CORBA proxy of GEOM Engine. If None, the default Engine is used.
12942 #  @return geomBuilder instance
12943 def New( study, instance=None):
12944     """
12945     Create a new geomBuilder instance.The geomBuilder class provides the Python
12946     interface to GEOM operations.
12947
12948     Typical use is:
12949         import salome
12950         salome.salome_init()
12951         from salome.geom import geomBuilder
12952         geompy = geomBuilder.New(salome.myStudy)
12953
12954     Parameters:
12955         study     SALOME study, generally obtained by salome.myStudy.
12956         instance  CORBA proxy of GEOM Engine. If None, the default Engine is used.
12957     Returns:
12958         geomBuilder instance
12959     """
12960     #print "New geomBuilder ", study, instance
12961     global engine
12962     global geom
12963     global doLcc
12964     engine = instance
12965     if engine is None:
12966       doLcc = True
12967     geom = geomBuilder()
12968     assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
12969     geom.init_geom(study)
12970     return geom
12971
12972
12973 # Register methods from the plug-ins in the geomBuilder class 
12974 plugins_var = os.environ.get( "GEOM_PluginsList" )
12975
12976 plugins = None
12977 if plugins_var is not None:
12978     plugins = plugins_var.split( ":" )
12979     plugins=filter(lambda x: len(x)>0, plugins)
12980 if plugins is not None:
12981     for pluginName in plugins:
12982         pluginBuilderName = pluginName + "Builder"
12983         try:
12984             exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
12985         except Exception, e:
12986             from salome_utils import verbose
12987             print "Exception while loading %s: %s" % ( pluginBuilderName, e )
12988             continue
12989         exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
12990         plugin = eval( pluginBuilderName )
12991         
12992         # add methods from plugin module to the geomBuilder class
12993         for k in dir( plugin ):
12994             if k[0] == '_': continue
12995             method = getattr( plugin, k )
12996             if type( method ).__name__ == 'function':
12997                 if not hasattr( geomBuilder, k ):
12998                     setattr( geomBuilder, k, method )
12999                 pass
13000             pass
13001         del pluginName
13002         pass
13003     pass