00001 /* 00002 * CloudViewerInteractorStyl.h 00003 * 00004 * Created on: Aug 21, 2018 00005 * Author: mathieu 00006 */ 00007 00008 #ifndef GUILIB_SRC_CLOUDVIEWERINTERACTORSTYLE_H_ 00009 #define GUILIB_SRC_CLOUDVIEWERINTERACTORSTYLE_H_ 00010 00011 #include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines 00012 00013 #include <pcl/visualization/mouse_event.h> 00014 #include <pcl/visualization/point_picking_event.h> 00015 #include <pcl/visualization/interactor_style.h> 00016 #include <pcl/point_types.h> 00017 00018 namespace rtabmap { 00019 00020 class CloudViewer; 00021 00022 class RTABMAPGUI_EXP CloudViewerInteractorStyle: public pcl::visualization::PCLVisualizerInteractorStyle 00023 { 00024 public: 00025 static CloudViewerInteractorStyle *New (); 00026 vtkTypeMacro(CloudViewerInteractorStyle, pcl::visualization::PCLVisualizerInteractorStyle); 00027 00028 public: 00029 CloudViewerInteractorStyle(); 00030 virtual void Rotate(); 00031 void setOrthoMode(bool enabled); 00032 protected: 00033 virtual void OnMouseMove(); 00034 virtual void OnLeftButtonDown(); 00035 00036 protected: 00037 friend class CloudViewer; 00038 void setCloudViewer(CloudViewer * cloudViewer) {viewer_ = cloudViewer;} 00039 CloudViewer * viewer_; 00040 00041 private: 00042 unsigned int NumberOfClicks; 00043 int PreviousPosition[2]; 00044 int ResetPixelDistance; 00045 float PreviousMeasure[3]; 00046 pcl::PointCloud<pcl::PointXYZRGB>::Ptr pointsHolder_; 00047 bool orthoMode_; 00048 }; 00049 00050 } /* namespace rtabmap */ 00051 00052 #endif /* GUILIB_SRC_CLOUDVIEWERINTERACTORSTYLE_H_ */