Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
igl::opengl::ViewerCore Class Reference

#include <src/libigl/igl/opengl/ViewerCore.h>

Public Types

enum  RotationType { ROTATION_TYPE_TRACKBALL = 0 , ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP = 1 , ROTATION_TYPE_NO_ROTATION = 2 , NUM_ROTATION_TYPES = 3 }
 

Public Member Functions

IGL_INLINE ViewerCore ()
 
IGL_INLINE void init ()
 
IGL_INLINE void shut ()
 
IGL_INLINE void InitSerialization ()
 
IGL_INLINE void align_camera_center (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F)
 
IGL_INLINE void get_scale_and_shift_to_fit_mesh (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, float &zoom, Eigen::Vector3f &shift)
 
IGL_INLINE void align_camera_center (const Eigen::MatrixXd &V)
 
IGL_INLINE void get_scale_and_shift_to_fit_mesh (const Eigen::MatrixXd &V, float &zoom, Eigen::Vector3f &shift)
 
IGL_INLINE void clear_framebuffers ()
 
IGL_INLINE void draw (ViewerData &data, bool update_matrices=true)
 
IGL_INLINE void draw_buffer (ViewerData &data, bool update_matrices, Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > &R, Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > &G, Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > &B, Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > &A)
 
IGL_INLINE void set_rotation_type (const RotationType &value)
 

Public Attributes

Eigen::Vector4f background_color
 
Eigen::Vector3f light_position
 
float lighting_factor
 
RotationType rotation_type
 
Eigen::Quaternionf trackball_angle
 
float camera_base_zoom
 
float camera_zoom
 
bool orthographic
 
Eigen::Vector3f camera_base_translation
 
Eigen::Vector3f camera_translation
 
Eigen::Vector3f camera_eye
 
Eigen::Vector3f camera_up
 
Eigen::Vector3f camera_center
 
float camera_view_angle
 
float camera_dnear
 
float camera_dfar
 
bool depth_test
 
bool is_animating
 
double animation_max_fps
 
float object_scale
 
Eigen::Vector4f viewport
 
Eigen::Matrix4f view
 
Eigen::Matrix4f proj
 
Eigen::Matrix4f norm
 

Detailed Description

Member Enumeration Documentation

◆ RotationType

Enumerator
ROTATION_TYPE_TRACKBALL 
ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP 
ROTATION_TYPE_NO_ROTATION 
NUM_ROTATION_TYPES 
86 {
91 };
@ ROTATION_TYPE_TRACKBALL
Definition ViewerCore.h:87
@ NUM_ROTATION_TYPES
Definition ViewerCore.h:90
@ ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP
Definition ViewerCore.h:88
@ ROTATION_TYPE_NO_ROTATION
Definition ViewerCore.h:89

Constructor & Destructor Documentation

◆ ViewerCore()

IGL_INLINE igl::opengl::ViewerCore::ViewerCore ( )
352{
353 // Default colors
354 background_color << 0.3f, 0.3f, 0.5f, 1.0f;
355
356 // Default lights settings
357 light_position << 0.0f, 0.3f, 0.0f;
358 lighting_factor = 1.0f; //on
359
360 // Default trackball
363
364 // Camera parameters
365 camera_base_zoom = 1.0f;
366 camera_zoom = 1.0f;
367 orthographic = false;
368 camera_view_angle = 45.0;
369 camera_dnear = 1.0;
370 camera_dfar = 100.0;
371 camera_base_translation << 0, 0, 0;
372 camera_translation << 0, 0, 0;
373 camera_eye << 0, 0, 5;
374 camera_center << 0, 0, 0;
375 camera_up << 0, 1, 0;
376
377 depth_test = true;
378
379 is_animating = false;
380 animation_max_fps = 30.;
381
382 viewport.setZero();
383}
IGL_INLINE void set_rotation_type(const RotationType &value)
Definition ViewerCore.cpp:336
Eigen::Vector3f light_position
Definition ViewerCore.h:100
bool is_animating
Definition ViewerCore.h:122
bool depth_test
Definition ViewerCore.h:119
float camera_dnear
Definition ViewerCore.h:116
bool orthographic
Definition ViewerCore.h:109
float camera_base_zoom
Definition ViewerCore.h:107
Eigen::Quaternionf trackball_angle
Definition ViewerCore.h:104
Eigen::Vector3f camera_eye
Definition ViewerCore.h:112
Eigen::Vector3f camera_center
Definition ViewerCore.h:114
float camera_view_angle
Definition ViewerCore.h:115
Eigen::Vector4f viewport
Definition ViewerCore.h:129
float lighting_factor
Definition ViewerCore.h:101
Eigen::Vector3f camera_base_translation
Definition ViewerCore.h:110
Eigen::Vector4f background_color
Definition ViewerCore.h:97
Eigen::Vector3f camera_up
Definition ViewerCore.h:113
float camera_dfar
Definition ViewerCore.h:117
float camera_zoom
Definition ViewerCore.h:108
Eigen::Vector3f camera_translation
Definition ViewerCore.h:111
double animation_max_fps
Definition ViewerCore.h:123
static EIGEN_DEVICE_FUNC Quaternion< Scalar > Identity()
Definition Quaternion.h:111

References Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::Identity(), and ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP.

+ Here is the call graph for this function:

Member Function Documentation

◆ align_camera_center() [1/2]

IGL_INLINE void igl::opengl::ViewerCore::align_camera_center ( const Eigen::MatrixXd &  V)
59{
60 if(V.rows() == 0)
61 return;
62
64 // Rather than crash on empty mesh...
65 if(V.size() > 0)
66 {
67 object_scale = (V.colwise().maxCoeff() - V.colwise().minCoeff()).norm();
68 }
69}
float object_scale
Definition ViewerCore.h:126
Eigen::Matrix4f norm
Definition ViewerCore.h:134
IGL_INLINE void get_scale_and_shift_to_fit_mesh(const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, float &zoom, Eigen::Vector3f &shift)
Definition ViewerCore.cpp:37

◆ align_camera_center() [2/2]

IGL_INLINE void igl::opengl::ViewerCore::align_camera_center ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F 
)
25{
26 if(V.rows() == 0)
27 return;
28
30 // Rather than crash on empty mesh...
31 if(V.size() > 0)
32 {
33 object_scale = (V.colwise().maxCoeff() - V.colwise().minCoeff()).norm();
34 }
35}

References camera_base_translation, camera_base_zoom, get_scale_and_shift_to_fit_mesh(), norm, and object_scale.

Referenced by igl::opengl::glfw::imgui::ImGuiMenu::draw_viewer_menu(), igl::opengl::glfw::Viewer::launch_init(), and igl::opengl::glfw::Viewer::load_mesh_from_file().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clear_framebuffers()

IGL_INLINE void igl::opengl::ViewerCore::clear_framebuffers ( )
89{
90 glClearColor(background_color[0],
94 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
95}

Referenced by igl::opengl::glfw::Viewer::draw().

+ Here is the caller graph for this function:

◆ draw()

IGL_INLINE void igl::opengl::ViewerCore::draw ( ViewerData data,
bool  update_matrices = true 
)
100{
101 using namespace std;
102 using namespace Eigen;
103
104 if (depth_test)
105 glEnable(GL_DEPTH_TEST);
106 else
107 glDisable(GL_DEPTH_TEST);
108
109 glEnable(GL_BLEND);
110 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
111
112 /* Bind and potentially refresh mesh/line/point data */
113 if (data.dirty)
114 {
115 data.updateGL(data, data.invert_normals,data.meshgl);
116 data.dirty = MeshGL::DIRTY_NONE;
117 }
118 data.meshgl.bind_mesh();
119
120 // Initialize uniform
121 glViewport(viewport(0), viewport(1), viewport(2), viewport(3));
122
123 if(update_matrices)
124 {
125 view = Eigen::Matrix4f::Identity();
126 proj = Eigen::Matrix4f::Identity();
127 norm = Eigen::Matrix4f::Identity();
128
129 float width = viewport(2);
130 float height = viewport(3);
131
132 // Set view
134 view = view
137
138 norm = view.inverse().transpose();
139
140 // Set projection
141 if (orthographic)
142 {
143 float length = (camera_eye - camera_center).norm();
144 float h = tan(camera_view_angle/360.0 * igl::PI) * (length);
145 ortho(-h*width/height, h*width/height, -h, h, camera_dnear, camera_dfar,proj);
146 }
147 else
148 {
149 float fH = tan(camera_view_angle / 360.0 * igl::PI) * camera_dnear;
150 float fW = fH * (double)width/(double)height;
151 frustum(-fW, fW, -fH, fH, camera_dnear, camera_dfar,proj);
152 }
153 }
154
155 // Send transformations to the GPU
156 GLint viewi = glGetUniformLocation(data.meshgl.shader_mesh,"view");
157 GLint proji = glGetUniformLocation(data.meshgl.shader_mesh,"proj");
158 GLint normi = glGetUniformLocation(data.meshgl.shader_mesh,"normal_matrix");
159 glUniformMatrix4fv(viewi, 1, GL_FALSE, view.data());
160 glUniformMatrix4fv(proji, 1, GL_FALSE, proj.data());
161 glUniformMatrix4fv(normi, 1, GL_FALSE, norm.data());
162
163 // Light parameters
164 GLint specular_exponenti = glGetUniformLocation(data.meshgl.shader_mesh,"specular_exponent");
165 GLint light_position_eyei = glGetUniformLocation(data.meshgl.shader_mesh,"light_position_eye");
166 GLint lighting_factori = glGetUniformLocation(data.meshgl.shader_mesh,"lighting_factor");
167 GLint fixed_colori = glGetUniformLocation(data.meshgl.shader_mesh,"fixed_color");
168 GLint texture_factori = glGetUniformLocation(data.meshgl.shader_mesh,"texture_factor");
169
170 glUniform1f(specular_exponenti, data.shininess);
171 glUniform3fv(light_position_eyei, 1, light_position.data());
172 glUniform1f(lighting_factori, lighting_factor); // enables lighting
173 glUniform4f(fixed_colori, 0.0, 0.0, 0.0, 0.0);
174
175 if (data.V.rows()>0)
176 {
177 // Render fill
178 if (data.show_faces)
179 {
180 // Texture
181 glUniform1f(texture_factori, data.show_texture ? 1.0f : 0.0f);
182 data.meshgl.draw_mesh(true);
183 glUniform1f(texture_factori, 0.0f);
184 }
185
186 // Render wireframe
187 if (data.show_lines)
188 {
189 glLineWidth(data.line_width);
190 glUniform4f(fixed_colori,
191 data.line_color[0],
192 data.line_color[1],
193 data.line_color[2], 1.0f);
194 data.meshgl.draw_mesh(false);
195 glUniform4f(fixed_colori, 0.0f, 0.0f, 0.0f, 0.0f);
196 }
197 }
198
199 if (data.show_overlay)
200 {
201 if (data.show_overlay_depth)
202 glEnable(GL_DEPTH_TEST);
203 else
204 glDisable(GL_DEPTH_TEST);
205
206 if (data.lines.rows() > 0)
207 {
208 data.meshgl.bind_overlay_lines();
209 viewi = glGetUniformLocation(data.meshgl.shader_overlay_lines,"view");
210 proji = glGetUniformLocation(data.meshgl.shader_overlay_lines,"proj");
211
212 glUniformMatrix4fv(viewi, 1, GL_FALSE, view.data());
213 glUniformMatrix4fv(proji, 1, GL_FALSE, proj.data());
214 // This must be enabled, otherwise glLineWidth has no effect
215 glEnable(GL_LINE_SMOOTH);
216 glLineWidth(data.line_width);
217
218 data.meshgl.draw_overlay_lines();
219 }
220
221 if (data.points.rows() > 0)
222 {
223 data.meshgl.bind_overlay_points();
224 viewi = glGetUniformLocation(data.meshgl.shader_overlay_points,"view");
225 proji = glGetUniformLocation(data.meshgl.shader_overlay_points,"proj");
226
227 glUniformMatrix4fv(viewi, 1, GL_FALSE, view.data());
228 glUniformMatrix4fv(proji, 1, GL_FALSE, proj.data());
229 glPointSize(data.point_size);
230
231 data.meshgl.draw_overlay_points();
232 }
233
234 glEnable(GL_DEPTH_TEST);
235 }
236
237}
EIGEN_DEVICE_FUNC const TanReturnType tan() const
Definition ArrayCwiseUnaryOps.h:234
@ DIRTY_NONE
Definition MeshGL.h:30
Eigen::Matrix4f proj
Definition ViewerCore.h:133
Eigen::Matrix4f view
Definition ViewerCore.h:132
int GLint
Definition glu-libtess.h:58
#define GL_FALSE
Definition glu-libtess.h:71
Definition LDLT.h:16
UniformScaling< float > Scaling(float s)
Definition Scaling.h:121
Translation< float, 3 > Translation3f
Definition Translation.h:176
coord_t width(const BoundingBox &box)
Definition Arrange.cpp:539
coord_t height(const BoundingBox &box)
Definition Arrange.cpp:540
constexpr auto data(C &c) -> decltype(c.data())
Definition span.hpp:195
double length(std::vector< SurfacePoint > &path)
Definition exact_geodesic.cpp:1682
IGL_INLINE void look_at(const Eigen::PlainObjectBase< Derivedeye > &eye, const Eigen::PlainObjectBase< Derivedcenter > &center, const Eigen::PlainObjectBase< Derivedup > &up, Eigen::PlainObjectBase< DerivedR > &R)
Definition look_at.cpp:15
const double PI
Definition PI.h:16
IGL_INLINE void frustum(const typename DerivedP::Scalar left, const typename DerivedP::Scalar right, const typename DerivedP::Scalar bottom, const typename DerivedP::Scalar top, const typename DerivedP::Scalar nearVal, const typename DerivedP::Scalar farVal, Eigen::PlainObjectBase< DerivedP > &P)
Definition frustum.cpp:10
IGL_INLINE void ortho(const typename DerivedP::Scalar left, const typename DerivedP::Scalar right, const typename DerivedP::Scalar bottom, const typename DerivedP::Scalar top, const typename DerivedP::Scalar nearVal, const typename DerivedP::Scalar farVal, Eigen::PlainObjectBase< DerivedP > &P)
Definition ortho.cpp:11
STL namespace.

References igl::opengl::MeshGL::DIRTY_NONE, igl::frustum(), GL_FALSE, igl::look_at(), igl::ortho(), igl::PI, Eigen::Scaling(), and tan().

Referenced by igl::opengl::glfw::Viewer::draw().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ draw_buffer()

IGL_INLINE void igl::opengl::ViewerCore::draw_buffer ( ViewerData data,
bool  update_matrices,
Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > &  R,
Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > &  G,
Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > &  B,
Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > &  A 
)
245{
246 assert(R.rows() == G.rows() && G.rows() == B.rows() && B.rows() == A.rows());
247 assert(R.cols() == G.cols() && G.cols() == B.cols() && B.cols() == A.cols());
248
249 unsigned width = R.rows();
250 unsigned height = R.cols();
251
252 // https://learnopengl.com/Advanced-OpenGL/Anti-Aliasing
253 unsigned int framebuffer;
254 glGenFramebuffers(1, &framebuffer);
255 glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
256 // create a multisampled color attachment texture
257 unsigned int textureColorBufferMultiSampled;
258 glGenTextures(1, &textureColorBufferMultiSampled);
259 glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, textureColorBufferMultiSampled);
260 glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 4, GL_RGBA, width, height, GL_TRUE);
261 glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, 0);
262 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, textureColorBufferMultiSampled, 0);
263 // create a (also multisampled) renderbuffer object for depth and stencil attachments
264 unsigned int rbo;
265 glGenRenderbuffers(1, &rbo);
266 glBindRenderbuffer(GL_RENDERBUFFER, rbo);
267 glRenderbufferStorageMultisample(GL_RENDERBUFFER, 4, GL_DEPTH24_STENCIL8, width, height);
268 glBindRenderbuffer(GL_RENDERBUFFER, 0);
269 glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rbo);
270 assert(glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE);
271 glBindFramebuffer(GL_FRAMEBUFFER, 0);
272
273 // configure second post-processing framebuffer
274 unsigned int intermediateFBO;
275 glGenFramebuffers(1, &intermediateFBO);
276 glBindFramebuffer(GL_FRAMEBUFFER, intermediateFBO);
277 // create a color attachment texture
278 unsigned int screenTexture;
279 glGenTextures(1, &screenTexture);
280 glBindTexture(GL_TEXTURE_2D, screenTexture);
281 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
282 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
283 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
284 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, screenTexture, 0); // we only need a color buffer
285 assert(glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE);
286 glBindFramebuffer(GL_FRAMEBUFFER, 0);
287
288 glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
289
290 // Clear the buffer
291 glClearColor(background_color(0), background_color(1), background_color(2), 0.f);
292 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
293 // Save old viewport
294 Eigen::Vector4f viewport_ori = viewport;
295 viewport << 0,0,width,height;
296 // Draw
297 draw(data,update_matrices);
298 // Restore viewport
299 viewport = viewport_ori;
300
301 glBindFramebuffer(GL_READ_FRAMEBUFFER, framebuffer);
302 glBindFramebuffer(GL_DRAW_FRAMEBUFFER, intermediateFBO);
303 glBlitFramebuffer(0, 0, width, height, 0, 0, width, height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
304
305 glBindFramebuffer(GL_FRAMEBUFFER, intermediateFBO);
306 // Copy back in the given Eigen matrices
307 GLubyte* pixels = (GLubyte*)calloc(width*height*4,sizeof(GLubyte));
308 glReadPixels(0, 0,width, height,GL_RGBA, GL_UNSIGNED_BYTE, pixels);
309
310 // Clean up
311 glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
312 glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
313 glBindFramebuffer(GL_FRAMEBUFFER, 0);
314 glDeleteTextures(1, &screenTexture);
315 glDeleteTextures(1, &textureColorBufferMultiSampled);
316 glDeleteFramebuffers(1, &framebuffer);
317 glDeleteFramebuffers(1, &intermediateFBO);
318 glDeleteRenderbuffers(1, &rbo);
319
320 int count = 0;
321 for (unsigned j=0; j<height; ++j)
322 {
323 for (unsigned i=0; i<width; ++i)
324 {
325 R(i,j) = pixels[count*4+0];
326 G(i,j) = pixels[count*4+1];
327 B(i,j) = pixels[count*4+2];
328 A(i,j) = pixels[count*4+3];
329 ++count;
330 }
331 }
332 // Clean up
333 free(pixels);
334}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index cols() const
Definition PlainObjectBase.h:153
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rows() const
Definition PlainObjectBase.h:151
IGL_INLINE void draw(ViewerData &data, bool update_matrices=true)
Definition ViewerCore.cpp:97
void free(void *)
unsigned char GLubyte
Definition glu-libtess.h:60
#define GL_TRUE
Definition glu-libtess.h:70
IGL_INLINE void count(const Eigen::SparseMatrix< XType > &X, const int dim, Eigen::SparseVector< SType > &S)
Definition count.cpp:12

References Eigen::PlainObjectBase< Derived >::cols(), igl::count(), free(), GL_TRUE, and Eigen::PlainObjectBase< Derived >::rows().

+ Here is the call graph for this function:

◆ get_scale_and_shift_to_fit_mesh() [1/2]

IGL_INLINE void igl::opengl::ViewerCore::get_scale_and_shift_to_fit_mesh ( const Eigen::MatrixXd &  V,
const Eigen::MatrixXi &  F,
float &  zoom,
Eigen::Vector3f &  shift 
)
42{
43 if (V.rows() == 0)
44 return;
45
46 Eigen::MatrixXd BC;
47 if (F.rows() <= 1)
48 {
49 BC = V;
50 } else
51 {
52 igl::barycenter(V,F,BC);
53 }
54 return get_scale_and_shift_to_fit_mesh(BC,zoom,shift);
55}
@ F
Definition libslic3r.h:102
IGL_INLINE void barycenter(const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedBC > &BC)
Definition barycenter.cpp:14

References igl::barycenter().

Referenced by align_camera_center().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_scale_and_shift_to_fit_mesh() [2/2]

IGL_INLINE void igl::opengl::ViewerCore::get_scale_and_shift_to_fit_mesh ( const Eigen::MatrixXd &  V,
float &  zoom,
Eigen::Vector3f &  shift 
)
75{
76 if (V.rows() == 0)
77 return;
78
79 auto min_point = V.colwise().minCoeff();
80 auto max_point = V.colwise().maxCoeff();
81 auto centroid = (0.5*(min_point + max_point)).eval();
82 shift.setConstant(0);
83 shift.head(centroid.size()) = -centroid.cast<float>();
84 zoom = 2.0 / (max_point-min_point).array().abs().maxCoeff();
85}
IGL_INLINE void centroid(const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< Derivedc > &c, Derivedvol &vol)
Definition centroid.cpp:16

References igl::centroid().

+ Here is the call graph for this function:

◆ init()

IGL_INLINE void igl::opengl::ViewerCore::init ( )
386{
387}

Referenced by igl::opengl::glfw::Viewer::init().

+ Here is the caller graph for this function:

◆ InitSerialization()

IGL_INLINE void igl::opengl::ViewerCore::InitSerialization ( )

◆ set_rotation_type()

IGL_INLINE void igl::opengl::ViewerCore::set_rotation_type ( const RotationType value)
338{
339 using namespace Eigen;
340 using namespace std;
341 const RotationType old_rotation_type = rotation_type;
342 rotation_type = value;
344 old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
345 {
347 }
348}
RotationType
Definition ViewerCore.h:86
RotationType rotation_type
Definition ViewerCore.h:103
The quaternion class used to represent 3D orientations and rotations.
Definition Quaternion.h:233
IGL_INLINE void snap_to_fixed_up(const Eigen::Quaternion< Qtype > &q, Eigen::Quaternion< Qtype > &s)
Definition snap_to_fixed_up.cpp:11

References igl::snap_to_fixed_up().

Referenced by igl::opengl::glfw::imgui::ImGuiMenu::draw_viewer_menu(), and igl::opengl::glfw::Viewer::key_pressed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shut()

IGL_INLINE void igl::opengl::ViewerCore::shut ( )
390{
391}

Referenced by igl::opengl::glfw::Viewer::launch_shut().

+ Here is the caller graph for this function:

Member Data Documentation

◆ animation_max_fps

double igl::opengl::ViewerCore::animation_max_fps

◆ background_color

Eigen::Vector4f igl::opengl::ViewerCore::background_color

◆ camera_base_translation

Eigen::Vector3f igl::opengl::ViewerCore::camera_base_translation

Referenced by align_camera_center().

◆ camera_base_zoom

float igl::opengl::ViewerCore::camera_base_zoom

Referenced by align_camera_center().

◆ camera_center

Eigen::Vector3f igl::opengl::ViewerCore::camera_center

◆ camera_dfar

float igl::opengl::ViewerCore::camera_dfar

◆ camera_dnear

float igl::opengl::ViewerCore::camera_dnear

◆ camera_eye

Eigen::Vector3f igl::opengl::ViewerCore::camera_eye

◆ camera_translation

Eigen::Vector3f igl::opengl::ViewerCore::camera_translation

◆ camera_up

Eigen::Vector3f igl::opengl::ViewerCore::camera_up

◆ camera_view_angle

float igl::opengl::ViewerCore::camera_view_angle

◆ camera_zoom

◆ depth_test

bool igl::opengl::ViewerCore::depth_test

◆ is_animating

bool igl::opengl::ViewerCore::is_animating

◆ light_position

Eigen::Vector3f igl::opengl::ViewerCore::light_position

◆ lighting_factor

float igl::opengl::ViewerCore::lighting_factor

◆ norm

Eigen::Matrix4f igl::opengl::ViewerCore::norm

Referenced by align_camera_center().

◆ object_scale

float igl::opengl::ViewerCore::object_scale

◆ orthographic

bool igl::opengl::ViewerCore::orthographic

◆ proj

◆ rotation_type

◆ trackball_angle

◆ view

◆ viewport


The documentation for this class was generated from the following files: