21 #include <dtkCoreSupport/dtkAbstractData.h>
22 #include <dtkCoreSupport/dtkAbstractDataFactory.h>
23 #include <dtkCoreSupport/dtkAbstractProcessFactory.h>
41 return "axlFieldParametricVolumeReader";
46 return "axlFieldParametricVolumeReader";
51 return QStringList() <<
"axlFieldParametricVolume";
61 QDomElement element = node.toElement();
63 if(element.tagName() !=
"field")
71 return !this->
accept(node);
79 dtkWarn() << Q_FUNC_INFO <<
"enter";
80 QDomElement element = node.toElement();
84 QString type = element.attribute(
"type");
91 QString name = element.attribute(
"name");
94 field->setObjectName(name);
98 QString typeField = element.attribute(
"valueType");
99 if(!typeField.isEmpty()){
100 if(typeField ==
"int"){
102 }
else if(typeField ==
"float"){
111 QString support = element.attribute(
"support");
112 if(support ==
"point"){
114 }
else if(support ==
"cell"){
121 QString kind = element.attribute(
"kind");
122 if(kind ==
"scalar"){
124 }
else if(kind ==
"vector"){
132 QDomNodeList listFunction = element.elementsByTagName(
"volume");
133 QDomElement functionDescription = listFunction.at(0).toElement();
135 dtkAbstractData *data = NULL;
137 foreach(QString reader, dtkAbstractDataFactory::instance()->readers()) {
139 data = this->
dataByReader(axl_reader, functionDescription);
160 if(!axl_reader->
accept(node))
163 axl_reader->dtkAbstractDataReader::read(this->file());
165 if(dtkAbstractData *data = axl_reader->
read(node))
~axlFieldParametricVolumeReader(void)
dtkAbstractDataReader * createaxlFieldParametricVolumeReader(void)
void setFunction(axlAbstractData *data)
Sets the Bspline function which determines the values of the parametric field.
virtual axlAbstractData * read(const QDomNode &node)=0
virtual void update(void)
bool accept(const QDomNode &node)
virtual void setType(Type type)
Sets the type of the field which can be either int, float or double.
QString description(void) const
static bool registered(void)
QString identifier(void) const
bool reject(const QDomNode &node)
virtual void setSupport(Support support)
virtual bool accept(const QDomNode &node)=0
QStringList handled(void) const
Class axlFieldParametricVolume defines an API for field which owns a BSpline Volume.
dtkAbstractData * dataByReader(axlAbstractDataReader *axl_reader, const QDomNode &node)
virtual void setKind(Kind kind)
Sets the kind of the field which can be either scalar, vector or tensor.
Class axlAbstractData defines an API for all type of axel data.
axlFieldParametricVolumeReader(void)
axlAbstractData * read(const QDomNode &node)