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