7 #include <dtkCoreSupport/dtkAbstractData.h>
8 #include <dtkCoreSupport/dtkAbstractDataFactory.h>
22 return "axlSurfaceRevolutionWriter";
26 return "axlSurfaceRevolutionWriter";
30 return QStringList() <<
"axlSurfaceRevolution";
46 return !this->
accept(data);
53 QDomElement surElement = doc->createElement(
"surface_revolution");
54 surElement.setAttribute(
"name", surRev->name());
57 surElement.setAttribute(
"size", QString::number(surRev->
size()));
60 QColor qcolor = surRev->
color();
62 QTextStream(&color) << QString::number(qcolor.red()) <<
" "
63 << QString::number(qcolor.green()) <<
" "
64 << QString::number(qcolor.blue()) <<
" "
65 << QString::number(surRev->
opacity());
66 surElement.setAttribute(
"color", color);
69 QString shader = surRev->
shader();
70 QFileInfo shaderFileInfo(shader);
71 surElement.setAttribute(
"shader", shaderFileInfo.fileName());
74 QDomElement axeElement = doc->createElement(
"axe");
77 QDomElement lineElement = axeWriter->
write(doc, axe);
78 axeElement.appendChild(lineElement);
79 surElement.appendChild(axeElement);
82 QDomElement curvesElement = doc->createElement(
"curves");
84 QList<axlAbstractCurve*> curves = surRev->
getCurves();
86 for(
int i = 0; i<curves.size(); i++)
88 QDomElement curveElement = doc->createElement(
"curve");
89 QString curveWriterTag = curves.at(i)->identifier()+
"Writer";
91 QDomElement subCurveElement = curveWriter->
write(doc, curves.at(i));
92 curveElement.appendChild(subCurveElement);
93 curveElement.setAttribute(
"type",curves.at(i)->identifier());
94 curvesElement.appendChild(curveElement);
96 surElement.appendChild(curvesElement);
99 QDomElement angleElement = doc->createElement(
"angle");
102 angleElement.setAttribute(
"start_angle",startAngle);
103 angleElement.setAttribute(
"end_angle",endAngle);
104 surElement.appendChild(angleElement);
112 QDomElement axlSurfaceRevolutionWriter::elementByWriter(
axlAbstractDataWriter *axl_writer, QDomDocument *doc, dtkAbstractData *data) {
118 if(!axl_writer->
accept(data))
121 element = axl_writer->
write(doc, data);
virtual ~axlSurfaceRevolutionWriter(void)
static bool registered(void)
Class axlLine defines 3D lines.
virtual bool accept(dtkAbstractData *data)=0
QList< axlAbstractCurve * > getCurves()
bool reject(dtkAbstractData *data)
QString description(void) const
bool accept(dtkAbstractData *data)
axlSurfaceRevolutionWriter(void)
QDomElement write(QDomDocument *doc, dtkAbstractData *data)
dtkAbstractDataWriter * createaxlSurfaceRevolutionWriter(void)
QStringList handled(void) const
virtual QDomElement write(QDomDocument *doc, dtkAbstractData *data)=0
QString identifier(void) const