|
Graphite Version 3
An experimental 3D geometry processing program
|
A display list that memorizes simple graphic primitives to be displayed over the 3D rendering window. More...
#include <OGF/renderer/context/overlay.h>
Public Member Functions | |
| Overlay (RenderingContext *rendering_context) | |
| void | clear () |
| Removes all primitives to be displayed. | |
| void | playback () |
| Plays back this overlay to the current ImGui context. | |
| void | segment (vec2 p1, vec2 p2, Color color, double thickness=1.0) |
| Adds a segment to the display list. | |
| void | rect (vec2 p1, vec2 p2, Color color, double thickness=1.0) |
| Adds a rectangle to the display list. | |
| void | fillrect (vec2 p1, vec2 p2, Color color) |
| Adds a filled rectangle to the display list. | |
| void | circle (vec2 p1, double R, Color color, double thickness=1.0) |
| Adds a circle to the display list. | |
| void | fillcircle (vec2 p1, double R, Color color) |
| Adds a filled circle to the display list. | |
| void | filltriangle (vec2 p1, vec2 p2, vec2 p3, Color color) |
| Adds a filled triangle to the display list. | |
| void | fillquad (vec2 p1, vec2 p2, vec2 p3, vec2 p4, Color color) |
| Adds a filled triangle to the display list. | |
| vec2f | imgui_to_GL (const vec2f &XY_imgui) const |
| Converts Dear ImGui coordinates to OpenGL coordinate. | |
| vec2f | GL_to_imgui (const vec2f &XY_GL) const |
| Converts OpenGL coordinates to Dear ImGui coordinate. | |
| vec2f | GL_to_imgui (const vec2 &XY_GL) const |
| Converts OpenGL coordinates to Dear ImGui coordinate. | |
A display list that memorizes simple graphic primitives to be displayed over the 3D rendering window.
Used by some tools. We cannot directly use ImDrawList API, because mouse event handler of the 3D window are called completely independelty of ImGui, so we need a "protocol" to communicate between the two worlds. All functions use OpenGL device coordinates, that is, in pixels, with origin in lower left corner.
|
inline |
Adds a circle to the display list.
| [in] | p1 | the 2D coordinates of the center of the circle. One may use Tool::project_point() to obtain them from real-world coordinates. Origin is lower-left corner. |
| [in] | R | the radius of the circle |
| [in] | color | the color, with alpha |
| [in] | thickness | line thickness (ImGui can draw antialiased thick lines). |
Adds a filled circle to the display list.
| [in] | p1 | the 2D coordinates of the center of the circle. One may use Tool::project_point() to obtain them from real-world coordinates. Origin is lower-left corner. |
| [in] | R | the radius of the circle |
| [in] | color | the color, with alpha |
Adds a filled triangle to the display list.
| [in] | p1,p2,p3,p4 | the 2D coordinates of two corners of the rectangle. One may use Tool::project_point() to obtain them from real-world coordinates. Origin is lower-left corner. |
| [in] | color | the color, with alpha |
Adds a filled rectangle to the display list.
| [in] | p1,p2 | the 2D coordinates of two corners of the rectangle. One may use Tool::project_point() to obtain them from real-world coordinates. Origin is lower-left corner. |
| [in] | color | the color, with alpha |
Adds a filled triangle to the display list.
| [in] | p1,p2,p3 | the 2D coordinates of two corners of the rectangle. One may use Tool::project_point() to obtain them from real-world coordinates. Origin is lower-left corner. |
| [in] | color | the color, with alpha |
Converts OpenGL coordinates to Dear ImGui coordinate.
| [in] | XY_GL | a point in OpenGL Window coordinates, with origin at bottom-left corner, in double-precision. |
Converts OpenGL coordinates to Dear ImGui coordinate.
| [in] | XY_GL | a point in OpenGL Window coordinates, with origin at bottom-left corner. |
Converts Dear ImGui coordinates to OpenGL coordinate.
| [in] | XY_imgui | a point in imgui coordinates, with origin at top-left corner and possibly retina-screen scaling |
| void OGF::Overlay::playback | ( | ) |
Plays back this overlay to the current ImGui context.
This function needs to be called right before ImGui::Render(). It is called by ApplicationImpl::draw_gui() in skin_imgui.
Adds a rectangle to the display list.
| [in] | p1,p2 | the 2D coordinates of two corners of the rectangle. One may use Tool::project_point() to obtain them from real-world coordinates. Origin is lower-left corner. |
| [in] | color | the color, with alpha |
| [in] | thickness | line thickness (ImGui can draw antialiased thick lines). |
Adds a segment to the display list.
| [in] | p1,p2 | the 2D coordinates of the extremities of the segment. One may use Tool::project_point() to obtain them from real-world coordinates. Origin is lower-left corner. |
| [in] | color | the color, with alpha |
| [in] | thickness | line thickness (ImGui can draw antialiased thick lines). |