MeasureItem.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2014 Open Source Robotics Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16*/
17
18#ifndef _GAZEBO_GUI_BUILDING_MEASUREITEM_HH_
19#define _GAZEBO_GUI_BUILDING_MEASUREITEM_HH_
20
21#include <memory>
22#include <ignition/math/Vector2.hh>
23
24#include "gazebo/gui/qt.h"
26
27#include "gazebo/util/system.hh"
28
29namespace gazebo
30{
31 namespace gui
32 {
33 // Forward declare private data.
34 class MeasureItemPrivate;
35
38
41 class GZ_GUI_VISIBLE MeasureItem : public SegmentItem
42 {
43 Q_OBJECT
44
49 public: MeasureItem(const ignition::math::Vector2d &_start,
50 const ignition::math::Vector2d &_end);
51
53 public: ~MeasureItem();
54
55 // Documentation inherited
56 private: virtual void paint(QPainter *_painter,
57 const QStyleOptionGraphicsItem *_option, QWidget *_widget);
58
61 public: double Distance() const;
62
65 public: void SetValue(double _value);
66
69 private: std::unique_ptr<MeasureItemPrivate> dataPtr;
70 };
72 }
73}
74
75#endif
gui
Definition KeyEventHandler.hh:29
Measurement lines and values.
Definition MeasureItem.hh:42
double Distance() const
Get distance between end points.
MeasureItem(const ignition::math::Vector2d &_start, const ignition::math::Vector2d &_end)
Constructor param[in] _start Start position of the measure item in pixel coordinates.
void SetValue(double _value)
Set value in meters.
2D line segment.
Definition SegmentItem.hh:46
Forward declarations for the common classes.
Definition Animation.hh:27