14 #include "msdevstudio/MSconfig.h"
34 :
BaseXML (
"FunctionProjector", controller )
43 const void * addr = reinterpret_cast <
const void * > ( & projector );
49 const vector < double > & parms =
function->getParameters ();
50 unsigned int size = parms.size();
52 for (
unsigned int i = 0;
i <
size;
i++ ) {
53 string parm (
"Parm" );
55 tag -> setAttribute ( parm, parms[
i] );
76 int size =
function->size();
77 vector < double > parms ( size );
78 for (
int i = 0;
i <
size;
i++ ) {
79 string parm (
"Parm" );
81 element -> attribute ( parm, parms[
i] );
84 function->setParameters ( parms );
96 if ( fc -> functionExists ( fname ) ) {
XmlElement * createElement()
Creates a new element node.
FunctionBase * getFunction() const
Returns the actual function, a FunctionBase derived class.
void setAttributes(const XmlElement *element, FunctionBase *function)
Set the values for the function from the XML element.
virtual bool attribute(const std::string &name, bool &value) const =0
Sets value to the attribute name's value.
FunctionProjectorXML(const FunctionProjectorXML &)
A private copy constructor in order to avoid copying.
FunctionProjectorXML class interface.
static FunctionController * instance()
Returns the pointer to the singleton instance.
std::string getFunctionName(const XmlElement *element)
Get the function name from the XML element.
XmlController class interface.
hippodraw::FunctionController class interface
A singleton class is the interface between an application and the list of FunctionRep objects contain...
A pure virtual base class of XML element wrapper.
A derived class of DataRep which is a base class for displaying a function.
The namespace for conversion to string.
hippodraw::DataRep * createFunctionRep(const XmlElement *element, hippodraw::DataRep *target)
Creates a FunctionRep from element with target DataRep.
void setId(XmlElement &tag, int id)
Sets the unique identification of the object.
hippodraw::FunctionRep class interface
The base class for data representations.
void saveParameters()
Saves the function parameters in a cache so that they can be restored.
FunctionRep * createFunctionRep(const std::string &name, DataRep *rep)
Returns a newly created FunctionRep object with function of type name and target rep.
intp size(numeric::array arr)
string convert(int i)
Converts an integer to a string.
XmlController * m_controller
The singleton XML controller object.
XmlElement class interface.
A function that can be added to a DataRep and used in a fitter.
hippodraw::FunctionProjector class interface
FunctionBase * function() const
Returns a pointer to the contained function.
A base class of XML element controllers.
hippodraw::FunctionBase class interface
A base class that is the interface between GUI and the XML serialization and deserialization.
virtual void setAttribute(const std::string &name, bool value)=0
Sets attribute named name to the int value value.
A projector that plots one function.