28 namespace visualization {
31 unsigned int position_x_,
unsigned int position_y_,
32 unsigned int width_ ,
unsigned int height_) :
33 Window(name_, position_x_, position_y_, width_, height_)
46 LOG(LTRACE) <<
"WindowMatrix2D::Display handler of window " << glutGetWindow();
48 APP_DATA_SYNCHRONIZATION_SCOPED_LOCK();
51 glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
52 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
62 float scale_x = (float)glutGet(GLUT_WINDOW_HEIGHT)/(float)(rows);
63 float scale_y = (float)glutGet(GLUT_WINDOW_WIDTH)/(float)(cols);
66 for (
size_t y = 0; y < rows; y++) {
67 for (
size_t x = 0; x < cols; x++) {
69 float val = data_ptr[x*rows + y];
81 draw_grid(0.5f, 0.3f, 0.3f, 0.3f, cols, rows);
94 APP_DATA_SYNCHRONIZATION_SCOPED_LOCK();
116 APP_DATA_SYNCHRONIZATION_SCOPED_LOCK();
void draw_filled_rectangle(float x, float y, float h, float w, float r, float g, float b, float a)
void setMatrixPointerUnsynchronized(mic::types::MatrixXfPtr displayed_matrix_ptr_)
WindowMatrix2D(std::string name_="Matrix2D", unsigned int position_x_=0, unsigned int position_y_=0, unsigned int width_=512, unsigned int height_=512)
Window displaying 2d matrix (e.g. a grayscale image).
mic::types::MatrixXfPtr displayed_matrix_ptr
void displayHandler(void)
void setMatrixUnsynchronized(mic::types::MatrixXf &displayed_matrix_)
Parent class of all OpenGL-based windows (abstract).
virtual ~WindowMatrix2D()
void setMatrixSynchronized(mic::types::MatrixXf &displayed_matrix_)
void setMatrixPointerSynchronized(mic::types::MatrixXfPtr displayed_matrix_ptr_)
void draw_grid(float r, float g, float b, float a, float cells_h, float cells_v, float line_width_=1.0)
Declaration of WindowManager class along with a bunch of helpful types and macros.