![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Distance map generation tool (surface of revolution) More...
#include <distanceMapGenerationTool.h>
Classes | |
| class | Map |
| "Distance" map More... | |
| struct | MapCell |
| "Distance" map cell More... | |
| struct | Measures |
| struct | ProfileMetaData |
Public Types | |
| enum | FillStrategyType { FILL_STRAT_MIN_DIST = 0 , FILL_STRAT_AVG_DIST = 1 , FILL_STRAT_MAX_DIST = 2 , INVALID_STRATEGY_TYPE = 255 } |
| Grid filling strategy. More... | |
| enum | EmptyCellFillOption { LEAVE_EMPTY = 0 , FILL_WITH_ZERO = 1 , FILL_INTERPOLATE = 2 } |
| Option for handling empty cells. More... | |
Static Public Member Functions | |
| static bool | GetPoylineMetaData (const ccPolyline *polyline, ProfileMetaData &data) |
| static void | SetPoylineOrigin (ccPolyline *polyline, const CCVector3 &origin) |
| Sets the origin of a given polyline/profile. More... | |
| static bool | GetPoylineOrigin (const ccPolyline *polyline, CCVector3 &origin) |
| Returns the origin associated to a given polyline/profile. More... | |
| static void | SetPoylineRevolDim (ccPolyline *polyline, int revolDim) |
| Sets the revolution dimension of a given polyline. More... | |
| static int | GetPoylineRevolDim (const ccPolyline *polyline) |
| static void | SetPoylineAxis (ccPolyline *polyline, const CCVector3 &axis) |
| Sets the revolution axis of a given polyline. More... | |
| static bool | GetPoylineAxis (const ccPolyline *polyline, CCVector3 &axis) |
| Returns the revolution axis associated to a given profile (polyline) More... | |
| static void | SetPolylineHeightShift (ccPolyline *polyline, PointCoordinateType heightShift) |
| Sets the profile 'height shift' (i.e. along the revolution axis) More... | |
| static bool | GetPolylineHeightShift (const ccPolyline *polyline, PointCoordinateType &heightShift) |
| Returns the profile 'height shift' (i.e. along the revolution axis) More... | |
| static bool | ComputeRadialDist (ccPointCloud *cloud, ccPolyline *profile, bool storeRadiiAsSF=false, ecvMainAppInterface *app=0) |
| Computes radial distance between cloud and a profile. More... | |
| static QSharedPointer< Map > | CreateMap (ccPointCloud *cloud, ccScalarField *sf, const ccGLMatrix &cloudToSurface, unsigned char revolutionAxisDim, double angStep_rad, double yStep, double yMin, double yMax, bool conical, bool counterclockwise, FillStrategyType fillStrategy, EmptyCellFillOption emptyCellfillOption, ecvMainAppInterface *app=0) |
| static ccMesh * | ConvertConicalMapToMesh (const QSharedPointer< Map > &map, bool counterclockwise, QImage mapTexture=QImage()) |
| Creates a conical projection (textured) mesh. More... | |
| static double | ConicalProjectN (double phi1, double phi2) |
| static double | ConicalProject (double phi, double phi1, double n) |
| static bool | ConvertCloudToCylindrical (ccPointCloud *cloud, const ccGLMatrix &cloudToSurface, unsigned char revolutionAxisDim, bool counterclockwise=false) |
| Converts a point cloud coordinates to "cylindrical" ones (in place) More... | |
| static bool | ConvertCloudToConical (ccPointCloud *cloud, const ccGLMatrix &cloudToSurface, unsigned char revolutionAxisDim, double latMin_rad, double latMax_rad, double conicalSpanRatio=1.0, bool counterclockwise=false) |
| Converts a point cloud coordinates to "conical" ones (in place) More... | |
| static CCVector3 | ProjectPointOnCone (double lon_rad, double lat_rad, double latMin_rad, double nProj, bool counterclockwise) |
| Projects a (longitude,r) couple to a 2D map. More... | |
| static bool | ComputeMinAndMaxLatitude_rad (ccPointCloud *cloud, double &minLat_rad, double &maxLat_rad, const ccGLMatrix &cloudToSurfaceOrigin, unsigned char revolutionAxisDim) |
| static bool | SaveMapAsCSVMatrix (const QSharedPointer< Map > &map, QString filename, QString xUnit, QString yUnit, double xConversionFactor=1.0, double yConversionFactor=1.0, ecvMainAppInterface *app=0) |
| Saves a map as a CSV matrix. More... | |
| static QImage | ConvertMapToImage (const QSharedPointer< Map > &map, ccColorScale::Shared colorScale, unsigned colorScaleSteps=ccColorScale::MAX_STEPS) |
| Converts map to a QImage. More... | |
| static ccPointCloud * | ConvertMapToCloud (const QSharedPointer< Map > &map, ccPolyline *profile, double baseRadius=1.0, bool keepNaNPoints=true) |
| Converts map to a point cloud. More... | |
| static ccMesh * | ConvertProfileToMesh (ccPolyline *profile, const ccGLMatrix &cloudToProfile, bool counterclockwise, unsigned angularSteps=36, QImage mapTexture=QImage()) |
| Converts profile to a (textured) mesh. More... | |
| static bool | ComputeSurfacesAndVolumes (const QSharedPointer< Map > &map, ccPolyline *profile, Measures &surfaces, Measures &volumes) |
Distance map generation tool (surface of revolution)
Definition at line 36 of file distanceMapGenerationTool.h.
Option for handling empty cells.
| Enumerator | |
|---|---|
| LEAVE_EMPTY | |
| FILL_WITH_ZERO | |
| FILL_INTERPOLATE | |
Definition at line 185 of file distanceMapGenerationTool.h.
Grid filling strategy.
| Enumerator | |
|---|---|
| FILL_STRAT_MIN_DIST | |
| FILL_STRAT_AVG_DIST | |
| FILL_STRAT_MAX_DIST | |
| INVALID_STRATEGY_TYPE | |
Definition at line 177 of file distanceMapGenerationTool.h.
|
static |
Computes min and max latitudes of a point cloud (relatively to an axis and an 'origin')
Definition at line 380 of file distanceMapGenerationTool.cpp.
References ComputeLatitude_rad(), count, cloudViewer::PointCloudTpl< T >::getPoint(), cloudViewer::PointCloudTpl< T >::size(), Tuple3Tpl< Type >::u, and X.
Referenced by DistanceMapGenerationDlg::updateMinAndMaxLimits().
|
static |
Computes radial distance between cloud and a profile.
Definition at line 219 of file distanceMapGenerationTool.cpp.
References ccPointCloud::addScalarField(), DistanceMapGenerationTool::ProfileMetaData::computeCloudToProfileOriginTrans(), ccScalarField::computeMinAndMax(), ecvMainAppInterface::dispToConsole(), dist(), ecvMainAppInterface::ERR_CONSOLE_MESSAGE, ecvMainAppInterface::getMainWindow(), cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::PointCloudTpl< T >::getPoint(), GetPoylineMetaData(), cloudViewer::PointCloudTpl< T >::getScalarField(), cloudViewer::PointCloudTpl< T >::getScalarFieldIndexByName(), height, NAN_VALUE, nProgress, cloudViewer::NormalizedProgress::oneStep(), profile, RADIAL_DIST_SF_NAME, RADII_SF_NAME, DistanceMapGenerationTool::ProfileMetaData::revolDim, ccPointCloud::setCurrentDisplayedScalarField(), ecvProgressDialog::setInfo(), ecvProgressDialog::setMethodTitle(), cloudViewer::ScalarField::setValue(), ccDrawableObject::showSF(), cloudViewer::GenericCloud::size(), cloudViewer::PointCloudTpl< T >::size(), ecvProgressDialog::start(), Tuple3Tpl< Type >::u, cloudViewer::ScalarField::ValidValue(), ecvMainAppInterface::WRN_CONSOLE_MESSAGE, Tuple3Tpl< Type >::x, and Tuple3Tpl< Type >::y.
Referenced by qSRA::doComputeRadialDists().
|
static |
Computes various surfaces and volumes (see Surfaces & Volumes structures) Warning: the 'positive' resp. 'negative' volumes coorespond to differences of volumes (i.e the volume that is exterior resp. interori to the theoretical profile). However, the 'positive' resp. 'negative' surfaces correspond to the surface of all the elements that have a positive resp. negative deviation.
Definition at line 977 of file distanceMapGenerationTool.cpp.
References DistanceMapGenerationTool::MapCell::count, fabs(), cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::PointCloudTpl< T >::getPoint(), GetPoylineRevolDim(), M_PI, DistanceMapGenerationTool::Measures::negative, DistanceMapGenerationTool::Measures::positive, profile, cloudViewer::GenericCloud::size(), cloudViewer::PointCloudTpl< T >::size(), std::swap(), DistanceMapGenerationTool::Measures::theoretical, DistanceMapGenerationTool::Measures::total, DistanceMapGenerationTool::MapCell::value, Tuple3Tpl< Type >::x, and Tuple3Tpl< Type >::y.
Referenced by DistanceMapGenerationDlg::updateVolumes().
|
static |
Projects a given latitude with a Lambert conform conical projection with two intersecting parallels
Definition at line 435 of file distanceMapGenerationTool.cpp.
References M_PI_DIV_2, and M_PI_DIV_4.
Referenced by ConvertConicalMapToMesh(), and ProjectPointOnCone().
|
static |
Returns the constant 'n' factor of a Lambert conform conical projection with two intersecting parallels
Definition at line 423 of file distanceMapGenerationTool.cpp.
References fabs(), M_PI_DIV_2, and M_PI_DIV_4.
Referenced by ConvertCloudToConical(), ConvertConicalMapToMesh(), and DistanceMapGenerationDlg::toggleOverlayGrid().
|
static |
Converts a point cloud coordinates to "conical" ones (in place)
See ProjectPointOnCone.
Definition at line 1203 of file distanceMapGenerationTool.cpp.
References ComputeLatitude_rad(), ConicalProjectN(), ccGenericPointCloud::deleteOctree(), ccGenericPointCloud::getOctree(), cloudViewer::PointCloudTpl< T >::getPoint(), M_PI, PC_ONE, ProjectPointOnCone(), ccPointCloud::refreshBB(), cloudViewer::PointCloudTpl< T >::size(), Tuple3Tpl< Type >::u, and X.
Referenced by DistanceMapGenerationDlg::loadOverlaySymbols().
|
static |
Converts a point cloud coordinates to "cylindrical" ones (in place)
Definition at line 1156 of file distanceMapGenerationTool.cpp.
References ccGenericPointCloud::deleteOctree(), ccGenericPointCloud::getOctree(), cloudViewer::PointCloudTpl< T >::getPoint(), height, M_PI, PC_ONE, ccPointCloud::refreshBB(), cloudViewer::PointCloudTpl< T >::size(), Tuple3Tpl< Type >::u, Tuple3Tpl< Type >::x, X, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by DistanceMapGenerationDlg::loadOverlaySymbols().
|
static |
Creates a conical projection (textured) mesh.
mapTexture.isNull()
Definition at line 838 of file distanceMapGenerationTool.cpp.
References ccHObject::addChild(), ccArray< Type, N, ComponentType >::addElement(), ccMaterialSet::addMaterial(), cloudViewer::PointCloudTpl< T >::addPoint(), ccMesh::addTriangle(), ccMesh::addTriangleMtlIndex(), ccMesh::addTriangleTexCoordIndexes(), ConicalProject(), ConicalProjectN(), M_PI, ccMesh::removePerTriangleTexCoordIndexes(), ccMesh::reserve(), ccPointCloud::reserve(), ccMesh::reservePerTriangleMtlIndexes(), ccMesh::reservePerTriangleTexCoordIndexes(), ccArray< Type, N, ComponentType >::reserveSafe(), ccMesh::setMaterialSet(), ccMesh::setTexCoordinatesTable(), ccDrawableObject::setVisible(), ccGenericMesh::showMaterials(), and TexCoords2D::ty.
Referenced by DistanceMapGenerationDlg::update().
|
static |
Converts map to a point cloud.
Definition at line 1503 of file distanceMapGenerationTool.cpp.
References cloudViewer::ScalarField::addElement(), cloudViewer::PointCloudTpl< T >::addPoint(), ccPointCloud::addScalarField(), ccScalarField::computeMinAndMax(), count, DistanceMapGenerationTool::MapCell::count, cloudViewer::GenericIndexedCloud::getPoint(), GetPoylineMetaData(), DistanceMapGenerationTool::ProfileMetaData::heightShift, M_PI, NAN_VALUE, DistanceMapGenerationTool::ProfileMetaData::origin, profile, CCShareable::release(), ccPointCloud::reserve(), cloudViewer::ScalarField::reserveSafe(), ccPointCloud::resize(), DistanceMapGenerationTool::ProfileMetaData::revolDim, ccPointCloud::setCurrentDisplayedScalarField(), ccDrawableObject::showSF(), cloudViewer::GenericCloud::size(), cloudViewer::PointCloudTpl< T >::size(), Tuple3Tpl< Type >::u, DistanceMapGenerationTool::MapCell::value, Tuple3Tpl< Type >::x, X, and Tuple3Tpl< Type >::y.
Referenced by DistanceMapGenerationDlg::exportMapAsCloud().
|
static |
Converts map to a QImage.
Definition at line 1596 of file distanceMapGenerationTool.cpp.
References ecvColor::RgbTpl< Type >::b, DistanceMapGenerationTool::MapCell::count, ecvColor::RgbTpl< Type >::g, image, ecvColor::lightGrey(), ecvColor::RgbTpl< Type >::r, and DistanceMapGenerationTool::MapCell::value.
Referenced by DistanceMapGenerationDlg::exportMapAsMesh(), and DistanceMapGenerationDlg::updateMapTexture().
|
static |
Converts profile to a (textured) mesh.
Definition at line 1326 of file distanceMapGenerationTool.cpp.
References ccHObject::addChild(), ccArray< Type, N, ComponentType >::addElement(), ccMaterialSet::addMaterial(), cloudViewer::PointCloudTpl< T >::addPoint(), ccMesh::addTriangle(), ccMesh::addTriangleMtlIndex(), ccMesh::addTriangleTexCoordIndexes(), ccGLMatrixTpl< T >::apply(), cloudViewer::GenericIndexedCloud::getPoint(), GetPoylineMetaData(), ccGLMatrixTpl< T >::inverse(), M_PI, profile, ccHObject::removeChild(), ccMesh::removePerTriangleTexCoordIndexes(), ccMesh::reserve(), ccPointCloud::reserve(), ccMesh::reservePerTriangleMtlIndexes(), ccMesh::reservePerTriangleTexCoordIndexes(), ccArray< Type, N, ComponentType >::reserveSafe(), DistanceMapGenerationTool::ProfileMetaData::revolDim, ccMesh::setMaterialSet(), ccMesh::setTexCoordinatesTable(), ccDrawableObject::setVisible(), ccGenericMesh::showMaterials(), cloudViewer::GenericCloud::size(), TexCoords2D::ty, Tuple3Tpl< Type >::u, Tuple3Tpl< Type >::x, X, and Tuple3Tpl< Type >::y.
Referenced by DistanceMapGenerationDlg::exportMapAsMesh().
|
static |
Projects a cloud (scalar field) on a revolution surface to generate a 2D map Projection can be either cylindrical or spherical. Warning: for cylindrical projection, the 2D map 'height' will be expressed relatively to the 'revolutionOrigin' and not the cloud's (implicit) origin.
Definition at line 447 of file distanceMapGenerationTool.cpp.
References cloudViewer::Delaunay2dMesh::buildMesh(), cloudViewer::utility::ceil(), ComputeLatitude_rad(), count, DistanceMapGenerationTool::MapCell::count, ecvMainAppInterface::dispToConsole(), ecvMainAppInterface::ERR_CONSOLE_MESSAGE, FILL_INTERPOLATE, FILL_STRAT_AVG_DIST, FILL_STRAT_MAX_DIST, FILL_STRAT_MIN_DIST, FILL_WITH_ZERO, cloudViewer::Delaunay2dMesh::getNextTriangleVertIndexes(), cloudViewer::PointCloudTpl< T >::getPoint(), cloudViewer::ScalarField::getValue(), cloudViewer::VerticesIndexes::i, M_PI, max(), min(), cloudViewer::Delaunay2dMesh::placeIteratorAtBeginning(), cloudViewer::Delaunay2dMesh::size(), cloudViewer::PointCloudTpl< T >::size(), ecvMainAppInterface::STD_CONSOLE_MESSAGE, Tuple3Tpl< Type >::u, cloudViewer::Delaunay2dMesh::USE_ALL_POINTS, cloudViewer::ScalarField::ValidValue(), DistanceMapGenerationTool::MapCell::value, Vector2Tpl< Type >::x, X, and Vector2Tpl< Type >::y.
Referenced by DistanceMapGenerationDlg::updateMap().
|
static |
Returns the profile 'height shift' (i.e. along the revolution axis)
Requires the right meta-data to be set (see SetPolylineHeightShift).
Definition at line 178 of file distanceMapGenerationTool.cpp.
References ccObject::getMetaData(), and PROFILE_HEIGHT_SHIFT_KEY.
Referenced by DistanceMapGenerationDlg::exportProfilesAsDXF(), and GetPoylineMetaData().
|
static |
Returns the revolution axis associated to a given profile (polyline)
Requires the right meta-data to be set (see SetPoylineAxis).
Definition at line 163 of file distanceMapGenerationTool.cpp.
References GetPolylineMetaVector(), and REVOLUTION_AXIS_KEY.
Referenced by GetPoylineMetaData().
|
static |
Returns the whole set of meta-data associated to a given polyline/profile
Definition at line 194 of file distanceMapGenerationTool.cpp.
References DistanceMapGenerationTool::ProfileMetaData::axis, GetPolylineHeightShift(), GetPoylineAxis(), GetPoylineOrigin(), GetPoylineRevolDim(), DistanceMapGenerationTool::ProfileMetaData::hasAxis, DistanceMapGenerationTool::ProfileMetaData::heightShift, DistanceMapGenerationTool::ProfileMetaData::origin, and DistanceMapGenerationTool::ProfileMetaData::revolDim.
Referenced by ComputeRadialDist(), ConvertMapToCloud(), ConvertProfileToMesh(), DistanceMapGenerationDlg::DistanceMapGenerationDlg(), DistanceMapGenerationDlg::exportMapAsMesh(), DistanceMapGenerationDlg::loadOverlaySymbols(), DistanceMapGenerationDlg::updateMap(), DistanceMapGenerationDlg::updateMinAndMaxLimits(), and DistanceMapGenerationDlg::updateProfileOrigin().
|
static |
Returns the origin associated to a given polyline/profile.
Requires the right meta-data to be set (see SetPoylineOrigin).
Definition at line 152 of file distanceMapGenerationTool.cpp.
References GetPolylineMetaVector(), and PROFILE_ORIGIN_KEY.
Referenced by GetPoylineMetaData().
|
static |
Returns the revolution 'dimension' associated to a given profile (polyline) Requires the right meta-data to be set (see SetPoylineRevolDim).
Definition at line 132 of file distanceMapGenerationTool.cpp.
References ccObject::getMetaData(), and REVOLUTION_AXIS_KEY.
Referenced by ComputeSurfacesAndVolumes(), and GetPoylineMetaData().
|
static |
Projects a (longitude,r) couple to a 2D map.
For computing 'nProj' see ConicalProjectN.
Definition at line 823 of file distanceMapGenerationTool.cpp.
References ConicalProject(), and M_PI.
Referenced by ConvertCloudToConical(), and DistanceMapGenerationDlg::toggleOverlayGrid().
|
static |
Saves a map as a CSV matrix.
Definition at line 1255 of file distanceMapGenerationTool.cpp.
References ecvMainAppInterface::dispToConsole(), QtCompat::endl(), ecvMainAppInterface::ERR_CONSOLE_MESSAGE, and filename.
Referenced by DistanceMapGenerationDlg::exportMapAsGrid().
|
static |
Sets the profile 'height shift' (i.e. along the revolution axis)
This information is associated to a specific meta-data.
Definition at line 169 of file distanceMapGenerationTool.cpp.
References PROFILE_HEIGHT_SHIFT_KEY, and ccObject::setMetaData().
Referenced by GetConeProfile(), qSRA::loadProfile(), and DistanceMapGenerationDlg::updateProfileOrigin().
|
static |
Sets the revolution axis of a given polyline.
The revolution axis is associated to a specific meta-data.
Definition at line 158 of file distanceMapGenerationTool.cpp.
References REVOLUTION_AXIS_KEY, and SetPoylineMetaVector().
Referenced by GetConeProfile().
|
static |
Sets the origin of a given polyline/profile.
The revolution axis is associated to a specific meta-data.
Definition at line 147 of file distanceMapGenerationTool.cpp.
References PROFILE_ORIGIN_KEY, and SetPoylineMetaVector().
Referenced by GetConeProfile(), qSRA::loadProfile(), and DistanceMapGenerationDlg::updateProfileOrigin().
|
static |
Sets the revolution dimension of a given polyline.
The revolution dimension is associated to a specific meta-data.
Definition at line 122 of file distanceMapGenerationTool.cpp.
References REVOLUTION_AXIS_KEY, and ccObject::setMetaData().
Referenced by GetConeProfile(), qSRA::loadProfile(), and DistanceMapGenerationDlg::updateProfileRevolDim().