19 #include <dtkCoreSupport/dtkAbstractData.h>
20 #include <dtkCoreSupport/dtkAbstractDataFactory.h>
38 return "axlFieldSpatialCoordinatesWriter";
43 return "axlFieldSpatialCoordinatesWriter";
48 return QStringList() <<
"axlAbstractField" <<
"axlAbstractFieldSpatial" <<
"axlFieldSpatialCoordinates";
67 return !this->
accept(data);
74 QDomElement fieldElement = doc->createElement(
"field");
77 fieldElement.setAttribute(
"type", field->
identifier());
80 for(
int i = 0; i < 3;i++){
82 QDomElement parameter = doc->createElement(
"parameter");
83 parameter.setAttribute(
"value", QString::number(field->
parameter(i)));
84 parameter.setAttribute(
"channel", QString::number(i));
85 parameter.setAttribute(
"type",
"double");
86 fieldElement.appendChild(parameter);
95 QDomElement axlFieldSpatialCoordinatesWriter::elementByWriter(
axlAbstractDataWriter *axl_writer, QDomDocument *doc, dtkAbstractData *data)
102 if(!axl_writer->
accept(data))
105 element = axl_writer->
write(doc, data);
axlFieldSpatialCoordinatesWriter(void)
QStringList handled(void) const
virtual bool accept(dtkAbstractData *data)=0
QString description(void) const
Class axlFieldSpatialCoordinates defines an API for spatial field. The value are computed as follow :...
QString identifier(void) const
Returns the identifier of the field which is "axlFieldSpatialCoordinates".
static bool registered(void)
bool reject(dtkAbstractData *data)
QString identifier(void) const
double parameter(int channel)
Returns the channel-th parameter value.
bool accept(dtkAbstractData *data)
~axlFieldSpatialCoordinatesWriter(void)
QDomElement write(QDomDocument *doc, dtkAbstractData *data)
virtual QDomElement write(QDomDocument *doc, dtkAbstractData *data)=0
dtkAbstractDataWriter * createaxlFieldSpatialCoordinatesWriter(void)