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