Debian Codegraph @

src/Gui/TextureMapping.h

raw
1 /***************************************************************************
2 * Copyright (c) 2010 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 #ifndef GUI_TEXTUREMAPPING_H
24 #define GUI_TEXTUREMAPPING_H
25
26 #include <Gui/TaskView/TaskDialog.h>
27 #include <Gui/TaskView/TaskView.h>
28 #include <QDialog>
29
30 class SoGroup;
31 class SoTexture2;
32 class SoTextureCoordinateEnvironment;
33
34 namespace Gui
35 {
36 namespace Dialog
37 {
38
39 class Ui_TextureMapping;
40 class GuiExport TextureMapping: public QDialog
41 {
42 Q_OBJECT
43
44 public:
45 explicit TextureMapping(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
46 ~TextureMapping() override;
47 void accept() override;
48 void reject() override;
49
50 private:
51 void onFileChooserFileNameSelected(const QString&);
52 void onCheckEnvToggled(bool);
53
54 protected:
55 void changeEvent(QEvent* e) override;
56 void keyPressEvent(QKeyEvent* e) override;
57
58 private:
59 SoGroup* grp;
60 SoTexture2* tex;
61 SoTextureCoordinateEnvironment* env;
62 QString fileName;
63 Ui_TextureMapping* ui;
64 };
65
66 class TaskTextureMapping: public Gui::TaskView::TaskDialog
67 {
68 Q_OBJECT
69
70 public:
71 TaskTextureMapping();
72 ~TaskTextureMapping() override;
73
74 public:
75 bool accept() override;
76 bool reject() override;
77
78 QDialogButtonBox::StandardButtons getStandardButtons() const override
79 {
80 return QDialogButtonBox::Close;
81 }
82
83 private:
84 TextureMapping* dialog;
85 };
86
87 } // namespace Dialog
88 } // namespace Gui
89
90 #endif // GUI_TEXTUREMAPPING_H