saving CloudViewer settings (Camera,Trajectory,Grid) in the config file

This commit is contained in:
Mathieu Labbe
2015-01-13 18:11:34 -05:00
parent 6bd2a0926b
commit fb0b23ae06
10 changed files with 379 additions and 27 deletions

View File

@@ -127,7 +127,7 @@ public:
float opacity);
void removeOccupancyGridMap();
void updateCameraPosition(
void updateCameraTargetPosition(
const Transform & pose);
void addOrUpdateGraph(
@@ -137,8 +137,10 @@ public:
void removeGraph(const std::string & id);
void removeAllGraphs();
bool isTrajectoryShown() const;
int getTrajectorySize() const;
void setTrajectoryShown(bool shown);
void setTrajectorySize(int value);
void setTrajectorySize(unsigned int value);
void clearTrajectory();
void removeAllClouds(); //including meshes
@@ -149,12 +151,30 @@ public:
const QMap<std::string, Transform> & getAddedClouds() const {return _addedClouds;} //including meshes
const QColor & getBackgroundColor() const;
Transform getTargetPose() const;
void getCameraPosition(
float & x, float & y, float & z,
float & focalX, float & focalY, float & focalZ,
float & upX, float & upY, float & upZ) const;
bool isCameraTargetLocked() const;
bool isCameraTargetFollow() const;
bool isCameraFree() const;
bool isCameraLockZ() const;
bool isGridShown() const;
unsigned int getGridCellCount() const;
float getGridCellSize() const;
void setCameraPosition(
float x, float y, float z,
float focalX, float focalY, float focalZ,
float upX, float upY, float upZ);
void setCameraTargetLocked(bool enabled = true);
void setCameraTargetFollow(bool enabled = true);
void setCameraFree();
void setCameraLockZ(bool enabled = true);
void setGridShown(bool shown);
void setGridCellCount(unsigned int count);
void setGridCellSize(float size);
void setWorkingDirectory(const QString & path) {_workingDirectory = path;}
public slots:
@@ -168,6 +188,8 @@ public slots:
protected:
virtual void keyReleaseEvent(QKeyEvent * event);
virtual void keyPressEvent(QKeyEvent * event);
virtual void mousePressEvent(QMouseEvent * event);
virtual void mouseMoveEvent(QMouseEvent * event);
virtual void contextMenuEvent(QContextMenuEvent * event);
virtual void handleAction(QAction * event);
QMenu * menu() {return _menu;}
@@ -188,11 +210,15 @@ private:
QAction * _aSetTrajectorySize;
QAction * _aClearTrajectory;
QAction * _aShowGrid;
QAction * _aSetGridCellCount;
QAction * _aSetGridCellSize;
QAction * _aSetBackgroundColor;
QMenu * _menu;
std::map<std::string, pcl::PointCloud<pcl::PointXYZ>::Ptr > _graphes;
pcl::PointCloud<pcl::PointXYZ>::Ptr _trajectory;
unsigned int _maxTrajectorySize;
unsigned int _gridCellCount;
float _gridCellSize;
QMap<std::string, Transform> _addedClouds; // include cloud, scan, meshes
Transform _lastPose;
std::list<std::string> _gridLines;

View File

@@ -53,10 +53,10 @@ public:
void resetZoom();
bool isImageShown();
bool isImageDepthShown();
bool isFeaturesShown();
bool isLinesShown();
bool isImageShown() const;
bool isImageDepthShown() const;
bool isFeaturesShown() const;
bool isLinesShown() const;
void setFeaturesShown(bool shown);
void setImageShown(bool shown);

View File

@@ -61,6 +61,8 @@ class OdometryThread;
class CameraThread;
class Signature;
class LoopClosureViewer;
class CloudViewer;
class ImageView;
class RTABMAPGUI_EXP PreferencesDialog : public QDialog
{
@@ -101,6 +103,10 @@ public:
void loadWindowGeometry(const QString & windowName, QWidget * window);
void saveMainWindowState(const QMainWindow * mainWindow);
void loadMainWindowState(QMainWindow * mainWindow);
void saveCloudViewerState(const QString & name, const CloudViewer * viewer);
void loadCloudViewerState(const QString & name, CloudViewer * viewer);
void saveImageViewState(const QString & name, const ImageView * view);
void loadImageViewState(const QString & name, ImageView * view);
void saveCustomConfig(const QString & section, const QString & key, const QString & value);
QString loadCustomConfig(const QString & section, const QString & key);