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();
66 bool eventFilter( QObject*, QEvent* );
69 Material_ResourceMgr* resourceMgr();
71 void fromModel( Material_Model* );
72 void toModel( Material_Model* ) const;
73 void toFrontModel( Material_Model* ) const;
74 void toBackModel( Material_Model* ) const;
76 QString findUniqueName( const QString&,
80 bool isFrontTabActive() const;
83 void materialChanged();
91 void onBackMaterialChecked( bool );
92 void onCurrentTabChanged( int );
93 void onMaterialChanged();
95 void onItemChanged( QListWidgetItem* );
96 void onReflectionTypeToggled( bool );
100 Material_ResourceMgr* myResMgr;
102 QCheckBox* myBackMaterialCheck;
104 //! Current material model for front material
105 Material_Model* myCurrentModelF;
107 //! Current material model for back material
108 Material_Model* myCurrentModelB;
110 QListWidget* myMaterialList;
111 int myMaterialListFId;
112 int myMaterialListBId;
114 QTabWidget* myMaterialTab;
115 QWidget* myMaterialBWidget;
116 bool myIsBTabWasActivated;
118 //! Controls defining front material properties
119 QGroupBox* myAmbientGroupF;
120 QtxColorButton* myAmbientColorF;
121 QtxDoubleSpinBox* myAmbientCoefntF;
123 QGroupBox* myDiffuseGroupF;
124 QtxColorButton* myDiffuseColorF;
125 QtxDoubleSpinBox* myDiffuseCoefntF;
127 QGroupBox* mySpecularGroupF;
128 QtxColorButton* mySpecularColorF;
129 QtxDoubleSpinBox* mySpecularCoefntF;
131 QGroupBox* myEmissionGroupF;
132 QtxColorButton* myEmissionColorF;
133 QtxDoubleSpinBox* myEmissionCoefntF;
135 QtxDoubleSpinBox* myShininessF;
137 //! Controls defining back material properties
138 QGroupBox* myAmbientGroupB;
139 QtxColorButton* myAmbientColorB;
140 QtxDoubleSpinBox* myAmbientCoefntB;
142 QGroupBox* myDiffuseGroupB;
143 QtxColorButton* myDiffuseColorB;
144 QtxDoubleSpinBox* myDiffuseCoefntB;
146 QGroupBox* mySpecularGroupB;
147 QtxColorButton* mySpecularColorB;
148 QtxDoubleSpinBox* mySpecularCoefntB;
150 QGroupBox* myEmissionGroupB;
151 QtxColorButton* myEmissionColorB;
152 QtxDoubleSpinBox* myEmissionCoefntB;
154 QtxDoubleSpinBox* myShininessB;
156 QString myHelpFileName;
158 ViewerType myViewerType;
162 #endif // GEOMTOOLSGUI_MATERIALPROPERTIESDLG_H