34#include <NDEVR/Camera.h>
46 class QTResourceListener;
54 static const int MARGIN = 4;
63 Ruler(
bool is_horizontal,
bool is_left_or_top, QWidget* parent);
65 void setCamera(
const DynamicPointer<Camera>& camera);
66 QSize sizeHint()
const override;
67 void paintEvent(QPaintEvent *event)
override;
68 void paintBackground(QPainter& g2D);
69 void paintRuler(QPainter& g2D);
70 void setLabel(
const String& label,
const Vector<2, fltp08>& location = Vector<2, fltp08>(0.0));
71 void setLabelMode(LabelMode mode);
73 RGBColor labelBackground();
74 void setLabelsVisible(
bool visible);
77 Vector<2, fltp08> labelPixelLocation()
const;
78 Bounds<3, fltp08> worldBounds()
const;
79 Vector<2, fltp08> worldSpan()
const;
80 Vector<2, fltp08> scale()
const;
81 Vector<2, fltp08> worldOffset()
const;
82 Vector<2, fltp08> worldGridSpacing()
const;
83 fltp08 convertPixelToModel(uint04 dim, uint04 pixel);
84 uint04 convertModelToPixel(uint04 dim, fltp08 model);
85 TranslatedString getFormattedTickText(fltp08 value, fltp08 spacing, uint01 dim);
87 QTResourceListener* m_camera_listener;
88 QTResourceListener* m_coordinate_listener;
91 RGBColor m_label_background;
92 LabelMode m_label_mode;
93 ConstPointer<Camera> m_camera;
94 Vector<2, uint01> m_axis;
95 Vector<2, uint01> m_label_axis;
96 Vector<2, fltp08> m_last_paint_scale;
97 Vector<2, fltp08> m_last_label_location;
98 Vector<2, fltp08> m_last_world_spacing;
99 Vector<2, fltp08> m_last_world_offset;
100 Vector<2, fltp08> m_label_location;
101 String m_last_label_text;
102 RGBColor m_last_label_background;
104 bool m_is_left_or_top;
106 bool m_labels_visible;
113 CameraRulerMenu(
const DynamicPointer<Camera>& camera, Button* combo,
const void* lock_ptr);
114 CameraRulerMenu(Button* combo,
const void* lock_ptr);
115 void setCamera(
const DynamicPointer<Camera>& camera);
116 void setLockPointer(
const void* lock_ptr);
117 void setShowRuler(
const TranslatedString& ruler_name,
bool show_vertical,
bool show_horizontal,
bool show_lockable);
118 void updateFromModel();
122 void requestShowRuler(
bool show_vertical,
bool show_horizontal);
124 bool m_show_lockable;
128 QWidgetAction* m_lock_act;
129 QWidgetAction* m_show_vert_act;
130 QWidgetAction* m_show_horz_act;
131 QWidgetAction* m_show_grid_act;
132 Toggle* m_vert_toggle;
133 Toggle* m_horz_toggle;
134 Toggle* m_lock_toggle;
135 Toggle* m_show_grid_toggle;
136 QActionGroup* m_view_mode_group;
138 DynamicPointer<Camera> m_camera;
139 TranslatedString m_ruler_name;
140 const void* m_lock_ptr;
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