Version: 9.16.0
GEOMToolsGUI_MaterialPropertiesDlg.h
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
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.
7//
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.
12//
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
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20// File : GEOMToolsGUI_MaterialPropertiesDlg.h
21// Author : Margarita KARPUNINA, Open CASCADE S.A.S. (margarita.karpunina@opencascade.com)
22//
23#ifndef GEOMTOOLSGUI_MATERIALPROPERTIESDLG_H
24#define GEOMTOOLSGUI_MATERIALPROPERTIESDLG_H
25
26#include "GEOM_ToolsGUI.hxx"
27
28#include <QListWidget>
29#include <QtxDialog.h>
30#include "Material_Model.h"
32
33class QCheckBox;
34class QLabel;
35class QPushButton;
36class QtxDoubleSpinBox;
37class QtxColorButton;
39
41{
42 Q_OBJECT
43
44 enum { Current, Global, User };
45 enum { TypeRole = Qt::UserRole + 123, NameRole };
46
47public:
48 GEOMToolsGUI_MaterialPropertiesDlg( QWidget* = 0 , bool = true, bool = false,const int = Standard );
50
51 void accept();
52
53 bool eventFilter( QObject*, QEvent* );
54
55private:
56 void updateState();
57 void toModel( Material_Model& ) const;
58 void fromModel( const Material_Model& );
59 QString findUniqueName( const QString&,
60 QListWidgetItem* = 0,
61 bool = false );
62
63signals:
64 void changed();
65
66private slots:
67 void onChanged();
68 void onMaterialChanged();
69 void onItemChanged( QListWidgetItem* );
70 void onContextMenu( QContextMenuEvent* );
71 void onDeleteMaterial();
72 void onAddMaterial();
73 void onApply();
74 void onHelp();
75 void SetEditCurrentArgument();
76 void SelectionIntoArgument();
77
78private:
79 typedef struct
80 {
81 QCheckBox* enabled;
82 QLabel* label;
83 QtxColorButton* color;
84 QtxDoubleSpinBox* front_coef;
85 QtxDoubleSpinBox* back_coef;
86 } Reflection;
87
89 QCheckBox* myPhysical;
90 QList<Reflection> myReflection;
91 QtxDoubleSpinBox* myFrontShininess;
92 QtxDoubleSpinBox* myBackShininess;
93 QLabel* myColorLab;
94 QtxColorButton* myColor;
95 QPushButton* myAddButton;
96 QPushButton* myDelButton;
101 QPushButton* myPushBtn;
102};
103
105{
106Q_OBJECT
107public:
109protected:
110 void contextMenuEvent( QContextMenuEvent* e );
111signals:
112 void contextMenu( QContextMenuEvent* );
113};
114
115#endif // GEOMTOOLSGUI_MATERIALPROPERTIESDLG_H
#define GEOMTOOLSGUI_EXPORT
Definition: GEOM_ToolsGUI.hxx:37
Internal class, used to handle context menu event from materials list.
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:105
void contextMenuEvent(QContextMenuEvent *e)
Context menu event, emits context menu signal passing event as parameter.
Definition: GEOMToolsGUI_MaterialPropertiesDlg.cxx:79
GEOMToolsGUI_MaterialList(QWidget *parent)
Constructor.
Definition: GEOMToolsGUI_MaterialPropertiesDlg.cxx:72
void contextMenu(QContextMenuEvent *)
GEOM material properties dialog box class.
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:41
QPushButton * myAddButton
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:95
QList< Reflection > myReflection
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:90
QPushButton * myDelButton
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:96
bool myShowSelWidget
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:99
GEOMToolsGUI_MaterialList * myMaterials
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:88
QLineEdit * myLineEditCurArg
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:100
QtxDoubleSpinBox * myFrontShininess
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:91
Material_Model myCurrentModel
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:98
@ Current
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:44
QPushButton * myPushBtn
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:101
QLabel * myColorLab
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:93
QtxColorButton * myColor
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:94
QCheckBox * myPhysical
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:89
QtxDoubleSpinBox * myBackShininess
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:92
Material_ResourceMgr myResourceMgr
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:97
Definition: Material_Model.h:39
Material properties resources manager.
Definition: Material_ResourceMgr.h:35
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:80
QtxColorButton * color
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:83
QCheckBox * enabled
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:81
QLabel * label
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:82
QtxDoubleSpinBox * back_coef
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:85
QtxDoubleSpinBox * front_coef
Definition: GEOMToolsGUI_MaterialPropertiesDlg.h:84