Salome HOME
0022626: EDF 8453 GEOM: order with SubShapeAllSortedCentres
[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
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.AdvOp    = None
661               self.FieldOp  = None
662             pass
663
664         ## Process object publication in the study, as follows:
665         #  - if @a theName is specified (not None), the object is published in the study
666         #    with this name, not taking into account "auto-publishing" option;
667         #  - if @a theName is NOT specified, the object is published in the study
668         #    (using default name, which can be customized using @a theDefaultName parameter)
669         #    only if auto-publishing is switched on.
670         #
671         #  @param theObj  object, a subject for publishing
672         #  @param theName object name for study
673         #  @param theDefaultName default name for the auto-publishing
674         #
675         #  @sa addToStudyAuto()
676         def _autoPublish(self, theObj, theName, theDefaultName="noname"):
677             # ---
678             def _item_name(_names, _defname, _idx=-1):
679                 if not _names: _names = _defname
680                 if type(_names) in [types.ListType, types.TupleType]:
681                     if _idx >= 0:
682                         if _idx >= len(_names) or not _names[_idx]:
683                             if type(_defname) not in [types.ListType, types.TupleType]:
684                                 _name = "%s_%d"%(_defname, _idx+1)
685                             elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
686                                 _name = _defname[_idx]
687                             else:
688                                 _name = "%noname_%d"%(dn, _idx+1)
689                             pass
690                         else:
691                             _name = _names[_idx]
692                         pass
693                     else:
694                         # must be wrong  usage
695                         _name = _names[0]
696                     pass
697                 else:
698                     if _idx >= 0:
699                         _name = "%s_%d"%(_names, _idx+1)
700                     else:
701                         _name = _names
702                     pass
703                 return _name
704             # ---
705             def _publish( _name, _obj ):
706                 fatherObj = None
707                 if isinstance( _obj, GEOM._objref_GEOM_Field ):
708                     fatherObj = _obj.GetShape()
709                 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
710                     fatherObj = _obj.GetField()
711                 elif not _obj.IsMainShape():
712                     fatherObj = _obj.GetMainShape()
713                     pass
714                 if fatherObj and fatherObj.GetStudyEntry():
715                     self.addToStudyInFather(fatherObj, _obj, _name)
716                 else:
717                     self.addToStudy(_obj, _name)
718                     pass
719                 return
720             # ---
721             if not theObj:
722                 return # null object
723             if not theName and not self.myMaxNbSubShapesAllowed:
724                 return # nothing to do: auto-publishing is disabled
725             if not theName and not theDefaultName:
726                 return # neither theName nor theDefaultName is given
727             import types
728             if type(theObj) in [types.ListType, types.TupleType]:
729                 # list of objects is being published
730                 idx = 0
731                 for obj in theObj:
732                     if not obj: continue # bad object
733                     name = _item_name(theName, theDefaultName, idx)
734                     _publish( name, obj )
735                     idx = idx+1
736                     if not theName and idx == self.myMaxNbSubShapesAllowed: break
737                     pass
738                 pass
739             else:
740                 # single object is published
741                 name = _item_name(theName, theDefaultName)
742                 _publish( name, theObj )
743             pass
744
745         ## @addtogroup l1_geomBuilder_auxiliary
746         ## @{
747         def init_geom(self,theStudy):
748             self.myStudy = theStudy
749             self.myStudyId = self.myStudy._get_StudyId()
750             self.myBuilder = self.myStudy.NewBuilder()
751             self.father = self.myStudy.FindComponent("GEOM")
752             notebook.myStudy = theStudy
753             if self.father is None:
754                 self.father = self.myBuilder.NewComponent("GEOM")
755                 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
756                 FName = A1._narrow(SALOMEDS.AttributeName)
757                 FName.SetValue("Geometry")
758                 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
759                 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
760                 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
761                 self.myBuilder.DefineComponentInstance(self.father,self)
762                 pass
763             self.BasicOp  = self.GetIBasicOperations    (self.myStudyId)
764             self.CurvesOp = self.GetICurvesOperations   (self.myStudyId)
765             self.PrimOp   = self.GetI3DPrimOperations   (self.myStudyId)
766             self.ShapesOp = self.GetIShapesOperations   (self.myStudyId)
767             self.HealOp   = self.GetIHealingOperations  (self.myStudyId)
768             self.InsertOp = self.GetIInsertOperations   (self.myStudyId)
769             self.BoolOp   = self.GetIBooleanOperations  (self.myStudyId)
770             self.TrsfOp   = self.GetITransformOperations(self.myStudyId)
771             self.LocalOp  = self.GetILocalOperations    (self.myStudyId)
772             self.MeasuOp  = self.GetIMeasureOperations  (self.myStudyId)
773             self.BlocksOp = self.GetIBlocksOperations   (self.myStudyId)
774             self.GroupOp  = self.GetIGroupOperations    (self.myStudyId)
775             self.FieldOp  = self.GetIFieldOperations    (self.myStudyId)
776
777             # The below line is a right way to map all plugin functions to geomBuilder,
778             # but AdvancedOperations are already mapped, that is why this line is commented
779             # and presents here only as an axample
780             #self.AdvOp    = self.GetPluginOperations (self.myStudyId, "AdvancedEngine")
781
782             # self.AdvOp is used by functions MakePipeTShape*, MakeDividedDisk, etc.
783             self.AdvOp = GEOM._objref_GEOM_Gen.GetPluginOperations (self, self.myStudyId, "AdvancedEngine")
784
785             # set GEOM as root in the use case tree
786             self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
787             self.myUseCaseBuilder.SetRootCurrent()
788             self.myUseCaseBuilder.Append(self.father)
789             pass
790
791         def GetPluginOperations(self, studyID, libraryName):
792             op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
793             if op:
794                 # bind methods of operations to self
795                 methods = op.__class__.__dict__['__methods__']
796                 avoid_methods = self.BasicOp.__class__.__dict__['__methods__']
797                 for meth_name in methods:
798                     if not meth_name in avoid_methods: # avoid basic methods
799                         function = getattr(op.__class__, meth_name)
800                         if callable(function):
801                             #self.__dict__[meth_name] = self.__PluginOperation(op, function)
802                             self.__dict__[meth_name] = PluginOperation(op, function)
803             return op
804
805         ## Enable / disable results auto-publishing
806         #
807         #  The automatic publishing is managed in the following way:
808         #  - if @a maxNbSubShapes = 0, automatic publishing is disabled.
809         #  - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
810         #  maximum number of sub-shapes allowed for publishing is unlimited; any negative
811         #  value passed as parameter has the same effect.
812         #  - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
813         #  maximum number of sub-shapes allowed for publishing is set to specified value.
814         #
815         #  @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
816         #  @ingroup l1_publish_data
817         def addToStudyAuto(self, maxNbSubShapes=-1):
818             """
819             Enable / disable results auto-publishing
820
821             The automatic publishing is managed in the following way:
822             - if @a maxNbSubShapes = 0, automatic publishing is disabled;
823             - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
824             maximum number of sub-shapes allowed for publishing is unlimited; any negative
825             value passed as parameter has the same effect.
826             - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
827             maximum number of sub-shapes allowed for publishing is set to this value.
828
829             Parameters:
830                 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
831
832             Example of usage:
833                 geompy.addToStudyAuto()   # enable auto-publishing
834                 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
835                 geompy.addToStudyAuto(0)  # disable auto-publishing
836             """
837             self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
838             pass
839
840         ## Dump component to the Python script
841         #  This method overrides IDL function to allow default values for the parameters.
842         def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
843             """
844             Dump component to the Python script
845             This method overrides IDL function to allow default values for the parameters.
846             """
847             return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
848
849         ## Get name for sub-shape aSubObj of shape aMainObj
850         #
851         # @ref swig_SubShapeName "Example"
852         @ManageTransactions("ShapesOp")
853         def SubShapeName(self,aSubObj, aMainObj):
854             """
855             Get name for sub-shape aSubObj of shape aMainObj
856             """
857             # Example: see GEOM_TestAll.py
858
859             #aSubId  = orb.object_to_string(aSubObj)
860             #aMainId = orb.object_to_string(aMainObj)
861             #index = gg.getIndexTopology(aSubId, aMainId)
862             #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
863             index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
864             name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
865             return name
866
867         ## Publish in study aShape with name aName
868         #
869         #  \param aShape the shape to be published
870         #  \param aName  the name for the shape
871         #  \param doRestoreSubShapes if True, finds and publishes also
872         #         sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
873         #         and published sub-shapes of arguments
874         #  \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
875         #                                                  these arguments description
876         #  \return study entry of the published shape in form of string
877         #
878         #  @ingroup l1_publish_data
879         #  @ref swig_all_addtostudy "Example"
880         def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
881                        theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
882             """
883             Publish in study aShape with name aName
884
885             Parameters:
886                 aShape the shape to be published
887                 aName  the name for the shape
888                 doRestoreSubShapes if True, finds and publishes also
889                                    sub-shapes of aShape, corresponding to its arguments
890                                    and published sub-shapes of arguments
891                 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
892                                                          these arguments description
893
894             Returns:
895                 study entry of the published shape in form of string
896
897             Example of usage:
898                 id_block1 = geompy.addToStudy(Block1, "Block 1")
899             """
900             # Example: see GEOM_TestAll.py
901             try:
902                 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
903                 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
904                 if doRestoreSubShapes:
905                     self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
906                                             theFindMethod, theInheritFirstArg, True )
907             except:
908                 print "addToStudy() failed"
909                 return ""
910             return aShape.GetStudyEntry()
911
912         ## Publish in study aShape with name aName as sub-object of previously published aFather
913         #  \param aFather previously published object
914         #  \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
915         #  \param aName  the name for the shape
916         #
917         #  \return study entry of the published shape in form of string
918         #
919         #  @ingroup l1_publish_data
920         #  @ref swig_all_addtostudyInFather "Example"
921         def addToStudyInFather(self, aFather, aShape, aName):
922             """
923             Publish in study aShape with name aName as sub-object of previously published aFather
924
925             Parameters:
926                 aFather previously published object
927                 aShape the shape to be published as sub-object of aFather
928                 aName  the name for the shape
929
930             Returns:
931                 study entry of the published shape in form of string
932             """
933             # Example: see GEOM_TestAll.py
934             try:
935                 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
936                 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
937             except:
938                 print "addToStudyInFather() failed"
939                 return ""
940             return aShape.GetStudyEntry()
941
942         ## Unpublish object in study
943         #
944         #  \param obj the object to be unpublished
945         def hideInStudy(self, obj):
946             """
947             Unpublish object in study
948
949             Parameters:
950                 obj the object to be unpublished
951             """
952             ior = salome.orb.object_to_string(obj)
953             aSObject = self.myStudy.FindObjectIOR(ior)
954             if aSObject is not None:
955                 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
956                 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
957                 drwAttribute.SetDrawable(False)
958                 pass
959
960         # end of l1_geomBuilder_auxiliary
961         ## @}
962
963         ## @addtogroup l3_restore_ss
964         ## @{
965
966         ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
967         #  To be used from python scripts out of addToStudy() (non-default usage)
968         #  \param theObject published GEOM.GEOM_Object, arguments of which will be published
969         #  \param theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
970         #                   If this list is empty, all operation arguments will be published
971         #  \param theFindMethod method to search sub-shapes, corresponding to arguments and
972         #                       their sub-shapes. Value from enumeration GEOM.find_shape_method.
973         #  \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
974         #                            Do not publish sub-shapes in place of arguments, but only
975         #                            in place of sub-shapes of the first argument,
976         #                            because the whole shape corresponds to the first argument.
977         #                            Mainly to be used after transformations, but it also can be
978         #                            usefull after partition with one object shape, and some other
979         #                            operations, where only the first argument has to be considered.
980         #                            If theObject has only one argument shape, this flag is automatically
981         #                            considered as True, not regarding really passed value.
982         #  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
983         #                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
984         #  \return list of published sub-shapes
985         #
986         #  @ref tui_restore_prs_params "Example"
987         def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
988                               theInheritFirstArg=False, theAddPrefix=True):
989             """
990             Publish sub-shapes, standing for arguments and sub-shapes of arguments
991             To be used from python scripts out of geompy.addToStudy (non-default usage)
992
993             Parameters:
994                 theObject published GEOM.GEOM_Object, arguments of which will be published
995                 theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
996                           If this list is empty, all operation arguments will be published
997                 theFindMethod method to search sub-shapes, corresponding to arguments and
998                               their sub-shapes. Value from enumeration GEOM.find_shape_method.
999                 theInheritFirstArg set properties of the first argument for theObject.
1000                                    Do not publish sub-shapes in place of arguments, but only
1001                                    in place of sub-shapes of the first argument,
1002                                    because the whole shape corresponds to the first argument.
1003                                    Mainly to be used after transformations, but it also can be
1004                                    usefull after partition with one object shape, and some other
1005                                    operations, where only the first argument has to be considered.
1006                                    If theObject has only one argument shape, this flag is automatically
1007                                    considered as True, not regarding really passed value.
1008                 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1009                              and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1010             Returns:
1011                 list of published sub-shapes
1012             """
1013             # Example: see GEOM_TestAll.py
1014             return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
1015                                           theFindMethod, theInheritFirstArg, theAddPrefix)
1016
1017         ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1018         #  To be used from python scripts out of addToStudy() (non-default usage)
1019         #  \param theObject published GEOM.GEOM_Object, arguments of which will be published
1020         #  \param theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
1021         #                   If this list is empty, all operation arguments will be published
1022         #  \param theFindMethod method to search sub-shapes, corresponding to arguments and
1023         #                       their sub-shapes. Value from enumeration GEOM::find_shape_method.
1024         #  \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1025         #                            Do not publish sub-shapes in place of arguments, but only
1026         #                            in place of sub-shapes of the first argument,
1027         #                            because the whole shape corresponds to the first argument.
1028         #                            Mainly to be used after transformations, but it also can be
1029         #                            usefull after partition with one object shape, and some other
1030         #                            operations, where only the first argument has to be considered.
1031         #                            If theObject has only one argument shape, this flag is automatically
1032         #                            considered as True, not regarding really passed value.
1033         #  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1034         #                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1035         #  \return list of published sub-shapes
1036         #
1037         #  @ref tui_restore_prs_params "Example"
1038         def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1039                                    theInheritFirstArg=False, theAddPrefix=True):
1040             """
1041             Publish sub-shapes, standing for arguments and sub-shapes of arguments
1042             To be used from python scripts out of geompy.addToStudy() (non-default usage)
1043
1044             Parameters:
1045                 theObject published GEOM.GEOM_Object, arguments of which will be published
1046                 theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
1047                           If this list is empty, all operation arguments will be published
1048                 theFindMethod method to search sub-shapes, corresponding to arguments and
1049                               their sub-shapes. Value from enumeration GEOM::find_shape_method.
1050                 theInheritFirstArg set properties of the first argument for theObject.
1051                                    Do not publish sub-shapes in place of arguments, but only
1052                                    in place of sub-shapes of the first argument,
1053                                    because the whole shape corresponds to the first argument.
1054                                    Mainly to be used after transformations, but it also can be
1055                                    usefull after partition with one object shape, and some other
1056                                    operations, where only the first argument has to be considered.
1057                                    If theObject has only one argument shape, this flag is automatically
1058                                    considered as True, not regarding really passed value.
1059                 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1060                              and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1061
1062             Returns:
1063                 list of published sub-shapes
1064             """
1065             # Example: see GEOM_TestAll.py
1066             return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1067                                                theFindMethod, theInheritFirstArg, theAddPrefix)
1068
1069         # end of l3_restore_ss
1070         ## @}
1071
1072         ## @addtogroup l3_basic_go
1073         ## @{
1074
1075         ## Create point by three coordinates.
1076         #  @param theX The X coordinate of the point.
1077         #  @param theY The Y coordinate of the point.
1078         #  @param theZ The Z coordinate of the point.
1079         #  @param theName Object name; when specified, this parameter is used
1080         #         for result publication in the study. Otherwise, if automatic
1081         #         publication is switched on, default value is used for result name.
1082         #
1083         #  @return New GEOM.GEOM_Object, containing the created point.
1084         #
1085         #  @ref tui_creation_point "Example"
1086         @ManageTransactions("BasicOp")
1087         def MakeVertex(self, theX, theY, theZ, theName=None):
1088             """
1089             Create point by three coordinates.
1090
1091             Parameters:
1092                 theX The X coordinate of the point.
1093                 theY The Y coordinate of the point.
1094                 theZ The Z coordinate of the point.
1095                 theName Object name; when specified, this parameter is used
1096                         for result publication in the study. Otherwise, if automatic
1097                         publication is switched on, default value is used for result name.
1098
1099             Returns:
1100                 New GEOM.GEOM_Object, containing the created point.
1101             """
1102             # Example: see GEOM_TestAll.py
1103             theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1104             anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1105             RaiseIfFailed("MakePointXYZ", self.BasicOp)
1106             anObj.SetParameters(Parameters)
1107             self._autoPublish(anObj, theName, "vertex")
1108             return anObj
1109
1110         ## Create a point, distant from the referenced point
1111         #  on the given distances along the coordinate axes.
1112         #  @param theReference The referenced point.
1113         #  @param theX Displacement from the referenced point along OX axis.
1114         #  @param theY Displacement from the referenced point along OY axis.
1115         #  @param theZ Displacement from the referenced point along OZ axis.
1116         #  @param theName Object name; when specified, this parameter is used
1117         #         for result publication in the study. Otherwise, if automatic
1118         #         publication is switched on, default value is used for result name.
1119         #
1120         #  @return New GEOM.GEOM_Object, containing the created point.
1121         #
1122         #  @ref tui_creation_point "Example"
1123         @ManageTransactions("BasicOp")
1124         def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1125             """
1126             Create a point, distant from the referenced point
1127             on the given distances along the coordinate axes.
1128
1129             Parameters:
1130                 theReference The referenced point.
1131                 theX Displacement from the referenced point along OX axis.
1132                 theY Displacement from the referenced point along OY axis.
1133                 theZ Displacement from the referenced point along OZ axis.
1134                 theName Object name; when specified, this parameter is used
1135                         for result publication in the study. Otherwise, if automatic
1136                         publication is switched on, default value is used for result name.
1137
1138             Returns:
1139                 New GEOM.GEOM_Object, containing the created point.
1140             """
1141             # Example: see GEOM_TestAll.py
1142             theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1143             anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1144             RaiseIfFailed("MakePointWithReference", self.BasicOp)
1145             anObj.SetParameters(Parameters)
1146             self._autoPublish(anObj, theName, "vertex")
1147             return anObj
1148
1149         ## Create a point, corresponding to the given parameter on the given curve.
1150         #  @param theRefCurve The referenced curve.
1151         #  @param theParameter Value of parameter on the referenced curve.
1152         #  @param theName Object name; when specified, this parameter is used
1153         #         for result publication in the study. Otherwise, if automatic
1154         #         publication is switched on, default value is used for result name.
1155         #
1156         #  @return New GEOM.GEOM_Object, containing the created point.
1157         #
1158         #  @ref tui_creation_point "Example"
1159         @ManageTransactions("BasicOp")
1160         def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1161             """
1162             Create a point, corresponding to the given parameter on the given curve.
1163
1164             Parameters:
1165                 theRefCurve The referenced curve.
1166                 theParameter Value of parameter on the referenced curve.
1167                 theName Object name; when specified, this parameter is used
1168                         for result publication in the study. Otherwise, if automatic
1169                         publication is switched on, default value is used for result name.
1170
1171             Returns:
1172                 New GEOM.GEOM_Object, containing the created point.
1173
1174             Example of usage:
1175                 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1176             """
1177             # Example: see GEOM_TestAll.py
1178             theParameter, Parameters = ParseParameters(theParameter)
1179             anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1180             RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1181             anObj.SetParameters(Parameters)
1182             self._autoPublish(anObj, theName, "vertex")
1183             return anObj
1184
1185         ## Create a point by projection give coordinates on the given curve
1186         #  @param theRefCurve The referenced curve.
1187         #  @param theX X-coordinate in 3D space
1188         #  @param theY Y-coordinate in 3D space
1189         #  @param theZ Z-coordinate in 3D space
1190         #  @param theName Object name; when specified, this parameter is used
1191         #         for result publication in the study. Otherwise, if automatic
1192         #         publication is switched on, default value is used for result name.
1193         #
1194         #  @return New GEOM.GEOM_Object, containing the created point.
1195         #
1196         #  @ref tui_creation_point "Example"
1197         @ManageTransactions("BasicOp")
1198         def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1199             """
1200             Create a point by projection give coordinates on the given curve
1201
1202             Parameters:
1203                 theRefCurve The referenced curve.
1204                 theX X-coordinate in 3D space
1205                 theY Y-coordinate in 3D space
1206                 theZ Z-coordinate in 3D space
1207                 theName Object name; when specified, this parameter is used
1208                         for result publication in the study. Otherwise, if automatic
1209                         publication is switched on, default value is used for result name.
1210
1211             Returns:
1212                 New GEOM.GEOM_Object, containing the created point.
1213
1214             Example of usage:
1215                 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1216             """
1217             # Example: see GEOM_TestAll.py
1218             theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1219             anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1220             RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1221             anObj.SetParameters(Parameters)
1222             self._autoPublish(anObj, theName, "vertex")
1223             return anObj
1224
1225         ## Create a point, corresponding to the given length on the given curve.
1226         #  @param theRefCurve The referenced curve.
1227         #  @param theLength Length on the referenced curve. It can be negative.
1228         #  @param theStartPoint Point allowing to choose the direction for the calculation
1229         #                       of the length. If None, start from the first point of theRefCurve.
1230         #  @param theName Object name; when specified, this parameter is used
1231         #         for result publication in the study. Otherwise, if automatic
1232         #         publication is switched on, default value is used for result name.
1233         #
1234         #  @return New GEOM.GEOM_Object, containing the created point.
1235         #
1236         #  @ref tui_creation_point "Example"
1237         @ManageTransactions("BasicOp")
1238         def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1239             """
1240             Create a point, corresponding to the given length on the given curve.
1241
1242             Parameters:
1243                 theRefCurve The referenced curve.
1244                 theLength Length on the referenced curve. It can be negative.
1245                 theStartPoint Point allowing to choose the direction for the calculation
1246                               of the length. If None, start from the first point of theRefCurve.
1247                 theName Object name; when specified, this parameter is used
1248                         for result publication in the study. Otherwise, if automatic
1249                         publication is switched on, default value is used for result name.
1250
1251             Returns:
1252                 New GEOM.GEOM_Object, containing the created point.
1253             """
1254             # Example: see GEOM_TestAll.py
1255             theLength, Parameters = ParseParameters(theLength)
1256             anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1257             RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1258             anObj.SetParameters(Parameters)
1259             self._autoPublish(anObj, theName, "vertex")
1260             return anObj
1261
1262         ## Create a point, corresponding to the given parameters on the
1263         #    given surface.
1264         #  @param theRefSurf The referenced surface.
1265         #  @param theUParameter Value of U-parameter on the referenced surface.
1266         #  @param theVParameter Value of V-parameter on the referenced surface.
1267         #  @param theName Object name; when specified, this parameter is used
1268         #         for result publication in the study. Otherwise, if automatic
1269         #         publication is switched on, default value is used for result name.
1270         #
1271         #  @return New GEOM.GEOM_Object, containing the created point.
1272         #
1273         #  @ref swig_MakeVertexOnSurface "Example"
1274         @ManageTransactions("BasicOp")
1275         def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1276             """
1277             Create a point, corresponding to the given parameters on the
1278             given surface.
1279
1280             Parameters:
1281                 theRefSurf The referenced surface.
1282                 theUParameter Value of U-parameter on the referenced surface.
1283                 theVParameter Value of V-parameter on the referenced surface.
1284                 theName Object name; when specified, this parameter is used
1285                         for result publication in the study. Otherwise, if automatic
1286                         publication is switched on, default value is used for result name.
1287
1288             Returns:
1289                 New GEOM.GEOM_Object, containing the created point.
1290
1291             Example of usage:
1292                 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1293             """
1294             theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1295             # Example: see GEOM_TestAll.py
1296             anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1297             RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1298             anObj.SetParameters(Parameters);
1299             self._autoPublish(anObj, theName, "vertex")
1300             return anObj
1301
1302         ## Create a point by projection give coordinates on the given surface
1303         #  @param theRefSurf The referenced surface.
1304         #  @param theX X-coordinate in 3D space
1305         #  @param theY Y-coordinate in 3D space
1306         #  @param theZ Z-coordinate in 3D space
1307         #  @param theName Object name; when specified, this parameter is used
1308         #         for result publication in the study. Otherwise, if automatic
1309         #         publication is switched on, default value is used for result name.
1310         #
1311         #  @return New GEOM.GEOM_Object, containing the created point.
1312         #
1313         #  @ref swig_MakeVertexOnSurfaceByCoord "Example"
1314         @ManageTransactions("BasicOp")
1315         def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1316             """
1317             Create a point by projection give coordinates on the given surface
1318
1319             Parameters:
1320                 theRefSurf The referenced surface.
1321                 theX X-coordinate in 3D space
1322                 theY Y-coordinate in 3D space
1323                 theZ Z-coordinate in 3D space
1324                 theName Object name; when specified, this parameter is used
1325                         for result publication in the study. Otherwise, if automatic
1326                         publication is switched on, default value is used for result name.
1327
1328             Returns:
1329                 New GEOM.GEOM_Object, containing the created point.
1330
1331             Example of usage:
1332                 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1333             """
1334             theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1335             # Example: see GEOM_TestAll.py
1336             anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1337             RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1338             anObj.SetParameters(Parameters);
1339             self._autoPublish(anObj, theName, "vertex")
1340             return anObj
1341
1342         ## Create a point, which lays on the given face.
1343         #  The point will lay in arbitrary place of the face.
1344         #  The only condition on it is a non-zero distance to the face boundary.
1345         #  Such point can be used to uniquely identify the face inside any
1346         #  shape in case, when the shape does not contain overlapped faces.
1347         #  @param theFace The referenced face.
1348         #  @param theName Object name; when specified, this parameter is used
1349         #         for result publication in the study. Otherwise, if automatic
1350         #         publication is switched on, default value is used for result name.
1351         #
1352         #  @return New GEOM.GEOM_Object, containing the created point.
1353         #
1354         #  @ref swig_MakeVertexInsideFace "Example"
1355         @ManageTransactions("BasicOp")
1356         def MakeVertexInsideFace (self, theFace, theName=None):
1357             """
1358             Create a point, which lays on the given face.
1359             The point will lay in arbitrary place of the face.
1360             The only condition on it is a non-zero distance to the face boundary.
1361             Such point can be used to uniquely identify the face inside any
1362             shape in case, when the shape does not contain overlapped faces.
1363
1364             Parameters:
1365                 theFace The referenced face.
1366                 theName Object name; when specified, this parameter is used
1367                         for result publication in the study. Otherwise, if automatic
1368                         publication is switched on, default value is used for result name.
1369
1370             Returns:
1371                 New GEOM.GEOM_Object, containing the created point.
1372
1373             Example of usage:
1374                 p_on_face = geompy.MakeVertexInsideFace(Face)
1375             """
1376             # Example: see GEOM_TestAll.py
1377             anObj = self.BasicOp.MakePointOnFace(theFace)
1378             RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1379             self._autoPublish(anObj, theName, "vertex")
1380             return anObj
1381
1382         ## Create a point on intersection of two lines.
1383         #  @param theRefLine1, theRefLine2 The referenced lines.
1384         #  @param theName Object name; when specified, this parameter is used
1385         #         for result publication in the study. Otherwise, if automatic
1386         #         publication is switched on, default value is used for result name.
1387         #
1388         #  @return New GEOM.GEOM_Object, containing the created point.
1389         #
1390         #  @ref swig_MakeVertexOnLinesIntersection "Example"
1391         @ManageTransactions("BasicOp")
1392         def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1393             """
1394             Create a point on intersection of two lines.
1395
1396             Parameters:
1397                 theRefLine1, theRefLine2 The referenced lines.
1398                 theName Object name; when specified, this parameter is used
1399                         for result publication in the study. Otherwise, if automatic
1400                         publication is switched on, default value is used for result name.
1401
1402             Returns:
1403                 New GEOM.GEOM_Object, containing the created point.
1404             """
1405             # Example: see GEOM_TestAll.py
1406             anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1407             RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1408             self._autoPublish(anObj, theName, "vertex")
1409             return anObj
1410
1411         ## Create a tangent, corresponding to the given parameter on the given curve.
1412         #  @param theRefCurve The referenced curve.
1413         #  @param theParameter Value of parameter on the referenced curve.
1414         #  @param theName Object name; when specified, this parameter is used
1415         #         for result publication in the study. Otherwise, if automatic
1416         #         publication is switched on, default value is used for result name.
1417         #
1418         #  @return New GEOM.GEOM_Object, containing the created tangent.
1419         #
1420         #  @ref swig_MakeTangentOnCurve "Example"
1421         @ManageTransactions("BasicOp")
1422         def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1423             """
1424             Create a tangent, corresponding to the given parameter on the given curve.
1425
1426             Parameters:
1427                 theRefCurve The referenced curve.
1428                 theParameter Value of parameter on the referenced curve.
1429                 theName Object name; when specified, this parameter is used
1430                         for result publication in the study. Otherwise, if automatic
1431                         publication is switched on, default value is used for result name.
1432
1433             Returns:
1434                 New GEOM.GEOM_Object, containing the created tangent.
1435
1436             Example of usage:
1437                 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1438             """
1439             anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1440             RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1441             self._autoPublish(anObj, theName, "tangent")
1442             return anObj
1443
1444         ## Create a tangent plane, corresponding to the given parameter on the given face.
1445         #  @param theFace The face for which tangent plane should be built.
1446         #  @param theParameterV vertical value of the center point (0.0 - 1.0).
1447         #  @param theParameterU horisontal value of the center point (0.0 - 1.0).
1448         #  @param theTrimSize the size of plane.
1449         #  @param theName Object name; when specified, this parameter is used
1450         #         for result publication in the study. Otherwise, if automatic
1451         #         publication is switched on, default value is used for result name.
1452         #
1453         #  @return New GEOM.GEOM_Object, containing the created tangent.
1454         #
1455         #  @ref swig_MakeTangentPlaneOnFace "Example"
1456         @ManageTransactions("BasicOp")
1457         def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1458             """
1459             Create a tangent plane, corresponding to the given parameter on the given face.
1460
1461             Parameters:
1462                 theFace The face for which tangent plane should be built.
1463                 theParameterV vertical value of the center point (0.0 - 1.0).
1464                 theParameterU horisontal value of the center point (0.0 - 1.0).
1465                 theTrimSize the size of plane.
1466                 theName Object name; when specified, this parameter is used
1467                         for result publication in the study. Otherwise, if automatic
1468                         publication is switched on, default value is used for result name.
1469
1470            Returns:
1471                 New GEOM.GEOM_Object, containing the created tangent.
1472
1473            Example of usage:
1474                 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1475             """
1476             anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1477             RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1478             self._autoPublish(anObj, theName, "tangent")
1479             return anObj
1480
1481         ## Create a vector with the given components.
1482         #  @param theDX X component of the vector.
1483         #  @param theDY Y component of the vector.
1484         #  @param theDZ Z component of the vector.
1485         #  @param theName Object name; when specified, this parameter is used
1486         #         for result publication in the study. Otherwise, if automatic
1487         #         publication is switched on, default value is used for result name.
1488         #
1489         #  @return New GEOM.GEOM_Object, containing the created vector.
1490         #
1491         #  @ref tui_creation_vector "Example"
1492         @ManageTransactions("BasicOp")
1493         def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1494             """
1495             Create a vector with the given components.
1496
1497             Parameters:
1498                 theDX X component of the vector.
1499                 theDY Y component of the vector.
1500                 theDZ Z component of the vector.
1501                 theName Object name; when specified, this parameter is used
1502                         for result publication in the study. Otherwise, if automatic
1503                         publication is switched on, default value is used for result name.
1504
1505             Returns:
1506                 New GEOM.GEOM_Object, containing the created vector.
1507             """
1508             # Example: see GEOM_TestAll.py
1509             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1510             anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1511             RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1512             anObj.SetParameters(Parameters)
1513             self._autoPublish(anObj, theName, "vector")
1514             return anObj
1515
1516         ## Create a vector between two points.
1517         #  @param thePnt1 Start point for the vector.
1518         #  @param thePnt2 End point for the vector.
1519         #  @param theName Object name; when specified, this parameter is used
1520         #         for result publication in the study. Otherwise, if automatic
1521         #         publication is switched on, default value is used for result name.
1522         #
1523         #  @return New GEOM.GEOM_Object, containing the created vector.
1524         #
1525         #  @ref tui_creation_vector "Example"
1526         @ManageTransactions("BasicOp")
1527         def MakeVector(self, thePnt1, thePnt2, theName=None):
1528             """
1529             Create a vector between two points.
1530
1531             Parameters:
1532                 thePnt1 Start point for the vector.
1533                 thePnt2 End point for the vector.
1534                 theName Object name; when specified, this parameter is used
1535                         for result publication in the study. Otherwise, if automatic
1536                         publication is switched on, default value is used for result name.
1537
1538             Returns:
1539                 New GEOM.GEOM_Object, containing the created vector.
1540             """
1541             # Example: see GEOM_TestAll.py
1542             anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1543             RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1544             self._autoPublish(anObj, theName, "vector")
1545             return anObj
1546
1547         ## Create a line, passing through the given point
1548         #  and parrallel to the given direction
1549         #  @param thePnt Point. The resulting line will pass through it.
1550         #  @param theDir Direction. The resulting line will be parallel to it.
1551         #  @param theName Object name; when specified, this parameter is used
1552         #         for result publication in the study. Otherwise, if automatic
1553         #         publication is switched on, default value is used for result name.
1554         #
1555         #  @return New GEOM.GEOM_Object, containing the created line.
1556         #
1557         #  @ref tui_creation_line "Example"
1558         @ManageTransactions("BasicOp")
1559         def MakeLine(self, thePnt, theDir, theName=None):
1560             """
1561             Create a line, passing through the given point
1562             and parrallel to the given direction
1563
1564             Parameters:
1565                 thePnt Point. The resulting line will pass through it.
1566                 theDir Direction. The resulting line will be parallel to it.
1567                 theName Object name; when specified, this parameter is used
1568                         for result publication in the study. Otherwise, if automatic
1569                         publication is switched on, default value is used for result name.
1570
1571             Returns:
1572                 New GEOM.GEOM_Object, containing the created line.
1573             """
1574             # Example: see GEOM_TestAll.py
1575             anObj = self.BasicOp.MakeLine(thePnt, theDir)
1576             RaiseIfFailed("MakeLine", self.BasicOp)
1577             self._autoPublish(anObj, theName, "line")
1578             return anObj
1579
1580         ## Create a line, passing through the given points
1581         #  @param thePnt1 First of two points, defining the line.
1582         #  @param thePnt2 Second of two points, defining the line.
1583         #  @param theName Object name; when specified, this parameter is used
1584         #         for result publication in the study. Otherwise, if automatic
1585         #         publication is switched on, default value is used for result name.
1586         #
1587         #  @return New GEOM.GEOM_Object, containing the created line.
1588         #
1589         #  @ref tui_creation_line "Example"
1590         @ManageTransactions("BasicOp")
1591         def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1592             """
1593             Create a line, passing through the given points
1594
1595             Parameters:
1596                 thePnt1 First of two points, defining the line.
1597                 thePnt2 Second of two points, defining the line.
1598                 theName Object name; when specified, this parameter is used
1599                         for result publication in the study. Otherwise, if automatic
1600                         publication is switched on, default value is used for result name.
1601
1602             Returns:
1603                 New GEOM.GEOM_Object, containing the created line.
1604             """
1605             # Example: see GEOM_TestAll.py
1606             anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1607             RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1608             self._autoPublish(anObj, theName, "line")
1609             return anObj
1610
1611         ## Create a line on two faces intersection.
1612         #  @param theFace1 First of two faces, defining the line.
1613         #  @param theFace2 Second of two faces, defining the line.
1614         #  @param theName Object name; when specified, this parameter is used
1615         #         for result publication in the study. Otherwise, if automatic
1616         #         publication is switched on, default value is used for result name.
1617         #
1618         #  @return New GEOM.GEOM_Object, containing the created line.
1619         #
1620         #  @ref swig_MakeLineTwoFaces "Example"
1621         @ManageTransactions("BasicOp")
1622         def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1623             """
1624             Create a line on two faces intersection.
1625
1626             Parameters:
1627                 theFace1 First of two faces, defining the line.
1628                 theFace2 Second of two faces, defining the line.
1629                 theName Object name; when specified, this parameter is used
1630                         for result publication in the study. Otherwise, if automatic
1631                         publication is switched on, default value is used for result name.
1632
1633             Returns:
1634                 New GEOM.GEOM_Object, containing the created line.
1635             """
1636             # Example: see GEOM_TestAll.py
1637             anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1638             RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1639             self._autoPublish(anObj, theName, "line")
1640             return anObj
1641
1642         ## Create a plane, passing through the given point
1643         #  and normal to the given vector.
1644         #  @param thePnt Point, the plane has to pass through.
1645         #  @param theVec Vector, defining the plane normal direction.
1646         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1647         #  @param theName Object name; when specified, this parameter is used
1648         #         for result publication in the study. Otherwise, if automatic
1649         #         publication is switched on, default value is used for result name.
1650         #
1651         #  @return New GEOM.GEOM_Object, containing the created plane.
1652         #
1653         #  @ref tui_creation_plane "Example"
1654         @ManageTransactions("BasicOp")
1655         def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1656             """
1657             Create a plane, passing through the given point
1658             and normal to the given vector.
1659
1660             Parameters:
1661                 thePnt Point, the plane has to pass through.
1662                 theVec Vector, defining the plane normal direction.
1663                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1664                 theName Object name; when specified, this parameter is used
1665                         for result publication in the study. Otherwise, if automatic
1666                         publication is switched on, default value is used for result name.
1667
1668             Returns:
1669                 New GEOM.GEOM_Object, containing the created plane.
1670             """
1671             # Example: see GEOM_TestAll.py
1672             theTrimSize, Parameters = ParseParameters(theTrimSize);
1673             anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1674             RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1675             anObj.SetParameters(Parameters)
1676             self._autoPublish(anObj, theName, "plane")
1677             return anObj
1678
1679         ## Create a plane, passing through the three given points
1680         #  @param thePnt1 First of three points, defining the plane.
1681         #  @param thePnt2 Second of three points, defining the plane.
1682         #  @param thePnt3 Fird of three points, defining the plane.
1683         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1684         #  @param theName Object name; when specified, this parameter is used
1685         #         for result publication in the study. Otherwise, if automatic
1686         #         publication is switched on, default value is used for result name.
1687         #
1688         #  @return New GEOM.GEOM_Object, containing the created plane.
1689         #
1690         #  @ref tui_creation_plane "Example"
1691         @ManageTransactions("BasicOp")
1692         def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1693             """
1694             Create a plane, passing through the three given points
1695
1696             Parameters:
1697                 thePnt1 First of three points, defining the plane.
1698                 thePnt2 Second of three points, defining the plane.
1699                 thePnt3 Fird of three points, defining the plane.
1700                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1701                 theName Object name; when specified, this parameter is used
1702                         for result publication in the study. Otherwise, if automatic
1703                         publication is switched on, default value is used for result name.
1704
1705             Returns:
1706                 New GEOM.GEOM_Object, containing the created plane.
1707             """
1708             # Example: see GEOM_TestAll.py
1709             theTrimSize, Parameters = ParseParameters(theTrimSize);
1710             anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1711             RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1712             anObj.SetParameters(Parameters)
1713             self._autoPublish(anObj, theName, "plane")
1714             return anObj
1715
1716         ## Create a plane, similar to the existing one, but with another size of representing face.
1717         #  @param theFace Referenced plane or LCS(Marker).
1718         #  @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1719         #  @param theName Object name; when specified, this parameter is used
1720         #         for result publication in the study. Otherwise, if automatic
1721         #         publication is switched on, default value is used for result name.
1722         #
1723         #  @return New GEOM.GEOM_Object, containing the created plane.
1724         #
1725         #  @ref tui_creation_plane "Example"
1726         @ManageTransactions("BasicOp")
1727         def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1728             """
1729             Create a plane, similar to the existing one, but with another size of representing face.
1730
1731             Parameters:
1732                 theFace Referenced plane or LCS(Marker).
1733                 theTrimSize New half size of a side of quadrangle face, representing the plane.
1734                 theName Object name; when specified, this parameter is used
1735                         for result publication in the study. Otherwise, if automatic
1736                         publication is switched on, default value is used for result name.
1737
1738             Returns:
1739                 New GEOM.GEOM_Object, containing the created plane.
1740             """
1741             # Example: see GEOM_TestAll.py
1742             theTrimSize, Parameters = ParseParameters(theTrimSize);
1743             anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1744             RaiseIfFailed("MakePlaneFace", self.BasicOp)
1745             anObj.SetParameters(Parameters)
1746             self._autoPublish(anObj, theName, "plane")
1747             return anObj
1748
1749         ## Create a plane, passing through the 2 vectors
1750         #  with center in a start point of the first vector.
1751         #  @param theVec1 Vector, defining center point and plane direction.
1752         #  @param theVec2 Vector, defining the plane normal direction.
1753         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1754         #  @param theName Object name; when specified, this parameter is used
1755         #         for result publication in the study. Otherwise, if automatic
1756         #         publication is switched on, default value is used for result name.
1757         #
1758         #  @return New GEOM.GEOM_Object, containing the created plane.
1759         #
1760         #  @ref tui_creation_plane "Example"
1761         @ManageTransactions("BasicOp")
1762         def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1763             """
1764             Create a plane, passing through the 2 vectors
1765             with center in a start point of the first vector.
1766
1767             Parameters:
1768                 theVec1 Vector, defining center point and plane direction.
1769                 theVec2 Vector, defining the plane normal direction.
1770                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1771                 theName Object name; when specified, this parameter is used
1772                         for result publication in the study. Otherwise, if automatic
1773                         publication is switched on, default value is used for result name.
1774
1775             Returns:
1776                 New GEOM.GEOM_Object, containing the created plane.
1777             """
1778             # Example: see GEOM_TestAll.py
1779             theTrimSize, Parameters = ParseParameters(theTrimSize);
1780             anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1781             RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1782             anObj.SetParameters(Parameters)
1783             self._autoPublish(anObj, theName, "plane")
1784             return anObj
1785
1786         ## Create a plane, based on a Local coordinate system.
1787         #  @param theLCS  coordinate system, defining plane.
1788         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1789         #  @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1790         #  @param theName Object name; when specified, this parameter is used
1791         #         for result publication in the study. Otherwise, if automatic
1792         #         publication is switched on, default value is used for result name.
1793         #
1794         #  @return New GEOM.GEOM_Object, containing the created plane.
1795         #
1796         #  @ref tui_creation_plane "Example"
1797         @ManageTransactions("BasicOp")
1798         def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1799             """
1800             Create a plane, based on a Local coordinate system.
1801
1802            Parameters:
1803                 theLCS  coordinate system, defining plane.
1804                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1805                 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1806                 theName Object name; when specified, this parameter is used
1807                         for result publication in the study. Otherwise, if automatic
1808                         publication is switched on, default value is used for result name.
1809
1810             Returns:
1811                 New GEOM.GEOM_Object, containing the created plane.
1812             """
1813             # Example: see GEOM_TestAll.py
1814             theTrimSize, Parameters = ParseParameters(theTrimSize);
1815             anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1816             RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1817             anObj.SetParameters(Parameters)
1818             self._autoPublish(anObj, theName, "plane")
1819             return anObj
1820
1821         ## Create a local coordinate system.
1822         #  @param OX,OY,OZ Three coordinates of coordinate system origin.
1823         #  @param XDX,XDY,XDZ Three components of OX direction
1824         #  @param YDX,YDY,YDZ Three components of OY direction
1825         #  @param theName Object name; when specified, this parameter is used
1826         #         for result publication in the study. Otherwise, if automatic
1827         #         publication is switched on, default value is used for result name.
1828         #
1829         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1830         #
1831         #  @ref swig_MakeMarker "Example"
1832         @ManageTransactions("BasicOp")
1833         def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1834             """
1835             Create a local coordinate system.
1836
1837             Parameters:
1838                 OX,OY,OZ Three coordinates of coordinate system origin.
1839                 XDX,XDY,XDZ Three components of OX direction
1840                 YDX,YDY,YDZ Three components of OY direction
1841                 theName Object name; when specified, this parameter is used
1842                         for result publication in the study. Otherwise, if automatic
1843                         publication is switched on, default value is used for result name.
1844
1845             Returns:
1846                 New GEOM.GEOM_Object, containing the created coordinate system.
1847             """
1848             # Example: see GEOM_TestAll.py
1849             OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1850             anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1851             RaiseIfFailed("MakeMarker", self.BasicOp)
1852             anObj.SetParameters(Parameters)
1853             self._autoPublish(anObj, theName, "lcs")
1854             return anObj
1855
1856         ## Create a local coordinate system from shape.
1857         #  @param theShape The initial shape to detect the coordinate system.
1858         #  @param theName Object name; when specified, this parameter is used
1859         #         for result publication in the study. Otherwise, if automatic
1860         #         publication is switched on, default value is used for result name.
1861         #
1862         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1863         #
1864         #  @ref tui_creation_lcs "Example"
1865         @ManageTransactions("BasicOp")
1866         def MakeMarkerFromShape(self, theShape, theName=None):
1867             """
1868             Create a local coordinate system from shape.
1869
1870             Parameters:
1871                 theShape The initial shape to detect the coordinate system.
1872                 theName Object name; when specified, this parameter is used
1873                         for result publication in the study. Otherwise, if automatic
1874                         publication is switched on, default value is used for result name.
1875
1876             Returns:
1877                 New GEOM.GEOM_Object, containing the created coordinate system.
1878             """
1879             anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1880             RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1881             self._autoPublish(anObj, theName, "lcs")
1882             return anObj
1883
1884         ## Create a local coordinate system from point and two vectors.
1885         #  @param theOrigin Point of coordinate system origin.
1886         #  @param theXVec Vector of X direction
1887         #  @param theYVec Vector of Y direction
1888         #  @param theName Object name; when specified, this parameter is used
1889         #         for result publication in the study. Otherwise, if automatic
1890         #         publication is switched on, default value is used for result name.
1891         #
1892         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1893         #
1894         #  @ref tui_creation_lcs "Example"
1895         @ManageTransactions("BasicOp")
1896         def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1897             """
1898             Create a local coordinate system from point and two vectors.
1899
1900             Parameters:
1901                 theOrigin Point of coordinate system origin.
1902                 theXVec Vector of X direction
1903                 theYVec Vector of Y direction
1904                 theName Object name; when specified, this parameter is used
1905                         for result publication in the study. Otherwise, if automatic
1906                         publication is switched on, default value is used for result name.
1907
1908             Returns:
1909                 New GEOM.GEOM_Object, containing the created coordinate system.
1910
1911             """
1912             anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1913             RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1914             self._autoPublish(anObj, theName, "lcs")
1915             return anObj
1916
1917         # end of l3_basic_go
1918         ## @}
1919
1920         ## @addtogroup l4_curves
1921         ## @{
1922
1923         ##  Create an arc of circle, passing through three given points.
1924         #  @param thePnt1 Start point of the arc.
1925         #  @param thePnt2 Middle point of the arc.
1926         #  @param thePnt3 End point of the arc.
1927         #  @param theName Object name; when specified, this parameter is used
1928         #         for result publication in the study. Otherwise, if automatic
1929         #         publication is switched on, default value is used for result name.
1930         #
1931         #  @return New GEOM.GEOM_Object, containing the created arc.
1932         #
1933         #  @ref swig_MakeArc "Example"
1934         @ManageTransactions("CurvesOp")
1935         def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1936             """
1937             Create an arc of circle, passing through three given points.
1938
1939             Parameters:
1940                 thePnt1 Start point of the arc.
1941                 thePnt2 Middle point of the arc.
1942                 thePnt3 End point of the arc.
1943                 theName Object name; when specified, this parameter is used
1944                         for result publication in the study. Otherwise, if automatic
1945                         publication is switched on, default value is used for result name.
1946
1947             Returns:
1948                 New GEOM.GEOM_Object, containing the created arc.
1949             """
1950             # Example: see GEOM_TestAll.py
1951             anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1952             RaiseIfFailed("MakeArc", self.CurvesOp)
1953             self._autoPublish(anObj, theName, "arc")
1954             return anObj
1955
1956         ##  Create an arc of circle from a center and 2 points.
1957         #  @param thePnt1 Center of the arc
1958         #  @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1959         #  @param thePnt3 End point of the arc (Gives also a direction)
1960         #  @param theSense Orientation of the arc
1961         #  @param theName Object name; when specified, this parameter is used
1962         #         for result publication in the study. Otherwise, if automatic
1963         #         publication is switched on, default value is used for result name.
1964         #
1965         #  @return New GEOM.GEOM_Object, containing the created arc.
1966         #
1967         #  @ref swig_MakeArc "Example"
1968         @ManageTransactions("CurvesOp")
1969         def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1970             """
1971             Create an arc of circle from a center and 2 points.
1972
1973             Parameters:
1974                 thePnt1 Center of the arc
1975                 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1976                 thePnt3 End point of the arc (Gives also a direction)
1977                 theSense Orientation of the arc
1978                 theName Object name; when specified, this parameter is used
1979                         for result publication in the study. Otherwise, if automatic
1980                         publication is switched on, default value is used for result name.
1981
1982             Returns:
1983                 New GEOM.GEOM_Object, containing the created arc.
1984             """
1985             # Example: see GEOM_TestAll.py
1986             anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1987             RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1988             self._autoPublish(anObj, theName, "arc")
1989             return anObj
1990
1991         ##  Create an arc of ellipse, of center and two points.
1992         #  @param theCenter Center of the arc.
1993         #  @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1994         #  @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1995         #  @param theName Object name; when specified, this parameter is used
1996         #         for result publication in the study. Otherwise, if automatic
1997         #         publication is switched on, default value is used for result name.
1998         #
1999         #  @return New GEOM.GEOM_Object, containing the created arc.
2000         #
2001         #  @ref swig_MakeArc "Example"
2002         @ManageTransactions("CurvesOp")
2003         def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2004             """
2005             Create an arc of ellipse, of center and two points.
2006
2007             Parameters:
2008                 theCenter Center of the arc.
2009                 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2010                 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2011                 theName Object name; when specified, this parameter is used
2012                         for result publication in the study. Otherwise, if automatic
2013                         publication is switched on, default value is used for result name.
2014
2015             Returns:
2016                 New GEOM.GEOM_Object, containing the created arc.
2017             """
2018             # Example: see GEOM_TestAll.py
2019             anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2020             RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2021             self._autoPublish(anObj, theName, "arc")
2022             return anObj
2023
2024         ## Create a circle with given center, normal vector and radius.
2025         #  @param thePnt Circle center.
2026         #  @param theVec Vector, normal to the plane of the circle.
2027         #  @param theR Circle radius.
2028         #  @param theName Object name; when specified, this parameter is used
2029         #         for result publication in the study. Otherwise, if automatic
2030         #         publication is switched on, default value is used for result name.
2031         #
2032         #  @return New GEOM.GEOM_Object, containing the created circle.
2033         #
2034         #  @ref tui_creation_circle "Example"
2035         @ManageTransactions("CurvesOp")
2036         def MakeCircle(self, thePnt, theVec, theR, theName=None):
2037             """
2038             Create a circle with given center, normal vector and radius.
2039
2040             Parameters:
2041                 thePnt Circle center.
2042                 theVec Vector, normal to the plane of the circle.
2043                 theR Circle radius.
2044                 theName Object name; when specified, this parameter is used
2045                         for result publication in the study. Otherwise, if automatic
2046                         publication is switched on, default value is used for result name.
2047
2048             Returns:
2049                 New GEOM.GEOM_Object, containing the created circle.
2050             """
2051             # Example: see GEOM_TestAll.py
2052             theR, Parameters = ParseParameters(theR)
2053             anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2054             RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2055             anObj.SetParameters(Parameters)
2056             self._autoPublish(anObj, theName, "circle")
2057             return anObj
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         #  @param theR Circle radius.
2063         #  @param theName Object name; when specified, this parameter is used
2064         #         for result publication in the study. Otherwise, if automatic
2065         #         publication is switched on, default value is used for result name.
2066         #
2067         #  @return New GEOM.GEOM_Object, containing the created circle.
2068         @ManageTransactions("CurvesOp")
2069         def MakeCircleR(self, theR, theName=None):
2070             """
2071             Create a circle with given radius.
2072             Center of the circle will be in the origin of global
2073             coordinate system and normal vector will be codirected with Z axis
2074
2075             Parameters:
2076                 theR Circle radius.
2077                 theName Object name; when specified, this parameter is used
2078                         for result publication in the study. Otherwise, if automatic
2079                         publication is switched on, default value is used for result name.
2080
2081             Returns:
2082                 New GEOM.GEOM_Object, containing the created circle.
2083             """
2084             anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2085             RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2086             self._autoPublish(anObj, theName, "circle")
2087             return anObj
2088
2089         ## Create a circle, passing through three given points
2090         #  @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2091         #  @param theName Object name; when specified, this parameter is used
2092         #         for result publication in the study. Otherwise, if automatic
2093         #         publication is switched on, default value is used for result name.
2094         #
2095         #  @return New GEOM.GEOM_Object, containing the created circle.
2096         #
2097         #  @ref tui_creation_circle "Example"
2098         @ManageTransactions("CurvesOp")
2099         def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2100             """
2101             Create a circle, passing through three given points
2102
2103             Parameters:
2104                 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2105                 theName Object name; when specified, this parameter is used
2106                         for result publication in the study. Otherwise, if automatic
2107                         publication is switched on, default value is used for result name.
2108
2109             Returns:
2110                 New GEOM.GEOM_Object, containing the created circle.
2111             """
2112             # Example: see GEOM_TestAll.py
2113             anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2114             RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2115             self._autoPublish(anObj, theName, "circle")
2116             return anObj
2117
2118         ## Create a circle, with given point1 as center,
2119         #  passing through the point2 as radius and laying in the plane,
2120         #  defined by all three given points.
2121         #  @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2122         #  @param theName Object name; when specified, this parameter is used
2123         #         for result publication in the study. Otherwise, if automatic
2124         #         publication is switched on, default value is used for result name.
2125         #
2126         #  @return New GEOM.GEOM_Object, containing the created circle.
2127         #
2128         #  @ref swig_MakeCircle "Example"
2129         @ManageTransactions("CurvesOp")
2130         def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2131             """
2132             Create a circle, with given point1 as center,
2133             passing through the point2 as radius and laying in the plane,
2134             defined by all three given points.
2135
2136             Parameters:
2137                 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2138                 theName Object name; when specified, this parameter is used
2139                         for result publication in the study. Otherwise, if automatic
2140                         publication is switched on, default value is used for result name.
2141
2142             Returns:
2143                 New GEOM.GEOM_Object, containing the created circle.
2144             """
2145             # Example: see GEOM_example6.py
2146             anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2147             RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2148             self._autoPublish(anObj, theName, "circle")
2149             return anObj
2150
2151         ## Create an ellipse with given center, normal vector and radiuses.
2152         #  @param thePnt Ellipse center.
2153         #  @param theVec Vector, normal to the plane of the ellipse.
2154         #  @param theRMajor Major ellipse radius.
2155         #  @param theRMinor Minor ellipse radius.
2156         #  @param theVecMaj Vector, direction of the ellipse's main axis.
2157         #  @param theName Object name; when specified, this parameter is used
2158         #         for result publication in the study. Otherwise, if automatic
2159         #         publication is switched on, default value is used for result name.
2160         #
2161         #  @return New GEOM.GEOM_Object, containing the created ellipse.
2162         #
2163         #  @ref tui_creation_ellipse "Example"
2164         @ManageTransactions("CurvesOp")
2165         def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2166             """
2167             Create an ellipse with given center, normal vector and radiuses.
2168
2169             Parameters:
2170                 thePnt Ellipse center.
2171                 theVec Vector, normal to the plane of the ellipse.
2172                 theRMajor Major ellipse radius.
2173                 theRMinor Minor ellipse radius.
2174                 theVecMaj Vector, direction of the ellipse's main axis.
2175                 theName Object name; when specified, this parameter is used
2176                         for result publication in the study. Otherwise, if automatic
2177                         publication is switched on, default value is used for result name.
2178
2179             Returns:
2180                 New GEOM.GEOM_Object, containing the created ellipse.
2181             """
2182             # Example: see GEOM_TestAll.py
2183             theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2184             if theVecMaj is not None:
2185                 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2186             else:
2187                 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2188                 pass
2189             RaiseIfFailed("MakeEllipse", self.CurvesOp)
2190             anObj.SetParameters(Parameters)
2191             self._autoPublish(anObj, theName, "ellipse")
2192             return anObj
2193
2194         ## Create an ellipse with given radiuses.
2195         #  Center of the ellipse will be in the origin of global
2196         #  coordinate system and normal vector will be codirected with Z axis
2197         #  @param theRMajor Major ellipse radius.
2198         #  @param theRMinor Minor ellipse radius.
2199         #  @param theName Object name; when specified, this parameter is used
2200         #         for result publication in the study. Otherwise, if automatic
2201         #         publication is switched on, default value is used for result name.
2202         #
2203         #  @return New GEOM.GEOM_Object, containing the created ellipse.
2204         @ManageTransactions("CurvesOp")
2205         def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2206             """
2207             Create an ellipse with given radiuses.
2208             Center of the ellipse will be in the origin of global
2209             coordinate system and normal vector will be codirected with Z axis
2210
2211             Parameters:
2212                 theRMajor Major ellipse radius.
2213                 theRMinor Minor ellipse radius.
2214                 theName Object name; when specified, this parameter is used
2215                         for result publication in the study. Otherwise, if automatic
2216                         publication is switched on, default value is used for result name.
2217
2218             Returns:
2219             New GEOM.GEOM_Object, containing the created ellipse.
2220             """
2221             anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2222             RaiseIfFailed("MakeEllipse", self.CurvesOp)
2223             self._autoPublish(anObj, theName, "ellipse")
2224             return anObj
2225
2226         ## Create a polyline on the set of points.
2227         #  @param thePoints Sequence of points for the polyline.
2228         #  @param theIsClosed If True, build a closed wire.
2229         #  @param theName Object name; when specified, this parameter is used
2230         #         for result publication in the study. Otherwise, if automatic
2231         #         publication is switched on, default value is used for result name.
2232         #
2233         #  @return New GEOM.GEOM_Object, containing the created polyline.
2234         #
2235         #  @ref tui_creation_curve "Example"
2236         @ManageTransactions("CurvesOp")
2237         def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2238             """
2239             Create a polyline on the set of points.
2240
2241             Parameters:
2242                 thePoints Sequence of points for the polyline.
2243                 theIsClosed If True, build a closed wire.
2244                 theName Object name; when specified, this parameter is used
2245                         for result publication in the study. Otherwise, if automatic
2246                         publication is switched on, default value is used for result name.
2247
2248             Returns:
2249                 New GEOM.GEOM_Object, containing the created polyline.
2250             """
2251             # Example: see GEOM_TestAll.py
2252             anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2253             RaiseIfFailed("MakePolyline", self.CurvesOp)
2254             self._autoPublish(anObj, theName, "polyline")
2255             return anObj
2256
2257         ## Create bezier curve on the set of points.
2258         #  @param thePoints Sequence of points for the bezier curve.
2259         #  @param theIsClosed If True, build a closed curve.
2260         #  @param theName Object name; when specified, this parameter is used
2261         #         for result publication in the study. Otherwise, if automatic
2262         #         publication is switched on, default value is used for result name.
2263         #
2264         #  @return New GEOM.GEOM_Object, containing the created bezier curve.
2265         #
2266         #  @ref tui_creation_curve "Example"
2267         @ManageTransactions("CurvesOp")
2268         def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2269             """
2270             Create bezier curve on the set of points.
2271
2272             Parameters:
2273                 thePoints Sequence of points for the bezier curve.
2274                 theIsClosed If True, build a closed curve.
2275                 theName Object name; when specified, this parameter is used
2276                         for result publication in the study. Otherwise, if automatic
2277                         publication is switched on, default value is used for result name.
2278
2279             Returns:
2280                 New GEOM.GEOM_Object, containing the created bezier curve.
2281             """
2282             # Example: see GEOM_TestAll.py
2283             anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2284             RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2285             self._autoPublish(anObj, theName, "bezier")
2286             return anObj
2287
2288         ## Create B-Spline curve on the set of points.
2289         #  @param thePoints Sequence of points for the B-Spline curve.
2290         #  @param theIsClosed If True, build a closed curve.
2291         #  @param theDoReordering If TRUE, the algo does not follow the order of
2292         #                         \a thePoints but searches for the closest vertex.
2293         #  @param theName Object name; when specified, this parameter is used
2294         #         for result publication in the study. Otherwise, if automatic
2295         #         publication is switched on, default value is used for result name.
2296         #
2297         #  @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2298         #
2299         #  @ref tui_creation_curve "Example"
2300         @ManageTransactions("CurvesOp")
2301         def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2302             """
2303             Create B-Spline curve on the set of points.
2304
2305             Parameters:
2306                 thePoints Sequence of points for the B-Spline curve.
2307                 theIsClosed If True, build a closed curve.
2308                 theDoReordering If True, the algo does not follow the order of
2309                                 thePoints but searches for the closest vertex.
2310                 theName Object name; when specified, this parameter is used
2311                         for result publication in the study. Otherwise, if automatic
2312                         publication is switched on, default value is used for result name.
2313
2314             Returns:
2315                 New GEOM.GEOM_Object, containing the created B-Spline curve.
2316             """
2317             # Example: see GEOM_TestAll.py
2318             anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2319             RaiseIfFailed("MakeInterpol", self.CurvesOp)
2320             self._autoPublish(anObj, theName, "bspline")
2321             return anObj
2322
2323         ## Create B-Spline curve on the set of points.
2324         #  @param thePoints Sequence of points for the B-Spline curve.
2325         #  @param theFirstVec Vector object, defining the curve direction at its first point.
2326         #  @param theLastVec Vector object, defining the curve direction at its last point.
2327         #  @param theName Object name; when specified, this parameter is used
2328         #         for result publication in the study. Otherwise, if automatic
2329         #         publication is switched on, default value is used for result name.
2330         #
2331         #  @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2332         #
2333         #  @ref tui_creation_curve "Example"
2334         @ManageTransactions("CurvesOp")
2335         def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2336             """
2337             Create B-Spline curve on the set of points.
2338
2339             Parameters:
2340                 thePoints Sequence of points for the B-Spline curve.
2341                 theFirstVec Vector object, defining the curve direction at its first point.
2342                 theLastVec Vector object, defining the curve direction at its last point.
2343                 theName Object name; when specified, this parameter is used
2344                         for result publication in the study. Otherwise, if automatic
2345                         publication is switched on, default value is used for result name.
2346
2347             Returns:
2348                 New GEOM.GEOM_Object, containing the created B-Spline curve.
2349             """
2350             # Example: see GEOM_TestAll.py
2351             anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2352             RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2353             self._autoPublish(anObj, theName, "bspline")
2354             return anObj
2355
2356         ## Creates a curve using the parametric definition of the basic points.
2357         #  @param thexExpr parametric equation of the coordinates X.
2358         #  @param theyExpr parametric equation of the coordinates Y.
2359         #  @param thezExpr parametric equation of the coordinates Z.
2360         #  @param theParamMin the minimal value of the parameter.
2361         #  @param theParamMax the maximum value of the parameter.
2362         #  @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2363         #  @param theCurveType the type of the curve,
2364         #         one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2365         #  @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.
2366         #  @param theName Object name; when specified, this parameter is used
2367         #         for result publication in the study. Otherwise, if automatic
2368         #         publication is switched on, default value is used for result name.
2369         #
2370         #  @return New GEOM.GEOM_Object, containing the created curve.
2371         #
2372         #  @ref tui_creation_curve "Example"
2373         @ManageTransactions("CurvesOp")
2374         def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2375                                 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2376             """
2377             Creates a curve using the parametric definition of the basic points.
2378
2379             Parameters:
2380                 thexExpr parametric equation of the coordinates X.
2381                 theyExpr parametric equation of the coordinates Y.
2382                 thezExpr parametric equation of the coordinates Z.
2383                 theParamMin the minimal value of the parameter.
2384                 theParamMax the maximum value of the parameter.
2385                 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2386                 theCurveType the type of the curve,
2387                              one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2388                 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2389                              method is used which can lead to a bug.
2390                 theName Object name; when specified, this parameter is used
2391                         for result publication in the study. Otherwise, if automatic
2392                         publication is switched on, default value is used for result name.
2393
2394             Returns:
2395                 New GEOM.GEOM_Object, containing the created curve.
2396             """
2397             theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2398             if theNewMethod:
2399               anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2400             else:
2401               anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2402             RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2403             anObj.SetParameters(Parameters)
2404             self._autoPublish(anObj, theName, "curve")
2405             return anObj
2406
2407         ## Create an isoline curve on a face.
2408         #  @param theFace the face for which an isoline is created.
2409         #  @param IsUIsoline True for U-isoline creation; False for V-isoline
2410         #         creation.
2411         #  @param theParameter the U parameter for U-isoline or V parameter
2412         #         for V-isoline.
2413         #  @param theName Object name; when specified, this parameter is used
2414         #         for result publication in the study. Otherwise, if automatic
2415         #         publication is switched on, default value is used for result name.
2416         #
2417         #  @return New GEOM.GEOM_Object, containing the created isoline edge or
2418         #          a compound of edges.
2419         #
2420         #  @ref tui_creation_curve "Example"
2421         @ManageTransactions("CurvesOp")
2422         def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2423             """
2424             Create an isoline curve on a face.
2425
2426             Parameters:
2427                 theFace the face for which an isoline is created.
2428                 IsUIsoline True for U-isoline creation; False for V-isoline
2429                            creation.
2430                 theParameter the U parameter for U-isoline or V parameter
2431                              for V-isoline.
2432                 theName Object name; when specified, this parameter is used
2433                         for result publication in the study. Otherwise, if automatic
2434                         publication is switched on, default value is used for result name.
2435
2436             Returns:
2437                 New GEOM.GEOM_Object, containing the created isoline edge or a
2438                 compound of edges.
2439             """
2440             # Example: see GEOM_TestAll.py
2441             anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2442             RaiseIfFailed("MakeIsoline", self.CurvesOp)
2443             if IsUIsoline:
2444                 self._autoPublish(anObj, theName, "U-Isoline")
2445             else:
2446                 self._autoPublish(anObj, theName, "V-Isoline")
2447             return anObj
2448
2449         # end of l4_curves
2450         ## @}
2451
2452         ## @addtogroup l3_sketcher
2453         ## @{
2454
2455         ## Create a sketcher (wire or face), following the textual description,
2456         #  passed through <VAR>theCommand</VAR> argument. \n
2457         #  Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2458         #  Format of the description string have to be the following:
2459         #
2460         #  "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2461         #
2462         #  Where:
2463         #  - x1, y1 are coordinates of the first sketcher point (zero by default),
2464         #  - CMD is one of
2465         #     - "R angle" : Set the direction by angle
2466         #     - "D dx dy" : Set the direction by DX & DY
2467         #     .
2468         #       \n
2469         #     - "TT x y" : Create segment by point at X & Y
2470         #     - "T dx dy" : Create segment by point with DX & DY
2471         #     - "L length" : Create segment by direction & Length
2472         #     - "IX x" : Create segment by direction & Intersect. X
2473         #     - "IY y" : Create segment by direction & Intersect. Y
2474         #     .
2475         #       \n
2476         #     - "C radius length" : Create arc by direction, radius and length(in degree)
2477         #     - "AA x y": Create arc by point at X & Y
2478         #     - "A dx dy" : Create arc by point with DX & DY
2479         #     - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2480         #     - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2481         #     - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2482         #     - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2483         #     .
2484         #       \n
2485         #     - "WW" : Close Wire (to finish)
2486         #     - "WF" : Close Wire and build face (to finish)
2487         #     .
2488         #        \n
2489         #  - Flag1 (= reverse) is 0 or 2 ...
2490         #     - if 0 the drawn arc is the one of lower angle (< Pi)
2491         #     - if 2 the drawn arc ius the one of greater angle (> Pi)
2492         #     .
2493         #        \n
2494         #  - Flag2 (= control tolerance) is 0 or 1 ...
2495         #     - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2496         #     - if 1 the wire is built only if the end point is on the arc
2497         #       with a tolerance of 10^-7 on the distance else the creation fails
2498         #
2499         #  @param theCommand String, defining the sketcher in local
2500         #                    coordinates of the working plane.
2501         #  @param theWorkingPlane Nine double values, defining origin,
2502         #                         OZ and OX directions of the working plane.
2503         #  @param theName Object name; when specified, this parameter is used
2504         #         for result publication in the study. Otherwise, if automatic
2505         #         publication is switched on, default value is used for result name.
2506         #
2507         #  @return New GEOM.GEOM_Object, containing the created wire.
2508         #
2509         #  @ref tui_sketcher_page "Example"
2510         @ManageTransactions("CurvesOp")
2511         def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2512             """
2513             Create a sketcher (wire or face), following the textual description, passed
2514             through theCommand argument.
2515             Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2516             Format of the description string have to be the following:
2517                 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2518             Where:
2519             - x1, y1 are coordinates of the first sketcher point (zero by default),
2520             - CMD is one of
2521                - "R angle" : Set the direction by angle
2522                - "D dx dy" : Set the direction by DX & DY
2523
2524                - "TT x y" : Create segment by point at X & Y
2525                - "T dx dy" : Create segment by point with DX & DY
2526                - "L length" : Create segment by direction & Length
2527                - "IX x" : Create segment by direction & Intersect. X
2528                - "IY y" : Create segment by direction & Intersect. Y
2529
2530                - "C radius length" : Create arc by direction, radius and length(in degree)
2531                - "AA x y": Create arc by point at X & Y
2532                - "A dx dy" : Create arc by point with DX & DY
2533                - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2534                - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2535                - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2536                - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2537
2538                - "WW" : Close Wire (to finish)
2539                - "WF" : Close Wire and build face (to finish)
2540
2541             - Flag1 (= reverse) is 0 or 2 ...
2542                - if 0 the drawn arc is the one of lower angle (< Pi)
2543                - if 2 the drawn arc ius the one of greater angle (> Pi)
2544
2545             - Flag2 (= control tolerance) is 0 or 1 ...
2546                - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2547                - if 1 the wire is built only if the end point is on the arc
2548                  with a tolerance of 10^-7 on the distance else the creation fails
2549
2550             Parameters:
2551                 theCommand String, defining the sketcher in local
2552                            coordinates of the working plane.
2553                 theWorkingPlane Nine double values, defining origin,
2554                                 OZ and OX directions of the working plane.
2555                 theName Object name; when specified, this parameter is used
2556                         for result publication in the study. Otherwise, if automatic
2557                         publication is switched on, default value is used for result name.
2558
2559             Returns:
2560                 New GEOM.GEOM_Object, containing the created wire.
2561             """
2562             # Example: see GEOM_TestAll.py
2563             theCommand,Parameters = ParseSketcherCommand(theCommand)
2564             anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2565             RaiseIfFailed("MakeSketcher", self.CurvesOp)
2566             anObj.SetParameters(Parameters)
2567             self._autoPublish(anObj, theName, "wire")
2568             return anObj
2569
2570         ## Create a sketcher (wire or face), following the textual description,
2571         #  passed through <VAR>theCommand</VAR> argument. \n
2572         #  For format of the description string see MakeSketcher() method.\n
2573         #  @param theCommand String, defining the sketcher in local
2574         #                    coordinates of the working plane.
2575         #  @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2576         #  @param theName Object name; when specified, this parameter is used
2577         #         for result publication in the study. Otherwise, if automatic
2578         #         publication is switched on, default value is used for result name.
2579         #
2580         #  @return New GEOM.GEOM_Object, containing the created wire.
2581         #
2582         #  @ref tui_sketcher_page "Example"
2583         @ManageTransactions("CurvesOp")
2584         def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2585             """
2586             Create a sketcher (wire or face), following the textual description,
2587             passed through theCommand argument.
2588             For format of the description string see geompy.MakeSketcher() method.
2589
2590             Parameters:
2591                 theCommand String, defining the sketcher in local
2592                            coordinates of the working plane.
2593                 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2594                 theName Object name; when specified, this parameter is used
2595                         for result publication in the study. Otherwise, if automatic
2596                         publication is switched on, default value is used for result name.
2597
2598             Returns:
2599                 New GEOM.GEOM_Object, containing the created wire.
2600             """
2601             theCommand,Parameters = ParseSketcherCommand(theCommand)
2602             anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2603             RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2604             anObj.SetParameters(Parameters)
2605             self._autoPublish(anObj, theName, "wire")
2606             return anObj
2607
2608         ## Obtain a 2D sketcher interface
2609         #  @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2610         def Sketcher2D (self):
2611             """
2612             Obtain a 2D sketcher interface.
2613
2614             Example of usage:
2615                sk = geompy.Sketcher2D()
2616                sk.addPoint(20, 20)
2617                sk.addSegmentRelative(15, 70)
2618                sk.addSegmentPerpY(50)
2619                sk.addArcRadiusRelative(25, 15, 14.5, 0)
2620                sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2621                sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2622                sk.close()
2623                Sketch_1 = sk.wire(geomObj_1)
2624             """
2625             sk = Sketcher2D (self)
2626             return sk
2627
2628         ## Create a sketcher wire, following the numerical description,
2629         #  passed through <VAR>theCoordinates</VAR> argument. \n
2630         #  @param theCoordinates double values, defining points to create a wire,
2631         #                                                      passing from it.
2632         #  @param theName Object name; when specified, this parameter is used
2633         #         for result publication in the study. Otherwise, if automatic
2634         #         publication is switched on, default value is used for result name.
2635         #
2636         #  @return New GEOM.GEOM_Object, containing the created wire.
2637         #
2638         #  @ref tui_3dsketcher_page "Example"
2639         @ManageTransactions("CurvesOp")
2640         def Make3DSketcher(self, theCoordinates, theName=None):
2641             """
2642             Create a sketcher wire, following the numerical description,
2643             passed through theCoordinates argument.
2644
2645             Parameters:
2646                 theCoordinates double values, defining points to create a wire,
2647                                passing from it.
2648                 theName Object name; when specified, this parameter is used
2649                         for result publication in the study. Otherwise, if automatic
2650                         publication is switched on, default value is used for result name.
2651
2652             Returns:
2653                 New GEOM_Object, containing the created wire.
2654             """
2655             theCoordinates,Parameters = ParseParameters(theCoordinates)
2656             anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2657             RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2658             anObj.SetParameters(Parameters)
2659             self._autoPublish(anObj, theName, "wire")
2660             return anObj
2661
2662         ## Obtain a 3D sketcher interface
2663         #  @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2664         #
2665         #  @ref tui_3dsketcher_page "Example"
2666         def Sketcher3D (self):
2667             """
2668             Obtain a 3D sketcher interface.
2669
2670             Example of usage:
2671                 sk = geompy.Sketcher3D()
2672                 sk.addPointsAbsolute(0,0,0, 70,0,0)
2673                 sk.addPointsRelative(0, 0, 130)
2674                 sk.addPointAnglesLength("OXY", 50, 0, 100)
2675                 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2676                 sk.close()
2677                 a3D_Sketcher_1 = sk.wire()
2678             """
2679             sk = Sketcher3D (self)
2680             return sk
2681
2682         # end of l3_sketcher
2683         ## @}
2684
2685         ## @addtogroup l3_3d_primitives
2686         ## @{
2687
2688         ## Create a box by coordinates of two opposite vertices.
2689         #
2690         #  @param x1,y1,z1 double values, defining first point it.
2691         #  @param x2,y2,z2 double values, defining first point it.
2692         #  @param theName Object name; when specified, this parameter is used
2693         #         for result publication in the study. Otherwise, if automatic
2694         #         publication is switched on, default value is used for result name.
2695         #
2696         #  @return New GEOM.GEOM_Object, containing the created box.
2697         #
2698         #  @ref tui_creation_box "Example"
2699         def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2700             """
2701             Create a box by coordinates of two opposite vertices.
2702
2703             Parameters:
2704                 x1,y1,z1 double values, defining first point.
2705                 x2,y2,z2 double values, defining second point.
2706                 theName Object name; when specified, this parameter is used
2707                         for result publication in the study. Otherwise, if automatic
2708                         publication is switched on, default value is used for result name.
2709
2710             Returns:
2711                 New GEOM.GEOM_Object, containing the created box.
2712             """
2713             # Example: see GEOM_TestAll.py
2714             pnt1 = self.MakeVertex(x1,y1,z1)
2715             pnt2 = self.MakeVertex(x2,y2,z2)
2716             # note: auto-publishing is done in self.MakeBoxTwoPnt()
2717             return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2718
2719         ## Create a box with specified dimensions along the coordinate axes
2720         #  and with edges, parallel to the coordinate axes.
2721         #  Center of the box will be at point (DX/2, DY/2, DZ/2).
2722         #  @param theDX Length of Box edges, parallel to OX axis.
2723         #  @param theDY Length of Box edges, parallel to OY axis.
2724         #  @param theDZ Length of Box edges, parallel to OZ axis.
2725         #  @param theName Object name; when specified, this parameter is used
2726         #         for result publication in the study. Otherwise, if automatic
2727         #         publication is switched on, default value is used for result name.
2728         #
2729         #  @return New GEOM.GEOM_Object, containing the created box.
2730         #
2731         #  @ref tui_creation_box "Example"
2732         @ManageTransactions("PrimOp")
2733         def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2734             """
2735             Create a box with specified dimensions along the coordinate axes
2736             and with edges, parallel to the coordinate axes.
2737             Center of the box will be at point (DX/2, DY/2, DZ/2).
2738
2739             Parameters:
2740                 theDX Length of Box edges, parallel to OX axis.
2741                 theDY Length of Box edges, parallel to OY axis.
2742                 theDZ Length of Box edges, parallel to OZ axis.
2743                 theName Object name; when specified, this parameter is used
2744                         for result publication in the study. Otherwise, if automatic
2745                         publication is switched on, default value is used for result name.
2746
2747             Returns:
2748                 New GEOM.GEOM_Object, containing the created box.
2749             """
2750             # Example: see GEOM_TestAll.py
2751             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2752             anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2753             RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2754             anObj.SetParameters(Parameters)
2755             self._autoPublish(anObj, theName, "box")
2756             return anObj
2757
2758         ## Create a box with two specified opposite vertices,
2759         #  and with edges, parallel to the coordinate axes
2760         #  @param thePnt1 First of two opposite vertices.
2761         #  @param thePnt2 Second of two opposite vertices.
2762         #  @param theName Object name; when specified, this parameter is used
2763         #         for result publication in the study. Otherwise, if automatic
2764         #         publication is switched on, default value is used for result name.
2765         #
2766         #  @return New GEOM.GEOM_Object, containing the created box.
2767         #
2768         #  @ref tui_creation_box "Example"
2769         @ManageTransactions("PrimOp")
2770         def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2771             """
2772             Create a box with two specified opposite vertices,
2773             and with edges, parallel to the coordinate axes
2774
2775             Parameters:
2776                 thePnt1 First of two opposite vertices.
2777                 thePnt2 Second of two opposite vertices.
2778                 theName Object name; when specified, this parameter is used
2779                         for result publication in the study. Otherwise, if automatic
2780                         publication is switched on, default value is used for result name.
2781
2782             Returns:
2783                 New GEOM.GEOM_Object, containing the created box.
2784             """
2785             # Example: see GEOM_TestAll.py
2786             anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2787             RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2788             self._autoPublish(anObj, theName, "box")
2789             return anObj
2790
2791         ## Create a face with specified dimensions with edges parallel to coordinate axes.
2792         #  @param theH height of Face.
2793         #  @param theW width of Face.
2794         #  @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2795         #  @param theName Object name; when specified, this parameter is used
2796         #         for result publication in the study. Otherwise, if automatic
2797         #         publication is switched on, default value is used for result name.
2798         #
2799         #  @return New GEOM.GEOM_Object, containing the created face.
2800         #
2801         #  @ref tui_creation_face "Example"
2802         @ManageTransactions("PrimOp")
2803         def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2804             """
2805             Create a face with specified dimensions with edges parallel to coordinate axes.
2806
2807             Parameters:
2808                 theH height of Face.
2809                 theW width of Face.
2810                 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2811                 theName Object name; when specified, this parameter is used
2812                         for result publication in the study. Otherwise, if automatic
2813                         publication is switched on, default value is used for result name.
2814
2815             Returns:
2816                 New GEOM.GEOM_Object, containing the created face.
2817             """
2818             # Example: see GEOM_TestAll.py
2819             theH,theW,Parameters = ParseParameters(theH, theW)
2820             anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2821             RaiseIfFailed("MakeFaceHW", self.PrimOp)
2822             anObj.SetParameters(Parameters)
2823             self._autoPublish(anObj, theName, "rectangle")
2824             return anObj
2825
2826         ## Create a face from another plane and two sizes,
2827         #  vertical size and horisontal size.
2828         #  @param theObj   Normale vector to the creating face or
2829         #  the face object.
2830         #  @param theH     Height (vertical size).
2831         #  @param theW     Width (horisontal size).
2832         #  @param theName Object name; when specified, this parameter is used
2833         #         for result publication in the study. Otherwise, if automatic
2834         #         publication is switched on, default value is used for result name.
2835         #
2836         #  @return New GEOM.GEOM_Object, containing the created face.
2837         #
2838         #  @ref tui_creation_face "Example"
2839         @ManageTransactions("PrimOp")
2840         def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2841             """
2842             Create a face from another plane and two sizes,
2843             vertical size and horisontal size.
2844
2845             Parameters:
2846                 theObj   Normale vector to the creating face or
2847                          the face object.
2848                 theH     Height (vertical size).
2849                 theW     Width (horisontal size).
2850                 theName Object name; when specified, this parameter is used
2851                         for result publication in the study. Otherwise, if automatic
2852                         publication is switched on, default value is used for result name.
2853
2854             Returns:
2855                 New GEOM_Object, containing the created face.
2856             """
2857             # Example: see GEOM_TestAll.py
2858             theH,theW,Parameters = ParseParameters(theH, theW)
2859             anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2860             RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2861             anObj.SetParameters(Parameters)
2862             self._autoPublish(anObj, theName, "rectangle")
2863             return anObj
2864
2865         ## Create a disk with given center, normal vector and radius.
2866         #  @param thePnt Disk center.
2867         #  @param theVec Vector, normal to the plane of the disk.
2868         #  @param theR Disk radius.
2869         #  @param theName Object name; when specified, this parameter is used
2870         #         for result publication in the study. Otherwise, if automatic
2871         #         publication is switched on, default value is used for result name.
2872         #
2873         #  @return New GEOM.GEOM_Object, containing the created disk.
2874         #
2875         #  @ref tui_creation_disk "Example"
2876         @ManageTransactions("PrimOp")
2877         def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2878             """
2879             Create a disk with given center, normal vector and radius.
2880
2881             Parameters:
2882                 thePnt Disk center.
2883                 theVec Vector, normal to the plane of the disk.
2884                 theR Disk radius.
2885                 theName Object name; when specified, this parameter is used
2886                         for result publication in the study. Otherwise, if automatic
2887                         publication is switched on, default value is used for result name.
2888
2889             Returns:
2890                 New GEOM.GEOM_Object, containing the created disk.
2891             """
2892             # Example: see GEOM_TestAll.py
2893             theR,Parameters = ParseParameters(theR)
2894             anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2895             RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2896             anObj.SetParameters(Parameters)
2897             self._autoPublish(anObj, theName, "disk")
2898             return anObj
2899
2900         ## Create a disk, passing through three given points
2901         #  @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2902         #  @param theName Object name; when specified, this parameter is used
2903         #         for result publication in the study. Otherwise, if automatic
2904         #         publication is switched on, default value is used for result name.
2905         #
2906         #  @return New GEOM.GEOM_Object, containing the created disk.
2907         #
2908         #  @ref tui_creation_disk "Example"
2909         @ManageTransactions("PrimOp")
2910         def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2911             """
2912             Create a disk, passing through three given points
2913
2914             Parameters:
2915                 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2916                 theName Object name; when specified, this parameter is used
2917                         for result publication in the study. Otherwise, if automatic
2918                         publication is switched on, default value is used for result name.
2919
2920             Returns:
2921                 New GEOM.GEOM_Object, containing the created disk.
2922             """
2923             # Example: see GEOM_TestAll.py
2924             anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2925             RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2926             self._autoPublish(anObj, theName, "disk")
2927             return anObj
2928
2929         ## Create a disk with specified dimensions along OX-OY coordinate axes.
2930         #  @param theR Radius of Face.
2931         #  @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2932         #  @param theName Object name; when specified, this parameter is used
2933         #         for result publication in the study. Otherwise, if automatic
2934         #         publication is switched on, default value is used for result name.
2935         #
2936         #  @return New GEOM.GEOM_Object, containing the created disk.
2937         #
2938         #  @ref tui_creation_face "Example"
2939         @ManageTransactions("PrimOp")
2940         def MakeDiskR(self, theR, theOrientation, theName=None):
2941             """
2942             Create a disk with specified dimensions along OX-OY coordinate axes.
2943
2944             Parameters:
2945                 theR Radius of Face.
2946                 theOrientation set the orientation belong axis OXY or OYZ or OZX
2947                 theName Object name; when specified, this parameter is used
2948                         for result publication in the study. Otherwise, if automatic
2949                         publication is switched on, default value is used for result name.
2950
2951             Returns:
2952                 New GEOM.GEOM_Object, containing the created disk.
2953
2954             Example of usage:
2955                 Disk3 = geompy.MakeDiskR(100., 1)
2956             """
2957             # Example: see GEOM_TestAll.py
2958             theR,Parameters = ParseParameters(theR)
2959             anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2960             RaiseIfFailed("MakeDiskR", self.PrimOp)
2961             anObj.SetParameters(Parameters)
2962             self._autoPublish(anObj, theName, "disk")
2963             return anObj
2964
2965         ## Create a cylinder with given base point, axis, radius and height.
2966         #  @param thePnt Central point of cylinder base.
2967         #  @param theAxis Cylinder axis.
2968         #  @param theR Cylinder radius.
2969         #  @param theH Cylinder height.
2970         #  @param theName Object name; when specified, this parameter is used
2971         #         for result publication in the study. Otherwise, if automatic
2972         #         publication is switched on, default value is used for result name.
2973         #
2974         #  @return New GEOM.GEOM_Object, containing the created cylinder.
2975         #
2976         #  @ref tui_creation_cylinder "Example"
2977         @ManageTransactions("PrimOp")
2978         def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2979             """
2980             Create a cylinder with given base point, axis, radius and height.
2981
2982             Parameters:
2983                 thePnt Central point of cylinder base.
2984                 theAxis Cylinder axis.
2985                 theR Cylinder radius.
2986                 theH Cylinder height.
2987                 theName Object name; when specified, this parameter is used
2988                         for result publication in the study. Otherwise, if automatic
2989                         publication is switched on, default value is used for result name.
2990
2991             Returns:
2992                 New GEOM.GEOM_Object, containing the created cylinder.
2993             """
2994             # Example: see GEOM_TestAll.py
2995             theR,theH,Parameters = ParseParameters(theR, theH)
2996             anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2997             RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2998             anObj.SetParameters(Parameters)
2999             self._autoPublish(anObj, theName, "cylinder")
3000             return anObj
3001
3002         ## Create a cylinder with given radius and height at
3003         #  the origin of coordinate system. Axis of the cylinder
3004         #  will be collinear to the OZ axis of the coordinate system.
3005         #  @param theR Cylinder radius.
3006         #  @param theH Cylinder height.
3007         #  @param theName Object name; when specified, this parameter is used
3008         #         for result publication in the study. Otherwise, if automatic
3009         #         publication is switched on, default value is used for result name.
3010         #
3011         #  @return New GEOM.GEOM_Object, containing the created cylinder.
3012         #
3013         #  @ref tui_creation_cylinder "Example"
3014         @ManageTransactions("PrimOp")
3015         def MakeCylinderRH(self, theR, theH, theName=None):
3016             """
3017             Create a cylinder with given radius and height at
3018             the origin of coordinate system. Axis of the cylinder
3019             will be collinear to the OZ axis of the coordinate system.
3020
3021             Parameters:
3022                 theR Cylinder radius.
3023                 theH Cylinder height.
3024                 theName Object name; when specified, this parameter is used
3025                         for result publication in the study. Otherwise, if automatic
3026                         publication is switched on, default value is used for result name.
3027
3028             Returns:
3029                 New GEOM.GEOM_Object, containing the created cylinder.
3030             """
3031             # Example: see GEOM_TestAll.py
3032             theR,theH,Parameters = ParseParameters(theR, theH)
3033             anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3034             RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3035             anObj.SetParameters(Parameters)
3036             self._autoPublish(anObj, theName, "cylinder")
3037             return anObj
3038
3039         ## Create a sphere with given center and radius.
3040         #  @param thePnt Sphere center.
3041         #  @param theR Sphere radius.
3042         #  @param theName Object name; when specified, this parameter is used
3043         #         for result publication in the study. Otherwise, if automatic
3044         #         publication is switched on, default value is used for result name.
3045         #
3046         #  @return New GEOM.GEOM_Object, containing the created sphere.
3047         #
3048         #  @ref tui_creation_sphere "Example"
3049         @ManageTransactions("PrimOp")
3050         def MakeSpherePntR(self, thePnt, theR, theName=None):
3051             """
3052             Create a sphere with given center and radius.
3053
3054             Parameters:
3055                 thePnt Sphere center.
3056                 theR Sphere radius.
3057                 theName Object name; when specified, this parameter is used
3058                         for result publication in the study. Otherwise, if automatic
3059                         publication is switched on, default value is used for result name.
3060
3061             Returns:
3062                 New GEOM.GEOM_Object, containing the created sphere.
3063             """
3064             # Example: see GEOM_TestAll.py
3065             theR,Parameters = ParseParameters(theR)
3066             anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3067             RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3068             anObj.SetParameters(Parameters)
3069             self._autoPublish(anObj, theName, "sphere")
3070             return anObj
3071
3072         ## Create a sphere with given center and radius.
3073         #  @param x,y,z Coordinates of sphere center.
3074         #  @param theR Sphere radius.
3075         #  @param 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         #  @return New GEOM.GEOM_Object, containing the created sphere.
3080         #
3081         #  @ref tui_creation_sphere "Example"
3082         def MakeSphere(self, x, y, z, theR, theName=None):
3083             """
3084             Create a sphere with given center and radius.
3085
3086             Parameters:
3087                 x,y,z Coordinates of sphere center.
3088                 theR Sphere radius.
3089                 theName Object name; when specified, this parameter is used
3090                         for result publication in the study. Otherwise, if automatic
3091                         publication is switched on, default value is used for result name.
3092
3093             Returns:
3094                 New GEOM.GEOM_Object, containing the created sphere.
3095             """
3096             # Example: see GEOM_TestAll.py
3097             point = self.MakeVertex(x, y, z)
3098             # note: auto-publishing is done in self.MakeSpherePntR()
3099             anObj = self.MakeSpherePntR(point, theR, theName)
3100             return anObj
3101
3102         ## Create a sphere with given radius at the origin of coordinate system.
3103         #  @param theR Sphere radius.
3104         #  @param theName Object name; when specified, this parameter is used
3105         #         for result publication in the study. Otherwise, if automatic
3106         #         publication is switched on, default value is used for result name.
3107         #
3108         #  @return New GEOM.GEOM_Object, containing the created sphere.
3109         #
3110         #  @ref tui_creation_sphere "Example"
3111         @ManageTransactions("PrimOp")
3112         def MakeSphereR(self, theR, theName=None):
3113             """
3114             Create a sphere with given radius at the origin of coordinate system.
3115
3116             Parameters:
3117                 theR Sphere radius.
3118                 theName Object name; when specified, this parameter is used
3119                         for result publication in the study. Otherwise, if automatic
3120                         publication is switched on, default value is used for result name.
3121
3122             Returns:
3123                 New GEOM.GEOM_Object, containing the created sphere.
3124             """
3125             # Example: see GEOM_TestAll.py
3126             theR,Parameters = ParseParameters(theR)
3127             anObj = self.PrimOp.MakeSphereR(theR)
3128             RaiseIfFailed("MakeSphereR", self.PrimOp)
3129             anObj.SetParameters(Parameters)
3130             self._autoPublish(anObj, theName, "sphere")
3131             return anObj
3132
3133         ## Create a cone with given base point, axis, height and radiuses.
3134         #  @param thePnt Central point of the first cone base.
3135         #  @param theAxis Cone axis.
3136         #  @param theR1 Radius of the first cone base.
3137         #  @param theR2 Radius of the second cone base.
3138         #    \note If both radiuses are non-zero, the cone will be truncated.
3139         #    \note If the radiuses are equal, a cylinder will be created instead.
3140         #  @param theH Cone height.
3141         #  @param theName Object name; when specified, this parameter is used
3142         #         for result publication in the study. Otherwise, if automatic
3143         #         publication is switched on, default value is used for result name.
3144         #
3145         #  @return New GEOM.GEOM_Object, containing the created cone.
3146         #
3147         #  @ref tui_creation_cone "Example"
3148         @ManageTransactions("PrimOp")
3149         def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3150             """
3151             Create a cone with given base point, axis, height and radiuses.
3152
3153             Parameters:
3154                 thePnt Central point of the first cone base.
3155                 theAxis Cone axis.
3156                 theR1 Radius of the first cone base.
3157                 theR2 Radius of the second cone base.
3158                 theH Cone height.
3159                 theName Object name; when specified, this parameter is used
3160                         for result publication in the study. Otherwise, if automatic
3161                         publication is switched on, default value is used for result name.
3162
3163             Note:
3164                 If both radiuses are non-zero, the cone will be truncated.
3165                 If the radiuses are equal, a cylinder will be created instead.
3166
3167             Returns:
3168                 New GEOM.GEOM_Object, containing the created cone.
3169             """
3170             # Example: see GEOM_TestAll.py
3171             theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3172             anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3173             RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3174             anObj.SetParameters(Parameters)
3175             self._autoPublish(anObj, theName, "cone")
3176             return anObj
3177
3178         ## Create a cone with given height and radiuses at
3179         #  the origin of coordinate system. Axis of the cone will
3180         #  be collinear to the OZ axis of the coordinate system.
3181         #  @param theR1 Radius of the first cone base.
3182         #  @param theR2 Radius of the second cone base.
3183         #    \note If both radiuses are non-zero, the cone will be truncated.
3184         #    \note If the radiuses are equal, a cylinder will be created instead.
3185         #  @param theH Cone height.
3186         #  @param theName Object name; when specified, this parameter is used
3187         #         for result publication in the study. Otherwise, if automatic
3188         #         publication is switched on, default value is used for result name.
3189         #
3190         #  @return New GEOM.GEOM_Object, containing the created cone.
3191         #
3192         #  @ref tui_creation_cone "Example"
3193         @ManageTransactions("PrimOp")
3194         def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3195             """
3196             Create a cone with given height and radiuses at
3197             the origin of coordinate system. Axis of the cone will
3198             be collinear to the OZ axis of the coordinate system.
3199
3200             Parameters:
3201                 theR1 Radius of the first cone base.
3202                 theR2 Radius of the second cone base.
3203                 theH Cone height.
3204                 theName Object name; when specified, this parameter is used
3205                         for result publication in the study. Otherwise, if automatic
3206                         publication is switched on, default value is used for result name.
3207
3208             Note:
3209                 If both radiuses are non-zero, the cone will be truncated.
3210                 If the radiuses are equal, a cylinder will be created instead.
3211
3212             Returns:
3213                 New GEOM.GEOM_Object, containing the created cone.
3214             """
3215             # Example: see GEOM_TestAll.py
3216             theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3217             anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3218             RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3219             anObj.SetParameters(Parameters)
3220             self._autoPublish(anObj, theName, "cone")
3221             return anObj
3222
3223         ## Create a torus with given center, normal vector and radiuses.
3224         #  @param thePnt Torus central point.
3225         #  @param theVec Torus axis of symmetry.
3226         #  @param theRMajor Torus major radius.
3227         #  @param theRMinor Torus minor radius.
3228         #  @param theName Object name; when specified, this parameter is used
3229         #         for result publication in the study. Otherwise, if automatic
3230         #         publication is switched on, default value is used for result name.
3231         #
3232         #  @return New GEOM.GEOM_Object, containing the created torus.
3233         #
3234         #  @ref tui_creation_torus "Example"
3235         @ManageTransactions("PrimOp")
3236         def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3237             """
3238             Create a torus with given center, normal vector and radiuses.
3239
3240             Parameters:
3241                 thePnt Torus central point.
3242                 theVec Torus axis of symmetry.
3243                 theRMajor Torus major radius.
3244                 theRMinor Torus minor radius.
3245                 theName Object name; when specified, this parameter is used
3246                         for result publication in the study. Otherwise, if automatic
3247                         publication is switched on, default value is used for result name.
3248
3249            Returns:
3250                 New GEOM.GEOM_Object, containing the created torus.
3251             """
3252             # Example: see GEOM_TestAll.py
3253             theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3254             anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3255             RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3256             anObj.SetParameters(Parameters)
3257             self._autoPublish(anObj, theName, "torus")
3258             return anObj
3259
3260         ## Create a torus with given radiuses at the origin of coordinate system.
3261         #  @param theRMajor Torus major radius.
3262         #  @param theRMinor Torus minor radius.
3263         #  @param theName Object name; when specified, this parameter is used
3264         #         for result publication in the study. Otherwise, if automatic
3265         #         publication is switched on, default value is used for result name.
3266         #
3267         #  @return New GEOM.GEOM_Object, containing the created torus.
3268         #
3269         #  @ref tui_creation_torus "Example"
3270         @ManageTransactions("PrimOp")
3271         def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3272             """
3273            Create a torus with given radiuses at the origin of coordinate system.
3274
3275            Parameters:
3276                 theRMajor Torus major radius.
3277                 theRMinor Torus minor radius.
3278                 theName Object name; when specified, this parameter is used
3279                         for result publication in the study. Otherwise, if automatic
3280                         publication is switched on, default value is used for result name.
3281
3282            Returns:
3283                 New GEOM.GEOM_Object, containing the created torus.
3284             """
3285             # Example: see GEOM_TestAll.py
3286             theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3287             anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3288             RaiseIfFailed("MakeTorusRR", self.PrimOp)
3289             anObj.SetParameters(Parameters)
3290             self._autoPublish(anObj, theName, "torus")
3291             return anObj
3292
3293         # end of l3_3d_primitives
3294         ## @}
3295
3296         ## @addtogroup l3_complex
3297         ## @{
3298
3299         ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3300         #  @param theBase Base shape to be extruded.
3301         #  @param thePoint1 First end of extrusion vector.
3302         #  @param thePoint2 Second end of extrusion vector.
3303         #  @param theScaleFactor Use it to make prism with scaled second base.
3304         #                        Nagative value means not scaled second base.
3305         #  @param theName Object name; when specified, this parameter is used
3306         #         for result publication in the study. Otherwise, if automatic
3307         #         publication is switched on, default value is used for result name.
3308         #
3309         #  @return New GEOM.GEOM_Object, containing the created prism.
3310         #
3311         #  @ref tui_creation_prism "Example"
3312         @ManageTransactions("PrimOp")
3313         def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3314             """
3315             Create a shape by extrusion of the base shape along a vector, defined by two points.
3316
3317             Parameters:
3318                 theBase Base shape to be extruded.
3319                 thePoint1 First end of extrusion vector.
3320                 thePoint2 Second end of extrusion vector.
3321                 theScaleFactor Use it to make prism with scaled second base.
3322                                Nagative value means not scaled second base.
3323                 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             Returns:
3328                 New GEOM.GEOM_Object, containing the created prism.
3329             """
3330             # Example: see GEOM_TestAll.py
3331             anObj = None
3332             Parameters = ""
3333             if theScaleFactor > 0:
3334                 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3335                 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3336             else:
3337                 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3338             RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3339             anObj.SetParameters(Parameters)
3340             self._autoPublish(anObj, theName, "prism")
3341             return anObj
3342
3343         ## Create a shape by extrusion of the base shape along a
3344         #  vector, defined by two points, in 2 Ways (forward/backward).
3345         #  @param theBase Base shape to be extruded.
3346         #  @param thePoint1 First end of extrusion vector.
3347         #  @param thePoint2 Second end of extrusion vector.
3348         #  @param theName Object name; when specified, this parameter is used
3349         #         for result publication in the study. Otherwise, if automatic
3350         #         publication is switched on, default value is used for result name.
3351         #
3352         #  @return New GEOM.GEOM_Object, containing the created prism.
3353         #
3354         #  @ref tui_creation_prism "Example"
3355         @ManageTransactions("PrimOp")
3356         def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3357             """
3358             Create a shape by extrusion of the base shape along a
3359             vector, defined by two points, in 2 Ways (forward/backward).
3360
3361             Parameters:
3362                 theBase Base shape to be extruded.
3363                 thePoint1 First end of extrusion vector.
3364                 thePoint2 Second end of extrusion vector.
3365                 theName Object name; when specified, this parameter is used
3366                         for result publication in the study. Otherwise, if automatic
3367                         publication is switched on, default value is used for result name.
3368
3369             Returns:
3370                 New GEOM.GEOM_Object, containing the created prism.
3371             """
3372             # Example: see GEOM_TestAll.py
3373             anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3374             RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3375             self._autoPublish(anObj, theName, "prism")
3376             return anObj
3377
3378         ## Create a shape by extrusion of the base shape along the vector,
3379         #  i.e. all the space, transfixed by the base shape during its translation
3380         #  along the vector on the given distance.
3381         #  @param theBase Base shape to be extruded.
3382         #  @param theVec Direction of extrusion.
3383         #  @param theH Prism dimension along theVec.
3384         #  @param theScaleFactor Use it to make prism with scaled second base.
3385         #                        Negative value means not scaled second base.
3386         #  @param theName Object name; when specified, this parameter is used
3387         #         for result publication in the study. Otherwise, if automatic
3388         #         publication is switched on, default value is used for result name.
3389         #
3390         #  @return New GEOM.GEOM_Object, containing the created prism.
3391         #
3392         #  @ref tui_creation_prism "Example"
3393         @ManageTransactions("PrimOp")
3394         def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3395             """
3396             Create a shape by extrusion of the base shape along the vector,
3397             i.e. all the space, transfixed by the base shape during its translation
3398             along the vector on the given distance.
3399
3400             Parameters:
3401                 theBase Base shape to be extruded.
3402                 theVec Direction of extrusion.
3403                 theH Prism dimension along theVec.
3404                 theScaleFactor Use it to make prism with scaled second base.
3405                                Negative value means not scaled second base.
3406                 theName Object name; when specified, this parameter is used
3407                         for result publication in the study. Otherwise, if automatic
3408                         publication is switched on, default value is used for result name.
3409
3410             Returns:
3411                 New GEOM.GEOM_Object, containing the created prism.
3412             """
3413             # Example: see GEOM_TestAll.py
3414             anObj = None
3415             Parameters = ""
3416             if theScaleFactor > 0:
3417                 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3418                 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3419             else:
3420                 theH,Parameters = ParseParameters(theH)
3421                 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3422             RaiseIfFailed("MakePrismVecH", self.PrimOp)
3423             anObj.SetParameters(Parameters)
3424             self._autoPublish(anObj, theName, "prism")
3425             return anObj
3426
3427         ## Create a shape by extrusion of the base shape along the vector,
3428         #  i.e. all the space, transfixed by the base shape during its translation
3429         #  along the vector on the given distance in 2 Ways (forward/backward).
3430         #  @param theBase Base shape to be extruded.
3431         #  @param theVec Direction of extrusion.
3432         #  @param theH Prism dimension along theVec in forward direction.
3433         #  @param theName Object name; when specified, this parameter is used
3434         #         for result publication in the study. Otherwise, if automatic
3435         #         publication is switched on, default value is used for result name.
3436         #
3437         #  @return New GEOM.GEOM_Object, containing the created prism.
3438         #
3439         #  @ref tui_creation_prism "Example"
3440         @ManageTransactions("PrimOp")
3441         def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3442             """
3443             Create a shape by extrusion of the base shape along the vector,
3444             i.e. all the space, transfixed by the base shape during its translation
3445             along the vector on the given distance in 2 Ways (forward/backward).
3446
3447             Parameters:
3448                 theBase Base shape to be extruded.
3449                 theVec Direction of extrusion.
3450                 theH Prism dimension along theVec in forward direction.
3451                 theName Object name; when specified, this parameter is used
3452                         for result publication in the study. Otherwise, if automatic
3453                         publication is switched on, default value is used for result name.
3454
3455             Returns:
3456                 New GEOM.GEOM_Object, containing the created prism.
3457             """
3458             # Example: see GEOM_TestAll.py
3459             theH,Parameters = ParseParameters(theH)
3460             anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3461             RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3462             anObj.SetParameters(Parameters)
3463             self._autoPublish(anObj, theName, "prism")
3464             return anObj
3465
3466         ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3467         #  @param theBase Base shape to be extruded.
3468         #  @param theDX, theDY, theDZ Directions of extrusion.
3469         #  @param theScaleFactor Use it to make prism with scaled second base.
3470         #                        Nagative value means not scaled second base.
3471         #  @param theName Object name; when specified, this parameter is used
3472         #         for result publication in the study. Otherwise, if automatic
3473         #         publication is switched on, default value is used for result name.
3474         #
3475         #  @return New GEOM.GEOM_Object, containing the created prism.
3476         #
3477         #  @ref tui_creation_prism "Example"
3478         @ManageTransactions("PrimOp")
3479         def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3480             """
3481             Create a shape by extrusion of the base shape along the dx, dy, dz direction
3482
3483             Parameters:
3484                 theBase Base shape to be extruded.
3485                 theDX, theDY, theDZ Directions of extrusion.
3486                 theScaleFactor Use it to make prism with scaled second base.
3487                                Nagative value means not scaled second base.
3488                 theName Object name; when specified, this parameter is used
3489                         for result publication in the study. Otherwise, if automatic
3490                         publication is switched on, default value is used for result name.
3491
3492             Returns:
3493                 New GEOM.GEOM_Object, containing the created prism.
3494             """
3495             # Example: see GEOM_TestAll.py
3496             anObj = None
3497             Parameters = ""
3498             if theScaleFactor > 0:
3499                 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3500                 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3501             else:
3502                 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3503                 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3504             RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3505             anObj.SetParameters(Parameters)
3506             self._autoPublish(anObj, theName, "prism")
3507             return anObj
3508
3509         ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3510         #  i.e. all the space, transfixed by the base shape during its translation
3511         #  along the vector on the given distance in 2 Ways (forward/backward).
3512         #  @param theBase Base shape to be extruded.
3513         #  @param theDX, theDY, theDZ Directions of extrusion.
3514         #  @param theName Object name; when specified, this parameter is used
3515         #         for result publication in the study. Otherwise, if automatic
3516         #         publication is switched on, default value is used for result name.
3517         #
3518         #  @return New GEOM.GEOM_Object, containing the created prism.
3519         #
3520         #  @ref tui_creation_prism "Example"
3521         @ManageTransactions("PrimOp")
3522         def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3523             """
3524             Create a shape by extrusion of the base shape along the dx, dy, dz direction
3525             i.e. all the space, transfixed by the base shape during its translation
3526             along the vector on the given distance in 2 Ways (forward/backward).
3527
3528             Parameters:
3529                 theBase Base shape to be extruded.
3530                 theDX, theDY, theDZ Directions of extrusion.
3531                 theName Object name; when specified, this parameter is used
3532                         for result publication in the study. Otherwise, if automatic
3533                         publication is switched on, default value is used for result name.
3534
3535             Returns:
3536                 New GEOM.GEOM_Object, containing the created prism.
3537             """
3538             # Example: see GEOM_TestAll.py
3539             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3540             anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3541             RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3542             anObj.SetParameters(Parameters)
3543             self._autoPublish(anObj, theName, "prism")
3544             return anObj
3545
3546         ## Create a shape by revolution of the base shape around the axis
3547         #  on the given angle, i.e. all the space, transfixed by the base
3548         #  shape during its rotation around the axis on the given angle.
3549         #  @param theBase Base shape to be rotated.
3550         #  @param theAxis Rotation axis.
3551         #  @param theAngle Rotation angle in radians.
3552         #  @param theName Object name; when specified, this parameter is used
3553         #         for result publication in the study. Otherwise, if automatic
3554         #         publication is switched on, default value is used for result name.
3555         #
3556         #  @return New GEOM.GEOM_Object, containing the created revolution.
3557         #
3558         #  @ref tui_creation_revolution "Example"
3559         @ManageTransactions("PrimOp")
3560         def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3561             """
3562             Create a shape by revolution of the base shape around the axis
3563             on the given angle, i.e. all the space, transfixed by the base
3564             shape during its rotation around the axis on the given angle.
3565
3566             Parameters:
3567                 theBase Base shape to be rotated.
3568                 theAxis Rotation axis.
3569                 theAngle Rotation angle in radians.
3570                 theName Object name; when specified, this parameter is used
3571                         for result publication in the study. Otherwise, if automatic
3572                         publication is switched on, default value is used for result name.
3573
3574             Returns:
3575                 New GEOM.GEOM_Object, containing the created revolution.
3576             """
3577             # Example: see GEOM_TestAll.py
3578             theAngle,Parameters = ParseParameters(theAngle)
3579             anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3580             RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3581             anObj.SetParameters(Parameters)
3582             self._autoPublish(anObj, theName, "revolution")
3583             return anObj
3584
3585         ## Create a shape by revolution of the base shape around the axis
3586         #  on the given angle, i.e. all the space, transfixed by the base
3587         #  shape during its rotation around the axis on the given angle in
3588         #  both directions (forward/backward)
3589         #  @param theBase Base shape to be rotated.
3590         #  @param theAxis Rotation axis.
3591         #  @param theAngle Rotation angle in radians.
3592         #  @param theName Object name; when specified, this parameter is used
3593         #         for result publication in the study. Otherwise, if automatic
3594         #         publication is switched on, default value is used for result name.
3595         #
3596         #  @return New GEOM.GEOM_Object, containing the created revolution.
3597         #
3598         #  @ref tui_creation_revolution "Example"
3599         @ManageTransactions("PrimOp")
3600         def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3601             """
3602             Create a shape by revolution of the base shape around the axis
3603             on the given angle, i.e. all the space, transfixed by the base
3604             shape during its rotation around the axis on the given angle in
3605             both directions (forward/backward).
3606
3607             Parameters:
3608                 theBase Base shape to be rotated.
3609                 theAxis Rotation axis.
3610                 theAngle Rotation angle in radians.
3611                 theName Object name; when specified, this parameter is used
3612                         for result publication in the study. Otherwise, if automatic
3613                         publication is switched on, default value is used for result name.
3614
3615             Returns:
3616                 New GEOM.GEOM_Object, containing the created revolution.
3617             """
3618             theAngle,Parameters = ParseParameters(theAngle)
3619             anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3620             RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3621             anObj.SetParameters(Parameters)
3622             self._autoPublish(anObj, theName, "revolution")
3623             return anObj
3624
3625         ## Create a filling from the given compound of contours.
3626         #  @param theShape the compound of contours
3627         #  @param theMinDeg a minimal degree of BSpline surface to create
3628         #  @param theMaxDeg a maximal degree of BSpline surface to create
3629         #  @param theTol2D a 2d tolerance to be reached
3630         #  @param theTol3D a 3d tolerance to be reached
3631         #  @param theNbIter a number of iteration of approximation algorithm
3632         #  @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3633         #  @param isApprox if True, BSpline curves are generated in the process
3634         #                  of surface construction. By default it is False, that means
3635         #                  the surface is created using given curves. The usage of
3636         #                  Approximation makes the algorithm work slower, but allows
3637         #                  building the surface for rather complex cases.
3638         #  @param theName Object name; when specified, this parameter is used
3639         #         for result publication in the study. Otherwise, if automatic
3640         #         publication is switched on, default value is used for result name.
3641         #
3642         #  @return New GEOM.GEOM_Object, containing the created filling surface.
3643         #
3644         #  @ref tui_creation_filling "Example"
3645         @ManageTransactions("PrimOp")
3646         def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3647                         theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3648             """
3649             Create a filling from the given compound of contours.
3650
3651             Parameters:
3652                 theShape the compound of contours
3653                 theMinDeg a minimal degree of BSpline surface to create
3654                 theMaxDeg a maximal degree of BSpline surface to create
3655                 theTol2D a 2d tolerance to be reached
3656                 theTol3D a 3d tolerance to be reached
3657                 theNbIter a number of iteration of approximation algorithm
3658                 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3659                 isApprox if True, BSpline curves are generated in the process
3660                          of surface construction. By default it is False, that means
3661                          the surface is created using given curves. The usage of
3662                          Approximation makes the algorithm work slower, but allows
3663                          building the surface for rather complex cases
3664                 theName Object name; when specified, this parameter is used
3665                         for result publication in the study. Otherwise, if automatic
3666                         publication is switched on, default value is used for result name.
3667
3668             Returns:
3669                 New GEOM.GEOM_Object, containing the created filling surface.
3670
3671             Example of usage:
3672                 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3673             """
3674             # Example: see GEOM_TestAll.py
3675             theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3676             anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3677                                             theTol2D, theTol3D, theNbIter,
3678                                             theMethod, isApprox)
3679             RaiseIfFailed("MakeFilling", self.PrimOp)
3680             anObj.SetParameters(Parameters)
3681             self._autoPublish(anObj, theName, "filling")
3682             return anObj
3683
3684
3685         ## Create a filling from the given compound of contours.
3686         #  This method corresponds to MakeFilling with isApprox=True
3687         #  @param theShape the compound of contours
3688         #  @param theMinDeg a minimal degree of BSpline surface to create
3689         #  @param theMaxDeg a maximal degree of BSpline surface to create
3690         #  @param theTol3D a 3d tolerance to be reached
3691         #  @param theName Object name; when specified, this parameter is used
3692         #         for result publication in the study. Otherwise, if automatic
3693         #         publication is switched on, default value is used for result name.
3694         #
3695         #  @return New GEOM.GEOM_Object, containing the created filling surface.
3696         #
3697         #  @ref tui_creation_filling "Example"
3698         @ManageTransactions("PrimOp")
3699         def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3700             """
3701             Create a filling from the given compound of contours.
3702             This method corresponds to MakeFilling with isApprox=True
3703
3704             Parameters:
3705                 theShape the compound of contours
3706                 theMinDeg a minimal degree of BSpline surface to create
3707                 theMaxDeg a maximal degree of BSpline surface to create
3708                 theTol3D a 3d tolerance to be reached
3709                 theName Object name; when specified, this parameter is used
3710                         for result publication in the study. Otherwise, if automatic
3711                         publication is switched on, default value is used for result name.
3712
3713             Returns:
3714                 New GEOM.GEOM_Object, containing the created filling surface.
3715
3716             Example of usage:
3717                 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3718             """
3719             # Example: see GEOM_TestAll.py
3720             theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3721             anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3722                                             0, theTol3D, 0, GEOM.FOM_Default, True)
3723             RaiseIfFailed("MakeFillingNew", self.PrimOp)
3724             anObj.SetParameters(Parameters)
3725             self._autoPublish(anObj, theName, "filling")
3726             return anObj
3727
3728         ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3729         #  @param theSeqSections - set of specified sections.
3730         #  @param theModeSolid - mode defining building solid or shell
3731         #  @param thePreci - precision 3D used for smoothing
3732         #  @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
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 shell or solid.
3738         #
3739         #  @ref swig_todo "Example"
3740         @ManageTransactions("PrimOp")
3741         def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3742             """
3743             Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3744
3745             Parameters:
3746                 theSeqSections - set of specified sections.
3747                 theModeSolid - mode defining building solid or shell
3748                 thePreci - precision 3D used for smoothing
3749                 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3750                 theName Object name; when specified, this parameter is used
3751                         for result publication in the study. Otherwise, if automatic
3752                         publication is switched on, default value is used for result name.
3753
3754             Returns:
3755                 New GEOM.GEOM_Object, containing the created shell or solid.
3756             """
3757             # Example: see GEOM_TestAll.py
3758             anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3759             RaiseIfFailed("MakeThruSections", self.PrimOp)
3760             self._autoPublish(anObj, theName, "filling")
3761             return anObj
3762
3763         ## Create a shape by extrusion of the base shape along
3764         #  the path shape. The path shape can be a wire or an edge.
3765         #  @param theBase Base shape to be extruded.
3766         #  @param thePath Path shape to extrude the base shape along it.
3767         #  @param theName Object name; when specified, this parameter is used
3768         #         for result publication in the study. Otherwise, if automatic
3769         #         publication is switched on, default value is used for result name.
3770         #
3771         #  @return New GEOM.GEOM_Object, containing the created pipe.
3772         #
3773         #  @ref tui_creation_pipe "Example"
3774         @ManageTransactions("PrimOp")
3775         def MakePipe(self, theBase, thePath, theName=None):
3776             """
3777             Create a shape by extrusion of the base shape along
3778             the path shape. The path shape can be a wire or an edge.
3779
3780             Parameters:
3781                 theBase Base shape to be extruded.
3782                 thePath Path shape to extrude the base shape along it.
3783                 theName Object name; when specified, this parameter is used
3784                         for result publication in the study. Otherwise, if automatic
3785                         publication is switched on, default value is used for result name.
3786
3787             Returns:
3788                 New GEOM.GEOM_Object, containing the created pipe.
3789             """
3790             # Example: see GEOM_TestAll.py
3791             anObj = self.PrimOp.MakePipe(theBase, thePath)
3792             RaiseIfFailed("MakePipe", self.PrimOp)
3793             self._autoPublish(anObj, theName, "pipe")
3794             return anObj
3795
3796         ## Create a shape by extrusion of the profile shape along
3797         #  the path shape. The path shape can be a wire or an edge.
3798         #  the several profiles can be specified in the several locations of path.
3799         #  @param theSeqBases - list of  Bases shape to be extruded.
3800         #  @param theLocations - list of locations on the path corresponding
3801         #                        specified list of the Bases shapes. Number of locations
3802         #                        should be equal to number of bases or list of locations can be empty.
3803         #  @param thePath - Path shape to extrude the base shape along it.
3804         #  @param theWithContact - the mode defining that the section is translated to be in
3805         #                          contact with the spine.
3806         #  @param theWithCorrection - defining that the section is rotated to be
3807         #                             orthogonal to the spine tangent in the correspondent point
3808         #  @param theName Object name; when specified, this parameter is used
3809         #         for result publication in the study. Otherwise, if automatic
3810         #         publication is switched on, default value is used for result name.
3811         #
3812         #  @return New GEOM.GEOM_Object, containing the created pipe.
3813         #
3814         #  @ref tui_creation_pipe_with_diff_sec "Example"
3815         @ManageTransactions("PrimOp")
3816         def MakePipeWithDifferentSections(self, theSeqBases,
3817                                           theLocations, thePath,
3818                                           theWithContact, theWithCorrection, theName=None):
3819             """
3820             Create a shape by extrusion of the profile shape along
3821             the path shape. The path shape can be a wire or an edge.
3822             the several profiles can be specified in the several locations of path.
3823
3824             Parameters:
3825                 theSeqBases - list of  Bases shape to be extruded.
3826                 theLocations - list of locations on the path corresponding
3827                                specified list of the Bases shapes. Number of locations
3828                                should be equal to number of bases or list of locations can be empty.
3829                 thePath - Path shape to extrude the base shape along it.
3830                 theWithContact - the mode defining that the section is translated to be in
3831                                  contact with the spine(0/1)
3832                 theWithCorrection - defining that the section is rotated to be
3833                                     orthogonal to the spine tangent in the correspondent point (0/1)
3834                 theName Object name; when specified, this parameter is used
3835                         for result publication in the study. Otherwise, if automatic
3836                         publication is switched on, default value is used for result name.
3837
3838             Returns:
3839                 New GEOM.GEOM_Object, containing the created pipe.
3840             """
3841             anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3842                                                               theLocations, thePath,
3843                                                               theWithContact, theWithCorrection)
3844             RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3845             self._autoPublish(anObj, theName, "pipe")
3846             return anObj
3847
3848         ## Create a shape by extrusion of the profile shape along
3849         #  the path shape. The path shape can be a wire or a edge.
3850         #  the several profiles can be specified in the several locations of path.
3851         #  @param theSeqBases - list of  Bases shape to be extruded. Base shape must be
3852         #                       shell or face. If number of faces in neighbour sections
3853         #                       aren't coincided result solid between such sections will
3854         #                       be created using external boundaries of this shells.
3855         #  @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3856         #                          This list is used for searching correspondences between
3857         #                          faces in the sections. Size of this list must be equal
3858         #                          to size of list of base shapes.
3859         #  @param theLocations - list of locations on the path corresponding
3860         #                        specified list of the Bases shapes. Number of locations
3861         #                        should be equal to number of bases. First and last
3862         #                        locations must be coincided with first and last vertexes
3863         #                        of path correspondingly.
3864         #  @param thePath - Path shape to extrude the base shape along it.
3865         #  @param theWithContact - the mode defining that the section is translated to be in
3866         #                          contact with the spine.
3867         #  @param theWithCorrection - defining that the section is rotated to be
3868         #                             orthogonal to the spine tangent in the correspondent point
3869         #  @param theName Object name; when specified, this parameter is used
3870         #         for result publication in the study. Otherwise, if automatic
3871         #         publication is switched on, default value is used for result name.
3872         #
3873         #  @return New GEOM.GEOM_Object, containing the created solids.
3874         #
3875         #  @ref tui_creation_pipe_with_shell_sec "Example"
3876         @ManageTransactions("PrimOp")
3877         def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3878                                       theLocations, thePath,
3879                                       theWithContact, theWithCorrection, theName=None):
3880             """
3881             Create a shape by extrusion of the profile shape along
3882             the path shape. The path shape can be a wire or a edge.
3883             the several profiles can be specified in the several locations of path.
3884
3885             Parameters:
3886                 theSeqBases - list of  Bases shape to be extruded. Base shape must be
3887                               shell or face. If number of faces in neighbour sections
3888                               aren't coincided result solid between such sections will
3889                               be created using external boundaries of this shells.
3890                 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3891                                  This list is used for searching correspondences between
3892                                  faces in the sections. Size of this list must be equal
3893                                  to size of list of base shapes.
3894                 theLocations - list of locations on the path corresponding
3895                                specified list of the Bases shapes. Number of locations
3896                                should be equal to number of bases. First and last
3897                                locations must be coincided with first and last vertexes
3898                                of path correspondingly.
3899                 thePath - Path shape to extrude the base shape along it.
3900                 theWithContact - the mode defining that the section is translated to be in
3901                                  contact with the spine (0/1)
3902                 theWithCorrection - defining that the section is rotated to be
3903                                     orthogonal to the spine tangent in the correspondent point (0/1)
3904                 theName Object name; when specified, this parameter is used
3905                         for result publication in the study. Otherwise, if automatic
3906                         publication is switched on, default value is used for result name.
3907
3908             Returns:
3909                 New GEOM.GEOM_Object, containing the created solids.
3910             """
3911             anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3912                                                           theLocations, thePath,
3913                                                           theWithContact, theWithCorrection)
3914             RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3915             self._autoPublish(anObj, theName, "pipe")
3916             return anObj
3917
3918         ## Create a shape by extrusion of the profile shape along
3919         #  the path shape. This function is used only for debug pipe
3920         #  functionality - it is a version of function MakePipeWithShellSections()
3921         #  which give a possibility to recieve information about
3922         #  creating pipe between each pair of sections step by step.
3923         @ManageTransactions("PrimOp")
3924         def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3925                                              theLocations, thePath,
3926                                              theWithContact, theWithCorrection, theName=None):
3927             """
3928             Create a shape by extrusion of the profile shape along
3929             the path shape. This function is used only for debug pipe
3930             functionality - it is a version of previous function
3931             geompy.MakePipeWithShellSections() which give a possibility to
3932             recieve information about creating pipe between each pair of
3933             sections step by step.
3934             """
3935             res = []
3936             nbsect = len(theSeqBases)
3937             nbsubsect = len(theSeqSubBases)
3938             #print "nbsect = ",nbsect
3939             for i in range(1,nbsect):
3940                 #print "  i = ",i
3941                 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3942                 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3943                 tmpSeqSubBases = []
3944                 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3945                 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3946                                                               tmpLocations, thePath,
3947                                                               theWithContact, theWithCorrection)
3948                 if self.PrimOp.IsDone() == 0:
3949                     print "Problems with pipe creation between ",i," and ",i+1," sections"
3950                     RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3951                     break
3952                 else:
3953                     print "Pipe between ",i," and ",i+1," sections is OK"
3954                     res.append(anObj)
3955                     pass
3956                 pass
3957
3958             resc = self.MakeCompound(res)
3959             #resc = self.MakeSewing(res, 0.001)
3960             #print "resc: ",resc
3961             self._autoPublish(resc, theName, "pipe")
3962             return resc
3963
3964         ## Create solids between given sections
3965         #  @param theSeqBases - list of sections (shell or face).
3966         #  @param theLocations - list of corresponding vertexes
3967         #  @param theName Object name; when specified, this parameter is used
3968         #         for result publication in the study. Otherwise, if automatic
3969         #         publication is switched on, default value is used for result name.
3970         #
3971         #  @return New GEOM.GEOM_Object, containing the created solids.
3972         #
3973         #  @ref tui_creation_pipe_without_path "Example"
3974         @ManageTransactions("PrimOp")
3975         def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3976             """
3977             Create solids between given sections
3978
3979             Parameters:
3980                 theSeqBases - list of sections (shell or face).
3981                 theLocations - list of corresponding vertexes
3982                 theName Object name; when specified, this parameter is used
3983                         for result publication in the study. Otherwise, if automatic
3984                         publication is switched on, default value is used for result name.
3985
3986             Returns:
3987                 New GEOM.GEOM_Object, containing the created solids.
3988             """
3989             anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
3990             RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
3991             self._autoPublish(anObj, theName, "pipe")
3992             return anObj
3993
3994         ## Create a shape by extrusion of the base shape along
3995         #  the path shape with constant bi-normal direction along the given vector.
3996         #  The path shape can be a wire or an edge.
3997         #  @param theBase Base shape to be extruded.
3998         #  @param thePath Path shape to extrude the base shape along it.
3999         #  @param theVec Vector defines a constant binormal direction to keep the
4000         #                same angle beetween the direction and the sections
4001         #                along the sweep surface.
4002         #  @param theName Object name; when specified, this parameter is used
4003         #         for result publication in the study. Otherwise, if automatic
4004         #         publication is switched on, default value is used for result name.
4005         #
4006         #  @return New GEOM.GEOM_Object, containing the created pipe.
4007         #
4008         #  @ref tui_creation_pipe "Example"
4009         @ManageTransactions("PrimOp")
4010         def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
4011             """
4012             Create a shape by extrusion of the base shape along
4013             the path shape with constant bi-normal direction along the given vector.
4014             The path shape can be a wire or an edge.
4015
4016             Parameters:
4017                 theBase Base shape to be extruded.
4018                 thePath Path shape to extrude the base shape along it.
4019                 theVec Vector defines a constant binormal direction to keep the
4020                        same angle beetween the direction and the sections
4021                        along the sweep surface.
4022                 theName Object name; when specified, this parameter is used
4023                         for result publication in the study. Otherwise, if automatic
4024                         publication is switched on, default value is used for result name.
4025
4026             Returns:
4027                 New GEOM.GEOM_Object, containing the created pipe.
4028             """
4029             # Example: see GEOM_TestAll.py
4030             anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
4031             RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4032             self._autoPublish(anObj, theName, "pipe")
4033             return anObj
4034
4035         ## Makes a thick solid from a face or a shell
4036         #  @param theShape Face or Shell to be thicken
4037         #  @param theThickness Thickness of the resulting solid
4038         #  @param theName Object name; when specified, this parameter is used
4039         #         for result publication in the study. Otherwise, if automatic
4040         #         publication is switched on, default value is used for result name.
4041         #
4042         #  @return New GEOM.GEOM_Object, containing the created solid
4043         #
4044         @ManageTransactions("PrimOp")
4045         def MakeThickSolid(self, theShape, theThickness, theName=None):
4046             """
4047             Make a thick solid from a face or a shell
4048
4049             Parameters:
4050                  theShape Face or Shell to be thicken
4051                  theThickness Thickness of the resulting solid
4052                  theName Object name; when specified, this parameter is used
4053                  for result publication in the study. Otherwise, if automatic
4054                  publication is switched on, default value is used for result name.
4055
4056             Returns:
4057                 New GEOM.GEOM_Object, containing the created solid
4058             """
4059             # Example: see GEOM_TestAll.py
4060             anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
4061             RaiseIfFailed("MakeThickening", self.PrimOp)
4062             self._autoPublish(anObj, theName, "pipe")
4063             return anObj
4064
4065
4066         ## Modifies a face or a shell to make it a thick solid
4067         #  @param theShape Face or Shell to be thicken
4068         #  @param theThickness Thickness of the resulting solid
4069         #
4070         #  @return The modified shape
4071         #
4072         @ManageTransactions("PrimOp")
4073         def Thicken(self, theShape, theThickness):
4074             """
4075             Modifies a face or a shell to make it a thick solid
4076
4077             Parameters:
4078                 theBase Base shape to be extruded.
4079                 thePath Path shape to extrude the base shape along it.
4080                 theName Object name; when specified, this parameter is used
4081                         for result publication in the study. Otherwise, if automatic
4082                         publication is switched on, default value is used for result name.
4083
4084             Returns:
4085                 The modified shape
4086             """
4087             # Example: see GEOM_TestAll.py
4088             anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
4089             RaiseIfFailed("MakeThickening", self.PrimOp)
4090             return anObj
4091
4092         ## Build a middle path of a pipe-like shape.
4093         #  The path shape can be a wire or an edge.
4094         #  @param theShape It can be closed or unclosed pipe-like shell
4095         #                  or a pipe-like solid.
4096         #  @param theBase1, theBase2 Two bases of the supposed pipe. This
4097         #                            should be wires or faces of theShape.
4098         #  @param theName Object name; when specified, this parameter is used
4099         #         for result publication in the study. Otherwise, if automatic
4100         #         publication is switched on, default value is used for result name.
4101         #
4102         #  @note It is not assumed that exact or approximate copy of theShape
4103         #        can be obtained by applying existing Pipe operation on the
4104         #        resulting "Path" wire taking theBase1 as the base - it is not
4105         #        always possible; though in some particular cases it might work
4106         #        it is not guaranteed. Thus, RestorePath function should not be
4107         #        considered as an exact reverse operation of the Pipe.
4108         #
4109         #  @return New GEOM.GEOM_Object, containing an edge or wire that represent
4110         #                                source pipe's "path".
4111         #
4112         #  @ref tui_creation_pipe_path "Example"
4113         @ManageTransactions("PrimOp")
4114         def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4115             """
4116             Build a middle path of a pipe-like shape.
4117             The path shape can be a wire or an edge.
4118
4119             Parameters:
4120                 theShape It can be closed or unclosed pipe-like shell
4121                          or a pipe-like solid.
4122                 theBase1, theBase2 Two bases of the supposed pipe. This
4123                                    should be wires or faces of theShape.
4124                 theName Object name; when specified, this parameter is used
4125                         for result publication in the study. Otherwise, if automatic
4126                         publication is switched on, default value is used for result name.
4127
4128             Returns:
4129                 New GEOM_Object, containing an edge or wire that represent
4130                                  source pipe's path.
4131             """
4132             anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4133             RaiseIfFailed("RestorePath", self.PrimOp)
4134             self._autoPublish(anObj, theName, "path")
4135             return anObj
4136
4137         ## Build a middle path of a pipe-like shape.
4138         #  The path shape can be a wire or an edge.
4139         #  @param theShape It can be closed or unclosed pipe-like shell
4140         #                  or a pipe-like solid.
4141         #  @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4142         #                                should be lists of edges of theShape.
4143         #  @param theName Object name; when specified, this parameter is used
4144         #         for result publication in the study. Otherwise, if automatic
4145         #         publication is switched on, default value is used for result name.
4146         #
4147         #  @note It is not assumed that exact or approximate copy of theShape
4148         #        can be obtained by applying existing Pipe operation on the
4149         #        resulting "Path" wire taking theBase1 as the base - it is not
4150         #        always possible; though in some particular cases it might work
4151         #        it is not guaranteed. Thus, RestorePath function should not be
4152         #        considered as an exact reverse operation of the Pipe.
4153         #
4154         #  @return New GEOM.GEOM_Object, containing an edge or wire that represent
4155         #                                source pipe's "path".
4156         #
4157         #  @ref tui_creation_pipe_path "Example"
4158         @ManageTransactions("PrimOp")
4159         def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4160             """
4161             Build a middle path of a pipe-like shape.
4162             The path shape can be a wire or an edge.
4163
4164             Parameters:
4165                 theShape It can be closed or unclosed pipe-like shell
4166                          or a pipe-like solid.
4167                 listEdges1, listEdges2 Two bases of the supposed pipe. This
4168                                        should be lists of edges of theShape.
4169                 theName Object name; when specified, this parameter is used
4170                         for result publication in the study. Otherwise, if automatic
4171                         publication is switched on, default value is used for result name.
4172
4173             Returns:
4174                 New GEOM_Object, containing an edge or wire that represent
4175                                  source pipe's path.
4176             """
4177             anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4178             RaiseIfFailed("RestorePath", self.PrimOp)
4179             self._autoPublish(anObj, theName, "path")
4180             return anObj
4181
4182         # end of l3_complex
4183         ## @}
4184
4185         ## @addtogroup l3_advanced
4186         ## @{
4187
4188         ## Create a linear edge with specified ends.
4189         #  @param thePnt1 Point for the first end of edge.
4190         #  @param thePnt2 Point for the second end of edge.
4191         #  @param theName Object name; when specified, this parameter is used
4192         #         for result publication in the study. Otherwise, if automatic
4193         #         publication is switched on, default value is used for result name.
4194         #
4195         #  @return New GEOM.GEOM_Object, containing the created edge.
4196         #
4197         #  @ref tui_creation_edge "Example"
4198         @ManageTransactions("ShapesOp")
4199         def MakeEdge(self, thePnt1, thePnt2, theName=None):
4200             """
4201             Create a linear edge with specified ends.
4202
4203             Parameters:
4204                 thePnt1 Point for the first end of edge.
4205                 thePnt2 Point for the second end of edge.
4206                 theName Object name; when specified, this parameter is used
4207                         for result publication in the study. Otherwise, if automatic
4208                         publication is switched on, default value is used for result name.
4209
4210             Returns:
4211                 New GEOM.GEOM_Object, containing the created edge.
4212             """
4213             # Example: see GEOM_TestAll.py
4214             anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4215             RaiseIfFailed("MakeEdge", self.ShapesOp)
4216             self._autoPublish(anObj, theName, "edge")
4217             return anObj
4218
4219         ## Create a new edge, corresponding to the given length on the given curve.
4220         #  @param theRefCurve The referenced curve (edge).
4221         #  @param theLength Length on the referenced curve. It can be negative.
4222         #  @param theStartPoint Any point can be selected for it, the new edge will begin
4223         #                       at the end of \a theRefCurve, close to the selected point.
4224         #                       If None, start from the first point of \a theRefCurve.
4225         #  @param theName Object name; when specified, this parameter is used
4226         #         for result publication in the study. Otherwise, if automatic
4227         #         publication is switched on, default value is used for result name.
4228         #
4229         #  @return New GEOM.GEOM_Object, containing the created edge.
4230         #
4231         #  @ref tui_creation_edge "Example"
4232         @ManageTransactions("ShapesOp")
4233         def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4234             """
4235             Create a new edge, corresponding to the given length on the given curve.
4236
4237             Parameters:
4238                 theRefCurve The referenced curve (edge).
4239                 theLength Length on the referenced curve. It can be negative.
4240                 theStartPoint Any point can be selected for it, the new edge will begin
4241                               at the end of theRefCurve, close to the selected point.
4242                               If None, start from the first point of theRefCurve.
4243                 theName Object name; when specified, this parameter is used
4244                         for result publication in the study. Otherwise, if automatic
4245                         publication is switched on, default value is used for result name.
4246
4247             Returns:
4248                 New GEOM.GEOM_Object, containing the created edge.
4249             """
4250             # Example: see GEOM_TestAll.py
4251             theLength, Parameters = ParseParameters(theLength)
4252             anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4253             RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4254             anObj.SetParameters(Parameters)
4255             self._autoPublish(anObj, theName, "edge")
4256             return anObj
4257
4258         ## Create an edge from specified wire.
4259         #  @param theWire source Wire
4260         #  @param theLinearTolerance linear tolerance value (default = 1e-07)
4261         #  @param theAngularTolerance angular tolerance value (default = 1e-12)
4262         #  @param theName Object name; when specified, this parameter is used
4263         #         for result publication in the study. Otherwise, if automatic
4264         #         publication is switched on, default value is used for result name.
4265         #
4266         #  @return New GEOM.GEOM_Object, containing the created edge.
4267         #
4268         #  @ref tui_creation_edge "Example"
4269         @ManageTransactions("ShapesOp")
4270         def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4271             """
4272             Create an edge from specified wire.
4273
4274             Parameters:
4275                 theWire source Wire
4276                 theLinearTolerance linear tolerance value (default = 1e-07)
4277                 theAngularTolerance angular tolerance value (default = 1e-12)
4278                 theName Object name; when specified, this parameter is used
4279                         for result publication in the study. Otherwise, if automatic
4280                         publication is switched on, default value is used for result name.
4281
4282             Returns:
4283                 New GEOM.GEOM_Object, containing the created edge.
4284             """
4285             # Example: see GEOM_TestAll.py
4286             anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4287             RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4288             self._autoPublish(anObj, theName, "edge")
4289             return anObj
4290
4291         ## Create a wire from the set of edges and wires.
4292         #  @param theEdgesAndWires List of edges and/or wires.
4293         #  @param theTolerance Maximum distance between vertices, that will be merged.
4294         #                      Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4295         #  @param theName Object name; when specified, this parameter is used
4296         #         for result publication in the study. Otherwise, if automatic
4297         #         publication is switched on, default value is used for result name.
4298         #
4299         #  @return New GEOM.GEOM_Object, containing the created wire.
4300         #
4301         #  @ref tui_creation_wire "Example"
4302         @ManageTransactions("ShapesOp")
4303         def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4304             """
4305             Create a wire from the set of edges and wires.
4306
4307             Parameters:
4308                 theEdgesAndWires List of edges and/or wires.
4309                 theTolerance Maximum distance between vertices, that will be merged.
4310                              Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4311                 theName Object name; when specified, this parameter is used
4312                         for result publication in the study. Otherwise, if automatic
4313                         publication is switched on, default value is used for result name.
4314
4315             Returns:
4316                 New GEOM.GEOM_Object, containing the created wire.
4317             """
4318             # Example: see GEOM_TestAll.py
4319             anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4320             RaiseIfFailed("MakeWire", self.ShapesOp)
4321             self._autoPublish(anObj, theName, "wire")
4322             return anObj
4323
4324         ## Create a face on the given wire.
4325         #  @param theWire closed Wire or Edge to build the face on.
4326         #  @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4327         #                        If the tolerance of the obtained planar face is less
4328         #                        than 1e-06, this face will be returned, otherwise the
4329         #                        algorithm tries to build any suitable face on the given
4330         #                        wire and prints a warning message.
4331         #  @param theName Object name; when specified, this parameter is used
4332         #         for result publication in the study. Otherwise, if automatic
4333         #         publication is switched on, default value is used for result name.
4334         #
4335         #  @return New GEOM.GEOM_Object, containing the created face.
4336         #
4337         #  @ref tui_creation_face "Example"
4338         @ManageTransactions("ShapesOp")
4339         def MakeFace(self, theWire, isPlanarWanted, theName=None):
4340             """
4341             Create a face on the given wire.
4342
4343             Parameters:
4344                 theWire closed Wire or Edge to build the face on.
4345                 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4346                                If the tolerance of the obtained planar face is less
4347                                than 1e-06, this face will be returned, otherwise the
4348                                algorithm tries to build any suitable face on the given
4349                                wire and prints a warning message.
4350                 theName Object name; when specified, this parameter is used
4351                         for result publication in the study. Otherwise, if automatic
4352                         publication is switched on, default value is used for result name.
4353
4354             Returns:
4355                 New GEOM.GEOM_Object, containing the created face.
4356             """
4357             # Example: see GEOM_TestAll.py
4358             anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4359             if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4360                 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4361             else:
4362                 RaiseIfFailed("MakeFace", self.ShapesOp)
4363             self._autoPublish(anObj, theName, "face")
4364             return anObj
4365
4366         ## Create a face on the given wires set.
4367         #  @param theWires List of closed wires or edges to build the face on.
4368         #  @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4369         #                        If the tolerance of the obtained planar face is less
4370         #                        than 1e-06, this face will be returned, otherwise the
4371         #                        algorithm tries to build any suitable face on the given
4372         #                        wire and prints a warning message.
4373         #  @param 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         #  @return New GEOM.GEOM_Object, containing the created face.
4378         #
4379         #  @ref tui_creation_face "Example"
4380         @ManageTransactions("ShapesOp")
4381         def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4382             """
4383             Create a face on the given wires set.
4384
4385             Parameters:
4386                 theWires List of closed wires or edges to build the face on.
4387                 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4388                                If the tolerance of the obtained planar face is less
4389                                than 1e-06, this face will be returned, otherwise the
4390                                algorithm tries to build any suitable face on the given
4391                                wire and prints a warning message.
4392                 theName Object name; when specified, this parameter is used
4393                         for result publication in the study. Otherwise, if automatic
4394                         publication is switched on, default value is used for result name.
4395
4396             Returns:
4397                 New GEOM.GEOM_Object, containing the created face.
4398             """
4399             # Example: see GEOM_TestAll.py
4400             anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4401             if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4402                 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4403             else:
4404                 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4405             self._autoPublish(anObj, theName, "face")
4406             return anObj
4407
4408         ## See MakeFaceWires() method for details.
4409         #
4410         #  @ref tui_creation_face "Example 1"
4411         #  \n @ref swig_MakeFaces  "Example 2"
4412         def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4413             """
4414             See geompy.MakeFaceWires() method for details.
4415             """
4416             # Example: see GEOM_TestOthers.py
4417             # note: auto-publishing is done in self.MakeFaceWires()
4418             anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4419             return anObj
4420
4421         ## Create a shell from the set of faces and shells.
4422         #  @param theFacesAndShells List of faces and/or shells.
4423         #  @param theName Object name; when specified, this parameter is used
4424         #         for result publication in the study. Otherwise, if automatic
4425         #         publication is switched on, default value is used for result name.
4426         #
4427         #  @return New GEOM.GEOM_Object, containing the created shell.
4428         #
4429         #  @ref tui_creation_shell "Example"
4430         @ManageTransactions("ShapesOp")
4431         def MakeShell(self, theFacesAndShells, theName=None):
4432             """
4433             Create a shell from the set of faces and shells.
4434
4435             Parameters:
4436                 theFacesAndShells List of faces and/or shells.
4437                 theName Object name; when specified, this parameter is used
4438                         for result publication in the study. Otherwise, if automatic
4439                         publication is switched on, default value is used for result name.
4440
4441             Returns:
4442                 New GEOM.GEOM_Object, containing the created shell.
4443             """
4444             # Example: see GEOM_TestAll.py
4445             anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4446             RaiseIfFailed("MakeShell", self.ShapesOp)
4447             self._autoPublish(anObj, theName, "shell")
4448             return anObj
4449
4450         ## Create a solid, bounded by the given shells.
4451         #  @param theShells Sequence of bounding shells.
4452         #  @param theName Object name; when specified, this parameter is used
4453         #         for result publication in the study. Otherwise, if automatic
4454         #         publication is switched on, default value is used for result name.
4455         #
4456         #  @return New GEOM.GEOM_Object, containing the created solid.
4457         #
4458         #  @ref tui_creation_solid "Example"
4459         @ManageTransactions("ShapesOp")
4460         def MakeSolid(self, theShells, theName=None):
4461             """
4462             Create a solid, bounded by the given shells.
4463
4464             Parameters:
4465                 theShells Sequence of bounding shells.
4466                 theName Object name; when specified, this parameter is used
4467                         for result publication in the study. Otherwise, if automatic
4468                         publication is switched on, default value is used for result name.
4469
4470             Returns:
4471                 New GEOM.GEOM_Object, containing the created solid.
4472             """
4473             # Example: see GEOM_TestAll.py
4474             if len(theShells) == 1:
4475                 descr = self._IsGoodForSolid(theShells[0])
4476                 #if len(descr) > 0:
4477                 #    raise RuntimeError, "MakeSolidShells : " + descr
4478                 if descr == "WRN_SHAPE_UNCLOSED":
4479                     raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4480             anObj = self.ShapesOp.MakeSolidShells(theShells)
4481             RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4482             self._autoPublish(anObj, theName, "solid")
4483             return anObj
4484
4485         ## Create a compound of the given shapes.
4486         #  @param theShapes List of shapes to put in compound.
4487         #  @param 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         #  @return New GEOM.GEOM_Object, containing the created compound.
4492         #
4493         #  @ref tui_creation_compound "Example"
4494         @ManageTransactions("ShapesOp")
4495         def MakeCompound(self, theShapes, theName=None):
4496             """
4497             Create a compound of the given shapes.
4498
4499             Parameters:
4500                 theShapes List of shapes to put in compound.
4501                 theName Object name; when specified, this parameter is used
4502                         for result publication in the study. Otherwise, if automatic
4503                         publication is switched on, default value is used for result name.
4504
4505             Returns:
4506                 New GEOM.GEOM_Object, containing the created compound.
4507             """
4508             # Example: see GEOM_TestAll.py
4509             anObj = self.ShapesOp.MakeCompound(theShapes)
4510             RaiseIfFailed("MakeCompound", self.ShapesOp)
4511             self._autoPublish(anObj, theName, "compound")
4512             return anObj
4513
4514         # end of l3_advanced
4515         ## @}
4516
4517         ## @addtogroup l2_measure
4518         ## @{
4519
4520         ## Gives quantity of faces in the given shape.
4521         #  @param theShape Shape to count faces of.
4522         #  @return Quantity of faces.
4523         #
4524         #  @ref swig_NumberOf "Example"
4525         @ManageTransactions("ShapesOp")
4526         def NumberOfFaces(self, theShape):
4527             """
4528             Gives quantity of faces in the given shape.
4529
4530             Parameters:
4531                 theShape Shape to count faces of.
4532
4533             Returns:
4534                 Quantity of faces.
4535             """
4536             # Example: see GEOM_TestOthers.py
4537             nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4538             RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4539             return nb_faces
4540
4541         ## Gives quantity of edges in the given shape.
4542         #  @param theShape Shape to count edges of.
4543         #  @return Quantity of edges.
4544         #
4545         #  @ref swig_NumberOf "Example"
4546         @ManageTransactions("ShapesOp")
4547         def NumberOfEdges(self, theShape):
4548             """
4549             Gives quantity of edges in the given shape.
4550
4551             Parameters:
4552                 theShape Shape to count edges of.
4553
4554             Returns:
4555                 Quantity of edges.
4556             """
4557             # Example: see GEOM_TestOthers.py
4558             nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4559             RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4560             return nb_edges
4561
4562         ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4563         #  @param theShape Shape to count sub-shapes of.
4564         #  @param theShapeType Type of sub-shapes to count (see ShapeType())
4565         #  @return Quantity of sub-shapes of given type.
4566         #
4567         #  @ref swig_NumberOf "Example"
4568         @ManageTransactions("ShapesOp")
4569         def NumberOfSubShapes(self, theShape, theShapeType):
4570             """
4571             Gives quantity of sub-shapes of type theShapeType in the given shape.
4572
4573             Parameters:
4574                 theShape Shape to count sub-shapes of.
4575                 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4576
4577             Returns:
4578                 Quantity of sub-shapes of given type.
4579             """
4580             # Example: see GEOM_TestOthers.py
4581             nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4582             RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4583             return nb_ss
4584
4585         ## Gives quantity of solids in the given shape.
4586         #  @param theShape Shape to count solids in.
4587         #  @return Quantity of solids.
4588         #
4589         #  @ref swig_NumberOf "Example"
4590         @ManageTransactions("ShapesOp")
4591         def NumberOfSolids(self, theShape):
4592             """
4593             Gives quantity of solids in the given shape.
4594
4595             Parameters:
4596                 theShape Shape to count solids in.
4597
4598             Returns:
4599                 Quantity of solids.
4600             """
4601             # Example: see GEOM_TestOthers.py
4602             nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4603             RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4604             return nb_solids
4605
4606         # end of l2_measure
4607         ## @}
4608
4609         ## @addtogroup l3_healing
4610         ## @{
4611
4612         ## Reverses an orientation the given shape.
4613         #  @param theShape Shape to be reversed.
4614         #  @param theName Object name; when specified, this parameter is used
4615         #         for result publication in the study. Otherwise, if automatic
4616         #         publication is switched on, default value is used for result name.
4617         #
4618         #  @return The reversed copy of theShape.
4619         #
4620         #  @ref swig_ChangeOrientation "Example"
4621         @ManageTransactions("ShapesOp")
4622         def ChangeOrientation(self, theShape, theName=None):
4623             """
4624             Reverses an orientation the given shape.
4625
4626             Parameters:
4627                 theShape Shape to be reversed.
4628                 theName Object name; when specified, this parameter is used
4629                         for result publication in the study. Otherwise, if automatic
4630                         publication is switched on, default value is used for result name.
4631
4632             Returns:
4633                 The reversed copy of theShape.
4634             """
4635             # Example: see GEOM_TestAll.py
4636             anObj = self.ShapesOp.ChangeOrientation(theShape)
4637             RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4638             self._autoPublish(anObj, theName, "reversed")
4639             return anObj
4640
4641         ## See ChangeOrientation() method for details.
4642         #
4643         #  @ref swig_OrientationChange "Example"
4644         def OrientationChange(self, theShape, theName=None):
4645             """
4646             See geompy.ChangeOrientation method for details.
4647             """
4648             # Example: see GEOM_TestOthers.py
4649             # note: auto-publishing is done in self.ChangeOrientation()
4650             anObj = self.ChangeOrientation(theShape, theName)
4651             return anObj
4652
4653         # end of l3_healing
4654         ## @}
4655
4656         ## @addtogroup l4_obtain
4657         ## @{
4658
4659         ## Retrieve all free faces from the given shape.
4660         #  Free face is a face, which is not shared between two shells of the shape.
4661         #  @param theShape Shape to find free faces in.
4662         #  @return List of IDs of all free faces, contained in theShape.
4663         #
4664         #  @ref tui_measurement_tools_page "Example"
4665         @ManageTransactions("ShapesOp")
4666         def GetFreeFacesIDs(self,theShape):
4667             """
4668             Retrieve all free faces from the given shape.
4669             Free face is a face, which is not shared between two shells of the shape.
4670
4671             Parameters:
4672                 theShape Shape to find free faces in.
4673
4674             Returns:
4675                 List of IDs of all free faces, contained in theShape.
4676             """
4677             # Example: see GEOM_TestOthers.py
4678             anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4679             RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4680             return anIDs
4681
4682         ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4683         #  @param theShape1 Shape to find sub-shapes in.
4684         #  @param theShape2 Shape to find shared sub-shapes with.
4685         #  @param theShapeType Type of sub-shapes to be retrieved.
4686         #  @param theName Object name; when specified, this parameter is used
4687         #         for result publication in the study. Otherwise, if automatic
4688         #         publication is switched on, default value is used for result name.
4689         #
4690         #  @return List of sub-shapes of theShape1, shared with theShape2.
4691         #
4692         #  @ref swig_GetSharedShapes "Example"
4693         @ManageTransactions("ShapesOp")
4694         def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4695             """
4696             Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4697
4698             Parameters:
4699                 theShape1 Shape to find sub-shapes in.
4700                 theShape2 Shape to find shared sub-shapes with.
4701                 theShapeType Type of sub-shapes to be retrieved.
4702                 theName Object name; when specified, this parameter is used
4703                         for result publication in the study. Otherwise, if automatic
4704                         publication is switched on, default value is used for result name.
4705
4706             Returns:
4707                 List of sub-shapes of theShape1, shared with theShape2.
4708             """
4709             # Example: see GEOM_TestOthers.py
4710             aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4711             RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4712             self._autoPublish(aList, theName, "shared")
4713             return aList
4714
4715         ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4716         #  @param theShapes Shapes to find common sub-shapes of.
4717         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4718         #  @param theName Object name; when specified, this parameter is used
4719         #         for result publication in the study. Otherwise, if automatic
4720         #         publication is switched on, default value is used for result name.
4721         #
4722         #  @return List of objects, that are sub-shapes of all given shapes.
4723         #
4724         #  @ref swig_GetSharedShapes "Example"
4725         @ManageTransactions("ShapesOp")
4726         def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4727             """
4728             Get all sub-shapes, shared by all shapes in the list theShapes.
4729
4730             Parameters:
4731                 theShapes Shapes to find common sub-shapes of.
4732                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4733                 theName Object name; when specified, this parameter is used
4734                         for result publication in the study. Otherwise, if automatic
4735                         publication is switched on, default value is used for result name.
4736
4737             Returns:
4738                 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4739             """
4740             # Example: see GEOM_TestOthers.py
4741             aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4742             RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4743             self._autoPublish(aList, theName, "shared")
4744             return aList
4745
4746         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4747         #  situated relatively the specified plane by the certain way,
4748         #  defined through <VAR>theState</VAR> parameter.
4749         #  @param theShape Shape to find sub-shapes of.
4750         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4751         #  @param theAx1 Vector (or line, or linear edge), specifying normal
4752         #                direction and location of the plane to find shapes on.
4753         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4754         #  @param theName Object name; when specified, this parameter is used
4755         #         for result publication in the study. Otherwise, if automatic
4756         #         publication is switched on, default value is used for result name.
4757         #
4758         #  @return List of all found sub-shapes.
4759         #
4760         #  @ref swig_GetShapesOnPlane "Example"
4761         @ManageTransactions("ShapesOp")
4762         def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4763             """
4764             Find in theShape all sub-shapes of type theShapeType,
4765             situated relatively the specified plane by the certain way,
4766             defined through theState parameter.
4767
4768             Parameters:
4769                 theShape Shape to find sub-shapes of.
4770                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4771                 theAx1 Vector (or line, or linear edge), specifying normal
4772                        direction and location of the plane to find shapes on.
4773                 theState The state of the sub-shapes to find (see GEOM::shape_state)
4774                 theName Object name; when specified, this parameter is used
4775                         for result publication in the study. Otherwise, if automatic
4776                         publication is switched on, default value is used for result name.
4777
4778             Returns:
4779                 List of all found sub-shapes.
4780             """
4781             # Example: see GEOM_TestOthers.py
4782             aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4783             RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4784             self._autoPublish(aList, theName, "shapeOnPlane")
4785             return aList
4786
4787         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4788         #  situated relatively the specified plane by the certain way,
4789         #  defined through <VAR>theState</VAR> parameter.
4790         #  @param theShape Shape to find sub-shapes of.
4791         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4792         #  @param theAx1 Vector (or line, or linear edge), specifying normal
4793         #                direction and location of the plane to find shapes on.
4794         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4795         #
4796         #  @return List of all found sub-shapes indices.
4797         #
4798         #  @ref swig_GetShapesOnPlaneIDs "Example"
4799         @ManageTransactions("ShapesOp")
4800         def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4801             """
4802             Find in theShape all sub-shapes of type theShapeType,
4803             situated relatively the specified plane by the certain way,
4804             defined through theState parameter.
4805
4806             Parameters:
4807                 theShape Shape to find sub-shapes of.
4808                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4809                 theAx1 Vector (or line, or linear edge), specifying normal
4810                        direction and location of the plane to find shapes on.
4811                 theState The state of the sub-shapes to find (see GEOM::shape_state)
4812
4813             Returns:
4814                 List of all found sub-shapes indices.
4815             """
4816             # Example: see GEOM_TestOthers.py
4817             aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4818             RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4819             return aList
4820
4821         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4822         #  situated relatively the specified plane by the certain way,
4823         #  defined through <VAR>theState</VAR> parameter.
4824         #  @param theShape Shape to find sub-shapes of.
4825         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4826         #  @param theAx1 Vector (or line, or linear edge), specifying normal
4827         #                direction of the plane to find shapes on.
4828         #  @param thePnt Point specifying location of the plane to find shapes on.
4829         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4830         #  @param theName Object name; when specified, this parameter is used
4831         #         for result publication in the study. Otherwise, if automatic
4832         #         publication is switched on, default value is used for result name.
4833         #
4834         #  @return List of all found sub-shapes.
4835         #
4836         #  @ref swig_GetShapesOnPlaneWithLocation "Example"
4837         @ManageTransactions("ShapesOp")
4838         def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4839             """
4840             Find in theShape all sub-shapes of type theShapeType,
4841             situated relatively the specified plane by the certain way,
4842             defined through theState parameter.
4843
4844             Parameters:
4845                 theShape Shape to find sub-shapes of.
4846                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4847                 theAx1 Vector (or line, or linear edge), specifying normal
4848                        direction and location of the plane to find shapes on.
4849                 thePnt Point specifying location of the plane to find shapes on.
4850                 theState The state of the sub-shapes to find (see GEOM::shape_state)
4851                 theName Object name; when specified, this parameter is used
4852                         for result publication in the study. Otherwise, if automatic
4853                         publication is switched on, default value is used for result name.
4854
4855             Returns:
4856                 List of all found sub-shapes.
4857             """
4858             # Example: see GEOM_TestOthers.py
4859             aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4860                                                                theAx1, thePnt, theState)
4861             RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4862             self._autoPublish(aList, theName, "shapeOnPlane")
4863             return aList
4864
4865         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4866         #  situated relatively the specified plane by the certain way,
4867         #  defined through <VAR>theState</VAR> parameter.
4868         #  @param theShape Shape to find sub-shapes of.
4869         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4870         #  @param theAx1 Vector (or line, or linear edge), specifying normal
4871         #                direction of the plane to find shapes on.
4872         #  @param thePnt Point specifying location of the plane to find shapes on.
4873         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4874         #
4875         #  @return List of all found sub-shapes indices.
4876         #
4877         #  @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4878         @ManageTransactions("ShapesOp")
4879         def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4880             """
4881             Find in theShape all sub-shapes of type theShapeType,
4882             situated relatively the specified plane by the certain way,
4883             defined through theState parameter.
4884
4885             Parameters:
4886                 theShape Shape to find sub-shapes of.
4887                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4888                 theAx1 Vector (or line, or linear edge), specifying normal
4889                        direction and location of the plane to find shapes on.
4890                 thePnt Point specifying location of the plane to find shapes on.
4891                 theState The state of the sub-shapes to find (see GEOM::shape_state)
4892
4893             Returns:
4894                 List of all found sub-shapes indices.
4895             """
4896             # Example: see GEOM_TestOthers.py
4897             aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4898                                                                   theAx1, thePnt, theState)
4899             RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4900             return aList
4901
4902         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4903         #  the specified cylinder by the certain way, defined through \a theState parameter.
4904         #  @param theShape Shape to find sub-shapes of.
4905         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4906         #  @param theAxis Vector (or line, or linear edge), specifying
4907         #                 axis of the cylinder to find shapes on.
4908         #  @param theRadius Radius of the cylinder to find shapes on.
4909         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4910         #  @param theName Object name; when specified, this parameter is used
4911         #         for result publication in the study. Otherwise, if automatic
4912         #         publication is switched on, default value is used for result name.
4913         #
4914         #  @return List of all found sub-shapes.
4915         #
4916         #  @ref swig_GetShapesOnCylinder "Example"
4917         @ManageTransactions("ShapesOp")
4918         def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4919             """
4920             Find in theShape all sub-shapes of type theShapeType, situated relatively
4921             the specified cylinder by the certain way, defined through theState parameter.
4922
4923             Parameters:
4924                 theShape Shape to find sub-shapes of.
4925                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4926                 theAxis Vector (or line, or linear edge), specifying
4927                         axis of the cylinder to find shapes on.
4928                 theRadius Radius of the cylinder to find shapes on.
4929                 theState The state of the sub-shapes to find (see GEOM::shape_state)
4930                 theName Object name; when specified, this parameter is used
4931                         for result publication in the study. Otherwise, if automatic
4932                         publication is switched on, default value is used for result name.
4933
4934             Returns:
4935                 List of all found sub-shapes.
4936             """
4937             # Example: see GEOM_TestOthers.py
4938             aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4939             RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4940             self._autoPublish(aList, theName, "shapeOnCylinder")
4941             return aList
4942
4943         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4944         #  the specified cylinder by the certain way, defined through \a theState parameter.
4945         #  @param theShape Shape to find sub-shapes of.
4946         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4947         #  @param theAxis Vector (or line, or linear edge), specifying
4948         #                 axis of the cylinder to find shapes on.
4949         #  @param theRadius Radius of the cylinder to find shapes on.
4950         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4951         #
4952         #  @return List of all found sub-shapes indices.
4953         #
4954         #  @ref swig_GetShapesOnCylinderIDs "Example"
4955         @ManageTransactions("ShapesOp")
4956         def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4957             """
4958             Find in theShape all sub-shapes of type theShapeType, situated relatively
4959             the specified cylinder by the certain way, defined through theState parameter.
4960
4961             Parameters:
4962                 theShape Shape to find sub-shapes of.
4963                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4964                 theAxis Vector (or line, or linear edge), specifying
4965                         axis of the cylinder to find shapes on.
4966                 theRadius Radius of the cylinder to find shapes on.
4967                 theState The state of the sub-shapes to find (see GEOM::shape_state)
4968
4969             Returns:
4970                 List of all found sub-shapes indices.
4971             """
4972             # Example: see GEOM_TestOthers.py
4973             aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4974             RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4975             return aList
4976
4977         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4978         #  the specified cylinder by the certain way, defined through \a theState parameter.
4979         #  @param theShape Shape to find sub-shapes of.
4980         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4981         #  @param theAxis Vector (or line, or linear edge), specifying
4982         #                 axis of the cylinder to find shapes on.
4983         #  @param thePnt Point specifying location of the bottom of the cylinder.
4984         #  @param theRadius Radius of the cylinder to find shapes on.
4985         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4986         #  @param theName Object name; when specified, this parameter is used
4987         #         for result publication in the study. Otherwise, if automatic
4988         #         publication is switched on, default value is used for result name.
4989         #
4990         #  @return List of all found sub-shapes.
4991         #
4992         #  @ref swig_GetShapesOnCylinderWithLocation "Example"
4993         @ManageTransactions("ShapesOp")
4994         def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
4995             """
4996             Find in theShape all sub-shapes of type theShapeType, situated relatively
4997             the specified cylinder by the certain way, defined through theState parameter.
4998
4999             Parameters:
5000                 theShape Shape to find sub-shapes of.
5001                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5002                 theAxis Vector (or line, or linear edge), specifying
5003                         axis of the cylinder to find shapes on.
5004                 theRadius Radius of the cylinder to find shapes on.
5005                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5006                 theName Object name; when specified, this parameter is used
5007                         for result publication in the study. Otherwise, if automatic
5008                         publication is switched on, default value is used for result name.
5009
5010             Returns:
5011                 List of all found sub-shapes.
5012             """
5013             # Example: see GEOM_TestOthers.py
5014             aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5015             RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5016             self._autoPublish(aList, theName, "shapeOnCylinder")
5017             return aList
5018
5019         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5020         #  the specified cylinder by the certain way, defined through \a theState parameter.
5021         #  @param theShape Shape to find sub-shapes of.
5022         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5023         #  @param theAxis Vector (or line, or linear edge), specifying
5024         #                 axis of the cylinder to find shapes on.
5025         #  @param thePnt Point specifying location of the bottom of the cylinder.
5026         #  @param theRadius Radius of the cylinder to find shapes on.
5027         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5028         #
5029         #  @return List of all found sub-shapes indices
5030         #
5031         #  @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5032         @ManageTransactions("ShapesOp")
5033         def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5034             """
5035             Find in theShape all sub-shapes of type theShapeType, situated relatively
5036             the specified cylinder by the certain way, defined through theState parameter.
5037
5038             Parameters:
5039                 theShape Shape to find sub-shapes of.
5040                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5041                 theAxis Vector (or line, or linear edge), specifying
5042                         axis of the cylinder to find shapes on.
5043                 theRadius Radius of the cylinder to find shapes on.
5044                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5045
5046             Returns:
5047                 List of all found sub-shapes indices.
5048             """
5049             # Example: see GEOM_TestOthers.py
5050             aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5051             RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5052             return aList
5053
5054         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5055         #  the specified sphere by the certain way, defined through \a theState parameter.
5056         #  @param theShape Shape to find sub-shapes of.
5057         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5058         #  @param theCenter Point, specifying center of the sphere to find shapes on.
5059         #  @param theRadius Radius of the sphere to find shapes on.
5060         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5061         #  @param theName Object name; when specified, this parameter is used
5062         #         for result publication in the study. Otherwise, if automatic
5063         #         publication is switched on, default value is used for result name.
5064         #
5065         #  @return List of all found sub-shapes.
5066         #
5067         #  @ref swig_GetShapesOnSphere "Example"
5068         @ManageTransactions("ShapesOp")
5069         def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5070             """
5071             Find in theShape all sub-shapes of type theShapeType, situated relatively
5072             the specified sphere by the certain way, defined through theState parameter.
5073
5074             Parameters:
5075                 theShape Shape to find sub-shapes of.
5076                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5077                 theCenter Point, specifying center of the sphere to find shapes on.
5078                 theRadius Radius of the sphere to find shapes on.
5079                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5080                 theName Object name; when specified, this parameter is used
5081                         for result publication in the study. Otherwise, if automatic
5082                         publication is switched on, default value is used for result name.
5083
5084             Returns:
5085                 List of all found sub-shapes.
5086             """
5087             # Example: see GEOM_TestOthers.py
5088             aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5089             RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5090             self._autoPublish(aList, theName, "shapeOnSphere")
5091             return aList
5092
5093         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5094         #  the specified sphere by the certain way, defined through \a theState parameter.
5095         #  @param theShape Shape to find sub-shapes of.
5096         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5097         #  @param theCenter Point, specifying center of the sphere to find shapes on.
5098         #  @param theRadius Radius of the sphere to find shapes on.
5099         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5100         #
5101         #  @return List of all found sub-shapes indices.
5102         #
5103         #  @ref swig_GetShapesOnSphereIDs "Example"
5104         @ManageTransactions("ShapesOp")
5105         def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5106             """
5107             Find in theShape all sub-shapes of type theShapeType, situated relatively
5108             the specified sphere by the certain way, defined through theState parameter.
5109
5110             Parameters:
5111                 theShape Shape to find sub-shapes of.
5112                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5113                 theCenter Point, specifying center of the sphere to find shapes on.
5114                 theRadius Radius of the sphere to find shapes on.
5115                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5116
5117             Returns:
5118                 List of all found sub-shapes indices.
5119             """
5120             # Example: see GEOM_TestOthers.py
5121             aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5122             RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5123             return aList
5124
5125         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5126         #  the specified quadrangle by the certain way, defined through \a theState parameter.
5127         #  @param theShape Shape to find sub-shapes of.
5128         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5129         #  @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5130         #  @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5131         #  @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5132         #  @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5133         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5134         #  @param theName Object name; when specified, this parameter is used
5135         #         for result publication in the study. Otherwise, if automatic
5136         #         publication is switched on, default value is used for result name.
5137         #
5138         #  @return List of all found sub-shapes.
5139         #
5140         #  @ref swig_GetShapesOnQuadrangle "Example"
5141         @ManageTransactions("ShapesOp")
5142         def GetShapesOnQuadrangle(self, theShape, theShapeType,
5143                                   theTopLeftPoint, theTopRigthPoint,
5144                                   theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5145             """
5146             Find in theShape all sub-shapes of type theShapeType, situated relatively
5147             the specified quadrangle by the certain way, defined through theState parameter.
5148
5149             Parameters:
5150                 theShape Shape to find sub-shapes of.
5151                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5152                 theTopLeftPoint Point, specifying top left corner of a quadrangle
5153                 theTopRigthPoint Point, specifying top right corner of a quadrangle
5154                 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5155                 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5156                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5157                 theName Object name; when specified, this parameter is used
5158                         for result publication in the study. Otherwise, if automatic
5159                         publication is switched on, default value is used for result name.
5160
5161             Returns:
5162                 List of all found sub-shapes.
5163             """
5164             # Example: see GEOM_TestOthers.py
5165             aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5166                                                         theTopLeftPoint, theTopRigthPoint,
5167                                                         theBottomLeftPoint, theBottomRigthPoint, theState)
5168             RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5169             self._autoPublish(aList, theName, "shapeOnQuadrangle")
5170             return aList
5171
5172         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5173         #  the specified quadrangle by the certain way, defined through \a theState parameter.
5174         #  @param theShape Shape to find sub-shapes of.
5175         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5176         #  @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5177         #  @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5178         #  @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5179         #  @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5180         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5181         #
5182         #  @return List of all found sub-shapes indices.
5183         #
5184         #  @ref swig_GetShapesOnQuadrangleIDs "Example"
5185         @ManageTransactions("ShapesOp")
5186         def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5187                                      theTopLeftPoint, theTopRigthPoint,
5188                                      theBottomLeftPoint, theBottomRigthPoint, theState):
5189             """
5190             Find in theShape all sub-shapes of type theShapeType, situated relatively
5191             the specified quadrangle by the certain way, defined through theState parameter.
5192
5193             Parameters:
5194                 theShape Shape to find sub-shapes of.
5195                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5196                 theTopLeftPoint Point, specifying top left corner of a quadrangle
5197                 theTopRigthPoint Point, specifying top right corner of a quadrangle
5198                 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5199                 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5200                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5201
5202             Returns:
5203                 List of all found sub-shapes indices.
5204             """
5205
5206             # Example: see GEOM_TestOthers.py
5207             aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5208                                                            theTopLeftPoint, theTopRigthPoint,
5209                                                            theBottomLeftPoint, theBottomRigthPoint, theState)
5210             RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5211             return aList
5212
5213         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5214         #  the specified \a theBox by the certain way, defined through \a theState parameter.
5215         #  @param theBox Shape for relative comparing.
5216         #  @param theShape Shape to find sub-shapes of.
5217         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5218         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5219         #  @param theName Object name; when specified, this parameter is used
5220         #         for result publication in the study. Otherwise, if automatic
5221         #         publication is switched on, default value is used for result name.
5222         #
5223         #  @return List of all found sub-shapes.
5224         #
5225         #  @ref swig_GetShapesOnBox "Example"
5226         @ManageTransactions("ShapesOp")
5227         def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5228             """
5229             Find in theShape all sub-shapes of type theShapeType, situated relatively
5230             the specified theBox by the certain way, defined through theState parameter.
5231
5232             Parameters:
5233                 theBox Shape for relative comparing.
5234                 theShape Shape to find sub-shapes of.
5235                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5236                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5237                 theName Object name; when specified, this parameter is used
5238                         for result publication in the study. Otherwise, if automatic
5239                         publication is switched on, default value is used for result name.
5240
5241             Returns:
5242                 List of all found sub-shapes.
5243             """
5244             # Example: see GEOM_TestOthers.py
5245             aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5246             RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5247             self._autoPublish(aList, theName, "shapeOnBox")
5248             return aList
5249
5250         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5251         #  the specified \a theBox by the certain way, defined through \a theState parameter.
5252         #  @param theBox Shape for relative comparing.
5253         #  @param theShape Shape to find sub-shapes of.
5254         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5255         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5256         #
5257         #  @return List of all found sub-shapes indices.
5258         #
5259         #  @ref swig_GetShapesOnBoxIDs "Example"
5260         @ManageTransactions("ShapesOp")
5261         def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5262             """
5263             Find in theShape all sub-shapes of type theShapeType, situated relatively
5264             the specified theBox by the certain way, defined through theState parameter.
5265
5266             Parameters:
5267                 theBox Shape for relative comparing.
5268                 theShape Shape to find sub-shapes of.
5269                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5270                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5271
5272             Returns:
5273                 List of all found sub-shapes indices.
5274             """
5275             # Example: see GEOM_TestOthers.py
5276             aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5277             RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5278             return aList
5279
5280         ## Find in \a theShape all sub-shapes of type \a theShapeType,
5281         #  situated relatively the specified \a theCheckShape by the
5282         #  certain way, defined through \a theState parameter.
5283         #  @param theCheckShape Shape for relative comparing. It must be a solid.
5284         #  @param theShape Shape to find sub-shapes of.
5285         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5286         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5287         #  @param theName Object name; when specified, this parameter is used
5288         #         for result publication in the study. Otherwise, if automatic
5289         #         publication is switched on, default value is used for result name.
5290         #
5291         #  @return List of all found sub-shapes.
5292         #
5293         #  @ref swig_GetShapesOnShape "Example"
5294         @ManageTransactions("ShapesOp")
5295         def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5296             """
5297             Find in theShape all sub-shapes of type theShapeType,
5298             situated relatively the specified theCheckShape by the
5299             certain way, defined through theState parameter.
5300
5301             Parameters:
5302                 theCheckShape Shape for relative comparing. It must be a solid.
5303                 theShape Shape to find sub-shapes of.
5304                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5305                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5306                 theName Object name; when specified, this parameter is used
5307                         for result publication in the study. Otherwise, if automatic
5308                         publication is switched on, default value is used for result name.
5309
5310             Returns:
5311                 List of all found sub-shapes.
5312             """
5313             # Example: see GEOM_TestOthers.py
5314             aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5315                                                    theShapeType, theState)
5316             RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5317             self._autoPublish(aList, theName, "shapeOnShape")
5318             return aList
5319
5320         ## Find in \a theShape all sub-shapes of type \a theShapeType,
5321         #  situated relatively the specified \a theCheckShape by the
5322         #  certain way, defined through \a theState parameter.
5323         #  @param theCheckShape Shape for relative comparing. It must be a solid.
5324         #  @param theShape Shape to find sub-shapes of.
5325         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5326         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5327         #  @param theName Object name; when specified, this parameter is used
5328         #         for result publication in the study. Otherwise, if automatic
5329         #         publication is switched on, default value is used for result name.
5330         #
5331         #  @return All found sub-shapes as compound.
5332         #
5333         #  @ref swig_GetShapesOnShapeAsCompound "Example"
5334         @ManageTransactions("ShapesOp")
5335         def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5336             """
5337             Find in theShape all sub-shapes of type theShapeType,
5338             situated relatively the specified theCheckShape by the
5339             certain way, defined through theState parameter.
5340
5341             Parameters:
5342                 theCheckShape Shape for relative comparing. It must be a solid.
5343                 theShape Shape to find sub-shapes of.
5344                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5345                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5346                 theName Object name; when specified, this parameter is used
5347                         for result publication in the study. Otherwise, if automatic
5348                         publication is switched on, default value is used for result name.
5349
5350             Returns:
5351                 All found sub-shapes as compound.
5352             """
5353             # Example: see GEOM_TestOthers.py
5354             anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5355                                                              theShapeType, theState)
5356             RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5357             self._autoPublish(anObj, theName, "shapeOnShape")
5358             return anObj
5359
5360         ## Find in \a theShape all sub-shapes of type \a theShapeType,
5361         #  situated relatively the specified \a theCheckShape by the
5362         #  certain way, defined through \a theState parameter.
5363         #  @param theCheckShape Shape for relative comparing. It must be a solid.
5364         #  @param theShape Shape to find sub-shapes of.
5365         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5366         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5367         #
5368         #  @return List of all found sub-shapes indices.
5369         #
5370         #  @ref swig_GetShapesOnShapeIDs "Example"
5371         @ManageTransactions("ShapesOp")
5372         def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5373             """
5374             Find in theShape all sub-shapes of type theShapeType,
5375             situated relatively the specified theCheckShape by the
5376             certain way, defined through theState parameter.
5377
5378             Parameters:
5379                 theCheckShape Shape for relative comparing. It must be a solid.
5380                 theShape Shape to find sub-shapes of.
5381                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5382                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5383
5384             Returns:
5385                 List of all found sub-shapes indices.
5386             """
5387             # Example: see GEOM_TestOthers.py
5388             aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5389                                                       theShapeType, theState)
5390             RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5391             return aList
5392
5393         ## Get sub-shape(s) of theShapeWhere, which are
5394         #  coincident with \a theShapeWhat or could be a part of it.
5395         #  @param theShapeWhere Shape to find sub-shapes of.
5396         #  @param theShapeWhat Shape, specifying what to find.
5397         #  @param isNewImplementation implementation of GetInPlace functionality
5398         #             (default = False, old alghorithm based on shape properties)
5399         #  @param theName Object name; when specified, this parameter is used
5400         #         for result publication in the study. Otherwise, if automatic
5401         #         publication is switched on, default value is used for result name.
5402         #
5403         #  @return Group of all found sub-shapes or a single found sub-shape.
5404         #
5405         #  @note This function has a restriction on argument shapes.
5406         #        If \a theShapeWhere has curved parts with significantly
5407         #        outstanding centres (i.e. the mass centre of a part is closer to
5408         #        \a theShapeWhat than to the part), such parts will not be found.
5409         #        @image html get_in_place_lost_part.png
5410         #
5411         #  @ref swig_GetInPlace "Example"
5412         @ManageTransactions("ShapesOp")
5413         def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5414             """
5415             Get sub-shape(s) of theShapeWhere, which are
5416             coincident with  theShapeWhat or could be a part of it.
5417
5418             Parameters:
5419                 theShapeWhere Shape to find sub-shapes of.
5420                 theShapeWhat Shape, specifying what to find.
5421                 isNewImplementation Implementation of GetInPlace functionality
5422                                     (default = False, old alghorithm based on shape properties)
5423                 theName Object name; when specified, this parameter is used
5424                         for result publication in the study. Otherwise, if automatic
5425                         publication is switched on, default value is used for result name.
5426
5427             Returns:
5428                 Group of all found sub-shapes or a single found sub-shape.
5429
5430
5431             Note:
5432                 This function has a restriction on argument shapes.
5433                 If theShapeWhere has curved parts with significantly
5434                 outstanding centres (i.e. the mass centre of a part is closer to
5435                 theShapeWhat than to the part), such parts will not be found.
5436             """
5437             # Example: see GEOM_TestOthers.py
5438             anObj = None
5439             if isNewImplementation:
5440                 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5441             else:
5442                 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5443                 pass
5444             RaiseIfFailed("GetInPlace", self.ShapesOp)
5445             self._autoPublish(anObj, theName, "inplace")
5446             return anObj
5447
5448         ## Get sub-shape(s) of \a theShapeWhere, which are
5449         #  coincident with \a theShapeWhat or could be a part of it.
5450         #
5451         #  Implementation of this method is based on a saved history of an operation,
5452         #  produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5453         #  arguments (an argument shape or a sub-shape of an argument shape).
5454         #  The operation could be the Partition or one of boolean operations,
5455         #  performed on simple shapes (not on compounds).
5456         #
5457         #  @param theShapeWhere Shape to find sub-shapes of.
5458         #  @param theShapeWhat Shape, specifying what to find (must be in the
5459         #                      building history of the ShapeWhere).
5460         #  @param theName Object name; when specified, this parameter is used
5461         #         for result publication in the study. Otherwise, if automatic
5462         #         publication is switched on, default value is used for result name.
5463         #
5464         #  @return Group of all found sub-shapes or a single found sub-shape.
5465         #
5466         #  @ref swig_GetInPlace "Example"
5467         @ManageTransactions("ShapesOp")
5468         def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5469             """
5470             Implementation of this method is based on a saved history of an operation,
5471             produced theShapeWhere. The theShapeWhat must be among this operation's
5472             arguments (an argument shape or a sub-shape of an argument shape).
5473             The operation could be the Partition or one of boolean operations,
5474             performed on simple shapes (not on compounds).
5475
5476             Parameters:
5477                 theShapeWhere Shape to find sub-shapes of.
5478                 theShapeWhat Shape, specifying what to find (must be in the
5479                                 building history of the ShapeWhere).
5480                 theName Object name; when specified, this parameter is used
5481                         for result publication in the study. Otherwise, if automatic
5482                         publication is switched on, default value is used for result name.
5483
5484             Returns:
5485                 Group of all found sub-shapes or a single found sub-shape.
5486             """
5487             # Example: see GEOM_TestOthers.py
5488             anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5489             RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5490             self._autoPublish(anObj, theName, "inplace")
5491             return anObj
5492
5493         ## Get sub-shape of theShapeWhere, which is
5494         #  equal to \a theShapeWhat.
5495         #  @param theShapeWhere Shape to find sub-shape of.
5496         #  @param theShapeWhat Shape, specifying what to find.
5497         #  @param theName Object name; when specified, this parameter is used
5498         #         for result publication in the study. Otherwise, if automatic
5499         #         publication is switched on, default value is used for result name.
5500         #
5501         #  @return New GEOM.GEOM_Object for found sub-shape.
5502         #
5503         #  @ref swig_GetSame "Example"
5504         @ManageTransactions("ShapesOp")
5505         def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5506             """
5507             Get sub-shape of theShapeWhere, which is
5508             equal to theShapeWhat.
5509
5510             Parameters:
5511                 theShapeWhere Shape to find sub-shape of.
5512                 theShapeWhat Shape, specifying what to find.
5513                 theName Object name; when specified, this parameter is used
5514                         for result publication in the study. Otherwise, if automatic
5515                         publication is switched on, default value is used for result name.
5516
5517             Returns:
5518                 New GEOM.GEOM_Object for found sub-shape.
5519             """
5520             anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5521             RaiseIfFailed("GetSame", self.ShapesOp)
5522             self._autoPublish(anObj, theName, "sameShape")
5523             return anObj
5524
5525
5526         ## Get sub-shape indices of theShapeWhere, which is
5527         #  equal to \a theShapeWhat.
5528         #  @param theShapeWhere Shape to find sub-shape of.
5529         #  @param theShapeWhat Shape, specifying what to find.
5530         #  @return List of all found sub-shapes indices.
5531         #
5532         #  @ref swig_GetSame "Example"
5533         @ManageTransactions("ShapesOp")
5534         def GetSameIDs(self, theShapeWhere, theShapeWhat):
5535             """
5536             Get sub-shape indices of theShapeWhere, which is
5537             equal to theShapeWhat.
5538
5539             Parameters:
5540                 theShapeWhere Shape to find sub-shape of.
5541                 theShapeWhat Shape, specifying what to find.
5542
5543             Returns:
5544                 List of all found sub-shapes indices.
5545             """
5546             anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5547             RaiseIfFailed("GetSameIDs", self.ShapesOp)
5548             return anObj
5549
5550
5551         # end of l4_obtain
5552         ## @}
5553
5554         ## @addtogroup l4_access
5555         ## @{
5556
5557         ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5558         #  of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5559         #  @param aShape Shape to get sub-shape of.
5560         #  @param ListOfID List of sub-shapes indices.
5561         #  @param theName Object name; when specified, this parameter is used
5562         #         for result publication in the study. Otherwise, if automatic
5563         #         publication is switched on, default value is used for result name.
5564         #
5565         #  @return Found sub-shape.
5566         #
5567         #  @ref swig_all_decompose "Example"
5568         def GetSubShape(self, aShape, ListOfID, theName=None):
5569             """
5570             Obtain a composite sub-shape of aShape, composed from sub-shapes
5571             of aShape, selected by their unique IDs inside aShape
5572
5573             Parameters:
5574                 aShape Shape to get sub-shape of.
5575                 ListOfID List of sub-shapes indices.
5576                 theName Object name; when specified, this parameter is used
5577                         for result publication in the study. Otherwise, if automatic
5578                         publication is switched on, default value is used for result name.
5579
5580             Returns:
5581                 Found sub-shape.
5582             """
5583             # Example: see GEOM_TestAll.py
5584             anObj = self.AddSubShape(aShape,ListOfID)
5585             self._autoPublish(anObj, theName, "subshape")
5586             return anObj
5587
5588         ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5589         #  of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5590         #  @param aShape Shape to get sub-shape of.
5591         #  @param aSubShape Sub-shapes of aShape.
5592         #  @return ID of found sub-shape.
5593         #
5594         #  @ref swig_all_decompose "Example"
5595         @ManageTransactions("LocalOp")
5596         def GetSubShapeID(self, aShape, aSubShape):
5597             """
5598             Obtain unique ID of sub-shape aSubShape inside aShape
5599             of aShape, selected by their unique IDs inside aShape
5600
5601             Parameters:
5602                aShape Shape to get sub-shape of.
5603                aSubShape Sub-shapes of aShape.
5604
5605             Returns:
5606                ID of found sub-shape.
5607             """
5608             # Example: see GEOM_TestAll.py
5609             anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5610             RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5611             return anID
5612
5613         ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5614         #  This function is provided for performance purpose. The complexity is O(n) with n
5615         #  the number of subobjects of aShape
5616         #  @param aShape Shape to get sub-shape of.
5617         #  @param aSubShapes Sub-shapes of aShape.
5618         #  @return list of IDs of found sub-shapes.
5619         #
5620         #  @ref swig_all_decompose "Example"
5621         @ManageTransactions("ShapesOp")
5622         def GetSubShapesIDs(self, aShape, aSubShapes):
5623             """
5624             Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5625             This function is provided for performance purpose. The complexity is O(n) with n
5626             the number of subobjects of aShape
5627
5628             Parameters:
5629                aShape Shape to get sub-shape of.
5630                aSubShapes Sub-shapes of aShape.
5631
5632             Returns:
5633                List of IDs of found sub-shape.
5634             """
5635             # Example: see GEOM_TestAll.py
5636             anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5637             RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5638             return anIDs
5639
5640         # end of l4_access
5641         ## @}
5642
5643         ## @addtogroup l4_decompose
5644         ## @{
5645
5646         ## Get all sub-shapes and groups of \a theShape,
5647         #  that were created already by any other methods.
5648         #  @param theShape Any shape.
5649         #  @param theGroupsOnly If this parameter is TRUE, only groups will be
5650         #                       returned, else all found sub-shapes and groups.
5651         #  @return List of existing sub-objects of \a theShape.
5652         #
5653         #  @ref swig_all_decompose "Example"
5654         @ManageTransactions("ShapesOp")
5655         def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5656             """
5657             Get all sub-shapes and groups of theShape,
5658             that were created already by any other methods.
5659
5660             Parameters:
5661                 theShape Any shape.
5662                 theGroupsOnly If this parameter is TRUE, only groups will be
5663                                  returned, else all found sub-shapes and groups.
5664
5665             Returns:
5666                 List of existing sub-objects of theShape.
5667             """
5668             # Example: see GEOM_TestAll.py
5669             ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5670             RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5671             return ListObj
5672
5673         ## Get all groups of \a theShape,
5674         #  that were created already by any other methods.
5675         #  @param theShape Any shape.
5676         #  @return List of existing groups of \a theShape.
5677         #
5678         #  @ref swig_all_decompose "Example"
5679         @ManageTransactions("ShapesOp")
5680         def GetGroups(self, theShape):
5681             """
5682             Get all groups of theShape,
5683             that were created already by any other methods.
5684
5685             Parameters:
5686                 theShape Any shape.
5687
5688             Returns:
5689                 List of existing groups of theShape.
5690             """
5691             # Example: see GEOM_TestAll.py
5692             ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5693             RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5694             return ListObj
5695
5696         ## Explode a shape on sub-shapes of a given type.
5697         #  If the shape itself matches the type, it is also returned.
5698         #  @param aShape Shape to be exploded.
5699         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
5700         #  @param theName Object name; when specified, this parameter is used
5701         #         for result publication in the study. Otherwise, if automatic
5702         #         publication is switched on, default value is used for result name.
5703         #
5704         #  @return List of sub-shapes of type theShapeType, contained in theShape.
5705         #
5706         #  @ref swig_all_decompose "Example"
5707         @ManageTransactions("ShapesOp")
5708         def SubShapeAll(self, aShape, aType, theName=None):
5709             """
5710             Explode a shape on sub-shapes of a given type.
5711             If the shape itself matches the type, it is also returned.
5712
5713             Parameters:
5714                 aShape Shape to be exploded.
5715                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5716                 theName Object name; when specified, this parameter is used
5717                         for result publication in the study. Otherwise, if automatic
5718                         publication is switched on, default value is used for result name.
5719
5720             Returns:
5721                 List of sub-shapes of type theShapeType, contained in theShape.
5722             """
5723             # Example: see GEOM_TestAll.py
5724             ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5725             RaiseIfFailed("SubShapeAll", self.ShapesOp)
5726             self._autoPublish(ListObj, theName, "subshape")
5727             return ListObj
5728
5729         ## Explode a shape on sub-shapes of a given type.
5730         #  @param aShape Shape to be exploded.
5731         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
5732         #  @return List of IDs of sub-shapes.
5733         #
5734         #  @ref swig_all_decompose "Example"
5735         @ManageTransactions("ShapesOp")
5736         def SubShapeAllIDs(self, aShape, aType):
5737             """
5738             Explode a shape on sub-shapes of a given type.
5739
5740             Parameters:
5741                 aShape Shape to be exploded (see geompy.ShapeType)
5742                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5743
5744             Returns:
5745                 List of IDs of sub-shapes.
5746             """
5747             ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5748             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5749             return ListObj
5750
5751         ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5752         #  selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5753         #  Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5754         #  @param aShape Shape to get sub-shape of.
5755         #  @param ListOfInd List of sub-shapes indices.
5756         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
5757         #  @param theName Object name; when specified, this parameter is used
5758         #         for result publication in the study. Otherwise, if automatic
5759         #         publication is switched on, default value is used for result name.
5760         #
5761         #  @return A compound of sub-shapes of aShape.
5762         #
5763         #  @ref swig_all_decompose "Example"
5764         def SubShape(self, aShape, aType, ListOfInd, theName=None):
5765             """
5766             Obtain a compound of sub-shapes of aShape,
5767             selected by their indices in list of all sub-shapes of type aType.
5768             Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5769
5770             Parameters:
5771                 aShape Shape to get sub-shape of.
5772                 ListOfID List of sub-shapes indices.
5773                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5774                 theName Object name; when specified, this parameter is used
5775                         for result publication in the study. Otherwise, if automatic
5776                         publication is switched on, default value is used for result name.
5777
5778             Returns:
5779                 A compound of sub-shapes of aShape.
5780             """
5781             # Example: see GEOM_TestAll.py
5782             ListOfIDs = []
5783             AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5784             for ind in ListOfInd:
5785                 ListOfIDs.append(AllShapeIDsList[ind - 1])
5786             # note: auto-publishing is done in self.GetSubShape()
5787             anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5788             return anObj
5789
5790         ## Explode a shape on sub-shapes of a given type.
5791         #  Sub-shapes will be sorted taking into account their gravity centers,
5792         #  to provide stable order of sub-shapes.
5793         #  If the shape itself matches the type, it is also returned.
5794         #  @param aShape Shape to be exploded.
5795         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
5796         #  @param theName Object name; when specified, this parameter is used
5797         #         for result publication in the study. Otherwise, if automatic
5798         #         publication is switched on, default value is used for result name.
5799         #
5800         #  @return List of sub-shapes of type theShapeType, contained in theShape.
5801         #
5802         #  @ref swig_SubShapeAllSorted "Example"
5803         @ManageTransactions("ShapesOp")
5804         def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5805             """
5806             Explode a shape on sub-shapes of a given type.
5807             Sub-shapes will be sorted taking into account their gravity centers,
5808             to provide stable order of sub-shapes.
5809             If the shape itself matches the type, it is also returned.
5810
5811             Parameters:
5812                 aShape Shape to be exploded.
5813                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5814                 theName Object name; when specified, this parameter is used
5815                         for result publication in the study. Otherwise, if automatic
5816                         publication is switched on, default value is used for result name.
5817
5818             Returns:
5819                 List of sub-shapes of type theShapeType, contained in theShape.
5820             """
5821             # Example: see GEOM_TestAll.py
5822             ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5823             RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5824             self._autoPublish(ListObj, theName, "subshape")
5825             return ListObj
5826
5827         ## Explode a shape on sub-shapes of a given type.
5828         #  Sub-shapes will be sorted taking into account their gravity centers,
5829         #  to provide stable order of sub-shapes.
5830         #  @param aShape Shape to be exploded.
5831         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
5832         #  @return List of IDs of sub-shapes.
5833         #
5834         #  @ref swig_all_decompose "Example"
5835         @ManageTransactions("ShapesOp")
5836         def SubShapeAllSortedCentresIDs(self, aShape, aType):
5837             """
5838             Explode a shape on sub-shapes of a given type.
5839             Sub-shapes will be sorted taking into account their gravity centers,
5840             to provide stable order of sub-shapes.
5841
5842             Parameters:
5843                 aShape Shape to be exploded.
5844                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5845
5846             Returns:
5847                 List of IDs of sub-shapes.
5848             """
5849             ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5850             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5851             return ListIDs
5852
5853         ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5854         #  selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5855         #  Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5856         #  @param aShape Shape to get sub-shape of.
5857         #  @param ListOfInd List of sub-shapes indices.
5858         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
5859         #  @param theName Object name; when specified, this parameter is used
5860         #         for result publication in the study. Otherwise, if automatic
5861         #         publication is switched on, default value is used for result name.
5862         #
5863         #  @return A compound of sub-shapes of aShape.
5864         #
5865         #  @ref swig_all_decompose "Example"
5866         def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5867             """
5868             Obtain a compound of sub-shapes of aShape,
5869             selected by they indices in sorted list of all sub-shapes of type aType.
5870             Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5871
5872             Parameters:
5873                 aShape Shape to get sub-shape of.
5874                 ListOfID List of sub-shapes indices.
5875                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5876                 theName Object name; when specified, this parameter is used
5877                         for result publication in the study. Otherwise, if automatic
5878                         publication is switched on, default value is used for result name.
5879
5880             Returns:
5881                 A compound of sub-shapes of aShape.
5882             """
5883             # Example: see GEOM_TestAll.py
5884             ListOfIDs = []
5885             AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5886             for ind in ListOfInd:
5887                 ListOfIDs.append(AllShapeIDsList[ind - 1])
5888             # note: auto-publishing is done in self.GetSubShape()
5889             anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5890             return anObj
5891
5892         ## Extract shapes (excluding the main shape) of given type.
5893         #  @param aShape The shape.
5894         #  @param aType  The shape type (see ShapeType())
5895         #  @param isSorted Boolean flag to switch sorting on/off.
5896         #  @param theName Object name; when specified, this parameter is used
5897         #         for result publication in the study. Otherwise, if automatic
5898         #         publication is switched on, default value is used for result name.
5899         #
5900         #  @return List of sub-shapes of type aType, contained in aShape.
5901         #
5902         #  @ref swig_FilletChamfer "Example"
5903         @ManageTransactions("ShapesOp")
5904         def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5905             """
5906             Extract shapes (excluding the main shape) of given type.
5907
5908             Parameters:
5909                 aShape The shape.
5910                 aType  The shape type (see geompy.ShapeType)
5911                 isSorted Boolean flag to switch sorting on/off.
5912                 theName Object name; when specified, this parameter is used
5913                         for result publication in the study. Otherwise, if automatic
5914                         publication is switched on, default value is used for result name.
5915
5916             Returns:
5917                 List of sub-shapes of type aType, contained in aShape.
5918             """
5919             # Example: see GEOM_TestAll.py
5920             ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5921             RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5922             self._autoPublish(ListObj, theName, "subshape")
5923             return ListObj
5924
5925         ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5926         #  @param aShape Main shape.
5927         #  @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5928         #  @param theName Object name; when specified, this parameter is used
5929         #         for result publication in the study. Otherwise, if automatic
5930         #         publication is switched on, default value is used for result name.
5931         #  @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5932         #
5933         #  @ref swig_all_decompose "Example"
5934         @ManageTransactions("ShapesOp")
5935         def SubShapes(self, aShape, anIDs, theName=None):
5936             """
5937             Get a set of sub-shapes defined by their unique IDs inside theMainShape
5938
5939             Parameters:
5940                 aShape Main shape.
5941                 anIDs List of unique IDs of sub-shapes inside theMainShape.
5942                 theName Object name; when specified, this parameter is used
5943                         for result publication in the study. Otherwise, if automatic
5944                         publication is switched on, default value is used for result name.
5945
5946             Returns:
5947                 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5948             """
5949             # Example: see GEOM_TestAll.py
5950             ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5951             RaiseIfFailed("SubShapes", self.ShapesOp)
5952             self._autoPublish(ListObj, theName, "subshape")
5953             return ListObj
5954
5955         # end of l4_decompose
5956         ## @}
5957
5958         ## @addtogroup l4_decompose_d
5959         ## @{
5960
5961         ## Deprecated method
5962         #  It works like SubShapeAllSortedCentres(), but wrongly
5963         #  defines centres of faces, shells and solids.
5964         @ManageTransactions("ShapesOp")
5965         def SubShapeAllSorted(self, aShape, aType, theName=None):
5966             """
5967             Deprecated method
5968             It works like geompy.SubShapeAllSortedCentres, but wrongly
5969             defines centres of faces, shells and solids.
5970             """
5971             ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5972             RaiseIfFailed("MakeExplode", self.ShapesOp)
5973             self._autoPublish(ListObj, theName, "subshape")
5974             return ListObj
5975
5976         ## Deprecated method
5977         #  It works like SubShapeAllSortedCentresIDs(), but wrongly
5978         #  defines centres of faces, shells and solids.
5979         @ManageTransactions("ShapesOp")
5980         def SubShapeAllSortedIDs(self, aShape, aType):
5981             """
5982             Deprecated method
5983             It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5984             defines centres of faces, shells and solids.
5985             """
5986             ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5987             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5988             return ListIDs
5989
5990         ## Deprecated method
5991         #  It works like SubShapeSortedCentres(), but has a bug
5992         #  (wrongly defines centres of faces, shells and solids).
5993         def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
5994             """
5995             Deprecated method
5996             It works like geompy.SubShapeSortedCentres, but has a bug
5997             (wrongly defines centres of faces, shells and solids).
5998             """
5999             ListOfIDs = []
6000             AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6001             for ind in ListOfInd:
6002                 ListOfIDs.append(AllShapeIDsList[ind - 1])
6003             # note: auto-publishing is done in self.GetSubShape()
6004             anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6005             return anObj
6006
6007         # end of l4_decompose_d
6008         ## @}
6009
6010         ## @addtogroup l3_healing
6011         ## @{
6012
6013         ## Apply a sequence of Shape Healing operators to the given object.
6014         #  @param theShape Shape to be processed.
6015         #  @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6016         #  @param theParameters List of names of parameters
6017         #                    ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6018         #  @param theValues List of values of parameters, in the same order
6019         #                    as parameters are listed in <VAR>theParameters</VAR> list.
6020         #  @param theName Object name; when specified, this parameter is used
6021         #         for result publication in the study. Otherwise, if automatic
6022         #         publication is switched on, default value is used for result name.
6023         #
6024         #  <b> Operators and Parameters: </b> \n
6025         #
6026         #  * \b FixShape - corrects invalid shapes. \n
6027         #  - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6028         #  - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6029         #
6030         #  * \b FixFaceSize - removes small faces, such as spots and strips.\n
6031         #  - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6032         #  - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6033         #  - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6034         #
6035         #  * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6036         #    surfaces in segments using a certain angle. \n
6037         #  - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6038         #    if Angle=180, four if Angle=90, etc). \n
6039         #  - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6040         #
6041         #  * \b SplitClosedFaces - splits closed faces in segments.
6042         #    The number of segments depends on the number of splitting points.\n
6043         #  - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6044         #
6045         #  * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6046         #  - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6047         #  - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6048         #  - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6049         #   This and the previous parameters can take the following values:\n
6050         #   \b Parametric \b Continuity \n
6051         #   \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6052         #   are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6053         #   \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6054         #    ruling out sharp edges).\n
6055         #   \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6056         #       are of the same magnitude).\n
6057         #   \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6058         #    or surfaces (d/du C(u)) are the same at junction. \n
6059         #   \b Geometric \b Continuity \n
6060         #   \b G1: first derivatives are proportional at junction.\n
6061         #   The curve tangents thus have the same direction, but not necessarily the same magnitude.
6062         #      i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6063         #   \b G2: first and second derivatives are proportional at junction.
6064         #   As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6065         #    continuity requires that the underlying parameterization was continuous as well.
6066         #   Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6067         #
6068         #  * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6069         #  - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6070         #  - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6071         #  - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6072         #  - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6073         #       with the specified parameters.\n
6074         #  - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6075         #       with the specified parameters.\n
6076         #  - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6077         #  - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6078         #  - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6079         #  - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6080         #
6081         #  * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6082         #  - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6083         #  - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6084         #  - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6085         #  - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6086         #
6087         #  * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6088         #  - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6089         #
6090         #
6091         #  @return New GEOM.GEOM_Object, containing processed shape.
6092         #
6093         #  \n @ref tui_shape_processing "Example"
6094         @ManageTransactions("HealOp")
6095         def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6096             """
6097             Apply a sequence of Shape Healing operators to the given object.
6098
6099             Parameters:
6100                 theShape Shape to be processed.
6101                 theValues List of values of parameters, in the same order
6102                           as parameters are listed in theParameters list.
6103                 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6104                 theParameters List of names of parameters
6105                               ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6106                 theName Object name; when specified, this parameter is used
6107                         for result publication in the study. Otherwise, if automatic
6108                         publication is switched on, default value is used for result name.
6109
6110                 Operators and Parameters:
6111
6112                  * FixShape - corrects invalid shapes.
6113                      * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6114                      * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6115                  * FixFaceSize - removes small faces, such as spots and strips.
6116                      * FixFaceSize.Tolerance - defines minimum possible face size.
6117                      * DropSmallEdges - removes edges, which merge with neighbouring edges.
6118                      * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6119                  * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6120                                 in segments using a certain angle.
6121                      * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6122                                           if Angle=180, four if Angle=90, etc).
6123                      * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6124                  * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6125                                       splitting points.
6126                      * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6127                  * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6128                      * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6129                      * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6130                      * SplitContinuity.CurveContinuity - required continuity for curves.
6131                        This and the previous parameters can take the following values:
6132
6133                        Parametric Continuity:
6134                        C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6135                                                    coincidental. The curves or surfaces may still meet at an angle,
6136                                                    giving rise to a sharp corner or edge).
6137                        C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6138                                                    are parallel, ruling out sharp edges).
6139                        C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6140                                                   or surfaces are of the same magnitude).
6141                        CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6142                           curves or surfaces (d/du C(u)) are the same at junction.
6143
6144                        Geometric Continuity:
6145                        G1: first derivatives are proportional at junction.
6146                            The curve tangents thus have the same direction, but not necessarily the same magnitude.
6147                            i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6148                        G2: first and second derivatives are proportional at junction. As the names imply,
6149                            geometric continuity requires the geometry to be continuous, while parametric continuity requires
6150                            that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6151                            geometric continuity of order n, but not vice-versa.
6152                  * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6153                      * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6154                      * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6155                      * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6156                      * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6157                                                         the specified parameters.
6158                      * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6159                                                         the specified parameters.
6160                      * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6161                      * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6162                      * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6163                      * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6164                  * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6165                      * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6166                      * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6167                      * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6168                      * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6169                  * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6170                      * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6171
6172             Returns:
6173                 New GEOM.GEOM_Object, containing processed shape.
6174
6175             Note: For more information look through SALOME Geometry User's Guide->
6176                   -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6177             """
6178             # Example: see GEOM_TestHealing.py
6179             theValues,Parameters = ParseList(theValues)
6180             anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6181             # To avoid script failure in case of good argument shape
6182             if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6183                 return theShape
6184             RaiseIfFailed("ProcessShape", self.HealOp)
6185             for string in (theOperators + theParameters):
6186                 Parameters = ":" + Parameters
6187                 pass
6188             anObj.SetParameters(Parameters)
6189             self._autoPublish(anObj, theName, "healed")
6190             return anObj
6191
6192         ## Remove faces from the given object (shape).
6193         #  @param theObject Shape to be processed.
6194         #  @param theFaces Indices of faces to be removed, if EMPTY then the method
6195         #                  removes ALL faces of the given object.
6196         #  @param theName Object name; when specified, this parameter is used
6197         #         for result publication in the study. Otherwise, if automatic
6198         #         publication is switched on, default value is used for result name.
6199         #
6200         #  @return New GEOM.GEOM_Object, containing processed shape.
6201         #
6202         #  @ref tui_suppress_faces "Example"
6203         @ManageTransactions("HealOp")
6204         def SuppressFaces(self, theObject, theFaces, theName=None):
6205             """
6206             Remove faces from the given object (shape).
6207
6208             Parameters:
6209                 theObject Shape to be processed.
6210                 theFaces Indices of faces to be removed, if EMPTY then the method
6211                          removes ALL faces of the given object.
6212                 theName Object name; when specified, this parameter is used
6213                         for result publication in the study. Otherwise, if automatic
6214                         publication is switched on, default value is used for result name.
6215
6216             Returns:
6217                 New GEOM.GEOM_Object, containing processed shape.
6218             """
6219             # Example: see GEOM_TestHealing.py
6220             anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6221             RaiseIfFailed("SuppressFaces", self.HealOp)
6222             self._autoPublish(anObj, theName, "suppressFaces")
6223             return anObj
6224
6225         ## Sewing of some shapes into single shape.
6226         #  @param ListShape Shapes to be processed.
6227         #  @param theTolerance Required tolerance value.
6228         #  @param AllowNonManifold Flag that allows non-manifold sewing.
6229         #  @param theName Object name; when specified, this parameter is used
6230         #         for result publication in the study. Otherwise, if automatic
6231         #         publication is switched on, default value is used for result name.
6232         #
6233         #  @return New GEOM.GEOM_Object, containing processed shape.
6234         #
6235         #  @ref tui_sewing "Example"
6236         def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6237             """
6238             Sewing of some shapes into single shape.
6239
6240             Parameters:
6241                 ListShape Shapes to be processed.
6242                 theTolerance Required tolerance value.
6243                 AllowNonManifold Flag that allows non-manifold sewing.
6244                 theName Object name; when specified, this parameter is used
6245                         for result publication in the study. Otherwise, if automatic
6246                         publication is switched on, default value is used for result name.
6247
6248             Returns:
6249                 New GEOM.GEOM_Object, containing processed shape.
6250             """
6251             # Example: see GEOM_TestHealing.py
6252             comp = self.MakeCompound(ListShape)
6253             # note: auto-publishing is done in self.Sew()
6254             anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
6255             return anObj
6256
6257         ## Sewing of the given object.
6258         #  @param theObject Shape to be processed.
6259         #  @param theTolerance Required tolerance value.
6260         #  @param AllowNonManifold Flag that allows non-manifold sewing.
6261         #  @param theName Object name; when specified, this parameter is used
6262         #         for result publication in the study. Otherwise, if automatic
6263         #         publication is switched on, default value is used for result name.
6264         #
6265         #  @return New GEOM.GEOM_Object, containing processed shape.
6266         @ManageTransactions("HealOp")
6267         def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6268             """
6269             Sewing of the given object.
6270
6271             Parameters:
6272                 theObject Shape to be processed.
6273                 theTolerance Required tolerance value.
6274                 AllowNonManifold Flag that allows non-manifold sewing.
6275                 theName Object name; when specified, this parameter is used
6276                         for result publication in the study. Otherwise, if automatic
6277                         publication is switched on, default value is used for result name.
6278
6279             Returns:
6280                 New GEOM.GEOM_Object, containing processed shape.
6281             """
6282             # Example: see MakeSewing() above
6283             theTolerance,Parameters = ParseParameters(theTolerance)
6284             if AllowNonManifold:
6285                 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6286             else:
6287                 anObj = self.HealOp.Sew(theObject, theTolerance)
6288             # To avoid script failure in case of good argument shape
6289             if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6290                 return theObject
6291             RaiseIfFailed("Sew", self.HealOp)
6292             anObj.SetParameters(Parameters)
6293             self._autoPublish(anObj, theName, "sewed")
6294             return anObj
6295
6296         ## Rebuild the topology of theCompound of solids by removing
6297         #  of the faces that are shared by several solids.
6298         #  @param theCompound Shape to be processed.
6299         #  @param theName Object name; when specified, this parameter is used
6300         #         for result publication in the study. Otherwise, if automatic
6301         #         publication is switched on, default value is used for result name.
6302         #
6303         #  @return New GEOM.GEOM_Object, containing processed shape.
6304         #
6305         #  @ref tui_remove_webs "Example"
6306         @ManageTransactions("HealOp")
6307         def RemoveInternalFaces (self, theCompound, theName=None):
6308             """
6309             Rebuild the topology of theCompound of solids by removing
6310             of the faces that are shared by several solids.
6311
6312             Parameters:
6313                 theCompound Shape to be processed.
6314                 theName Object name; when specified, this parameter is used
6315                         for result publication in the study. Otherwise, if automatic
6316                         publication is switched on, default value is used for result name.
6317
6318             Returns:
6319                 New GEOM.GEOM_Object, containing processed shape.
6320             """
6321             # Example: see GEOM_TestHealing.py
6322             anObj = self.HealOp.RemoveInternalFaces(theCompound)
6323             RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6324             self._autoPublish(anObj, theName, "removeWebs")
6325             return anObj
6326
6327         ## Remove internal wires and edges from the given object (face).
6328         #  @param theObject Shape to be processed.
6329         #  @param theWires Indices of wires to be removed, if EMPTY then the method
6330         #                  removes ALL internal wires of the given object.
6331         #  @param theName Object name; when specified, this parameter is used
6332         #         for result publication in the study. Otherwise, if automatic
6333         #         publication is switched on, default value is used for result name.
6334         #
6335         #  @return New GEOM.GEOM_Object, containing processed shape.
6336         #
6337         #  @ref tui_suppress_internal_wires "Example"
6338         @ManageTransactions("HealOp")
6339         def SuppressInternalWires(self, theObject, theWires, theName=None):
6340             """
6341             Remove internal wires and edges from the given object (face).
6342
6343             Parameters:
6344                 theObject Shape to be processed.
6345                 theWires Indices of wires to be removed, if EMPTY then the method
6346                          removes ALL internal wires of the given object.
6347                 theName Object name; when specified, this parameter is used
6348                         for result publication in the study. Otherwise, if automatic
6349                         publication is switched on, default value is used for result name.
6350
6351             Returns:
6352                 New GEOM.GEOM_Object, containing processed shape.
6353             """
6354             # Example: see GEOM_TestHealing.py
6355             anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6356             RaiseIfFailed("RemoveIntWires", self.HealOp)
6357             self._autoPublish(anObj, theName, "suppressWires")
6358             return anObj
6359
6360         ## Remove internal closed contours (holes) from the given object.
6361         #  @param theObject Shape to be processed.
6362         #  @param theWires Indices of wires to be removed, if EMPTY then the method
6363         #                  removes ALL internal holes of the given object
6364         #  @param theName Object name; when specified, this parameter is used
6365         #         for result publication in the study. Otherwise, if automatic
6366         #         publication is switched on, default value is used for result name.
6367         #
6368         #  @return New GEOM.GEOM_Object, containing processed shape.
6369         #
6370         #  @ref tui_suppress_holes "Example"
6371         @ManageTransactions("HealOp")
6372         def SuppressHoles(self, theObject, theWires, theName=None):
6373             """
6374             Remove internal closed contours (holes) from the given object.
6375
6376             Parameters:
6377                 theObject Shape to be processed.
6378                 theWires Indices of wires to be removed, if EMPTY then the method
6379                          removes ALL internal holes of the given object
6380                 theName Object name; when specified, this parameter is used
6381                         for result publication in the study. Otherwise, if automatic
6382                         publication is switched on, default value is used for result name.
6383
6384             Returns:
6385                 New GEOM.GEOM_Object, containing processed shape.
6386             """
6387             # Example: see GEOM_TestHealing.py
6388             anObj = self.HealOp.FillHoles(theObject, theWires)
6389             RaiseIfFailed("FillHoles", self.HealOp)
6390             self._autoPublish(anObj, theName, "suppressHoles")
6391             return anObj
6392
6393         ## Close an open wire.
6394         #  @param theObject Shape to be processed.
6395         #  @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6396         #                  if [ ], then <VAR>theObject</VAR> itself is a wire.
6397         #  @param isCommonVertex If True  : closure by creation of a common vertex,
6398         #                        If False : closure by creation of an edge between ends.
6399         #  @param theName Object name; when specified, this parameter is used
6400         #         for result publication in the study. Otherwise, if automatic
6401         #         publication is switched on, default value is used for result name.
6402         #
6403         #  @return New GEOM.GEOM_Object, containing processed shape.
6404         #
6405         #  @ref tui_close_contour "Example"
6406         @ManageTransactions("HealOp")
6407         def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6408             """
6409             Close an open wire.
6410
6411             Parameters:
6412                 theObject Shape to be processed.
6413                 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6414                          if [ ], then theObject itself is a wire.
6415                 isCommonVertex If True  : closure by creation of a common vertex,
6416                                If False : closure by creation of an edge between ends.
6417                 theName Object name; when specified, this parameter is used
6418                         for result publication in the study. Otherwise, if automatic
6419                         publication is switched on, default value is used for result name.
6420
6421             Returns:
6422                 New GEOM.GEOM_Object, containing processed shape.
6423             """
6424             # Example: see GEOM_TestHealing.py
6425             anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6426             RaiseIfFailed("CloseContour", self.HealOp)
6427             self._autoPublish(anObj, theName, "closeContour")
6428             return anObj
6429
6430         ## Addition of a point to a given edge object.
6431         #  @param theObject Shape to be processed.
6432         #  @param theEdgeIndex Index of edge to be divided within theObject's shape,
6433         #                      if -1, then theObject itself is the edge.
6434         #  @param theValue Value of parameter on edge or length parameter,
6435         #                  depending on \a isByParameter.
6436         #  @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6437         #                       if FALSE : \a theValue is treated as a length parameter [0..1]
6438         #  @param theName Object name; when specified, this parameter is used
6439         #         for result publication in the study. Otherwise, if automatic
6440         #         publication is switched on, default value is used for result name.
6441         #
6442         #  @return New GEOM.GEOM_Object, containing processed shape.
6443         #
6444         #  @ref tui_add_point_on_edge "Example"
6445         @ManageTransactions("HealOp")
6446         def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6447             """
6448             Addition of a point to a given edge object.
6449
6450             Parameters:
6451                 theObject Shape to be processed.
6452                 theEdgeIndex Index of edge to be divided within theObject's shape,
6453                              if -1, then theObject itself is the edge.
6454                 theValue Value of parameter on edge or length parameter,
6455                          depending on isByParameter.
6456                 isByParameter If TRUE :  theValue is treated as a curve parameter [0..1],
6457                               if FALSE : theValue is treated as a length parameter [0..1]
6458                 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             Returns:
6463                 New GEOM.GEOM_Object, containing processed shape.
6464             """
6465             # Example: see GEOM_TestHealing.py
6466             theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6467             anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6468             RaiseIfFailed("DivideEdge", self.HealOp)
6469             anObj.SetParameters(Parameters)
6470             self._autoPublish(anObj, theName, "divideEdge")
6471             return anObj
6472
6473         ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6474         #  @param theWire Wire to minimize the number of C1 continuous edges in.
6475         #  @param theVertices A list of vertices to suppress. If the list
6476         #                     is empty, all vertices in a wire will be assumed.
6477         #  @param theName Object name; when specified, this parameter is used
6478         #         for result publication in the study. Otherwise, if automatic
6479         #         publication is switched on, default value is used for result name.
6480         #
6481         #  @return New GEOM.GEOM_Object with modified wire.
6482         #
6483         #  @ref tui_fuse_collinear_edges "Example"
6484         @ManageTransactions("HealOp")
6485         def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6486             """
6487             Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6488
6489             Parameters:
6490                 theWire Wire to minimize the number of C1 continuous edges in.
6491                 theVertices A list of vertices to suppress. If the list
6492                             is empty, all vertices in a wire will be assumed.
6493                 theName Object name; when specified, this parameter is used
6494                         for result publication in the study. Otherwise, if automatic
6495                         publication is switched on, default value is used for result name.
6496
6497             Returns:
6498                 New GEOM.GEOM_Object with modified wire.
6499             """
6500             anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6501             RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6502             self._autoPublish(anObj, theName, "fuseEdges")
6503             return anObj
6504
6505         ## Change orientation of the given object. Updates given shape.
6506         #  @param theObject Shape to be processed.
6507         #  @return Updated <var>theObject</var>
6508         #
6509         #  @ref swig_todo "Example"
6510         @ManageTransactions("HealOp")
6511         def ChangeOrientationShell(self,theObject):
6512             """
6513             Change orientation of the given object. Updates given shape.
6514
6515             Parameters:
6516                 theObject Shape to be processed.
6517
6518             Returns:
6519                 Updated theObject
6520             """
6521             theObject = self.HealOp.ChangeOrientation(theObject)
6522             RaiseIfFailed("ChangeOrientation", self.HealOp)
6523             pass
6524
6525         ## Change orientation of the given object.
6526         #  @param theObject Shape to be processed.
6527         #  @param theName Object name; when specified, this parameter is used
6528         #         for result publication in the study. Otherwise, if automatic
6529         #         publication is switched on, default value is used for result name.
6530         #
6531         #  @return New GEOM.GEOM_Object, containing processed shape.
6532         #
6533         #  @ref swig_todo "Example"
6534         @ManageTransactions("HealOp")
6535         def ChangeOrientationShellCopy(self, theObject, theName=None):
6536             """
6537             Change orientation of the given object.
6538
6539             Parameters:
6540                 theObject Shape to be processed.
6541                 theName Object name; when specified, this parameter is used
6542                         for result publication in the study. Otherwise, if automatic
6543                         publication is switched on, default value is used for result name.
6544
6545             Returns:
6546                 New GEOM.GEOM_Object, containing processed shape.
6547             """
6548             anObj = self.HealOp.ChangeOrientationCopy(theObject)
6549             RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6550             self._autoPublish(anObj, theName, "reversed")
6551             return anObj
6552
6553         ## Try to limit tolerance of the given object by value \a theTolerance.
6554         #  @param theObject Shape to be processed.
6555         #  @param theTolerance Required tolerance value.
6556         #  @param theName Object name; when specified, this parameter is used
6557         #         for result publication in the study. Otherwise, if automatic
6558         #         publication is switched on, default value is used for result name.
6559         #
6560         #  @return New GEOM.GEOM_Object, containing processed shape.
6561         #
6562         #  @ref tui_limit_tolerance "Example"
6563         @ManageTransactions("HealOp")
6564         def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6565             """
6566             Try to limit tolerance of the given object by value theTolerance.
6567
6568             Parameters:
6569                 theObject Shape to be processed.
6570                 theTolerance Required tolerance value.
6571                 theName Object name; when specified, this parameter is used
6572                         for result publication in the study. Otherwise, if automatic
6573                         publication is switched on, default value is used for result name.
6574
6575             Returns:
6576                 New GEOM.GEOM_Object, containing processed shape.
6577             """
6578             anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6579             RaiseIfFailed("LimitTolerance", self.HealOp)
6580             self._autoPublish(anObj, theName, "limitTolerance")
6581             return anObj
6582
6583         ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6584         #  that constitute a free boundary of the given shape.
6585         #  @param theObject Shape to get free boundary of.
6586         #  @param theName Object name; when specified, this parameter is used
6587         #         for result publication in the study. Otherwise, if automatic
6588         #         publication is switched on, default value is used for result name.
6589         #
6590         #  @return [\a status, \a theClosedWires, \a theOpenWires]
6591         #  \n \a status: FALSE, if an error(s) occured during the method execution.
6592         #  \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6593         #  \n \a theOpenWires: Open wires on the free boundary of the given shape.
6594         #
6595         #  @ref tui_measurement_tools_page "Example"
6596         @ManageTransactions("HealOp")
6597         def GetFreeBoundary(self, theObject, theName=None):
6598             """
6599             Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6600             that constitute a free boundary of the given shape.
6601
6602             Parameters:
6603                 theObject Shape to get free boundary of.
6604                 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             Returns:
6609                 [status, theClosedWires, theOpenWires]
6610                  status: FALSE, if an error(s) occured during the method execution.
6611                  theClosedWires: Closed wires on the free boundary of the given shape.
6612                  theOpenWires: Open wires on the free boundary of the given shape.
6613             """
6614             # Example: see GEOM_TestHealing.py
6615             anObj = self.HealOp.GetFreeBoundary(theObject)
6616             RaiseIfFailed("GetFreeBoundary", self.HealOp)
6617             self._autoPublish(anObj[1], theName, "closedWire")
6618             self._autoPublish(anObj[2], theName, "openWire")
6619             return anObj
6620
6621         ## Replace coincident faces in theShape by one face.
6622         #  @param theShape Initial shape.
6623         #  @param theTolerance Maximum distance between faces, which can be considered as coincident.
6624         #  @param doKeepNonSolids If FALSE, only solids will present in the result,
6625         #                         otherwise all initial shapes.
6626         #  @param theName Object name; when specified, this parameter is used
6627         #         for result publication in the study. Otherwise, if automatic
6628         #         publication is switched on, default value is used for result name.
6629         #
6630         #  @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6631         #
6632         #  @ref tui_glue_faces "Example"
6633         @ManageTransactions("ShapesOp")
6634         def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6635             """
6636             Replace coincident faces in theShape by one face.
6637
6638             Parameters:
6639                 theShape Initial shape.
6640                 theTolerance Maximum distance between faces, which can be considered as coincident.
6641                 doKeepNonSolids If FALSE, only solids will present in the result,
6642                                 otherwise all initial shapes.
6643                 theName Object name; when specified, this parameter is used
6644                         for result publication in the study. Otherwise, if automatic
6645                         publication is switched on, default value is used for result name.
6646
6647             Returns:
6648                 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6649             """
6650             # Example: see GEOM_Spanner.py
6651             theTolerance,Parameters = ParseParameters(theTolerance)
6652             anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6653             if anObj is None:
6654                 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6655             anObj.SetParameters(Parameters)
6656             self._autoPublish(anObj, theName, "glueFaces")
6657             return anObj
6658
6659         ## Find coincident faces in theShape for possible gluing.
6660         #  @param theShape Initial shape.
6661         #  @param theTolerance Maximum distance between faces,
6662         #                      which can be considered as coincident.
6663         #  @param theName Object name; when specified, this parameter is used
6664         #         for result publication in the study. Otherwise, if automatic
6665         #         publication is switched on, default value is used for result name.
6666         #
6667         #  @return GEOM.ListOfGO
6668         #
6669         #  @ref tui_glue_faces "Example"
6670         @ManageTransactions("ShapesOp")
6671         def GetGlueFaces(self, theShape, theTolerance, theName=None):
6672             """
6673             Find coincident faces in theShape for possible gluing.
6674
6675             Parameters:
6676                 theShape Initial shape.
6677                 theTolerance Maximum distance between faces,
6678                              which can be considered as coincident.
6679                 theName Object name; when specified, this parameter is used
6680                         for result publication in the study. Otherwise, if automatic
6681                         publication is switched on, default value is used for result name.
6682
6683             Returns:
6684                 GEOM.ListOfGO
6685             """
6686             anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6687             RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6688             self._autoPublish(anObj, theName, "facesToGlue")
6689             return anObj
6690
6691         ## Replace coincident faces in theShape by one face
6692         #  in compliance with given list of faces
6693         #  @param theShape Initial shape.
6694         #  @param theTolerance Maximum distance between faces,
6695         #                      which can be considered as coincident.
6696         #  @param theFaces List of faces for gluing.
6697         #  @param doKeepNonSolids If FALSE, only solids will present in the result,
6698         #                         otherwise all initial shapes.
6699         #  @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6700         #                        will be glued, otherwise only the edges,
6701         #                        belonging to <VAR>theFaces</VAR>.
6702         #  @param theName Object name; when specified, this parameter is used
6703         #         for result publication in the study. Otherwise, if automatic
6704         #         publication is switched on, default value is used for result name.
6705         #
6706         #  @return New GEOM.GEOM_Object, containing a copy of theShape
6707         #          without some faces.
6708         #
6709         #  @ref tui_glue_faces "Example"
6710         @ManageTransactions("ShapesOp")
6711         def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6712                                 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6713             """
6714             Replace coincident faces in theShape by one face
6715             in compliance with given list of faces
6716
6717             Parameters:
6718                 theShape Initial shape.
6719                 theTolerance Maximum distance between faces,
6720                              which can be considered as coincident.
6721                 theFaces List of faces for gluing.
6722                 doKeepNonSolids If FALSE, only solids will present in the result,
6723                                 otherwise all initial shapes.
6724                 doGlueAllEdges If TRUE, all coincident edges of theShape
6725                                will be glued, otherwise only the edges,
6726                                belonging to theFaces.
6727                 theName Object name; when specified, this parameter is used
6728                         for result publication in the study. Otherwise, if automatic
6729                         publication is switched on, default value is used for result name.
6730
6731             Returns:
6732                 New GEOM.GEOM_Object, containing a copy of theShape
6733                     without some faces.
6734             """
6735             anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6736                                                       doKeepNonSolids, doGlueAllEdges)
6737             if anObj is None:
6738                 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6739             self._autoPublish(anObj, theName, "glueFaces")
6740             return anObj
6741
6742         ## Replace coincident edges in theShape by one edge.
6743         #  @param theShape Initial shape.
6744         #  @param theTolerance Maximum distance between edges, which can be considered as coincident.
6745         #  @param theName Object name; when specified, this parameter is used
6746         #         for result publication in the study. Otherwise, if automatic
6747         #         publication is switched on, default value is used for result name.
6748         #
6749         #  @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6750         #
6751         #  @ref tui_glue_edges "Example"
6752         @ManageTransactions("ShapesOp")
6753         def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6754             """
6755             Replace coincident edges in theShape by one edge.
6756
6757             Parameters:
6758                 theShape Initial shape.
6759                 theTolerance Maximum distance between edges, which can be considered as coincident.
6760                 theName Object name; when specified, this parameter is used
6761                         for result publication in the study. Otherwise, if automatic
6762                         publication is switched on, default value is used for result name.
6763
6764             Returns:
6765                 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6766             """
6767             theTolerance,Parameters = ParseParameters(theTolerance)
6768             anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6769             if anObj is None:
6770                 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6771             anObj.SetParameters(Parameters)
6772             self._autoPublish(anObj, theName, "glueEdges")
6773             return anObj
6774
6775         ## Find coincident edges in theShape for possible gluing.
6776         #  @param theShape Initial shape.
6777         #  @param theTolerance Maximum distance between edges,
6778         #                      which can be considered as coincident.
6779         #  @param theName Object name; when specified, this parameter is used
6780         #         for result publication in the study. Otherwise, if automatic
6781         #         publication is switched on, default value is used for result name.
6782         #
6783         #  @return GEOM.ListOfGO
6784         #
6785         #  @ref tui_glue_edges "Example"
6786         @ManageTransactions("ShapesOp")
6787         def GetGlueEdges(self, theShape, theTolerance, theName=None):
6788             """
6789             Find coincident edges in theShape for possible gluing.
6790
6791             Parameters:
6792                 theShape Initial shape.
6793                 theTolerance Maximum distance between edges,
6794                              which can be considered as coincident.
6795                 theName Object name; when specified, this parameter is used
6796                         for result publication in the study. Otherwise, if automatic
6797                         publication is switched on, default value is used for result name.
6798
6799             Returns:
6800                 GEOM.ListOfGO
6801             """
6802             anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6803             RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6804             self._autoPublish(anObj, theName, "edgesToGlue")
6805             return anObj
6806
6807         ## Replace coincident edges in theShape by one edge
6808         #  in compliance with given list of edges.
6809         #  @param theShape Initial shape.
6810         #  @param theTolerance Maximum distance between edges,
6811         #                      which can be considered as coincident.
6812         #  @param theEdges List of edges for gluing.
6813         #  @param theName Object name; when specified, this parameter is used
6814         #         for result publication in the study. Otherwise, if automatic
6815         #         publication is switched on, default value is used for result name.
6816         #
6817         #  @return New GEOM.GEOM_Object, containing a copy of theShape
6818         #          without some edges.
6819         #
6820         #  @ref tui_glue_edges "Example"
6821         @ManageTransactions("ShapesOp")
6822         def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6823             """
6824             Replace coincident edges in theShape by one edge
6825             in compliance with given list of edges.
6826
6827             Parameters:
6828                 theShape Initial shape.
6829                 theTolerance Maximum distance between edges,
6830                              which can be considered as coincident.
6831                 theEdges List of edges for gluing.
6832                 theName Object name; when specified, this parameter is used
6833                         for result publication in the study. Otherwise, if automatic
6834                         publication is switched on, default value is used for result name.
6835
6836             Returns:
6837                 New GEOM.GEOM_Object, containing a copy of theShape
6838                 without some edges.
6839             """
6840             anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6841             if anObj is None:
6842                 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6843             self._autoPublish(anObj, theName, "glueEdges")
6844             return anObj
6845
6846         # end of l3_healing
6847         ## @}
6848
6849         ## @addtogroup l3_boolean Boolean Operations
6850         ## @{
6851
6852         # -----------------------------------------------------------------------------
6853         # Boolean (Common, Cut, Fuse, Section)
6854         # -----------------------------------------------------------------------------
6855
6856         ## Perform one of boolean operations on two given shapes.
6857         #  @param theShape1 First argument for boolean operation.
6858         #  @param theShape2 Second argument for boolean operation.
6859         #  @param theOperation Indicates the operation to be done:\n
6860         #                      1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6861         #  @param checkSelfInte The flag that tells if the arguments should
6862         #         be checked for self-intersection prior to the operation.
6863         #  @param theName Object name; when specified, this parameter is used
6864         #         for result publication in the study. Otherwise, if automatic
6865         #         publication is switched on, default value is used for result name.
6866         #
6867         #  @note This algorithm doesn't find all types of self-intersections.
6868         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6869         #        vertex/face and edge/face intersections. Face/face
6870         #        intersections detection is switched off as it is a
6871         #        time-consuming operation that gives an impact on performance.
6872         #        To find all self-intersections please use
6873         #        CheckSelfIntersections() method.
6874         #
6875         #  @return New GEOM.GEOM_Object, containing the result shape.
6876         #
6877         #  @ref tui_fuse "Example"
6878         @ManageTransactions("BoolOp")
6879         def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
6880             """
6881             Perform one of boolean operations on two given shapes.
6882
6883             Parameters:
6884                 theShape1 First argument for boolean operation.
6885                 theShape2 Second argument for boolean operation.
6886                 theOperation Indicates the operation to be done:
6887                              1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6888                 checkSelfInte The flag that tells if the arguments should
6889                               be checked for self-intersection prior to
6890                               the operation.
6891                 theName Object name; when specified, this parameter is used
6892                         for result publication in the study. Otherwise, if automatic
6893                         publication is switched on, default value is used for result name.
6894
6895             Note:
6896                     This algorithm doesn't find all types of self-intersections.
6897                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6898                     vertex/face and edge/face intersections. Face/face
6899                     intersections detection is switched off as it is a
6900                     time-consuming operation that gives an impact on performance.
6901                     To find all self-intersections please use
6902                     CheckSelfIntersections() method.
6903
6904             Returns:
6905                 New GEOM.GEOM_Object, containing the result shape.
6906             """
6907             # Example: see GEOM_TestAll.py
6908             anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
6909             RaiseIfFailed("MakeBoolean", self.BoolOp)
6910             def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6911             self._autoPublish(anObj, theName, def_names[theOperation])
6912             return anObj
6913
6914         ## Perform Common boolean operation on two given shapes.
6915         #  @param theShape1 First argument for boolean operation.
6916         #  @param theShape2 Second argument for boolean operation.
6917         #  @param checkSelfInte The flag that tells if the arguments should
6918         #         be checked for self-intersection prior to the operation.
6919         #  @param theName Object name; when specified, this parameter is used
6920         #         for result publication in the study. Otherwise, if automatic
6921         #         publication is switched on, default value is used for result name.
6922         #
6923         #  @note This algorithm doesn't find all types of self-intersections.
6924         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6925         #        vertex/face and edge/face intersections. Face/face
6926         #        intersections detection is switched off as it is a
6927         #        time-consuming operation that gives an impact on performance.
6928         #        To find all self-intersections please use
6929         #        CheckSelfIntersections() method.
6930         #
6931         #  @return New GEOM.GEOM_Object, containing the result shape.
6932         #
6933         #  @ref tui_common "Example 1"
6934         #  \n @ref swig_MakeCommon "Example 2"
6935         def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6936             """
6937             Perform Common boolean operation on two given shapes.
6938
6939             Parameters:
6940                 theShape1 First argument for boolean operation.
6941                 theShape2 Second argument for boolean operation.
6942                 checkSelfInte The flag that tells if the arguments should
6943                               be checked for self-intersection prior to
6944                               the operation.
6945                 theName Object name; when specified, this parameter is used
6946                         for result publication in the study. Otherwise, if automatic
6947                         publication is switched on, default value is used for result name.
6948
6949             Note:
6950                     This algorithm doesn't find all types of self-intersections.
6951                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6952                     vertex/face and edge/face intersections. Face/face
6953                     intersections detection is switched off as it is a
6954                     time-consuming operation that gives an impact on performance.
6955                     To find all self-intersections please use
6956                     CheckSelfIntersections() method.
6957
6958             Returns:
6959                 New GEOM.GEOM_Object, containing the result shape.
6960             """
6961             # Example: see GEOM_TestOthers.py
6962             # note: auto-publishing is done in self.MakeBoolean()
6963             return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
6964
6965         ## Perform Cut boolean operation on two given shapes.
6966         #  @param theShape1 First argument for boolean operation.
6967         #  @param theShape2 Second argument for boolean operation.
6968         #  @param checkSelfInte The flag that tells if the arguments should
6969         #         be checked for self-intersection prior to the operation.
6970         #  @param theName Object name; when specified, this parameter is used
6971         #         for result publication in the study. Otherwise, if automatic
6972         #         publication is switched on, default value is used for result name.
6973         #
6974         #  @note This algorithm doesn't find all types of self-intersections.
6975         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6976         #        vertex/face and edge/face intersections. Face/face
6977         #        intersections detection is switched off as it is a
6978         #        time-consuming operation that gives an impact on performance.
6979         #        To find all self-intersections please use
6980         #        CheckSelfIntersections() method.
6981         #
6982         #  @return New GEOM.GEOM_Object, containing the result shape.
6983         #
6984         #  @ref tui_cut "Example 1"
6985         #  \n @ref swig_MakeCommon "Example 2"
6986         def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6987             """
6988             Perform Cut boolean operation on two given shapes.
6989
6990             Parameters:
6991                 theShape1 First argument for boolean operation.
6992                 theShape2 Second argument for boolean operation.
6993                 checkSelfInte The flag that tells if the arguments should
6994                               be checked for self-intersection prior to
6995                               the operation.
6996                 theName Object name; when specified, this parameter is used
6997                         for result publication in the study. Otherwise, if automatic
6998                         publication is switched on, default value is used for result name.
6999
7000             Note:
7001                     This algorithm doesn't find all types of self-intersections.
7002                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7003                     vertex/face and edge/face intersections. Face/face
7004                     intersections detection is switched off as it is a
7005                     time-consuming operation that gives an impact on performance.
7006                     To find all self-intersections please use
7007                     CheckSelfIntersections() method.
7008
7009             Returns:
7010                 New GEOM.GEOM_Object, containing the result shape.
7011
7012             """
7013             # Example: see GEOM_TestOthers.py
7014             # note: auto-publishing is done in self.MakeBoolean()
7015             return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7016
7017         ## Perform Fuse boolean operation on two given shapes.
7018         #  @param theShape1 First argument for boolean operation.
7019         #  @param theShape2 Second argument for boolean operation.
7020         #  @param checkSelfInte The flag that tells if the arguments should
7021         #         be checked for self-intersection prior to the operation.
7022         #  @param rmExtraEdges The flag that tells if Remove Extra Edges
7023         #         operation should be performed during the operation.
7024         #  @param theName Object name; when specified, this parameter is used
7025         #         for result publication in the study. Otherwise, if automatic
7026         #         publication is switched on, default value is used for result name.
7027         #
7028         #  @note This algorithm doesn't find all types of self-intersections.
7029         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7030         #        vertex/face and edge/face intersections. Face/face
7031         #        intersections detection is switched off as it is a
7032         #        time-consuming operation that gives an impact on performance.
7033         #        To find all self-intersections please use
7034         #        CheckSelfIntersections() method.
7035         #
7036         #  @return New GEOM.GEOM_Object, containing the result shape.
7037         #
7038         #  @ref tui_fuse "Example 1"
7039         #  \n @ref swig_MakeCommon "Example 2"
7040         @ManageTransactions("BoolOp")
7041         def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7042                      rmExtraEdges=False, theName=None):
7043             """
7044             Perform Fuse boolean operation on two given shapes.
7045
7046             Parameters:
7047                 theShape1 First argument for boolean operation.
7048                 theShape2 Second argument for boolean operation.
7049                 checkSelfInte The flag that tells if the arguments should
7050                               be checked for self-intersection prior to
7051                               the operation.
7052                 rmExtraEdges The flag that tells if Remove Extra Edges
7053                              operation should be performed during the operation.
7054                 theName Object name; when specified, this parameter is used
7055                         for result publication in the study. Otherwise, if automatic
7056                         publication is switched on, default value is used for result name.
7057
7058             Note:
7059                     This algorithm doesn't find all types of self-intersections.
7060                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7061                     vertex/face and edge/face intersections. Face/face
7062                     intersections detection is switched off as it is a
7063                     time-consuming operation that gives an impact on performance.
7064                     To find all self-intersections please use
7065                     CheckSelfIntersections() method.
7066
7067             Returns:
7068                 New GEOM.GEOM_Object, containing the result shape.
7069
7070             """
7071             # Example: see GEOM_TestOthers.py
7072             anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7073                                          checkSelfInte, rmExtraEdges)
7074             RaiseIfFailed("MakeFuse", self.BoolOp)
7075             self._autoPublish(anObj, theName, "fuse")
7076             return anObj
7077
7078         ## Perform Section boolean operation on two given shapes.
7079         #  @param theShape1 First argument for boolean operation.
7080         #  @param theShape2 Second argument for boolean operation.
7081         #  @param checkSelfInte The flag that tells if the arguments should
7082         #         be checked for self-intersection prior to the operation.
7083         #  @param theName Object name; when specified, this parameter is used
7084         #         for result publication in the study. Otherwise, if automatic
7085         #         publication is switched on, default value is used for result name.
7086         #
7087         #  @note This algorithm doesn't find all types of self-intersections.
7088         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7089         #        vertex/face and edge/face intersections. Face/face
7090         #        intersections detection is switched off as it is a
7091         #        time-consuming operation that gives an impact on performance.
7092         #        To find all self-intersections please use
7093         #        CheckSelfIntersections() method.
7094         #
7095         #  @return New GEOM.GEOM_Object, containing the result shape.
7096         #
7097         #  @ref tui_section "Example 1"
7098         #  \n @ref swig_MakeCommon "Example 2"
7099         def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7100             """
7101             Perform Section boolean operation on two given shapes.
7102
7103             Parameters:
7104                 theShape1 First argument for boolean operation.
7105                 theShape2 Second argument for boolean operation.
7106                 checkSelfInte The flag that tells if the arguments should
7107                               be checked for self-intersection prior to
7108                               the operation.
7109                 theName Object name; when specified, this parameter is used
7110                         for result publication in the study. Otherwise, if automatic
7111                         publication is switched on, default value is used for result name.
7112
7113             Note:
7114                     This algorithm doesn't find all types of self-intersections.
7115                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7116                     vertex/face and edge/face intersections. Face/face
7117                     intersections detection is switched off as it is a
7118                     time-consuming operation that gives an impact on performance.
7119                     To find all self-intersections please use
7120                     CheckSelfIntersections() method.
7121
7122             Returns:
7123                 New GEOM.GEOM_Object, containing the result shape.
7124
7125             """
7126             # Example: see GEOM_TestOthers.py
7127             # note: auto-publishing is done in self.MakeBoolean()
7128             return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7129
7130         ## Perform Fuse boolean operation on the list of shapes.
7131         #  @param theShapesList Shapes to be fused.
7132         #  @param checkSelfInte The flag that tells if the arguments should
7133         #         be checked for self-intersection prior to the operation.
7134         #  @param rmExtraEdges The flag that tells if Remove Extra Edges
7135         #         operation should be performed during the operation.
7136         #  @param theName Object name; when specified, this parameter is used
7137         #         for result publication in the study. Otherwise, if automatic
7138         #         publication is switched on, default value is used for result name.
7139         #
7140         #  @note This algorithm doesn't find all types of self-intersections.
7141         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7142         #        vertex/face and edge/face intersections. Face/face
7143         #        intersections detection is switched off as it is a
7144         #        time-consuming operation that gives an impact on performance.
7145         #        To find all self-intersections please use
7146         #        CheckSelfIntersections() method.
7147         #
7148         #  @return New GEOM.GEOM_Object, containing the result shape.
7149         #
7150         #  @ref tui_fuse "Example 1"
7151         #  \n @ref swig_MakeCommon "Example 2"
7152         @ManageTransactions("BoolOp")
7153         def MakeFuseList(self, theShapesList, checkSelfInte=False,
7154                          rmExtraEdges=False, theName=None):
7155             """
7156             Perform Fuse boolean operation on the list of shapes.
7157
7158             Parameters:
7159                 theShapesList Shapes to be fused.
7160                 checkSelfInte The flag that tells if the arguments should
7161                               be checked for self-intersection prior to
7162                               the operation.
7163                 rmExtraEdges The flag that tells if Remove Extra Edges
7164                              operation should be performed during the operation.
7165                 theName Object name; when specified, this parameter is used
7166                         for result publication in the study. Otherwise, if automatic
7167                         publication is switched on, default value is used for result name.
7168
7169             Note:
7170                     This algorithm doesn't find all types of self-intersections.
7171                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7172                     vertex/face and edge/face intersections. Face/face
7173                     intersections detection is switched off as it is a
7174                     time-consuming operation that gives an impact on performance.
7175                     To find all self-intersections please use
7176                     CheckSelfIntersections() method.
7177
7178             Returns:
7179                 New GEOM.GEOM_Object, containing the result shape.
7180
7181             """
7182             # Example: see GEOM_TestOthers.py
7183             anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7184                                              rmExtraEdges)
7185             RaiseIfFailed("MakeFuseList", self.BoolOp)
7186             self._autoPublish(anObj, theName, "fuse")
7187             return anObj
7188
7189         ## Perform Common boolean operation on the list of shapes.
7190         #  @param theShapesList Shapes for Common operation.
7191         #  @param checkSelfInte The flag that tells if the arguments should
7192         #         be checked for self-intersection prior to the operation.
7193         #  @param theName Object name; when specified, this parameter is used
7194         #         for result publication in the study. Otherwise, if automatic
7195         #         publication is switched on, default value is used for result name.
7196         #
7197         #  @note This algorithm doesn't find all types of self-intersections.
7198         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7199         #        vertex/face and edge/face intersections. Face/face
7200         #        intersections detection is switched off as it is a
7201         #        time-consuming operation that gives an impact on performance.
7202         #        To find all self-intersections please use
7203         #        CheckSelfIntersections() method.
7204         #
7205         #  @return New GEOM.GEOM_Object, containing the result shape.
7206         #
7207         #  @ref tui_common "Example 1"
7208         #  \n @ref swig_MakeCommon "Example 2"
7209         @ManageTransactions("BoolOp")
7210         def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7211             """
7212             Perform Common boolean operation on the list of shapes.
7213
7214             Parameters:
7215                 theShapesList Shapes for Common operation.
7216                 checkSelfInte The flag that tells if the arguments should
7217                               be checked for self-intersection prior to
7218                               the operation.
7219                 theName Object name; when specified, this parameter is used
7220                         for result publication in the study. Otherwise, if automatic
7221                         publication is switched on, default value is used for result name.
7222
7223             Note:
7224                     This algorithm doesn't find all types of self-intersections.
7225                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7226                     vertex/face and edge/face intersections. Face/face
7227                     intersections detection is switched off as it is a
7228                     time-consuming operation that gives an impact on performance.
7229                     To find all self-intersections please use
7230                     CheckSelfIntersections() method.
7231
7232             Returns:
7233                 New GEOM.GEOM_Object, containing the result shape.
7234
7235             """
7236             # Example: see GEOM_TestOthers.py
7237             anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7238             RaiseIfFailed("MakeCommonList", self.BoolOp)
7239             self._autoPublish(anObj, theName, "common")
7240             return anObj
7241
7242         ## Perform Cut boolean operation on one object and the list of tools.
7243         #  @param theMainShape The object of the operation.
7244         #  @param theShapesList The list of tools of the operation.
7245         #  @param checkSelfInte The flag that tells if the arguments should
7246         #         be checked for self-intersection prior to the operation.
7247         #  @param theName Object name; when specified, this parameter is used
7248         #         for result publication in the study. Otherwise, if automatic
7249         #         publication is switched on, default value is used for result name.
7250         #
7251         #  @note This algorithm doesn't find all types of self-intersections.
7252         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7253         #        vertex/face and edge/face intersections. Face/face
7254         #        intersections detection is switched off as it is a
7255         #        time-consuming operation that gives an impact on performance.
7256         #        To find all self-intersections please use
7257         #        CheckSelfIntersections() method.
7258         #
7259         #  @return New GEOM.GEOM_Object, containing the result shape.
7260         #
7261         #  @ref tui_cut "Example 1"
7262         #  \n @ref swig_MakeCommon "Example 2"
7263         @ManageTransactions("BoolOp")
7264         def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7265             """
7266             Perform Cut boolean operation on one object and the list of tools.
7267
7268             Parameters:
7269                 theMainShape The object of the operation.
7270                 theShapesList The list of tools of the operation.
7271                 checkSelfInte The flag that tells if the arguments should
7272                               be checked for self-intersection prior to
7273                               the operation.
7274                 theName Object name; when specified, this parameter is used
7275                         for result publication in the study. Otherwise, if automatic
7276                         publication is switched on, default value is used for result name.
7277
7278             Note:
7279                     This algorithm doesn't find all types of self-intersections.
7280                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7281                     vertex/face and edge/face intersections. Face/face
7282                     intersections detection is switched off as it is a
7283                     time-consuming operation that gives an impact on performance.
7284                     To find all self-intersections please use
7285                     CheckSelfIntersections() method.
7286
7287             Returns:
7288                 New GEOM.GEOM_Object, containing the result shape.
7289
7290             """
7291             # Example: see GEOM_TestOthers.py
7292             anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7293             RaiseIfFailed("MakeCutList", self.BoolOp)
7294             self._autoPublish(anObj, theName, "cut")
7295             return anObj
7296
7297         # end of l3_boolean
7298         ## @}
7299
7300         ## @addtogroup l3_basic_op
7301         ## @{
7302
7303         ## Perform partition operation.
7304         #  @param ListShapes Shapes to be intersected.
7305         #  @param ListTools Shapes to intersect theShapes.
7306         #  @param Limit Type of resulting shapes (see ShapeType()).\n
7307         #         If this parameter is set to -1 ("Auto"), most appropriate shape limit
7308         #         type will be detected automatically.
7309         #  @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7310         #                             target type (equal to Limit) are kept in the result,
7311         #                             else standalone shapes of lower dimension
7312         #                             are kept also (if they exist).
7313         #
7314         #  @param theName Object name; when specified, this parameter is used
7315         #         for result publication in the study. Otherwise, if automatic
7316         #         publication is switched on, default value is used for result name.
7317         #
7318         #  @note Each compound from ListShapes and ListTools will be exploded
7319         #        in order to avoid possible intersection between shapes from this compound.
7320         #
7321         #  After implementation new version of PartitionAlgo (October 2006)
7322         #  other parameters are ignored by current functionality. They are kept
7323         #  in this function only for support old versions.
7324         #      @param ListKeepInside Shapes, outside which the results will be deleted.
7325         #         Each shape from theKeepInside must belong to theShapes also.
7326         #      @param ListRemoveInside Shapes, inside which the results will be deleted.
7327         #         Each shape from theRemoveInside must belong to theShapes also.
7328         #      @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7329         #      @param ListMaterials Material indices for each shape. Make sence,
7330         #         only if theRemoveWebs is TRUE.
7331         #
7332         #  @return New GEOM.GEOM_Object, containing the result shapes.
7333         #
7334         #  @ref tui_partition "Example"
7335         @ManageTransactions("BoolOp")
7336         def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7337                           Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7338                           KeepNonlimitShapes=0, theName=None):
7339             """
7340             Perform partition operation.
7341
7342             Parameters:
7343                 ListShapes Shapes to be intersected.
7344                 ListTools Shapes to intersect theShapes.
7345                 Limit Type of resulting shapes (see geompy.ShapeType)
7346                       If this parameter is set to -1 ("Auto"), most appropriate shape limit
7347                       type will be detected automatically.
7348                 KeepNonlimitShapes if this parameter == 0, then only shapes of
7349                                     target type (equal to Limit) are kept in the result,
7350                                     else standalone shapes of lower dimension
7351                                     are kept also (if they exist).
7352
7353                 theName Object name; when specified, this parameter is used
7354                         for result publication in the study. Otherwise, if automatic
7355                         publication is switched on, default value is used for result name.
7356             Note:
7357                     Each compound from ListShapes and ListTools will be exploded
7358                     in order to avoid possible intersection between shapes from
7359                     this compound.
7360
7361             After implementation new version of PartitionAlgo (October 2006) other
7362             parameters are ignored by current functionality. They are kept in this
7363             function only for support old versions.
7364
7365             Ignored parameters:
7366                 ListKeepInside Shapes, outside which the results will be deleted.
7367                                Each shape from theKeepInside must belong to theShapes also.
7368                 ListRemoveInside Shapes, inside which the results will be deleted.
7369                                  Each shape from theRemoveInside must belong to theShapes also.
7370                 RemoveWebs If TRUE, perform Glue 3D algorithm.
7371                 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7372
7373             Returns:
7374                 New GEOM.GEOM_Object, containing the result shapes.
7375             """
7376             # Example: see GEOM_TestAll.py
7377             if Limit == self.ShapeType["AUTO"]:
7378                 # automatic detection of the most appropriate shape limit type
7379                 lim = GEOM.SHAPE
7380                 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7381                 Limit = EnumToLong(lim)
7382                 pass
7383             anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7384                                               ListKeepInside, ListRemoveInside,
7385                                               Limit, RemoveWebs, ListMaterials,
7386                                               KeepNonlimitShapes);
7387             RaiseIfFailed("MakePartition", self.BoolOp)
7388             self._autoPublish(anObj, theName, "partition")
7389             return anObj
7390
7391         ## Perform partition operation.
7392         #  This method may be useful if it is needed to make a partition for
7393         #  compound contains nonintersected shapes. Performance will be better
7394         #  since intersection between shapes from compound is not performed.
7395         #
7396         #  Description of all parameters as in previous method MakePartition().
7397         #  One additional parameter is provided:
7398         #  @param checkSelfInte The flag that tells if the arguments should
7399         #         be checked for self-intersection prior to the operation.
7400         #
7401         #  @note This algorithm doesn't find all types of self-intersections.
7402         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7403         #        vertex/face and edge/face intersections. Face/face
7404         #        intersections detection is switched off as it is a
7405         #        time-consuming operation that gives an impact on performance.
7406         #        To find all self-intersections please use
7407         #        CheckSelfIntersections() method.
7408         #
7409         #  @note Passed compounds (via ListShapes or via ListTools)
7410         #           have to consist of nonintersecting shapes.
7411         #
7412         #  @return New GEOM.GEOM_Object, containing the result shapes.
7413         #
7414         #  @ref swig_todo "Example"
7415         @ManageTransactions("BoolOp")
7416         def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7417                                                  ListKeepInside=[], ListRemoveInside=[],
7418                                                  Limit=ShapeType["AUTO"], RemoveWebs=0,
7419                                                  ListMaterials=[], KeepNonlimitShapes=0,
7420                                                  checkSelfInte=False, theName=None):
7421             """
7422             Perform partition operation.
7423             This method may be useful if it is needed to make a partition for
7424             compound contains nonintersected shapes. Performance will be better
7425             since intersection between shapes from compound is not performed.
7426
7427             Parameters:
7428                 Description of all parameters as in method geompy.MakePartition.
7429                 One additional parameter is provided:
7430                 checkSelfInte The flag that tells if the arguments should
7431                               be checked for self-intersection prior to
7432                               the operation.
7433
7434             Note:
7435                     This algorithm doesn't find all types of self-intersections.
7436                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7437                     vertex/face and edge/face intersections. Face/face
7438                     intersections detection is switched off as it is a
7439                     time-consuming operation that gives an impact on performance.
7440                     To find all self-intersections please use
7441                     CheckSelfIntersections() method.
7442
7443             NOTE:
7444                 Passed compounds (via ListShapes or via ListTools)
7445                 have to consist of nonintersecting shapes.
7446
7447             Returns:
7448                 New GEOM.GEOM_Object, containing the result shapes.
7449             """
7450             if Limit == self.ShapeType["AUTO"]:
7451                 # automatic detection of the most appropriate shape limit type
7452                 lim = GEOM.SHAPE
7453                 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7454                 Limit = EnumToLong(lim)
7455                 pass
7456             anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7457                                                                      ListKeepInside, ListRemoveInside,
7458                                                                      Limit, RemoveWebs, ListMaterials,
7459                                                                      KeepNonlimitShapes, checkSelfInte);
7460             RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7461             self._autoPublish(anObj, theName, "partition")
7462             return anObj
7463
7464         ## See method MakePartition() for more information.
7465         #
7466         #  @ref tui_partition "Example 1"
7467         #  \n @ref swig_Partition "Example 2"
7468         def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7469                       Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7470                       KeepNonlimitShapes=0, theName=None):
7471             """
7472             See method geompy.MakePartition for more information.
7473             """
7474             # Example: see GEOM_TestOthers.py
7475             # note: auto-publishing is done in self.MakePartition()
7476             anObj = self.MakePartition(ListShapes, ListTools,
7477                                        ListKeepInside, ListRemoveInside,
7478                                        Limit, RemoveWebs, ListMaterials,
7479                                        KeepNonlimitShapes, theName);
7480             return anObj
7481
7482         ## Perform partition of the Shape with the Plane
7483         #  @param theShape Shape to be intersected.
7484         #  @param thePlane Tool shape, to intersect theShape.
7485         #  @param theName Object name; when specified, this parameter is used
7486         #         for result publication in the study. Otherwise, if automatic
7487         #         publication is switched on, default value is used for result name.
7488         #
7489         #  @return New GEOM.GEOM_Object, containing the result shape.
7490         #
7491         #  @ref tui_partition "Example"
7492         @ManageTransactions("BoolOp")
7493         def MakeHalfPartition(self, theShape, thePlane, theName=None):
7494             """
7495             Perform partition of the Shape with the Plane
7496
7497             Parameters:
7498                 theShape Shape to be intersected.
7499                 thePlane Tool shape, to intersect theShape.
7500                 theName Object name; when specified, this parameter is used
7501                         for result publication in the study. Otherwise, if automatic
7502                         publication is switched on, default value is used for result name.
7503
7504             Returns:
7505                 New GEOM.GEOM_Object, containing the result shape.
7506             """
7507             # Example: see GEOM_TestAll.py
7508             anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7509             RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7510             self._autoPublish(anObj, theName, "partition")
7511             return anObj
7512
7513         # end of l3_basic_op
7514         ## @}
7515
7516         ## @addtogroup l3_transform
7517         ## @{
7518
7519         ## Translate the given object along the vector, specified
7520         #  by its end points.
7521         #  @param theObject The object to be translated.
7522         #  @param thePoint1 Start point of translation vector.
7523         #  @param thePoint2 End point of translation vector.
7524         #  @param theCopy Flag used to translate object itself or create a copy.
7525         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7526         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7527         @ManageTransactions("TrsfOp")
7528         def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7529             """
7530             Translate the given object along the vector, specified by its end points.
7531
7532             Parameters:
7533                 theObject The object to be translated.
7534                 thePoint1 Start point of translation vector.
7535                 thePoint2 End point of translation vector.
7536                 theCopy Flag used to translate object itself or create a copy.
7537
7538             Returns:
7539                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7540                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7541             """
7542             if theCopy:
7543                 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7544             else:
7545                 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7546             RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7547             return anObj
7548
7549         ## Translate the given object along the vector, specified
7550         #  by its end points, creating its copy before the translation.
7551         #  @param theObject The object to be translated.
7552         #  @param thePoint1 Start point of translation vector.
7553         #  @param thePoint2 End point of translation vector.
7554         #  @param theName Object name; when specified, this parameter is used
7555         #         for result publication in the study. Otherwise, if automatic
7556         #         publication is switched on, default value is used for result name.
7557         #
7558         #  @return New GEOM.GEOM_Object, containing the translated object.
7559         #
7560         #  @ref tui_translation "Example 1"
7561         #  \n @ref swig_MakeTranslationTwoPoints "Example 2"
7562         @ManageTransactions("TrsfOp")
7563         def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7564             """
7565             Translate the given object along the vector, specified
7566             by its end points, creating its copy before the translation.
7567
7568             Parameters:
7569                 theObject The object to be translated.
7570                 thePoint1 Start point of translation vector.
7571                 thePoint2 End point of translation vector.
7572                 theName Object name; when specified, this parameter is used
7573                         for result publication in the study. Otherwise, if automatic
7574                         publication is switched on, default value is used for result name.
7575
7576             Returns:
7577                 New GEOM.GEOM_Object, containing the translated object.
7578             """
7579             # Example: see GEOM_TestAll.py
7580             anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7581             RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7582             self._autoPublish(anObj, theName, "translated")
7583             return anObj
7584
7585         ## Translate the given object along the vector, specified by its components.
7586         #  @param theObject The object to be translated.
7587         #  @param theDX,theDY,theDZ Components of translation vector.
7588         #  @param theCopy Flag used to translate object itself or create a copy.
7589         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7590         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7591         #
7592         #  @ref tui_translation "Example"
7593         @ManageTransactions("TrsfOp")
7594         def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7595             """
7596             Translate the given object along the vector, specified by its components.
7597
7598             Parameters:
7599                 theObject The object to be translated.
7600                 theDX,theDY,theDZ Components of translation vector.
7601                 theCopy Flag used to translate object itself or create a copy.
7602
7603             Returns:
7604                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7605                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7606             """
7607             # Example: see GEOM_TestAll.py
7608             theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7609             if theCopy:
7610                 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7611             else:
7612                 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7613             anObj.SetParameters(Parameters)
7614             RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7615             return anObj
7616
7617         ## Translate the given object along the vector, specified
7618         #  by its components, creating its copy before the translation.
7619         #  @param theObject The object to be translated.
7620         #  @param theDX,theDY,theDZ Components of translation vector.
7621         #  @param theName Object name; when specified, this parameter is used
7622         #         for result publication in the study. Otherwise, if automatic
7623         #         publication is switched on, default value is used for result name.
7624         #
7625         #  @return New GEOM.GEOM_Object, containing the translated object.
7626         #
7627         #  @ref tui_translation "Example"
7628         @ManageTransactions("TrsfOp")
7629         def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7630             """
7631             Translate the given object along the vector, specified
7632             by its components, creating its copy before the translation.
7633
7634             Parameters:
7635                 theObject The object to be translated.
7636                 theDX,theDY,theDZ Components of translation vector.
7637                 theName Object name; when specified, this parameter is used
7638                         for result publication in the study. Otherwise, if automatic
7639                         publication is switched on, default value is used for result name.
7640
7641             Returns:
7642                 New GEOM.GEOM_Object, containing the translated object.
7643             """
7644             # Example: see GEOM_TestAll.py
7645             theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7646             anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7647             anObj.SetParameters(Parameters)
7648             RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7649             self._autoPublish(anObj, theName, "translated")
7650             return anObj
7651
7652         ## Translate the given object along the given vector.
7653         #  @param theObject The object to be translated.
7654         #  @param theVector The translation vector.
7655         #  @param theCopy Flag used to translate object itself or create a copy.
7656         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7657         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7658         @ManageTransactions("TrsfOp")
7659         def TranslateVector(self, theObject, theVector, theCopy=False):
7660             """
7661             Translate the given object along the given vector.
7662
7663             Parameters:
7664                 theObject The object to be translated.
7665                 theVector The translation vector.
7666                 theCopy Flag used to translate object itself or create a copy.
7667
7668             Returns:
7669                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7670                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7671             """
7672             if theCopy:
7673                 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7674             else:
7675                 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7676             RaiseIfFailed("TranslateVector", self.TrsfOp)
7677             return anObj
7678
7679         ## Translate the given object along the given vector,
7680         #  creating its copy before the translation.
7681         #  @param theObject The object to be translated.
7682         #  @param theVector The translation vector.
7683         #  @param theName Object name; when specified, this parameter is used
7684         #         for result publication in the study. Otherwise, if automatic
7685         #         publication is switched on, default value is used for result name.
7686         #
7687         #  @return New GEOM.GEOM_Object, containing the translated object.
7688         #
7689         #  @ref tui_translation "Example"
7690         @ManageTransactions("TrsfOp")
7691         def MakeTranslationVector(self, theObject, theVector, theName=None):
7692             """
7693             Translate the given object along the given vector,
7694             creating its copy before the translation.
7695
7696             Parameters:
7697                 theObject The object to be translated.
7698                 theVector The 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.TranslateVectorCopy(theObject, theVector)
7708             RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7709             self._autoPublish(anObj, theName, "translated")
7710             return anObj
7711
7712         ## Translate the given object along the given vector on given distance.
7713         #  @param theObject The object to be translated.
7714         #  @param theVector The translation vector.
7715         #  @param theDistance The translation distance.
7716         #  @param theCopy Flag used to translate object itself or create a copy.
7717         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7718         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7719         #
7720         #  @ref tui_translation "Example"
7721         @ManageTransactions("TrsfOp")
7722         def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7723             """
7724             Translate the given object along the given vector on given distance.
7725
7726             Parameters:
7727                 theObject The object to be translated.
7728                 theVector The translation vector.
7729                 theDistance The translation distance.
7730                 theCopy Flag used to translate object itself or create a copy.
7731
7732             Returns:
7733                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7734                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7735             """
7736             # Example: see GEOM_TestAll.py
7737             theDistance,Parameters = ParseParameters(theDistance)
7738             anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7739             RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7740             anObj.SetParameters(Parameters)
7741             return anObj
7742
7743         ## Translate the given object along the given vector on given distance,
7744         #  creating its copy before the translation.
7745         #  @param theObject The object to be translated.
7746         #  @param theVector The translation vector.
7747         #  @param theDistance The translation distance.
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 MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7757             """
7758             Translate the given object along the given vector on given distance,
7759             creating its copy before the translation.
7760
7761             Parameters:
7762                 theObject The object to be translated.
7763                 theVector The translation vector.
7764                 theDistance The translation distance.
7765                 theName Object name; when specified, this parameter is used
7766                         for result publication in the study. Otherwise, if automatic
7767                         publication is switched on, default value is used for result name.
7768
7769             Returns:
7770                 New GEOM.GEOM_Object, containing the translated object.
7771             """
7772             # Example: see GEOM_TestAll.py
7773             theDistance,Parameters = ParseParameters(theDistance)
7774             anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7775             RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7776             anObj.SetParameters(Parameters)
7777             self._autoPublish(anObj, theName, "translated")
7778             return anObj
7779
7780         ## Rotate the given object around the given axis on the given angle.
7781         #  @param theObject The object to be rotated.
7782         #  @param theAxis Rotation axis.
7783         #  @param theAngle Rotation angle in radians.
7784         #  @param theCopy Flag used to rotate object itself or create a copy.
7785         #
7786         #  @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7787         #  new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7788         #
7789         #  @ref tui_rotation "Example"
7790         @ManageTransactions("TrsfOp")
7791         def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7792             """
7793             Rotate the given object around the given axis on the given angle.
7794
7795             Parameters:
7796                 theObject The object to be rotated.
7797                 theAxis Rotation axis.
7798                 theAngle Rotation angle in radians.
7799                 theCopy Flag used to rotate object itself or create a copy.
7800
7801             Returns:
7802                 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7803                 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7804             """
7805             # Example: see GEOM_TestAll.py
7806             flag = False
7807             if isinstance(theAngle,str):
7808                 flag = True
7809             theAngle, Parameters = ParseParameters(theAngle)
7810             if flag:
7811                 theAngle = theAngle*math.pi/180.0
7812             if theCopy:
7813                 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7814             else:
7815                 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7816             RaiseIfFailed("Rotate", self.TrsfOp)
7817             anObj.SetParameters(Parameters)
7818             return anObj
7819
7820         ## Rotate the given object around the given axis
7821         #  on the given angle, creating its copy before the rotatation.
7822         #  @param theObject The object to be rotated.
7823         #  @param theAxis Rotation axis.
7824         #  @param theAngle Rotation angle in radians.
7825         #  @param theName Object name; when specified, this parameter is used
7826         #         for result publication in the study. Otherwise, if automatic
7827         #         publication is switched on, default value is used for result name.
7828         #
7829         #  @return New GEOM.GEOM_Object, containing the rotated object.
7830         #
7831         #  @ref tui_rotation "Example"
7832         @ManageTransactions("TrsfOp")
7833         def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7834             """
7835             Rotate the given object around the given axis
7836             on the given angle, creating its copy before the rotatation.
7837
7838             Parameters:
7839                 theObject The object to be rotated.
7840                 theAxis Rotation axis.
7841                 theAngle Rotation angle in radians.
7842                 theName Object name; when specified, this parameter is used
7843                         for result publication in the study. Otherwise, if automatic
7844                         publication is switched on, default value is used for result name.
7845
7846             Returns:
7847                 New GEOM.GEOM_Object, containing the rotated object.
7848             """
7849             # Example: see GEOM_TestAll.py
7850             flag = False
7851             if isinstance(theAngle,str):
7852                 flag = True
7853             theAngle, Parameters = ParseParameters(theAngle)
7854             if flag:
7855                 theAngle = theAngle*math.pi/180.0
7856             anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7857             RaiseIfFailed("RotateCopy", self.TrsfOp)
7858             anObj.SetParameters(Parameters)
7859             self._autoPublish(anObj, theName, "rotated")
7860             return anObj
7861
7862         ## Rotate given object around vector perpendicular to plane
7863         #  containing three points.
7864         #  @param theObject The object to be rotated.
7865         #  @param theCentPoint central point the axis is the vector perpendicular to the plane
7866         #  containing the three points.
7867         #  @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7868         #  @param theCopy Flag used to rotate object itself or create a copy.
7869         #  @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7870         #  new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7871         @ManageTransactions("TrsfOp")
7872         def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7873             """
7874             Rotate given object around vector perpendicular to plane
7875             containing three points.
7876
7877             Parameters:
7878                 theObject The object to be rotated.
7879                 theCentPoint central point  the axis is the vector perpendicular to the plane
7880                              containing the three points.
7881                 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7882                 theCopy Flag used to rotate object itself or create a copy.
7883
7884             Returns:
7885                 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7886                 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7887             """
7888             if theCopy:
7889                 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7890             else:
7891                 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7892             RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7893             return anObj
7894
7895         ## Rotate given object around vector perpendicular to plane
7896         #  containing three points, creating its copy before the rotatation.
7897         #  @param theObject The object to be rotated.
7898         #  @param theCentPoint central point the axis is the vector perpendicular to the plane
7899         #  containing the three points.
7900         #  @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7901         #  @param theName Object name; when specified, this parameter is used
7902         #         for result publication in the study. Otherwise, if automatic
7903         #         publication is switched on, default value is used for result name.
7904         #
7905         #  @return New GEOM.GEOM_Object, containing the rotated object.
7906         #
7907         #  @ref tui_rotation "Example"
7908         @ManageTransactions("TrsfOp")
7909         def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7910             """
7911             Rotate given object around vector perpendicular to plane
7912             containing three points, creating its copy before the rotatation.
7913
7914             Parameters:
7915                 theObject The object to be rotated.
7916                 theCentPoint central point  the axis is the vector perpendicular to the plane
7917                              containing the three points.
7918                 thePoint1,thePoint2  in a perpendicular plane of the axis.
7919                 theName Object name; when specified, this parameter is used
7920                         for result publication in the study. Otherwise, if automatic
7921                         publication is switched on, default value is used for result name.
7922
7923             Returns:
7924                 New GEOM.GEOM_Object, containing the rotated object.
7925             """
7926             # Example: see GEOM_TestAll.py
7927             anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7928             RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7929             self._autoPublish(anObj, theName, "rotated")
7930             return anObj
7931
7932         ## Scale the given object by the specified factor.
7933         #  @param theObject The object to be scaled.
7934         #  @param thePoint Center point for scaling.
7935         #                  Passing None for it means scaling relatively the origin of global CS.
7936         #  @param theFactor Scaling factor value.
7937         #  @param theCopy Flag used to scale object itself or create a copy.
7938         #  @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7939         #  new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7940         @ManageTransactions("TrsfOp")
7941         def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7942             """
7943             Scale the given object by the specified factor.
7944
7945             Parameters:
7946                 theObject The object to be scaled.
7947                 thePoint Center point for scaling.
7948                          Passing None for it means scaling relatively the origin of global CS.
7949                 theFactor Scaling factor value.
7950                 theCopy Flag used to scale object itself or create a copy.
7951
7952             Returns:
7953                 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7954                 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7955             """
7956             # Example: see GEOM_TestAll.py
7957             theFactor, Parameters = ParseParameters(theFactor)
7958             if theCopy:
7959                 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7960             else:
7961                 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7962             RaiseIfFailed("Scale", self.TrsfOp)
7963             anObj.SetParameters(Parameters)
7964             return anObj
7965
7966         ## Scale the given object by the factor, creating its copy before the scaling.
7967         #  @param theObject The object to be scaled.
7968         #  @param thePoint Center point for scaling.
7969         #                  Passing None for it means scaling relatively the origin of global CS.
7970         #  @param theFactor Scaling factor value.
7971         #  @param theName Object name; when specified, this parameter is used
7972         #         for result publication in the study. Otherwise, if automatic
7973         #         publication is switched on, default value is used for result name.
7974         #
7975         #  @return New GEOM.GEOM_Object, containing the scaled shape.
7976         #
7977         #  @ref tui_scale "Example"
7978         @ManageTransactions("TrsfOp")
7979         def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7980             """
7981             Scale the given object by the factor, creating its copy before the scaling.
7982
7983             Parameters:
7984                 theObject The object to be scaled.
7985                 thePoint Center point for scaling.
7986                          Passing None for it means scaling relatively the origin of global CS.
7987                 theFactor Scaling factor value.
7988                 theName Object name; when specified, this parameter is used
7989                         for result publication in the study. Otherwise, if automatic
7990                         publication is switched on, default value is used for result name.
7991
7992             Returns:
7993                 New GEOM.GEOM_Object, containing the scaled shape.
7994             """
7995             # Example: see GEOM_TestAll.py
7996             theFactor, Parameters = ParseParameters(theFactor)
7997             anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7998             RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7999             anObj.SetParameters(Parameters)
8000             self._autoPublish(anObj, theName, "scaled")
8001             return anObj
8002
8003         ## Scale the given object by different factors along coordinate axes.
8004         #  @param theObject The object to be scaled.
8005         #  @param thePoint Center point for scaling.
8006         #                  Passing None for it means scaling relatively the origin of global CS.
8007         #  @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8008         #  @param theCopy Flag used to scale object itself or create a copy.
8009         #  @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8010         #  new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8011         @ManageTransactions("TrsfOp")
8012         def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8013             """
8014             Scale the given object by different factors along coordinate axes.
8015
8016             Parameters:
8017                 theObject The object to be scaled.
8018                 thePoint Center point for scaling.
8019                             Passing None for it means scaling relatively the origin of global CS.
8020                 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8021                 theCopy Flag used to scale object itself or create a copy.
8022
8023             Returns:
8024                 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8025                 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8026             """
8027             # Example: see GEOM_TestAll.py
8028             theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8029             if theCopy:
8030                 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8031                                                             theFactorX, theFactorY, theFactorZ)
8032             else:
8033                 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8034                                                         theFactorX, theFactorY, theFactorZ)
8035             RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8036             anObj.SetParameters(Parameters)
8037             return anObj
8038
8039         ## Scale the given object by different factors along coordinate axes,
8040         #  creating its copy before the scaling.
8041         #  @param theObject The object to be scaled.
8042         #  @param thePoint Center point for scaling.
8043         #                  Passing None for it means scaling relatively the origin of global CS.
8044         #  @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8045         #  @param theName Object name; when specified, this parameter is used
8046         #         for result publication in the study. Otherwise, if automatic
8047         #         publication is switched on, default value is used for result name.
8048         #
8049         #  @return New GEOM.GEOM_Object, containing the scaled shape.
8050         #
8051         #  @ref swig_scale "Example"
8052         @ManageTransactions("TrsfOp")
8053         def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8054             """
8055             Scale the given object by different factors along coordinate axes,
8056             creating its copy before the scaling.
8057
8058             Parameters:
8059                 theObject The object to be scaled.
8060                 thePoint Center point for scaling.
8061                             Passing None for it means scaling relatively the origin of global CS.
8062                 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8063                 theName Object name; when specified, this parameter is used
8064                         for result publication in the study. Otherwise, if automatic
8065                         publication is switched on, default value is used for result name.
8066
8067             Returns:
8068                 New GEOM.GEOM_Object, containing the scaled shape.
8069             """
8070             # Example: see GEOM_TestAll.py
8071             theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8072             anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8073                                                         theFactorX, theFactorY, theFactorZ)
8074             RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8075             anObj.SetParameters(Parameters)
8076             self._autoPublish(anObj, theName, "scaled")
8077             return anObj
8078
8079         ## Mirror an object relatively the given plane.
8080         #  @param theObject The object to be mirrored.
8081         #  @param thePlane Plane of symmetry.
8082         #  @param theCopy Flag used to mirror object itself or create a copy.
8083         #  @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8084         #  new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8085         @ManageTransactions("TrsfOp")
8086         def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8087             """
8088             Mirror an object relatively the given plane.
8089
8090             Parameters:
8091                 theObject The object to be mirrored.
8092                 thePlane Plane of symmetry.
8093                 theCopy Flag used to mirror object itself or create a copy.
8094
8095             Returns:
8096                 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8097                 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8098             """
8099             if theCopy:
8100                 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8101             else:
8102                 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8103             RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8104             return anObj
8105
8106         ## Create an object, symmetrical
8107         #  to the given one relatively the given plane.
8108         #  @param theObject The object to be mirrored.
8109         #  @param thePlane Plane of symmetry.
8110         #  @param theName Object name; when specified, this parameter is used
8111         #         for result publication in the study. Otherwise, if automatic
8112         #         publication is switched on, default value is used for result name.
8113         #
8114         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
8115         #
8116         #  @ref tui_mirror "Example"
8117         @ManageTransactions("TrsfOp")
8118         def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8119             """
8120             Create an object, symmetrical to the given one relatively the given plane.
8121
8122             Parameters:
8123                 theObject The object to be mirrored.
8124                 thePlane Plane of symmetry.
8125                 theName Object name; when specified, this parameter is used
8126                         for result publication in the study. Otherwise, if automatic
8127                         publication is switched on, default value is used for result name.
8128
8129             Returns:
8130                 New GEOM.GEOM_Object, containing the mirrored shape.
8131             """
8132             # Example: see GEOM_TestAll.py
8133             anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8134             RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8135             self._autoPublish(anObj, theName, "mirrored")
8136             return anObj
8137
8138         ## Mirror an object relatively the given axis.
8139         #  @param theObject The object to be mirrored.
8140         #  @param theAxis Axis of symmetry.
8141         #  @param theCopy Flag used to mirror object itself or create a copy.
8142         #  @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8143         #  new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8144         @ManageTransactions("TrsfOp")
8145         def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8146             """
8147             Mirror an object relatively the given axis.
8148
8149             Parameters:
8150                 theObject The object to be mirrored.
8151                 theAxis Axis of symmetry.
8152                 theCopy Flag used to mirror object itself or create a copy.
8153
8154             Returns:
8155                 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8156                 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8157             """
8158             if theCopy:
8159                 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8160             else:
8161                 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8162             RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8163             return anObj
8164
8165         ## Create an object, symmetrical
8166         #  to the given one relatively the given axis.
8167         #  @param theObject The object to be mirrored.
8168         #  @param theAxis Axis of symmetry.
8169         #  @param theName Object name; when specified, this parameter is used
8170         #         for result publication in the study. Otherwise, if automatic
8171         #         publication is switched on, default value is used for result name.
8172         #
8173         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
8174         #
8175         #  @ref tui_mirror "Example"
8176         @ManageTransactions("TrsfOp")
8177         def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8178             """
8179             Create an object, symmetrical to the given one relatively the given axis.
8180
8181             Parameters:
8182                 theObject The object to be mirrored.
8183                 theAxis Axis of symmetry.
8184                 theName Object name; when specified, this parameter is used
8185                         for result publication in the study. Otherwise, if automatic
8186                         publication is switched on, default value is used for result name.
8187
8188             Returns:
8189                 New GEOM.GEOM_Object, containing the mirrored shape.
8190             """
8191             # Example: see GEOM_TestAll.py
8192             anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8193             RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8194             self._autoPublish(anObj, theName, "mirrored")
8195             return anObj
8196
8197         ## Mirror an object relatively the given point.
8198         #  @param theObject The object to be mirrored.
8199         #  @param thePoint Point of symmetry.
8200         #  @param theCopy Flag used to mirror object itself or create a copy.
8201         #  @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8202         #  new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8203         @ManageTransactions("TrsfOp")
8204         def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8205             """
8206             Mirror an object relatively the given point.
8207
8208             Parameters:
8209                 theObject The object to be mirrored.
8210                 thePoint Point of symmetry.
8211                 theCopy Flag used to mirror object itself or create a copy.
8212
8213             Returns:
8214                 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8215                 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8216             """
8217             # Example: see GEOM_TestAll.py
8218             if theCopy:
8219                 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8220             else:
8221                 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8222             RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8223             return anObj
8224
8225         ## Create an object, symmetrical
8226         #  to the given one relatively the given point.
8227         #  @param theObject The object to be mirrored.
8228         #  @param thePoint Point of symmetry.
8229         #  @param theName Object name; when specified, this parameter is used
8230         #         for result publication in the study. Otherwise, if automatic
8231         #         publication is switched on, default value is used for result name.
8232         #
8233         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
8234         #
8235         #  @ref tui_mirror "Example"
8236         @ManageTransactions("TrsfOp")
8237         def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8238             """
8239             Create an object, symmetrical
8240             to the given one relatively the given point.
8241
8242             Parameters:
8243                 theObject The object to be mirrored.
8244                 thePoint Point of symmetry.
8245                 theName Object name; when specified, this parameter is used
8246                         for result publication in the study. Otherwise, if automatic
8247                         publication is switched on, default value is used for result name.
8248
8249             Returns:
8250                 New GEOM.GEOM_Object, containing the mirrored shape.
8251             """
8252             # Example: see GEOM_TestAll.py
8253             anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8254             RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8255             self._autoPublish(anObj, theName, "mirrored")
8256             return anObj
8257
8258         ## Modify the location of the given object.
8259         #  @param theObject The object to be displaced.
8260         #  @param theStartLCS Coordinate system to perform displacement from it.\n
8261         #                     If \a theStartLCS is NULL, displacement
8262         #                     will be performed from global CS.\n
8263         #                     If \a theObject itself is used as \a theStartLCS,
8264         #                     its location will be changed to \a theEndLCS.
8265         #  @param theEndLCS Coordinate system to perform displacement to it.
8266         #  @param theCopy Flag used to displace object itself or create a copy.
8267         #  @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8268         #  new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8269         @ManageTransactions("TrsfOp")
8270         def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8271             """
8272             Modify the Location of the given object by LCS, creating its copy before the setting.
8273
8274             Parameters:
8275                 theObject The object to be displaced.
8276                 theStartLCS Coordinate system to perform displacement from it.
8277                             If theStartLCS is NULL, displacement
8278                             will be performed from global CS.
8279                             If theObject itself is used as theStartLCS,
8280                             its location will be changed to theEndLCS.
8281                 theEndLCS Coordinate system to perform displacement to it.
8282                 theCopy Flag used to displace object itself or create a copy.
8283
8284             Returns:
8285                 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8286                 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8287             """
8288             # Example: see GEOM_TestAll.py
8289             if theCopy:
8290                 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8291             else:
8292                 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8293             RaiseIfFailed("Displace", self.TrsfOp)
8294             return anObj
8295
8296         ## Modify the Location of the given object by LCS,
8297         #  creating its copy before the setting.
8298         #  @param theObject The object to be displaced.
8299         #  @param theStartLCS Coordinate system to perform displacement from it.\n
8300         #                     If \a theStartLCS is NULL, displacement
8301         #                     will be performed from global CS.\n
8302         #                     If \a theObject itself is used as \a theStartLCS,
8303         #                     its location will be changed to \a theEndLCS.
8304         #  @param theEndLCS Coordinate system to perform displacement to it.
8305         #  @param theName Object name; when specified, this parameter is used
8306         #         for result publication in the study. Otherwise, if automatic
8307         #         publication is switched on, default value is used for result name.
8308         #
8309         #  @return New GEOM.GEOM_Object, containing the displaced shape.
8310         #
8311         #  @ref tui_modify_location "Example"
8312         @ManageTransactions("TrsfOp")
8313         def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8314             """
8315             Modify the Location of the given object by LCS, creating its copy before the setting.
8316
8317             Parameters:
8318                 theObject The object to be displaced.
8319                 theStartLCS Coordinate system to perform displacement from it.
8320                             If theStartLCS is NULL, displacement
8321                             will be performed from global CS.
8322                             If theObject itself is used as theStartLCS,
8323                             its location will be changed to theEndLCS.
8324                 theEndLCS Coordinate system to perform displacement to it.
8325                 theName Object name; when specified, this parameter is used
8326                         for result publication in the study. Otherwise, if automatic
8327                         publication is switched on, default value is used for result name.
8328
8329             Returns:
8330                 New GEOM.GEOM_Object, containing the displaced shape.
8331
8332             Example of usage:
8333                 # create local coordinate systems
8334                 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8335                 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8336                 # modify the location of the given object
8337                 position = geompy.MakePosition(cylinder, cs1, cs2)
8338             """
8339             # Example: see GEOM_TestAll.py
8340             anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8341             RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8342             self._autoPublish(anObj, theName, "displaced")
8343             return anObj
8344
8345         ## Modify the Location of the given object by Path.
8346         #  @param  theObject The object to be displaced.
8347         #  @param  thePath Wire or Edge along that the object will be translated.
8348         #  @param  theDistance progress of Path (0 = start location, 1 = end of path location).
8349         #  @param  theCopy is to create a copy objects if true.
8350         #  @param  theReverse  0 - for usual direction, 1 - to reverse path direction.
8351         #  @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8352         #          new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8353         #
8354         #  @ref tui_modify_location "Example"
8355         @ManageTransactions("TrsfOp")
8356         def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8357             """
8358             Modify the Location of the given object by Path.
8359
8360             Parameters:
8361                  theObject The object to be displaced.
8362                  thePath Wire or Edge along that the object will be translated.
8363                  theDistance progress of Path (0 = start location, 1 = end of path location).
8364                  theCopy is to create a copy objects if true.
8365                  theReverse  0 - for usual direction, 1 - to reverse path direction.
8366
8367             Returns:
8368                  Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8369                  new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8370
8371             Example of usage:
8372                 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8373             """
8374             # Example: see GEOM_TestAll.py
8375             anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8376             RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8377             return anObj
8378
8379         ## Modify the Location of the given object by Path, creating its copy before the operation.
8380         #  @param theObject The object to be displaced.
8381         #  @param thePath Wire or Edge along that the object will be translated.
8382         #  @param theDistance progress of Path (0 = start location, 1 = end of path location).
8383         #  @param theReverse  0 - for usual direction, 1 - to reverse path direction.
8384         #  @param theName Object name; when specified, this parameter is used
8385         #         for result publication in the study. Otherwise, if automatic
8386         #         publication is switched on, default value is used for result name.
8387         #
8388         #  @return New GEOM.GEOM_Object, containing the displaced shape.
8389         @ManageTransactions("TrsfOp")
8390         def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8391             """
8392             Modify the Location of the given object by Path, creating its copy before the operation.
8393
8394             Parameters:
8395                  theObject The object to be displaced.
8396                  thePath Wire or Edge along that the object will be translated.
8397                  theDistance progress of Path (0 = start location, 1 = end of path location).
8398                  theReverse  0 - for usual direction, 1 - to reverse path direction.
8399                  theName Object name; when specified, this parameter is used
8400                          for result publication in the study. Otherwise, if automatic
8401                          publication is switched on, default value is used for result name.
8402
8403             Returns:
8404                 New GEOM.GEOM_Object, containing the displaced shape.
8405             """
8406             # Example: see GEOM_TestAll.py
8407             anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8408             RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8409             self._autoPublish(anObj, theName, "displaced")
8410             return anObj
8411
8412         ## Offset given shape.
8413         #  @param theObject The base object for the offset.
8414         #  @param theOffset Offset value.
8415         #  @param theCopy Flag used to offset object itself or create a copy.
8416         #  @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8417         #  new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8418         @ManageTransactions("TrsfOp")
8419         def Offset(self, theObject, theOffset, theCopy=False):
8420             """
8421             Offset given shape.
8422
8423             Parameters:
8424                 theObject The base object for the offset.
8425                 theOffset Offset value.
8426                 theCopy Flag used to offset object itself or create a copy.
8427
8428             Returns:
8429                 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8430                 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8431             """
8432             theOffset, Parameters = ParseParameters(theOffset)
8433             if theCopy:
8434                 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8435             else:
8436                 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8437             RaiseIfFailed("Offset", self.TrsfOp)
8438             anObj.SetParameters(Parameters)
8439             return anObj
8440
8441         ## Create new object as offset of the given one.
8442         #  @param theObject The base object for the offset.
8443         #  @param theOffset Offset value.
8444         #  @param theName Object name; when specified, this parameter is used
8445         #         for result publication in the study. Otherwise, if automatic
8446         #         publication is switched on, default value is used for result name.
8447         #
8448         #  @return New GEOM.GEOM_Object, containing the offset object.
8449         #
8450         #  @ref tui_offset "Example"
8451         @ManageTransactions("TrsfOp")
8452         def MakeOffset(self, theObject, theOffset, theName=None):
8453             """
8454             Create new object as offset of the given one.
8455
8456             Parameters:
8457                 theObject The base object for the offset.
8458                 theOffset Offset value.
8459                 theName Object name; when specified, this parameter is used
8460                         for result publication in the study. Otherwise, if automatic
8461                         publication is switched on, default value is used for result name.
8462
8463             Returns:
8464                 New GEOM.GEOM_Object, containing the offset object.
8465
8466             Example of usage:
8467                  box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8468                  # create a new object as offset of the given object
8469                  offset = geompy.MakeOffset(box, 70.)
8470             """
8471             # Example: see GEOM_TestAll.py
8472             theOffset, Parameters = ParseParameters(theOffset)
8473             anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8474             RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8475             anObj.SetParameters(Parameters)
8476             self._autoPublish(anObj, theName, "offset")
8477             return anObj
8478
8479         ## Create new object as projection of the given one on a 2D surface.
8480         #  @param theSource The source object for the projection. It can be a point, edge or wire.
8481         #  @param theTarget The target object. It can be planar or cylindrical face.
8482         #  @param theName Object name; when specified, this parameter is used
8483         #         for result publication in the study. Otherwise, if automatic
8484         #         publication is switched on, default value is used for result name.
8485         #
8486         #  @return New GEOM.GEOM_Object, containing the projection.
8487         #
8488         #  @ref tui_projection "Example"
8489         @ManageTransactions("TrsfOp")
8490         def MakeProjection(self, theSource, theTarget, theName=None):
8491             """
8492             Create new object as projection of the given one on a 2D surface.
8493
8494             Parameters:
8495                 theSource The source object for the projection. It can be a point, edge or wire.
8496                 theTarget The target object. It can be planar or cylindrical face.
8497                 theName Object name; when specified, this parameter is used
8498                         for result publication in the study. Otherwise, if automatic
8499                         publication is switched on, default value is used for result name.
8500
8501             Returns:
8502                 New GEOM.GEOM_Object, containing the projection.
8503             """
8504             # Example: see GEOM_TestAll.py
8505             anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8506             RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8507             self._autoPublish(anObj, theName, "projection")
8508             return anObj
8509
8510         ## Create a projection projection of the given point on a wire or an edge.
8511         #  If there are no solutions or there are 2 or more solutions It throws an
8512         #  exception.
8513         #  @param thePoint the point to be projected.
8514         #  @param theWire the wire. The edge is accepted as well.
8515         #  @param theName Object name; when specified, this parameter is used
8516         #         for result publication in the study. Otherwise, if automatic
8517         #         publication is switched on, default value is used for result name.
8518         #
8519         #  @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8520         #  \n \a u: The parameter of projection point on edge.
8521         #  \n \a PointOnEdge: The projection point.
8522         #  \n \a EdgeInWireIndex: The index of an edge in a wire.
8523         #
8524         #  @ref tui_projection "Example"
8525         @ManageTransactions("TrsfOp")
8526         def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8527             """
8528             Create a projection projection of the given point on a wire or an edge.
8529             If there are no solutions or there are 2 or more solutions It throws an
8530             exception.
8531
8532             Parameters:
8533                 thePoint the point to be projected.
8534                 theWire the wire. The edge is accepted as well.
8535                 theName Object name; when specified, this parameter is used
8536                         for result publication in the study. Otherwise, if automatic
8537                         publication is switched on, default value is used for result name.
8538
8539             Returns:
8540                 [u, PointOnEdge, EdgeInWireIndex]
8541                  u: The parameter of projection point on edge.
8542                  PointOnEdge: The projection point.
8543                  EdgeInWireIndex: The index of an edge in a wire.
8544             """
8545             # Example: see GEOM_TestAll.py
8546             anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8547             RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8548             self._autoPublish(anObj[1], theName, "projection")
8549             return anObj
8550
8551         # -----------------------------------------------------------------------------
8552         # Patterns
8553         # -----------------------------------------------------------------------------
8554
8555         ## Translate the given object along the given vector a given number times
8556         #  @param theObject The object to be translated.
8557         #  @param theVector Direction of the translation. DX if None.
8558         #  @param theStep Distance to translate on.
8559         #  @param theNbTimes Quantity of translations to be done.
8560         #  @param theName Object name; when specified, this parameter is used
8561         #         for result publication in the study. Otherwise, if automatic
8562         #         publication is switched on, default value is used for result name.
8563         #
8564         #  @return New GEOM.GEOM_Object, containing compound of all
8565         #          the shapes, obtained after each translation.
8566         #
8567         #  @ref tui_multi_translation "Example"
8568         @ManageTransactions("TrsfOp")
8569         def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8570             """
8571             Translate the given object along the given vector a given number times
8572
8573             Parameters:
8574                 theObject The object to be translated.
8575                 theVector Direction of the translation. DX if None.
8576                 theStep Distance to translate on.
8577                 theNbTimes Quantity of translations to be done.
8578                 theName Object name; when specified, this parameter is used
8579                         for result publication in the study. Otherwise, if automatic
8580                         publication is switched on, default value is used for result name.
8581
8582             Returns:
8583                 New GEOM.GEOM_Object, containing compound of all
8584                 the shapes, obtained after each translation.
8585
8586             Example of usage:
8587                 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8588             """
8589             # Example: see GEOM_TestAll.py
8590             theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8591             anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8592             RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8593             anObj.SetParameters(Parameters)
8594             self._autoPublish(anObj, theName, "multitranslation")
8595             return anObj
8596
8597         ## Conseqently apply two specified translations to theObject specified number of times.
8598         #  @param theObject The object to be translated.
8599         #  @param theVector1 Direction of the first translation. DX if None.
8600         #  @param theStep1 Step of the first translation.
8601         #  @param theNbTimes1 Quantity of translations to be done along theVector1.
8602         #  @param theVector2 Direction of the second translation. DY if None.
8603         #  @param theStep2 Step of the second translation.
8604         #  @param theNbTimes2 Quantity of translations to be done along theVector2.
8605         #  @param theName Object name; when specified, this parameter is used
8606         #         for result publication in the study. Otherwise, if automatic
8607         #         publication is switched on, default value is used for result name.
8608         #
8609         #  @return New GEOM.GEOM_Object, containing compound of all
8610         #          the shapes, obtained after each translation.
8611         #
8612         #  @ref tui_multi_translation "Example"
8613         @ManageTransactions("TrsfOp")
8614         def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8615                                    theVector2, theStep2, theNbTimes2, theName=None):
8616             """
8617             Conseqently apply two specified translations to theObject specified number of times.
8618
8619             Parameters:
8620                 theObject The object to be translated.
8621                 theVector1 Direction of the first translation. DX if None.
8622                 theStep1 Step of the first translation.
8623                 theNbTimes1 Quantity of translations to be done along theVector1.
8624                 theVector2 Direction of the second translation. DY if None.
8625                 theStep2 Step of the second translation.
8626                 theNbTimes2 Quantity of translations to be done along theVector2.
8627                 theName Object name; when specified, this parameter is used
8628                         for result publication in the study. Otherwise, if automatic
8629                         publication is switched on, default value is used for result name.
8630
8631             Returns:
8632                 New GEOM.GEOM_Object, containing compound of all
8633                 the shapes, obtained after each translation.
8634
8635             Example of usage:
8636                 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8637             """
8638             # Example: see GEOM_TestAll.py
8639             theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8640             anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8641                                                  theVector2, theStep2, theNbTimes2)
8642             RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8643             anObj.SetParameters(Parameters)
8644             self._autoPublish(anObj, theName, "multitranslation")
8645             return anObj
8646
8647         ## Rotate the given object around the given axis a given number times.
8648         #  Rotation angle will be 2*PI/theNbTimes.
8649         #  @param theObject The object to be rotated.
8650         #  @param theAxis The rotation axis. DZ if None.
8651         #  @param theNbTimes Quantity of rotations to be done.
8652         #  @param theName Object name; when specified, this parameter is used
8653         #         for result publication in the study. Otherwise, if automatic
8654         #         publication is switched on, default value is used for result name.
8655         #
8656         #  @return New GEOM.GEOM_Object, containing compound of all the
8657         #          shapes, obtained after each rotation.
8658         #
8659         #  @ref tui_multi_rotation "Example"
8660         @ManageTransactions("TrsfOp")
8661         def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8662             """
8663             Rotate the given object around the given axis a given number times.
8664             Rotation angle will be 2*PI/theNbTimes.
8665
8666             Parameters:
8667                 theObject The object to be rotated.
8668                 theAxis The rotation axis. DZ if None.
8669                 theNbTimes Quantity of rotations to be done.
8670                 theName Object name; when specified, this parameter is used
8671                         for result publication in the study. Otherwise, if automatic
8672                         publication is switched on, default value is used for result name.
8673
8674             Returns:
8675                 New GEOM.GEOM_Object, containing compound of all the
8676                 shapes, obtained after each rotation.
8677
8678             Example of usage:
8679                 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8680             """
8681             # Example: see GEOM_TestAll.py
8682             theNbTimes, Parameters = ParseParameters(theNbTimes)
8683             anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8684             RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8685             anObj.SetParameters(Parameters)
8686             self._autoPublish(anObj, theName, "multirotation")
8687             return anObj
8688
8689         ## Rotate the given object around the given axis
8690         #  a given number times on the given angle.
8691         #  @param theObject The object to be rotated.
8692         #  @param theAxis The rotation axis. DZ if None.
8693         #  @param theAngleStep Rotation angle in radians.
8694         #  @param theNbTimes Quantity of rotations to be done.
8695         #  @param theName Object name; when specified, this parameter is used
8696         #         for result publication in the study. Otherwise, if automatic
8697         #         publication is switched on, default value is used for result name.
8698         #
8699         #  @return New GEOM.GEOM_Object, containing compound of all the
8700         #          shapes, obtained after each rotation.
8701         #
8702         #  @ref tui_multi_rotation "Example"
8703         @ManageTransactions("TrsfOp")
8704         def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8705             """
8706             Rotate the given object around the given axis
8707             a given number times on the given angle.
8708
8709             Parameters:
8710                 theObject The object to be rotated.
8711                 theAxis The rotation axis. DZ if None.
8712                 theAngleStep Rotation angle in radians.
8713                 theNbTimes Quantity of rotations to be done.
8714                 theName Object name; when specified, this parameter is used
8715                         for result publication in the study. Otherwise, if automatic
8716                         publication is switched on, default value is used for result name.
8717
8718             Returns:
8719                 New GEOM.GEOM_Object, containing compound of all the
8720                 shapes, obtained after each rotation.
8721
8722             Example of usage:
8723                 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8724             """
8725             # Example: see GEOM_TestAll.py
8726             theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8727             anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8728             RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8729             anObj.SetParameters(Parameters)
8730             self._autoPublish(anObj, theName, "multirotation")
8731             return anObj
8732
8733         ## Rotate the given object around the given axis a given
8734         #  number times and multi-translate each rotation result.
8735         #  Rotation angle will be 2*PI/theNbTimes1.
8736         #  Translation direction passes through center of gravity
8737         #  of rotated shape and its projection on the rotation axis.
8738         #  @param theObject The object to be rotated.
8739         #  @param theAxis Rotation axis. DZ if None.
8740         #  @param theNbTimes1 Quantity of rotations to be done.
8741         #  @param theRadialStep Translation distance.
8742         #  @param theNbTimes2 Quantity of translations to be done.
8743         #  @param theName Object name; when specified, this parameter is used
8744         #         for result publication in the study. Otherwise, if automatic
8745         #         publication is switched on, default value is used for result name.
8746         #
8747         #  @return New GEOM.GEOM_Object, containing compound of all the
8748         #          shapes, obtained after each transformation.
8749         #
8750         #  @ref tui_multi_rotation "Example"
8751         @ManageTransactions("TrsfOp")
8752         def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8753             """
8754             Rotate the given object around the
8755             given axis on the given angle a given number
8756             times and multi-translate each rotation result.
8757             Translation direction passes through center of gravity
8758             of rotated shape and its projection on the rotation axis.
8759
8760             Parameters:
8761                 theObject The object to be rotated.
8762                 theAxis Rotation axis. DZ if None.
8763                 theNbTimes1 Quantity of rotations to be done.
8764                 theRadialStep Translation distance.
8765                 theNbTimes2 Quantity of translations to be done.
8766                 theName Object name; when specified, this parameter is used
8767                         for result publication in the study. Otherwise, if automatic
8768                         publication is switched on, default value is used for result name.
8769
8770             Returns:
8771                 New GEOM.GEOM_Object, containing compound of all the
8772                 shapes, obtained after each transformation.
8773
8774             Example of usage:
8775                 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8776             """
8777             # Example: see GEOM_TestAll.py
8778             theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8779             anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8780             RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8781             anObj.SetParameters(Parameters)
8782             self._autoPublish(anObj, theName, "multirotation")
8783             return anObj
8784
8785         ## Rotate the given object around the
8786         #  given axis on the given angle a given number
8787         #  times and multi-translate each rotation result.
8788         #  Translation direction passes through center of gravity
8789         #  of rotated shape and its projection on the rotation axis.
8790         #  @param theObject The object to be rotated.
8791         #  @param theAxis Rotation axis. DZ if None.
8792         #  @param theAngleStep Rotation angle in radians.
8793         #  @param theNbTimes1 Quantity of rotations to be done.
8794         #  @param theRadialStep Translation distance.
8795         #  @param theNbTimes2 Quantity of translations to be done.
8796         #  @param theName Object name; when specified, this parameter is used
8797         #         for result publication in the study. Otherwise, if automatic
8798         #         publication is switched on, default value is used for result name.
8799         #
8800         #  @return New GEOM.GEOM_Object, containing compound of all the
8801         #          shapes, obtained after each transformation.
8802         #
8803         #  @ref tui_multi_rotation "Example"
8804         @ManageTransactions("TrsfOp")
8805         def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8806             """
8807             Rotate the given object around the
8808             given axis on the given angle a given number
8809             times and multi-translate each rotation result.
8810             Translation direction passes through center of gravity
8811             of rotated shape and its projection on the rotation axis.
8812
8813             Parameters:
8814                 theObject The object to be rotated.
8815                 theAxis Rotation axis. DZ if None.
8816                 theAngleStep Rotation angle in radians.
8817                 theNbTimes1 Quantity of rotations to be done.
8818                 theRadialStep Translation distance.
8819                 theNbTimes2 Quantity of translations to be done.
8820                 theName Object name; when specified, this parameter is used
8821                         for result publication in the study. Otherwise, if automatic
8822                         publication is switched on, default value is used for result name.
8823
8824             Returns:
8825                 New GEOM.GEOM_Object, containing compound of all the
8826                 shapes, obtained after each transformation.
8827
8828             Example of usage:
8829                 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8830             """
8831             # Example: see GEOM_TestAll.py
8832             theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8833             anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8834             RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8835             anObj.SetParameters(Parameters)
8836             self._autoPublish(anObj, theName, "multirotation")
8837             return anObj
8838
8839         ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8840         #
8841         #  @ref swig_MakeMultiRotation "Example"
8842         def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8843             """
8844             The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8845
8846             Example of usage:
8847                 pz = geompy.MakeVertex(0, 0, 100)
8848                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8849                 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8850             """
8851             # Example: see GEOM_TestOthers.py
8852             aVec = self.MakeLine(aPoint,aDir)
8853             # note: auto-publishing is done in self.MultiRotate1D()
8854             anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8855             return anObj
8856
8857         ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8858         #
8859         #  @ref swig_MakeMultiRotation "Example"
8860         def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8861             """
8862             The same, as geompy.MultiRotate1D, but axis is given by direction and point
8863
8864             Example of usage:
8865                 pz = geompy.MakeVertex(0, 0, 100)
8866                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8867                 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8868             """
8869             # Example: see GEOM_TestOthers.py
8870             aVec = self.MakeLine(aPoint,aDir)
8871             # note: auto-publishing is done in self.MultiRotate1D()
8872             anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8873             return anObj
8874
8875         ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8876         #
8877         #  @ref swig_MakeMultiRotation "Example"
8878         def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8879             """
8880             The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8881
8882             Example of usage:
8883                 pz = geompy.MakeVertex(0, 0, 100)
8884                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8885                 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8886             """
8887             # Example: see GEOM_TestOthers.py
8888             aVec = self.MakeLine(aPoint,aDir)
8889             # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8890             anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8891             return anObj
8892
8893         ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8894         #
8895         #  @ref swig_MakeMultiRotation "Example"
8896         def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8897             """
8898             The same, as MultiRotate2DByStep(), but axis is given by direction and point
8899
8900             Example of usage:
8901                 pz = geompy.MakeVertex(0, 0, 100)
8902                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8903                 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8904             """
8905             # Example: see GEOM_TestOthers.py
8906             aVec = self.MakeLine(aPoint,aDir)
8907             # note: auto-publishing is done in self.MultiRotate2D()
8908             anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8909             return anObj
8910
8911         # end of l3_transform
8912         ## @}
8913
8914         ## @addtogroup l3_transform_d
8915         ## @{
8916
8917         ## Deprecated method. Use MultiRotate1DNbTimes instead.
8918         def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8919             """
8920             Deprecated method. Use MultiRotate1DNbTimes instead.
8921             """
8922             print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8923             return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8924
8925         ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8926         #  This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8927         @ManageTransactions("TrsfOp")
8928         def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8929             """
8930             The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8931             This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8932
8933             Example of usage:
8934                 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8935             """
8936             print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8937             theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8938             anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8939             RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8940             anObj.SetParameters(Parameters)
8941             self._autoPublish(anObj, theName, "multirotation")
8942             return anObj
8943
8944         ## The same, as MultiRotate1D(), but axis is given by direction and point
8945         #  This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8946         def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8947             """
8948             The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8949             This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8950
8951             Example of usage:
8952                 pz = geompy.MakeVertex(0, 0, 100)
8953                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8954                 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8955             """
8956             print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8957             aVec = self.MakeLine(aPoint,aDir)
8958             # note: auto-publishing is done in self.MultiRotate1D()
8959             anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8960             return anObj
8961
8962         ## The same, as MultiRotate2D(), but axis is given by direction and point
8963         #  This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8964         def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8965             """
8966             The same, as MultiRotate2D(), but axis is given by direction and point
8967             This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8968
8969             Example of usage:
8970                 pz = geompy.MakeVertex(0, 0, 100)
8971                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8972                 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8973             """
8974             print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8975             aVec = self.MakeLine(aPoint,aDir)
8976             # note: auto-publishing is done in self.MultiRotate2D()
8977             anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8978             return anObj
8979
8980         # end of l3_transform_d
8981         ## @}
8982
8983         ## @addtogroup l3_local
8984         ## @{
8985
8986         ## Perform a fillet on all edges of the given shape.
8987         #  @param theShape Shape, to perform fillet on.
8988         #  @param theR Fillet radius.
8989         #  @param theName Object name; when specified, this parameter is used
8990         #         for result publication in the study. Otherwise, if automatic
8991         #         publication is switched on, default value is used for result name.
8992         #
8993         #  @return New GEOM.GEOM_Object, containing the result shape.
8994         #
8995         #  @ref tui_fillet "Example 1"
8996         #  \n @ref swig_MakeFilletAll "Example 2"
8997         @ManageTransactions("LocalOp")
8998         def MakeFilletAll(self, theShape, theR, theName=None):
8999             """
9000             Perform a fillet on all edges of the given shape.
9001
9002             Parameters:
9003                 theShape Shape, to perform fillet on.
9004                 theR Fillet radius.
9005                 theName Object name; when specified, this parameter is used
9006                         for result publication in the study. Otherwise, if automatic
9007                         publication is switched on, default value is used for result name.
9008
9009             Returns:
9010                 New GEOM.GEOM_Object, containing the result shape.
9011
9012             Example of usage:
9013                filletall = geompy.MakeFilletAll(prism, 10.)
9014             """
9015             # Example: see GEOM_TestOthers.py
9016             theR,Parameters = ParseParameters(theR)
9017             anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9018             RaiseIfFailed("MakeFilletAll", self.LocalOp)
9019             anObj.SetParameters(Parameters)
9020             self._autoPublish(anObj, theName, "fillet")
9021             return anObj
9022
9023         ## Perform a fillet on the specified edges/faces of the given shape
9024         #  @param theShape Shape, to perform fillet on.
9025         #  @param theR Fillet radius.
9026         #  @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9027         #  @param theListShapes Global indices of edges/faces to perform fillet on.
9028         #  @param theName Object name; when specified, this parameter is used
9029         #         for result publication in the study. Otherwise, if automatic
9030         #         publication is switched on, default value is used for result name.
9031         #
9032         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9033         #
9034         #  @return New GEOM.GEOM_Object, containing the result shape.
9035         #
9036         #  @ref tui_fillet "Example"
9037         @ManageTransactions("LocalOp")
9038         def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9039             """
9040             Perform a fillet on the specified edges/faces of the given shape
9041
9042             Parameters:
9043                 theShape Shape, to perform fillet on.
9044                 theR Fillet radius.
9045                 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9046                 theListShapes Global indices of edges/faces to perform fillet on.
9047                 theName Object name; when specified, this parameter is used
9048                         for result publication in the study. Otherwise, if automatic
9049                         publication is switched on, default value is used for result name.
9050
9051             Note:
9052                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9053
9054             Returns:
9055                 New GEOM.GEOM_Object, containing the result shape.
9056
9057             Example of usage:
9058                 # get the list of IDs (IDList) for the fillet
9059                 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9060                 IDlist_e = []
9061                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9062                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9063                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9064                 # make a fillet on the specified edges of the given shape
9065                 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9066             """
9067             # Example: see GEOM_TestAll.py
9068             theR,Parameters = ParseParameters(theR)
9069             anObj = None
9070             if theShapeType == self.ShapeType["EDGE"]:
9071                 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9072                 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9073             else:
9074                 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9075                 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9076             anObj.SetParameters(Parameters)
9077             self._autoPublish(anObj, theName, "fillet")
9078             return anObj
9079
9080         ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9081         @ManageTransactions("LocalOp")
9082         def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9083             """
9084             The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9085
9086             Example of usage:
9087                 # get the list of IDs (IDList) for the fillet
9088                 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9089                 IDlist_e = []
9090                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9091                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9092                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9093                 # make a fillet on the specified edges of the given shape
9094                 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9095             """
9096             theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9097             anObj = None
9098             if theShapeType == self.ShapeType["EDGE"]:
9099                 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9100                 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9101             else:
9102                 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9103                 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9104             anObj.SetParameters(Parameters)
9105             self._autoPublish(anObj, theName, "fillet")
9106             return anObj
9107
9108         ## Perform a fillet on the specified edges of the given shape
9109         #  @param theShape  Wire Shape to perform fillet on.
9110         #  @param theR  Fillet radius.
9111         #  @param theListOfVertexes Global indices of vertexes to perform fillet on.
9112         #    \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9113         #    \note The list of vertices could be empty,
9114         #          in this case fillet will done done at all vertices in wire
9115         #  @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9116         #         by the length of the edges, nearest to the fillet vertex.
9117         #         But sometimes the next edge is C1 continuous with the one, nearest to
9118         #         the fillet point, and such two (or more) edges can be united to allow
9119         #         bigger radius. Set this flag to TRUE to allow collinear edges union,
9120         #         thus ignoring the secant vertex (vertices).
9121         #  @param theName Object name; when specified, this parameter is used
9122         #         for result publication in the study. Otherwise, if automatic
9123         #         publication is switched on, default value is used for result name.
9124         #
9125         #  @return New GEOM.GEOM_Object, containing the result shape.
9126         #
9127         #  @ref tui_fillet2d "Example"
9128         @ManageTransactions("LocalOp")
9129         def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9130             """
9131             Perform a fillet on the specified edges of the given shape
9132
9133             Parameters:
9134                 theShape  Wire Shape to perform fillet on.
9135                 theR  Fillet radius.
9136                 theListOfVertexes Global indices of vertexes to perform fillet on.
9137                 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9138                     by the length of the edges, nearest to the fillet vertex.
9139                     But sometimes the next edge is C1 continuous with the one, nearest to
9140                     the fillet point, and such two (or more) edges can be united to allow
9141                     bigger radius. Set this flag to TRUE to allow collinear edges union,
9142                     thus ignoring the secant vertex (vertices).
9143                 theName Object name; when specified, this parameter is used
9144                         for result publication in the study. Otherwise, if automatic
9145                         publication is switched on, default value is used for result name.
9146             Note:
9147                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9148
9149                 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9150
9151             Returns:
9152                 New GEOM.GEOM_Object, containing the result shape.
9153
9154             Example of usage:
9155                 # create wire
9156                 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9157                 # make fillet at given wire vertices with giver radius
9158                 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9159             """
9160             # Example: see GEOM_TestAll.py
9161             theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9162             anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9163             RaiseIfFailed("MakeFillet1D", self.LocalOp)
9164             anObj.SetParameters(Parameters)
9165             self._autoPublish(anObj, theName, "fillet")
9166             return anObj
9167
9168         ## Perform a fillet at the specified vertices of the given face/shell.
9169         #  @param theShape Face or Shell shape to perform fillet on.
9170         #  @param theR Fillet radius.
9171         #  @param theListOfVertexes Global indices of vertexes to perform fillet on.
9172         #  @param theName Object name; when specified, this parameter is used
9173         #         for result publication in the study. Otherwise, if automatic
9174         #         publication is switched on, default value is used for result name.
9175         #
9176         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9177         #
9178         #  @return New GEOM.GEOM_Object, containing the result shape.
9179         #
9180         #  @ref tui_fillet2d "Example"
9181         @ManageTransactions("LocalOp")
9182         def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9183             """
9184             Perform a fillet at the specified vertices of the given face/shell.
9185
9186             Parameters:
9187                 theShape  Face or Shell shape to perform fillet on.
9188                 theR  Fillet radius.
9189                 theListOfVertexes Global indices of vertexes to perform fillet on.
9190                 theName Object name; when specified, this parameter is used
9191                         for result publication in the study. Otherwise, if automatic
9192                         publication is switched on, default value is used for result name.
9193             Note:
9194                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9195
9196             Returns:
9197                 New GEOM.GEOM_Object, containing the result shape.
9198
9199             Example of usage:
9200                 face = geompy.MakeFaceHW(100, 100, 1)
9201                 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9202             """
9203             # Example: see GEOM_TestAll.py
9204             theR,Parameters = ParseParameters(theR)
9205             anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9206             RaiseIfFailed("MakeFillet2D", self.LocalOp)
9207             anObj.SetParameters(Parameters)
9208             self._autoPublish(anObj, theName, "fillet")
9209             return anObj
9210
9211         ## Perform a symmetric chamfer on all edges of the given shape.
9212         #  @param theShape Shape, to perform chamfer on.
9213         #  @param theD Chamfer size along each face.
9214         #  @param theName Object name; when specified, this parameter is used
9215         #         for result publication in the study. Otherwise, if automatic
9216         #         publication is switched on, default value is used for result name.
9217         #
9218         #  @return New GEOM.GEOM_Object, containing the result shape.
9219         #
9220         #  @ref tui_chamfer "Example 1"
9221         #  \n @ref swig_MakeChamferAll "Example 2"
9222         @ManageTransactions("LocalOp")
9223         def MakeChamferAll(self, theShape, theD, theName=None):
9224             """
9225             Perform a symmetric chamfer on all edges of the given shape.
9226
9227             Parameters:
9228                 theShape Shape, to perform chamfer on.
9229                 theD Chamfer size along each face.
9230                 theName Object name; when specified, this parameter is used
9231                         for result publication in the study. Otherwise, if automatic
9232                         publication is switched on, default value is used for result name.
9233
9234             Returns:
9235                 New GEOM.GEOM_Object, containing the result shape.
9236
9237             Example of usage:
9238                 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9239             """
9240             # Example: see GEOM_TestOthers.py
9241             theD,Parameters = ParseParameters(theD)
9242             anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9243             RaiseIfFailed("MakeChamferAll", self.LocalOp)
9244             anObj.SetParameters(Parameters)
9245             self._autoPublish(anObj, theName, "chamfer")
9246             return anObj
9247
9248         ## Perform a chamfer on edges, common to the specified faces,
9249         #  with distance D1 on the Face1
9250         #  @param theShape Shape, to perform chamfer on.
9251         #  @param theD1 Chamfer size along \a theFace1.
9252         #  @param theD2 Chamfer size along \a theFace2.
9253         #  @param theFace1,theFace2 Global indices of two faces of \a theShape.
9254         #  @param theName Object name; when specified, this parameter is used
9255         #         for result publication in the study. Otherwise, if automatic
9256         #         publication is switched on, default value is used for result name.
9257         #
9258         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9259         #
9260         #  @return New GEOM.GEOM_Object, containing the result shape.
9261         #
9262         #  @ref tui_chamfer "Example"
9263         @ManageTransactions("LocalOp")
9264         def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9265             """
9266             Perform a chamfer on edges, common to the specified faces,
9267             with distance D1 on the Face1
9268
9269             Parameters:
9270                 theShape Shape, to perform chamfer on.
9271                 theD1 Chamfer size along theFace1.
9272                 theD2 Chamfer size along theFace2.
9273                 theFace1,theFace2 Global indices of two faces of theShape.
9274                 theName Object name; when specified, this parameter is used
9275                         for result publication in the study. Otherwise, if automatic
9276                         publication is switched on, default value is used for result name.
9277
9278             Note:
9279                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9280
9281             Returns:
9282                 New GEOM.GEOM_Object, containing the result shape.
9283
9284             Example of usage:
9285                 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9286                 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9287                 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9288                 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9289             """
9290             # Example: see GEOM_TestAll.py
9291             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9292             anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9293             RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9294             anObj.SetParameters(Parameters)
9295             self._autoPublish(anObj, theName, "chamfer")
9296             return anObj
9297
9298         ## Perform a chamfer on edges
9299         #  @param theShape Shape, to perform chamfer on.
9300         #  @param theD Chamfer length
9301         #  @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9302         #  @param theFace1,theFace2 Global indices of two faces of \a theShape.
9303         #  @param theName Object name; when specified, this parameter is used
9304         #         for result publication in the study. Otherwise, if automatic
9305         #         publication is switched on, default value is used for result name.
9306         #
9307         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9308         #
9309         #  @return New GEOM.GEOM_Object, containing the result shape.
9310         @ManageTransactions("LocalOp")
9311         def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9312             """
9313             Perform a chamfer on edges
9314
9315             Parameters:
9316                 theShape Shape, to perform chamfer on.
9317                 theD1 Chamfer size along theFace1.
9318                 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9319                 theFace1,theFace2 Global indices of two faces of theShape.
9320                 theName Object name; when specified, this parameter is used
9321                         for result publication in the study. Otherwise, if automatic
9322                         publication is switched on, default value is used for result name.
9323
9324             Note:
9325                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9326
9327             Returns:
9328                 New GEOM.GEOM_Object, containing the result shape.
9329
9330             Example of usage:
9331                 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9332                 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9333                 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9334                 ang = 30
9335                 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9336             """
9337             flag = False
9338             if isinstance(theAngle,str):
9339                 flag = True
9340             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9341             if flag:
9342                 theAngle = theAngle*math.pi/180.0
9343             anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9344             RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9345             anObj.SetParameters(Parameters)
9346             self._autoPublish(anObj, theName, "chamfer")
9347             return anObj
9348
9349         ## Perform a chamfer on all edges of the specified faces,
9350         #  with distance D1 on the first specified face (if several for one edge)
9351         #  @param theShape Shape, to perform chamfer on.
9352         #  @param theD1 Chamfer size along face from \a theFaces. If both faces,
9353         #               connected to the edge, are in \a theFaces, \a theD1
9354         #               will be get along face, which is nearer to \a theFaces beginning.
9355         #  @param theD2 Chamfer size along another of two faces, connected to the edge.
9356         #  @param theFaces Sequence of global indices of faces of \a theShape.
9357         #  @param 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         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9362         #
9363         #  @return New GEOM.GEOM_Object, containing the result shape.
9364         #
9365         #  @ref tui_chamfer "Example"
9366         @ManageTransactions("LocalOp")
9367         def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9368             """
9369             Perform a chamfer on all edges of the specified faces,
9370             with distance D1 on the first specified face (if several for one edge)
9371
9372             Parameters:
9373                 theShape Shape, to perform chamfer on.
9374                 theD1 Chamfer size along face from  theFaces. If both faces,
9375                       connected to the edge, are in theFaces, theD1
9376                       will be get along face, which is nearer to theFaces beginning.
9377                 theD2 Chamfer size along another of two faces, connected to the edge.
9378                 theFaces Sequence of global indices of faces of theShape.
9379                 theName Object name; when specified, this parameter is used
9380                         for result publication in the study. Otherwise, if automatic
9381                         publication is switched on, default value is used for result name.
9382
9383             Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9384
9385             Returns:
9386                 New GEOM.GEOM_Object, containing the result shape.
9387             """
9388             # Example: see GEOM_TestAll.py
9389             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9390             anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9391             RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9392             anObj.SetParameters(Parameters)
9393             self._autoPublish(anObj, theName, "chamfer")
9394             return anObj
9395
9396         ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9397         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9398         #
9399         #  @ref swig_FilletChamfer "Example"
9400         @ManageTransactions("LocalOp")
9401         def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9402             """
9403             The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9404             theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9405             """
9406             flag = False
9407             if isinstance(theAngle,str):
9408                 flag = True
9409             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9410             if flag:
9411                 theAngle = theAngle*math.pi/180.0
9412             anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9413             RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9414             anObj.SetParameters(Parameters)
9415             self._autoPublish(anObj, theName, "chamfer")
9416             return anObj
9417
9418         ## Perform a chamfer on edges,
9419         #  with distance D1 on the first specified face (if several for one edge)
9420         #  @param theShape Shape, to perform chamfer on.
9421         #  @param theD1,theD2 Chamfer size
9422         #  @param theEdges Sequence of edges of \a theShape.
9423         #  @param theName Object name; when specified, this parameter is used
9424         #         for result publication in the study. Otherwise, if automatic
9425         #         publication is switched on, default value is used for result name.
9426         #
9427         #  @return New GEOM.GEOM_Object, containing the result shape.
9428         #
9429         #  @ref swig_FilletChamfer "Example"
9430         @ManageTransactions("LocalOp")
9431         def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9432             """
9433             Perform a chamfer on edges,
9434             with distance D1 on the first specified face (if several for one edge)
9435
9436             Parameters:
9437                 theShape Shape, to perform chamfer on.
9438                 theD1,theD2 Chamfer size
9439                 theEdges Sequence of edges of theShape.
9440                 theName Object name; when specified, this parameter is used
9441                         for result publication in the study. Otherwise, if automatic
9442                         publication is switched on, default value is used for result name.
9443
9444             Returns:
9445                 New GEOM.GEOM_Object, containing the result shape.
9446             """
9447             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9448             anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9449             RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9450             anObj.SetParameters(Parameters)
9451             self._autoPublish(anObj, theName, "chamfer")
9452             return anObj
9453
9454         ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9455         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9456         @ManageTransactions("LocalOp")
9457         def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9458             """
9459             The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9460             theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9461             """
9462             flag = False
9463             if isinstance(theAngle,str):
9464                 flag = True
9465             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9466             if flag:
9467                 theAngle = theAngle*math.pi/180.0
9468             anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9469             RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9470             anObj.SetParameters(Parameters)
9471             self._autoPublish(anObj, theName, "chamfer")
9472             return anObj
9473
9474         ## @sa MakeChamferEdge(), MakeChamferFaces()
9475         #
9476         #  @ref swig_MakeChamfer "Example"
9477         def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9478             """
9479             See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9480             """
9481             # Example: see GEOM_TestOthers.py
9482             anObj = None
9483             # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9484             if aShapeType == self.ShapeType["EDGE"]:
9485                 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9486             else:
9487                 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9488             return anObj
9489
9490         ## Remove material from a solid by extrusion of the base shape on the given distance.
9491         #  @param theInit Shape to remove material from. It must be a solid or
9492         #  a compound made of a single solid.
9493         #  @param theBase Closed edge or wire defining the base shape to be extruded.
9494         #  @param theH Prism dimension along the normal to theBase
9495         #  @param theAngle Draft angle in degrees.
9496         #  @param theName Object name; when specified, this parameter is used
9497         #         for result publication in the study. Otherwise, if automatic
9498         #         publication is switched on, default value is used for result name.
9499         #
9500         #  @return New GEOM.GEOM_Object, containing the initial shape with removed material
9501         #
9502         #  @ref tui_creation_prism "Example"
9503         @ManageTransactions("PrimOp")
9504         def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9505             """
9506             Add material to a solid by extrusion of the base shape on the given distance.
9507
9508             Parameters:
9509                 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9510                 theBase Closed edge or wire defining the base shape to be extruded.
9511                 theH Prism dimension along the normal  to theBase
9512                 theAngle Draft angle in degrees.
9513                 theName Object name; when specified, this parameter is used
9514                         for result publication in the study. Otherwise, if automatic
9515                         publication is switched on, default value is used for result name.
9516
9517             Returns:
9518                 New GEOM.GEOM_Object,  containing the initial shape with removed material.
9519             """
9520             # Example: see GEOM_TestAll.py
9521             #theH,Parameters = ParseParameters(theH)
9522             anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9523             RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9524             #anObj.SetParameters(Parameters)
9525             self._autoPublish(anObj, theName, "extrudedCut")
9526             return anObj
9527
9528         ## Add material to a solid by extrusion of the base shape on the given distance.
9529         #  @param theInit Shape to add material to. It must be a solid or
9530         #  a compound made of a single solid.
9531         #  @param theBase Closed edge or wire defining the base shape to be extruded.
9532         #  @param theH Prism dimension along the normal to theBase
9533         #  @param theAngle Draft angle in degrees.
9534         #  @param theName Object name; when specified, this parameter is used
9535         #         for result publication in the study. Otherwise, if automatic
9536         #         publication is switched on, default value is used for result name.
9537         #
9538         #  @return New GEOM.GEOM_Object, containing the initial shape with added material
9539         #
9540         #  @ref tui_creation_prism "Example"
9541         @ManageTransactions("PrimOp")
9542         def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9543             """
9544             Add material to a solid by extrusion of the base shape on the given distance.
9545
9546             Parameters:
9547                 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9548                 theBase Closed edge or wire defining the base shape to be extruded.
9549                 theH Prism dimension along the normal  to theBase
9550                 theAngle Draft angle in degrees.
9551                 theName Object name; when specified, this parameter is used
9552                         for result publication in the study. Otherwise, if automatic
9553                         publication is switched on, default value is used for result name.
9554
9555             Returns:
9556                 New GEOM.GEOM_Object,  containing the initial shape with added material.
9557             """
9558             # Example: see GEOM_TestAll.py
9559             #theH,Parameters = ParseParameters(theH)
9560             anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9561             RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9562             #anObj.SetParameters(Parameters)
9563             self._autoPublish(anObj, theName, "extrudedBoss")
9564             return anObj
9565
9566         # end of l3_local
9567         ## @}
9568
9569         ## @addtogroup l3_basic_op
9570         ## @{
9571
9572         ## Perform an Archimde operation on the given shape with given parameters.
9573         #  The object presenting the resulting face is returned.
9574         #  @param theShape Shape to be put in water.
9575         #  @param theWeight Weight og the shape.
9576         #  @param theWaterDensity Density of the water.
9577         #  @param theMeshDeflection Deflection of the mesh, using to compute the section.
9578         #  @param theName Object name; when specified, this parameter is used
9579         #         for result publication in the study. Otherwise, if automatic
9580         #         publication is switched on, default value is used for result name.
9581         #
9582         #  @return New GEOM.GEOM_Object, containing a section of \a theShape
9583         #          by a plane, corresponding to water level.
9584         #
9585         #  @ref tui_archimede "Example"
9586         @ManageTransactions("LocalOp")
9587         def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9588             """
9589             Perform an Archimde operation on the given shape with given parameters.
9590             The object presenting the resulting face is returned.
9591
9592             Parameters:
9593                 theShape Shape to be put in water.
9594                 theWeight Weight og the shape.
9595                 theWaterDensity Density of the water.
9596                 theMeshDeflection Deflection of the mesh, using to compute the section.
9597                 theName Object name; when specified, this parameter is used
9598                         for result publication in the study. Otherwise, if automatic
9599                         publication is switched on, default value is used for result name.
9600
9601             Returns:
9602                 New GEOM.GEOM_Object, containing a section of theShape
9603                 by a plane, corresponding to water level.
9604             """
9605             # Example: see GEOM_TestAll.py
9606             theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9607               theWeight,theWaterDensity,theMeshDeflection)
9608             anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9609             RaiseIfFailed("MakeArchimede", self.LocalOp)
9610             anObj.SetParameters(Parameters)
9611             self._autoPublish(anObj, theName, "archimede")
9612             return anObj
9613
9614         # end of l3_basic_op
9615         ## @}
9616
9617         ## @addtogroup l2_measure
9618         ## @{
9619
9620         ## Get point coordinates
9621         #  @return [x, y, z]
9622         #
9623         #  @ref tui_measurement_tools_page "Example"
9624         @ManageTransactions("MeasuOp")
9625         def PointCoordinates(self,Point):
9626             """
9627             Get point coordinates
9628
9629             Returns:
9630                 [x, y, z]
9631             """
9632             # Example: see GEOM_TestMeasures.py
9633             aTuple = self.MeasuOp.PointCoordinates(Point)
9634             RaiseIfFailed("PointCoordinates", self.MeasuOp)
9635             return aTuple
9636
9637         ## Get vector coordinates
9638         #  @return [x, y, z]
9639         #
9640         #  @ref tui_measurement_tools_page "Example"
9641         def VectorCoordinates(self,Vector):
9642             """
9643             Get vector coordinates
9644
9645             Returns:
9646                 [x, y, z]
9647             """
9648
9649             p1=self.GetFirstVertex(Vector)
9650             p2=self.GetLastVertex(Vector)
9651
9652             X1=self.PointCoordinates(p1)
9653             X2=self.PointCoordinates(p2)
9654
9655             return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9656
9657
9658         ## Compute cross product
9659         #  @return vector w=u^v
9660         #
9661         #  @ref tui_measurement_tools_page "Example"
9662         def CrossProduct(self, Vector1, Vector2):
9663             """
9664             Compute cross product
9665
9666             Returns: vector w=u^v
9667             """
9668             u=self.VectorCoordinates(Vector1)
9669             v=self.VectorCoordinates(Vector2)
9670             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])
9671
9672             return w
9673
9674         ## Compute cross product
9675         #  @return dot product  p=u.v
9676         #
9677         #  @ref tui_measurement_tools_page "Example"
9678         def DotProduct(self, Vector1, Vector2):
9679             """
9680             Compute cross product
9681
9682             Returns: dot product  p=u.v
9683             """
9684             u=self.VectorCoordinates(Vector1)
9685             v=self.VectorCoordinates(Vector2)
9686             p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9687
9688             return p
9689
9690
9691         ## Get summarized length of all wires,
9692         #  area of surface and volume of the given shape.
9693         #  @param theShape Shape to define properties of.
9694         #  @return [theLength, theSurfArea, theVolume]\n
9695         #  theLength:   Summarized length of all wires of the given shape.\n
9696         #  theSurfArea: Area of surface of the given shape.\n
9697         #  theVolume:   Volume of the given shape.
9698         #
9699         #  @ref tui_measurement_tools_page "Example"
9700         @ManageTransactions("MeasuOp")
9701         def BasicProperties(self,theShape):
9702             """
9703             Get summarized length of all wires,
9704             area of surface and volume of the given shape.
9705
9706             Parameters:
9707                 theShape Shape to define properties of.
9708
9709             Returns:
9710                 [theLength, theSurfArea, theVolume]
9711                  theLength:   Summarized length of all wires of the given shape.
9712                  theSurfArea: Area of surface of the given shape.
9713                  theVolume:   Volume of the given shape.
9714             """
9715             # Example: see GEOM_TestMeasures.py
9716             aTuple = self.MeasuOp.GetBasicProperties(theShape)
9717             RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9718             return aTuple
9719
9720         ## Get parameters of bounding box of the given shape
9721         #  @param theShape Shape to obtain bounding box of.
9722         #  @param precise TRUE for precise computation; FALSE for fast one.
9723         #  @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9724         #  Xmin,Xmax: Limits of shape along OX axis.
9725         #  Ymin,Ymax: Limits of shape along OY axis.
9726         #  Zmin,Zmax: Limits of shape along OZ axis.
9727         #
9728         #  @ref tui_measurement_tools_page "Example"
9729         @ManageTransactions("MeasuOp")
9730         def BoundingBox (self, theShape, precise=False):
9731             """
9732             Get parameters of bounding box of the given shape
9733
9734             Parameters:
9735                 theShape Shape to obtain bounding box of.
9736                 precise TRUE for precise computation; FALSE for fast one.
9737
9738             Returns:
9739                 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9740                  Xmin,Xmax: Limits of shape along OX axis.
9741                  Ymin,Ymax: Limits of shape along OY axis.
9742                  Zmin,Zmax: Limits of shape along OZ axis.
9743             """
9744             # Example: see GEOM_TestMeasures.py
9745             aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9746             RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9747             return aTuple
9748
9749         ## Get bounding box of the given shape
9750         #  @param theShape Shape to obtain bounding box of.
9751         #  @param precise TRUE for precise computation; FALSE for fast one.
9752         #  @param theName Object name; when specified, this parameter is used
9753         #         for result publication in the study. Otherwise, if automatic
9754         #         publication is switched on, default value is used for result name.
9755         #
9756         #  @return New GEOM.GEOM_Object, containing the created box.
9757         #
9758         #  @ref tui_measurement_tools_page "Example"
9759         @ManageTransactions("MeasuOp")
9760         def MakeBoundingBox (self, theShape, precise=False, theName=None):
9761             """
9762             Get bounding box of the given shape
9763
9764             Parameters:
9765                 theShape Shape to obtain bounding box of.
9766                 precise TRUE for precise computation; FALSE for fast one.
9767                 theName Object name; when specified, this parameter is used
9768                         for result publication in the study. Otherwise, if automatic
9769                         publication is switched on, default value is used for result name.
9770
9771             Returns:
9772                 New GEOM.GEOM_Object, containing the created box.
9773             """
9774             # Example: see GEOM_TestMeasures.py
9775             anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9776             RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9777             self._autoPublish(anObj, theName, "bndbox")
9778             return anObj
9779
9780         ## Get inertia matrix and moments of inertia of theShape.
9781         #  @param theShape Shape to calculate inertia of.
9782         #  @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9783         #  I(1-3)(1-3): Components of the inertia matrix of the given shape.
9784         #  Ix,Iy,Iz:    Moments of inertia of the given shape.
9785         #
9786         #  @ref tui_measurement_tools_page "Example"
9787         @ManageTransactions("MeasuOp")
9788         def Inertia(self,theShape):
9789             """
9790             Get inertia matrix and moments of inertia of theShape.
9791
9792             Parameters:
9793                 theShape Shape to calculate inertia of.
9794
9795             Returns:
9796                 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9797                  I(1-3)(1-3): Components of the inertia matrix of the given shape.
9798                  Ix,Iy,Iz:    Moments of inertia of the given shape.
9799             """
9800             # Example: see GEOM_TestMeasures.py
9801             aTuple = self.MeasuOp.GetInertia(theShape)
9802             RaiseIfFailed("GetInertia", self.MeasuOp)
9803             return aTuple
9804
9805         ## Get if coords are included in the shape (ST_IN or ST_ON)
9806         #  @param theShape Shape
9807         #  @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9808         #  @param tolerance to be used (default is 1.0e-7)
9809         #  @return list_of_boolean = [res1, res2, ...]
9810         @ManageTransactions("MeasuOp")
9811         def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9812             """
9813             Get if coords are included in the shape (ST_IN or ST_ON)
9814
9815             Parameters:
9816                 theShape Shape
9817                 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9818                 tolerance to be used (default is 1.0e-7)
9819
9820             Returns:
9821                 list_of_boolean = [res1, res2, ...]
9822             """
9823             return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9824
9825         ## Get minimal distance between the given shapes.
9826         #  @param theShape1,theShape2 Shapes to find minimal distance between.
9827         #  @return Value of the minimal distance between the given shapes.
9828         #
9829         #  @ref tui_measurement_tools_page "Example"
9830         @ManageTransactions("MeasuOp")
9831         def MinDistance(self, theShape1, theShape2):
9832             """
9833             Get minimal distance between the given shapes.
9834
9835             Parameters:
9836                 theShape1,theShape2 Shapes to find minimal distance between.
9837
9838             Returns:
9839                 Value of the minimal distance between the given shapes.
9840             """
9841             # Example: see GEOM_TestMeasures.py
9842             aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9843             RaiseIfFailed("GetMinDistance", self.MeasuOp)
9844             return aTuple[0]
9845
9846         ## Get minimal distance between the given shapes.
9847         #  @param theShape1,theShape2 Shapes to find minimal distance between.
9848         #  @return Value of the minimal distance between the given shapes, in form of list
9849         #          [Distance, DX, DY, DZ].
9850         #
9851         #  @ref swig_all_measure "Example"
9852         @ManageTransactions("MeasuOp")
9853         def MinDistanceComponents(self, theShape1, theShape2):
9854             """
9855             Get minimal distance between the given shapes.
9856
9857             Parameters:
9858                 theShape1,theShape2 Shapes to find minimal distance between.
9859
9860             Returns:
9861                 Value of the minimal distance between the given shapes, in form of list
9862                 [Distance, DX, DY, DZ]
9863             """
9864             # Example: see GEOM_TestMeasures.py
9865             aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9866             RaiseIfFailed("GetMinDistance", self.MeasuOp)
9867             aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9868             return aRes
9869
9870         ## Get closest points of the given shapes.
9871         #  @param theShape1,theShape2 Shapes to find closest points of.
9872         #  @return The number of found solutions (-1 in case of infinite number of
9873         #          solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9874         #
9875         #  @ref tui_measurement_tools_page "Example"
9876         @ManageTransactions("MeasuOp")
9877         def ClosestPoints (self, theShape1, theShape2):
9878             """
9879             Get closest points of the given shapes.
9880
9881             Parameters:
9882                 theShape1,theShape2 Shapes to find closest points of.
9883
9884             Returns:
9885                 The number of found solutions (-1 in case of infinite number of
9886                 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9887             """
9888             # Example: see GEOM_TestMeasures.py
9889             aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9890             RaiseIfFailed("ClosestPoints", self.MeasuOp)
9891             return aTuple
9892
9893         ## Get angle between the given shapes in degrees.
9894         #  @param theShape1,theShape2 Lines or linear edges to find angle between.
9895         #  @note If both arguments are vectors, the angle is computed in accordance
9896         #        with their orientations, otherwise the minimum angle is computed.
9897         #  @return Value of the angle between the given shapes in degrees.
9898         #
9899         #  @ref tui_measurement_tools_page "Example"
9900         @ManageTransactions("MeasuOp")
9901         def GetAngle(self, theShape1, theShape2):
9902             """
9903             Get angle between the given shapes in degrees.
9904
9905             Parameters:
9906                 theShape1,theShape2 Lines or linear edges to find angle between.
9907
9908             Note:
9909                 If both arguments are vectors, the angle is computed in accordance
9910                 with their orientations, otherwise the minimum angle is computed.
9911
9912             Returns:
9913                 Value of the angle between the given shapes in degrees.
9914             """
9915             # Example: see GEOM_TestMeasures.py
9916             anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9917             RaiseIfFailed("GetAngle", self.MeasuOp)
9918             return anAngle
9919
9920         ## Get angle between the given shapes in radians.
9921         #  @param theShape1,theShape2 Lines or linear edges to find angle between.
9922         #  @note If both arguments are vectors, the angle is computed in accordance
9923         #        with their orientations, otherwise the minimum angle is computed.
9924         #  @return Value of the angle between the given shapes in radians.
9925         #
9926         #  @ref tui_measurement_tools_page "Example"
9927         @ManageTransactions("MeasuOp")
9928         def GetAngleRadians(self, theShape1, theShape2):
9929             """
9930             Get angle between the given shapes in radians.
9931
9932             Parameters:
9933                 theShape1,theShape2 Lines or linear edges to find angle between.
9934
9935
9936             Note:
9937                 If both arguments are vectors, the angle is computed in accordance
9938                 with their orientations, otherwise the minimum angle is computed.
9939
9940             Returns:
9941                 Value of the angle between the given shapes in radians.
9942             """
9943             # Example: see GEOM_TestMeasures.py
9944             anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9945             RaiseIfFailed("GetAngle", self.MeasuOp)
9946             return anAngle
9947
9948         ## Get angle between the given vectors in degrees.
9949         #  @param theShape1,theShape2 Vectors to find angle between.
9950         #  @param theFlag If True, the normal vector is defined by the two vectors cross,
9951         #                 if False, the opposite vector to the normal vector is used.
9952         #  @return Value of the angle between the given vectors in degrees.
9953         #
9954         #  @ref tui_measurement_tools_page "Example"
9955         @ManageTransactions("MeasuOp")
9956         def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9957             """
9958             Get angle between the given vectors in degrees.
9959
9960             Parameters:
9961                 theShape1,theShape2 Vectors to find angle between.
9962                 theFlag If True, the normal vector is defined by the two vectors cross,
9963                         if False, the opposite vector to the normal vector is used.
9964
9965             Returns:
9966                 Value of the angle between the given vectors in degrees.
9967             """
9968             anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9969             if not theFlag:
9970                 anAngle = 360. - anAngle
9971             RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9972             return anAngle
9973
9974         ## The same as GetAngleVectors, but the result is in radians.
9975         def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9976             """
9977             Get angle between the given vectors in radians.
9978
9979             Parameters:
9980                 theShape1,theShape2 Vectors to find angle between.
9981                 theFlag If True, the normal vector is defined by the two vectors cross,
9982                         if False, the opposite vector to the normal vector is used.
9983
9984             Returns:
9985                 Value of the angle between the given vectors in radians.
9986             """
9987             anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9988             return anAngle
9989
9990         ## @name Curve Curvature Measurement
9991         #  Methods for receiving radius of curvature of curves
9992         #  in the given point
9993         ## @{
9994
9995         ## Measure curvature of a curve at a point, set by parameter.
9996         #  @param theCurve a curve.
9997         #  @param theParam parameter.
9998         #  @return radius of curvature of \a theCurve.
9999         #
10000         #  @ref swig_todo "Example"
10001         @ManageTransactions("MeasuOp")
10002         def CurveCurvatureByParam(self, theCurve, theParam):
10003             """
10004             Measure curvature of a curve at a point, set by parameter.
10005
10006             Parameters:
10007                 theCurve a curve.
10008                 theParam parameter.
10009
10010             Returns:
10011                 radius of curvature of theCurve.
10012             """
10013             # Example: see GEOM_TestMeasures.py
10014             aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10015             RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10016             return aCurv
10017
10018         ## Measure curvature of a curve at a point.
10019         #  @param theCurve a curve.
10020         #  @param thePoint given point.
10021         #  @return radius of curvature of \a theCurve.
10022         #
10023         #  @ref swig_todo "Example"
10024         @ManageTransactions("MeasuOp")
10025         def CurveCurvatureByPoint(self, theCurve, thePoint):
10026             """
10027             Measure curvature of a curve at a point.
10028
10029             Parameters:
10030                 theCurve a curve.
10031                 thePoint given point.
10032
10033             Returns:
10034                 radius of curvature of theCurve.
10035             """
10036             aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10037             RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10038             return aCurv
10039         ## @}
10040
10041         ## @name Surface Curvature Measurement
10042         #  Methods for receiving max and min radius of curvature of surfaces
10043         #  in the given point
10044         ## @{
10045
10046         ## Measure max radius of curvature of surface.
10047         #  @param theSurf the given surface.
10048         #  @param theUParam Value of U-parameter on the referenced surface.
10049         #  @param theVParam Value of V-parameter on the referenced surface.
10050         #  @return max radius of curvature of theSurf.
10051         #
10052         ## @ref swig_todo "Example"
10053         @ManageTransactions("MeasuOp")
10054         def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10055             """
10056             Measure max radius of curvature of surface.
10057
10058             Parameters:
10059                 theSurf the given surface.
10060                 theUParam Value of U-parameter on the referenced surface.
10061                 theVParam Value of V-parameter on the referenced surface.
10062
10063             Returns:
10064                 max radius of curvature of theSurf.
10065             """
10066             # Example: see GEOM_TestMeasures.py
10067             aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10068             RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10069             return aSurf
10070
10071         ## Measure max radius of curvature of surface in the given point
10072         #  @param theSurf the given surface.
10073         #  @param thePoint given point.
10074         #  @return max radius of curvature of theSurf.
10075         #
10076         ## @ref swig_todo "Example"
10077         @ManageTransactions("MeasuOp")
10078         def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10079             """
10080             Measure max radius of curvature of surface in the given point.
10081
10082             Parameters:
10083                 theSurf the given surface.
10084                 thePoint given point.
10085
10086             Returns:
10087                 max radius of curvature of theSurf.
10088             """
10089             aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10090             RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10091             return aSurf
10092
10093         ## Measure min radius of curvature of surface.
10094         #  @param theSurf the given surface.
10095         #  @param theUParam Value of U-parameter on the referenced surface.
10096         #  @param theVParam Value of V-parameter on the referenced surface.
10097         #  @return min radius of curvature of theSurf.
10098         #
10099         ## @ref swig_todo "Example"
10100         @ManageTransactions("MeasuOp")
10101         def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10102             """
10103             Measure min radius of curvature of surface.
10104
10105             Parameters:
10106                 theSurf the given surface.
10107                 theUParam Value of U-parameter on the referenced surface.
10108                 theVParam Value of V-parameter on the referenced surface.
10109
10110             Returns:
10111                 Min radius of curvature of theSurf.
10112             """
10113             aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10114             RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10115             return aSurf
10116
10117         ## Measure min radius of curvature of surface in the given point
10118         #  @param theSurf the given surface.
10119         #  @param thePoint given point.
10120         #  @return min radius of curvature of theSurf.
10121         #
10122         ## @ref swig_todo "Example"
10123         @ManageTransactions("MeasuOp")
10124         def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10125             """
10126             Measure min radius of curvature of surface in the given point.
10127
10128             Parameters:
10129                 theSurf the given surface.
10130                 thePoint given point.
10131
10132             Returns:
10133                 Min radius of curvature of theSurf.
10134             """
10135             aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10136             RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10137             return aSurf
10138         ## @}
10139
10140         ## Get min and max tolerances of sub-shapes of theShape
10141         #  @param theShape Shape, to get tolerances of.
10142         #  @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10143         #  FaceMin,FaceMax: Min and max tolerances of the faces.\n
10144         #  EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10145         #  VertMin,VertMax: Min and max tolerances of the vertices.
10146         #
10147         #  @ref tui_measurement_tools_page "Example"
10148         @ManageTransactions("MeasuOp")
10149         def Tolerance(self,theShape):
10150             """
10151             Get min and max tolerances of sub-shapes of theShape
10152
10153             Parameters:
10154                 theShape Shape, to get tolerances of.
10155
10156             Returns:
10157                 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10158                  FaceMin,FaceMax: Min and max tolerances of the faces.
10159                  EdgeMin,EdgeMax: Min and max tolerances of the edges.
10160                  VertMin,VertMax: Min and max tolerances of the vertices.
10161             """
10162             # Example: see GEOM_TestMeasures.py
10163             aTuple = self.MeasuOp.GetTolerance(theShape)
10164             RaiseIfFailed("GetTolerance", self.MeasuOp)
10165             return aTuple
10166
10167         ## Obtain description of the given shape (number of sub-shapes of each type)
10168         #  @param theShape Shape to be described.
10169         #  @return Description of the given shape.
10170         #
10171         #  @ref tui_measurement_tools_page "Example"
10172         @ManageTransactions("MeasuOp")
10173         def WhatIs(self,theShape):
10174             """
10175             Obtain description of the given shape (number of sub-shapes of each type)
10176
10177             Parameters:
10178                 theShape Shape to be described.
10179
10180             Returns:
10181                 Description of the given shape.
10182             """
10183             # Example: see GEOM_TestMeasures.py
10184             aDescr = self.MeasuOp.WhatIs(theShape)
10185             RaiseIfFailed("WhatIs", self.MeasuOp)
10186             return aDescr
10187
10188         ## Obtain quantity of shapes of the given type in \a theShape.
10189         #  If \a theShape is of type \a theType, it is also counted.
10190         #  @param theShape Shape to be described.
10191         #  @param theType the given ShapeType().
10192         #  @return Quantity of shapes of type \a theType in \a theShape.
10193         #
10194         #  @ref tui_measurement_tools_page "Example"
10195         def NbShapes (self, theShape, theType):
10196             """
10197             Obtain quantity of shapes of the given type in theShape.
10198             If theShape is of type theType, it is also counted.
10199
10200             Parameters:
10201                 theShape Shape to be described.
10202                 theType the given geompy.ShapeType
10203
10204             Returns:
10205                 Quantity of shapes of type theType in theShape.
10206             """
10207             # Example: see GEOM_TestMeasures.py
10208             listSh = self.SubShapeAllIDs(theShape, theType)
10209             Nb = len(listSh)
10210             return Nb
10211
10212         ## Obtain quantity of shapes of each type in \a theShape.
10213         #  The \a theShape is also counted.
10214         #  @param theShape Shape to be described.
10215         #  @return Dictionary of ShapeType() with bound quantities of shapes.
10216         #
10217         #  @ref tui_measurement_tools_page "Example"
10218         def ShapeInfo (self, theShape):
10219             """
10220             Obtain quantity of shapes of each type in theShape.
10221             The theShape is also counted.
10222
10223             Parameters:
10224                 theShape Shape to be described.
10225
10226             Returns:
10227                 Dictionary of geompy.ShapeType with bound quantities of shapes.
10228             """
10229             # Example: see GEOM_TestMeasures.py
10230             aDict = {}
10231             for typeSh in self.ShapeType:
10232                 if typeSh in ( "AUTO", "SHAPE" ): continue
10233                 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10234                 Nb = len(listSh)
10235                 aDict[typeSh] = Nb
10236                 pass
10237             return aDict
10238
10239         def GetCreationInformation(self, theShape):
10240             info = theShape.GetCreationInformation()
10241             # operationName
10242             opName = info.operationName
10243             if not opName: opName = "no info available"
10244             res = "Operation: " + opName
10245             # parameters
10246             for parVal in info.params:
10247                 res += " \n %s = %s" % ( parVal.name, parVal.value )
10248             return res
10249
10250         ## Get a point, situated at the centre of mass of theShape.
10251         #  @param theShape Shape to define centre of mass of.
10252         #  @param theName Object name; when specified, this parameter is used
10253         #         for result publication in the study. Otherwise, if automatic
10254         #         publication is switched on, default value is used for result name.
10255         #
10256         #  @return New GEOM.GEOM_Object, containing the created point.
10257         #
10258         #  @ref tui_measurement_tools_page "Example"
10259         @ManageTransactions("MeasuOp")
10260         def MakeCDG(self, theShape, theName=None):
10261             """
10262             Get a point, situated at the centre of mass of theShape.
10263
10264             Parameters:
10265                 theShape Shape to define centre of mass of.
10266                 theName Object name; when specified, this parameter is used
10267                         for result publication in the study. Otherwise, if automatic
10268                         publication is switched on, default value is used for result name.
10269
10270             Returns:
10271                 New GEOM.GEOM_Object, containing the created point.
10272             """
10273             # Example: see GEOM_TestMeasures.py
10274             anObj = self.MeasuOp.GetCentreOfMass(theShape)
10275             RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10276             self._autoPublish(anObj, theName, "centerOfMass")
10277             return anObj
10278
10279         ## Get a vertex sub-shape by index depended with orientation.
10280         #  @param theShape Shape to find sub-shape.
10281         #  @param theIndex Index to find vertex by this index (starting from zero)
10282         #  @param theName Object name; when specified, this parameter is used
10283         #         for result publication in the study. Otherwise, if automatic
10284         #         publication is switched on, default value is used for result name.
10285         #
10286         #  @return New GEOM.GEOM_Object, containing the created vertex.
10287         #
10288         #  @ref tui_measurement_tools_page "Example"
10289         @ManageTransactions("MeasuOp")
10290         def GetVertexByIndex(self, theShape, theIndex, theName=None):
10291             """
10292             Get a vertex sub-shape by index depended with orientation.
10293
10294             Parameters:
10295                 theShape Shape to find sub-shape.
10296                 theIndex Index to find vertex by this index (starting from zero)
10297                 theName Object name; when specified, this parameter is used
10298                         for result publication in the study. Otherwise, if automatic
10299                         publication is switched on, default value is used for result name.
10300
10301             Returns:
10302                 New GEOM.GEOM_Object, containing the created vertex.
10303             """
10304             # Example: see GEOM_TestMeasures.py
10305             anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10306             RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10307             self._autoPublish(anObj, theName, "vertex")
10308             return anObj
10309
10310         ## Get the first vertex of wire/edge depended orientation.
10311         #  @param theShape Shape to find first vertex.
10312         #  @param theName Object name; when specified, this parameter is used
10313         #         for result publication in the study. Otherwise, if automatic
10314         #         publication is switched on, default value is used for result name.
10315         #
10316         #  @return New GEOM.GEOM_Object, containing the created vertex.
10317         #
10318         #  @ref tui_measurement_tools_page "Example"
10319         def GetFirstVertex(self, theShape, theName=None):
10320             """
10321             Get the first vertex of wire/edge depended orientation.
10322
10323             Parameters:
10324                 theShape Shape to find first vertex.
10325                 theName Object name; when specified, this parameter is used
10326                         for result publication in the study. Otherwise, if automatic
10327                         publication is switched on, default value is used for result name.
10328
10329             Returns:
10330                 New GEOM.GEOM_Object, containing the created vertex.
10331             """
10332             # Example: see GEOM_TestMeasures.py
10333             # note: auto-publishing is done in self.GetVertexByIndex()
10334             return self.GetVertexByIndex(theShape, 0, theName)
10335
10336         ## Get the last vertex of wire/edge depended orientation.
10337         #  @param theShape Shape to find last vertex.
10338         #  @param theName Object name; when specified, this parameter is used
10339         #         for result publication in the study. Otherwise, if automatic
10340         #         publication is switched on, default value is used for result name.
10341         #
10342         #  @return New GEOM.GEOM_Object, containing the created vertex.
10343         #
10344         #  @ref tui_measurement_tools_page "Example"
10345         def GetLastVertex(self, theShape, theName=None):
10346             """
10347             Get the last vertex of wire/edge depended orientation.
10348
10349             Parameters:
10350                 theShape Shape to find last vertex.
10351                 theName Object name; when specified, this parameter is used
10352                         for result publication in the study. Otherwise, if automatic
10353                         publication is switched on, default value is used for result name.
10354
10355             Returns:
10356                 New GEOM.GEOM_Object, containing the created vertex.
10357             """
10358             # Example: see GEOM_TestMeasures.py
10359             nb_vert =  self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10360             # note: auto-publishing is done in self.GetVertexByIndex()
10361             return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10362
10363         ## Get a normale to the given face. If the point is not given,
10364         #  the normale is calculated at the center of mass.
10365         #  @param theFace Face to define normale of.
10366         #  @param theOptionalPoint Point to compute the normale at.
10367         #  @param theName Object name; when specified, this parameter is used
10368         #         for result publication in the study. Otherwise, if automatic
10369         #         publication is switched on, default value is used for result name.
10370         #
10371         #  @return New GEOM.GEOM_Object, containing the created vector.
10372         #
10373         #  @ref swig_todo "Example"
10374         @ManageTransactions("MeasuOp")
10375         def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10376             """
10377             Get a normale to the given face. If the point is not given,
10378             the normale is calculated at the center of mass.
10379
10380             Parameters:
10381                 theFace Face to define normale of.
10382                 theOptionalPoint Point to compute the normale at.
10383                 theName Object name; when specified, this parameter is used
10384                         for result publication in the study. Otherwise, if automatic
10385                         publication is switched on, default value is used for result name.
10386
10387             Returns:
10388                 New GEOM.GEOM_Object, containing the created vector.
10389             """
10390             # Example: see GEOM_TestMeasures.py
10391             anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10392             RaiseIfFailed("GetNormal", self.MeasuOp)
10393             self._autoPublish(anObj, theName, "normal")
10394             return anObj
10395
10396         ## Print shape errors obtained from CheckShape.
10397         #  @param theShape Shape that was checked.
10398         #  @param theShapeErrors the shape errors obtained by CheckShape.
10399         #  @param theReturnStatus If 0 the description of problem is printed.
10400         #                         If 1 the description of problem is returned.
10401         #  @return If theReturnStatus is equal to 1 the description is returned.
10402         #          Otherwise doesn't return anything.
10403         #
10404         #  @ref tui_measurement_tools_page "Example"
10405         @ManageTransactions("MeasuOp")
10406         def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10407             """
10408             Print shape errors obtained from CheckShape.
10409
10410             Parameters:
10411                 theShape Shape that was checked.
10412                 theShapeErrors the shape errors obtained by CheckShape.
10413                 theReturnStatus If 0 the description of problem is printed.
10414                                 If 1 the description of problem is returned.
10415
10416             Returns:
10417                 If theReturnStatus is equal to 1 the description is returned.
10418                   Otherwise doesn't return anything.
10419             """
10420             # Example: see GEOM_TestMeasures.py
10421             Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10422             if theReturnStatus == 1:
10423                 return Descr
10424             print Descr
10425             pass
10426
10427         ## Check a topology of the given shape.
10428         #  @param theShape Shape to check validity of.
10429         #  @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10430         #                        if TRUE, the shape's geometry will be checked also.
10431         #  @param theReturnStatus If 0 and if theShape is invalid, a description
10432         #                         of problem is printed.
10433         #                         If 1 isValid flag and the description of
10434         #                         problem is returned.
10435         #                         If 2 isValid flag and the list of error data
10436         #                         is returned.
10437         #  @return TRUE, if the shape "seems to be valid".
10438         #          If theShape is invalid, prints a description of problem.
10439         #          If theReturnStatus is equal to 1 the description is returned
10440         #          along with IsValid flag.
10441         #          If theReturnStatus is equal to 2 the list of error data is
10442         #          returned along with IsValid flag.
10443         #
10444         #  @ref tui_measurement_tools_page "Example"
10445         @ManageTransactions("MeasuOp")
10446         def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10447             """
10448             Check a topology of the given shape.
10449
10450             Parameters:
10451                 theShape Shape to check validity of.
10452                 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10453                                if TRUE, the shape's geometry will be checked also.
10454                 theReturnStatus If 0 and if theShape is invalid, a description
10455                                 of problem is printed.
10456                                 If 1 IsValid flag and the description of
10457                                 problem is returned.
10458                                 If 2 IsValid flag and the list of error data
10459                                 is returned.
10460
10461             Returns:
10462                 TRUE, if the shape "seems to be valid".
10463                 If theShape is invalid, prints a description of problem.
10464                 If theReturnStatus is equal to 1 the description is returned
10465                 along with IsValid flag.
10466                 If theReturnStatus is equal to 2 the list of error data is
10467                 returned along with IsValid flag.
10468             """
10469             # Example: see GEOM_TestMeasures.py
10470             if theIsCheckGeom:
10471                 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10472                 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10473             else:
10474                 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
10475                 RaiseIfFailed("CheckShape", self.MeasuOp)
10476             if IsValid == 0:
10477                 if theReturnStatus == 0:
10478                     Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10479                     print Descr
10480             if theReturnStatus == 1:
10481               Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10482               return (IsValid, Descr)
10483             elif theReturnStatus == 2:
10484               return (IsValid, ShapeErrors)
10485             return IsValid
10486
10487         ## Detect self-intersections in the given shape.
10488         #  @param theShape Shape to check.
10489         #  @return TRUE, if the shape contains no self-intersections.
10490         #
10491         #  @ref tui_measurement_tools_page "Example"
10492         @ManageTransactions("MeasuOp")
10493         def CheckSelfIntersections(self, theShape):
10494             """
10495             Detect self-intersections in the given shape.
10496
10497             Parameters:
10498                 theShape Shape to check.
10499
10500             Returns:
10501                 TRUE, if the shape contains no self-intersections.
10502             """
10503             # Example: see GEOM_TestMeasures.py
10504             (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
10505             RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10506             return IsValid
10507
10508         ## Get position (LCS) of theShape.
10509         #
10510         #  Origin of the LCS is situated at the shape's center of mass.
10511         #  Axes of the LCS are obtained from shape's location or,
10512         #  if the shape is a planar face, from position of its plane.
10513         #
10514         #  @param theShape Shape to calculate position of.
10515         #  @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10516         #          Ox,Oy,Oz: Coordinates of shape's LCS origin.
10517         #          Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10518         #          Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10519         #
10520         #  @ref swig_todo "Example"
10521         @ManageTransactions("MeasuOp")
10522         def GetPosition(self,theShape):
10523             """
10524             Get position (LCS) of theShape.
10525             Origin of the LCS is situated at the shape's center of mass.
10526             Axes of the LCS are obtained from shape's location or,
10527             if the shape is a planar face, from position of its plane.
10528
10529             Parameters:
10530                 theShape Shape to calculate position of.
10531
10532             Returns:
10533                 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10534                  Ox,Oy,Oz: Coordinates of shape's LCS origin.
10535                  Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10536                  Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10537             """
10538             # Example: see GEOM_TestMeasures.py
10539             aTuple = self.MeasuOp.GetPosition(theShape)
10540             RaiseIfFailed("GetPosition", self.MeasuOp)
10541             return aTuple
10542
10543         ## Get kind of theShape.
10544         #
10545         #  @param theShape Shape to get a kind of.
10546         #  @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10547         #          and a list of parameters, describing the shape.
10548         #  @note  Concrete meaning of each value, returned via \a theIntegers
10549         #         or \a theDoubles list depends on the kind() of the shape.
10550         #
10551         #  @ref swig_todo "Example"
10552         @ManageTransactions("MeasuOp")
10553         def KindOfShape(self,theShape):
10554             """
10555             Get kind of theShape.
10556
10557             Parameters:
10558                 theShape Shape to get a kind of.
10559
10560             Returns:
10561                 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10562                     and a list of parameters, describing the shape.
10563             Note:
10564                 Concrete meaning of each value, returned via theIntegers
10565                 or theDoubles list depends on the geompy.kind of the shape
10566             """
10567             # Example: see GEOM_TestMeasures.py
10568             aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10569             RaiseIfFailed("KindOfShape", self.MeasuOp)
10570
10571             aKind  = aRoughTuple[0]
10572             anInts = aRoughTuple[1]
10573             aDbls  = aRoughTuple[2]
10574
10575             # Now there is no exception from this rule:
10576             aKindTuple = [aKind] + aDbls + anInts
10577
10578             # If they are we will regroup parameters for such kind of shape.
10579             # For example:
10580             #if aKind == kind.SOME_KIND:
10581             #    #  SOME_KIND     int int double int double double
10582             #    aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10583
10584             return aKindTuple
10585
10586         ## Returns the string that describes if the shell is good for solid.
10587         #  This is a support method for MakeSolid.
10588         #
10589         #  @param theShell the shell to be checked.
10590         #  @return Returns a string that describes the shell validity for
10591         #          solid construction.
10592         @ManageTransactions("MeasuOp")
10593         def _IsGoodForSolid(self, theShell):
10594             """
10595             Returns the string that describes if the shell is good for solid.
10596             This is a support method for MakeSolid.
10597
10598             Parameter:
10599                 theShell the shell to be checked.
10600
10601             Returns:
10602                 Returns a string that describes the shell validity for
10603                 solid construction.
10604             """
10605             aDescr = self.MeasuOp.IsGoodForSolid(theShell)
10606             return aDescr
10607
10608         # end of l2_measure
10609         ## @}
10610
10611         ## @addtogroup l2_import_export
10612         ## @{
10613
10614         ## Import a shape from the BREP or IGES or STEP file
10615         #  (depends on given format) with given name.
10616         #  @param theFileName The file, containing the shape.
10617         #  @param theFormatName Specify format for the file reading.
10618         #         Available formats can be obtained with InsertOp.ImportTranslators() method.
10619         #         If format 'IGES_SCALE' is used instead of 'IGES' or
10620         #            format 'STEP_SCALE' is used instead of 'STEP',
10621         #            length unit will be set to 'meter' and result model will be scaled.
10622         #  @param theName Object name; when specified, this parameter is used
10623         #         for result publication in the study. Otherwise, if automatic
10624         #         publication is switched on, default value is used for result name.
10625         #
10626         #  @return New GEOM.GEOM_Object, containing the imported shape.
10627         #          If material names are imported it returns the list of
10628         #          objects. The first one is the imported object followed by
10629         #          material groups.
10630         #  @note Auto publishing is allowed for the shape itself. Imported
10631         #        material groups are not automatically published.
10632         #
10633         #  @ref swig_Import_Export "Example"
10634         @ManageTransactions("InsertOp")
10635         def ImportFile(self, theFileName, theFormatName, theName=None):
10636             """
10637             Import a shape from the BREP or IGES or STEP file
10638             (depends on given format) with given name.
10639
10640             Parameters:
10641                 theFileName The file, containing the shape.
10642                 theFormatName Specify format for the file reading.
10643                     Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10644                     If format 'IGES_SCALE' is used instead of 'IGES' or
10645                        format 'STEP_SCALE' is used instead of 'STEP',
10646                        length unit will be set to 'meter' and result model will be scaled.
10647                 theName Object name; when specified, this parameter is used
10648                         for result publication in the study. Otherwise, if automatic
10649                         publication is switched on, default value is used for result name.
10650
10651             Returns:
10652                 New GEOM.GEOM_Object, containing the imported shape.
10653                 If material names are imported it returns the list of
10654                 objects. The first one is the imported object followed by
10655                 material groups.
10656             Note:
10657                 Auto publishing is allowed for the shape itself. Imported
10658                 material groups are not automatically published.
10659             """
10660             # Example: see GEOM_TestOthers.py
10661             aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10662             RaiseIfFailed("ImportFile", self.InsertOp)
10663             aNbObj = len(aListObj)
10664             if aNbObj > 0:
10665                 self._autoPublish(aListObj[0], theName, "imported")
10666             if aNbObj == 1:
10667                 return aListObj[0]
10668             return aListObj
10669
10670         ## Deprecated analog of ImportFile()
10671         def Import(self, theFileName, theFormatName, theName=None):
10672             """
10673             Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10674             """
10675             print "WARNING: Function Import is deprecated, use ImportFile instead"
10676             # note: auto-publishing is done in self.ImportFile()
10677             return self.ImportFile(theFileName, theFormatName, theName)
10678
10679         ## Shortcut to ImportFile() for BREP format.
10680         #  Import a shape from the BREP file with given name.
10681         #  @param theFileName The file, containing the shape.
10682         #  @param theName Object name; when specified, this parameter is used
10683         #         for result publication in the study. Otherwise, if automatic
10684         #         publication is switched on, default value is used for result name.
10685         #
10686         #  @return New GEOM.GEOM_Object, containing the imported shape.
10687         #
10688         #  @ref swig_Import_Export "Example"
10689         def ImportBREP(self, theFileName, theName=None):
10690             """
10691             geompy.ImportFile(...) function for BREP format
10692             Import a shape from the BREP file with given name.
10693
10694             Parameters:
10695                 theFileName The file, containing the shape.
10696                 theName Object name; when specified, this parameter is used
10697                         for result publication in the study. Otherwise, if automatic
10698                         publication is switched on, default value is used for result name.
10699
10700             Returns:
10701                 New GEOM.GEOM_Object, containing the imported shape.
10702             """
10703             # Example: see GEOM_TestOthers.py
10704             # note: auto-publishing is done in self.ImportFile()
10705             return self.ImportFile(theFileName, "BREP", theName)
10706
10707         ## Shortcut to ImportFile() for IGES format
10708         #  Import a shape from the IGES file with given name.
10709         #  @param theFileName The file, containing the shape.
10710         #  @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10711         #                     and result model will be scaled, if its units are not meters.
10712         #                     If False (default), file length units will be taken into account.
10713         #  @param theName Object name; when specified, this parameter is used
10714         #         for result publication in the study. Otherwise, if automatic
10715         #         publication is switched on, default value is used for result name.
10716         #
10717         #  @return New GEOM.GEOM_Object, containing the imported shape.
10718         #
10719         #  @ref swig_Import_Export "Example"
10720         def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
10721             """
10722             geompy.ImportFile(...) function for IGES format
10723
10724             Parameters:
10725                 theFileName The file, containing the shape.
10726                 ignoreUnits If True, file length units will be ignored (set to 'meter')
10727                             and result model will be scaled, if its units are not meters.
10728                             If False (default), file length units will be taken into account.
10729                 theName Object name; when specified, this parameter is used
10730                         for result publication in the study. Otherwise, if automatic
10731                         publication is switched on, default value is used for result name.
10732
10733             Returns:
10734                 New GEOM.GEOM_Object, containing the imported shape.
10735             """
10736             # Example: see GEOM_TestOthers.py
10737             # note: auto-publishing is done in self.ImportFile()
10738             if ignoreUnits:
10739                 return self.ImportFile(theFileName, "IGES_SCALE", theName)
10740             return self.ImportFile(theFileName, "IGES", theName)
10741
10742         ## Return length unit from given IGES file
10743         #  @param theFileName The file, containing the shape.
10744         #  @return String, containing the units name.
10745         #
10746         #  @ref swig_Import_Export "Example"
10747         @ManageTransactions("InsertOp")
10748         def GetIGESUnit(self, theFileName):
10749             """
10750             Return length units from given IGES file
10751
10752             Parameters:
10753                 theFileName The file, containing the shape.
10754
10755             Returns:
10756                 String, containing the units name.
10757             """
10758             # Example: see GEOM_TestOthers.py
10759             aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
10760             return aUnitName
10761
10762         ## Shortcut to ImportFile() for STEP format
10763         #  Import a shape from the STEP file with given name.
10764         #  @param theFileName The file, containing the shape.
10765         #  @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10766         #                     and result model will be scaled, if its units are not meters.
10767         #                     If False (default), file length units will be taken into account.
10768         #  @param theName Object name; when specified, this parameter is used
10769         #         for result publication in the study. Otherwise, if automatic
10770         #         publication is switched on, default value is used for result name.
10771         #
10772         #  @return New GEOM.GEOM_Object, containing the imported shape.
10773         #          If material names are imported it returns the list of
10774         #          objects. The first one is the imported object followed by
10775         #          material groups.
10776         #  @note Auto publishing is allowed for the shape itself. Imported
10777         #        material groups are not automatically published.
10778         #
10779         #  @ref swig_Import_Export "Example"
10780         def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10781             """
10782             geompy.ImportFile(...) function for STEP format
10783
10784             Parameters:
10785                 theFileName The file, containing the shape.
10786                 ignoreUnits If True, file length units will be ignored (set to 'meter')
10787                             and result model will be scaled, if its units are not meters.
10788                             If False (default), file length units will be taken into account.
10789                 theName Object name; when specified, this parameter is used
10790                         for result publication in the study. Otherwise, if automatic
10791                         publication is switched on, default value is used for result name.
10792
10793             Returns:
10794                 New GEOM.GEOM_Object, containing the imported shape.
10795                 If material names are imported it returns the list of
10796                 objects. The first one is the imported object followed by
10797                 material groups.
10798             Note:
10799                 Auto publishing is allowed for the shape itself. Imported
10800                 material groups are not automatically published.
10801             """
10802             # Example: see GEOM_TestOthers.py
10803             # note: auto-publishing is done in self.ImportFile()
10804             if ignoreUnits:
10805                 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10806             return self.ImportFile(theFileName, "STEP", theName)
10807
10808         ## Return length unit from given IGES or STEP file
10809         #  @param theFileName The file, containing the shape.
10810         #  @return String, containing the units name.
10811         #
10812         #  @ref swig_Import_Export "Example"
10813         @ManageTransactions("InsertOp")
10814         def GetSTEPUnit(self, theFileName):
10815             """
10816             Return length units from given STEP file
10817
10818             Parameters:
10819                 theFileName The file, containing the shape.
10820
10821             Returns:
10822                 String, containing the units name.
10823             """
10824             # Example: see GEOM_TestOthers.py
10825             aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10826             return aUnitName
10827
10828         ## Read a shape from the binary stream, containing its bounding representation (BRep).
10829         #  @note This method will not be dumped to the python script by DumpStudy functionality.
10830         #  @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10831         #  @param theStream The BRep binary stream.
10832         #  @param theName Object name; when specified, this parameter is used
10833         #         for result publication in the study. Otherwise, if automatic
10834         #         publication is switched on, default value is used for result name.
10835         #
10836         #  @return New GEOM_Object, containing the shape, read from theStream.
10837         #
10838         #  @ref swig_Import_Export "Example"
10839         @ManageTransactions("InsertOp")
10840         def RestoreShape (self, theStream, theName=None):
10841             """
10842             Read a shape from the binary stream, containing its bounding representation (BRep).
10843
10844             Note:
10845                 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10846
10847             Parameters:
10848                 theStream The BRep binary stream.
10849                 theName Object name; when specified, this parameter is used
10850                         for result publication in the study. Otherwise, if automatic
10851                         publication is switched on, default value is used for result name.
10852
10853             Returns:
10854                 New GEOM_Object, containing the shape, read from theStream.
10855             """
10856             # Example: see GEOM_TestOthers.py
10857             anObj = self.InsertOp.RestoreShape(theStream)
10858             RaiseIfFailed("RestoreShape", self.InsertOp)
10859             self._autoPublish(anObj, theName, "restored")
10860             return anObj
10861
10862         ## Export the given shape into a file with given name.
10863         #  @param theObject Shape to be stored in the file.
10864         #  @param theFileName Name of the file to store the given shape in.
10865         #  @param theFormatName Specify format for the shape storage.
10866         #         Available formats can be obtained with
10867         #         geompy.InsertOp.ExportTranslators()[0] method.
10868         #
10869         #  @ref swig_Import_Export "Example"
10870         @ManageTransactions("InsertOp")
10871         def Export(self, theObject, theFileName, theFormatName):
10872             """
10873             Export the given shape into a file with given name.
10874
10875             Parameters:
10876                 theObject Shape to be stored in the file.
10877                 theFileName Name of the file to store the given shape in.
10878                 theFormatName Specify format for the shape storage.
10879                               Available formats can be obtained with
10880                               geompy.InsertOp.ExportTranslators()[0] method.
10881             """
10882             # Example: see GEOM_TestOthers.py
10883             self.InsertOp.Export(theObject, theFileName, theFormatName)
10884             if self.InsertOp.IsDone() == 0:
10885                 raise RuntimeError,  "Export : " + self.InsertOp.GetErrorCode()
10886                 pass
10887             pass
10888
10889         ## Shortcut to Export() for BREP format
10890         #
10891         #  @ref swig_Import_Export "Example"
10892         def ExportBREP(self,theObject, theFileName):
10893             """
10894             geompy.Export(...) function for BREP format
10895             """
10896             # Example: see GEOM_TestOthers.py
10897             return self.Export(theObject, theFileName, "BREP")
10898
10899         ## Shortcut to Export() for IGES format
10900         #
10901         #  @ref swig_Import_Export "Example"
10902         def ExportIGES(self,theObject, theFileName):
10903             """
10904             geompy.Export(...) function for IGES format
10905             """
10906             # Example: see GEOM_TestOthers.py
10907             return self.Export(theObject, theFileName, "IGES")
10908
10909         ## Shortcut to Export() for STEP format
10910         #
10911         #  @ref swig_Import_Export "Example"
10912         def ExportSTEP(self,theObject, theFileName):
10913             """
10914             geompy.Export(...) function for STEP format
10915             """
10916             # Example: see GEOM_TestOthers.py
10917             return self.Export(theObject, theFileName, "STEP")
10918
10919         # end of l2_import_export
10920         ## @}
10921
10922         ## @addtogroup l3_blocks
10923         ## @{
10924
10925         ## Create a quadrangle face from four edges. Order of Edges is not
10926         #  important. It is  not necessary that edges share the same vertex.
10927         #  @param E1,E2,E3,E4 Edges for the face bound.
10928         #  @param theName Object name; when specified, this parameter is used
10929         #         for result publication in the study. Otherwise, if automatic
10930         #         publication is switched on, default value is used for result name.
10931         #
10932         #  @return New GEOM.GEOM_Object, containing the created face.
10933         #
10934         #  @ref tui_building_by_blocks_page "Example"
10935         @ManageTransactions("BlocksOp")
10936         def MakeQuad(self, E1, E2, E3, E4, theName=None):
10937             """
10938             Create a quadrangle face from four edges. Order of Edges is not
10939             important. It is  not necessary that edges share the same vertex.
10940
10941             Parameters:
10942                 E1,E2,E3,E4 Edges for the face bound.
10943                 theName Object name; when specified, this parameter is used
10944                         for result publication in the study. Otherwise, if automatic
10945                         publication is switched on, default value is used for result name.
10946
10947             Returns:
10948                 New GEOM.GEOM_Object, containing the created face.
10949
10950             Example of usage:
10951                 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10952             """
10953             # Example: see GEOM_Spanner.py
10954             anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10955             RaiseIfFailed("MakeQuad", self.BlocksOp)
10956             self._autoPublish(anObj, theName, "quad")
10957             return anObj
10958
10959         ## Create a quadrangle face on two edges.
10960         #  The missing edges will be built by creating the shortest ones.
10961         #  @param E1,E2 Two opposite edges for the face.
10962         #  @param theName Object name; when specified, this parameter is used
10963         #         for result publication in the study. Otherwise, if automatic
10964         #         publication is switched on, default value is used for result name.
10965         #
10966         #  @return New GEOM.GEOM_Object, containing the created face.
10967         #
10968         #  @ref tui_building_by_blocks_page "Example"
10969         @ManageTransactions("BlocksOp")
10970         def MakeQuad2Edges(self, E1, E2, theName=None):
10971             """
10972             Create a quadrangle face on two edges.
10973             The missing edges will be built by creating the shortest ones.
10974
10975             Parameters:
10976                 E1,E2 Two opposite edges for the face.
10977                 theName Object name; when specified, this parameter is used
10978                         for result publication in the study. Otherwise, if automatic
10979                         publication is switched on, default value is used for result name.
10980
10981             Returns:
10982                 New GEOM.GEOM_Object, containing the created face.
10983
10984             Example of usage:
10985                 # create vertices
10986                 p1 = geompy.MakeVertex(  0.,   0.,   0.)
10987                 p2 = geompy.MakeVertex(150.,  30.,   0.)
10988                 p3 = geompy.MakeVertex(  0., 120.,  50.)
10989                 p4 = geompy.MakeVertex(  0.,  40.,  70.)
10990                 # create edges
10991                 edge1 = geompy.MakeEdge(p1, p2)
10992                 edge2 = geompy.MakeEdge(p3, p4)
10993                 # create a quadrangle face from two edges
10994                 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10995             """
10996             # Example: see GEOM_Spanner.py
10997             anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10998             RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10999             self._autoPublish(anObj, theName, "quad")
11000             return anObj
11001
11002         ## Create a quadrangle face with specified corners.
11003         #  The missing edges will be built by creating the shortest ones.
11004         #  @param V1,V2,V3,V4 Corner vertices for the face.
11005         #  @param theName Object name; when specified, this parameter is used
11006         #         for result publication in the study. Otherwise, if automatic
11007         #         publication is switched on, default value is used for result name.
11008         #
11009         #  @return New GEOM.GEOM_Object, containing the created face.
11010         #
11011         #  @ref tui_building_by_blocks_page "Example 1"
11012         #  \n @ref swig_MakeQuad4Vertices "Example 2"
11013         @ManageTransactions("BlocksOp")
11014         def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
11015             """
11016             Create a quadrangle face with specified corners.
11017             The missing edges will be built by creating the shortest ones.
11018
11019             Parameters:
11020                 V1,V2,V3,V4 Corner vertices for the face.
11021                 theName Object name; when specified, this parameter is used
11022                         for result publication in the study. Otherwise, if automatic
11023                         publication is switched on, default value is used for result name.
11024
11025             Returns:
11026                 New GEOM.GEOM_Object, containing the created face.
11027
11028             Example of usage:
11029                 # create vertices
11030                 p1 = geompy.MakeVertex(  0.,   0.,   0.)
11031                 p2 = geompy.MakeVertex(150.,  30.,   0.)
11032                 p3 = geompy.MakeVertex(  0., 120.,  50.)
11033                 p4 = geompy.MakeVertex(  0.,  40.,  70.)
11034                 # create a quadrangle from four points in its corners
11035                 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
11036             """
11037             # Example: see GEOM_Spanner.py
11038             anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
11039             RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
11040             self._autoPublish(anObj, theName, "quad")
11041             return anObj
11042
11043         ## Create a hexahedral solid, bounded by the six given faces. Order of
11044         #  faces is not important. It is  not necessary that Faces share the same edge.
11045         #  @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11046         #  @param theName Object name; when specified, this parameter is used
11047         #         for result publication in the study. Otherwise, if automatic
11048         #         publication is switched on, default value is used for result name.
11049         #
11050         #  @return New GEOM.GEOM_Object, containing the created solid.
11051         #
11052         #  @ref tui_building_by_blocks_page "Example 1"
11053         #  \n @ref swig_MakeHexa "Example 2"
11054         @ManageTransactions("BlocksOp")
11055         def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
11056             """
11057             Create a hexahedral solid, bounded by the six given faces. Order of
11058             faces is not important. It is  not necessary that Faces share the same edge.
11059
11060             Parameters:
11061                 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11062                 theName Object name; when specified, this parameter is used
11063                         for result publication in the study. Otherwise, if automatic
11064                         publication is switched on, default value is used for result name.
11065
11066             Returns:
11067                 New GEOM.GEOM_Object, containing the created solid.
11068
11069             Example of usage:
11070                 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
11071             """
11072             # Example: see GEOM_Spanner.py
11073             anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
11074             RaiseIfFailed("MakeHexa", self.BlocksOp)
11075             self._autoPublish(anObj, theName, "hexa")
11076             return anObj
11077
11078         ## Create a hexahedral solid between two given faces.
11079         #  The missing faces will be built by creating the smallest ones.
11080         #  @param F1,F2 Two opposite faces for the hexahedral solid.
11081         #  @param theName Object name; when specified, this parameter is used
11082         #         for result publication in the study. Otherwise, if automatic
11083         #         publication is switched on, default value is used for result name.
11084         #
11085         #  @return New GEOM.GEOM_Object, containing the created solid.
11086         #
11087         #  @ref tui_building_by_blocks_page "Example 1"
11088         #  \n @ref swig_MakeHexa2Faces "Example 2"
11089         @ManageTransactions("BlocksOp")
11090         def MakeHexa2Faces(self, F1, F2, theName=None):
11091             """
11092             Create a hexahedral solid between two given faces.
11093             The missing faces will be built by creating the smallest ones.
11094
11095             Parameters:
11096                 F1,F2 Two opposite faces for the hexahedral solid.
11097                 theName Object name; when specified, this parameter is used
11098                         for result publication in the study. Otherwise, if automatic
11099                         publication is switched on, default value is used for result name.
11100
11101             Returns:
11102                 New GEOM.GEOM_Object, containing the created solid.
11103
11104             Example of usage:
11105                 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11106             """
11107             # Example: see GEOM_Spanner.py
11108             anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11109             RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11110             self._autoPublish(anObj, theName, "hexa")
11111             return anObj
11112
11113         # end of l3_blocks
11114         ## @}
11115
11116         ## @addtogroup l3_blocks_op
11117         ## @{
11118
11119         ## Get a vertex, found in the given shape by its coordinates.
11120         #  @param theShape Block or a compound of blocks.
11121         #  @param theX,theY,theZ Coordinates of the sought vertex.
11122         #  @param theEpsilon Maximum allowed distance between the resulting
11123         #                    vertex and point with the given coordinates.
11124         #  @param theName Object name; when specified, this parameter is used
11125         #         for result publication in the study. Otherwise, if automatic
11126         #         publication is switched on, default value is used for result name.
11127         #
11128         #  @return New GEOM.GEOM_Object, containing the found vertex.
11129         #
11130         #  @ref swig_GetPoint "Example"
11131         @ManageTransactions("BlocksOp")
11132         def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11133             """
11134             Get a vertex, found in the given shape by its coordinates.
11135
11136             Parameters:
11137                 theShape Block or a compound of blocks.
11138                 theX,theY,theZ Coordinates of the sought vertex.
11139                 theEpsilon Maximum allowed distance between the resulting
11140                            vertex and point with the given coordinates.
11141                 theName Object name; when specified, this parameter is used
11142                         for result publication in the study. Otherwise, if automatic
11143                         publication is switched on, default value is used for result name.
11144
11145             Returns:
11146                 New GEOM.GEOM_Object, containing the found vertex.
11147
11148             Example of usage:
11149                 pnt = geompy.GetPoint(shape, -50,  50,  50, 0.01)
11150             """
11151             # Example: see GEOM_TestOthers.py
11152             anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11153             RaiseIfFailed("GetPoint", self.BlocksOp)
11154             self._autoPublish(anObj, theName, "vertex")
11155             return anObj
11156
11157         ## Find a vertex of the given shape, which has minimal distance to the given point.
11158         #  @param theShape Any shape.
11159         #  @param thePoint Point, close to the desired vertex.
11160         #  @param theName Object name; when specified, this parameter is used
11161         #         for result publication in the study. Otherwise, if automatic
11162         #         publication is switched on, default value is used for result name.
11163         #
11164         #  @return New GEOM.GEOM_Object, containing the found vertex.
11165         #
11166         #  @ref swig_GetVertexNearPoint "Example"
11167         @ManageTransactions("BlocksOp")
11168         def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11169             """
11170             Find a vertex of the given shape, which has minimal distance to the given point.
11171
11172             Parameters:
11173                 theShape Any shape.
11174                 thePoint Point, close to the desired vertex.
11175                 theName Object name; when specified, this parameter is used
11176                         for result publication in the study. Otherwise, if automatic
11177                         publication is switched on, default value is used for result name.
11178
11179             Returns:
11180                 New GEOM.GEOM_Object, containing the found vertex.
11181
11182             Example of usage:
11183                 pmidle = geompy.MakeVertex(50, 0, 50)
11184                 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11185             """
11186             # Example: see GEOM_TestOthers.py
11187             anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11188             RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11189             self._autoPublish(anObj, theName, "vertex")
11190             return anObj
11191
11192         ## Get an edge, found in the given shape by two given vertices.
11193         #  @param theShape Block or a compound of blocks.
11194         #  @param thePoint1,thePoint2 Points, close to the ends of 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_GetEdge "Example"
11202         @ManageTransactions("BlocksOp")
11203         def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11204             """
11205             Get an edge, found in the given shape by two given vertices.
11206
11207             Parameters:
11208                 theShape Block or a compound of blocks.
11209                 thePoint1,thePoint2 Points, close to the ends of 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_Spanner.py
11218             anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11219             RaiseIfFailed("GetEdge", self.BlocksOp)
11220             self._autoPublish(anObj, theName, "edge")
11221             return anObj
11222
11223         ## Find an edge of the given shape, which has minimal distance to the given point.
11224         #  @param theShape Block or a compound of blocks.
11225         #  @param thePoint Point, close to the desired edge.
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 edge.
11231         #
11232         #  @ref swig_GetEdgeNearPoint "Example"
11233         @ManageTransactions("BlocksOp")
11234         def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11235             """
11236             Find an edge of the given shape, which has minimal distance to the given point.
11237
11238             Parameters:
11239                 theShape Block or a compound of blocks.
11240                 thePoint Point, close to the desired edge.
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 edge.
11247             """
11248             # Example: see GEOM_TestOthers.py
11249             anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11250             RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11251             self._autoPublish(anObj, theName, "edge")
11252             return anObj
11253
11254         ## Returns a face, found in the given shape by four given corner vertices.
11255         #  @param theShape Block or a compound of blocks.
11256         #  @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners 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 GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11266             """
11267             Returns a face, found in the given shape by four given corner vertices.
11268
11269             Parameters:
11270                 theShape Block or a compound of blocks.
11271                 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners 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.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11281             RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11282             self._autoPublish(anObj, theName, "face")
11283             return anObj
11284
11285         ## Get a face of block, found in the given shape by two given edges.
11286         #  @param theShape Block or a compound of blocks.
11287         #  @param theEdge1,theEdge2 Edges, close to the edges of 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_todo "Example"
11295         @ManageTransactions("BlocksOp")
11296         def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11297             """
11298             Get a face of block, found in the given shape by two given edges.
11299
11300             Parameters:
11301                 theShape Block or a compound of blocks.
11302                 theEdge1,theEdge2 Edges, close to the edges of 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.GetFaceByEdges(theShape, theEdge1, theEdge2)
11312             RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11313             self._autoPublish(anObj, theName, "face")
11314             return anObj
11315
11316         ## Find a face, opposite to the given one in the given block.
11317         #  @param theBlock Must be a hexahedral solid.
11318         #  @param theFace Face of \a theBlock, opposite 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_GetOppositeFace "Example"
11326         @ManageTransactions("BlocksOp")
11327         def GetOppositeFace(self, theBlock, theFace, theName=None):
11328             """
11329             Find a face, opposite to the given one in the given block.
11330
11331             Parameters:
11332                 theBlock Must be a hexahedral solid.
11333                 theFace Face of theBlock, opposite 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.GetOppositeFace(theBlock, theFace)
11343             RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11344             self._autoPublish(anObj, theName, "face")
11345             return anObj
11346
11347         ## Find a face of the given shape, which has minimal distance to the given point.
11348         #  @param theShape Block or a compound of blocks.
11349         #  @param thePoint Point, close to 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_GetFaceNearPoint "Example"
11357         @ManageTransactions("BlocksOp")
11358         def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11359             """
11360             Find a face of the given shape, which has minimal distance to the given point.
11361
11362             Parameters:
11363                 theShape Block or a compound of blocks.
11364                 thePoint Point, close to 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.GetFaceNearPoint(theShape, thePoint)
11374             RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11375             self._autoPublish(anObj, theName, "face")
11376             return anObj
11377
11378         ## Find a face of block, whose outside normale has minimal angle with the given vector.
11379         #  @param theBlock Block or a compound of blocks.
11380         #  @param theVector Vector, close to the normale of the desired face.
11381         #  @param theName Object name; when specified, this parameter is used
11382         #         for result publication in the study. Otherwise, if automatic
11383         #         publication is switched on, default value is used for result name.
11384         #
11385         #  @return New GEOM.GEOM_Object, containing the found face.
11386         #
11387         #  @ref swig_todo "Example"
11388         @ManageTransactions("BlocksOp")
11389         def GetFaceByNormale(self, theBlock, theVector, theName=None):
11390             """
11391             Find a face of block, whose outside normale has minimal angle with the given vector.
11392
11393             Parameters:
11394                 theBlock Block or a compound of blocks.
11395                 theVector Vector, close to the normale of the desired face.
11396                 theName Object name; when specified, this parameter is used
11397                         for result publication in the study. Otherwise, if automatic
11398                         publication is switched on, default value is used for result name.
11399
11400             Returns:
11401                 New GEOM.GEOM_Object, containing the found face.
11402             """
11403             # Example: see GEOM_Spanner.py
11404             anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11405             RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11406             self._autoPublish(anObj, theName, "face")
11407             return anObj
11408
11409         ## Find all sub-shapes of type \a theShapeType of the given shape,
11410         #  which have minimal distance to the given point.
11411         #  @param theShape Any shape.
11412         #  @param thePoint Point, close to the desired shape.
11413         #  @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11414         #  @param theTolerance The tolerance for distances comparison. All shapes
11415         #                      with distances to the given point in interval
11416         #                      [minimal_distance, minimal_distance + theTolerance] will be gathered.
11417         #  @param theName Object name; when specified, this parameter is used
11418         #         for result publication in the study. Otherwise, if automatic
11419         #         publication is switched on, default value is used for result name.
11420         #
11421         #  @return New GEOM_Object, containing a group of all found shapes.
11422         #
11423         #  @ref swig_GetShapesNearPoint "Example"
11424         @ManageTransactions("BlocksOp")
11425         def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11426             """
11427             Find all sub-shapes of type theShapeType of the given shape,
11428             which have minimal distance to the given point.
11429
11430             Parameters:
11431                 theShape Any shape.
11432                 thePoint Point, close to the desired shape.
11433                 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11434                 theTolerance The tolerance for distances comparison. All shapes
11435                                 with distances to the given point in interval
11436                                 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11437                 theName Object name; when specified, this parameter is used
11438                         for result publication in the study. Otherwise, if automatic
11439                         publication is switched on, default value is used for result name.
11440
11441             Returns:
11442                 New GEOM_Object, containing a group of all found shapes.
11443             """
11444             # Example: see GEOM_TestOthers.py
11445             anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11446             RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11447             self._autoPublish(anObj, theName, "group")
11448             return anObj
11449
11450         # end of l3_blocks_op
11451         ## @}
11452
11453         ## @addtogroup l4_blocks_measure
11454         ## @{
11455
11456         ## Check, if the compound of blocks is given.
11457         #  To be considered as a compound of blocks, the
11458         #  given shape must satisfy the following conditions:
11459         #  - Each element of the compound should be a Block (6 faces and 12 edges).
11460         #  - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11461         #  - The compound should be connexe.
11462         #  - The glue between two quadrangle faces should be applied.
11463         #  @param theCompound The compound to check.
11464         #  @return TRUE, if the given shape is a compound of blocks.
11465         #  If theCompound is not valid, prints all discovered errors.
11466         #
11467         #  @ref tui_measurement_tools_page "Example 1"
11468         #  \n @ref swig_CheckCompoundOfBlocks "Example 2"
11469         @ManageTransactions("BlocksOp")
11470         def CheckCompoundOfBlocks(self,theCompound):
11471             """
11472             Check, if the compound of blocks is given.
11473             To be considered as a compound of blocks, the
11474             given shape must satisfy the following conditions:
11475             - Each element of the compound should be a Block (6 faces and 12 edges).
11476             - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11477             - The compound should be connexe.
11478             - The glue between two quadrangle faces should be applied.
11479
11480             Parameters:
11481                 theCompound The compound to check.
11482
11483             Returns:
11484                 TRUE, if the given shape is a compound of blocks.
11485                 If theCompound is not valid, prints all discovered errors.
11486             """
11487             # Example: see GEOM_Spanner.py
11488             (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11489             RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11490             if IsValid == 0:
11491                 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11492                 print Descr
11493             return IsValid
11494
11495         ## Retrieve all non blocks solids and faces from \a theShape.
11496         #  @param theShape The shape to explore.
11497         #  @param theName Object name; when specified, this parameter is used
11498         #         for result publication in the study. Otherwise, if automatic
11499         #         publication is switched on, default value is used for result name.
11500         #
11501         #  @return A tuple of two GEOM_Objects. The first object is a group of all
11502         #          non block solids (= not 6 faces, or with 6 faces, but with the
11503         #          presence of non-quadrangular faces). The second object is a
11504         #          group of all non quadrangular faces.
11505         #
11506         #  @ref tui_measurement_tools_page "Example 1"
11507         #  \n @ref swig_GetNonBlocks "Example 2"
11508         @ManageTransactions("BlocksOp")
11509         def GetNonBlocks (self, theShape, theName=None):
11510             """
11511             Retrieve all non blocks solids and faces from theShape.
11512
11513             Parameters:
11514                 theShape The shape to explore.
11515                 theName Object name; when specified, this parameter is used
11516                         for result publication in the study. Otherwise, if automatic
11517                         publication is switched on, default value is used for result name.
11518
11519             Returns:
11520                 A tuple of two GEOM_Objects. The first object is a group of all
11521                 non block solids (= not 6 faces, or with 6 faces, but with the
11522                 presence of non-quadrangular faces). The second object is a
11523                 group of all non quadrangular faces.
11524
11525             Usage:
11526                 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11527             """
11528             # Example: see GEOM_Spanner.py
11529             aTuple = self.BlocksOp.GetNonBlocks(theShape)
11530             RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11531             self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11532             return aTuple
11533
11534         ## Remove all seam and degenerated edges from \a theShape.
11535         #  Unite faces and edges, sharing one surface. It means that
11536         #  this faces must have references to one C++ surface object (handle).
11537         #  @param theShape The compound or single solid to remove irregular edges from.
11538         #  @param doUnionFaces If True, then unite faces. If False (the default value),
11539         #         do not unite faces.
11540         #  @param theName Object name; when specified, this parameter is used
11541         #         for result publication in the study. Otherwise, if automatic
11542         #         publication is switched on, default value is used for result name.
11543         #
11544         #  @return Improved shape.
11545         #
11546         #  @ref swig_RemoveExtraEdges "Example"
11547         @ManageTransactions("BlocksOp")
11548         def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11549             """
11550             Remove all seam and degenerated edges from theShape.
11551             Unite faces and edges, sharing one surface. It means that
11552             this faces must have references to one C++ surface object (handle).
11553
11554             Parameters:
11555                 theShape The compound or single solid to remove irregular edges from.
11556                 doUnionFaces If True, then unite faces. If False (the default value),
11557                              do not unite faces.
11558                 theName Object name; when specified, this parameter is used
11559                         for result publication in the study. Otherwise, if automatic
11560                         publication is switched on, default value is used for result name.
11561
11562             Returns:
11563                 Improved shape.
11564             """
11565             # Example: see GEOM_TestOthers.py
11566             nbFacesOptimum = -1 # -1 means do not unite faces
11567             if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11568             anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11569             RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11570             self._autoPublish(anObj, theName, "removeExtraEdges")
11571             return anObj
11572
11573         ## Performs union faces of \a theShape
11574         #  Unite faces sharing one surface. It means that
11575         #  these faces must have references to one C++ surface object (handle).
11576         #  @param theShape The compound or single solid that contains faces
11577         #         to perform union.
11578         #  @param theName Object name; when specified, this parameter is used
11579         #         for result publication in the study. Otherwise, if automatic
11580         #         publication is switched on, default value is used for result name.
11581         #
11582         #  @return Improved shape.
11583         #
11584         #  @ref swig_UnionFaces "Example"
11585         @ManageTransactions("BlocksOp")
11586         def UnionFaces(self, theShape, theName=None):
11587             """
11588             Performs union faces of theShape.
11589             Unite faces sharing one surface. It means that
11590             these faces must have references to one C++ surface object (handle).
11591
11592             Parameters:
11593                 theShape The compound or single solid that contains faces
11594                          to perform union.
11595                 theName Object name; when specified, this parameter is used
11596                         for result publication in the study. Otherwise, if automatic
11597                         publication is switched on, default value is used for result name.
11598
11599             Returns:
11600                 Improved shape.
11601             """
11602             # Example: see GEOM_TestOthers.py
11603             anObj = self.BlocksOp.UnionFaces(theShape)
11604             RaiseIfFailed("UnionFaces", self.BlocksOp)
11605             self._autoPublish(anObj, theName, "unionFaces")
11606             return anObj
11607
11608         ## Check, if the given shape is a blocks compound.
11609         #  Fix all detected errors.
11610         #    \note Single block can be also fixed by this method.
11611         #  @param theShape The compound to check and improve.
11612         #  @param theName Object name; when specified, this parameter is used
11613         #         for result publication in the study. Otherwise, if automatic
11614         #         publication is switched on, default value is used for result name.
11615         #
11616         #  @return Improved compound.
11617         #
11618         #  @ref swig_CheckAndImprove "Example"
11619         @ManageTransactions("BlocksOp")
11620         def CheckAndImprove(self, theShape, theName=None):
11621             """
11622             Check, if the given shape is a blocks compound.
11623             Fix all detected errors.
11624
11625             Note:
11626                 Single block can be also fixed by this method.
11627
11628             Parameters:
11629                 theShape The compound to check and improve.
11630                 theName Object name; when specified, this parameter is used
11631                         for result publication in the study. Otherwise, if automatic
11632                         publication is switched on, default value is used for result name.
11633
11634             Returns:
11635                 Improved compound.
11636             """
11637             # Example: see GEOM_TestOthers.py
11638             anObj = self.BlocksOp.CheckAndImprove(theShape)
11639             RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11640             self._autoPublish(anObj, theName, "improved")
11641             return anObj
11642
11643         # end of l4_blocks_measure
11644         ## @}
11645
11646         ## @addtogroup l3_blocks_op
11647         ## @{
11648
11649         ## Get all the blocks, contained in the given compound.
11650         #  @param theCompound The compound to explode.
11651         #  @param theMinNbFaces If solid has lower number of faces, it is not a block.
11652         #  @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11653         #  @param theName Object name; when specified, this parameter is used
11654         #         for result publication in the study. Otherwise, if automatic
11655         #         publication is switched on, default value is used for result name.
11656         #
11657         #  @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11658         #
11659         #  @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11660         #
11661         #  @ref tui_explode_on_blocks "Example 1"
11662         #  \n @ref swig_MakeBlockExplode "Example 2"
11663         @ManageTransactions("BlocksOp")
11664         def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11665             """
11666             Get all the blocks, contained in the given compound.
11667
11668             Parameters:
11669                 theCompound The compound to explode.
11670                 theMinNbFaces If solid has lower number of faces, it is not a block.
11671                 theMaxNbFaces If solid has higher number of faces, it is not a block.
11672                 theName Object name; when specified, this parameter is used
11673                         for result publication in the study. Otherwise, if automatic
11674                         publication is switched on, default value is used for result name.
11675
11676             Note:
11677                 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11678
11679             Returns:
11680                 List of GEOM.GEOM_Object, containing the retrieved blocks.
11681             """
11682             # Example: see GEOM_TestOthers.py
11683             theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11684             aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11685             RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11686             for anObj in aList:
11687                 anObj.SetParameters(Parameters)
11688                 pass
11689             self._autoPublish(aList, theName, "block")
11690             return aList
11691
11692         ## Find block, containing the given point inside its volume or on boundary.
11693         #  @param theCompound Compound, to find block in.
11694         #  @param thePoint Point, close to the desired block. If the point lays on
11695         #         boundary between some blocks, we return block with nearest center.
11696         #  @param theName Object name; when specified, this parameter is used
11697         #         for result publication in the study. Otherwise, if automatic
11698         #         publication is switched on, default value is used for result name.
11699         #
11700         #  @return New GEOM.GEOM_Object, containing the found block.
11701         #
11702         #  @ref swig_todo "Example"
11703         @ManageTransactions("BlocksOp")
11704         def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11705             """
11706             Find block, containing the given point inside its volume or on boundary.
11707
11708             Parameters:
11709                 theCompound Compound, to find block in.
11710                 thePoint Point, close to the desired block. If the point lays on
11711                          boundary between some blocks, we return block with nearest center.
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.GEOM_Object, containing the found block.
11718             """
11719             # Example: see GEOM_Spanner.py
11720             anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11721             RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11722             self._autoPublish(anObj, theName, "block")
11723             return anObj
11724
11725         ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11726         #  @param theCompound Compound, to find block in.
11727         #  @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
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 New GEOM.GEOM_Object, containing the found block.
11733         #
11734         #  @ref swig_GetBlockByParts "Example"
11735         @ManageTransactions("BlocksOp")
11736         def GetBlockByParts(self, theCompound, theParts, theName=None):
11737             """
11738              Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11739
11740              Parameters:
11741                 theCompound Compound, to find block in.
11742                 theParts List of faces and/or edges and/or vertices to be parts of the found block.
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                 New GEOM_Object, containing the found block.
11749             """
11750             # Example: see GEOM_TestOthers.py
11751             anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11752             RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11753             self._autoPublish(anObj, theName, "block")
11754             return anObj
11755
11756         ## Return all blocks, containing all the elements, passed as the parts.
11757         #  @param theCompound Compound, to find blocks in.
11758         #  @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11759         #  @param theName Object name; when specified, this parameter is used
11760         #         for result publication in the study. Otherwise, if automatic
11761         #         publication is switched on, default value is used for result name.
11762         #
11763         #  @return List of GEOM.GEOM_Object, containing the found blocks.
11764         #
11765         #  @ref swig_todo "Example"
11766         @ManageTransactions("BlocksOp")
11767         def GetBlocksByParts(self, theCompound, theParts, theName=None):
11768             """
11769             Return all blocks, containing all the elements, passed as the parts.
11770
11771             Parameters:
11772                 theCompound Compound, to find blocks in.
11773                 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11774                 theName Object name; when specified, this parameter is used
11775                         for result publication in the study. Otherwise, if automatic
11776                         publication is switched on, default value is used for result name.
11777
11778             Returns:
11779                 List of GEOM.GEOM_Object, containing the found blocks.
11780             """
11781             # Example: see GEOM_Spanner.py
11782             aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11783             RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11784             self._autoPublish(aList, theName, "block")
11785             return aList
11786
11787         ## Multi-transformate block and glue the result.
11788         #  Transformation is defined so, as to superpose direction faces.
11789         #  @param Block Hexahedral solid to be multi-transformed.
11790         #  @param DirFace1 ID of First direction face.
11791         #  @param DirFace2 ID of Second direction face.
11792         #  @param NbTimes Quantity of transformations to be done.
11793         #  @param theName Object name; when specified, this parameter is used
11794         #         for result publication in the study. Otherwise, if automatic
11795         #         publication is switched on, default value is used for result name.
11796         #
11797         #  @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11798         #
11799         #  @return New GEOM.GEOM_Object, containing the result shape.
11800         #
11801         #  @ref tui_multi_transformation "Example"
11802         @ManageTransactions("BlocksOp")
11803         def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11804             """
11805             Multi-transformate block and glue the result.
11806             Transformation is defined so, as to superpose direction faces.
11807
11808             Parameters:
11809                 Block Hexahedral solid to be multi-transformed.
11810                 DirFace1 ID of First direction face.
11811                 DirFace2 ID of Second direction face.
11812                 NbTimes Quantity of transformations to be done.
11813                 theName Object name; when specified, this parameter is used
11814                         for result publication in the study. Otherwise, if automatic
11815                         publication is switched on, default value is used for result name.
11816
11817             Note:
11818                 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11819
11820             Returns:
11821                 New GEOM.GEOM_Object, containing the result shape.
11822             """
11823             # Example: see GEOM_Spanner.py
11824             DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11825             anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11826             RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11827             anObj.SetParameters(Parameters)
11828             self._autoPublish(anObj, theName, "transformed")
11829             return anObj
11830
11831         ## Multi-transformate block and glue the result.
11832         #  @param Block Hexahedral solid to be multi-transformed.
11833         #  @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11834         #  @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11835         #  @param NbTimesU,NbTimesV Quantity of transformations to be done.
11836         #  @param theName Object name; when specified, this parameter is used
11837         #         for result publication in the study. Otherwise, if automatic
11838         #         publication is switched on, default value is used for result name.
11839         #
11840         #  @return New GEOM.GEOM_Object, containing the result shape.
11841         #
11842         #  @ref tui_multi_transformation "Example"
11843         @ManageTransactions("BlocksOp")
11844         def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11845                                       DirFace1V, DirFace2V, NbTimesV, theName=None):
11846             """
11847             Multi-transformate block and glue the result.
11848
11849             Parameters:
11850                 Block Hexahedral solid to be multi-transformed.
11851                 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11852                 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11853                 NbTimesU,NbTimesV Quantity of transformations to be done.
11854                 theName Object name; when specified, this parameter is used
11855                         for result publication in the study. Otherwise, if automatic
11856                         publication is switched on, default value is used for result name.
11857
11858             Returns:
11859                 New GEOM.GEOM_Object, containing the result shape.
11860             """
11861             # Example: see GEOM_Spanner.py
11862             DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11863               DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11864             anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11865                                                             DirFace1V, DirFace2V, NbTimesV)
11866             RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11867             anObj.SetParameters(Parameters)
11868             self._autoPublish(anObj, theName, "transformed")
11869             return anObj
11870
11871         ## Build all possible propagation groups.
11872         #  Propagation group is a set of all edges, opposite to one (main)
11873         #  edge of this group directly or through other opposite edges.
11874         #  Notion of Opposite Edge make sence only on quadrangle face.
11875         #  @param theShape Shape to build propagation groups on.
11876         #  @param theName Object name; when specified, this parameter is used
11877         #         for result publication in the study. Otherwise, if automatic
11878         #         publication is switched on, default value is used for result name.
11879         #
11880         #  @return List of GEOM.GEOM_Object, each of them is a propagation group.
11881         #
11882         #  @ref swig_Propagate "Example"
11883         @ManageTransactions("BlocksOp")
11884         def Propagate(self, theShape, theName=None):
11885             """
11886             Build all possible propagation groups.
11887             Propagation group is a set of all edges, opposite to one (main)
11888             edge of this group directly or through other opposite edges.
11889             Notion of Opposite Edge make sence only on quadrangle face.
11890
11891             Parameters:
11892                 theShape Shape to build propagation groups on.
11893                 theName Object name; when specified, this parameter is used
11894                         for result publication in the study. Otherwise, if automatic
11895                         publication is switched on, default value is used for result name.
11896
11897             Returns:
11898                 List of GEOM.GEOM_Object, each of them is a propagation group.
11899             """
11900             # Example: see GEOM_TestOthers.py
11901             listChains = self.BlocksOp.Propagate(theShape)
11902             RaiseIfFailed("Propagate", self.BlocksOp)
11903             self._autoPublish(listChains, theName, "propagate")
11904             return listChains
11905
11906         # end of l3_blocks_op
11907         ## @}
11908
11909         ## @addtogroup l3_groups
11910         ## @{
11911
11912         ## Creates a new group which will store sub-shapes of theMainShape
11913         #  @param theMainShape is a GEOM object on which the group is selected
11914         #  @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11915         #  @param theName Object name; when specified, this parameter is used
11916         #         for result publication in the study. Otherwise, if automatic
11917         #         publication is switched on, default value is used for result name.
11918         #
11919         #  @return a newly created GEOM group (GEOM.GEOM_Object)
11920         #
11921         #  @ref tui_working_with_groups_page "Example 1"
11922         #  \n @ref swig_CreateGroup "Example 2"
11923         @ManageTransactions("GroupOp")
11924         def CreateGroup(self, theMainShape, theShapeType, theName=None):
11925             """
11926             Creates a new group which will store sub-shapes of theMainShape
11927
11928             Parameters:
11929                theMainShape is a GEOM object on which the group is selected
11930                theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11931                             "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11932                 theName Object name; when specified, this parameter is used
11933                         for result publication in the study. Otherwise, if automatic
11934                         publication is switched on, default value is used for result name.
11935
11936             Returns:
11937                a newly created GEOM group
11938
11939             Example of usage:
11940                 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11941
11942             """
11943             # Example: see GEOM_TestOthers.py
11944             anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11945             RaiseIfFailed("CreateGroup", self.GroupOp)
11946             self._autoPublish(anObj, theName, "group")
11947             return anObj
11948
11949         ## Adds a sub-object with ID theSubShapeId to the group
11950         #  @param theGroup is a GEOM group to which the new sub-shape is added
11951         #  @param theSubShapeID is a sub-shape ID in the main object.
11952         #  \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11953         #
11954         #  @ref tui_working_with_groups_page "Example"
11955         @ManageTransactions("GroupOp")
11956         def AddObject(self,theGroup, theSubShapeID):
11957             """
11958             Adds a sub-object with ID theSubShapeId to the group
11959
11960             Parameters:
11961                 theGroup       is a GEOM group to which the new sub-shape is added
11962                 theSubShapeID  is a sub-shape ID in the main object.
11963
11964             Note:
11965                 Use method GetSubShapeID() to get an unique ID of the sub-shape
11966             """
11967             # Example: see GEOM_TestOthers.py
11968             self.GroupOp.AddObject(theGroup, theSubShapeID)
11969             if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11970                 RaiseIfFailed("AddObject", self.GroupOp)
11971                 pass
11972             pass
11973
11974         ## Removes a sub-object with ID \a theSubShapeId from the group
11975         #  @param theGroup is a GEOM group from which the new sub-shape is removed
11976         #  @param theSubShapeID is a sub-shape ID in the main object.
11977         #  \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11978         #
11979         #  @ref tui_working_with_groups_page "Example"
11980         @ManageTransactions("GroupOp")
11981         def RemoveObject(self,theGroup, theSubShapeID):
11982             """
11983             Removes a sub-object with ID theSubShapeId from the group
11984
11985             Parameters:
11986                 theGroup is a GEOM group from which the new sub-shape is removed
11987                 theSubShapeID is a sub-shape ID in the main object.
11988
11989             Note:
11990                 Use method GetSubShapeID() to get an unique ID of the sub-shape
11991             """
11992             # Example: see GEOM_TestOthers.py
11993             self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11994             RaiseIfFailed("RemoveObject", self.GroupOp)
11995             pass
11996
11997         ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11998         #  @param theGroup is a GEOM group to which the new sub-shapes are added.
11999         #  @param theSubShapes is a list of sub-shapes to be added.
12000         #
12001         #  @ref tui_working_with_groups_page "Example"
12002         @ManageTransactions("GroupOp")
12003         def UnionList (self,theGroup, theSubShapes):
12004             """
12005             Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12006
12007             Parameters:
12008                 theGroup is a GEOM group to which the new sub-shapes are added.
12009                 theSubShapes is a list of sub-shapes to be added.
12010             """
12011             # Example: see GEOM_TestOthers.py
12012             self.GroupOp.UnionList(theGroup, theSubShapes)
12013             RaiseIfFailed("UnionList", self.GroupOp)
12014             pass
12015
12016         ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12017         #  @param theGroup is a GEOM group to which the new sub-shapes are added.
12018         #  @param theSubShapes is a list of indices of sub-shapes to be added.
12019         #
12020         #  @ref swig_UnionIDs "Example"
12021         @ManageTransactions("GroupOp")
12022         def UnionIDs(self,theGroup, theSubShapes):
12023             """
12024             Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12025
12026             Parameters:
12027                 theGroup is a GEOM group to which the new sub-shapes are added.
12028                 theSubShapes is a list of indices of sub-shapes to be added.
12029             """
12030             # Example: see GEOM_TestOthers.py
12031             self.GroupOp.UnionIDs(theGroup, theSubShapes)
12032             RaiseIfFailed("UnionIDs", self.GroupOp)
12033             pass
12034
12035         ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12036         #  @param theGroup is a GEOM group from which the sub-shapes are removed.
12037         #  @param theSubShapes is a list of sub-shapes to be removed.
12038         #
12039         #  @ref tui_working_with_groups_page "Example"
12040         @ManageTransactions("GroupOp")
12041         def DifferenceList (self,theGroup, theSubShapes):
12042             """
12043             Removes from the group all the given shapes. No errors, if some shapes are not included.
12044
12045             Parameters:
12046                 theGroup is a GEOM group from which the sub-shapes are removed.
12047                 theSubShapes is a list of sub-shapes to be removed.
12048             """
12049             # Example: see GEOM_TestOthers.py
12050             self.GroupOp.DifferenceList(theGroup, theSubShapes)
12051             RaiseIfFailed("DifferenceList", self.GroupOp)
12052             pass
12053
12054         ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12055         #  @param theGroup is a GEOM group from which the sub-shapes are removed.
12056         #  @param theSubShapes is a list of indices of sub-shapes to be removed.
12057         #
12058         #  @ref swig_DifferenceIDs "Example"
12059         @ManageTransactions("GroupOp")
12060         def DifferenceIDs(self,theGroup, theSubShapes):
12061             """
12062             Removes from the group all the given shapes. No errors, if some shapes are not included.
12063
12064             Parameters:
12065                 theGroup is a GEOM group from which the sub-shapes are removed.
12066                 theSubShapes is a list of indices of sub-shapes to be removed.
12067             """
12068             # Example: see GEOM_TestOthers.py
12069             self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
12070             RaiseIfFailed("DifferenceIDs", self.GroupOp)
12071             pass
12072
12073         ## Union of two groups.
12074         #  New group is created. It will contain all entities
12075         #  which are present in groups theGroup1 and theGroup2.
12076         #  @param theGroup1, theGroup2 are the initial GEOM groups
12077         #                              to create the united group from.
12078         #  @param theName Object name; when specified, this parameter is used
12079         #         for result publication in the study. Otherwise, if automatic
12080         #         publication is switched on, default value is used for result name.
12081         #
12082         #  @return a newly created GEOM group.
12083         #
12084         #  @ref tui_union_groups_anchor "Example"
12085         @ManageTransactions("GroupOp")
12086         def UnionGroups (self, theGroup1, theGroup2, theName=None):
12087             """
12088             Union of two groups.
12089             New group is created. It will contain all entities
12090             which are present in groups theGroup1 and theGroup2.
12091
12092             Parameters:
12093                 theGroup1, theGroup2 are the initial GEOM groups
12094                                      to create the united group from.
12095                 theName Object name; when specified, this parameter is used
12096                         for result publication in the study. Otherwise, if automatic
12097                         publication is switched on, default value is used for result name.
12098
12099             Returns:
12100                 a newly created GEOM group.
12101             """
12102             # Example: see GEOM_TestOthers.py
12103             aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12104             RaiseIfFailed("UnionGroups", self.GroupOp)
12105             self._autoPublish(aGroup, theName, "group")
12106             return aGroup
12107
12108         ## Intersection of two groups.
12109         #  New group is created. It will contain only those entities
12110         #  which are present in both groups theGroup1 and theGroup2.
12111         #  @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12112         #  @param theName Object name; when specified, this parameter is used
12113         #         for result publication in the study. Otherwise, if automatic
12114         #         publication is switched on, default value is used for result name.
12115         #
12116         #  @return a newly created GEOM group.
12117         #
12118         #  @ref tui_intersect_groups_anchor "Example"
12119         @ManageTransactions("GroupOp")
12120         def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12121             """
12122             Intersection of two groups.
12123             New group is created. It will contain only those entities
12124             which are present in both groups theGroup1 and theGroup2.
12125
12126             Parameters:
12127                 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12128                 theName Object name; when specified, this parameter is used
12129                         for result publication in the study. Otherwise, if automatic
12130                         publication is switched on, default value is used for result name.
12131
12132             Returns:
12133                 a newly created GEOM group.
12134             """
12135             # Example: see GEOM_TestOthers.py
12136             aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12137             RaiseIfFailed("IntersectGroups", self.GroupOp)
12138             self._autoPublish(aGroup, theName, "group")
12139             return aGroup
12140
12141         ## Cut of two groups.
12142         #  New group is created. It will contain entities which are
12143         #  present in group theGroup1 but are not present in group theGroup2.
12144         #  @param theGroup1 is a GEOM group to include elements of.
12145         #  @param theGroup2 is a GEOM group to exclude elements of.
12146         #  @param theName Object name; when specified, this parameter is used
12147         #         for result publication in the study. Otherwise, if automatic
12148         #         publication is switched on, default value is used for result name.
12149         #
12150         #  @return a newly created GEOM group.
12151         #
12152         #  @ref tui_cut_groups_anchor "Example"
12153         @ManageTransactions("GroupOp")
12154         def CutGroups (self, theGroup1, theGroup2, theName=None):
12155             """
12156             Cut of two groups.
12157             New group is created. It will contain entities which are
12158             present in group theGroup1 but are not present in group theGroup2.
12159
12160             Parameters:
12161                 theGroup1 is a GEOM group to include elements of.
12162                 theGroup2 is a GEOM group to exclude elements of.
12163                 theName Object name; when specified, this parameter is used
12164                         for result publication in the study. Otherwise, if automatic
12165                         publication is switched on, default value is used for result name.
12166
12167             Returns:
12168                 a newly created GEOM group.
12169             """
12170             # Example: see GEOM_TestOthers.py
12171             aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12172             RaiseIfFailed("CutGroups", self.GroupOp)
12173             self._autoPublish(aGroup, theName, "group")
12174             return aGroup
12175
12176         ## Union of list of groups.
12177         #  New group is created. It will contain all entities that are
12178         #  present in groups listed in theGList.
12179         #  @param theGList is a list of GEOM groups to create the united group from.
12180         #  @param theName Object name; when specified, this parameter is used
12181         #         for result publication in the study. Otherwise, if automatic
12182         #         publication is switched on, default value is used for result name.
12183         #
12184         #  @return a newly created GEOM group.
12185         #
12186         #  @ref tui_union_groups_anchor "Example"
12187         @ManageTransactions("GroupOp")
12188         def UnionListOfGroups (self, theGList, theName=None):
12189             """
12190             Union of list of groups.
12191             New group is created. It will contain all entities that are
12192             present in groups listed in theGList.
12193
12194             Parameters:
12195                 theGList is a list of GEOM groups to create the united group from.
12196                 theName Object name; when specified, this parameter is used
12197                         for result publication in the study. Otherwise, if automatic
12198                         publication is switched on, default value is used for result name.
12199
12200             Returns:
12201                 a newly created GEOM group.
12202             """
12203             # Example: see GEOM_TestOthers.py
12204             aGroup = self.GroupOp.UnionListOfGroups(theGList)
12205             RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12206             self._autoPublish(aGroup, theName, "group")
12207             return aGroup
12208
12209         ## Cut of lists of groups.
12210         #  New group is created. It will contain only entities
12211         #  which are present in groups listed in theGList.
12212         #  @param theGList is a list of GEOM groups to include elements of.
12213         #  @param theName Object name; when specified, this parameter is used
12214         #         for result publication in the study. Otherwise, if automatic
12215         #         publication is switched on, default value is used for result name.
12216         #
12217         #  @return a newly created GEOM group.
12218         #
12219         #  @ref tui_intersect_groups_anchor "Example"
12220         @ManageTransactions("GroupOp")
12221         def IntersectListOfGroups (self, theGList, theName=None):
12222             """
12223             Cut of lists of groups.
12224             New group is created. It will contain only entities
12225             which are present in groups listed in theGList.
12226
12227             Parameters:
12228                 theGList is a list of GEOM groups to include elements of.
12229                 theName Object name; when specified, this parameter is used
12230                         for result publication in the study. Otherwise, if automatic
12231                         publication is switched on, default value is used for result name.
12232
12233             Returns:
12234                 a newly created GEOM group.
12235             """
12236             # Example: see GEOM_TestOthers.py
12237             aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12238             RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12239             self._autoPublish(aGroup, theName, "group")
12240             return aGroup
12241
12242         ## Cut of lists of groups.
12243         #  New group is created. It will contain only entities
12244         #  which are present in groups listed in theGList1 but
12245         #  are not present in groups from theGList2.
12246         #  @param theGList1 is a list of GEOM groups to include elements of.
12247         #  @param theGList2 is a list of GEOM groups to exclude elements of.
12248         #  @param theName Object name; when specified, this parameter is used
12249         #         for result publication in the study. Otherwise, if automatic
12250         #         publication is switched on, default value is used for result name.
12251         #
12252         #  @return a newly created GEOM group.
12253         #
12254         #  @ref tui_cut_groups_anchor "Example"
12255         @ManageTransactions("GroupOp")
12256         def CutListOfGroups (self, theGList1, theGList2, theName=None):
12257             """
12258             Cut of lists of groups.
12259             New group is created. It will contain only entities
12260             which are present in groups listed in theGList1 but
12261             are not present in groups from theGList2.
12262
12263             Parameters:
12264                 theGList1 is a list of GEOM groups to include elements of.
12265                 theGList2 is a list of GEOM groups to exclude elements of.
12266                 theName Object name; when specified, this parameter is used
12267                         for result publication in the study. Otherwise, if automatic
12268                         publication is switched on, default value is used for result name.
12269
12270             Returns:
12271                 a newly created GEOM group.
12272             """
12273             # Example: see GEOM_TestOthers.py
12274             aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12275             RaiseIfFailed("CutListOfGroups", self.GroupOp)
12276             self._autoPublish(aGroup, theName, "group")
12277             return aGroup
12278
12279         ## Returns a list of sub-objects ID stored in the group
12280         #  @param theGroup is a GEOM group for which a list of IDs is requested
12281         #
12282         #  @ref swig_GetObjectIDs "Example"
12283         @ManageTransactions("GroupOp")
12284         def GetObjectIDs(self,theGroup):
12285             """
12286             Returns a list of sub-objects ID stored in the group
12287
12288             Parameters:
12289                 theGroup is a GEOM group for which a list of IDs is requested
12290             """
12291             # Example: see GEOM_TestOthers.py
12292             ListIDs = self.GroupOp.GetObjects(theGroup)
12293             RaiseIfFailed("GetObjects", self.GroupOp)
12294             return ListIDs
12295
12296         ## Returns a type of sub-objects stored in the group
12297         #  @param theGroup is a GEOM group which type is returned.
12298         #
12299         #  @ref swig_GetType "Example"
12300         @ManageTransactions("GroupOp")
12301         def GetType(self,theGroup):
12302             """
12303             Returns a type of sub-objects stored in the group
12304
12305             Parameters:
12306                 theGroup is a GEOM group which type is returned.
12307             """
12308             # Example: see GEOM_TestOthers.py
12309             aType = self.GroupOp.GetType(theGroup)
12310             RaiseIfFailed("GetType", self.GroupOp)
12311             return aType
12312
12313         ## Convert a type of geom object from id to string value
12314         #  @param theId is a GEOM obect type id.
12315         #  @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12316         #  @ref swig_GetType "Example"
12317         def ShapeIdToType(self, theId):
12318             """
12319             Convert a type of geom object from id to string value
12320
12321             Parameters:
12322                 theId is a GEOM obect type id.
12323
12324             Returns:
12325                 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12326             """
12327             if theId == 0:
12328                 return "COPY"
12329             if theId == 1:
12330                 return "IMPORT"
12331             if theId == 2:
12332                 return "POINT"
12333             if theId == 3:
12334                 return "VECTOR"
12335             if theId == 4:
12336                 return "PLANE"
12337             if theId == 5:
12338                 return "LINE"
12339             if theId == 6:
12340                 return "TORUS"
12341             if theId == 7:
12342                 return "BOX"
12343             if theId == 8:
12344                 return "CYLINDER"
12345             if theId == 9:
12346                 return "CONE"
12347             if theId == 10:
12348                 return "SPHERE"
12349             if theId == 11:
12350                 return "PRISM"
12351             if theId == 12:
12352                 return "REVOLUTION"
12353             if theId == 13:
12354                 return "BOOLEAN"
12355             if theId == 14:
12356                 return "PARTITION"
12357             if theId == 15:
12358                 return "POLYLINE"
12359             if theId == 16:
12360                 return "CIRCLE"
12361             if theId == 17:
12362                 return "SPLINE"
12363             if theId == 18:
12364                 return "ELLIPSE"
12365             if theId == 19:
12366                 return "CIRC_ARC"
12367             if theId == 20:
12368                 return "FILLET"
12369             if theId == 21:
12370                 return "CHAMFER"
12371             if theId == 22:
12372                 return "EDGE"
12373             if theId == 23:
12374                 return "WIRE"
12375             if theId == 24:
12376                 return "FACE"
12377             if theId == 25:
12378                 return "SHELL"
12379             if theId == 26:
12380                 return "SOLID"
12381             if theId == 27:
12382                 return "COMPOUND"
12383             if theId == 28:
12384                 return "SUBSHAPE"
12385             if theId == 29:
12386                 return "PIPE"
12387             if theId == 30:
12388                 return "ARCHIMEDE"
12389             if theId == 31:
12390                 return "FILLING"
12391             if theId == 32:
12392                 return "EXPLODE"
12393             if theId == 33:
12394                 return "GLUED"
12395             if theId == 34:
12396                 return "SKETCHER"
12397             if theId == 35:
12398                 return "CDG"
12399             if theId == 36:
12400                 return "FREE_BOUNDS"
12401             if theId == 37:
12402                 return "GROUP"
12403             if theId == 38:
12404                 return "BLOCK"
12405             if theId == 39:
12406                 return "MARKER"
12407             if theId == 40:
12408                 return "THRUSECTIONS"
12409             if theId == 41:
12410                 return "COMPOUNDFILTER"
12411             if theId == 42:
12412                 return "SHAPES_ON_SHAPE"
12413             if theId == 43:
12414                 return "ELLIPSE_ARC"
12415             if theId == 44:
12416                 return "3DSKETCHER"
12417             if theId == 45:
12418                 return "FILLET_2D"
12419             if theId == 46:
12420                 return "FILLET_1D"
12421             if theId == 201:
12422                 return "PIPETSHAPE"
12423             return "Shape Id not exist."
12424
12425         ## Returns a main shape associated with the group
12426         #  @param theGroup is a GEOM group for which a main shape object is requested
12427         #  @return a GEOM object which is a main shape for theGroup
12428         #
12429         #  @ref swig_GetMainShape "Example"
12430         @ManageTransactions("GroupOp")
12431         def GetMainShape(self,theGroup):
12432             """
12433             Returns a main shape associated with the group
12434
12435             Parameters:
12436                 theGroup is a GEOM group for which a main shape object is requested
12437
12438             Returns:
12439                 a GEOM object which is a main shape for theGroup
12440
12441             Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12442             """
12443             # Example: see GEOM_TestOthers.py
12444             anObj = self.GroupOp.GetMainShape(theGroup)
12445             RaiseIfFailed("GetMainShape", self.GroupOp)
12446             return anObj
12447
12448         ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12449         #  If include_min/max == 0, edges with length == min/max_length will not be included in result.
12450         #  @param theShape given shape (see GEOM.GEOM_Object)
12451         #  @param min_length minimum length of edges of theShape
12452         #  @param max_length maximum length of edges of theShape
12453         #  @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12454         #  @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12455         #  @param theName Object name; when specified, this parameter is used
12456         #         for result publication in the study. Otherwise, if automatic
12457         #         publication is switched on, default value is used for result name.
12458         #
12459         #  @return a newly created GEOM group of edges
12460         #
12461         #  @@ref swig_todo "Example"
12462         def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12463             """
12464             Create group of edges of theShape, whose length is in range [min_length, max_length].
12465             If include_min/max == 0, edges with length == min/max_length will not be included in result.
12466
12467             Parameters:
12468                 theShape given shape
12469                 min_length minimum length of edges of theShape
12470                 max_length maximum length of edges of theShape
12471                 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12472                 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12473                 theName Object name; when specified, this parameter is used
12474                         for result publication in the study. Otherwise, if automatic
12475                         publication is switched on, default value is used for result name.
12476
12477              Returns:
12478                 a newly created GEOM group of edges.
12479             """
12480             edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12481             edges_in_range = []
12482             for edge in edges:
12483                 Props = self.BasicProperties(edge)
12484                 if min_length <= Props[0] and Props[0] <= max_length:
12485                     if (not include_min) and (min_length == Props[0]):
12486                         skip = 1
12487                     else:
12488                         if (not include_max) and (Props[0] == max_length):
12489                             skip = 1
12490                         else:
12491                             edges_in_range.append(edge)
12492
12493             if len(edges_in_range) <= 0:
12494                 print "No edges found by given criteria"
12495                 return None
12496
12497             # note: auto-publishing is done in self.CreateGroup()
12498             group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12499             self.UnionList(group_edges, edges_in_range)
12500
12501             return group_edges
12502
12503         ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12504         #  If include_min/max == 0, edges with length == min/max_length will not be included in result.
12505         #  @param min_length minimum length of edges of selected shape
12506         #  @param max_length maximum length of edges of selected shape
12507         #  @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12508         #  @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12509         #  @return a newly created GEOM group of edges
12510         #  @ref swig_todo "Example"
12511         def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12512             """
12513             Create group of edges of selected shape, whose length is in range [min_length, max_length].
12514             If include_min/max == 0, edges with length == min/max_length will not be included in result.
12515
12516             Parameters:
12517                 min_length minimum length of edges of selected shape
12518                 max_length maximum length of edges of selected shape
12519                 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12520                 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12521
12522              Returns:
12523                 a newly created GEOM group of edges.
12524             """
12525             nb_selected = sg.SelectedCount()
12526             if nb_selected < 1:
12527                 print "Select a shape before calling this function, please."
12528                 return 0
12529             if nb_selected > 1:
12530                 print "Only one shape must be selected"
12531                 return 0
12532
12533             id_shape = sg.getSelected(0)
12534             shape = IDToObject( id_shape )
12535
12536             group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12537
12538             left_str  = " < "
12539             right_str = " < "
12540             if include_min: left_str  = " <= "
12541             if include_max: right_str  = " <= "
12542
12543             self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12544                                     + left_str + "length" + right_str + `max_length`)
12545
12546             sg.updateObjBrowser(1)
12547
12548             return group_edges
12549
12550         # end of l3_groups
12551         ## @}
12552
12553         ## @addtogroup l4_advanced
12554         ## @{
12555
12556         ## Create a T-shape object with specified caracteristics for the main
12557         #  and the incident pipes (radius, width, half-length).
12558         #  The extremities of the main pipe are located on junctions points P1 and P2.
12559         #  The extremity of the incident pipe is located on junction point P3.
12560         #  If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12561         #  the main plane of the T-shape is XOY.
12562         #
12563         #  @param theR1 Internal radius of main pipe
12564         #  @param theW1 Width of main pipe
12565         #  @param theL1 Half-length of main pipe
12566         #  @param theR2 Internal radius of incident pipe (R2 < R1)
12567         #  @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12568         #  @param theL2 Half-length of incident pipe
12569         #
12570         #  @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12571         #  @param theP1 1st junction point of main pipe
12572         #  @param theP2 2nd junction point of main pipe
12573         #  @param theP3 Junction point of incident pipe
12574         #
12575         #  @param theRL Internal radius of left thickness reduction
12576         #  @param theWL Width of left thickness reduction
12577         #  @param theLtransL Length of left transition part
12578         #  @param theLthinL Length of left thin part
12579         #
12580         #  @param theRR Internal radius of right thickness reduction
12581         #  @param theWR Width of right thickness reduction
12582         #  @param theLtransR Length of right transition part
12583         #  @param theLthinR Length of right thin part
12584         #
12585         #  @param theRI Internal radius of incident thickness reduction
12586         #  @param theWI Width of incident thickness reduction
12587         #  @param theLtransI Length of incident transition part
12588         #  @param theLthinI Length of incident thin part
12589         #
12590         #  @param theName Object name; when specified, this parameter is used
12591         #         for result publication in the study. Otherwise, if automatic
12592         #         publication is switched on, default value is used for result name.
12593         #
12594         #  @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12595         #
12596         #  @ref tui_creation_pipetshape "Example"
12597         @ManageTransactions("AdvOp")
12598         def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
12599                             theHexMesh=True, theP1=None, theP2=None, theP3=None,
12600                             theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12601                             theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12602                             theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12603                             theName=None):
12604             """
12605             Create a T-shape object with specified caracteristics for the main
12606             and the incident pipes (radius, width, half-length).
12607             The extremities of the main pipe are located on junctions points P1 and P2.
12608             The extremity of the incident pipe is located on junction point P3.
12609             If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12610             the main plane of the T-shape is XOY.
12611
12612             Parameters:
12613                 theR1 Internal radius of main pipe
12614                 theW1 Width of main pipe
12615                 theL1 Half-length of main pipe
12616                 theR2 Internal radius of incident pipe (R2 < R1)
12617                 theW2 Width of incident pipe (R2+W2 < R1+W1)
12618                 theL2 Half-length of incident pipe
12619                 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12620                 theP1 1st junction point of main pipe
12621                 theP2 2nd junction point of main pipe
12622                 theP3 Junction point of incident pipe
12623
12624                 theRL Internal radius of left thickness reduction
12625                 theWL Width of left thickness reduction
12626                 theLtransL Length of left transition part
12627                 theLthinL Length of left thin part
12628
12629                 theRR Internal radius of right thickness reduction
12630                 theWR Width of right thickness reduction
12631                 theLtransR Length of right transition part
12632                 theLthinR Length of right thin part
12633
12634                 theRI Internal radius of incident thickness reduction
12635                 theWI Width of incident thickness reduction
12636                 theLtransI Length of incident transition part
12637                 theLthinI Length of incident thin part
12638
12639                 theName Object name; when specified, this parameter is used
12640                         for result publication in the study. Otherwise, if automatic
12641                         publication is switched on, default value is used for result name.
12642
12643             Returns:
12644                 List of GEOM_Object, containing the created shape and propagation groups.
12645
12646             Example of usage:
12647                 # create PipeTShape object
12648                 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
12649                 # create PipeTShape object with position
12650                 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
12651                 # create PipeTShape object with left thickness reduction
12652                 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
12653             """
12654             theR1, theW1, theL1, theR2, theW2, theL2, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI)
12655             if (theP1 and theP2 and theP3):
12656                 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12657                                                                 theRL, theWL, theLtransL, theLthinL,
12658                                                                 theRR, theWR, theLtransR, theLthinR,
12659                                                                 theRI, theWI, theLtransI, theLthinI,
12660                                                                 theHexMesh, theP1, theP2, theP3)
12661             else:
12662                 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
12663                                                     theRL, theWL, theLtransL, theLthinL,
12664                                                     theRR, theWR, theLtransR, theLthinR,
12665                                                     theRI, theWI, theLtransI, theLthinI,
12666                                                     theHexMesh)
12667             RaiseIfFailed("MakePipeTShape", self.AdvOp)
12668             if Parameters: anObj[0].SetParameters(Parameters)
12669             def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12670             self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12671             return anObj
12672
12673         ## Create a T-shape object with chamfer and with specified caracteristics for the main
12674         #  and the incident pipes (radius, width, half-length). The chamfer is
12675         #  created on the junction of the pipes.
12676         #  The extremities of the main pipe are located on junctions points P1 and P2.
12677         #  The extremity of the incident pipe is located on junction point P3.
12678         #  If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12679         #  the main plane of the T-shape is XOY.
12680         #  @param theR1 Internal radius of main pipe
12681         #  @param theW1 Width of main pipe
12682         #  @param theL1 Half-length of main pipe
12683         #  @param theR2 Internal radius of incident pipe (R2 < R1)
12684         #  @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12685         #  @param theL2 Half-length of incident pipe
12686         #  @param theH Height of the chamfer.
12687         #  @param theW Width of the chamfer.
12688         #  @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12689         #  @param theP1 1st junction point of main pipe
12690         #  @param theP2 2nd junction point of main pipe
12691         #  @param theP3 Junction point of incident pipe
12692         #
12693         #  @param theRL Internal radius of left thickness reduction
12694         #  @param theWL Width of left thickness reduction
12695         #  @param theLtransL Length of left transition part
12696         #  @param theLthinL Length of left thin part
12697         #
12698         #  @param theRR Internal radius of right thickness reduction
12699         #  @param theWR Width of right thickness reduction
12700         #  @param theLtransR Length of right transition part
12701         #  @param theLthinR Length of right thin part
12702         #
12703         #  @param theRI Internal radius of incident thickness reduction
12704         #  @param theWI Width of incident thickness reduction
12705         #  @param theLtransI Length of incident transition part
12706         #  @param theLthinI Length of incident thin part
12707         #
12708         #  @param theName Object name; when specified, this parameter is used
12709         #         for result publication in the study. Otherwise, if automatic
12710         #         publication is switched on, default value is used for result name.
12711         #
12712         #  @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12713         #
12714         #  @ref tui_creation_pipetshape "Example"
12715         @ManageTransactions("AdvOp")
12716         def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
12717                                    theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12718                                    theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12719                                    theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12720                                    theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12721                                    theName=None):
12722             """
12723             Create a T-shape object with chamfer and with specified caracteristics for the main
12724             and the incident pipes (radius, width, half-length). The chamfer is
12725             created on the junction of the pipes.
12726             The extremities of the main pipe are located on junctions points P1 and P2.
12727             The extremity of the incident pipe is located on junction point P3.
12728             If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12729             the main plane of the T-shape is XOY.
12730
12731             Parameters:
12732                 theR1 Internal radius of main pipe
12733                 theW1 Width of main pipe
12734                 theL1 Half-length of main pipe
12735                 theR2 Internal radius of incident pipe (R2 < R1)
12736                 theW2 Width of incident pipe (R2+W2 < R1+W1)
12737                 theL2 Half-length of incident pipe
12738                 theH Height of the chamfer.
12739                 theW Width of the chamfer.
12740                 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12741                 theP1 1st junction point of main pipe
12742                 theP2 2nd junction point of main pipe
12743                 theP3 Junction point of incident pipe
12744
12745                 theRL Internal radius of left thickness reduction
12746                 theWL Width of left thickness reduction
12747                 theLtransL Length of left transition part
12748                 theLthinL Length of left thin part
12749
12750                 theRR Internal radius of right thickness reduction
12751                 theWR Width of right thickness reduction
12752                 theLtransR Length of right transition part
12753                 theLthinR Length of right thin part
12754
12755                 theRI Internal radius of incident thickness reduction
12756                 theWI Width of incident thickness reduction
12757                 theLtransI Length of incident transition part
12758                 theLthinI Length of incident thin part
12759
12760                 theName Object name; when specified, this parameter is used
12761                         for result publication in the study. Otherwise, if automatic
12762                         publication is switched on, default value is used for result name.
12763
12764             Returns:
12765                 List of GEOM_Object, containing the created shape and propagation groups.
12766
12767             Example of usage:
12768                 # create PipeTShape with chamfer object
12769                 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
12770                 # create PipeTShape with chamfer object with position
12771                 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
12772                 # create PipeTShape with chamfer object with left thickness reduction
12773                 pipetshapechamfer_thr = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
12774             """
12775             theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI)
12776             if (theP1 and theP2 and theP3):
12777               anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12778                                                                      theRL, theWL, theLtransL, theLthinL,
12779                                                                      theRR, theWR, theLtransR, theLthinR,
12780                                                                      theRI, theWI, theLtransI, theLthinI,
12781                                                                      theH, theW, theHexMesh, theP1, theP2, theP3)
12782             else:
12783               anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
12784                                                          theRL, theWL, theLtransL, theLthinL,
12785                                                          theRR, theWR, theLtransR, theLthinR,
12786                                                          theRI, theWI, theLtransI, theLthinI,
12787                                                          theH, theW, theHexMesh)
12788             RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
12789             if Parameters: anObj[0].SetParameters(Parameters)
12790             def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12791             self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12792             return anObj
12793
12794         ## Create a T-shape object with fillet and with specified caracteristics for the main
12795         #  and the incident pipes (radius, width, half-length). The fillet is
12796         #  created on the junction of the pipes.
12797         #  The extremities of the main pipe are located on junctions points P1 and P2.
12798         #  The extremity of the incident pipe is located on junction point P3.
12799         #  If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12800         #  the main plane of the T-shape is XOY.
12801         #  @param theR1 Internal radius of main pipe
12802         #  @param theW1 Width of main pipe
12803         #  @param theL1 Half-length of main pipe
12804         #  @param theR2 Internal radius of incident pipe (R2 < R1)
12805         #  @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12806         #  @param theL2 Half-length of incident pipe
12807         #  @param theRF Radius of curvature of fillet.
12808         #  @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12809         #  @param theP1 1st junction point of main pipe
12810         #  @param theP2 2nd junction point of main pipe
12811         #  @param theP3 Junction point of incident pipe
12812         #
12813         #  @param theRL Internal radius of left thickness reduction
12814         #  @param theWL Width of left thickness reduction
12815         #  @param theLtransL Length of left transition part
12816         #  @param theLthinL Length of left thin part
12817         #
12818         #  @param theRR Internal radius of right thickness reduction
12819         #  @param theWR Width of right thickness reduction
12820         #  @param theLtransR Length of right transition part
12821         #  @param theLthinR Length of right thin part
12822         #
12823         #  @param theRI Internal radius of incident thickness reduction
12824         #  @param theWI Width of incident thickness reduction
12825         #  @param theLtransI Length of incident transition part
12826         #  @param theLthinI Length of incident thin part
12827         #
12828         #  @param theName Object name; when specified, this parameter is used
12829         #         for result publication in the study. Otherwise, if automatic
12830         #         publication is switched on, default value is used for result name.
12831         #
12832         #  @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12833         #
12834         #  @ref tui_creation_pipetshape "Example"
12835         @ManageTransactions("AdvOp")
12836         def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12837                                   theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12838                                   theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12839                                   theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12840                                   theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12841                                   theName=None):
12842             """
12843             Create a T-shape object with fillet and with specified caracteristics for the main
12844             and the incident pipes (radius, width, half-length). The fillet is
12845             created on the junction of the pipes.
12846             The extremities of the main pipe are located on junctions points P1 and P2.
12847             The extremity of the incident pipe is located on junction point P3.
12848
12849             Parameters:
12850                 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12851                 the main plane of the T-shape is XOY.
12852                 theR1 Internal radius of main pipe
12853                 theW1 Width of main pipe
12854                 heL1 Half-length of main pipe
12855                 theR2 Internal radius of incident pipe (R2 < R1)
12856                 theW2 Width of incident pipe (R2+W2 < R1+W1)
12857                 theL2 Half-length of incident pipe
12858                 theRF Radius of curvature of fillet.
12859                 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12860                 theP1 1st junction point of main pipe
12861                 theP2 2nd junction point of main pipe
12862                 theP3 Junction point of incident pipe
12863
12864                 theRL Internal radius of left thickness reduction
12865                 theWL Width of left thickness reduction
12866                 theLtransL Length of left transition part
12867                 theLthinL Length of left thin part
12868
12869                 theRR Internal radius of right thickness reduction
12870                 theWR Width of right thickness reduction
12871                 theLtransR Length of right transition part
12872                 theLthinR Length of right thin part
12873
12874                 theRI Internal radius of incident thickness reduction
12875                 theWI Width of incident thickness reduction
12876                 theLtransI Length of incident transition part
12877                 theLthinI Length of incident thin part
12878
12879                 theName Object name; when specified, this parameter is used
12880                         for result publication in the study. Otherwise, if automatic
12881                         publication is switched on, default value is used for result name.
12882
12883             Returns:
12884                 List of GEOM_Object, containing the created shape and propagation groups.
12885
12886             Example of usage:
12887                 # create PipeTShape with fillet object
12888                 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12889                 # create PipeTShape with fillet object with position
12890                 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12891                 # create PipeTShape with fillet object with left thickness reduction
12892                 pipetshapefillet_thr = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
12893             """
12894             theR1, theW1, theL1, theR2, theW2, theL2, theRF, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI)
12895             if (theP1 and theP2 and theP3):
12896               anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12897                                                                     theRL, theWL, theLtransL, theLthinL,
12898                                                                     theRR, theWR, theLtransR, theLthinR,
12899                                                                     theRI, theWI, theLtransI, theLthinI,
12900                                                                     theRF, theHexMesh, theP1, theP2, theP3)
12901             else:
12902               anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12903                                                         theRL, theWL, theLtransL, theLthinL,
12904                                                         theRR, theWR, theLtransR, theLthinR,
12905                                                         theRI, theWI, theLtransI, theLthinI,
12906                                                         theRF, theHexMesh)
12907             RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12908             if Parameters: anObj[0].SetParameters(Parameters)
12909             def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12910             self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12911             return anObj
12912
12913         ## This function allows creating a disk already divided into blocks. It
12914         #  can be used to create divided pipes for later meshing in hexaedra.
12915         #  @param theR Radius of the disk
12916         #  @param theOrientation Orientation of the plane on which the disk will be built
12917         #         1 = XOY, 2 = OYZ, 3 = OZX
12918         #  @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12919         #  @param theName Object name; when specified, this parameter is used
12920         #         for result publication in the study. Otherwise, if automatic
12921         #         publication is switched on, default value is used for result name.
12922         #
12923         #  @return New GEOM_Object, containing the created shape.
12924         #
12925         #  @ref tui_creation_divideddisk "Example"
12926         @ManageTransactions("AdvOp")
12927         def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12928             """
12929             Creates a disk, divided into blocks. It can be used to create divided pipes
12930             for later meshing in hexaedra.
12931
12932             Parameters:
12933                 theR Radius of the disk
12934                 theOrientation Orientation of the plane on which the disk will be built:
12935                                1 = XOY, 2 = OYZ, 3 = OZX
12936                 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12937                 theName Object name; when specified, this parameter is used
12938                         for result publication in the study. Otherwise, if automatic
12939                         publication is switched on, default value is used for result name.
12940
12941             Returns:
12942                 New GEOM_Object, containing the created shape.
12943             """
12944             theR, Parameters = ParseParameters(theR)
12945             anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12946             RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12947             if Parameters: anObj.SetParameters(Parameters)
12948             self._autoPublish(anObj, theName, "dividedDisk")
12949             return anObj
12950
12951         ## This function allows creating a disk already divided into blocks. It
12952         #  can be used to create divided pipes for later meshing in hexaedra.
12953         #  @param theCenter Center of the disk
12954         #  @param theVector Normal vector to the plane of the created disk
12955         #  @param theRadius Radius of the disk
12956         #  @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12957         #  @param theName Object name; when specified, this parameter is used
12958         #         for result publication in the study. Otherwise, if automatic
12959         #         publication is switched on, default value is used for result name.
12960         #
12961         #  @return New GEOM_Object, containing the created shape.
12962         #
12963         #  @ref tui_creation_divideddisk "Example"
12964         @ManageTransactions("AdvOp")
12965         def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12966             """
12967             Creates a disk already divided into blocks. It can be used to create divided pipes
12968             for later meshing in hexaedra.
12969
12970             Parameters:
12971                 theCenter Center of the disk
12972                 theVector Normal vector to the plane of the created disk
12973                 theRadius Radius of the disk
12974                 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12975                 theName Object name; when specified, this parameter is used
12976                         for result publication in the study. Otherwise, if automatic
12977                         publication is switched on, default value is used for result name.
12978
12979             Returns:
12980                 New GEOM_Object, containing the created shape.
12981             """
12982             theRadius, Parameters = ParseParameters(theRadius)
12983             anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12984             RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12985             if Parameters: anObj.SetParameters(Parameters)
12986             self._autoPublish(anObj, theName, "dividedDisk")
12987             return anObj
12988
12989         ## Builds a cylinder prepared for hexa meshes
12990         #  @param theR Radius of the cylinder
12991         #  @param theH Height of the cylinder
12992         #  @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12993         #  @param theName Object name; when specified, this parameter is used
12994         #         for result publication in the study. Otherwise, if automatic
12995         #         publication is switched on, default value is used for result name.
12996         #
12997         #  @return New GEOM_Object, containing the created shape.
12998         #
12999         #  @ref tui_creation_dividedcylinder "Example"
13000         @ManageTransactions("AdvOp")
13001         def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
13002             """
13003             Builds a cylinder prepared for hexa meshes
13004
13005             Parameters:
13006                 theR Radius of the cylinder
13007                 theH Height of the cylinder
13008                 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
13009                 theName Object name; when specified, this parameter is used
13010                         for result publication in the study. Otherwise, if automatic
13011                         publication is switched on, default value is used for result name.
13012
13013             Returns:
13014                 New GEOM_Object, containing the created shape.
13015             """
13016             theR, theH, Parameters = ParseParameters(theR, theH)
13017             anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
13018             RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
13019             if Parameters: anObj.SetParameters(Parameters)
13020             self._autoPublish(anObj, theName, "dividedCylinder")
13021             return anObj
13022
13023         ## Create a surface from a cloud of points
13024         #  @param thelPoints list of points. Compounds of points are
13025         #         accepted as well.
13026         #  @param theNbMax maximum number of Bezier pieces in the resulting
13027         #         surface.
13028         #  @param theDegMax maximum degree of the resulting BSpline surface.
13029         #  @param theDMax 3D tolerance of initial approximation.
13030         #  @param theName Object name; when specified, this parameter is used
13031         #         for result publication in the study. Otherwise, if automatic
13032         #         publication is switched on, default value is used for result name.
13033         #  @return New GEOM_Object, containing the created shape.
13034         #  @note 3D tolerance of initial approximation represents a tolerance of
13035         #        initial plate surface approximation. If this parameter is equal
13036         #        to 0 (default value) it is computed. In this case an error of
13037         #        initial plate surface computation is used as the approximation
13038         #        tolerance. This error represents a maximal distance between
13039         #        computed plate surface and given points.
13040         #
13041         #  @ref tui_creation_smoothingsurface "Example"
13042         @ManageTransactions("AdvOp")
13043         def MakeSmoothingSurface(self, thelPoints, theNbMax=2, theDegMax=8,
13044                                  theDMax=0.0, theName=None):
13045             """
13046             Create a surface from a cloud of points
13047
13048             Parameters:
13049                 thelPoints list of points. Compounds of points are
13050                            accepted as well.
13051                 theNbMax maximum number of Bezier pieces in the resulting
13052                          surface.
13053                 theDegMax maximum degree of the resulting BSpline surface.
13054                 theDMax 3D tolerance of initial approximation.
13055                 theName Object name; when specified, this parameter is used
13056                         for result publication in the study. Otherwise, if automatic
13057                         publication is switched on, default value is used for result name.
13058
13059             Returns:
13060                 New GEOM_Object, containing the created shape.
13061
13062             Note:
13063                 3D tolerance of initial approximation represents a tolerance of
13064                 initial plate surface approximation. If this parameter is equal
13065                 to 0 (default value) it is computed. In this case an error of
13066                 initial plate surface computation is used as the approximation
13067                 tolerance. This error represents a maximal distance between
13068                 computed plate surface and given points.
13069             """
13070             anObj = self.AdvOp.MakeSmoothingSurface(thelPoints, theNbMax,
13071                                                     theDegMax, theDMax)
13072             RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
13073             self._autoPublish(anObj, theName, "smoothing")
13074             return anObj
13075
13076         ## Export a shape to XAO format
13077         #  @param shape The shape to export
13078         #  @param groups The list of groups to export
13079         #  @param fields The list of fields to export
13080         #  @param author The author of the export
13081         #  @param fileName The name of the file to export
13082         #  @return boolean
13083         #
13084         #  @ref tui_exportxao "Example"
13085         @ManageTransactions("InsertOp")
13086         def ExportXAO(self, shape, groups, fields, author, fileName):
13087             res = self.InsertOp.ExportXAO(shape, groups, fields, author, fileName)
13088             RaiseIfFailed("ExportXAO", self.InsertOp)
13089             return res
13090
13091         ## Import a shape from XAO format
13092         #  @param shape Shape to export
13093         #  @param fileName The name of the file to import
13094         #  @return tuple (res, shape, subShapes, groups, fields)
13095         #       res Flag indicating if the import was successful
13096         #       shape The imported shape
13097         #       subShapes The list of imported subShapes
13098         #       groups The list of imported groups
13099         #       fields The list of imported fields
13100         #
13101         #  @ref tui_importxao "Example"
13102         @ManageTransactions("InsertOp")
13103         def ImportXAO(self, fileName):
13104             res = self.InsertOp.ImportXAO(fileName)
13105             RaiseIfFailed("ImportXAO", self.InsertOp)
13106             return res
13107
13108         #@@ insert new functions before this line @@ do not remove this line @@#
13109
13110         # end of l4_advanced
13111         ## @}
13112
13113         ## Create a copy of the given object
13114         #
13115         #  @param theOriginal geometry object for copy
13116         #  @param theName Object name; when specified, this parameter is used
13117         #         for result publication in the study. Otherwise, if automatic
13118         #         publication is switched on, default value is used for result name.
13119         #
13120         #  @return New GEOM_Object, containing the copied shape.
13121         #
13122         #  @ingroup l1_geomBuilder_auxiliary
13123         #  @ref swig_MakeCopy "Example"
13124         @ManageTransactions("InsertOp")
13125         def MakeCopy(self, theOriginal, theName=None):
13126             """
13127             Create a copy of the given object
13128
13129             Parameters:
13130                 theOriginal geometry object for copy
13131                 theName Object name; when specified, this parameter is used
13132                         for result publication in the study. Otherwise, if automatic
13133                         publication is switched on, default value is used for result name.
13134
13135             Returns:
13136                 New GEOM_Object, containing the copied shape.
13137
13138             Example of usage: Copy = geompy.MakeCopy(Box)
13139             """
13140             # Example: see GEOM_TestAll.py
13141             anObj = self.InsertOp.MakeCopy(theOriginal)
13142             RaiseIfFailed("MakeCopy", self.InsertOp)
13143             self._autoPublish(anObj, theName, "copy")
13144             return anObj
13145
13146         ## Add Path to load python scripts from
13147         #  @param Path a path to load python scripts from
13148         #  @ingroup l1_geomBuilder_auxiliary
13149         def addPath(self,Path):
13150             """
13151             Add Path to load python scripts from
13152
13153             Parameters:
13154                 Path a path to load python scripts from
13155             """
13156             if (sys.path.count(Path) < 1):
13157                 sys.path.append(Path)
13158                 pass
13159             pass
13160
13161         ## Load marker texture from the file
13162         #  @param Path a path to the texture file
13163         #  @return unique texture identifier
13164         #  @ingroup l1_geomBuilder_auxiliary
13165         @ManageTransactions("InsertOp")
13166         def LoadTexture(self, Path):
13167             """
13168             Load marker texture from the file
13169
13170             Parameters:
13171                 Path a path to the texture file
13172
13173             Returns:
13174                 unique texture identifier
13175             """
13176             # Example: see GEOM_TestAll.py
13177             ID = self.InsertOp.LoadTexture(Path)
13178             RaiseIfFailed("LoadTexture", self.InsertOp)
13179             return ID
13180
13181         ## Get internal name of the object based on its study entry
13182         #  @note This method does not provide an unique identifier of the geometry object.
13183         #  @note This is internal function of GEOM component, though it can be used outside it for
13184         #  appropriate reason (e.g. for identification of geometry object).
13185         #  @param obj geometry object
13186         #  @return unique object identifier
13187         #  @ingroup l1_geomBuilder_auxiliary
13188         def getObjectID(self, obj):
13189             """
13190             Get internal name of the object based on its study entry.
13191             Note: this method does not provide an unique identifier of the geometry object.
13192             It is an internal function of GEOM component, though it can be used outside GEOM for
13193             appropriate reason (e.g. for identification of geometry object).
13194
13195             Parameters:
13196                 obj geometry object
13197
13198             Returns:
13199                 unique object identifier
13200             """
13201             ID = ""
13202             entry = salome.ObjectToID(obj)
13203             if entry is not None:
13204                 lst = entry.split(":")
13205                 if len(lst) > 0:
13206                     ID = lst[-1] # -1 means last item in the list
13207                     return "GEOM_" + ID
13208             return ID
13209
13210
13211
13212         ## Add marker texture. @a Width and @a Height parameters
13213         #  specify width and height of the texture in pixels.
13214         #  If @a RowData is @c True, @a Texture parameter should represent texture data
13215         #  packed into the byte array. If @a RowData is @c False (default), @a Texture
13216         #  parameter should be unpacked string, in which '1' symbols represent opaque
13217         #  pixels and '0' represent transparent pixels of the texture bitmap.
13218         #
13219         #  @param Width texture width in pixels
13220         #  @param Height texture height in pixels
13221         #  @param Texture texture data
13222         #  @param RowData if @c True, @a Texture data are packed in the byte stream
13223         #  @return unique texture identifier
13224         #  @ingroup l1_geomBuilder_auxiliary
13225         @ManageTransactions("InsertOp")
13226         def AddTexture(self, Width, Height, Texture, RowData=False):
13227             """
13228             Add marker texture. Width and Height parameters
13229             specify width and height of the texture in pixels.
13230             If RowData is True, Texture parameter should represent texture data
13231             packed into the byte array. If RowData is False (default), Texture
13232             parameter should be unpacked string, in which '1' symbols represent opaque
13233             pixels and '0' represent transparent pixels of the texture bitmap.
13234
13235             Parameters:
13236                 Width texture width in pixels
13237                 Height texture height in pixels
13238                 Texture texture data
13239                 RowData if True, Texture data are packed in the byte stream
13240
13241             Returns:
13242                 return unique texture identifier
13243             """
13244             if not RowData: Texture = PackData(Texture)
13245             ID = self.InsertOp.AddTexture(Width, Height, Texture)
13246             RaiseIfFailed("AddTexture", self.InsertOp)
13247             return ID
13248
13249         ## Creates a new folder object. It is a container for any GEOM objects.
13250         #  @param Name name of the container
13251         #  @param Father parent object. If None,
13252         #         folder under 'Geometry' root object will be created.
13253         #  @return a new created folder
13254         #  @ingroup l1_publish_data
13255         def NewFolder(self, Name, Father=None):
13256             """
13257             Create a new folder object. It is an auxiliary container for any GEOM objects.
13258
13259             Parameters:
13260                 Name name of the container
13261                 Father parent object. If None,
13262                 folder under 'Geometry' root object will be created.
13263
13264             Returns:
13265                 a new created folder
13266             """
13267             if not Father: Father = self.father
13268             return self.CreateFolder(Name, Father)
13269
13270         ## Move object to the specified folder
13271         #  @param Object object to move
13272         #  @param Folder target folder
13273         #  @ingroup l1_publish_data
13274         def PutToFolder(self, Object, Folder):
13275             """
13276             Move object to the specified folder
13277
13278             Parameters:
13279                 Object object to move
13280                 Folder target folder
13281             """
13282             self.MoveToFolder(Object, Folder)
13283             pass
13284
13285         ## Move list of objects to the specified folder
13286         #  @param ListOfSO list of objects to move
13287         #  @param Folder target folder
13288         #  @ingroup l1_publish_data
13289         def PutListToFolder(self, ListOfSO, Folder):
13290             """
13291             Move list of objects to the specified folder
13292
13293             Parameters:
13294                 ListOfSO list of objects to move
13295                 Folder target folder
13296             """
13297             self.MoveListToFolder(ListOfSO, Folder)
13298             pass
13299
13300         ## @addtogroup l2_field
13301         ## @{
13302
13303         ## Creates a field
13304         #  @param shape the shape the field lies on
13305         #  @param name the field name
13306         #  @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13307         #  @param dimension dimension of the shape the field lies on
13308         #         0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13309         #  @param componentNames names of components
13310         #  @return a created field
13311         @ManageTransactions("FieldOp")
13312         def CreateField(self, shape, name, type, dimension, componentNames):
13313             """
13314             Creates a field
13315
13316             Parameters:
13317                 shape the shape the field lies on
13318                 name  the field name
13319                 type  type of field data
13320                 dimension dimension of the shape the field lies on
13321                           0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13322                 componentNames names of components
13323
13324             Returns:
13325                 a created field
13326             """
13327             if isinstance( type, int ):
13328                 if type < 0 or type > 3:
13329                     raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
13330                 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13331
13332             f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13333             RaiseIfFailed("CreateField", self.FieldOp)
13334             global geom
13335             geom._autoPublish( f, "", name)
13336             return f
13337
13338         ## Removes a field from the GEOM component
13339         #  @param field the field to remove
13340         def RemoveField(self, field):
13341             "Removes a field from the GEOM component"
13342             global geom
13343             if isinstance( field, GEOM._objref_GEOM_Field ):
13344                 geom.RemoveObject( field )
13345             elif isinstance( field, geomField ):
13346                 geom.RemoveObject( field.field )
13347             else:
13348                 raise RuntimeError, "RemoveField() : the object is not a field"
13349             return
13350
13351         ## Returns number of fields on a shape
13352         @ManageTransactions("FieldOp")
13353         def CountFields(self, shape):
13354             "Returns number of fields on a shape"
13355             nb = self.FieldOp.CountFields( shape )
13356             RaiseIfFailed("CountFields", self.FieldOp)
13357             return nb
13358
13359         ## Returns all fields on a shape
13360         @ManageTransactions("FieldOp")
13361         def GetFields(self, shape):
13362             "Returns all fields on a shape"
13363             ff = self.FieldOp.GetFields( shape )
13364             RaiseIfFailed("GetFields", self.FieldOp)
13365             return ff
13366
13367         ## Returns a field on a shape by its name
13368         @ManageTransactions("FieldOp")
13369         def GetField(self, shape, name):
13370             "Returns a field on a shape by its name"
13371             f = self.FieldOp.GetField( shape, name )
13372             RaiseIfFailed("GetField", self.FieldOp)
13373             return f
13374
13375         # end of l2_field
13376         ## @}
13377
13378
13379 import omniORB
13380 # Register the new proxy for GEOM_Gen
13381 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13382
13383
13384 ## Field on Geometry
13385 #  @ingroup l2_field
13386 class geomField( GEOM._objref_GEOM_Field ):
13387
13388     def __init__(self):
13389         GEOM._objref_GEOM_Field.__init__(self)
13390         self.field = GEOM._objref_GEOM_Field
13391         return
13392
13393     ## Returns the shape the field lies on
13394     def getShape(self):
13395         "Returns the shape the field lies on"
13396         return self.field.GetShape(self)
13397
13398     ## Returns the field name
13399     def getName(self):
13400         "Returns the field name"
13401         return self.field.GetName(self)
13402
13403     ## Returns type of field data as integer [0-3]
13404     def getType(self):
13405         "Returns type of field data"
13406         return self.field.GetDataType(self)._v
13407
13408     ## Returns type of field data:
13409     #  one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13410     def getTypeEnum(self):
13411         "Returns type of field data"
13412         return self.field.GetDataType(self)
13413
13414     ## Returns dimension of the shape the field lies on:
13415     #  0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13416     def getDimension(self):
13417         """Returns dimension of the shape the field lies on:
13418         0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13419         return self.field.GetDimension(self)
13420
13421     ## Returns names of components
13422     def getComponents(self):
13423         "Returns names of components"
13424         return self.field.GetComponents(self)
13425
13426     ## Adds a time step to the field
13427     #  @param step the time step number further used as the step identifier
13428     #  @param stamp the time step time
13429     #  @param values the values of the time step
13430     def addStep(self, step, stamp, values):
13431         "Adds a time step to the field"
13432         stp = self.field.AddStep( self, step, stamp )
13433         if not stp:
13434             raise RuntimeError, \
13435                   "Field.addStep() : Error: step %s already exists in this field"%step
13436         global geom
13437         geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13438         self.setValues( step, values )
13439         return stp
13440
13441     ## Remove a time step from the field
13442     def removeStep(self,step):
13443         "Remove a time step from the field"
13444         stepSO = None
13445         try:
13446             stepObj = self.field.GetStep( self, step )
13447             if stepObj:
13448                 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13449         except:
13450             #import traceback
13451             #traceback.print_exc()
13452             pass
13453         self.field.RemoveStep( self, step )
13454         if stepSO:
13455             geom.myBuilder.RemoveObjectWithChildren( stepSO )
13456         return
13457
13458     ## Returns number of time steps in the field
13459     def countSteps(self):
13460         "Returns number of time steps in the field"
13461         return self.field.CountSteps(self)
13462
13463     ## Returns a list of time step IDs in the field
13464     def getSteps(self):
13465         "Returns a list of time step IDs in the field"
13466         return self.field.GetSteps(self)
13467
13468     ## Returns a time step by its ID
13469     def getStep(self,step):
13470         "Returns a time step by its ID"
13471         stp = self.field.GetStep(self, step)
13472         if not stp:
13473             raise RuntimeError, "Step %s is missing from this field"%step
13474         return stp
13475
13476     ## Returns the time of the field step
13477     def getStamp(self,step):
13478         "Returns the time of the field step"
13479         return self.getStep(step).GetStamp()
13480
13481     ## Changes the time of the field step
13482     def setStamp(self, step, stamp):
13483         "Changes the time of the field step"
13484         return self.getStep(step).SetStamp(stamp)
13485
13486     ## Returns values of the field step
13487     def getValues(self, step):
13488         "Returns values of the field step"
13489         return self.getStep(step).GetValues()
13490
13491     ## Changes values of the field step
13492     def setValues(self, step, values):
13493         "Changes values of the field step"
13494         stp = self.getStep(step)
13495         errBeg = "Field.setValues(values) : Error: "
13496         try:
13497             ok = stp.SetValues( values )
13498         except Exception, e:
13499             excStr = str(e)
13500             if excStr.find("WrongPythonType") > 0:
13501                 raise RuntimeError, errBeg +\
13502                       "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
13503             raise RuntimeError, errBeg + str(e)
13504         if not ok:
13505             nbOK = self.field.GetArraySize(self)
13506             nbKO = len(values)
13507             if nbOK != nbKO:
13508                 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
13509             else:
13510                 raise RuntimeError, errBeg + "failed"
13511         return
13512
13513     pass # end of class geomField
13514
13515 # Register the new proxy for GEOM_Field
13516 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13517
13518
13519 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13520 #  interface to GEOM operations.
13521 #
13522 #  Typical use is:
13523 #  \code
13524 #    import salome
13525 #    salome.salome_init()
13526 #    from salome.geom import geomBuilder
13527 #    geompy = geomBuilder.New(salome.myStudy)
13528 #  \endcode
13529 #  @param  study     SALOME study, generally obtained by salome.myStudy.
13530 #  @param  instance  CORBA proxy of GEOM Engine. If None, the default Engine is used.
13531 #  @return geomBuilder instance
13532 def New( study, instance=None):
13533     """
13534     Create a new geomBuilder instance.The geomBuilder class provides the Python
13535     interface to GEOM operations.
13536
13537     Typical use is:
13538         import salome
13539         salome.salome_init()
13540         from salome.geom import geomBuilder
13541         geompy = geomBuilder.New(salome.myStudy)
13542
13543     Parameters:
13544         study     SALOME study, generally obtained by salome.myStudy.
13545         instance  CORBA proxy of GEOM Engine. If None, the default Engine is used.
13546     Returns:
13547         geomBuilder instance
13548     """
13549     #print "New geomBuilder ", study, instance
13550     global engine
13551     global geom
13552     global doLcc
13553     engine = instance
13554     if engine is None:
13555       doLcc = True
13556     geom = geomBuilder()
13557     assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
13558     geom.init_geom(study)
13559     return geom