21 #ifndef __ctkMaterialPropertyWidget_h
22 #define __ctkMaterialPropertyWidget_h
28 #include "ctkWidgetsExport.h"
30 class ctkMaterialPropertyWidgetPrivate;
31 class QListWidgetItem;
43 Q_PROPERTY(QColor color READ color WRITE setColor);
45 Q_PROPERTY(
double opacity READ opacity WRITE setOpacity);
51 Q_PROPERTY(
double ambient READ ambient WRITE setAmbient);
55 Q_PROPERTY(
double diffuse READ diffuse WRITE setDiffuse);
59 Q_PROPERTY(
double specular READ specular WRITE setSpecular);
62 Q_PROPERTY(
double specularPower READ specularPower WRITE setSpecularPower);
64 Q_PROPERTY(
bool backfaceCulling READ backfaceCulling WRITE setBackfaceCulling);
66 Q_PROPERTY(
bool colorVisible READ isColorVisible WRITE setColorVisible);
68 Q_PROPERTY(
bool opacityVisible READ isOpacityVisible WRITE setOpacityVisible);
70 Q_PROPERTY(
bool backfaceCullingVisible READ isBackfaceCullingVisible WRITE setBackfaceCullingVisible);
83 double opacity()
const;
85 double ambient()
const;
86 double diffuse()
const;
87 double specular()
const;
88 double specularPower()
const;
90 bool backfaceCulling()
const;
98 void addPreset(
const QColor& color,
double opacity,
99 double ambient,
double diffuse,
100 double specular,
double power,
101 const QString& label);
103 bool isColorVisible()
const;
104 void setColorVisible(
bool show);
105 bool isOpacityVisible()
const;
106 void setOpacityVisible(
bool show);
107 bool isBackfaceCullingVisible()
const;
108 void setBackfaceCullingVisible(
bool show);
111 void setColor(
const QColor& newColor);
112 void setOpacity(
double newOpacity);
114 void setAmbient(
double newAmbient);
115 void setDiffuse(
double newDiffuse);
116 void setSpecular(
double newSpecular);
117 void setSpecularPower(
double newSpecularPower);
119 void setBackfaceCulling(
bool enable);
122 void colorChanged(QColor newColor);
123 void opacityChanged(
double newOpacity);
125 void ambientChanged(
double newAmbient);
126 void diffuseChanged(
double newDiffuse);
127 void specularChanged(
double newSpecular);
128 void specularPowerChanged(
double newSpecularPower);
130 void backfaceCullingChanged(
bool newBackfaceCulling);
132 virtual void onColorChanged(
const QColor& newColor);
133 virtual void onOpacityChanged(
double newOpacity);
135 virtual void onAmbientChanged(
double newAmbient);
136 virtual void onDiffuseChanged(
double newDiffuse);
137 virtual void onSpecularChanged(
double newSpecular);
138 virtual void onSpecularPowerChanged(
double newSpecularPower);
140 virtual void onBackfaceCullingChanged(
bool newBackFaceCulling);
142 void selectPreset(QListWidgetItem*);
145 QScopedPointer<ctkMaterialPropertyWidgetPrivate>
d_ptr;
147 virtual void resizeEvent(QResizeEvent* resize);