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_BOOLEANSTEP_HXX__
22 #define __XAO_BOOLEANSTEP_HXX__
26 #include "XAO_XaoUtils.hxx"
27 #include "XAO_Step.hxx"
33 * Step with boolean values.
35 class BooleanStep : 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 BooleanStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents);
47 virtual const XAO::Type getType() { return XAO::BOOLEAN; }
50 * Gets all the values in a vector by elements and by components.
51 * @return a vector containing all the values.
53 std::vector<bool> getValues();
56 * Gets all the values for an element.
57 * @param element the index of the element to get.
58 * @return a vector containing all the values for the given element.
60 std::vector<bool> getElement(const int& element) throw (XAO_Exception);
63 * Gets all the values for a component.
64 * @param component the index of the component to get.
65 * @return a vector containing all the values for the given component.
67 std::vector<bool> getComponent(const int& component) throw (XAO_Exception);
70 * Gets a value for an element and a component.
71 * @param element the index of the element.
72 * @param component the index of the component.
75 const bool 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<bool>& 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<bool>& 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<bool>& 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 bool& 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<bool> > m_values;
114 #endif /* __XAO_BOOLEANSTEP_HXX__ */