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