Debian Codegraph @

src/Gui/Inventor/SoFCBackgroundGradient.h

raw
1 /***************************************************************************
2 * Copyright (c) 2005 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_SOFCBACKGROUNDGRADIENT_H
24 #define GUI_SOFCBACKGROUNDGRADIENT_H
25
26 #include <Inventor/SbColor.h>
27 #include <Inventor/nodes/SoNode.h>
28 #include <Inventor/nodes/SoSubNode.h>
29 #include <FCGlobal.h>
30
31
32 class SbColor;
33 class SoGLRenderAction;
34
35 namespace Gui
36 {
37
38 class GuiExport SoFCBackgroundGradient: public SoNode
39 {
40 using inherited = SoNode;
41
42 SO_NODE_HEADER(Gui::SoFCBackgroundGradient);
43
44 public:
45 enum Gradient
46 {
47 LINEAR = 0,
48 RADIAL = 1
49 };
50 static void initClass();
51 static void finish();
52 SoFCBackgroundGradient();
53
54 void GLRender(SoGLRenderAction* action) override;
55 void setGradient(Gradient grad);
56 Gradient getGradient() const;
57 void setColorGradient(const SbColor& fromColor, const SbColor& toColor);
58 void setColorGradient(const SbColor& fromColor, const SbColor& toColor, const SbColor& midColor);
59
60 private:
61 Gradient gradient;
62
63 protected:
64 ~SoFCBackgroundGradient() override;
65
66 SbColor fCol, tCol, mCol;
67 };
68
69 } // namespace Gui
70
71
72 #endif // GUI_SOFCBACKGROUNDGRADIENT_H