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