| 1 |
/*************************************************************************** |
| 2 |
* Copyright (c) 2006 Werner Mayer <wmayer[at]users.sourceforge.net> * |
| 3 |
* * |
| 4 |
* This file is part of the FreeCAD CAx development system. * |
| 5 |
* * |
| 6 |
* This library is free software; you can redistribute it and/or * |
| 7 |
* modify it under the terms of the GNU Library General Public * |
| 8 |
* License as published by the Free Software Foundation; either * |
| 9 |
* version 2 of the License, or (at your option) any later version. * |
| 10 |
* * |
| 11 |
* This library is distributed in the hope that it will be useful, * |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 14 |
* GNU Library General Public License for more details. * |
| 15 |
* * |
| 16 |
* You should have received a copy of the GNU Library General Public * |
| 17 |
* License along with this library; see the file COPYING.LIB. If not, * |
| 18 |
* write to the Free Software Foundation, Inc., 59 Temple Place, * |
| 19 |
* Suite 330, Boston, MA 02111-1307, USA * |
| 20 |
* * |
| 21 |
***************************************************************************/ |
| 22 |
|
| 23 |
|
| 24 |
#ifndef GUI_DIALOG_DLGMATERIALPROPERTIES_IMP_H |
| 25 |
#define GUI_DIALOG_DLGMATERIALPROPERTIES_IMP_H |
| 26 |
|
| 27 |
#include <QDialog> |
| 28 |
#include <memory> |
| 29 |
#include <vector> |
| 30 |
#include <App/Material.h> |
| 31 |
|
| 32 |
namespace Base |
| 33 |
{ |
| 34 |
class Color; |
| 35 |
} |
| 36 |
|
| 37 |
namespace App |
| 38 |
{ |
| 39 |
class Material; |
| 40 |
} |
| 41 |
|
| 42 |
namespace Gui |
| 43 |
{ |
| 44 |
class ViewProvider; |
| 45 |
|
| 46 |
namespace Dialog |
| 47 |
{ |
| 48 |
class Ui_DlgMaterialProperties; |
| 49 |
|
| 50 |
class GuiExport DlgMaterialPropertiesImp: public QDialog |
| 51 |
{ |
| 52 |
Q_OBJECT |
| 53 |
|
| 54 |
public: |
| 55 |
explicit DlgMaterialPropertiesImp(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); |
| 56 |
~DlgMaterialPropertiesImp() override; |
| 57 |
App::Material getCustomMaterial() const; |
| 58 |
void setCustomMaterial(const App::Material& mat); |
| 59 |
App::Material getDefaultMaterial() const; |
| 60 |
void setDefaultMaterial(const App::Material& mat); |
| 61 |
|
| 62 |
private: |
| 63 |
void setupConnections(); |
| 64 |
void onAmbientColorChanged(); |
| 65 |
void onDiffuseColorChanged(); |
| 66 |
void onEmissiveColorChanged(); |
| 67 |
void onSpecularColorChanged(); |
| 68 |
void onShininessValueChanged(int); |
| 69 |
void onTransparencyValueChanged(int); |
| 70 |
void onButtonReset(); |
| 71 |
void onButtonDefault(); |
| 72 |
void setButtonColors(const App::Material& mat); |
| 73 |
|
| 74 |
private: |
| 75 |
std::unique_ptr<Ui_DlgMaterialProperties> ui; |
| 76 |
App::Material customMaterial; |
| 77 |
App::Material defaultMaterial; |
| 78 |
}; |
| 79 |
|
| 80 |
} // namespace Dialog |
| 81 |
} // namespace Gui |
| 82 |
|
| 83 |
#endif // GUI_DIALOG_DLGMATERIALPROPERTIES_IMP_H |