void qSRA::doProjectCloudDistsInGrid(ccPointCloud* cloud, ccPolyline* polyline) { assert(cloud && m_app); if (!cloud) return; //get associated scalar field ccScalarField* sf = cloud->getCurrentDisplayedScalarField(); if (!sf) { int sfIdx = cloud->getScalarFieldIndexByName(RADIAL_DIST_SF_NAME); if (sfIdx >= 0) sf = static_cast<ccScalarField*>(cloud->getScalarField(sfIdx)); else { m_app->dispToConsole(QString("Cloud has no activated scalar field and no '%1' field!").arg(RADIAL_DIST_SF_NAME),ccMainAppInterface::ERR_CONSOLE_MESSAGE); return; } } assert(sf); DistanceMapGenerationDlg dmgDlg(cloud, sf, polyline, m_app); dmgDlg.exec(); }
void qSRA::doProjectCloudDistsInGrid(ccPointCloud* cloud, ccPolyline* polyline) const { assert(cloud && m_app); if (!cloud) return; //get the scalar field to map ccScalarField* sf = 0; { int sfIdx = cloud->getScalarFieldIndexByName(RADIAL_DIST_SF_NAME); if (sfIdx < 0) { sf = cloud->getCurrentDisplayedScalarField(); if (sf) { if (QMessageBox::question( m_app ? m_app->getMainWindow() : 0, "Distance field", QString("Cloud has no '%1' field. Do you want to use the active scalar field instead?").arg(RADIAL_DIST_SF_NAME), QMessageBox::Yes, QMessageBox::No) == QMessageBox::No ) { //we can stop already return; } } else { QString message = QString("Cloud has no no '%1' field and no active scalar field!").arg(RADIAL_DIST_SF_NAME); ccLog::Error(message); //additional indications if (m_doCompareCloudToProfile) { ccLog::Warning(QString("You can compute the radial distances with the '%1' method").arg(m_doCompareCloudToProfile->text())); } return; } } else { sf = static_cast<ccScalarField*>(cloud->getScalarField(sfIdx)); } } assert(sf); DistanceMapGenerationDlg dmgDlg(cloud, sf, polyline, m_app); dmgDlg.exec(); }