14 #include "msdevstudio/MSconfig.h"
37 :
BaseXML (
"PointRep", controller ),
40 a_xerror (
"xerror" ),
41 a_yerror (
"yerror" ),
43 a_value_transform (
"value_transform" )
68 tag -> appendChild ( *element );
80 const void * addr = reinterpret_cast <
const void * > ( &
rep );
88 string value = rep.
xError() ?
"yes" :
"no";
90 value = rep.
yError() ?
"yes" :
"no";
106 rep = factory->
create ( type );
109 rep = factory->
create ( type );
112 if ( rep == 0 )
return 0;
119 if ( btc_element != 0 ) {
121 rep -> setValueTransform ( btc );
128 unsigned int style = 0;
129 ok = element -> attribute (
a_style, style );
130 if ( ok ) rep -> setStyle ( style );
132 string xerror =
"no";
134 if ( xerror ==
"yes" ) {
138 string yerror =
"no";
140 if ( yerror ==
"yes" ) {
156 BinToColor * btc = factory -> create ( transform );
157 rep -> setValueTransform ( btc );
XmlElement * createElement()
Creates a new element node.
Type * create(const std::string &name)
Creates a new object from a prototype named name.
A singleton class that is does XML serialization and deserialization of derived classes of Color with...
hippodraw::TextRepFactory class interface
virtual bool attribute(const std::string &name, bool &value) const =0
Sets value to the attribute name's value.
XmlElement * createElement(const Color &color)
Create a Color XML element.
BinToColorXML class interface.
The base class for the value to the color transformation.
static BinToColorFactory * instance()
Returns a pointer to the singleton instance.
PointRepXML class interface.
PointRepFactory class interface.
XmlController class interface.
static PointRepFactory * instance()
Returns a pointer to the singleton instance.
BinToColorXML * m_bintocolor_xml
The BinToColorXML instance used by this object.
const XmlElement * getNode(const XmlElement *element) const
Returns the single child node of element of the type that can be handled by this object.
A pure virtual base class of XML element wrapper.
ColorXML class interface.
RepBase * createObject(const XmlElement *element)
Creates an object derived from RepBase from information in the XmlElement.
const std::string & getText() const
Gets the text.
std::string a_xerror
The x error attribute name.
A singleton class that is does XML serialization and deserialization of derived classes of BinToColor...
virtual bool yError() const
Returns true if the point representation displays error on the Y axis.
A Color class for creating the color object following the standard RGB color space.
void setId(XmlElement &tag, int id)
Sets the unique identification of the object.
std::string a_value_transform
The type of value transform.
PyArray_TYPES type(numeric::array arr)
static TextRepFactory * instance()
Returns a pointer to the singleton instance.
A factory for textual representations.
std::string a_style
The style attribute name.
virtual void appendChild(const XmlNode &child)=0
Appends a child element to the element.
hippodraw::BinToColor class interface
intp size(numeric::array arr)
ColorXML * m_color_xml
The ColorXML instance used by this object.
virtual void setSize(float value)
Sets the size of the representation.
virtual void setColor(const Color &)
Sets the color of the representation.
hippodraw::RepBase class interface
std::string a_text
The text attribute name.
A factory for creation of objects whose class is derived from PointRepBase.
XmlController * m_controller
The singleton XML controller object.
XmlElement class interface.
std::string a_yerror
The y error attribute name.
Color * createObject(const XmlElement *element)
Sets the attributes of the object from the element values.
virtual void setErrorOn(hippodraw::Axes::Type axis, bool yes=true)
Sets the error representation on specified axis, if any, to yes.
PointRepXML(const PointRepXML &)
A private copy constructor in order to avoid copying.
virtual const BinToColor * getValueTransform() const
Returns the value transform.
const std::string m_type
The attribute name for the type of object.
std::string a_size
The size attribute name.
virtual unsigned int getStyle() const
Returns the style of the point representation.
A factory for creation of objects whose class is derived from BinToColor.
A base class of XML element controllers.
const std::string & name() const
Returns the name of the representation.
virtual const Color & getColor() const
Get the color of the representation.
virtual bool xError() const
Returns true if the point representation displays error on the X axis.
An exception class that is thrown when the factory fails to find the request class by its name...
A base class that is the interface between GUI and the XML serialization and deserialization.
void setAttributes(XmlElement &tag, const RepBase &rep)
Sets the attributes of a PointRep element tag.
~PointRepXML()
The destructor.
void setText(const std::string &text)
Sets the text.
float size() const
Returns the size of the representation.
The base class for the point representation hierarchy.
virtual void setAttribute(const std::string &name, bool value)=0
Sets attribute named name to the int value value.
BinToColorFactory class interface.