25 #include <dtkCoreSupport/dtkAbstractData.h>
26 #include <dtkCoreSupport/dtkAbstractDataFactory.h>
45 return "axlPointWriter";
50 return "axlPointWriter";
55 return QStringList() <<
"axlPoint";
60 return dtkAbstractDataFactory::instance()->registerDataWriterType(
"axlPointWriter", QStringList(),
createaxlPointWriter);
74 return !this->
accept(data);
82 QDomElement pointElement = doc->createElement(
"point");
83 pointElement.setAttribute(
"name",point->name());
87 pointElement.setAttribute(
"size", QString::number(point->
size()));
92 QColor qcolor = point->
color();
94 QTextStream(&color) << QString::number(qcolor.red()) <<
" "
95 << QString::number(qcolor.green()) <<
" "
96 << QString::number(qcolor.blue());
98 QTextStream(&color) <<
" " << QString::number(point->
opacity());
99 pointElement.setAttribute(
"color", color);
102 QString shader = point->
shader();
103 QFileInfo shaderFileInfo(shader);
104 pointElement.setAttribute(
"shader", shaderFileInfo.fileName());
108 QTextStream(&pointValue) << QString::number(point->
x()) <<
" "<< QString::number(point->
y()) <<
" "<< QString::number(point->
z());
110 QDomText pointDomText = doc->createTextNode(pointValue);
112 pointElement.appendChild(pointDomText);
115 if(!point->
fields().isEmpty()){
118 QDomElement fieldElement = field_writer->
write(doc, field);
119 pointElement.appendChild(fieldElement);
127 QDomElement axlPointWriter::elementByWriter(
axlAbstractDataWriter *axl_writer, QDomDocument *doc, dtkAbstractData *data)
134 if(!axl_writer->
accept(data))
137 element = axl_writer->
write(doc, data);
Class axlPoint defines 3D points.
virtual bool accept(dtkAbstractData *data)=0
static axlFieldWritersFactory * instance(void)
dtkAbstractDataWriter * createaxlPointWriter(void)
virtual QString identifier(void) const
QString description(void) const
QStringList handled(void) const
static bool registered(void)
dtkAbstractDataWriter * create(const QString &interface_name)
QString identifier(void) const
Class axlAbstractField defines an API for arrays of numeric data.
bool accept(dtkAbstractData *data)
bool reject(dtkAbstractData *data)
QList< axlAbstractField * > fields(void)
virtual QDomElement write(QDomDocument *doc, dtkAbstractData *data)=0
QDomElement write(QDomDocument *doc, dtkAbstractData *data)