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