Developer documentation | Axl-2.5.1

axlLight.h
Go to the documentation of this file.
1 /* axlLight.h ---
2  *
3  * Author: Meriadeg Perrinel
4  * Copyright (C) 2008 - Meriadeg Perrinel, Inria.
5  * Created: Tue Nov 9 16:58:59 2010 (+0100)
6  * Version: $Id$
7  * Last-Updated: Mon Dec 6 15:46:18 2010 (+0100)
8  * By: Meriadeg Perrinel
9  * Update #: 21
10  */
11 
12 /* Commentary:
13  * There is choice table for stock coordinate. But maybe that is nos the good solution if algorithm behin use a lot of point.
14  * In this case, we have to create three double directly instead of table
15  */
16 
17 /* Change log:
18  *
19  */
20 
21 #ifndef axlLight_H
22 #define axlLight_H
23 
24 #include "axlCoreExport.h"
25 
26 #include <QtCore>
27 
28 #include <dtkCoreSupport/dtkAbstractData.h>
29 
30 class axlLightPrivate;
31 class axlPoint;
32 
33 class AXLCORE_EXPORT axlLight : public dtkAbstractData
34 {
35  Q_OBJECT
36  Q_PROPERTY(QColor color READ color WRITE setColor )
37  Q_PROPERTY(double opacity READ opacity WRITE setOpacity )
38  Q_PROPERTY(QString shader READ shader WRITE setShader )
39 
40 public:
41  axlLight(QObject *parent = 0);
42  axlLight(double x, double y, double z=0, QObject *parent = 0);
43  axlLight(double *position, double *ambiant, double *diffuse, double *specular, double exponent, QObject *parent = 0);
44  axlLight(const axlLight& other);
45  ~axlLight(void);
46 
47  virtual QString description(void) const;
48 
49  double x(void) const;
50  double y(void) const;
51  double z(void) const;
52  double *position(void) const;
53  double *ambiant(void) const;
54  double *diffuse(void) const;
55  double *specular(void) const;
56  double exponent(void) const;
57 
58  void setPosition(axlPoint *position);
59  void setAmbiant(axlPoint *ambiant);
60  void setDiffuse(axlPoint *diffuse);
61  void setSpecular(axlPoint *specular);
62  void setExponent(double position);
63 
64 
65 
66 public slots:
67  void onPositionChanged(axlPoint *position);
68 
69 
70 public:
71  const QColor& color(void) const;
72  const double& opacity(void) const;
73  const QString& shader(void) const;
74 
75 public slots:
76 
77  void setColor(const QColor& color);
78  void setOpacity(const double& opacity);
79  void setShader(const QString& shader);
80 
81 
82 private:
83  axlLightPrivate *d;
84 };
85 
86 // /////////////////////////////////////////////////////////////////
87 // Debug operators
88 // /////////////////////////////////////////////////////////////////
89 
90 QDebug operator<<(QDebug dbg, axlLight point);
91 QDebug operator<<(QDebug dbg, axlLight& point);
92 QDebug operator<<(QDebug dbg, axlLight *point);
93 
94 #endif // axlLight_H
Class axlPoint defines 3D points.
Definition: axlPoint.h:34
Class axlLight defines 3D lights.
Definition: axlLight.h:33
#define AXLCORE_EXPORT