ImportImageView.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 #ifndef GAZEBO_GUI_BUILDING_IMPORTIMAGEVIEW_HH_
18 #define GAZEBO_GUI_BUILDING_IMPORTIMAGEVIEW_HH_
19 
20 #include <memory>
21 #include <string>
22 
23 #include "gazebo/gui/qt.h"
24 
25 #include "gazebo/util/system.hh"
26 
27 namespace gazebo
28 {
29  namespace gui
30  {
31  // Forward declare friend class.
32  class ImportImageDialog;
33  // Forward declare provate data.
34  class ImportImageViewPrivate;
35 
38 
41  class GZ_GUI_VISIBLE ImportImageView : public QGraphicsView
42  {
43  friend class ImportImageDialog;
44 
45  Q_OBJECT
46 
49  public: explicit ImportImageView(ImportImageDialog *_parent = 0);
50 
52  public: ~ImportImageView();
53 
56  public: void SetImage(const std::string &_filename);
57 
60  public: void RefreshDistance(double _distance);
61 
64  public: void EnableDrawDistance(bool _enable);
65 
68  private: void resizeEvent(QResizeEvent *_event);
69 
72  private: void mouseMoveEvent(QMouseEvent *_event);
73 
76  private: void mousePressEvent(QMouseEvent *_event);
77 
80  private: void mouseReleaseEvent(QMouseEvent *_event);
81 
84  private: void keyPressEvent(QKeyEvent *_event);
85 
88  private: void DrawMeasure(const QPoint &_pos);
89 
92  private: std::unique_ptr<ImportImageViewPrivate> dataPtr;
93  };
95  }
96 }
97 
98 #endif
Control the import image view and manage contents in the scene.
Definition: ImportImageView.hh:41
Definition: ImportImageDialog.hh:37