8#ifndef IGL_OPENGL_VIEWERCORE_H 
    9#define IGL_OPENGL_VIEWERCORE_H 
   13#include "../igl_inline.h" 
   14#include <Eigen/Geometry> 
   45    const Eigen::MatrixXd& V,
 
   46    const Eigen::MatrixXi& F);
 
   49    const Eigen::MatrixXd& V);
 
   58    const Eigen::MatrixXd& V,
 
   59    const Eigen::MatrixXi& F,
 
   61    Eigen::Vector3f& shift);
 
   64    const Eigen::MatrixXd& V,
 
   66    Eigen::Vector3f& shift);
 
  101    bool update_matrices,
 
  102    Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>& R,
 
  103    Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>& G,
 
  104    Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>& B,
 
  105    Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>& A);
 
  157  unsigned int id = 1u;
 
  234      EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 
 
  240#include "../serialize.h" 
  288      serialization(
false, obj, 
const_cast<std::vector<char>&
>(buffer));
 
 
 
  293#ifndef IGL_STATIC_LIBRARY 
  294#  include "ViewerCore.cpp" 
unsigned int GLuint
Definition MeshGL.h:26
 
Basic class of the 3D mesh viewer.
Definition ViewerCore.h:27
 
Eigen::Matrix4f shadow_proj
OpenGL shadow_proj transformation matrix on last render pass.
Definition ViewerCore.h:232
 
float object_scale
Caches the two-norm between the min/max point of the bounding box.
Definition ViewerCore.h:218
 
Eigen::Vector3f light_position
Light position (or direction to light)
Definition ViewerCore.h:163
 
bool is_animating
Whether "animating" (continuous drawing) is enabled.
Definition ViewerCore.h:213
 
void draw_labels(ViewerData &data, const igl::opengl::MeshGL::TextGL &labels)
Draw the text lables.
 
GLuint shadow_width
Width of the shadow map.
Definition ViewerCore.h:169
 
GLuint shadow_color_rbo
Shadow map color render buffer object.
Definition ViewerCore.h:177
 
void align_camera_center(const Eigen::MatrixXd &V)
This is an overloaded member function, provided for convenience. It differs from the above function o...
 
GLuint shadow_depth_tex
Shadow map depth texture.
Definition ViewerCore.h:173
 
bool depth_test
Whether testing for depth is enabled.
Definition ViewerCore.h:210
 
float camera_dnear
Near plane of camera.
Definition ViewerCore.h:205
 
GLuint shadow_height
Height of the shadow map.
Definition ViewerCore.h:171
 
void get_scale_and_shift_to_fit_mesh(const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, float &zoom, Eigen::Vector3f &shift)
Determines how much to zoom and shift such that the mesh fills the unit box (centered at the origin)
 
Eigen::Matrix4f norm
OpenGL norm transformation matrix on last render pass.
Definition ViewerCore.h:228
 
bool is_set(unsigned int property_mask) const
Check whether a ViewerData visualization option is set for this viewport.
 
bool is_shadow_mapping
Whether shadow mapping is on.
Definition ViewerCore.h:167
 
bool orthographic
Whether camera is orthographic (or perspective)
Definition ViewerCore.h:191
 
Eigen::Matrix4f proj
OpenGL proj transformation matrix on last render pass.
Definition ViewerCore.h:226
 
float camera_base_zoom
Base zoom of camera.
Definition ViewerCore.h:187
 
void deinitialize_shadow_pass()
deinitialize shadow pass
 
void init()
Initialization.
 
void toggle(unsigned int &property_mask) const
Toggle a ViewerData visualization option for this viewport.
 
void set_rotation_type(const RotationType &value)
Set the current rotation type.
 
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)
Render given ViewerData to a buffer.
 
bool is_directional_light
Whether to treat light_position as a point or direction.
Definition ViewerCore.h:165
 
void InitSerialization()
Serialization code.
 
Eigen::Quaternionf trackball_angle
View rotation as quaternion.
Definition ViewerCore.h:184
 
void generate_shadow_buffers()
generate the shadow buffers
 
Eigen::Vector3f camera_eye
Current "eye" / origin position of camera.
Definition ViewerCore.h:197
 
void delete_shadow_buffers()
delete the shadow buffers
 
Eigen::Matrix4f view
OpenGL view transformation matrix on last render pass.
Definition ViewerCore.h:224
 
RotationType
Type of user interface for changing the view rotation based on the mouse draggin.
Definition ViewerCore.h:117
 
@ ROTATION_TYPE_TRACKBALL
Typical trackball rotation (like Meshlab)
Definition ViewerCore.h:119
 
@ NUM_ROTATION_TYPES
Total number of rotation types.
Definition ViewerCore.h:125
 
@ ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP
Fixed up rotation (like Blender, Maya, etc.)
Definition ViewerCore.h:121
 
@ ROTATION_TYPE_NO_ROTATION
No rotation suitable for 2D.
Definition ViewerCore.h:123
 
void draw_shadow_pass(ViewerData &data, bool update_matrices=true)
Draw everything to shadow map.
 
Eigen::Vector3f camera_center
Current "look at" position of camera.
Definition ViewerCore.h:201
 
float camera_view_angle
Current view angle of camera.
Definition ViewerCore.h:203
 
void set(unsigned int &property_mask, bool value=true) const
Set a ViewerData visualization option for this viewport.
 
void get_scale_and_shift_to_fit_mesh(const Eigen::MatrixXd &V, float &zoom, Eigen::Vector3f &shift)
This is an overloaded member function, provided for convenience. It differs from the above function o...
 
MeshGL::GLuint GLuint
Definition ViewerCore.h:29
 
Eigen::Vector4f viewport
Viewport size.
Definition ViewerCore.h:221
 
float lighting_factor
Factor of lighting (0: no lighting, 1: full lighting)
Definition ViewerCore.h:179
 
Eigen::Vector3f camera_base_translation
Base translation of camera.
Definition ViewerCore.h:193
 
void initialize_shadow_pass()
initialize shadow pass
 
Eigen::Vector4f background_color
Background color as RGBA.
Definition ViewerCore.h:160
 
void draw(ViewerData &data, bool update_matrices=true)
Draw everything.
 
Eigen::Vector3f camera_up
Current "up" vector of camera.
Definition ViewerCore.h:199
 
Eigen::Matrix4f shadow_view
OpenGL shadow_view transformation matrix on last render pass.
Definition ViewerCore.h:230
 
float camera_dfar
Far plane of camera.
Definition ViewerCore.h:207
 
RotationType rotation_type
Type of rotation interaction.
Definition ViewerCore.h:182
 
void unset(unsigned int &property_mask) const
Unset a ViewerData visualization option for this viewport.
 
float camera_zoom
Current zoom of camera.
Definition ViewerCore.h:189
 
Eigen::Vector3f camera_translation
Current translation of camera.
Definition ViewerCore.h:195
 
void align_camera_center(const Eigen::MatrixXd &V, const Eigen::MatrixXi &F)
Adjust the view to see the entire model.
 
double animation_max_fps
Max fps of animation loop (e.g. 30fps or 60fps)
Definition ViewerCore.h:215
 
GLuint shadow_depth_fbo
Shadow map depth framebuffer object.
Definition ViewerCore.h:175
 
void clear_framebuffers()
Clear the frame buffers.
 
Object being drawn (i.e., mesh and its accessories) by the ViewerCore.
Definition ViewerData.h:39
 
#define IGL_INLINE
Definition igl_inline.h:15
 
void serialization(bool s, igl::opengl::ViewerCore &obj, std::vector< char > &buffer)
Definition ViewerCore.h:244
 
void deserialize(igl::opengl::ViewerCore &obj, const std::vector< char > &buffer)
Definition ViewerCore.h:286
 
void serialize(const igl::opengl::ViewerCore &obj, std::vector< char > &buffer)
Definition ViewerCore.h:280
 
#define SERIALIZE_MEMBER(Object)
Definition serialize.h:68