Represents a simple visualization window. More...
#include <view.h>
Inherited by MeshView, OrderView, ScalarView, StreamView, and VectorView.
Public Member Functions | |
| View (const char *title, int x, int y, int width, int height) | |
| virtual | ~View () |
| int | create () |
| void | close () |
| void | refresh () |
| Refreshes views. | |
| void | set_title (const char *title) |
| Changes the window name (in its title-bar) to 'title'. | |
| void | set_min_max_range (double min, double max) |
| void | auto_min_max_range () |
| void | get_min_max_range (double &min, double &max) |
| void | show_scale (bool show=true) |
| void | set_scale_position (int horz, int vert) |
| void | set_scale_size (int width, int height, int numticks) |
| void | set_scale_format (const char *fmt) |
| void | fix_scale_width (int width=80) |
| void | save_screenshot (const char *bmpname, bool high_quality=false) |
| Saves the current content of the window to a .BMP file. If 'high_quality' is true, an anti-aliased frame is rendered and saved. | |
| void | save_numbered_screenshot (const char *format, int number, bool high_quality=false) |
| Like save_screenshot(), but forms the file name in printf-style using the 'number' parameter, e.g., format="screen%03d.bmp" and number=5 gives the file name "screen005.bmp". | |
| void | set_palette (ViewPaletteType type) |
| void | set_num_palette_steps (int num) |
| void | set_palette_filter (bool linear) |
| void | wait_for_keypress (const char *text=NULL) |
| Waits for keypress. Deprecated. | |
| void | wait_for_close () |
| void | wait_for_draw () |
Static Public Member Functions | |
| static void | wait (const char *text) |
| Closes all views at once. | |
| static void | wait (ViewWaitEvent wait_event=H2DV_WAIT_CLOSE, const char *text=NULL) |
| Waits for an event. | |
Protected Member Functions | |
| void | draw_fps () |
| draws current FPS | |
| virtual void | on_create (int output_id) |
| virtual void | on_display ()=0 |
| virtual void | on_reshape (int width, int height) |
| virtual void | on_mouse_move (int x, int y) |
| virtual void | on_left_mouse_down (int x, int y) |
| virtual void | on_left_mouse_up (int x, int y) |
| virtual void | on_left_mouse_double_click (int x, int y) |
| virtual void | on_right_mouse_down (int x, int y) |
| virtual void | on_right_mouse_up (int x, int y) |
| virtual void | on_right_mouse_double_click (int x, int y) |
| virtual void | on_middle_mouse_down (int x, int y) |
| virtual void | on_middle_mouse_up (int x, int y) |
| virtual void | on_middle_mouse_double_click (int x, int y) |
| virtual void | on_key_down (unsigned char key, int x, int y) |
| virtual void | on_special_key (int key, int x, int y) |
| virtual void | on_entry (int state) |
| virtual void | on_close () |
| virtual void | reset_view (bool force_reset) |
| Resets view based on the axis-aligned bounding box of the mesh. Assumes that the bounding box is set up. Does not reset if view_not_reset is false. | |
| virtual void | update_layout () |
| Updates layout, i.e., centers mesh. | |
| void | create_gl_palette () |
| Creates pallete texture in OpenGL. Assumes that view_sync is locked. | |
| virtual void | get_palette_color (double x, float *gl_color) |
| Fills gl_color with palette color. Assumes that gl_color points to a vector of three components (RGB). | |
| double | transform_x (double x) |
| double | transform_y (double y) |
| double | untransform_x (double x) |
| double | untransform_y (double y) |
| virtual void | clear_background () |
| Clears background. | |
| void | pre_display () |
| void | display_antialiased () |
| void | set_ortho_projection (bool no_jitter=false) |
| void | set_3d_projection (int fov, double znear, double zfar) |
| void | draw_text (double x, double y, const char *text, int align=-1) |
| int | get_text_width (const char *text) |
| char * | get_screenshot_file_name () |
| void | save_screenshot_internal (const char *filename) |
| virtual void | scale_dispatch () |
| virtual int | measure_scale_labels () |
| void | draw_continuous_scale (char *title, bool righttext) |
| void | draw_discrete_scale (int numboxes, const char *boxnames[], const float boxcolors[][3]) |
| void | update_tex_adjust () |
| void | draw_help () |
| virtual const char * | get_help_text () const |
Static Protected Member Functions | |
| static double | get_tick_count () |
| returns a current time [in ms] | |
Protected Attributes | |
| double | rendering_frames [FPS_FRAME_SIZE] |
| time spend in rendering of frames [in ms] | |
| int | rendering_frames_top |
| the new location of the next FPS | |
| bool | view_not_reset |
| True if the view was not reset and therefore it has to be. | |
| double | vertices_min_x |
| double | vertices_max_x |
| double | vertices_min_y |
| double | vertices_max_y |
| AABB of shown mesh. | |
| double | scale |
| double | log_scale |
| double | trans_x |
| double | trans_y |
| double | center_x |
| double | center_y |
| int | margin |
| int | lspace |
| int | rspace |
| int | mouse_x |
| int | mouse_y |
| int | scx |
| int | scy |
| double | objx |
| double | objy |
| bool | dragging |
| bool | scaling |
| std::string | title |
| int | output_id |
| int | output_x |
| int | output_y |
| int | output_width |
| int | output_height |
| float | jitter_x |
| float | jitter_y |
| bool | hq_frame |
| bool | frame_ready |
| ViewPaletteType | pal_type |
| int | pal_steps |
| int | pal_filter |
| double | tex_scale |
| double | tex_shift |
| bool | range_auto |
| double | range_min |
| double | range_max |
| bool | b_scale |
| bool | b_help |
| bool | scale_focused |
| bool | scale_dragging |
| int | pos_horz |
| int | pos_vert |
| int | scale_x |
| int | scale_y |
| int | scale_width |
| int | scale_height |
| int | labels_width |
| int | scale_numticks |
| int | scale_box_height |
| int | scale_box_skip |
| char | scale_fmt [20] |
| int | scale_fixed_width |
| bool | want_screenshot |
| std::string | screenshot_filename |
| unsigned int | gl_pallete_tex_id |
| OpenGL texture object ID. | |
Static Protected Attributes | |
| static int | screenshot_no = 1 |
Friends | |
| void | on_display_stub (void) |
| void | on_reshape_stub (int, int) |
| void | on_mouse_move_stub (int, int) |
| void | on_mouse_click_stub (int, int, int, int) |
| void | on_key_down_stub (unsigned char, int, int) |
| void | on_special_key_stub (int, int, int) |
| void | on_entry_stub (int) |
| void | on_idle_stub () |
| void | on_close_stub () |
| int | add_view_in_thread (void *) |
| Adds a new view. Function has to be called just from the inside of view thread with a locked sync_view. | |
| int | remove_view_in_thread (void *) |
| Removes a new view. Function has to be called just from the inside of view thread with a locked sync_view. | |
Represents a simple visualization window.
View is a base class providing a simple OpenGL visualization window. Its task is to define basic functionality, such as the ability of the window to be responsive even when the main program thread is busy with calculations (ie., the windows are run in a background thread), to provide zooming and panning capabilities for use by the descendant classes, etc.
| View::View | ( | const char * | title, | |
| int | x, | |||
| int | y, | |||
| int | width, | |||
| int | height | |||
| ) |
| View::~View | ( | ) | [virtual] |
| void View::auto_min_max_range | ( | ) |
| void View::clear_background | ( | ) | [protected, virtual] |
Clears background.
| void View::close | ( | ) |
| int View::create | ( | ) |
| void View::create_gl_palette | ( | ) | [protected] |
Creates pallete texture in OpenGL. Assumes that view_sync is locked.
| void View::display_antialiased | ( | ) | [protected] |
| void View::draw_continuous_scale | ( | char * | title, | |
| bool | righttext | |||
| ) | [protected] |
| void View::draw_discrete_scale | ( | int | numboxes, | |
| const char * | boxnames[], | |||
| const float | boxcolors[][3] | |||
| ) | [protected] |
| void View::draw_fps | ( | ) | [protected] |
draws current FPS
| void View::draw_help | ( | ) | [protected] |
| void View::draw_text | ( | double | x, | |
| double | y, | |||
| const char * | text, | |||
| int | align = -1 | |||
| ) | [protected] |
| void View::fix_scale_width | ( | int | width = 80 |
) |
| virtual const char* View::get_help_text | ( | ) | const [inline, protected, virtual] |
Reimplemented in BaseView, MeshView, OrderView, ScalarView, StreamView, VectorBaseView, and VectorView.
| void View::get_min_max_range | ( | double & | min, | |
| double & | max | |||
| ) |
| void View::get_palette_color | ( | double | x, | |
| float * | gl_color | |||
| ) | [protected, virtual] |
Fills gl_color with palette color. Assumes that gl_color points to a vector of three components (RGB).
| char * View::get_screenshot_file_name | ( | ) | [protected] |
| int View::get_text_width | ( | const char * | text | ) | [protected] |
| double View::get_tick_count | ( | ) | [static, protected] |
returns a current time [in ms]
| int View::measure_scale_labels | ( | ) | [protected, virtual] |
Reimplemented in OrderView.
| void View::on_close | ( | ) | [protected, virtual] |
Reimplemented in ScalarView.
| void View::on_create | ( | int | output_id | ) | [protected, virtual] |
Reimplemented in ScalarView.
| virtual void View::on_display | ( | ) | [protected, pure virtual] |
Implemented in MeshView, OrderView, ScalarView, StreamView, and VectorView.
| virtual void View::on_entry | ( | int | state | ) | [inline, protected, virtual] |
| void View::on_key_down | ( | unsigned char | key, | |
| int | x, | |||
| int | y | |||
| ) | [protected, virtual] |
Reimplemented in MeshView, OrderView, ScalarView, StreamView, and VectorView.
| virtual void View::on_left_mouse_double_click | ( | int | x, | |
| int | y | |||
| ) | [inline, protected, virtual] |
| void View::on_left_mouse_down | ( | int | x, | |
| int | y | |||
| ) | [protected, virtual] |
Reimplemented in ScalarView, and StreamView.
| void View::on_left_mouse_up | ( | int | x, | |
| int | y | |||
| ) | [protected, virtual] |
Reimplemented in ScalarView.
| virtual void View::on_middle_mouse_double_click | ( | int | x, | |
| int | y | |||
| ) | [inline, protected, virtual] |
| virtual void View::on_middle_mouse_down | ( | int | x, | |
| int | y | |||
| ) | [inline, protected, virtual] |
Reimplemented in ScalarView.
| virtual void View::on_middle_mouse_up | ( | int | x, | |
| int | y | |||
| ) | [inline, protected, virtual] |
Reimplemented in ScalarView.
| void View::on_mouse_move | ( | int | x, | |
| int | y | |||
| ) | [protected, virtual] |
Reimplemented in ScalarView, StreamView, and VectorView.
| void View::on_reshape | ( | int | width, | |
| int | height | |||
| ) | [protected, virtual] |
Reimplemented in ScalarView.
| virtual void View::on_right_mouse_double_click | ( | int | x, | |
| int | y | |||
| ) | [inline, protected, virtual] |
| void View::on_right_mouse_down | ( | int | x, | |
| int | y | |||
| ) | [protected, virtual] |
Reimplemented in ScalarView.
| void View::on_right_mouse_up | ( | int | x, | |
| int | y | |||
| ) | [protected, virtual] |
Reimplemented in ScalarView.
| void View::on_special_key | ( | int | key, | |
| int | x, | |||
| int | y | |||
| ) | [protected, virtual] |
Reimplemented in BaseView, ScalarView, and VectorBaseView.
| void View::pre_display | ( | ) | [protected] |
| void View::refresh | ( | ) |
Refreshes views.
| void View::reset_view | ( | bool | force_reset | ) | [protected, virtual] |
Resets view based on the axis-aligned bounding box of the mesh. Assumes that the bounding box is set up. Does not reset if view_not_reset is false.
Reimplemented in ScalarView.
| void View::save_numbered_screenshot | ( | const char * | format, | |
| int | number, | |||
| bool | high_quality = false | |||
| ) |
Like save_screenshot(), but forms the file name in printf-style using the 'number' parameter, e.g., format="screen%03d.bmp" and number=5 gives the file name "screen005.bmp".
| void View::save_screenshot | ( | const char * | bmpname, | |
| bool | high_quality = false | |||
| ) |
Saves the current content of the window to a .BMP file. If 'high_quality' is true, an anti-aliased frame is rendered and saved.
| void View::save_screenshot_internal | ( | const char * | filename | ) | [protected] |
| void View::set_3d_projection | ( | int | fov, | |
| double | znear, | |||
| double | zfar | |||
| ) | [protected] |
| void View::set_min_max_range | ( | double | min, | |
| double | max | |||
| ) |
| void View::set_num_palette_steps | ( | int | num | ) |
| void View::set_ortho_projection | ( | bool | no_jitter = false |
) | [protected] |
| void View::set_palette | ( | ViewPaletteType | type | ) |
| void View::set_palette_filter | ( | bool | linear | ) |
| void View::set_scale_format | ( | const char * | fmt | ) |
| void View::set_scale_position | ( | int | horz, | |
| int | vert | |||
| ) |
| void View::set_scale_size | ( | int | width, | |
| int | height, | |||
| int | numticks | |||
| ) |
| void View::set_title | ( | const char * | title | ) |
Changes the window name (in its title-bar) to 'title'.
| void View::show_scale | ( | bool | show = true |
) |
| double View::transform_x | ( | double | x | ) | [inline, protected] |
| double View::transform_y | ( | double | y | ) | [inline, protected] |
| double View::untransform_x | ( | double | x | ) | [inline, protected] |
| double View::untransform_y | ( | double | y | ) | [inline, protected] |
| void View::update_layout | ( | ) | [protected, virtual] |
Updates layout, i.e., centers mesh.
Reimplemented in ScalarView.
| void View::update_tex_adjust | ( | ) | [protected] |
| void View::wait | ( | ViewWaitEvent | wait_event = H2DV_WAIT_CLOSE, |
|
| const char * | text = NULL | |||
| ) | [static] |
Waits for an event.
| void View::wait | ( | const char * | text | ) | [static] |
Closes all views at once.
| void View::wait_for_close | ( | ) |
| void View::wait_for_draw | ( | ) |
| void View::wait_for_keypress | ( | const char * | text = NULL |
) |
Waits for keypress. Deprecated.
| int add_view_in_thread | ( | void * | view_pars_ptr | ) | [friend] |
Adds a new view. Function has to be called just from the inside of view thread with a locked sync_view.
| void on_close_stub | ( | ) | [friend] |
| void on_display_stub | ( | void | ) | [friend] |
| void on_entry_stub | ( | int | state | ) | [friend] |
| void on_idle_stub | ( | ) | [friend] |
| void on_key_down_stub | ( | unsigned char | key, | |
| int | x, | |||
| int | y | |||
| ) | [friend] |
| void on_mouse_click_stub | ( | int | button, | |
| int | state, | |||
| int | x, | |||
| int | y | |||
| ) | [friend] |
| void on_mouse_move_stub | ( | int | x, | |
| int | y | |||
| ) | [friend] |
| void on_reshape_stub | ( | int | width, | |
| int | height | |||
| ) | [friend] |
| void on_special_key_stub | ( | int | key, | |
| int | x, | |||
| int | y | |||
| ) | [friend] |
| int remove_view_in_thread | ( | void * | remove_params_ptr | ) | [friend] |
Removes a new view. Function has to be called just from the inside of view thread with a locked sync_view.
bool View::b_help [protected] |
bool View::b_scale [protected] |
double View::center_x [protected] |
double View::center_y [protected] |
bool View::dragging [protected] |
bool View::frame_ready [protected] |
unsigned int View::gl_pallete_tex_id [protected] |
OpenGL texture object ID.
bool View::hq_frame [protected] |
float View::jitter_x [protected] |
float View::jitter_y [protected] |
int View::labels_width [protected] |
double View::log_scale [protected] |
int View::lspace [protected] |
int View::margin [protected] |
int View::mouse_x [protected] |
int View::mouse_y [protected] |
double View::objx [protected] |
double View::objy [protected] |
int View::output_height [protected] |
int View::output_id [protected] |
int View::output_width [protected] |
int View::output_x [protected] |
int View::output_y [protected] |
int View::pal_filter [protected] |
int View::pal_steps [protected] |
ViewPaletteType View::pal_type [protected] |
int View::pos_horz [protected] |
int View::pos_vert [protected] |
bool View::range_auto [protected] |
double View::range_max [protected] |
double View::range_min [protected] |
double View::rendering_frames[FPS_FRAME_SIZE] [protected] |
time spend in rendering of frames [in ms]
int View::rendering_frames_top [protected] |
the new location of the next FPS
int View::rspace [protected] |
double View::scale [protected] |
int View::scale_box_height [protected] |
int View::scale_box_skip [protected] |
bool View::scale_dragging [protected] |
int View::scale_fixed_width [protected] |
char View::scale_fmt[20] [protected] |
bool View::scale_focused [protected] |
int View::scale_height [protected] |
int View::scale_numticks [protected] |
int View::scale_width [protected] |
int View::scale_x [protected] |
int View::scale_y [protected] |
bool View::scaling [protected] |
std::string View::screenshot_filename [protected] |
int View::screenshot_no = 1 [static, protected] |
int View::scx [protected] |
int View::scy [protected] |
double View::tex_scale [protected] |
double View::tex_shift [protected] |
std::string View::title [protected] |
double View::trans_x [protected] |
double View::trans_y [protected] |
double View::vertices_max_x [protected] |
double View::vertices_max_y [protected] |
AABB of shown mesh.
double View::vertices_min_x [protected] |
double View::vertices_min_y [protected] |
bool View::view_not_reset [protected] |
True if the view was not reset and therefore it has to be.
bool View::want_screenshot [protected] |
1.6.3