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