Blender V4.3
NodeCamera.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
12#include "Node.h"
13
14#include "../geometry/Geom.h"
15
17
18namespace Freestyle {
19
20using namespace Geometry;
21
22class NodeOrthographicCamera;
23
24class NodePerspectiveCamera;
25
26class NodeCamera : public Node {
27 public:
33
35 NodeCamera(CameraType camera_type = GENERIC);
36#if 0 /* UNUSED, gives warning in gcc */
37 NodeCamera(const NodeCamera &iBrother);
38#endif
39
40 virtual ~NodeCamera() {}
41
43 virtual void accept(SceneVisitor &v);
44
46 void setModelViewMatrix(const double modelview_matrix[16]);
47
49 void setProjectionMatrix(const double projection_matrix[16]);
50
52 {
53 return modelview_matrix_;
54 }
55
57 {
58 return projection_matrix_;
59 }
60
61 protected:
62 // row major right handed matrix
64 // row major right handed matrix
66
68
69#ifdef WITH_CXX_GUARDEDALLOC
70 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:NodeCamera")
71#endif
72};
73
75 public:
77
93 double left, double right, double bottom, double top, double zNear, double zFar);
94
95 double left() const
96 {
97 return left_;
98 }
99
100 double right() const
101 {
102 return right_;
103 }
104
105 double bottom() const
106 {
107 return bottom_;
108 }
109
110 double top() const
111 {
112 return top_;
113 }
114
115 double zNear() const
116 {
117 return zNear_;
118 }
119
120 double zFar() const
121 {
122 return zFar_;
123 }
124
126
127 private:
128 double left_;
129 double right_;
130 double bottom_;
131 double top_;
132 double zNear_;
133 double zFar_;
134
135#ifdef WITH_CXX_GUARDEDALLOC
136 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:NodeOrthographicCamera")
137#endif
138};
139
141 public:
143
164 NodePerspectiveCamera(double fovy, double aspect, double zNear, double zFar);
165
197 double left, double right, double bottom, double top, double zNear, double zFar);
198
199#ifdef WITH_CXX_GUARDEDALLOC
200 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:NodePerspectiveCamera")
201#endif
202};
203
204} /* namespace Freestyle */
Configuration definitions.
Vectors and Matrices (useful type definitions)
Abstract class for scene graph nodes. Inherits from BaseObject which defines the addRef release mecha...
ATTR_WARN_UNUSED_RESULT const BMVert * v
CameraType camera_type_
Definition NodeCamera.h:67
double projection_matrix_[16]
Definition NodeCamera.h:65
void setModelViewMatrix(const double modelview_matrix[16])
virtual void accept(SceneVisitor &v)
double modelview_matrix_[16]
Definition NodeCamera.h:63
NodeCamera(CameraType camera_type=GENERIC)
double * modelViewMatrix()
Definition NodeCamera.h:51
double * projectionMatrix()
Definition NodeCamera.h:56
void setProjectionMatrix(const double projection_matrix[16])
NodeOrthographicCamera(const NodeOrthographicCamera &iBrother)=default
CameraType
inherits from class Rep
Definition AppCanvas.cpp:20