Skip to main content

CorePlotting::SpatialTransform

CorePlotting::SpatialTransform

Layout result for spatial data with coordinate transforms. More…

#include <SpatialLayoutStrategy.hpp>

Public Functions

Name
glm::vec2 apply(glm::vec2 const & point) const
Apply transform to a point.
float applyX(float x) const
Apply transform to x coordinate only.
float applyY(float y) const
Apply transform to y coordinate only.
SpatialTransform identity()
Create identity transform (no change).

Public Attributes

Name
float x_scale
X coordinate scale factor.
float y_scale
Y coordinate scale factor.
float x_offset
X coordinate offset (applied after scaling).
float y_offset
Y coordinate offset (applied after scaling).

Detailed Description

struct CorePlotting::SpatialTransform;

Layout result for spatial data with coordinate transforms.

Unlike stacked layouts which only position data in Y, spatial layouts transform both X and Y coordinates to fit data bounds into a viewport.

The transform is: output = input * scale + offset

Public Functions Documentation

function apply

inline glm::vec2 apply(
    glm::vec2 const & point
) const

Apply transform to a point.

function applyX

inline float applyX(
    float x
) const

Apply transform to x coordinate only.

function applyY

inline float applyY(
    float y
) const

Apply transform to y coordinate only.

function identity

static inline SpatialTransform identity()

Create identity transform (no change).

Public Attributes Documentation

variable x_scale

float x_scale {1.0f};

X coordinate scale factor.

variable y_scale

float y_scale {1.0f};

Y coordinate scale factor.

variable x_offset

float x_offset {0.0f};

X coordinate offset (applied after scaling).

variable y_offset

float y_offset {0.0f};

Y coordinate offset (applied after scaling).


Updated on 2026-11-13 at 20:25:42 +0000