ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
DistanceMapGenerationTool Class Reference

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< MapCreateMap (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 ccMeshConvertConicalMapToMesh (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 ccPointCloudConvertMapToCloud (const QSharedPointer< Map > &map, ccPolyline *profile, double baseRadius=1.0, bool keepNaNPoints=true)
 Converts map to a point cloud. More...
 
static ccMeshConvertProfileToMesh (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)
 

Detailed Description

Distance map generation tool (surface of revolution)

Definition at line 36 of file distanceMapGenerationTool.h.

Member Enumeration Documentation

◆ EmptyCellFillOption

Option for handling empty cells.

Enumerator
LEAVE_EMPTY 
FILL_WITH_ZERO 
FILL_INTERPOLATE 

Definition at line 185 of file distanceMapGenerationTool.h.

◆ FillStrategyType

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.

Member Function Documentation

◆ ComputeMinAndMaxLatitude_rad()

bool DistanceMapGenerationTool::ComputeMinAndMaxLatitude_rad ( ccPointCloud cloud,
double &  minLat_rad,
double &  maxLat_rad,
const ccGLMatrix cloudToSurfaceOrigin,
unsigned char  revolutionAxisDim 
)
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().

◆ ComputeRadialDist()

◆ ComputeSurfacesAndVolumes()

bool DistanceMapGenerationTool::ComputeSurfacesAndVolumes ( const QSharedPointer< Map > &  map,
ccPolyline profile,
Measures surfaces,
Measures volumes 
)
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().

◆ ConicalProject()

double DistanceMapGenerationTool::ConicalProject ( double  phi,
double  phi1,
double  n 
)
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().

◆ ConicalProjectN()

double DistanceMapGenerationTool::ConicalProjectN ( double  phi1,
double  phi2 
)
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().

◆ ConvertCloudToConical()

bool DistanceMapGenerationTool::ConvertCloudToConical ( ccPointCloud cloud,
const ccGLMatrix cloudToSurface,
unsigned char  revolutionAxisDim,
double  latMin_rad,
double  latMax_rad,
double  conicalSpanRatio = 1.0,
bool  counterclockwise = false 
)
static

◆ ConvertCloudToCylindrical()

bool DistanceMapGenerationTool::ConvertCloudToCylindrical ( ccPointCloud cloud,
const ccGLMatrix cloudToSurface,
unsigned char  revolutionAxisDim,
bool  counterclockwise = false 
)
static

◆ ConvertConicalMapToMesh()

◆ ConvertMapToCloud()

◆ ConvertMapToImage()

QImage DistanceMapGenerationTool::ConvertMapToImage ( const QSharedPointer< Map > &  map,
ccColorScale::Shared  colorScale,
unsigned  colorScaleSteps = ccColorScale::MAX_STEPS 
)
static

◆ ConvertProfileToMesh()

◆ CreateMap()

QSharedPointer< DistanceMapGenerationTool::Map > DistanceMapGenerationTool::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

◆ GetPolylineHeightShift()

bool DistanceMapGenerationTool::GetPolylineHeightShift ( const ccPolyline polyline,
PointCoordinateType heightShift 
)
static

Returns the profile 'height shift' (i.e. along the revolution axis)

Requires the right meta-data to be set (see SetPolylineHeightShift).

Returns
whether a height shift is defined or not

Definition at line 178 of file distanceMapGenerationTool.cpp.

References ccObject::getMetaData(), and PROFILE_HEIGHT_SHIFT_KEY.

Referenced by DistanceMapGenerationDlg::exportProfilesAsDXF(), and GetPoylineMetaData().

◆ GetPoylineAxis()

bool DistanceMapGenerationTool::GetPoylineAxis ( const ccPolyline polyline,
CCVector3 axis 
)
static

Returns the revolution axis associated to a given profile (polyline)

Requires the right meta-data to be set (see SetPoylineAxis).

Returns
whether an axis is defined or not

Definition at line 163 of file distanceMapGenerationTool.cpp.

References GetPolylineMetaVector(), and REVOLUTION_AXIS_KEY.

Referenced by GetPoylineMetaData().

◆ GetPoylineMetaData()

◆ GetPoylineOrigin()

bool DistanceMapGenerationTool::GetPoylineOrigin ( const ccPolyline polyline,
CCVector3 origin 
)
static

Returns the origin associated to a given polyline/profile.

Requires the right meta-data to be set (see SetPoylineOrigin).

Returns
whether an origin is defined or not

Definition at line 152 of file distanceMapGenerationTool.cpp.

References GetPolylineMetaVector(), and PROFILE_ORIGIN_KEY.

Referenced by GetPoylineMetaData().

◆ GetPoylineRevolDim()

int DistanceMapGenerationTool::GetPoylineRevolDim ( const ccPolyline polyline)
static

Returns the revolution 'dimension' associated to a given profile (polyline) Requires the right meta-data to be set (see SetPoylineRevolDim).

Returns
0 (X), 1 (Y), 2 (Z) or -1 if no revolution dimension is defined

Definition at line 132 of file distanceMapGenerationTool.cpp.

References ccObject::getMetaData(), and REVOLUTION_AXIS_KEY.

Referenced by ComputeSurfacesAndVolumes(), and GetPoylineMetaData().

◆ ProjectPointOnCone()

CCVector3 DistanceMapGenerationTool::ProjectPointOnCone ( double  lon_rad,
double  lat_rad,
double  latMin_rad,
double  nProj,
bool  counterclockwise 
)
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().

◆ SaveMapAsCSVMatrix()

bool DistanceMapGenerationTool::SaveMapAsCSVMatrix ( const QSharedPointer< Map > &  map,
QString  filename,
QString  xUnit,
QString  yUnit,
double  xConversionFactor = 1.0,
double  yConversionFactor = 1.0,
ecvMainAppInterface app = 0 
)
static

◆ SetPolylineHeightShift()

void DistanceMapGenerationTool::SetPolylineHeightShift ( ccPolyline polyline,
PointCoordinateType  heightShift 
)
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().

◆ SetPoylineAxis()

void DistanceMapGenerationTool::SetPoylineAxis ( ccPolyline polyline,
const CCVector3 axis 
)
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().

◆ SetPoylineOrigin()

void DistanceMapGenerationTool::SetPoylineOrigin ( ccPolyline polyline,
const CCVector3 origin 
)
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().

◆ SetPoylineRevolDim()

void DistanceMapGenerationTool::SetPoylineRevolDim ( ccPolyline polyline,
int  revolDim 
)
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().


The documentation for this class was generated from the following files: