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