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 | |
void | clear () |
Removes all primitives to be displayed. | |
void | playback () |
Plays back this overlay to the current ImGui context. More... | |
void | segment (vec2 p1, vec2 p2, Color color, double thickness=1.0) |
Adds a segment to the display list. More... | |
void | rect (vec2 p1, vec2 p2, Color color, double thickness=1.0) |
Adds a rectangle to the display list. More... | |
void | fillrect (vec2 p1, vec2 p2, Color color) |
Adds a filled rectangle to the display list. More... | |
void | circle (vec2 p1, double R, Color color, double thickness=1.0) |
Adds a circle to the display list. More... | |
void | fillcircle (vec2 p1, double R, Color color) |
Adds a filled circle to the display list. More... | |
void | filltriangle (vec2 p1, vec2 p2, vec2 p3, Color color) |
Adds a filled triangle to the display list. More... | |
void | fillquad (vec2 p1, vec2 p2, vec2 p3, vec2 p4, Color color) |
Adds a filled triangle to the display list. More... | |
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.
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. |
[in] | R | the radius of the circle |
[in] | 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. |
[in] | R | the radius of the circle |
[in] | 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. |
[in] | 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. |
[in] | 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. |
[in] | the | color, with alpha |
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. |
[in] | 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. |
[in] | the | color, with alpha |
[in] | thickness | line thickness (ImGui can draw antialiased thick lines). |