14 #include "msdevstudio/MSconfig.h" 35 :
BaseXML (
"BinToColor", controller ),
36 m_ctrlpt (
"CtrlPt" ),
48 unsigned int size = points.size ();
49 for (
unsigned int i = 0; i <
size; i++ ) {
52 element -> setAttribute (
m_point, points [ i ] );
53 tag -> appendChild ( *element );
64 bool ok = element -> attribute (
m_type, type );
69 btc = factory -> create ( type );
72 btc = factory -> create (
"Rainbow" );
75 ok = btc -> hasControlPoints ();
77 vector < double > points;
78 list < XmlElement * > nodelist;
80 list < XmlElement * > :: const_iterator first = nodelist.begin();
81 while ( first != nodelist.end() ) {
84 ok = pt_element -> attribute (
m_point, point );
85 points.push_back ( point );
87 btc -> setControlPoints ( points );
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...
A base class that is the interface between GUI and the XML serialization and deserialization.
virtual bool hasControlPoints() const
Returns true if class has control points by which the value to color transform can be varied...
BinToColor * createObject(const XmlElement *element)
Sets the attributes of the object from the element values.
static XmlDocument * m_xml_doc
The current document being generated or read.
hippodraw::BinToColor class interface
A base class of XML element controllers.
const std::string m_type
The attribute name for the type of object.
static BinToColorFactory * instance()
Returns a pointer to the singleton instance.
const std::string & name() const
Returns the name of the value to color transform.
intp size(numeric::array arr)
BinToColorFactory class interface.
BinToColorXML(const BinToColorXML &)
A private copy constructor in order to avoid copying.
PyArray_TYPES type(numeric::array arr)
A factory for creation of objects whose class is derived from BinToColor.
A pure virtual base class of XML element wrapper.
XmlDocument class interface.
std::string m_point
The attribute name of a control point.
An exception class that is thrown when the factory fails to find the request class by its name...
BinToColorXML class interface.
std::string m_ctrlpt
The element name for control points.
XmlController class interface.
XmlElement class interface.
XmlElement * createElement()
Creates a new element node.
The base class for the value to the color transformation.
const std::vector< double > & getControlPoints() const
Returns a list of control points.