5 #include <dtkCoreSupport/dtkAbstractData.h>
6 #include <dtkCoreSupport/dtkAbstractDataFactory.h>
20 return "axlTabulatedCylinderWriter";
24 return "axlTabulatedCylinderWriter";
28 return QStringList() <<
"axlTabulatedCylinder";
44 return !this->
accept(data);
51 QDomElement surElement = doc->createElement(
"tabulated_cylinder");
52 surElement.setAttribute(
"name", tabCyl->name());
55 surElement.setAttribute(
"size", QString::number(tabCyl->
size()));
58 QColor qcolor = tabCyl->
color();
60 QTextStream(&color) << QString::number(qcolor.red()) <<
" "
61 << QString::number(qcolor.green()) <<
" "
62 << QString::number(qcolor.blue()) <<
" "
63 << QString::number(tabCyl->
opacity());
64 surElement.setAttribute(
"color", color);
67 QString shader = tabCyl->
shader();
68 QFileInfo shaderFileInfo(shader);
69 surElement.setAttribute(
"shader", shaderFileInfo.fileName());
72 QDomElement generatrixElement = doc->createElement(
"generatrix");
76 generatrixElement.appendChild(subGenElement);
77 surElement.appendChild(generatrixElement);
79 QDomElement directrixElement = doc->createElement(
"directrix");
83 directrixElement.appendChild(subDirElement);
84 directrixElement.setAttribute(
"type",tabCyl->
get_pt_directrix()->identifier());
85 surElement.appendChild(directrixElement);
91 QDomElement axlTabulatedCylinderWriter::elementByWriter(
axlAbstractDataWriter *axl_writer, QDomDocument *doc, dtkAbstractData *data) {
97 if(!axl_writer->
accept(data))
100 element = axl_writer->
write(doc, data);
static bool registered(void)
virtual bool accept(dtkAbstractData *data)=0
bool accept(dtkAbstractData *data)
bool reject(dtkAbstractData *data)
axlPoint * get_pt_generatrix()
QStringList handled(void) const
axlTabulatedCylinderWriter(void)
virtual ~axlTabulatedCylinderWriter(void)
QString description(void) const
virtual QString identifier(void) const
axlAbstractCurve * get_pt_directrix() const
QString identifier(void) const
dtkAbstractDataWriter * createaxlTabulatedCylinderWriter(void)
QDomElement write(QDomDocument *doc, dtkAbstractData *data)
virtual QDomElement write(QDomDocument *doc, dtkAbstractData *data)=0