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_INTEGERSTEP_HXX__
22 #define __XAO_INTEGERSTEP_HXX__
26 #include "XAO_XaoUtils.hxx"
27 #include "XAO_Step.hxx"
33 * Step with integer values.
35 class IntegerStep : public Step
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.
45 IntegerStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents);
47 virtual const XAO::Type getType() { return XAO::INTEGER; }
50 * Gets all the values of the step as a list.
51 * @return a vector containing all the values of the step.
53 std::vector<int> getValues();
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.
60 std::vector<int> getElement(const int& element) throw (XAO_Exception);
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.
67 std::vector<int> getComponent(const int& component) throw (XAO_Exception);
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.
75 const int getValue(const int& element, const int& component) throw (XAO_Exception);
78 * Sets all the values from a list.
79 * @param values the list of values to set.
81 void setValues(const std::vector<int>& values) throw (XAO_Exception);
84 * Sets the values for an element.
85 * @param element the index of the element to set.
86 * @param elements the values to set.
88 void setElement(const int& element, const std::vector<int>& elements) throw (XAO_Exception);
91 * Sets the values for a component.
92 * @param component the index of the component to set.
93 * @param components the values to set.
95 void setComponent(const int& component, const std::vector<int>& components) throw (XAO_Exception);
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.
103 void setValue(const int& element, const int& component, const int& value) throw (XAO_Exception);
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);
109 std::vector< std::vector<int> > m_values;
114 #endif /* __XAO_INTEGERSTEP_HXX__ */