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