Graphite  Version 3
An experimental 3D geometry processing program
OGF::Overlay Class Reference

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...
 

Detailed Description

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.

Definition at line 53 of file overlay.h.

Member Function Documentation

◆ circle()

void OGF::Overlay::circle ( vec2  p1,
double  R,
Color  color,
double  thickness = 1.0 
)

Adds a circle to the display list.

Parameters
[in]p1the 2D coordinates of the center of the circle. One may use Tool::project_point() to obtain them from real-world coordinates.
[in]Rthe radius of the circle
[in]thecolor, with alpha
[in]thicknessline thickness (ImGui can draw antialiased thick lines).

◆ fillcircle()

void OGF::Overlay::fillcircle ( vec2  p1,
double  R,
Color  color 
)

Adds a filled circle to the display list.

Parameters
[in]p1the 2D coordinates of the center of the circle. One may use Tool::project_point() to obtain them from real-world coordinates.
[in]Rthe radius of the circle
[in]thecolor, with alpha

◆ fillquad()

void OGF::Overlay::fillquad ( vec2  p1,
vec2  p2,
vec2  p3,
vec2  p4,
Color  color 
)

Adds a filled triangle to the display list.

Parameters
[in]p1,p2,p3,p4the 2D coordinates of two corners of the rectangle. One may use Tool::project_point() to obtain them from real-world coordinates.
[in]thecolor, with alpha

◆ fillrect()

void OGF::Overlay::fillrect ( vec2  p1,
vec2  p2,
Color  color 
)

Adds a filled rectangle to the display list.

Parameters
[in]p1,p2the 2D coordinates of two corners of the rectangle. One may use Tool::project_point() to obtain them from real-world coordinates.
[in]thecolor, with alpha

◆ filltriangle()

void OGF::Overlay::filltriangle ( vec2  p1,
vec2  p2,
vec2  p3,
Color  color 
)

Adds a filled triangle to the display list.

Parameters
[in]p1,p2,p3the 2D coordinates of two corners of the rectangle. One may use Tool::project_point() to obtain them from real-world coordinates.
[in]thecolor, with alpha

◆ playback()

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.

◆ rect()

void OGF::Overlay::rect ( vec2  p1,
vec2  p2,
Color  color,
double  thickness = 1.0 
)

Adds a rectangle to the display list.

Parameters
[in]p1,p2the 2D coordinates of two corners of the rectangle. One may use Tool::project_point() to obtain them from real-world coordinates.
[in]thecolor, with alpha
[in]thicknessline thickness (ImGui can draw antialiased thick lines).

◆ segment()

void OGF::Overlay::segment ( vec2  p1,
vec2  p2,
Color  color,
double  thickness = 1.0 
)

Adds a segment to the display list.

Parameters
[in]p1,p2the 2D coordinates of the extremities of the segment. One may use Tool::project_point() to obtain them from real-world coordinates.
[in]thecolor, with alpha
[in]thicknessline thickness (ImGui can draw antialiased thick lines).

The documentation for this class was generated from the following file: