Salome HOME
09673466a8847014937c41cb16c89c7cf6d39e88
[modules/geom.git] / src / XAO / XAO_IntegerStep.hxx
1 // Copyright (C) 2013  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.
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 // Author : Frederic Pons (OpenCascade)
20
21 #ifndef __XAO_INTEGERSTEP_HXX__
22 #define __XAO_INTEGERSTEP_HXX__
23
24 #include <vector>
25
26 #include "XAO_XaoUtils.hxx"
27 #include "XAO_Step.hxx"
28
29 namespace XAO
30 {
31     /**
32      * @class IntegerStep
33      * Step with integer values.
34      */
35     class IntegerStep : public Step
36     {
37     public:
38         /**
39          * Constructor.
40          * @param step the step number.
41          * @param stamp the stamp of the step.
42          * @param nbElements the number elements of the geometry.
43          * @param nbComponents the number of components of the field.
44          */
45         IntegerStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents);
46
47         virtual const XAO::Type getType() { return XAO::INTEGER; }
48
49         /**
50          * Gets all the values of the step as a list.
51          * @return a vector containing all the values of the step.
52          */
53         std::vector<int> getValues();
54
55         /**
56          * Gets all the values for a given element.
57          * @param element the index of the element.
58          * @return a vector containing all the values for the given element.
59          */
60         std::vector<int> getElement(const int& element) throw (XAO_Exception);
61
62         /**
63          * Gets all the values for a given component.
64          * @param component the index of the component.
65          * @return a vector containing all the values for the given component.
66          */
67         std::vector<int> getComponent(const int& component) throw (XAO_Exception);
68
69         /**
70          * Gets the value for an element and a component.
71          * @param element the index of the element.
72          * @param component the index of the component.
73          * @return the value for the given element and component.
74          */
75         const int getValue(const int& element, const int& component) throw (XAO_Exception);
76
77         /**
78          * Sets all the values from a list.
79          * @param values the list of values to set.
80          */
81         void setValues(const std::vector<int>& values) throw (XAO_Exception);
82
83         /**
84          * Sets the values for an element.
85          * @param element the index of the element to set.
86          * @param elements the values to set.
87          */
88         void setElement(const int& element, const std::vector<int>& elements) throw (XAO_Exception);
89
90         /**
91          * Sets the values for a component.
92          * @param component the index of the component to set.
93          * @param components the values to set.
94          */
95         void setComponent(const int& component, const std::vector<int>& components) throw (XAO_Exception);
96
97         /**
98          * Sets the value for an element and a component.
99          * @param element the index of the element.
100          * @param component the index of the component.
101          * @param value the value.
102          */
103         void setValue(const int& element, const int& component, const int& value) throw (XAO_Exception);
104
105         virtual const std::string getStringValue(const int& element, const int& component) throw (XAO_Exception);
106         virtual void setStringValue(const int& element, const int& component, const std::string& value)  throw (XAO_Exception);
107
108     private:
109         std::vector< std::vector<int> > m_values;
110     };
111 }
112
113
114 #endif /* __XAO_INTEGERSTEP_HXX__ */