]> SALOME platform Git repositories - modules/shaper_study.git/blob - src/PY/SHAPERSTUDY_IOperations.py
Salome HOME
Initial integration
[modules/shaper_study.git] / src / PY / SHAPERSTUDY_IOperations.py
1 # Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
10 #
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # Lesser General Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22
23 import SHAPERSTUDY_ORB__POA
24
25 class SHAPERSTUDY_IShapesOperations(SHAPERSTUDY_ORB__POA.IShapesOperations):
26     """
27     Construct an instance of SHAPERSTUDY IShapesOperations.
28     """
29     def __init__ ( self, *args):
30         pass
31
32     def GetAllSubShapesIDs( self, theShape, theShapeType, isSorted ):
33         """
34         Explode a shape on sub-shapes of a given type.
35
36         Parameters:
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.
41         """
42         return [1]
43
44     def GetSharedShapes( self, theShape1, theShape2, theShapeType ):
45         """
46         Get sub-shapes, shared by input shapes.
47
48         Parameters:
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.
52         """
53         return [ SHAPERSTUDY_Object()._this() ]
54
55     def GetSubShapeIndex( self, theMainShape, theSubShape ):
56         """
57         Get global index of theSubShape in theMainShape.
58         """
59         return 2
60
61     def GetSubShape( self, theMainShape, theID ):
62         """
63         Get a sub-shape defined by its unique ID within theMainShape
64         """
65         return SHAPERSTUDY_Object()._this()
66
67     def GetInPlace( self, theShapeWhere, theShapeWhat ):
68         """
69         Get sub-shape(s) of \a theShapeWhere, which are
70         coincident with \a theShapeWhat or could be a part of it.
71         """
72         return SHAPERSTUDY_Object()._this()
73         
74     def GetInPlaceMap( self, theShapeWhere, theShapeWhat ):
75         """
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.
78         """
79         return [[]]
80
81     def IsDone( self ):
82         """
83         To know, if the operation was successfully performed
84         """
85         return False
86
87     pass
88     
89
90 class SHAPERSTUDY_IGroupOperations(SHAPERSTUDY_ORB__POA.IGroupOperations):
91     """
92     Construct an instance of SHAPERSTUDY IShapesOperations.
93     """
94     def __init__ ( self, *args):
95         pass
96
97     def CreateGroup( self, theMainShape, theShapeType ):
98         """
99         Creates a new group which will store sub-shapes of theMainShape
100         """
101         return SHAPERSTUDY_Object()._this()
102
103     def UnionList( self, theGroup, theSubShapes ):
104         """
105         Adds to the group all the given shapes. No errors, if some shapes are already included.
106
107         Parameters:
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.
110         """
111         return
112
113     def IsDone( self ):
114         """
115         To know, if the operation was successfully performed
116         """
117         return False
118
119     def GetMainShape( self, theGroup ):
120         """
121         Returns a main shape associated with the group
122         """
123         return SHAPERSTUDY_Object()._this()
124
125     def GetType( self, theGroup ):
126         """
127         Returns a type (int) of sub-objects stored in the group
128         """
129         return SHAPERSTUDY_Object()._this()
130
131     def GetObjects( self, theGroup ):
132         """
133         Returns a list of sub-objects ID stored in the group
134         """
135         return [2]
136
137     pass
138
139 class SHAPERSTUDY_IFieldOperations(SHAPERSTUDY_ORB__POA.IFieldOperations):
140     """
141     Construct an instance of SHAPERSTUDY IFieldOperations.
142     """
143     def __init__ ( self, *args):
144         pass
145
146     def GetFields( self, shape ):
147         """
148         Returns all fields on a shape
149         """
150         return [ SHAPERSTUDY_Field() ]
151
152     pass
153
154
155 class SHAPERSTUDY_IMeasureOperations(SHAPERSTUDY_ORB__POA.IMeasureOperations):
156     """
157     Construct an instance of SHAPERSTUDY IMeasureOperations.
158     """
159     def __init__ ( self, *args):
160         pass
161
162     def GetVertexByIndex( self, theShape, theIndex, theUseOri ):
163         """
164         Get a vertex sub-shape by index.
165
166         Parameters:
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
170         """
171         return [ SHAPERSTUDY_Field() ]
172
173     pass