1 // Copyright (C) 2007-2012 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 <QListWidget>
29 #include <QtxDialog.h>
30 #include "Material_Model.h"
31 #include "Material_ResourceMgr.h"
36 class QtxDoubleSpinBox;
38 class GEOMToolsGUI_MaterialList;
40 class GEOMTOOLSGUI_EXPORT GEOMToolsGUI_MaterialPropertiesDlg : public QtxDialog
44 enum { Current, Global, User };
45 enum { TypeRole = Qt::UserRole + 123, NameRole };
48 GEOMToolsGUI_MaterialPropertiesDlg( QWidget* = 0 );
49 ~GEOMToolsGUI_MaterialPropertiesDlg();
53 bool eventFilter( QObject*, QEvent* );
57 void toModel( Material_Model& ) const;
58 void fromModel( const Material_Model& );
59 QString findUniqueName( const QString&,
68 void onMaterialChanged();
69 void onItemChanged( QListWidgetItem* );
70 void onContextMenu( QContextMenuEvent* );
71 void onDeleteMaterial();
80 QtxColorButton* color;
81 QtxDoubleSpinBox* coef;
85 GEOMToolsGUI_MaterialList* myMaterials;
86 QCheckBox* myPhysical;
87 QList<Reflection> myReflection;
88 QtxDoubleSpinBox* myShininess;
90 QtxColorButton* myColor;
91 QPushButton* myAddButton;
92 QPushButton* myDelButton;
93 Material_ResourceMgr myResourceMgr;
94 Material_Model myCurrentModel;
97 class GEOMToolsGUI_MaterialList : public QListWidget
101 GEOMToolsGUI_MaterialList( QWidget* parent );
103 void contextMenuEvent( QContextMenuEvent* e );
105 void contextMenu( QContextMenuEvent* );
108 #endif // GEOMTOOLSGUI_MATERIALPROPERTIESDLG_H