Rodin::Plot::Plot class

Main plotting interface for finite element visualization.

The Plot class serves as the central interface for creating and managing visualizations of finite element data. It provides a high-level API for rendering meshes, functions, and analysis results with interactive controls.

Usage Example

Plot plot;
auto figure = plot.figure();
figure.plot(mesh);
figure.plot(solution);
plot.show();

Technical Details

  • Uses OpenGL for hardware-accelerated rendering
  • Supports multiple concurrent figure windows
  • Provides customizable rendering options and visual styles
  • Integrates with Rodin's finite element data structures

Public types

enum SwapInterval { ADAPTIVE = -1, IMMEDIATE = 0, VSYNC = 1 }
Buffer swap interval modes for controlling rendering synchronization.

Public functions

template<class ... Args>
auto figure(Args && ... args) -> Artist::Figure&
template<class ... Args>
auto figure(Args && ... args) const -> const Artist::Figure&
auto setSwapInterval(SwapInterval interval) -> bool
auto getSwapInterval() const -> SwapInterval
void show()
auto count() const -> size_t
auto getGLContext() const -> const SDL_GLContext&
void setCursor(GUI::Cursor::SystemCursor c)

Enum documentation

enum Rodin::Plot::Plot::SwapInterval

Buffer swap interval modes for controlling rendering synchronization.

This enumeration defines the synchronization behavior between buffer swaps and the display's vertical refresh rate, allowing control over frame rate and visual quality trade-offs.

Enumerators
ADAPTIVE

Adaptive vertical synchronization.

Updates synchronized with the vertical retrace, except that if the vertical retrace for the current frame was missed the buffers are swapped immediately. This provides smooth rendering while avoiding input lag.

IMMEDIATE

Immediate buffer swaps.

Immediate updates without synchronization. This provides the highest frame rate but may result in screen tearing.

VSYNC

Vertical synchronization.

Updates synchronized with the vertical retrace. This eliminates screen tearing but may introduce input lag and limits frame rate to the display refresh rate.

Function documentation

template<class ... Args>
Artist::Figure& Rodin::Plot::Plot::figure(Args && ... args)

Parameters
args in Arguments to be passed to the Figure constructor
Returns Reference to the Artist::Figure instance.

Creates a new figure managed by the Plot object.

template<class ... Args>
const Artist::Figure& Rodin::Plot::Plot::figure(Args && ... args) const

Parameters
args in Arguments to be passed to the Figure constructor
Returns Const reference to the Artist::Figure instance.

Creates a new figure managed by the Plot object.

bool Rodin::Plot::Plot::setSwapInterval(SwapInterval interval)

Parameters
interval in Swap interval
Returns true if the operation was successful, false otherwise.

Sets the global swap interval for each figure managed by the Plot object.

SwapInterval Rodin::Plot::Plot::getSwapInterval() const

Returns Swap interval

Queries the current value of the swap interval.

void Rodin::Plot::Plot::show()

Displays all the figures and enters the event handling loop, which blocks execution.

size_t Rodin::Plot::Plot::count() const

Returns The number of figures managed by the the Plot object.

const SDL_GLContext& Rodin::Plot::Plot::getGLContext() const

Returns The underlying OpenGL context.

void Rodin::Plot::Plot::setCursor(GUI::Cursor::SystemCursor c)

Sets the cursor