geom/src/GEOMToolsGUI/GEOMToolsGUI_MaterialPropertiesDlg.h

116 lines
3.7 KiB
C
Raw Normal View History

2021-03-22 21:09:08 +05:00
// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
2012-08-09 13:58:02 +06:00
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
2014-02-18 12:44:41 +06:00
// version 2.1 of the License, or (at your option) any later version.
2012-08-09 13:58:02 +06:00
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : GEOMToolsGUI_MaterialPropertiesDlg.h
// Author : Margarita KARPUNINA, Open CASCADE S.A.S. (margarita.karpunina@opencascade.com)
//
#ifndef GEOMTOOLSGUI_MATERIALPROPERTIESDLG_H
#define GEOMTOOLSGUI_MATERIALPROPERTIESDLG_H
#include "GEOM_ToolsGUI.hxx"
#include <QListWidget>
#include <QtxDialog.h>
#include "Material_Model.h"
#include "Material_ResourceMgr.h"
class QCheckBox;
class QLabel;
class QPushButton;
class QtxDoubleSpinBox;
class QtxColorButton;
class GEOMToolsGUI_MaterialList;
class GEOMTOOLSGUI_EXPORT GEOMToolsGUI_MaterialPropertiesDlg : public QtxDialog
{
Q_OBJECT
enum { Current, Global, User };
enum { TypeRole = Qt::UserRole + 123, NameRole };
public:
2013-02-12 17:35:16 +06:00
GEOMToolsGUI_MaterialPropertiesDlg( QWidget* = 0 , bool = true, bool = false,const int = Standard );
2012-08-09 13:58:02 +06:00
~GEOMToolsGUI_MaterialPropertiesDlg();
void accept();
bool eventFilter( QObject*, QEvent* );
private:
void updateState();
void toModel( Material_Model& ) const;
void fromModel( const Material_Model& );
QString findUniqueName( const QString&,
2013-06-17 18:15:50 +06:00
QListWidgetItem* = 0,
bool = false );
2012-08-09 13:58:02 +06:00
signals:
void changed();
private slots:
void onChanged();
void onMaterialChanged();
void onItemChanged( QListWidgetItem* );
void onContextMenu( QContextMenuEvent* );
void onDeleteMaterial();
void onAddMaterial();
void onApply();
void onHelp();
2013-02-12 17:35:16 +06:00
void SetEditCurrentArgument();
void SelectionIntoArgument();
2012-08-09 13:58:02 +06:00
private:
typedef struct
{
2013-02-12 17:35:16 +06:00
QCheckBox* enabled;
2012-08-09 13:58:02 +06:00
QLabel* label;
QtxColorButton* color;
2013-02-12 17:35:16 +06:00
QtxDoubleSpinBox* front_coef;
QtxDoubleSpinBox* back_coef;
2012-08-09 13:58:02 +06:00
} Reflection;
GEOMToolsGUI_MaterialList* myMaterials;
QCheckBox* myPhysical;
QList<Reflection> myReflection;
2013-02-12 17:35:16 +06:00
QtxDoubleSpinBox* myFrontShininess;
QtxDoubleSpinBox* myBackShininess;
2012-08-09 13:58:02 +06:00
QLabel* myColorLab;
QtxColorButton* myColor;
QPushButton* myAddButton;
QPushButton* myDelButton;
Material_ResourceMgr myResourceMgr;
Material_Model myCurrentModel;
2013-02-12 17:35:16 +06:00
bool myShowSelWidget;
QLineEdit* myLineEditCurArg;
QPushButton* myPushBtn;
2012-08-09 13:58:02 +06:00
};
class GEOMToolsGUI_MaterialList : public QListWidget
{
Q_OBJECT
public:
GEOMToolsGUI_MaterialList( QWidget* parent );
protected:
void contextMenuEvent( QContextMenuEvent* e );
signals:
void contextMenu( QContextMenuEvent* );
};
#endif // GEOMTOOLSGUI_MATERIALPROPERTIESDLG_H