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::string m_invert
The inversion attribute name.
virtual bool attribute(const std::string &name, bool &value) const =0
Sets value to the attribute name's value.
TupleCutXML class interface.
XmlController * m_controller
The singleton XML controller object.
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...
void setRange(const Range &range)
Sets the range of the cut.
A base class that is the interface between GUI and the XML serialization and deserialization.
static XmlDocument * m_xml_doc
The current document being generated or read.
void setAttributes(TupleCut *&cut, const XmlElement *element) const
Sets the attributes of the TupleCut object plotter from the information in the XmlElement element...
void setAxisAttributes(TupleCut *cut, hippodraw::Axes::Type axis, const XmlElement *element) const
Sets the attributes for each axis of the TupleCut.
A base class of XML element controllers.
double high() const
Returns the maximum of the range object.
std::string m_dim
The number of dimension attribute name.
const Range & getRange() const
Returns a reference to the range for each dimension.
hippodraw::TupleCut class interface
bool hasMultiDimTupleCut(const XmlElement *element) const
Returns true if element contains old style NTuple, i.e.
double low() const
Returns the minimum of the range object.
unsigned int getColumn() const
Returns the column index used in the DataSource.
TupleCutXML(const TupleCutXML &)
A private copy constructor in order to avoid copying.
std::string m_high
The high end of Range attribute name.
std::list< XmlElement *> NodeList_t
The type of container used to store XmlElement nodes.
Expresses a range of values.
A pure virtual base class of XML element wrapper.
XmlDocument class interface.
bool getInversion() const
Returns the state of the inversion for the axis.
void setColumn(unsigned int col)
Sets the column in the DataSource to be used.
std::string m_low
The low end of Range attribute name.
std::string m_column
The column index attribute name.
XmlController class interface.
TupleCut * getObject(const XmlElement &tag) const
Creates an TupleCut object and sets its properties from the XmlElement.
void setId(XmlElement &tag, int id)
Sets the unique identification of the object.
XmlElement class interface.
XmlElement * createElement()
Creates a new element node.
The class expresses a cut on a DataSource, i.e.
void getObjects(const XmlElement *element, std::vector< TupleCut * > &cuts)
Creates TupleCut objects from old style multidimensional TupleCut.
std::string m_axis
The axis attribute name.