#include <measure.hh>
◆ Ptr
◆ create()
◆ displayMeasurement()
67{
70
71 view->setStatusMessage(
72 fmt::format(
73 "l: {:.1f}, dx: {}, dy: {}, from: {}, to: {}",
74 tweaked.length(),
75 tweaked.width(),
76 tweaked.height(),
77 tweaked.start,
78 tweaked.end
79 )
80 );
81}
std::optional< Selection > selection
Definition measure.hh:27
const auto view
Definition pipette-tests.cc:227
Definition viewinterface.hh:37
Referenced by onSelectionEnd(), and onSelectionUpdate().
◆ drawCross()
84{
85 static const int size = 10;
86 cairo_move_to(
cr,
p.x - size,
p.y);
87 cairo_line_to(
cr,
p.x + size,
p.y);
88 cairo_move_to(
cr,
p.x,
p.y - size);
89 cairo_line_to(
cr,
p.x,
p.y + size);
90}
PresentationInterfaceStub::Ptr const p
Definition determine-size-test.cc:172
Referenced by render().
◆ onDisable()
| void MeasureHandler::onDisable |
( |
| ) |
|
|
overridevirtual |
Then function is called whenever the tool button is deselected.
Implements ToolStateListener.
150{
153}
bool enabled
Definition measure.hh:28
◆ onEnable()
| void MeasureHandler::onEnable |
( |
| ) |
|
|
overridevirtual |
This function is called whenever the tool button is selected.
Implements ToolStateListener.
◆ onSelectionEnd()
This function is called whenever the selection ends. That is, whenever the user releases the mouse button that was pressed.
The final selection is passed as an argument.
- See also
- Selection
Implements SelectionListener.
108{
110 {
113 }
114}
virtual void displayMeasurement(const ViewInterface::Ptr &view)
Definition measure.cc:66
◆ onSelectionStart()
This function is called whenever the user clicks a view. The point that is clicked is passed as an argument.
The passed point is a point in the presentation coordinate space.
Implements SelectionListener.
◆ onSelectionUpdate()
This function is called whenever the selection updates. That is, whenever the user moves the mouse while keeping the mouse button pressed.
The updated selection is passed as an argument.
- See also
- Selection
Implements SelectionListener.
◆ render()
This function is called after the presentation finishes redrawing.
- Parameters
-
| vi | The ViewInterface on whose behalf the request is made |
| cr | The context to with, the origin of the context is translated to be the same as the origin of the presentation. |
| presentationArea | the area that is to be drawn. The given x and y coordinates should map on 0,0 of the given context cr. |
| zoom | The requested zoom level. One pixel should have size 2**zoom when drawn. zoom may be negative. |
Implements PostRenderer.
126{
128 {
132
133 cairo_set_line_width(
cr, 1);
134 cairo_set_source_rgb(
cr, 0.75, 0, 0);
138 cairo_set_source_rgb(
cr, 1, 0, 0);
140 cairo_line_to(
cr, end.x, end.y);
142 }
143}
double pixelSizeFromZoom(int zoom)
Definition cairo-helpers.cc:123
virtual void drawCross(cairo_t *cr, Scroom::Utils::Point< double > p)
Definition measure.cc:83
xy_type getTopLeft() const
Definition rectangle.hh:133
const SampleIterator< const uint8_t > start(nullptr, initial_offset, bps)
◆ enabled
| bool MeasureHandler::enabled {false} |
|
private |
◆ selection
| std::optional<Selection> MeasureHandler::selection |
|
private |
The documentation for this class was generated from the following files: