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