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