80 elements.push_back(el);
108 glDepthMask(GL_FALSE);
109 glDisable(GL_DEPTH_TEST);
110 for (
unsigned int i = 0; i < elements.size(); ++i)
112 elements[i]->render(camera_2d, gui_shader);
114 glDepthMask(GL_TRUE);
124 bool checkClicked (
int x,
int y, vector <Tucano::GUI::Element *> * list)
126 for (
unsigned int i = 0; i < list->size(); ++i)
131 last_clicked = element;
void setViewportSize(int w, int h)
Set viewport size.
Definition: base.hpp:98
virtual void cursorMove(int x, int y)
Set behavior when mouse is released after clicking this element.
Definition: element.hpp:260
Base class for all GUI elements (buttons, sliders ...)
Definition: element.hpp:52
Definition: element.hpp:39
const string gui_vertex_code
Default vertex shader for rendering gui elements.
Definition: guishaders.hpp:50
bool isVisible(void)
Return whether element is visible or not.
Definition: element.hpp:359
Definition: bufferobject.hpp:34
bool leftButtonReleased(int x, int y)
Treats mouse left release callback for last clicked element.
Definition: base.hpp:179
Tucano::GUI::Element * last_clicked
Last clicked element.
Definition: base.hpp:62
void setShaderName(string name)
Sets the shader name, very useful for debugging.
Definition: shader.hpp:329
Base(void)
Default constructor.
Definition: base.hpp:69
Tucano::Shader gui_shader
Shader for rendering gui elements.
Definition: base.hpp:56
A Shader object represents one GLSL program.
Definition: shader.hpp:45
The gui select group is a placeholder for many selection buttons, so only one can be active at a time...
Definition: selectgroup.hpp:39
void add(Element *el)
Adds an element to the gui.
Definition: base.hpp:78
The gui group box is just a placeholder for other gui elements. It can be used to group elements...
Definition: groupbox.hpp:41
void initializeFromStrings(string in_vertex_code, string in_fragment_code, string in_geometry_code="", string in_tessellation_evaluation_code="", string in_tessellation_control_code="")
Initializes shader directly from string, no files.
Definition: shader.hpp:589
Eigen::Vector2i viewport_size
Viewport size.
Definition: base.hpp:50
Definition: element.hpp:44
Tucano::Camera camera_2d
2D camera
Definition: base.hpp:53
void render(void)
renders the 2D gui interface
Definition: base.hpp:106
Definition: element.hpp:40
Definition: element.hpp:43
const string gui_fragment_code
Default fragment shader for rendering gui elments.
Definition: guishaders.hpp:35
bool cursorMove(int x, int y)
Treats mouse mouvement.
Definition: base.hpp:196
virtual void release(void)
Set behavior when mouse is released after clicking this element.
Definition: element.hpp:253
bool checkClicked(int x, int y, vector< Tucano::GUI::Element * > *list)
Check if any element in a given list is inside clicked coordinates.
Definition: base.hpp:124
void setViewportSize(const Eigen::Vector2i &vs)
Set viewport size.
Definition: base.hpp:87
Base class for GUI, contains all elements and handles viewport and rendering transformations.
Definition: base.hpp:45
bool isInside(int x, int y)
Overloads the isInside method. Queries if a point is inside the button.
Definition: element.hpp:233
void reset(void)
Resets trackball to initial position and orientation.
Definition: camera.hpp:104
virtual int getType(void)
Returns the element type.
Definition: element.hpp:265
bool leftButtonPressed(int x, int y)
Treats mouse left click callback for all elements.
Definition: base.hpp:167
Defines an abstract camera with a projection and view matrices.
Definition: camera.hpp:37
Definition: element.hpp:41
Eigen::Matrix4f setOrthographicMatrix(float left, float right, float bottom, float top, float near_plane, float far_plane)
Sets the projection matrix as a orthographic matrix.
Definition: camera.hpp:465
vector< Tucano::GUI::Element * > elements
Vector containing gui elements.
Definition: base.hpp:59
The slide class draws a dragable cursor over a bar.
Definition: slider.hpp:39