34#include <NDEVR/Camera.h>
46 class QTResourceListener;
50 static const int MARGIN = 4;
59 Ruler(
bool is_horizontal,
bool is_left_or_top, QWidget* parent);
61 void setCamera(
const DynamicPointer<Camera>& camera);
62 QSize sizeHint()
const override;
63 void paintEvent(QPaintEvent *event)
override;
64 void paintBackground(QPainter& g2D);
65 void paintRuler(QPainter& g2D);
66 void setLabel(
const String& label,
const Vector<2, fltp08>& location = Vector<2, fltp08>(0.0));
67 void setLabelMode(LabelMode mode);
69 RGBColor labelBackground();
70 void setLabelsVisible(
bool visible);
73 Vector<2, fltp08> labelPixelLocation()
const;
74 Bounds<3, fltp08> worldBounds()
const;
75 Vector<2, fltp08> worldSpan()
const;
76 Vector<2, fltp08> scale()
const;
77 Vector<2, fltp08> worldOffset()
const;
78 Vector<2, fltp08> worldGridSpacing()
const;
79 fltp08 convertPixelToModel(uint04 dim, uint04 pixel);
80 uint04 convertModelToPixel(uint04 dim, fltp08 model);
81 TranslatedString getFormattedTickText(fltp08 value, fltp08 spacing, uint01 dim);
83 QTResourceListener* m_camera_listener;
84 QTResourceListener* m_coordinate_listener;
87 RGBColor m_label_background;
88 LabelMode m_label_mode;
89 ConstPointer<Camera> m_camera;
90 Vector<2, uint01> m_axis;
91 Vector<2, uint01> m_label_axis;
92 Vector<2, fltp08> m_last_paint_scale;
93 Vector<2, fltp08> m_last_label_location;
94 Vector<2, fltp08> m_last_world_spacing;
95 Vector<2, fltp08> m_last_world_offset;
96 Vector<2, fltp08> m_label_location;
97 String m_last_label_text;
98 RGBColor m_last_label_background;
100 bool m_is_left_or_top;
102 bool m_labels_visible;
109 CameraRulerMenu(
const DynamicPointer<Camera>& camera, Button* combo,
const void* lock_ptr);
110 CameraRulerMenu(Button* combo,
const void* lock_ptr);
111 void setCamera(
const DynamicPointer<Camera>& camera);
112 void setLockPointer(
const void* lock_ptr);
113 void setShowRuler(
const TranslatedString& ruler_name,
bool show_vertical,
bool show_horizontal,
bool show_lockable);
114 void updateFromModel();
118 void requestShowRuler(
bool show_vertical,
bool show_horizontal);
120 bool m_show_lockable;
124 QWidgetAction* m_lock_act;
125 QWidgetAction* m_show_vert_act;
126 QWidgetAction* m_show_horz_act;
127 QWidgetAction* m_show_grid_act;
128 Toggle* m_vert_toggle;
129 Toggle* m_horz_toggle;
130 Toggle* m_lock_toggle;
131 Toggle* m_show_grid_toggle;
132 QActionGroup* m_view_mode_group;
134 DynamicPointer<Camera> m_camera;
135 TranslatedString m_ruler_name;
136 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:115
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:176