MachineIntelligenceCore:Visualization
mic::opengl::visualization::Window Class Referenceabstract

Parent class of all OpenGL-based windows (abstract). More...

#include <Window.hpp>

Inheritance diagram for mic::opengl::visualization::Window:
Collaboration diagram for mic::opengl::visualization::Window:

Public Member Functions

 Window (std::string name_="OpenGlWindow", unsigned int position_x_=0, unsigned int position_y_=0, unsigned int width_=512, unsigned int height_=512)
 
virtual ~Window ()
 
unsigned int getId () const
 
std::string getName () const
 
virtual void displayHandler (void)=0
 
virtual void mouseHandler (int button, int state, int x, int y)
 
virtual void reshapeHandler (int width_, int height_)
 
- Public Member Functions inherited from mic::opengl::visualization::DrawingUtils
virtual ~DrawingUtils ()
 
void draw_frame (float x1, float y1, float x2, float y2, float r, float g, float b, float a)
 
void draw_grid (float r, float g, float b, float a, float cells_h, float cells_v, float line_width_=1.0)
 
void draw_mark (mark m, float x, float y, float size, float line_width, float r, float g, float b, float a)
 
void draw_circle (float x, float y, float size, float line_width, float r, float g, float b, float a)
 
void draw_plus (float x, float y, float size, float line_width, float r, float g, float b, float a)
 
void draw_cross (float x, float y, float size, float line_width, float r, float g, float b, float a)
 
void draw_square (float x, float y, float size, float line_width, float r, float g, float b, float a)
 
void draw_square_in_place (float size, float line_width, float r, float g, float b, float a)
 
void draw_filled_square (float x, float y, float size, float r, float g, float b, float a)
 
void draw_rectangle (float x, float y, float h, float w, float r, float g, float b, float a)
 
void draw_filled_rectangle (float x, float y, float h, float w, float r, float g, float b, float a)
 
void draw_texture_in_place (float size)
 
void draw_filled_square_in_place (float radius, float line_width, float r, float g, float b, float a)
 
void draw_filled_rectangle_in_place (float radius_x, float radius_y, float line_width, float r, float g, float b, float a)
 
void draw_cuboid (float radius, float line_width, float height, float r, float g, float b, float a)
 
void draw_text (float x, float y, char *string, float r, float g, float b, float a, void *font)
 
void draw_text_3i (float x, float y, float z, char *string, float r, float g, float b, float a, void *font)
 
void draw_cursor (float x, float y, float r, float g, float b, float a)
 
void draw_text_3d (GLfloat x, GLfloat y, char *text)
 
float to_radians (float degrees)
 

Protected Member Functions

void keyhandlerFullscreen (void)
 

Protected Attributes

std::string name
 
unsigned int position_x
 
unsigned int position_y
 
unsigned int width
 
unsigned int height
 
unsigned int previous_width
 
unsigned int previous_height
 
unsigned int id
 
bool fullscreen_mode
 

Detailed Description

Parent class of all OpenGL-based windows (abstract).

Author
tkornuta

Definition at line 51 of file Window.hpp.

Constructor & Destructor Documentation

mic::opengl::visualization::Window::Window ( std::string  name_ = "OpenGlWindow",
unsigned int  position_x_ = 0,
unsigned int  position_y_ = 0,
unsigned int  width_ = 512,
unsigned int  height_ = 512 
)

Public constructor. Initializes GLUT window, sets window parameters (size, position, name), sets OpenGL parameters (e.g. antialiasing), registers FullWindow key handler and registers the window in manager.

Parameters
name_Window name. As default set to "OpenGlWindow".
height_Window height. As default set to 512.
width_Window width. As default set to 512.
position_x_X coordinate of the upper left window corner.
position_y_Y coordinate of the upper left window corner.

Definition at line 30 of file Window.cpp.

References fullscreen_mode, height, keyhandlerFullscreen(), name, position_x, position_y, VGL_MANAGER, and width.

Here is the call graph for this function:

mic::opengl::visualization::Window::~Window ( )
virtual

Destructor.

Definition at line 72 of file Window.cpp.

Member Function Documentation

unsigned int mic::opengl::visualization::Window::getId ( ) const

Returns id of the window.

Returns
Window id.

Definition at line 77 of file Window.cpp.

References id.

Referenced by mic::opengl::visualization::WindowManager::registerWindow().

std::string mic::opengl::visualization::Window::getName ( ) const

Returns name of the window.

Returns
Window name.

Definition at line 81 of file Window.cpp.

References name.

void mic::opengl::visualization::Window::keyhandlerFullscreen ( void  )
protected

Keyhandler: toggles fullscreen on/off.

Definition at line 103 of file Window.cpp.

References fullscreen_mode, height, position_x, position_y, previous_height, previous_width, and width.

Referenced by Window().

virtual void mic::opengl::visualization::Window::mouseHandler ( int  button,
int  state,
int  x,
int  y 
)
inlinevirtual

Mouse handler - virtual method, to be overridden if necessary.

Definition at line 92 of file Window.hpp.

Referenced by mic::opengl::visualization::WindowManager::mouseHandler().

void mic::opengl::visualization::Window::reshapeHandler ( int  width_,
int  height_ 
)
virtual

Changes size of the window.

Parameters
width_New width.
height_New height.

Definition at line 85 of file Window.cpp.

References height, and width.

Referenced by mic::opengl::visualization::WindowManager::reshapeHandler().

Member Data Documentation

bool mic::opengl::visualization::Window::fullscreen_mode
protected

Full screen mode.

Definition at line 145 of file Window.hpp.

Referenced by keyhandlerFullscreen(), and Window().

unsigned int mic::opengl::visualization::Window::id
protected

Window ID assigned by OpenGl.

Definition at line 140 of file Window.hpp.

Referenced by getId().

std::string mic::opengl::visualization::Window::name
protected

Name of the window.

Definition at line 105 of file Window.hpp.

Referenced by getName(), and Window().

unsigned int mic::opengl::visualization::Window::position_x
protected

Window left corner position x.

Definition at line 110 of file Window.hpp.

Referenced by keyhandlerFullscreen(), and Window().

unsigned int mic::opengl::visualization::Window::position_y
protected

Window left corner position y.

Definition at line 115 of file Window.hpp.

Referenced by keyhandlerFullscreen(), and Window().

unsigned int mic::opengl::visualization::Window::previous_height
protected

Window height before entered the full-screen mode.

Definition at line 135 of file Window.hpp.

Referenced by keyhandlerFullscreen().

unsigned int mic::opengl::visualization::Window::previous_width
protected

Window width before entered the full-screen mode.

Definition at line 130 of file Window.hpp.

Referenced by keyhandlerFullscreen().


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