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