MachineIntelligenceCore:Visualization
DrawingUtils.hpp
Go to the documentation of this file.
1 
23 #ifndef SRC_VISUALIZATION_OPENGL_DRAWINGUTILS_HPP_
24 #define SRC_VISUALIZATION_OPENGL_DRAWINGUTILS_HPP_
25 
26  #ifdef __APPLE__
27 #include <GLUT/glut.h>
28 #elif defined(_WIN32)
29 #define M_PI 3.1415926535897932384626433
30 #define GLUT_NO_LIB_PRAGMA
31 #define GLUT_NO_WARNING_DISABLE
32 #define _WCHAR_T_DEFINED
33 #include <stdlib.h>
34 #include <stdint.h>
35 #include <stdio.h>
36 #include <string.h>
37 #include <windows.h>
38 #include <glut.h>
39 #else
40 #include <GL/glut.h>
41 #endif
42 
43 // Dependencies on core types.
44 //#include <types/vector_types.hpp>
45 #include <types/Color.hpp>
46 using namespace mic::types;
47 
48 namespace mic {
49 namespace opengl {
50 namespace visualization {
51 
56 //typedef enum {CIRCLE, PLUS, CROSS, SQUARE} mark;
58 
63 class DrawingUtils {
64 public:
65 
69  virtual ~DrawingUtils () {}
70 
78  //void display_image(image* img, unsigned w, unsigned h, bool show_grid = false);
79 
94  //void display_image_roi(image* img, unsigned w, unsigned h, int x1, int y1, int x2, int y2, float r, float g, float b, float a);
95 
107  void draw_frame(float x1, float y1, float x2, float y2, float r, float g, float b, float a);
108 
119  void draw_grid(float r, float g, float b, float a, float cells_h, float cells_v, float line_width_ = 1.0);
120 
133  void draw_mark(mark m, float x, float y, float size, float line_width, float r, float g, float b, float a);
134 
146  void draw_circle(float x, float y, float size, float line_width, float r, float g, float b, float a);
147 
159  void draw_plus(float x, float y, float size, float line_width, float r, float g, float b, float a);
160 
172  void draw_cross(float x, float y, float size, float line_width, float r, float g, float b, float a);
173 
185  void draw_square(float x, float y, float size, float line_width, float r, float g, float b, float a);
186 
196  void draw_square_in_place(float size, float line_width, float r, float g, float b, float a);
197 
208  void draw_filled_square(float x, float y, float size, float r, float g, float b, float a);
209 
221  void draw_rectangle(float x, float y, float h, float w, float r, float g, float b, float a);
222 
234  void draw_filled_rectangle(float x, float y, float h, float w, float r, float g, float b, float a);
235 
240  void draw_texture_in_place(float size);
241 
251  void draw_filled_square_in_place(float radius, float line_width, float r, float g, float b, float a);
252 
263  void draw_filled_rectangle_in_place(float radius_x, float radius_y, float line_width, float r, float g, float b, float a);
264 
275  void draw_cuboid(float radius, float line_width, float height, float r, float g, float b, float a);
276 
288  void draw_text(float x, float y, char* string, float r, float g, float b, float a, void* font);
289 
302  void draw_text_3i(float x, float y, float z, char* string, float r, float g, float b, float a, void* font);
303 
313  void draw_cursor(float x, float y, float r, float g, float b, float a);
314 
321  void draw_text_3d(GLfloat x, GLfloat y, char* text);
322 
328  float to_radians(float degrees);
329 
337  //v_3f get_3d_position(int x, int y, float plane);
338 
339 };
340 
341 } /* namespace visualization */
342 } /* namespace opengl */
343 } /* namespace mic */
344 
345 #endif /* SRC_VISUALIZATION_OPENGL_DRAWINGUTILS_HPP_ */
Class offering methods for drawing in OpenGL windows.
mark
Different types of marks drawn on chars.