QtMaterialDialog.hh
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 #ifndef ACG_QTMATERIALDIALOG_HH
00053 #define ACG_QTMATERIALDIALOG_HH
00054
00055
00056
00057
00058
00059 #include "ui_QtMaterialDialogUi.hh"
00060
00061 #include "../Math/VectorT.hh"
00062 #include "../GL/gl.hh"
00063
00064 #include <QColor>
00065 #include <QDialog>
00066
00067
00068
00069
00070 namespace ACG {
00071 namespace SceneGraph {
00072 class MaterialNode;
00073 class BaseNode;
00074 }
00075 }
00076
00077
00078
00079
00080
00081 namespace ACG {
00082 namespace QtWidgets {
00083
00084
00085
00086
00087
00088 class ACGDLLEXPORT QtMaterialDialog : public QDialog
00089 {
00090 Q_OBJECT
00091
00092 public:
00093
00094 QtMaterialDialog( QWidget * _parent,
00095 SceneGraph::MaterialNode * _node );
00096
00097 ~QtMaterialDialog() {}
00098
00099
00100 signals:
00101
00102 void signalNodeChanged( ACG::SceneGraph::BaseNode * _node );
00103
00104 private:
00105
00106
00107 QColor convertColor( Vec4f _color);
00108 Vec4f convertColor( QColor _color);
00109
00110 void setButtonColor( QPushButton * _button,
00111 const Vec4f & _color );
00112
00113 private slots:
00114
00115 void changeBaseColor();
00116 void changeAmbientColor();
00117 void changeDiffuseColor();
00118 void changeSpecularColor();
00119 void changeShine(int _new);
00120 void changePointSize(int _new);
00121 void changeLineWidth(int _new);
00122 void changeRoundPoints(bool _b);
00123 void changeLineSmooth(bool _b);
00124 void changeBackfaceCulling(bool _b);
00125 void changeAlphaTest(bool _b);
00126 void changeAlphaValue(int _new);
00127 void changeBlending(bool _b);
00128 void changeBlendingParam1(const QString& _name);
00129 void changeBlendingParam2(const QString& _name);
00130 void changeColorMaterial(bool _b);
00131 void changeMultiSampling(bool _b);
00132
00133 void changeActive(bool toggle);
00134
00135 void enableProperty();
00136 void enableProperty(int i);
00137
00138 QString paramToStr(GLenum param);
00139
00140 void applyChanges();
00141 void undoChanges();
00142
00143 void reject();
00144
00145 private:
00146
00147
00148
00149 unsigned int applyProperties_;
00150
00151 Vec4f color_, bak_color_,
00152 ambient_, bak_ambient_,
00153 diffuse_, bak_diffuse_,
00154 specular_, bak_specular_;
00155 float shine_, bak_shine_;
00156 float point_size_, bak_point_size_;
00157 float line_width_, bak_line_width_;
00158 bool round_points_, bak_round_points_;
00159 bool line_smooth_, bak_line_smooth_;
00160 bool backfaceCulling_, bak_backfaceCulling_;
00161 bool alphaTest_, bak_alphaTest_;
00162 float alphaValue_, bak_alphaValue_;
00163 bool blending_, bak_blending_;
00164 GLenum blendParam1_, bak_blendParam1_;
00165 GLenum blendParam2_, bak_blendParam2_;
00166 bool colorMaterial_, bak_colorMaterial_;
00167 bool multiSampling_, bak_multiSampling_;
00168
00169 bool baseColorActive_, bak_baseColorActive_;
00170 bool materialActive_, bak_materialActive_;
00171 bool pointSizeActive_, bak_pointSizeActive_;
00172 bool lineWidthActive_, bak_lineWidthActive_;
00173 bool roundPointsActive_, bak_roundPointsActive_;
00174 bool lineSmoothActive_, bak_lineSmoothActive_;
00175 bool alphaTestActive_, bak_alphaTestActive_;
00176 bool blendingActive_, bak_blendingActive_;
00177 bool backfaceCullingActive_, bak_backfaceCullingActive_;
00178 bool colorMaterialActive_, bak_colorMaterialActive_;
00179 bool multiSamplingActive_, bak_multiSamplingActive_;
00180
00181 SceneGraph::MaterialNode * node_;
00182
00183 Ui::QtMaterialDialogUi ui_;
00184
00185 };
00186
00187
00188
00189 }
00190 }
00191
00192 #endif // ACG_QTMATERIALDIALOG_HH defined
00193
00194