1 // Copyright (C) 2013-2019 CEA/DEN, EDF R&D, OPEN CASCADE
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, or (at your option) any later version.
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_STEP_HXX__
22 #define __XAO_STEP_HXX__
25 #include "XAO_XaoUtils.hxx"
28 #pragma warning(disable:4290) // Warning Exception ...
36 * Base class for steps.
41 /** Default constructor. */
51 * Gets the type of the step.
54 virtual const XAO::Type getType() = 0;
57 * Gets the step index.
58 * @return the index of the step.
60 const int getStep() { return m_step; }
63 * Sets the number of the step.
64 * @param step the index to set.
66 void setStep(const int& step) { m_step = step; }
69 * Gets the stamp of the index.
70 * @return the stamp of the index.
72 const int getStamp() { return m_stamp; }
75 * Sets the stamp of the index.
76 * @param stamp the stamp to set.
78 void setStamp(const int& stamp) { m_stamp = stamp; }
81 * Gets the number of components of the step.
82 * @return the number of components.
84 const int countComponents() { return m_nbComponents; }
87 * Gets the number of elements for the step.
88 * @return the number of elements.
90 const int countElements() { return m_nbElements; }
93 * Gets the number of values for the step.
94 * @return the number of values.
96 const int countValues() { return m_nbElements * m_nbComponents; }
99 * Gets a value as a string.
100 * @param element the index of the element.
101 * @param component the index of the component.
102 * @return the value as a string.
104 virtual const std::string getStringValue(const int& element, const int& component) = 0;
107 * Sets a value as a string
108 * @param element the index of the element.
109 * @param component the index of the component.
110 * @param value the string value.
111 * @throw XAO_Exception if the value is not valid.
113 virtual void setStringValue(const int& element, const int& component, const std::string& value) = 0;
117 * Checks that given element index is in the range of element indexes.
118 * @param element the index to check.
120 void checkElementIndex(const int& element) throw (XAO_Exception);
122 * Checks that given component index is in the range of component indexes.
123 * @param component the index to check.
125 void checkComponentIndex(const int& component)throw (XAO_Exception);
128 * Checks that the given number of elements is correct.
129 * @param nbElements the number of elements to check.
131 void checkNbElements(const int& nbElements)throw (XAO_Exception);
134 * Checks that the given number of components is correct.
135 * @param nbComponents the number of components to check.
137 void checkNbComponents(const int& nbComponents)throw (XAO_Exception);
140 * checks that the given number of values is correct.
141 * @param nbValues the number of values to check.
143 void checkNbValues(const int& nbValues)throw (XAO_Exception);
146 /** the index of the step. */
148 /** The stamp of the step. */
150 /** The number of components. */
152 /** The number of elements. */
158 #endif /* __XAO_STEP_HXX__ */