NDEVR
API Documentation
RulerModel.h
1#pragma once
2#include <NDEVR/Model.h>
3#if NDEVR_RULER_MODEL
4namespace NDEVR
5{
133}
134#endif
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:54
Model()
Default constructor. Creates an uninitialized Model.
Definition Model.h:365
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.
Definition RulerModel.h:128
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.
Definition RulerModel.h:127
Vector< 2, fltp08 > m_last_paint_scale
The scale values from the most recent render pass.
Definition RulerModel.h:129
Vector< 2, fltp08 > m_last_world_offset
The world offset from the most recent render pass.
Definition RulerModel.h:131
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.
Definition RulerModel.h:126
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.
Definition RulerModel.h:19
@ e_ruler_vertical
The ruler runs along the vertical axis.
Definition RulerModel.h:21
@ e_ruler_horizontal
The ruler runs along the horizontal axis.
Definition RulerModel.h:20
~RulerModel()
Destructor.
static const int MARGIN
The margin in pixels around the ruler display.
Definition RulerModel.h:13
bool m_is_opaque
Whether the ruler background is drawn opaque.
Definition RulerModel.h:125
Vector< 2, fltp08 > m_last_world_spacing
The grid spacing from the most recent render pass.
Definition RulerModel.h:130
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).
Definition RulerModel.h:124
Vector< 2, fltp08 > worldOffset() const
Computes the current world-space offset of the viewport origin.
The core String class for the NDEVR API.
Definition String.h:95
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
Definition Vector.hpp:62
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...