14 #include "msdevstudio/MSconfig.h"
30 :
BaseXML (
"TupleCut", controller ),
33 m_invert (
"invert" ),
34 m_column (
"column" ),
35 m_dim (
"dimension" ),
46 const void * addr = reinterpret_cast <
const void * > ( & cut );
50 tag -> setAttribute (
m_dim, -1 );
53 element -> setAttribute (
m_axis, i );
56 element -> setAttribute (
m_invert, tmp );
59 element -> setAttribute (
m_low, range.
low() );
60 element -> setAttribute (
m_high, range.
high() );
63 element -> setAttribute (
m_column, col );
65 tag -> appendChild ( *element );
89 if ( ok && ( value == 1 ) ) cut -> setInversion(
true );
96 Range range ( low, high );
111 bool ok = element -> attribute (
m_dim, dim );
112 if ( ok && dim < 0 ) yes =
false;
122 bool ok = element -> attribute (
m_dim, dim );
126 cuts.push_back ( cut );
131 assert ( nodelist.empty () == false );
132 XmlElement::NodeList_t::const_iterator first = nodelist.begin();
134 while ( first != nodelist.end() ) {
137 bool ok = node -> attribute (
m_axis, axis );
142 cuts.push_back ( cut );
161 assert ( nodelist.empty () == false );
162 XmlElement::NodeList_t::const_iterator first = nodelist.begin();
164 while ( first != nodelist.end() ) {
167 bool ok = node -> attribute (
m_axis, axis );
std::list< XmlElement * > NodeList_t
The type of container used to store XmlElement nodes.
void setAxisAttributes(TupleCut *cut, hippodraw::Axes::Type axis, const XmlElement *element) const
Sets the attributes for each axis of the TupleCut.
void setColumn(unsigned int col)
Sets the column in the DataSource to be used.
A base class of XML element controllers.
void getObjects(const XmlElement *element, std::vector< TupleCut * > &cuts)
Creates TupleCut objects from old style multidimensional TupleCut.
void setRange(const Range &range)
Sets the range of the cut.
XmlElement class interface.
std::string m_high
The high end of Range attribute name.
bool hasMultiDimTupleCut(const XmlElement *element) const
Returns true if element contains old style NTuple, i.e.
TupleCutXML class interface.
void setId(XmlElement &tag, int id)
Sets the unique identification of the object.
XmlController class interface.
std::string m_low
The low end of Range attribute name.
static XmlDocument * m_xml_doc
The current document being generated or read.
std::string m_dim
The number of dimension attribute name.
std::string m_axis
The axis attribute name.
double low() const
Returns the minimum of the range object.
TupleCutXML(const TupleCutXML &)
A private copy constructor in order to avoid copying.
A pure virtual base class of XML element wrapper.
A base class that is the interface between GUI and the XML serialization and deserialization.
bool getInversion() const
Returns the state of the inversion for the axis.
void setAttributes(TupleCut *&cut, const XmlElement *element) const
Sets the attributes of the TupleCut object plotter from the information in the XmlElement element...
double high() const
Returns the maximum of the range object.
XmlDocument class interface.
XmlElement * createElement()
Creates a new element node.
hippodraw::TupleCut class interface
unsigned int getColumn() const
Returns the column index used in the DataSource.
std::string m_invert
The inversion attribute name.
void fillNodeList(const XmlElement *element, std::list< XmlElement * > &nodelist)
Fills the nodelist with immediate child nodes of element with nodes that can be handled by this objec...
std::string m_column
The column index attribute name.
const Range & getRange() const
Returns a reference to the range for each dimension.
virtual bool attribute(const std::string &name, bool &value) const =0
Sets value to the attribute name's value.
XmlController * m_controller
The singleton XML controller object.
The class expresses a cut on a DataSource, i.e.
TupleCut * getObject(const XmlElement &tag) const
Creates an TupleCut object and sets its properties from the XmlElement.
Expresses a range of values.