21 #include <dtkCoreSupport/dtkAbstractData.h>
22 #include <dtkCoreSupport/dtkAbstractDataFactory.h>
23 #include <dtkCoreSupport/dtkAbstractProcessFactory.h>
41 return "axlFieldDiscreteReader";
46 return "axlFieldDiscreteReader";
51 return QStringList() <<
"axlFieldDiscrete";
56 return dtkAbstractDataFactory::instance()->registerDataReaderType(
"axlFieldDiscreteReader", QStringList(),
createaxlFieldDiscreteReader);
61 QDomElement element = node.toElement();
63 if(element.tagName() !=
"field")
71 return !this->
accept(node);
79 QDomElement element = node.toElement();
90 QString count = element.attribute(
"count");
93 countNumb = count.toInt();
98 QString dimension = element.attribute(
"dimension");
100 if(!dimension.isEmpty()){
101 int dim = dimension.toInt();
115 QString support = element.attribute(
"support");
117 if(!support.isEmpty()){
118 if(support ==
"point"){
121 }
else if(support ==
"cell"){
131 QString name = element.attribute(
"name");
133 name =
"axlFieldDiscrete";
157 QString *text_fields;
158 int size = field->
size();
159 text_fields =
new QString(element.text());
161 QTextStream in_fields(text_fields);
165 for(
int i = 0 ; i < size ; i++)
167 in_fields.skipWhiteSpace();
174 for(
int i = 0 ; i < size ; i++)
176 in_fields.skipWhiteSpace();
178 in_fields.skipWhiteSpace();
180 in_fields.skipWhiteSpace();
186 for(
int i = 0 ; i < size ; i++)
188 in_fields.skipWhiteSpace();
190 in_fields.skipWhiteSpace();
192 in_fields.skipWhiteSpace();
194 in_fields.skipWhiteSpace();
196 in_fields.skipWhiteSpace();
198 in_fields.skipWhiteSpace();
200 in_fields.skipWhiteSpace();
202 in_fields.skipWhiteSpace();
204 in_fields.skipWhiteSpace();
206 field->
setTensor(i, v1, v2, v3, v4, v5, v6, v7, v8, v9);
axlFieldDiscreteReader(void)
virtual void update(void)
QStringList handled(void) const
virtual void setVector(int index, double v1, double v2, double v3)
static bool registered(void)
bool reject(const QDomNode &node)
virtual void setScalar(int index, double v1)
axlAbstractData * read(const QDomNode &node)
virtual void setSize(int size)
dtkAbstractDataReader * createaxlFieldDiscreteReader(void)
Class axlFieldDiscrete 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.
virtual void setSupport(Support support)
QString identifier(void) const
virtual void setTensor(int index, double v1, double v2, double v3, double v4, double v5, double v6, double v7, double v8, double v9)
~axlFieldDiscreteReader(void)
bool accept(const QDomNode &node)
virtual void setKind(Kind kind)
Sets the kind of the field which can be either scalar, vector or tensor.
QString description(void) const
Class axlAbstractData defines an API for all type of axel data.