22 #include <dtkCoreSupport/dtkAbstractData.h>
23 #include <dtkCoreSupport/dtkAbstractDataFactory.h>
24 #include <dtkCoreSupport/dtkAbstractProcessFactory.h>
44 return "axlFieldReader";
49 return "axlFieldReader";
54 return QStringList() <<
"axlAbstractField";
59 return dtkAbstractDataFactory::instance()->registerDataReaderType(
"axlFieldReader", QStringList(),
createaxlFieldReader);
64 QDomElement element = node.toElement();
66 if(element.tagName() !=
"field")
74 return !this->
accept(node);
82 QDomElement element = node.toElement();
93 QString name = element.attribute(
"name");
96 field =
dynamic_cast<axlAbstractField *
>(dtkAbstractDataFactory::instance()->create(name));
100 QString type = element.attribute(
"type");
103 }
else if(type ==
"float"){
105 }
else if(type ==
"double"){
111 QString kind = element.attribute(
"kind");
112 if(kind ==
"scalar"){
114 }
else if(type ==
"vector"){
116 }
else if(type ==
"tensor"){
122 QString support = element.attribute(
"support");
125 }
else if(type ==
"cell"){
127 }
else if(type ==
"custom"){
153 if(!axl_reader->
accept(node))
156 axl_reader->dtkAbstractDataReader::read(this->file());
158 if(dtkAbstractData *data = axl_reader->
read(node))
bool reject(const QDomNode &node)
dtkAbstractData * dataByReader(axlAbstractDataReader *axl_reader, const QDomNode &node)
dtkAbstractDataReader * createaxlFieldReader(void)
static bool registered(void)
virtual void update(void)
QString identifier(void) const
virtual axlAbstractData * read(const QDomNode &node)=0
QStringList handled(void) const
Class axlAbstractField defines an API for arrays of numeric data.
virtual void setType(Type type)
Sets the type of the field which can be either int, float or double.
QString description(void) const
virtual void setSupport(Support support)
virtual bool accept(const QDomNode &node)=0
virtual void setKind(Kind kind)
Sets the kind of the field which can be either scalar, vector or tensor.
axlAbstractData * read(const QDomNode &node)
Class axlAbstractData defines an API for all type of axel data.
bool accept(const QDomNode &node)