23 #include <dtkCoreSupport/dtkAbstractData.h>
24 #include <dtkCoreSupport/dtkAbstractDataFactory.h>
25 #include <dtkCoreSupport/dtkAbstractProcessFactory.h>
45 return "axlFieldSpatialCoordinatesReader";
50 return "axlFieldSpatialCoordinatesReader";
55 return QStringList() <<
"axlAbstractField" <<
"axlFieldSpatialCoordinates";
65 QDomElement element = node.toElement();
67 if(element.tagName() !=
"field")
75 return !this->
accept(node);
83 QDomElement element = node.toElement();
87 QString type = element.attribute(
"type");
90 field =
dynamic_cast<axlAbstractField *
>(dtkAbstractDataFactory::instance()->create(type));
94 QString name = element.attribute(
"name");
97 field->setObjectName(name);
101 int number = node.childNodes().
size();
102 for(
int i = 0;i < number; i++){
103 QDomNode child = node.childNodes().at(i);
104 if(child.isElement() ){
108 if(!child.toElement().attribute(
"channel").isEmpty())
109 channel = child.toElement().attribute(
"channel").toInt();
111 if(!child.toElement().attribute(
"value").isEmpty())
112 value = child.toElement().attribute(
"value").toDouble();
114 field->setParameter(value, channel);
130 if(!axl_reader->
accept(node))
133 axl_reader->dtkAbstractDataReader::read(this->file());
135 if(dtkAbstractData *data = axl_reader->
read(node))
~axlFieldSpatialCoordinatesReader(void)
QString identifier(void) const
static bool registered(void)
axlAbstractData * read(const QDomNode &node)
bool reject(const QDomNode &node)
virtual void update(void)
axlFieldSpatialCoordinatesReader(void)
bool accept(const QDomNode &node)
dtkAbstractData * dataByReader(axlAbstractDataReader *axl_reader, const QDomNode &node)
virtual axlAbstractData * read(const QDomNode &node)=0
Class axlAbstractField defines an API for arrays of numeric data.
QString description(void) const
dtkAbstractDataReader * createaxlFieldSpatialCoordinatesReader(void)
virtual bool accept(const QDomNode &node)=0
QStringList handled(void) const
Class axlAbstractData defines an API for all type of axel data.