9 #include <dtkCoreSupport/dtkAbstractData.h>
10 #include <dtkCoreSupport/dtkAbstractDataFactory.h>
29 return "axlCompositeCurveReader";
33 return "axlCompositeCurveReader";
37 return QStringList() <<
"axlCompositeCurve";
45 QDomElement element = node.toElement();
47 if (element.tagName() !=
"composite_curve")
54 return !this->
accept(node);
59 QDomElement element = node.toElement();
64 QString name = element.attribute(
"name");
65 if (!name.isEmpty()) {
66 comCur->setObjectName(name);
70 QString color = element.attribute(
"color");
71 if (!color.isEmpty()) {
72 QStringList colorList = color.split(
" ");
73 if (colorList.size() > 2)
74 comCur->
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 comCur->
setSize(size.toFloat());
101 QList<axlAbstractCurve *> curveList;
102 QDomNodeList curvelistElement = element.elementsByTagName(
"curve");
103 for(
int i = 0; i<curvelistElement.size(); i++)
105 QDomElement curveElement = curvelistElement.at(i).toElement();
106 QString curveReaderTag = curveElement.attribute(
"type")+
"Reader";
109 curveList.append(curve);
void setShader(const QString &shader)
dtkAbstractDataReader * createaxlCompositeCurveReader(void)
void insert_list_curves(const QList< axlAbstractCurve > &data_curves)
axlAbstractData * read(const QDomNode &node)
virtual axlAbstractData * read(const QDomNode &node)=0
static bool registered(void)
bool reject(const QDomNode &node)
axlCompositeCurveReader(void)
QString identifier(void) const
void setOpacity(const double &opacity)
QString description(void) const
void setSize(const double &size)
void setColor(double r, double g, double b)
QStringList handled(void) const
bool accept(const QDomNode &node)
Class axlAbstractData defines an API for all type of axel data.
virtual ~axlCompositeCurveReader(void)