ImportImageView.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-2016 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_IMPORT_IMAGE_VIEW_HH_
19 #define _GAZEBO_GUI_IMPORT_IMAGE_VIEW_HH_
20 
21 #include <memory>
22 #include <string>
23 
24 #include "gazebo/gui/qt.h"
25 
26 #include "gazebo/util/system.hh"
27 
28 namespace gazebo
29 {
30  namespace gui
31  {
32  // Forward declare friend class.
33  class ImportImageDialog;
34  // Forward declare provate data.
35  class ImportImageViewPrivate;
36 
39 
42  class GZ_GUI_VISIBLE ImportImageView : public QGraphicsView
43  {
44  friend class ImportImageDialog;
45 
46  Q_OBJECT
47 
50  public: ImportImageView(ImportImageDialog *_parent = 0);
51 
53  public: ~ImportImageView();
54 
57  public: void SetImage(const std::string &_filename);
58 
61  public: void RefreshDistance(double _distance);
62 
65  public: void EnableDrawDistance(bool _enable);
66 
69  private: void resizeEvent(QResizeEvent *_event);
70 
73  private: void mouseMoveEvent(QMouseEvent *_event);
74 
77  private: void mousePressEvent(QMouseEvent *_event);
78 
81  private: void mouseReleaseEvent(QMouseEvent *_event);
82 
85  private: void keyPressEvent(QKeyEvent *_event);
86 
89  private: void DrawMeasure(const QPoint &_pos);
90 
93  private: std::unique_ptr<ImportImageViewPrivate> dataPtr;
94  };
96  }
97 }
98 
99 #endif
Control the import image view and manage contents in the scene.
Definition: ImportImageView.hh:42
Definition: ImportImageDialog.hh:38