cloudEditorWidget.h
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 
00041 #ifndef CLOUD_EDITOR_WIDGET_H_
00042 #define CLOUD_EDITOR_WIDGET_H_
00043 
00044 #include <QGLWidget>
00045 #include <boost/function.hpp>
00046 #include <pcl/apps/point_cloud_editor/localTypes.h>
00047 #include <pcl/apps/point_cloud_editor/common.h>
00048 #include <pcl/apps/point_cloud_editor/commandQueue.h>
00049 #include <pcl/apps/point_cloud_editor/denoiseParameterForm.h>
00050 #include <pcl/apps/point_cloud_editor/statisticsDialog.h>
00051 #include <pcl/apps/point_cloud_editor/toolInterface.h>
00052 
00055 class CloudEditorWidget : public QGLWidget
00056 {
00057   Q_OBJECT
00058   public:
00061     CloudEditorWidget (QWidget *parent = 0);
00062 
00064     ~CloudEditorWidget ();
00065 
00070     void
00071     loadFile(const std::string &filename);
00072 
00073   public slots:
00075     void
00076     load ();
00077 
00079     void
00080     save ();
00081 
00083     void
00084     toggleBlendMode ();
00085 
00087     void
00088     view ();
00089 
00091     void
00092     select1D ();
00093 
00095     void
00096     select2D ();
00097 
00099     void
00100     select3D ();
00101 
00103     void
00104     invertSelect ();
00105 
00107     void
00108     cancelSelect ();
00109 
00111     void
00112     copy ();
00113 
00115     void
00116     paste ();
00117 
00119     void
00120     remove ();
00121 
00123     void
00124     cut ();
00125 
00128     void
00129     transform ();
00130 
00132     void
00133     denoise ();
00134 
00136     void
00137     undo ();
00138 
00140     void
00141     increasePointSize ();
00142 
00144     void
00145     decreasePointSize ();
00146 
00148     void
00149     increaseSelectedPointSize ();
00150 
00152     void
00153     decreaseSelectedPointSize ();
00154 
00156     void
00157     setPointSize (int size);
00158 
00160     void
00161     setSelectedPointSize (int size);
00162 
00164     void
00165     colorByRGB ();
00166 
00169     void
00170     colorByX ();
00171 
00174     void
00175     colorByY ();
00176 
00179     void
00180     colorByZ ();
00181 
00183     void
00184     colorByPure ();
00185 
00187     void
00188     showStat ();
00189 
00190   //signals:
00191 
00192   protected:  
00194     void
00195     initializeGL ();
00196 
00198     void
00199     paintGL ();
00200 
00202     void
00203     resizeGL (int width, int height);
00204 
00206     void
00207     mousePressEvent (QMouseEvent *event);
00208 
00210     void
00211     mouseMoveEvent (QMouseEvent *event);
00212 
00214     void
00215     mouseReleaseEvent (QMouseEvent *event);
00216 
00218     void
00219     keyPressEvent (QKeyEvent *event);
00220 
00221   private:
00222     
00226     void
00227     loadFilePCD(const std::string &filename);
00228     
00230     void
00231     initFileLoadMap();
00232     
00235     bool
00236     isColored (const std::string &fileName) const;
00237 
00239     void
00240     swapRBValues ();
00241 
00244     void
00245     initKeyMap();
00246 
00247     struct ExtCompare
00248     {
00249       bool
00250       operator()(std::string lhs, std::string rhs) const
00251       {
00252         stringToLower(lhs);
00253         stringToLower(rhs);
00254         return lhs.compare(rhs) < 0;
00255       }
00256     };
00257     typedef boost::function<void (CloudEditorWidget*, const std::string&)>
00258       FileLoadFunc;
00259     typedef std::map<std::string, FileLoadFunc, ExtCompare> FileLoadMap;
00261     FileLoadMap cloud_load_func_map_;
00262     
00264     CloudPtr cloud_ptr_;
00265 
00267     unsigned int point_size_;
00268 
00270     unsigned int selected_point_size_;
00271 
00274     boost::shared_ptr<ToolInterface> tool_ptr_;
00275 
00277     SelectionPtr selection_ptr_;
00278 
00280     CopyBufferPtr copy_buffer_ptr_;
00281 
00283     CommandQueuePtr command_queue_ptr_;
00284 
00286     double cam_fov_;
00287 
00289     double cam_aspect_;
00290 
00292     double cam_near_;
00293 
00295     double cam_far_;
00296 
00298     void
00299     initTexture ();
00300 
00302     ColorScheme color_scheme_;
00303 
00305     bool is_colored_;
00306 
00307     typedef boost::function<void (CloudEditorWidget*)> KeyMapFunc;
00309     std::map<int, KeyMapFunc> key_map_;
00310 
00312     StatisticsDialog stat_dialog_;
00313 
00314 
00315 };
00316 #endif // CLOUD_EDITOR_WIDGET_H_


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:22:46