24 #include <dtkCoreSupport/dtkGlobal.h>
87 axlLight::axlLight(
double x,
double y,
double z, QObject *parent) : dtkAbstractData(), d(new axlLightPrivate)
102 d->specular[0] = 1.0;
103 d->specular[1] = 1.0;
104 d->specular[2] = 1.0;
109 axlLight::axlLight(
double *position,
double *ambiant,
double *diffuse,
double *specular,
double exponent, QObject *parent)
113 for(
int i = 0; i < 3; i++)
115 d->position[i] = position[i];
116 d->ambiant[i] = ambiant[i];
117 d->diffuse[i] = diffuse[i];
118 d->specular[i] = specular[i];
131 this->setParent(other.parent());
132 d->position[0] = other.d->position[0];
133 d->position[1] = other.d->position[1];
134 d->position[2] = other.d->position[2];
136 d->ambiant[0] = other.d->ambiant[0];
137 d->ambiant[1] = other.d->ambiant[1];
138 d->ambiant[2] = other.d->ambiant[2];
140 d->diffuse[0] = other.d->diffuse[0];
141 d->diffuse[1] = other.d->diffuse[1];
142 d->diffuse[2] = other.d->diffuse[2];
144 d->specular[0] = other.d->specular[0];
145 d->specular[1] = other.d->specular[1];
146 d->specular[2] = other.d->specular[2];
148 d->exponent = other.d->exponent;
170 return d->position[0];
179 return d->position[1];
188 return d->position[2];
222 for (
int i =0; i < 3 ; i ++)
228 for (
int i =0; i < 3 ; i ++)
234 for (
int i =0; i < 3 ; i ++)
240 for (
int i =0; i < 3 ; i ++)
298 QString position(QString(
"position: (%1, %2, %3)\n").arg(light.
position()[0]).arg(light.
position()[1]).arg(light.
position()[2]));
299 QString ambiant(QString(
"ambiant: (%1, %2, %3)\n").arg(light.
ambiant()[0]).arg(light.
ambiant()[1]).arg(light.
ambiant()[2]));
300 QString diffuse(QString(
"diffuse: (%1, %2, %3)\n").arg(light.
diffuse()[0]).arg(light.
diffuse()[1]).arg(light.
diffuse()[2]));
301 QString specular(QString(
"specular: (%1, %2, %3)\n").arg(light.
specular()[0]).arg(light.
specular()[1]).arg(light.
specular()[2]));
302 QString exponent(QString(
"exponent: (%1)").arg(light.
exponent()));
304 dbg.nospace() << QString(
"axlLight:\n") << position << ambiant << diffuse << specular<<exponent;
311 QString position(QString(
"position: (%1, %2, %3)\n").arg(light.
position()[0]).arg(light.
position()[1]).arg(light.
position()[2]));
312 QString ambiant(QString(
"ambiant: (%1, %2, %3)\n").arg(light.
ambiant()[0]).arg(light.
ambiant()[1]).arg(light.
ambiant()[2]));
313 QString diffuse(QString(
"diffuse: (%1, %2, %3)\n").arg(light.
diffuse()[0]).arg(light.
diffuse()[1]).arg(light.
diffuse()[2]));
314 QString specular(QString(
"specular: (%1, %2, %3)\n").arg(light.
specular()[0]).arg(light.
specular()[1]).arg(light.
specular()[2]));
315 QString exponent(QString(
"exponent: (%1)").arg(light.
exponent()));
317 dbg.nospace() << QString(
"axlLight:\n") << position << ambiant << diffuse << specular<<exponent;
324 QString position(QString(
"position: (%1, %2, %3)\n").arg(light->
position()[0]).arg(light->
position()[1]).arg(light->
position()[2]));
325 QString ambiant(QString(
"ambiant: (%1, %2, %3)\n").arg(light->
ambiant()[0]).arg(light->
ambiant()[1]).arg(light->
ambiant()[2]));
326 QString diffuse(QString(
"diffuse: (%1, %2, %3)\n").arg(light->
diffuse()[0]).arg(light->
diffuse()[1]).arg(light->
diffuse()[2]));
327 QString specular(QString(
"specular: (%1, %2, %3)\n").arg(light->
specular()[0]).arg(light->
specular()[1]).arg(light->
specular()[2]));
328 QString exponent(QString(
"exponent: (%1)").arg(light->
exponent()));
330 dbg.nospace() << QString(
"axlLight:\n") << position << ambiant << diffuse << specular<<exponent;
Class axlPoint defines 3D points.
void setOpacity(const double &opacity)
axlLight(QObject *parent=0)
Constructs a axel light of zero position with parent parent of QObject type.
double x(void) const
Returns x-coordinate of this light.
double * coordinates(void) const
Returns coordinates of this point.
void onPositionChanged(axlPoint *position)
void setDiffuse(axlPoint *diffuse)
double y(void) const
Returns y-coordinate of this light.
void setShader(const QString &shader)
virtual QString description(void) const
~axlLight(void)
Destroys the axel light.
double z(void) const
Returns z-coordinate of this light.
void setPosition(axlPoint *position)
double * position(void) const
Returns position of this light.
double * diffuse(void) const
void setExponent(double position)
const QColor & color(void) const
void setColor(const QColor &color)
const QString & shader(void) const
Class axlLight defines 3D lights.
double exponent(void) const
QDebug operator<<(QDebug dbg, axlLight light)
void setAmbiant(axlPoint *ambiant)
double * ambiant(void) const
double * specular(void) const
const double & opacity(void) const
void setSpecular(axlPoint *specular)