21 #include <dtkCoreSupport/dtkAbstractData.h>
22 #include <dtkCoreSupport/dtkAbstractDataFactory.h>
23 #include <dtkCoreSupport/dtkAbstractProcessFactory.h>
41 return "axlFieldParametricCurveReader";
46 return "axlFieldParametricCurveReader";
51 return QStringList() <<
"axlFieldParametricCurve";
61 QDomElement element = node.toElement();
63 if(element.tagName() !=
"field")
71 return !this->
accept(node);
79 qDebug() << 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(
"curve");
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))
QString identifier(void) const
Class axlFieldParametricCurve defines an API for field which owns a BSpline curve.
axlFieldParametricCurveReader(void)
QString description(void) const
axlAbstractData * read(const QDomNode &node)
dtkAbstractDataReader * createaxlFieldParametricCurveReader(void)
bool reject(const QDomNode &node)
dtkAbstractData * dataByReader(axlAbstractDataReader *axl_reader, const QDomNode &node)
virtual axlAbstractData * read(const QDomNode &node)=0
~axlFieldParametricCurveReader(void)
bool accept(const QDomNode &node)
virtual void update(void)
void setFunction(axlAbstractData *data)
Sets the Bspline function which determines the values of the BSpline field.
QStringList handled(void) const
static bool registered(void)
virtual void setType(Type type)
Sets the type of the field which can be either int, float or double.
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.
Class axlAbstractData defines an API for all type of axel data.