| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
#ifndef VIEWERWIDGET_H_ |
| 26 |
#define VIEWERWIDGET_H_ |
| 27 |
|
| 28 |
#include "SceneObject.h" |
| 29 |
#include "SelectionBox.h" |
| 30 |
#include <octomap/octomap.h> |
| 31 |
#include <qglviewer.h> |
| 32 |
|
| 33 |
namespace octomap{ |
| 34 |
|
| 35 |
class ViewerWidget : public QGLViewer { |
| 36 |
Q_OBJECT |
| 37 |
|
| 38 |
public: |
| 39 |
|
| 40 |
ViewerWidget(QWidget* parent = NULL); |
| 41 |
void clearAll(); |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
void addSceneObject(SceneObject* obj); |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
void removeSceneObject(SceneObject* obj); |
| 57 |
|
| 58 |
public slots: |
| 59 |
void enablePrintoutMode (bool enabled = true); |
| 60 |
void enableHeightColorMode (bool enabled = true); |
| 61 |
void enableSemanticColoring (bool enabled = true); |
| 62 |
void enableSelectionBox (bool enabled = true); |
| 63 |
void setCamPosition(double x, double y, double z, double lookX, double lookY, double lookZ); |
| 64 |
void setCamPose(const octomath::Pose6D& pose); |
| 65 |
virtual void setSceneBoundingBox(const qglviewer::Vec& min, const qglviewer::Vec& max); |
| 66 |
void deleteCameraPath(int id); |
| 67 |
void appendToCameraPath(int id, const octomath::Pose6D& pose); |
| 68 |
void appendCurrentToCameraPath(int id); |
| 69 |
void addCurrentToCameraPath(int id, int frame); |
| 70 |
void removeFromCameraPath(int id, int frame); |
| 71 |
void updateCameraPath(int id, int frame); |
| 72 |
void jumpToCamFrame(int id, int frame); |
| 73 |
void playCameraPath(int id, int start_frame); |
| 74 |
void stopCameraPath(int id); |
| 75 |
const SelectionBox& selectionBox() const { return m_selectionBox;} |
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
void resetView(); |
| 81 |
|
| 82 |
private slots: |
| 83 |
void cameraPathFinished(); |
| 84 |
void cameraPathInterpolated(); |
| 85 |
|
| 86 |
signals: |
| 87 |
void cameraPathStopped(int id); |
| 88 |
void cameraPathFrameChanged(int id, int current_camera_frame); |
| 89 |
void select(const QMouseEvent* e); |
| 90 |
|
| 91 |
protected: |
| 92 |
|
| 93 |
virtual void draw(); |
| 94 |
virtual void drawWithNames(); |
| 95 |
virtual void init(); |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
virtual void postDraw(); |
| 100 |
virtual void postSelection(const QPoint&); |
| 101 |
virtual QString helpString() const; |
| 102 |
|
| 103 |
qglviewer::Quaternion poseToQGLQuaternion(const octomath::Pose6D& pose); |
| 104 |
|
| 105 |
std::vector<SceneObject*> m_sceneObjects; |
| 106 |
SelectionBox m_selectionBox; |
| 107 |
|
| 108 |
bool m_printoutMode; |
| 109 |
bool m_heightColorMode; |
| 110 |
bool m_semantic_coloring; |
| 111 |
|
| 112 |
bool m_drawAxis; |
| 113 |
bool m_drawGrid; |
| 114 |
bool m_drawSelectionBox; |
| 115 |
|
| 116 |
double m_zMin; |
| 117 |
double m_zMax; |
| 118 |
|
| 119 |
int m_current_camera_path; |
| 120 |
int m_current_camera_frame; |
| 121 |
}; |
| 122 |
|
| 123 |
} |
| 124 |
|
| 125 |
#endif |