Blender  V2.93
NodeLight.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
24 #include "Node.h"
25 
26 #include "../geometry/Geom.h"
27 
28 #include "../system/FreestyleConfig.h"
29 
30 namespace Freestyle {
31 
32 using namespace Geometry;
33 
34 class NodeLight : public Node {
35  public:
36  NodeLight();
37  NodeLight(NodeLight &iBrother);
38 
39  virtual ~NodeLight()
40  {
41  }
42 
44  virtual void accept(SceneVisitor &v);
45 
47  inline const float *ambient() const
48  {
49  return Ambient;
50  }
51 
52  inline const float *diffuse() const
53  {
54  return Diffuse;
55  }
56 
57  inline const float *specular() const
58  {
59  return Specular;
60  }
61 
62  inline const float *position() const
63  {
64  return Position;
65  }
66 
67  inline bool isOn() const
68  {
69  return on;
70  }
71 
72  inline int number() const
73  {
74  return _number;
75  }
76 
77  private:
78  // Data members
79  // ============
80 
82  bool on;
83 
85  float Ambient[4];
86  float Diffuse[4];
87  float Specular[4];
88 
90  float Position[4];
91 
97  static int numberOfLights;
99  int _number;
100 };
101 
102 } /* namespace Freestyle */
Abstract class for scene graph nodes. Inherits from BaseObject which defines the addRef release mecha...
ATTR_WARN_UNUSED_RESULT const BMVert * v
const float * position() const
Definition: NodeLight.h:62
const float * diffuse() const
Definition: NodeLight.h:52
const float * ambient() const
Definition: NodeLight.h:47
const float * specular() const
Definition: NodeLight.h:57
bool isOn() const
Definition: NodeLight.h:67
virtual ~NodeLight()
Definition: NodeLight.h:39
int number() const
Definition: NodeLight.h:72
inherits from class Rep
Definition: AppCanvas.cpp:32