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