Salome HOME
Copyright update 2020
[modules/shaper_study.git] / src / PY / SHAPERSTUDY_Field.py
1 # Copyright (C) 2019-2020  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     pass
62
63
64
65 class SHAPERSTUDY_FieldStep(SHAPERSTUDY_ORB__POA.FieldStep):
66     """
67     Construct an instance of SHAPERSTUDY FieldStep.
68     """
69     def __init__ ( self, *args):
70         pass
71
72     def GetStamp( self ):
73         """
74         Returns the time of the field step
75         """
76         return 100
77
78     def GetID( self ):
79         """
80         Returns the number of the field step
81         """
82         return 1
83
84     pass
85
86
87 class SHAPERSTUDY_DoubleFieldStep(SHAPERSTUDY_ORB__POA.DoubleFieldStep):
88     """
89     Construct an instance of SHAPERSTUDY FieldStep.
90     """
91     def __init__ ( self, *args):
92         SHAPERSTUDY_FieldStep.__init__(self, *args)
93         pass
94
95     def GetValues( self ):
96         """
97         Returns values of the field step
98         """
99         return [1.0]
100
101     pass
102
103
104 class SHAPERSTUDY_IntFieldStep(SHAPERSTUDY_ORB__POA.IntFieldStep):
105     """
106     Construct an instance of SHAPERSTUDY FieldStep.
107     """
108     def __init__ ( self, *args):
109         SHAPERSTUDY_FieldStep.__init__(self, *args)
110         pass
111
112     def GetValues( self ):
113         """
114         Returns values of the field step
115         """
116         return [1]
117
118     pass
119
120
121 class SHAPERSTUDY_BoolFieldStep(SHAPERSTUDY_ORB__POA.BoolFieldStep):
122     """
123     Construct an instance of SHAPERSTUDY FieldStep.
124     """
125     def __init__ ( self, *args):
126         SHAPERSTUDY_FieldStep.__init__(self, *args)
127         pass
128
129     def GetValues( self ):
130         """
131         Returns values of the field step
132         """
133         return [True]
134
135     pass