9 #include <dtkCoreSupport/dtkAbstractData.h>
10 #include <dtkCoreSupport/dtkAbstractDataFactory.h>
26 return "axlTabulatedCylinderReader";
30 return "axlTabulatedCylinderReader";
34 return QStringList() <<
"axlTabulatedCylinder";
42 QDomElement element = node.toElement();
44 if (element.tagName() !=
"tabulated_cylinder")
51 return !this->
accept(node);
56 QDomElement element = node.toElement();
61 QString name = element.attribute(
"name");
62 if (!name.isEmpty()) {
63 tabCyl->setObjectName(name);
67 QString color = element.attribute(
"color");
68 if (!color.isEmpty()) {
69 QStringList colorList = color.split(
" ");
70 if (colorList.size() > 2)
71 tabCyl->
setColor(QColor(colorList.at(0).toInt(), colorList.at(1).toInt(), colorList.at(2).toInt()));
72 if (colorList.size() == 4)
77 QString shader = element.attribute(
"shader");
79 if (!shader.isEmpty()) {
81 dirShader =
":axlShader/shader/" + shader;
82 if (!QFile::exists(dirShader)) {
83 QSettings settings(
"inria",
"dtk");
85 settings.beginGroup(
"shader");
86 dirShader = settings.value(
"path", defaultPath).toString();
87 dirShader.append(
"/" + shader);
93 QString size = element.attribute(
"size");
95 tabCyl->
setSize(size.toFloat());
99 QDomNode genElement = element.elementsByTagName(
"generatrix").at(0);
101 QDomElement ptElement = genElement.toElement();
102 QString ptReaderTag =
"axlPointReader";
108 QDomElement dirElement = element.elementsByTagName(
"directrix").at(0).toElement();
109 QString curveReaderTag = dirElement.attribute(
"type")+
"Reader";
Class axlPoint defines 3D points.
axlAbstractData * read(const QDomNode &node)
QString description(void) const
bool reject(const QDomNode &node)
void setShader(const QString &shader)
dtkAbstractDataReader * createaxlTabulatedCylinderReader(void)
bool accept(const QDomNode &node)
axlTabulatedCylinderReader(void)
virtual axlAbstractData * read(const QDomNode &node)=0
void set_generatrix(const axlPoint &vector)
static bool registered(void)
virtual ~axlTabulatedCylinderReader(void)
QStringList handled(void) const
void setOpacity(const double &opacity)
QString identifier(void) const
void setSize(const double &size)
void setColor(double r, double g, double b)
Class axlAbstractData defines an API for all type of axel data.
void set_directrix(axlAbstractCurve *curve)