14 #include "msdevstudio/MSconfig.h"
33 :
BaseXML (
"AxisModel", controller ),
34 m_autorange (
"autorange" ),
37 m_scale_factor (
"scale_factor" ),
39 m_auto_tick (
"autotick" )
66 if ( model.
isLog () == true ) {
84 const vector < AxisTick > & ticks = model.
getTicks ();
85 unsigned int size = ticks.size ();
86 for (
unsigned int i = 0;
i <
size;
i++ ) {
98 const std::string & tagname )
111 if ( ok && value != 0 )
return true;
129 Range range ( low, high );
139 bool yes = value != 0;
140 model -> setAutoTicks ( yes );
151 vector < AxisTick > ticks;
156 if ( nodelist.empty () == false ) {
157 NodeList_t :: const_iterator first = nodelist.begin ();
158 while ( first != nodelist.end() ) {
161 ticks.push_back ( tick );
163 model -> setTicks ( ticks );
std::string m_autorange
The auto ranging attribute name.
XmlElement * createElement()
Creates a new element node.
AxisModelXML(const AxisModelXML &)
A private copy constructor in order to avoid copying.
std::list< XmlElement * > NodeList_t
The container type for element nodes.
double high() const
Returns the maximum of the range object.
A class to maintain tick coordinates and string values.
bool isAutoRanging() const
Returns true if auto-ranging is enabled; otherwise, returns false.
virtual bool attribute(const std::string &name, bool &value) const =0
Sets value to the attribute name's value.
std::string m_log
The attribute name for axis model that is logarithmic.
std::string m_low
The low end of Range attribute name.
bool isAutoTicks() const
Returns true if position of the ticks should be automatically generated.
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...
std::string m_scale_factor
the scale factor attribute name.
void setRange(double low, double high, double pos)
Sets the Range to the low and high values.
AxisModelXML class interface.
void createChildren(XmlElement &, const AxisModelBase &)
Creates the children elements.
void setAutoRanging(bool flag)
Sets the auto-ranging flag to flag.
virtual void appendChild(const XmlNode &child)=0
Appends a child element to the element.
intp size(numeric::array arr)
The AxisModelBase class maintains the Range and scaling of an axis.
AxisTickXML * m_axistick_xml
The AxisTick XML handler.
double getScaleFactor() const
Returns the scale factor.
std::string m_high
The high end of Range attribute name.
virtual bool isLog() const =0
Returns a boolean describing the type of the scale of the axis.
XmlElement class interface.
const std::vector< AxisTick > & getTicks() const
Returns a reference of generated ticks.
void setScaleFactor(double)
Sets the value of the scale factor.
~AxisModelXML()
The destructor.
hippodraw::AxisModelBase class interface
std::string m_auto_tick
The attribute name for axis model that wants auto tick generation.
const Range & getRange(bool scaled) const
Returns the range represented by this AxisModel.
A base class of XML element controllers.
double low() const
Returns the minimum of the range object.
Expresses a range of values.
A class that is does XML serialization and de-serialization of AxisTick with XML. ...
bool isLog(const XmlElement *element)
Returns true if the element represents an axis model that is on a logarithmic scale.
Type convert(const std::string &axis)
Converts from string representation ot Axes::Type representation.
A base class that is the interface between GUI and the XML serialization and deserialization.
void setAttributes(XmlElement &tag, const AxisModelBase &plotter)
Sets the attributes of the XmlElement tag from information in the AxisModel object plotter...
AxisTickXML class interface.
hippodraw::Axes::Type getAxis(const XmlElement *element, const std::string &tagname)
Returns the Axis attribute value.
virtual void setAttribute(const std::string &name, bool value)=0
Sets attribute named name to the int value value.
AxisTick class interface.