2#include <NDEVR/Model.h>
A specification of upper and lower bounds in N-dimensions.
Model()
Default constructor. Creates an uninitialized Model.
Model labelRootModel()
Retrieves or creates the child Model that serves as the root for tick labels.
Vector< 2, fltp08 > worldSpan() const
Computes the span of the visible world along the ruler's two relevant axes.
Vector< 2, uint01 > axis
The two axis indices used by this ruler based on its orientation.
Bounds< 3, fltp08 > worldBounds() const
Computes the current world-space bounding box relevant to the ruler.
void updateRuler()
Recalculates and redraws the ruler based on the current viewport state.
bool m_draw_minor
Whether minor tick lines should be drawn.
Vector< 2, fltp08 > m_last_paint_scale
The scale values from the most recent render pass.
Vector< 2, fltp08 > m_last_world_offset
The world offset from the most recent render pass.
Vector< 2, fltp08 > scale() const
Computes the current scale factor from world coordinates to pixel coordinates.
fltp08 convertPixelToModel(uint04 dim, uint04 pixel)
Converts a pixel coordinate to a model-space coordinate along the given dimension.
Vector< 2, fltp08 > worldGridSpacing() const
Computes the spacing between grid lines in world-space units.
Model minorLinesModel()
Retrieves or creates the child Model used to draw minor tick lines.
bool m_is_left_or_top
Whether the ruler is on the left or top side of the viewport.
RulerModel(RulerOrientation orientation, bool is_left_or_top, const Model &parent)
Constructs a RulerModel with the given orientation and parent.
uint04 convertModelToPixel(uint04 dim, fltp08 model)
Converts a model-space coordinate to a pixel coordinate along the given dimension.
RulerOrientation
Defines whether a ruler is oriented horizontally or vertically.
@ e_ruler_vertical
The ruler runs along the vertical axis.
@ e_ruler_horizontal
The ruler runs along the horizontal axis.
static const int MARGIN
The margin in pixels around the ruler display.
bool m_is_opaque
Whether the ruler background is drawn opaque.
Vector< 2, fltp08 > m_last_world_spacing
The grid spacing from the most recent render pass.
Model majorLinesModel()
Retrieves or creates the child Model used to draw major tick lines.
String getFormattedTickText(fltp08 value, fltp08 spacing, uint01 dim)
Formats a tick value as a display string with appropriate precision.
void setAxis()
Sets the axis indices based on the current ruler orientation.
RulerOrientation m_orientation
The orientation of this ruler (horizontal or vertical).
Vector< 2, fltp08 > worldOffset() const
Computes the current world-space offset of the viewport origin.
The core String class for the NDEVR API.
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
double fltp08
Defines an alias representing an 8 byte floating-point number.
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...