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