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