libigl v2.5.0
Loading...
Searching...
No Matches
igl::opengl::glfw::Viewer Class Reference

#include <Viewer.h>

Public Types

enum class  MouseButton { Left , Middle , Right }
 
enum class  MouseMode {
  None , Rotation , Zoom , Pan ,
  Translation
}
 

Public Member Functions

int launch (bool fullscreen=false, const std::string &name="libigl viewer", int width=0, int height=0)
 
int launch_init (bool fullscreen=false, const std::string &name="libigl viewer", int width=0, int height=0)
 
bool launch_rendering (bool loop=true)
 
void launch_shut ()
 
void init ()
 
void init_plugins ()
 
void shutdown_plugins ()
 
 Viewer ()
 
 ~Viewer ()
 
bool load_mesh_from_file (const std::string &mesh_file_name)
 
bool save_mesh_to_file (const std::string &mesh_file_name)
 
bool key_pressed (unsigned int unicode_key, int modifier)
 
bool key_down (int key, int modifier)
 
bool key_up (int key, int modifier)
 
bool mouse_down (MouseButton button, int modifier)
 
bool mouse_up (MouseButton button, int modifier)
 
bool mouse_move (int mouse_x, int mouse_y)
 
bool mouse_scroll (float delta_y)
 
bool load_scene ()
 
bool load_scene (std::string fname)
 
bool save_scene ()
 
bool save_scene (std::string fname)
 
void draw ()
 
template<typename T >
void draw_buffer (igl::opengl::ViewerCore &core, Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &R, Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &G, Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &B, Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &A, Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &D)
 
void resize (int w, int h)
 
void post_resize (int w, int h)
 
void snap_to_canonical_quaternion ()
 
void open_dialog_load_mesh ()
 
void open_dialog_save_mesh ()
 
ViewerDatadata (int mesh_id=-1)
 
const ViewerDatadata (int mesh_id=-1) const
 
int append_mesh (bool visible=true)
 
bool erase_mesh (const size_t index)
 
size_t mesh_index (const int id) const
 
ViewerCorecore (unsigned core_id=0)
 
const ViewerCorecore (unsigned core_id=0) const
 
int append_core (Eigen::Vector4f viewport, bool append_empty=false)
 
bool erase_core (const size_t index)
 
size_t core_index (const int id) const
 
void select_hovered_core ()
 

Public Attributes

enum igl::opengl::glfw::Viewer::MouseMode mouse_mode
 
std::vector< ViewerDatadata_list
 
size_t selected_data_index
 
int next_data_id
 
GLFWwindow * window
 
std::vector< ViewerCorecore_list
 
size_t selected_core_index
 
int next_core_id
 
std::vector< ViewerPlugin * > plugins
 
Eigen::Quaternionf down_rotation
 
int current_mouse_x
 
int current_mouse_y
 
int down_mouse_x
 
int down_mouse_y
 
float down_mouse_z
 
Eigen::Vector3f down_translation
 
bool down
 
bool hack_never_moved
 
float scroll_position
 
std::function< bool(Viewer &viewer)> callback_init
 
std::function< bool(Viewer &viewer)> callback_pre_draw
 
std::function< bool(Viewer &viewer)> callback_post_draw
 
std::function< bool(Viewer &viewer, int button, int modifier)> callback_mouse_down
 
std::function< bool(Viewer &viewer, int button, int modifier)> callback_mouse_up
 
std::function< bool(Viewer &viewer, int mouse_x, int mouse_y)> callback_mouse_move
 
std::function< bool(Viewer &viewer, float delta_y)> callback_mouse_scroll
 
std::function< bool(Viewer &viewer, unsigned int key, int modifiers)> callback_key_pressed
 
std::function< bool(Viewer &viewer, int w, int h)> callback_post_resize
 
std::function< bool(Viewer &viewer, unsigned int key, int modifiers)> callback_key_down
 
std::function< bool(Viewer &viewer, unsigned int key, int modifiers)> callback_key_up
 
void * callback_init_data
 
void * callback_pre_draw_data
 
void * callback_post_draw_data
 
void * callback_mouse_down_data
 
void * callback_mouse_up_data
 
void * callback_mouse_move_data
 
void * callback_mouse_scroll_data
 
void * callback_key_pressed_data
 
void * callback_key_down_data
 
void * callback_key_up_data
 

Member Enumeration Documentation

◆ MouseButton

Enumerator
Left 
Middle 
Right 

◆ MouseMode

Enumerator
None 
Rotation 
Zoom 
Pan 
Translation 

Constructor & Destructor Documentation

◆ Viewer()

igl::opengl::glfw::Viewer::Viewer ( )

◆ ~Viewer()

igl::opengl::glfw::Viewer::~Viewer ( )

Member Function Documentation

◆ launch()

int igl::opengl::glfw::Viewer::launch ( bool  fullscreen = false,
const std::string &  name = "libigl viewer",
int  width = 0,
int  height = 0 
)

◆ launch_init()

int igl::opengl::glfw::Viewer::launch_init ( bool  fullscreen = false,
const std::string &  name = "libigl viewer",
int  width = 0,
int  height = 0 
)

◆ launch_rendering()

bool igl::opengl::glfw::Viewer::launch_rendering ( bool  loop = true)

◆ launch_shut()

void igl::opengl::glfw::Viewer::launch_shut ( )

◆ init()

void igl::opengl::glfw::Viewer::init ( )

◆ init_plugins()

void igl::opengl::glfw::Viewer::init_plugins ( )

◆ shutdown_plugins()

void igl::opengl::glfw::Viewer::shutdown_plugins ( )

◆ load_mesh_from_file()

bool igl::opengl::glfw::Viewer::load_mesh_from_file ( const std::string &  mesh_file_name)

◆ save_mesh_to_file()

bool igl::opengl::glfw::Viewer::save_mesh_to_file ( const std::string &  mesh_file_name)

◆ key_pressed()

bool igl::opengl::glfw::Viewer::key_pressed ( unsigned int  unicode_key,
int  modifier 
)

◆ key_down()

bool igl::opengl::glfw::Viewer::key_down ( int  key,
int  modifier 
)

◆ key_up()

bool igl::opengl::glfw::Viewer::key_up ( int  key,
int  modifier 
)

◆ mouse_down()

bool igl::opengl::glfw::Viewer::mouse_down ( MouseButton  button,
int  modifier 
)

◆ mouse_up()

bool igl::opengl::glfw::Viewer::mouse_up ( MouseButton  button,
int  modifier 
)

◆ mouse_move()

bool igl::opengl::glfw::Viewer::mouse_move ( int  mouse_x,
int  mouse_y 
)

◆ mouse_scroll()

bool igl::opengl::glfw::Viewer::mouse_scroll ( float  delta_y)

◆ load_scene() [1/2]

bool igl::opengl::glfw::Viewer::load_scene ( )

◆ load_scene() [2/2]

bool igl::opengl::glfw::Viewer::load_scene ( std::string  fname)

◆ save_scene() [1/2]

bool igl::opengl::glfw::Viewer::save_scene ( )

◆ save_scene() [2/2]

bool igl::opengl::glfw::Viewer::save_scene ( std::string  fname)

◆ draw()

void igl::opengl::glfw::Viewer::draw ( )

◆ draw_buffer()

template<typename T >
void igl::opengl::glfw::Viewer::draw_buffer ( igl::opengl::ViewerCore core,
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  R,
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  G,
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  B,
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  A,
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  D 
)

◆ resize()

void igl::opengl::glfw::Viewer::resize ( int  w,
int  h 
)

◆ post_resize()

void igl::opengl::glfw::Viewer::post_resize ( int  w,
int  h 
)

◆ snap_to_canonical_quaternion()

void igl::opengl::glfw::Viewer::snap_to_canonical_quaternion ( )

◆ open_dialog_load_mesh()

void igl::opengl::glfw::Viewer::open_dialog_load_mesh ( )

◆ open_dialog_save_mesh()

void igl::opengl::glfw::Viewer::open_dialog_save_mesh ( )

◆ data() [1/2]

ViewerData & igl::opengl::glfw::Viewer::data ( int  mesh_id = -1)

◆ data() [2/2]

const ViewerData & igl::opengl::glfw::Viewer::data ( int  mesh_id = -1) const

◆ append_mesh()

int igl::opengl::glfw::Viewer::append_mesh ( bool  visible = true)

◆ erase_mesh()

bool igl::opengl::glfw::Viewer::erase_mesh ( const size_t  index)

◆ mesh_index()

size_t igl::opengl::glfw::Viewer::mesh_index ( const int  id) const

◆ core() [1/2]

ViewerCore & igl::opengl::glfw::Viewer::core ( unsigned  core_id = 0)

◆ core() [2/2]

const ViewerCore & igl::opengl::glfw::Viewer::core ( unsigned  core_id = 0) const

◆ append_core()

int igl::opengl::glfw::Viewer::append_core ( Eigen::Vector4f  viewport,
bool  append_empty = false 
)

◆ erase_core()

bool igl::opengl::glfw::Viewer::erase_core ( const size_t  index)

◆ core_index()

size_t igl::opengl::glfw::Viewer::core_index ( const int  id) const

◆ select_hovered_core()

void igl::opengl::glfw::Viewer::select_hovered_core ( )

Member Data Documentation

◆ mouse_mode

enum igl::opengl::glfw::Viewer::MouseMode igl::opengl::glfw::Viewer::mouse_mode

◆ data_list

std::vector<ViewerData> igl::opengl::glfw::Viewer::data_list

◆ selected_data_index

size_t igl::opengl::glfw::Viewer::selected_data_index

◆ next_data_id

int igl::opengl::glfw::Viewer::next_data_id

◆ window

GLFWwindow* igl::opengl::glfw::Viewer::window

◆ core_list

std::vector<ViewerCore> igl::opengl::glfw::Viewer::core_list

◆ selected_core_index

size_t igl::opengl::glfw::Viewer::selected_core_index

◆ next_core_id

int igl::opengl::glfw::Viewer::next_core_id

◆ plugins

std::vector<ViewerPlugin*> igl::opengl::glfw::Viewer::plugins

◆ down_rotation

Eigen::Quaternionf igl::opengl::glfw::Viewer::down_rotation

◆ current_mouse_x

int igl::opengl::glfw::Viewer::current_mouse_x

◆ current_mouse_y

int igl::opengl::glfw::Viewer::current_mouse_y

◆ down_mouse_x

int igl::opengl::glfw::Viewer::down_mouse_x

◆ down_mouse_y

int igl::opengl::glfw::Viewer::down_mouse_y

◆ down_mouse_z

float igl::opengl::glfw::Viewer::down_mouse_z

◆ down_translation

Eigen::Vector3f igl::opengl::glfw::Viewer::down_translation

◆ down

bool igl::opengl::glfw::Viewer::down

◆ hack_never_moved

bool igl::opengl::glfw::Viewer::hack_never_moved

◆ scroll_position

float igl::opengl::glfw::Viewer::scroll_position

◆ callback_init

std::function<bool(Viewer& viewer)> igl::opengl::glfw::Viewer::callback_init

◆ callback_pre_draw

std::function<bool(Viewer& viewer)> igl::opengl::glfw::Viewer::callback_pre_draw

◆ callback_post_draw

std::function<bool(Viewer& viewer)> igl::opengl::glfw::Viewer::callback_post_draw

◆ callback_mouse_down

std::function<bool(Viewer& viewer, int button, int modifier)> igl::opengl::glfw::Viewer::callback_mouse_down

◆ callback_mouse_up

std::function<bool(Viewer& viewer, int button, int modifier)> igl::opengl::glfw::Viewer::callback_mouse_up

◆ callback_mouse_move

std::function<bool(Viewer& viewer, int mouse_x, int mouse_y)> igl::opengl::glfw::Viewer::callback_mouse_move

◆ callback_mouse_scroll

std::function<bool(Viewer& viewer, float delta_y)> igl::opengl::glfw::Viewer::callback_mouse_scroll

◆ callback_key_pressed

std::function<bool(Viewer& viewer, unsigned int key, int modifiers)> igl::opengl::glfw::Viewer::callback_key_pressed

◆ callback_post_resize

std::function<bool(Viewer& viewer, int w, int h)> igl::opengl::glfw::Viewer::callback_post_resize

◆ callback_key_down

std::function<bool(Viewer& viewer, unsigned int key, int modifiers)> igl::opengl::glfw::Viewer::callback_key_down

◆ callback_key_up

std::function<bool(Viewer& viewer, unsigned int key, int modifiers)> igl::opengl::glfw::Viewer::callback_key_up

◆ callback_init_data

void* igl::opengl::glfw::Viewer::callback_init_data

◆ callback_pre_draw_data

void* igl::opengl::glfw::Viewer::callback_pre_draw_data

◆ callback_post_draw_data

void* igl::opengl::glfw::Viewer::callback_post_draw_data

◆ callback_mouse_down_data

void* igl::opengl::glfw::Viewer::callback_mouse_down_data

◆ callback_mouse_up_data

void* igl::opengl::glfw::Viewer::callback_mouse_up_data

◆ callback_mouse_move_data

void* igl::opengl::glfw::Viewer::callback_mouse_move_data

◆ callback_mouse_scroll_data

void* igl::opengl::glfw::Viewer::callback_mouse_scroll_data

◆ callback_key_pressed_data

void* igl::opengl::glfw::Viewer::callback_key_pressed_data

◆ callback_key_down_data

void* igl::opengl::glfw::Viewer::callback_key_down_data

◆ callback_key_up_data

void* igl::opengl::glfw::Viewer::callback_key_up_data

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