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