1 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : GEOMToolsGUI_MaterialPropertiesDlg.h
21 // Author : Margarita KARPUNINA, Open CASCADE S.A.S. (margarita.karpunina@opencascade.com)
23 #ifndef GEOMTOOLSGUI_MATERIALPROPERTIESDLG_H
24 #define GEOMTOOLSGUI_MATERIALPROPERTIESDLG_H
26 #include "GEOM_ToolsGUI.hxx"
28 #include <QtxDialog.h>
36 class QListWidgetItem;
42 class QtxDoubleSpinBox;
45 class Material_ResourceMgr;
47 class GEOMTOOLSGUI_EXPORT GEOMToolsGUI_MaterialPropertiesDlg : public QtxDialog
51 enum { Current, Default, Global, User };
52 enum { TypeRole = Qt::UserRole + 123, NameRole };
54 //! Enumeration of viewer types
61 GEOMToolsGUI_MaterialPropertiesDlg( QWidget* = 0 );
62 ~GEOMToolsGUI_MaterialPropertiesDlg();
67 void keyPressEvent( QKeyEvent* );
70 Material_ResourceMgr* resourceMgr();
72 void fromModel( Material_Model* );
73 void toModel( Material_Model* ) const;
74 void toFrontModel( Material_Model* ) const;
75 void toBackModel( Material_Model* ) const;
77 QString findUniqueName( const QString&,
81 bool isFrontTabActive() const;
84 void materialChanged();
92 void onBackMaterialChecked( bool );
93 void onCurrentTabChanged( int );
94 void onMaterialChanged();
96 void onItemChanged( QListWidgetItem* );
97 void onReflectionTypeToggled( bool );
101 Material_ResourceMgr* myResMgr;
103 QCheckBox* myBackMaterialCheck;
105 //! Current material model for front material
106 Material_Model* myCurrentModelF;
108 //! Current material model for back material
109 Material_Model* myCurrentModelB;
111 QListWidget* myMaterialList;
112 int myMaterialListFId;
113 int myMaterialListBId;
115 QTabWidget* myMaterialTab;
116 QWidget* myMaterialBWidget;
117 bool myIsBTabWasActivated;
119 //! Controls defining front material properties
120 QGroupBox* myAmbientGroupF;
121 QtxColorButton* myAmbientColorF;
122 QtxDoubleSpinBox* myAmbientCoefntF;
124 QGroupBox* myDiffuseGroupF;
125 QtxColorButton* myDiffuseColorF;
126 QtxDoubleSpinBox* myDiffuseCoefntF;
128 QGroupBox* mySpecularGroupF;
129 QtxColorButton* mySpecularColorF;
130 QtxDoubleSpinBox* mySpecularCoefntF;
132 QGroupBox* myEmissionGroupF;
133 QtxColorButton* myEmissionColorF;
134 QtxDoubleSpinBox* myEmissionCoefntF;
136 QtxDoubleSpinBox* myShininessF;
138 //! Controls defining back material properties
139 QGroupBox* myAmbientGroupB;
140 QtxColorButton* myAmbientColorB;
141 QtxDoubleSpinBox* myAmbientCoefntB;
143 QGroupBox* myDiffuseGroupB;
144 QtxColorButton* myDiffuseColorB;
145 QtxDoubleSpinBox* myDiffuseCoefntB;
147 QGroupBox* mySpecularGroupB;
148 QtxColorButton* mySpecularColorB;
149 QtxDoubleSpinBox* mySpecularCoefntB;
151 QGroupBox* myEmissionGroupB;
152 QtxColorButton* myEmissionColorB;
153 QtxDoubleSpinBox* myEmissionCoefntB;
155 QtxDoubleSpinBox* myShininessB;
157 QString myHelpFileName;
159 ViewerType myViewerType;
163 #endif // GEOMTOOLSGUI_MATERIALPROPERTIESDLG_H