Skip to content
Snippets Groups Projects
Commit 0af3b281 authored by Tobias Schmidt's avatar Tobias Schmidt
Browse files

MeasureTool: add button to clear all measurements

parent b92e0452
No related branches found
No related tags found
No related merge requests found
......@@ -389,6 +389,7 @@ tools/tool_bar.hh
tools/tool_option.hh
tools/tool_manager.hh
tools/tool_options_widget.hh
tools/measure_tool.hh
tools/tool_options_win.hh
)
if (ENABLE_IMG)
......
......
......@@ -56,6 +56,8 @@ MeasureTool::MeasureTool()
opts->AddOption(col_blue);
ToolOptionFloat* line_width(new ToolOptionFloat("line_width", "Line Width", 4, 0.1, 10.0));
opts->AddOption(line_width);
ToolOptionButton* clear_button(new ToolOptionButton("clear_button", "Clear", this, SLOT(ClearMeasurements())));
opts->AddOption(clear_button);
mode_=meas_mode->GetValue();
}
......@@ -108,6 +110,11 @@ void MeasureTool::Click(const MouseEvent& event)
scene.RequestRedraw();
}
void MeasureTool::ClearMeasurements()
{
ml_.clear();
}
void MeasureTool::RenderGL()
{
glDisable(GL_LIGHTING);
......
......
......@@ -28,6 +28,7 @@
#include <ost/gfx/color.hh>
#include <QList>
#include <QWidget>
namespace ost { namespace gui {
class DLLEXPORT_OST_GUI Measurement {
......@@ -62,8 +63,10 @@ typedef std::vector<Measurement> MeasurementList;
class DLLEXPORT_OST_GUI MeasureTool : public Tool {
Q_OBJECT
public:
MeasureTool();
virtual ~MeasureTool() {};
int GetMeasureMode();
virtual void Click(const MouseEvent& event);
......@@ -75,6 +78,9 @@ public:
void RenderGL();
public slots:
void ClearMeasurements();
private:
int num_clicks_;
int mode_;
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment