Salome HOME
The initial version of Open and Save in the SHAPER-STUDY
[modules/shaper_study.git] / src / PY / SHAPERSTUDY_Field.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 import GEOM
25
26 class SHAPERSTUDY_Field(SHAPERSTUDY_ORB__POA.Field):
27     """
28     Construct an instance of SHAPERSTUDY Field.
29     """
30     def __init__ ( self, *args ):
31         pass
32
33     def GetDataType( self ):
34         """
35         Returns type of field data (GEOM.field_data_type)
36         """
37         return GEOM.FDT_Double
38
39     def GetShape( self ):
40         """
41         Returns the shape the field lies on
42         """
43         return SHAPERSTUDY_Object()
44
45     def GetSteps( self ):
46         """
47         Returns a list of time step IDs in the field
48         """
49         return [1]
50
51     def GetComponents( self ):
52         """
53         Returns names of components
54         """
55         return ['X']
56
57     def GetDimension( self ):
58         """
59         Returns dimension of the shape the field lies on:
60         0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
61         """
62         return -1
63
64     pass
65
66
67
68 class SHAPERSTUDY_FieldStep(SHAPERSTUDY_ORB__POA.FieldStep):
69     """
70     Construct an instance of SHAPERSTUDY FieldStep.
71     """
72     def __init__ ( self, *args):
73         pass
74
75     def GetStamp( self ):
76         """
77         Returns the time of the field step
78         """
79         return 100
80
81     def GetID( self ):
82         """
83         Returns the number of the field step
84         """
85         return 1
86
87     pass
88
89
90 class SHAPERSTUDY_DoubleFieldStep(SHAPERSTUDY_ORB__POA.DoubleFieldStep):
91     """
92     Construct an instance of SHAPERSTUDY FieldStep.
93     """
94     def __init__ ( self, *args):
95         SHAPERSTUDY_FieldStep.__init__(self, *args)
96         pass
97
98     def GetValues( self ):
99         """
100         Returns values of the field step
101         """
102         return [1.0]
103
104     pass
105
106
107 class SHAPERSTUDY_IntFieldStep(SHAPERSTUDY_ORB__POA.IntFieldStep):
108     """
109     Construct an instance of SHAPERSTUDY FieldStep.
110     """
111     def __init__ ( self, *args):
112         SHAPERSTUDY_FieldStep.__init__(self, *args)
113         pass
114
115     def GetValues( self ):
116         """
117         Returns values of the field step
118         """
119         return [1]
120
121     pass
122
123
124 class SHAPERSTUDY_BoolFieldStep(SHAPERSTUDY_ORB__POA.BoolFieldStep):
125     """
126     Construct an instance of SHAPERSTUDY FieldStep.
127     """
128     def __init__ ( self, *args):
129         SHAPERSTUDY_FieldStep.__init__(self, *args)
130         pass
131
132     def GetValues( self ):
133         """
134         Returns values of the field step
135         """
136         return [True]
137
138     pass