1 // Copyright (C) 2007-2016 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, or (at your option) any later version.
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 , bool = true, bool = false,const int = Standard );
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();
75 void SetEditCurrentArgument();
76 void SelectionIntoArgument();
83 QtxColorButton* color;
84 QtxDoubleSpinBox* front_coef;
85 QtxDoubleSpinBox* back_coef;
88 GEOMToolsGUI_MaterialList* myMaterials;
89 QCheckBox* myPhysical;
90 QList<Reflection> myReflection;
91 QtxDoubleSpinBox* myFrontShininess;
92 QtxDoubleSpinBox* myBackShininess;
94 QtxColorButton* myColor;
95 QPushButton* myAddButton;
96 QPushButton* myDelButton;
97 Material_ResourceMgr myResourceMgr;
98 Material_Model myCurrentModel;
100 QLineEdit* myLineEditCurArg;
101 QPushButton* myPushBtn;
104 class GEOMToolsGUI_MaterialList : public QListWidget
108 GEOMToolsGUI_MaterialList( QWidget* parent );
110 void contextMenuEvent( QContextMenuEvent* e );
112 void contextMenu( QContextMenuEvent* );
115 #endif // GEOMTOOLSGUI_MATERIALPROPERTIESDLG_H