1 // Copyright (C) 2013 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Frederic Pons (OpenCascade)
21 #ifndef __XAO_STRINGSTEP_HXX__
22 #define __XAO_STRINGSTEP_HXX__
27 #include "XAO_XaoUtils.hxx"
28 #include "XAO_Step.hxx"
34 * Step with strings values.
36 class StringStep : public Step
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.
46 StringStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents);
48 virtual const XAO::Type getType() { return XAO::STRING; }
51 * Gets all the values of the step as a list.
52 * @return a vector containing all the values of the step.
54 std::vector<std::string> getValues();
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.
61 std::vector<std::string> getElement(const int& element) throw (XAO_Exception);
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.
68 std::vector<std::string> getComponent(const int& component) throw (XAO_Exception);
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.
76 const std::string getValue(const int& element, const int& component) throw (XAO_Exception);
79 * Sets all the values from a list.
80 * @param values the list of values to set.
82 void setValues(const std::vector<std::string>& values) throw (XAO_Exception);
85 * Sets the values for an element.
86 * @param element the index of the element to set.
87 * @param elements the values to set.
89 void setElement(const int& element, const std::vector<std::string>& elements) throw (XAO_Exception);
92 * Sets the values for a component.
93 * @param component the index of the component to set.
94 * @param components the values to set.
96 void setComponent(const int& component, const std::vector<std::string>& components) throw (XAO_Exception);
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.
104 void setValue(const int& element, const int& component, const std::string& value) throw (XAO_Exception);
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);
110 std::vector< std::vector<std::string> > m_values;
115 #endif /* __XAO_STRINGSTEP_HXX__ */