EditDepthArea.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the Universite de Sherbrooke nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #ifndef RTABMAP_EDITDEPTHAREA_H
29 #define RTABMAP_EDITDEPTHAREA_H
30 
31 #include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines
32 
33 #include <QColor>
34 #include <QImage>
35 #include <QPoint>
36 #include <QWidget>
37 #include <opencv2/opencv.hpp>
38 
39 class QMenu;
40 class QAction;
41 
42 namespace rtabmap {
43 
44 class RTABMAPGUI_EXP EditDepthArea : public QWidget
45 {
46  Q_OBJECT
47 
48 public:
49  EditDepthArea(QWidget *parent = 0);
50 
51  void setImage(const cv::Mat & depth, const cv::Mat & rgb = cv::Mat());
52  cv::Mat getModifiedImage() const;
53  bool isModified() const {return modified_;}
54 
55  void setPenWidth(int newWidth);
56  int penWidth() const { return myPenWidth_; }
57 
58 public Q_SLOTS:
59  void resetChanges();
60 
61 protected:
62  virtual void mousePressEvent(QMouseEvent *event);
63  virtual void mouseMoveEvent(QMouseEvent *event);
64  virtual void mouseReleaseEvent(QMouseEvent *event);
65  virtual void paintEvent(QPaintEvent *event);
66  virtual void resizeEvent(QResizeEvent *event);
67  virtual void contextMenuEvent(QContextMenuEvent * e);
68 
69 private:
70  void drawLineTo(const QPoint &endPoint);
71  void computeScaleOffsets(const QRect & targetRect, float & scale, float & offsetX, float & offsetY) const;
72 
73  bool modified_;
76  QImage imageRGB_;
77  QImage image_;
78  cv::Mat originalImage_;
79  QPoint lastPoint_;
80 
81  QMenu * menu_;
82  QAction * showRGB_;
83  QAction * removeCluster_;
84  QAction * resetChanges_;
85  QAction * setPenWidth_;
86 };
87 
88 }
89 
90 #endif
#define RTABMAPGUI_EXP
Definition: RtabmapGuiExp.h:38
bool isModified() const
Definition: EditDepthArea.h:53
GLM_FUNC_DECL genType e()
GLM_FUNC_DECL detail::tmat4x4< T, P > scale(detail::tmat4x4< T, P > const &m, detail::tvec3< T, P > const &v)


rtabmap
Author(s): Mathieu Labbe
autogenerated on Wed Jun 5 2019 22:41:31