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