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