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