mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-01 17:10:26 +08:00
CloudViewer: fixed opengl not refreshed on update (VTK9). Fixed File Explorer hanging (Qt 5.12). Fixed backup database not deleted after a recovery.
This commit is contained in:
@@ -86,6 +86,8 @@ public:
|
||||
void saveSettings(QSettings & settings, const QString & group = "") const;
|
||||
void loadSettings(QSettings & settings, const QString & group = "");
|
||||
|
||||
void refreshView();
|
||||
|
||||
bool updateCloudPose(
|
||||
const std::string & id,
|
||||
const Transform & pose); //including mesh
|
||||
|
||||
@@ -181,7 +181,7 @@ void CameraViewer::showImage(const rtabmap::SensorData & data)
|
||||
(showScanCheckbox_->isEnabled() && showScanCheckbox_->isChecked()));
|
||||
if(cloudView_->isVisible())
|
||||
{
|
||||
cloudView_->update();
|
||||
cloudView_->refreshView();
|
||||
}
|
||||
if(cloudView_->getAddedClouds().contains("cloud"))
|
||||
{
|
||||
|
||||
@@ -521,7 +521,16 @@ void CloudViewer::loadSettings(QSettings & settings, const QString & group)
|
||||
settings.endGroup();
|
||||
}
|
||||
|
||||
this->refreshView();
|
||||
}
|
||||
|
||||
void CloudViewer::refreshView()
|
||||
{
|
||||
#if VTK_MAJOR_VERSION > 8
|
||||
this->renderWindow()->Render();
|
||||
#else
|
||||
this->update();
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CloudViewer::updateCloudPose(
|
||||
@@ -2288,7 +2297,7 @@ void CloudViewer::clearTrajectory()
|
||||
{
|
||||
_trajectory->clear();
|
||||
_visualizer->removeShape("trajectory");
|
||||
this->update();
|
||||
this->refreshView();
|
||||
}
|
||||
|
||||
bool CloudViewer::isCameraAxisShown() const
|
||||
@@ -2306,7 +2315,7 @@ void CloudViewer::setCameraAxisShown(bool shown)
|
||||
{
|
||||
this->addOrUpdateCoordinate("reference", Transform::getIdentity(), 0.2);
|
||||
}
|
||||
this->update();
|
||||
this->refreshView();
|
||||
_aShowCameraAxis->setChecked(shown);
|
||||
}
|
||||
|
||||
@@ -2355,7 +2364,7 @@ void CloudViewer::setFrustumShown(bool shown)
|
||||
this->removeLine(*iter);
|
||||
}
|
||||
}
|
||||
this->update();
|
||||
this->refreshView();
|
||||
}
|
||||
_aShowFrustum->setChecked(shown);
|
||||
}
|
||||
@@ -2375,7 +2384,7 @@ void CloudViewer::setFrustumColor(QColor value)
|
||||
{
|
||||
_visualizer->setShapeRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, value.redF(), value.greenF(), value.blueF(), iter.key());
|
||||
}
|
||||
this->update();
|
||||
this->refreshView();
|
||||
_frustumColor = value;
|
||||
}
|
||||
|
||||
@@ -2604,7 +2613,7 @@ void CloudViewer::setBackfaceCulling(bool enabled, bool frontfaceCulling)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
this->update();
|
||||
this->refreshView();
|
||||
}
|
||||
|
||||
void CloudViewer::setPolygonPicking(bool enabled)
|
||||
@@ -2669,7 +2678,7 @@ void CloudViewer::setEDLShading(bool on)
|
||||
glrenderer->SetPass(NULL);
|
||||
}
|
||||
|
||||
this->update();
|
||||
this->refreshView();
|
||||
#else
|
||||
if(on)
|
||||
{
|
||||
@@ -2697,7 +2706,7 @@ void CloudViewer::setLighting(bool on)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
this->update();
|
||||
this->refreshView();
|
||||
}
|
||||
|
||||
void CloudViewer::setShading(bool on)
|
||||
@@ -2719,7 +2728,7 @@ void CloudViewer::setShading(bool on)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
this->update();
|
||||
this->refreshView();
|
||||
}
|
||||
|
||||
void CloudViewer::setEdgeVisibility(bool visible)
|
||||
@@ -2741,7 +2750,7 @@ void CloudViewer::setEdgeVisibility(bool visible)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
this->update();
|
||||
this->refreshView();
|
||||
}
|
||||
|
||||
void CloudViewer::setInteractorLayer(int layer)
|
||||
@@ -3164,7 +3173,7 @@ void CloudViewer::setCameraOrtho(bool enabled)
|
||||
if(interactor)
|
||||
{
|
||||
interactor->setOrthoMode(enabled);
|
||||
this->update();
|
||||
this->refreshView();
|
||||
}
|
||||
_aCameraOrtho->setChecked(enabled);
|
||||
}
|
||||
@@ -3724,7 +3733,7 @@ void CloudViewer::handleAction(QAction * a)
|
||||
this->removeGrid();
|
||||
}
|
||||
|
||||
this->update();
|
||||
this->refreshView();
|
||||
}
|
||||
else if(a == _aSetGridCellCount)
|
||||
{
|
||||
@@ -3747,7 +3756,7 @@ void CloudViewer::handleAction(QAction * a)
|
||||
else if(a == _aShowNormals)
|
||||
{
|
||||
this->setNormalsShown(_aShowNormals->isChecked());
|
||||
this->update();
|
||||
this->refreshView();
|
||||
}
|
||||
else if(a == _aSetNormalsStep)
|
||||
{
|
||||
@@ -3791,7 +3800,7 @@ void CloudViewer::handleAction(QAction * a)
|
||||
if(color.isValid())
|
||||
{
|
||||
this->setDefaultBackgroundColor(color);
|
||||
this->update();
|
||||
this->refreshView();
|
||||
}
|
||||
}
|
||||
else if(a == _aSetRenderingRate)
|
||||
@@ -3807,7 +3816,7 @@ void CloudViewer::handleAction(QAction * a)
|
||||
{
|
||||
if(_aLockViewZ->isChecked())
|
||||
{
|
||||
this->update();
|
||||
this->refreshView();
|
||||
}
|
||||
}
|
||||
else if(a == _aCameraOrtho)
|
||||
|
||||
@@ -1105,13 +1105,13 @@ bool DatabaseViewer::closeDatabase()
|
||||
sliderBValueChanged(0);
|
||||
|
||||
constraintsViewer_->clear();
|
||||
constraintsViewer_->update();
|
||||
constraintsViewer_->refreshView();
|
||||
|
||||
cloudViewer_->clear();
|
||||
cloudViewer_->update();
|
||||
cloudViewer_->refreshView();
|
||||
|
||||
occupancyGridViewer_->clear();
|
||||
occupancyGridViewer_->update();
|
||||
occupancyGridViewer_->refreshView();
|
||||
|
||||
ui_->graphViewer->clearAll();
|
||||
ui_->label_loopClosures->clear();
|
||||
@@ -1126,7 +1126,7 @@ bool DatabaseViewer::closeDatabase()
|
||||
|
||||
ui_->graphicsView_stereo->clear();
|
||||
stereoViewer_->clear();
|
||||
stereoViewer_->update();
|
||||
stereoViewer_->refreshView();
|
||||
|
||||
ui_->toolBox_statistics->clear();
|
||||
}
|
||||
@@ -5040,7 +5040,7 @@ void DatabaseViewer::update(int value,
|
||||
#endif
|
||||
}
|
||||
}
|
||||
cloudViewer_->updateCameraTargetPosition(pose);
|
||||
cloudViewer_->updateCameraTargetPosition(pose);
|
||||
cloudViewer_->clearTrajectory();
|
||||
cloudViewer_->refreshView();
|
||||
}
|
||||
@@ -5182,7 +5182,7 @@ void DatabaseViewer::update(int value,
|
||||
ui_->lineEdit_covariance->clear();
|
||||
ui_->label_type->clear();
|
||||
ui_->label_type_name->clear();
|
||||
ui_->checkBox_showOptimized->setEnabled(false);
|
||||
ui_->checkBox_showOptimized->setEnabled(false);
|
||||
}
|
||||
constraintsViewer_->refreshView();
|
||||
|
||||
@@ -5311,7 +5311,7 @@ void DatabaseViewer::updateStereo(const SensorData * data)
|
||||
UINFO("correspondences = %d/%d (%f) (time kpt=%fs stereo=%fs)",
|
||||
(int)cloud->size(), (int)leftCorners.size(), float(cloud->size())/float(leftCorners.size()), timeKpt, timeStereo);
|
||||
|
||||
stereoViewer_->updateCameraTargetPosition(Transform::getIdentity());
|
||||
stereoViewer_->updateCameraTargetPosition(Transform::getIdentity());
|
||||
stereoViewer_->addCloud("stereo", cloud);
|
||||
stereoViewer_->refreshView();
|
||||
|
||||
@@ -6231,7 +6231,7 @@ void DatabaseViewer::updateConstraintView(
|
||||
}
|
||||
#endif
|
||||
|
||||
constraintsViewer_->clearTrajectory();
|
||||
constraintsViewer_->clearTrajectory();
|
||||
|
||||
constraintsViewer_->refreshView();
|
||||
}
|
||||
@@ -6561,7 +6561,7 @@ void DatabaseViewer::sliderIterationsValueChanged(int value)
|
||||
ui_->graphViewer->updateMap(map8U, cellSize, xMin, yMin);
|
||||
}
|
||||
if(ui_->dockWidget_occupancyGridView->isVisible() && ui_->checkBox_grid_2d->isChecked())
|
||||
{
|
||||
{
|
||||
occupancyGridViewer_->addOccupancyGridMap(map8U, cellSize, xMin, yMin, 1.0f);
|
||||
occupancyGridViewer_->refreshView();
|
||||
}
|
||||
@@ -6684,7 +6684,7 @@ void DatabaseViewer::sliderIterationsValueChanged(int value)
|
||||
Transform::getIdentity(),
|
||||
QColor(ui_->lineEdit_emptyColor->text()));
|
||||
occupancyGridViewer_->setCloudPointSize("emptyCellsXYZ", 5);
|
||||
occupancyGridViewer_->setCloudOpacity("emptyCellsXYZ", 0.5);
|
||||
occupancyGridViewer_->setCloudOpacity("emptyCellsXYZ", 0.5);
|
||||
}
|
||||
occupancyGridViewer_->refreshView();
|
||||
}
|
||||
@@ -7029,7 +7029,7 @@ void DatabaseViewer::updateGrid()
|
||||
{
|
||||
if(sender() == ui_->checkBox_grid_2d && !ui_->checkBox_grid_2d->isChecked())
|
||||
{
|
||||
//just remove map in occupancy grid view
|
||||
//just remove map in occupancy grid view
|
||||
occupancyGridViewer_->removeOccupancyGridMap();
|
||||
occupancyGridViewer_->refreshView();
|
||||
}
|
||||
@@ -7139,7 +7139,7 @@ void DatabaseViewer::updateOctomapView()
|
||||
occupancyGridViewer_->setCloudOpacity("octomap_empty", 0.5);
|
||||
occupancyGridViewer_->setCloudPointSize("octomap_empty", 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
occupancyGridViewer_->refreshView();
|
||||
}
|
||||
@@ -8283,7 +8283,7 @@ void DatabaseViewer::updateLoopClosuresSlider(int from, int to)
|
||||
}
|
||||
else
|
||||
{
|
||||
ui_->horizontalSlider_loops->setEnabled(false);
|
||||
ui_->horizontalSlider_loops->setEnabled(false);
|
||||
constraintsViewer_->removeAllClouds();
|
||||
constraintsViewer_->refreshView();
|
||||
updateConstraintButtons();
|
||||
|
||||
@@ -1431,7 +1431,7 @@ void ExportCloudsDialog::viewClouds(
|
||||
_progressDialog->appendText(tr("Viewing the cloud %1 (%2 points)... done.").arg(iter->first).arg(iter->second->size()));
|
||||
}
|
||||
}
|
||||
viewer->update();
|
||||
viewer->refreshView();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -140,7 +140,7 @@ void LoopClosureViewer::updateView(const Transform & transform, const Parameters
|
||||
{
|
||||
UERROR("loop transform is null !?!?");
|
||||
ui_->cloudViewerTransform->removeAllClouds();
|
||||
}
|
||||
}
|
||||
ui_->cloudViewerTransform->refreshView();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1544,7 +1544,7 @@ void MainWindow::processOdometry(const rtabmap::OdometryEvent & odom, bool dataI
|
||||
_cloudViewer->updateCameraTargetPosition(_odometryCorrection*odom.pose());
|
||||
UDEBUG("Time Update Pose: %fs", time.ticks());
|
||||
}
|
||||
_cloudViewer->update();
|
||||
_cloudViewer->refreshView();
|
||||
|
||||
if(_ui->graphicsView_graphView->isVisible())
|
||||
{
|
||||
@@ -3275,7 +3275,7 @@ void MainWindow::updateMapCloud(
|
||||
}
|
||||
|
||||
UDEBUG("");
|
||||
_cloudViewer->update();
|
||||
_cloudViewer->refreshView();
|
||||
UDEBUG("");
|
||||
}
|
||||
|
||||
@@ -4189,7 +4189,7 @@ void MainWindow::updateNodeVisibility(int nodeId, bool visible)
|
||||
}
|
||||
}
|
||||
|
||||
_cloudViewer->update();
|
||||
_cloudViewer->refreshView();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user