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