]> SALOME platform Git repositories - modules/shaper_study.git/blob - src/PY/SHAPERSTUDY_Field.py
Salome HOME
Merge branch 'V9_8_BR'
[modules/shaper_study.git] / src / PY / SHAPERSTUDY_Field.py
1 # Copyright (C) 2019-2021  CEA/DEN, EDF R&D
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 import SHAPERSTUDY_ORB__POA
21 import GEOM
22
23 class SHAPERSTUDY_Field(SHAPERSTUDY_ORB__POA.Field):
24     """
25     Construct an instance of SHAPERSTUDY Field.
26     """
27     def __init__ ( self, *args ):
28         pass
29
30     def GetDataType( self ):
31         """
32         Returns type of field data (GEOM.field_data_type)
33         """
34         return GEOM.FDT_Double
35
36     def GetShape( self ):
37         """
38         Returns the shape the field lies on
39         """
40         return SHAPERSTUDY_Object()
41
42     def GetSteps( self ):
43         """
44         Returns a list of time step IDs in the field
45         """
46         return [1]
47
48     def GetComponents( self ):
49         """
50         Returns names of components
51         """
52         return ['X']
53
54     def GetDimension( self ):
55         """
56         Returns dimension of the shape the field lies on:
57         0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
58         """
59         return -1
60
61     ### unnecessary methods that can be accidentally called from any module
62     def AddStep(self, *args): return 
63     def RemoveStep(self, *args): return 
64     def CountSteps(self, *args): return 0
65     def GetStep(self, *args): return 0
66     def GetArraySize(self, *args): return 0
67
68     pass
69
70
71
72 class SHAPERSTUDY_FieldStep(SHAPERSTUDY_ORB__POA.FieldStep):
73     """
74     Construct an instance of SHAPERSTUDY FieldStep.
75     """
76     def __init__ ( self, *args):
77         pass
78
79     def GetStamp( self ):
80         """
81         Returns the time of the field step
82         """
83         return 100
84
85     def GetID( self ):
86         """
87         Returns the number of the field step
88         """
89         return 1
90
91     pass
92
93
94 class SHAPERSTUDY_DoubleFieldStep(SHAPERSTUDY_ORB__POA.DoubleFieldStep):
95     """
96     Construct an instance of SHAPERSTUDY FieldStep.
97     """
98     def __init__ ( self, *args):
99         SHAPERSTUDY_FieldStep.__init__(self, *args)
100         pass
101
102     def GetValues( self ):
103         """
104         Returns values of the field step
105         """
106         return [1.0]
107
108     pass
109
110
111 class SHAPERSTUDY_IntFieldStep(SHAPERSTUDY_ORB__POA.IntFieldStep):
112     """
113     Construct an instance of SHAPERSTUDY FieldStep.
114     """
115     def __init__ ( self, *args):
116         SHAPERSTUDY_FieldStep.__init__(self, *args)
117         pass
118
119     def GetValues( self ):
120         """
121         Returns values of the field step
122         """
123         return [1]
124
125     pass
126
127
128 class SHAPERSTUDY_BoolFieldStep(SHAPERSTUDY_ORB__POA.BoolFieldStep):
129     """
130     Construct an instance of SHAPERSTUDY FieldStep.
131     """
132     def __init__ ( self, *args):
133         SHAPERSTUDY_FieldStep.__init__(self, *args)
134         pass
135
136     def GetValues( self ):
137         """
138         Returns values of the field step
139         """
140         return [True]
141
142     pass