1 # Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE
3 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 import SHAPERSTUDY_ORB__POA
25 class SHAPERSTUDY_IShapesOperations(SHAPERSTUDY_ORB__POA.IShapesOperations):
27 Construct an instance of SHAPERSTUDY IShapesOperations.
29 def __init__ ( self, *args):
32 def GetAllSubShapesIDs( self, theShape, theShapeType, isSorted ):
34 Explode a shape on sub-shapes of a given type.
37 theShape Shape to be exploded.
38 theShapeType Type of sub-shapes to be retrieved.
39 isSorted If this parameter is TRUE, sub-shapes will be
40 sorted by coordinates of their gravity centers.
44 def GetSharedShapes( self, theShape1, theShape2, theShapeType ):
46 Get sub-shapes, shared by input shapes.
49 theShape1 Shape to find sub-shapes in.
50 theShape2 Shape to find shared sub-shapes with.
51 theShapeType Type of sub-shapes to be retrieved.
53 return [ SHAPERSTUDY_Object()._this() ]
55 def GetSubShapeIndex( self, theMainShape, theSubShape ):
57 Get global index of theSubShape in theMainShape.
61 def GetSubShape( self, theMainShape, theID ):
63 Get a sub-shape defined by its unique ID within theMainShape
65 return SHAPERSTUDY_Object()._this()
67 def GetInPlace( self, theShapeWhere, theShapeWhat ):
69 Get sub-shape(s) of \a theShapeWhere, which are
70 coincident with \a theShapeWhat or could be a part of it.
72 return SHAPERSTUDY_Object()._this()
74 def GetInPlaceMap( self, theShapeWhere, theShapeWhat ):
76 A sort of GetInPlace functionality, returning for each sub-shape ID of
77 \a theShapeWhat a list of corresponding sub-shape IDs of \a theShapeWhere.
83 To know, if the operation was successfully performed
90 class SHAPERSTUDY_IGroupOperations(SHAPERSTUDY_ORB__POA.IGroupOperations):
92 Construct an instance of SHAPERSTUDY IShapesOperations.
94 def __init__ ( self, *args):
97 def CreateGroup( self, theMainShape, theShapeType ):
99 Creates a new group which will store sub-shapes of theMainShape
101 return SHAPERSTUDY_Object()._this()
103 def UnionList( self, theGroup, theSubShapes ):
105 Adds to the group all the given shapes. No errors, if some shapes are already included.
108 theGroup is a GEOM group to which the new sub-shapes are added.
109 theSubShapes is a list of sub-shapes to be added.
115 To know, if the operation was successfully performed
119 def GetMainShape( self, theGroup ):
121 Returns a main shape associated with the group
123 return SHAPERSTUDY_Object()._this()
125 def GetType( self, theGroup ):
127 Returns a type (int) of sub-objects stored in the group
129 return SHAPERSTUDY_Object()._this()
131 def GetObjects( self, theGroup ):
133 Returns a list of sub-objects ID stored in the group
139 class SHAPERSTUDY_IFieldOperations(SHAPERSTUDY_ORB__POA.IFieldOperations):
141 Construct an instance of SHAPERSTUDY IFieldOperations.
143 def __init__ ( self, *args):
146 def GetFields( self, shape ):
148 Returns all fields on a shape
150 return [ SHAPERSTUDY_Field() ]
155 class SHAPERSTUDY_IMeasureOperations(SHAPERSTUDY_ORB__POA.IMeasureOperations):
157 Construct an instance of SHAPERSTUDY IMeasureOperations.
159 def __init__ ( self, *args):
162 def GetVertexByIndex( self, theShape, theIndex, theUseOri ):
164 Get a vertex sub-shape by index.
167 theShape Shape to find sub-shape.
168 theIndex Index to find vertex by this index (starting from zero)
169 theUseOri To consider edge/wire orientation or not
171 return [ SHAPERSTUDY_Field() ]