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