Debian Codegraph @

src/Gui/View3DSettings.h

raw
1 /***************************************************************************
2 * Copyright (c) 2023 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_VIEW3DSETTINGS_H
24 #define GUI_VIEW3DSETTINGS_H
25
26 #include <Base/Parameter.h>
27 #include <QApplication>
28
29 namespace Gui
30 {
31 class View3DInventorViewer;
32
33 class GuiExport View3DSettings: public ParameterGrp::ObserverType
34 {
35 public:
36 static constexpr auto defaultHeadLightDirection = "(0.6841049,-0.12062616,-0.7193398)";
37 static constexpr auto defaultFillLightDirection = "(-0.6403416,0.7631294,0.087155744)";
38 static constexpr auto defaultBackLightDirection = "(-0.7544065,-0.63302225,-0.17364818)";
39
40 View3DSettings(ParameterGrp::handle hGrp, View3DInventorViewer*);
41 View3DSettings(ParameterGrp::handle hGrp, const std::vector<View3DInventorViewer*>&);
42 ~View3DSettings() override;
43
44 /// Observer message from the ParameterGrp
45 void OnChange(ParameterGrp::SubjectType& rCaller, ParameterGrp::MessageType Reason) override;
46 void applySettings();
47 int stopAnimatingIfDeactivated() const;
48
49 bool ignoreNavigationStyle = false;
50 bool ignoreVBO = false;
51 bool ignoreDimensions = false;
52 bool ignoreRenderCache = false;
53 bool ignoreTransparent = false;
54
55 private:
56 ParameterGrp::handle hGrp;
57 ParameterGrp::handle hLightSourcesGrp;
58
59 std::vector<View3DInventorViewer*> _viewers;
60 };
61
62 class NaviCubeSettings
63 {
64 Q_DECLARE_TR_FUNCTIONS(NaviCubeSettings)
65 public:
66 NaviCubeSettings(ParameterGrp::handle hGrp, View3DInventorViewer*);
67 ~NaviCubeSettings();
68
69 void applySettings();
70
71 private:
72 void parameterChanged(ParameterGrp::MessageType pName);
73 ParameterGrp::handle hGrp;
74 View3DInventorViewer* _viewer;
75 boost::signals2::connection connectParameterChanged;
76 };
77
78 } // namespace Gui
79
80 #endif // GUI_VIEW3DSETTINGS_H