9 #include <dtkCoreSupport/dtkAbstractData.h>
10 #include <dtkCoreSupport/dtkAbstractDataFactory.h>
29 return "axlSurfaceRevolutionParametricReader";
33 return "axlSurfaceRevolutionParametricReader";
37 return QStringList() <<
"axlSurfaceRevolutionParametric";
45 QDomElement element = node.toElement();
47 if (element.tagName() !=
"surface_revolution_parametric")
54 return !this->
accept(node);
59 QDomElement element = node.toElement();
64 QString name = element.attribute(
"name");
65 if (!name.isEmpty()) {
66 surRev->setObjectName(name);
70 QString color = element.attribute(
"color");
71 if (!color.isEmpty()) {
72 QStringList colorList = color.split(
" ");
73 if (colorList.size() > 2)
74 surRev->
setColor(QColor(colorList.at(0).toInt(), colorList.at(1).toInt(), colorList.at(2).toInt()));
75 if (colorList.size() == 4)
80 QString shader = element.attribute(
"shader");
82 if (!shader.isEmpty()) {
84 dirShader =
":axlShader/shader/" + shader;
85 if (!QFile::exists(dirShader)) {
86 QSettings settings(
"inria",
"dtk");
88 settings.beginGroup(
"shader");
89 dirShader = settings.value(
"path", defaultPath).toString();
90 dirShader.append(
"/" + shader);
96 QString size = element.attribute(
"size");
98 surRev->
setSize(size.toFloat());
102 QDomElement axeElement = element.elementsByTagName(
"axe").at(0).toElement();
108 QDomElement curveElement = element.elementsByTagName(
"curve").at(0).toElement();
109 QString curveReaderTag = curveElement.attribute(
"type")+
"Reader";
115 QDomElement angleElement = element.elementsByTagName(
"angle").at(0).toElement();
116 double startAngle = angleElement.attribute(
"start_angle").toDouble();
117 double endAngle = angleElement.attribute(
"end_angle").toDouble();
118 surRev->
setAngle(startAngle,endAngle);
bool reject(const QDomNode &node)
axlSurfaceRevolutionParametricReader(void)
QStringList handled(void) const
Class axlLine defines 3D lines.
axlAbstractData * read(const QDomNode &node)
virtual ~axlSurfaceRevolutionParametricReader(void)
axlAbstractData * read(const QDomNode &node)
void setShader(const QString &shader)
bool accept(const QDomNode &node)
QString description(void) const
QString identifier(void) const
dtkAbstractDataReader * createaxlSurfaceRevolutionParametricReader(void)
void setAxe(axlLine *line)
virtual axlAbstractData * read(const QDomNode &node)=0
void setCurve(axlAbstractCurve *curve)
void setOpacity(const double &opacity)
void setAngle(double startAngle, double endAngle)
static bool registered(void)
void setSize(const double &size)
void setColor(double r, double g, double b)
Class axlAbstractData defines an API for all type of axel data.