API Documentation
Loading...
Searching...
No Matches
RulerModel.h
Go to the documentation of this file.
1#pragma once
2#include <NDEVR/Model.h>
3#if NDEVR_RULER_MODEL
4namespace NDEVR
5{
6 /**--------------------------------------------------------------------------------------------------
7 \brief A Model which can be used to show lengths of data between two points.
8 **/
9 class RulerModel : public Model
10 {
11 public:
12 static const int MARGIN = 4;
13 enum RulerOrientation
14 {
15 e_ruler_horizontal
16 , e_ruler_vertical
17 };
18
19 public:
20 RulerModel(RulerOrientation orientation, bool is_left_or_top, const Model& parent);
21 ~RulerModel();
22 public:
23 void updateRuler();
24 protected:
25 Model minorLinesModel();
26 Model majorLinesModel();
27 Model labelRootModel();
28 void setAxis();
29 Bounds<3, fltp08> worldBounds() const;
30 Vector<2, fltp08> worldSpan() const;
31 Vector<2, fltp08> scale() const;
32 Vector<2, fltp08> worldOffset() const;
33 Vector<2, fltp08> worldGridSpacing() const;
34 fltp08 convertPixelToModel(uint04 dim, uint04 pixel);
35 uint04 convertModelToPixel(uint04 dim, fltp08 model);
36
37 String getFormattedTickText(fltp08 value, fltp08 spacing, uint01 dim);
38 protected:
39 RulerOrientation m_orientation;
40 bool m_is_opaque;
41 bool m_is_left_or_top;
42 bool m_draw_minor;
43 Vector<2, uint01> axis;
44 Vector<2, fltp08> m_last_paint_scale;
45 Vector<2, fltp08> m_last_world_spacing;
46 Vector<2, fltp08> m_last_world_offset;
47 };
48}
49#endif
Definition ACIColor.h:37
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149