TransformXML.cxx
Go to the documentation of this file.
1 
12 // for truncation warning
13 #ifdef _MSC_VER
14 #include "msdevstudio/MSconfig.h"
15 #endif
16 
17 #include "TransformXML.h"
18 
19 #include "XmlElement.h"
20 
23 
24 #include <cassert>
25 
26 using std::string;
27 
28 namespace hippodraw {
29 
31  : BaseXML ( "Transform", controller )
32 {
33 }
34 
36 {
38  const string & type = transform.name();
39  tag->setAttribute ( m_type, type );
40 
41  return tag;
42 }
43 
45 {
46  string type;
47  bool ok = element->attribute ( m_type, type );
48  assert ( ok );
49 
51  TransformBase * transform = factory->createTransform ( type );
52 
53  return transform;
54 }
55 
56 } // namespace hippodraw
57 
XmlElement * createElement()
Creates a new element node.
Definition: BaseXML.cxx:43
virtual bool attribute(const std::string &name, bool &value) const =0
Sets value to the attribute name&#39;s value.
A transform that transforms coordinates from one coordinate system to another.
Definition: TransformBase.h:35
TransformXML(const TransformXML &)
A private copy constructor in order to avoid copying.
A pure virtual base class of XML element wrapper.
Definition: XmlElement.h:30
TransformBase * createTransform(const std::string &name)
Creates a returns a new TransformBase object with given name.
TransformXML class interface.
static TransformFactory * instance()
Returns a pointer to the singleton instance.
bool ok
Definition: CanvasView.cxx:163
PyArray_TYPES type(numeric::array arr)
Definition: num_util.cpp:249
XmlElement class interface.
const std::string & name() const
Returns the name of the Transform.
const std::string m_type
The attribute name for the type of object.
Definition: BaseXML.h:54
virtual TransformBase * createObject(const XmlElement *element)
Creates an object derived from TransformBase.
A base class of XML element controllers.
Definition: BaseXML.h:35
TransformBase class interface.
A base class that is the interface between GUI and the XML serialization and deserialization.
Definition: XmlController.h:53
The singleton Factory class for creating objects whose class is derived from TransformBase.
virtual void setAttribute(const std::string &name, bool value)=0
Sets attribute named name to the int value value.

Generated for HippoDraw Class Library by doxygen