![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Raster grid type. More...
#include <ecvRasterGrid.h>

Public Types | |
| enum | ExportableFields { PER_CELL_VALUE , PER_CELL_COUNT , PER_CELL_MIN_VALUE , PER_CELL_MAX_VALUE , PER_CELL_AVG_VALUE , PER_CELL_VALUE_STD_DEV , PER_CELL_VALUE_RANGE , PER_CELL_MEDIAN_VALUE , PER_CELL_PERCENTILE_VALUE , PER_CELL_UNIQUE_COUNT_VALUE , PER_CELL_INVALID } |
| Exportable fields. More... | |
| enum | ProjectionType { PROJ_MINIMUM_VALUE = 0 , PROJ_AVERAGE_VALUE = 1 , PROJ_MAXIMUM_VALUE = 2 , PROJ_MEDIAN_VALUE = 3 , PROJ_INVERSE_VAR_VALUE = 4 , INVALID_PROJECTION_TYPE = 255 } |
| Types of projection. More... | |
| enum class | InterpolationType { NONE = 0 , DELAUNAY = 1 } |
| Types of interpolation. More... | |
| enum | EmptyCellFillOption { LEAVE_EMPTY = 0 , FILL_MINIMUM_HEIGHT = 1 , FILL_MAXIMUM_HEIGHT = 2 , FILL_CUSTOM_HEIGHT = 3 , FILL_AVERAGE_HEIGHT = 4 , INTERPOLATE_DELAUNAY = 5 , KRIGING = 6 } |
| Option for handling empty cells. More... | |
| using | Row = std::vector< ccRasterCell > |
| Row. More... | |
| using | SF = std::vector< double > |
| Scalar field. More... | |
Public Member Functions | |
| ccRasterGrid () | |
| Default constructor. More... | |
| virtual | ~ccRasterGrid () |
| Destructor. More... | |
| bool | init (unsigned w, unsigned h, double gridStep, const CCVector3d &minCorner) |
| Initializes / resets the grid. More... | |
| void | clear () |
| Clears the grid. More... | |
| void | reset () |
| Resets the grid. More... | |
| ccPointCloud * | convertToCloud (const std::vector< ExportableFields > &exportedFields, bool interpolateSF, bool interpolateColors, bool resampleInputCloudXY, bool resampleInputCloudZ, ccGenericPointCloud *inputCloud, unsigned char Z, const ccBBox &box, bool fillEmptyCells, double emptyCellsHeight, bool exportToOriginalCS) const |
| Converts the grid to a cloud with scalar field(s) More... | |
| bool | fillWith (ccGenericPointCloud *cloud, unsigned char projectionDimension, ProjectionType projectionType, bool interpolateEmptyCells, ProjectionType sfInterpolation=INVALID_PROJECTION_TYPE, ecvProgressDialog *progressDialog=nullptr) |
| Fills the grid with a point cloud. More... | |
| void | fillEmptyCells (EmptyCellFillOption fillEmptyCellsStrategy, double customCellHeight=0) |
| Fills the empty cell (for all strategies but 'INTERPOLATE_DELAUNAY') More... | |
| unsigned | updateNonEmptyCellCount () |
| Updates the number of non-empty cells. More... | |
| void | updateCellStats () |
| Updates the statistics about the cells. More... | |
| void | setValid (bool state) |
| Sets valid. More... | |
| bool | isValid () const |
| Returns whether the grid is 'valid' or not. More... | |
| std::pair< int, int > | computeCellPos (const CCVector3 &P, unsigned char X, unsigned char Y) const |
| Computes the position of the cell that includes a given point. More... | |
| CCVector2d | computeCellCenter (int i, int j, unsigned char X, unsigned char Y) const |
| Computes the position of the center of a given cell. More... | |
Static Public Member Functions | |
| static bool | ComputeGridSize (unsigned char Z, const ccBBox &box, double gridStep, unsigned &width, unsigned &height) |
| Computes the raster size for a given bounding-box. More... | |
| static QString | GetDefaultFieldName (ExportableFields field) |
| Returns the default name of a given field. More... | |
| static InterpolationType | InterpolationTypeFromEmptyCellFillOption (EmptyCellFillOption option) |
Public Attributes | |
| std::vector< Row > | rows |
| All cells. More... | |
| std::vector< SF > | scalarFields |
| Associated scalar fields. More... | |
| unsigned | width |
| Number of columns. More... | |
| unsigned | height |
| Number of rows. More... | |
| double | gridStep |
| Grid step ('pixel' size) More... | |
| CCVector3d | minCorner |
| Min corner (3D) More... | |
| double | minHeight |
| Min height (computed on the NON-EMPTY or INTERPOLATED cells) More... | |
| double | maxHeight |
| Max height (computed on the NON-EMPTY or INTERPOLATED cells) More... | |
| double | meanHeight |
| Average height (computed on the NON-EMPTY or INTERPOLATED cells) More... | |
| unsigned | nonEmptyCellCount |
| Number of NON-EMPTY cells. More... | |
| unsigned | validCellCount |
| Number of VALID cells. More... | |
| bool | hasColors |
| Whether the (average) colors are available or not. More... | |
| bool | valid |
| Whether the grid is valid/up-to-date. More... | |
Raster grid type.
Definition at line 53 of file ecvRasterGrid.h.
| using ccRasterGrid::Row = std::vector<ccRasterCell> |
Row.
Definition at line 190 of file ecvRasterGrid.h.
| using ccRasterGrid::SF = std::vector<double> |
Scalar field.
Definition at line 196 of file ecvRasterGrid.h.
Option for handling empty cells.
| Enumerator | |
|---|---|
| LEAVE_EMPTY | |
| FILL_MINIMUM_HEIGHT | |
| FILL_MAXIMUM_HEIGHT | |
| FILL_CUSTOM_HEIGHT | |
| FILL_AVERAGE_HEIGHT | |
| INTERPOLATE_DELAUNAY | |
| KRIGING | |
Definition at line 137 of file ecvRasterGrid.h.
Exportable fields.
Definition at line 79 of file ecvRasterGrid.h.
|
strong |
Types of projection.
| Enumerator | |
|---|---|
| PROJ_MINIMUM_VALUE | |
| PROJ_AVERAGE_VALUE | |
| PROJ_MAXIMUM_VALUE | |
| PROJ_MEDIAN_VALUE | |
| PROJ_INVERSE_VAR_VALUE | |
| INVALID_PROJECTION_TYPE | |
Definition at line 112 of file ecvRasterGrid.h.
| ccRasterGrid::ccRasterGrid | ( | ) |
Default constructor.
|
virtual |
Destructor.
| void ccRasterGrid::clear | ( | ) |
Clears the grid.
|
inline |
Computes the position of the center of a given cell.
Definition at line 181 of file ecvRasterGrid.h.
References Vector2Tpl< Type >::u, and X.
Referenced by define_ccRasterGrid().
|
inline |
Computes the position of the cell that includes a given point.
Definition at line 168 of file ecvRasterGrid.h.
References Vector3Tpl< double >::fromArray(), Tuple3Tpl< Type >::u, and X.
Referenced by define_ccRasterGrid().
|
static |
Computes the raster size for a given bounding-box.
Referenced by define_ccRasterGrid(), cc2Point5DimEditor::getGridSize(), CommandRasterize::process(), and CommandVolume25D::process().
| ccPointCloud* ccRasterGrid::convertToCloud | ( | const std::vector< ExportableFields > & | exportedFields, |
| bool | interpolateSF, | ||
| bool | interpolateColors, | ||
| bool | resampleInputCloudXY, | ||
| bool | resampleInputCloudZ, | ||
| ccGenericPointCloud * | inputCloud, | ||
| unsigned char | Z, | ||
| const ccBBox & | box, | ||
| bool | fillEmptyCells, | ||
| double | emptyCellsHeight, | ||
| bool | exportToOriginalCS | ||
| ) | const |
Converts the grid to a cloud with scalar field(s)
Referenced by ccVolumeCalcTool::ConvertGridToCloud(), cc2Point5DimEditor::convertGridToCloud(), define_ccRasterGrid(), and CommandRasterize::process().
| void ccRasterGrid::fillEmptyCells | ( | EmptyCellFillOption | fillEmptyCellsStrategy, |
| double | customCellHeight = 0 |
||
| ) |
Fills the empty cell (for all strategies but 'INTERPOLATE_DELAUNAY')
Referenced by ccVolumeCalcTool::ComputeVolume(), define_ccRasterGrid(), and CommandRasterize::process().
| bool ccRasterGrid::fillWith | ( | ccGenericPointCloud * | cloud, |
| unsigned char | projectionDimension, | ||
| ProjectionType | projectionType, | ||
| bool | interpolateEmptyCells, | ||
| ProjectionType | sfInterpolation = INVALID_PROJECTION_TYPE, |
||
| ecvProgressDialog * | progressDialog = nullptr |
||
| ) |
Fills the grid with a point cloud.
Since version 2.8, we now use the "PixelIsArea" convention by default (as GDAL) This means that the height is computed at the center of the grid cell.
Referenced by ccVolumeCalcTool::ComputeVolume(), define_ccRasterGrid(), CommandRasterize::process(), and ccRasterizeTool::updateGrid().
|
static |
Returns the default name of a given field.
Referenced by ccRasterizeTool::ccRasterizeTool(), and define_ccRasterGrid().
| bool ccRasterGrid::init | ( | unsigned | w, |
| unsigned | h, | ||
| double | gridStep, | ||
| const CCVector3d & | minCorner | ||
| ) |
Initializes / resets the grid.
Referenced by ccVolumeCalcTool::ComputeVolume(), CommandRasterize::process(), and ccRasterizeTool::updateGrid().
|
static |
Converts the empty cells fill option to the corresponding interpolation type
|
inline |
Returns whether the grid is 'valid' or not.
Definition at line 165 of file ecvRasterGrid.h.
Referenced by ccRasterizeTool::convertGridToCloud(), define_ccRasterGrid(), ccVolumeCalcTool::exportGridAsCloud(), ccRasterizeTool::generateASCIIMatrix(), ccRasterizeTool::generateCloud(), ccRasterizeTool::generateContours(), ccRasterizeTool::generateHillshade(), ccRasterizeTool::generateImage(), ccRasterizeTool::generateRaster(), and cc2Point5DimEditor::update2DDisplayZoom().
| void ccRasterGrid::reset | ( | ) |
Resets the grid.
Referenced by define_ccRasterGrid().
|
inline |
Sets valid.
Definition at line 163 of file ecvRasterGrid.h.
Referenced by ccVolumeCalcTool::ComputeVolume(), and define_ccRasterGrid().
| void ccRasterGrid::updateCellStats | ( | ) |
Updates the statistics about the cells.
Referenced by define_ccRasterGrid().
| unsigned ccRasterGrid::updateNonEmptyCellCount | ( | ) |
Updates the number of non-empty cells.
Referenced by define_ccRasterGrid().
| double ccRasterGrid::gridStep |
Grid step ('pixel' size)
Definition at line 206 of file ecvRasterGrid.h.
Referenced by ccVolumeCalcTool::ComputeVolume(), define_ccRasterGrid(), ccRasterizeTool::ExportGeoTiff(), ccRasterizeTool::generateContours(), ccRasterizeTool::generateHillshade(), cc2Point5DimEditor::update2DDisplayZoom(), and ccRasterizeTool::updateGrid().
| bool ccRasterGrid::hasColors |
Whether the (average) colors are available or not.
Definition at line 222 of file ecvRasterGrid.h.
Referenced by define_ccRasterGrid(), and ccRasterizeTool::generateRaster().
| unsigned ccRasterGrid::height |
Number of rows.
Definition at line 204 of file ecvRasterGrid.h.
Referenced by ccVolumeCalcTool::ComputeVolume(), define_ccRasterGrid(), ccRasterizeTool::ExportGeoTiff(), ccRasterizeTool::generateASCIIMatrix(), ccRasterizeTool::generateContours(), ccRasterizeTool::generateHillshade(), ccRasterizeTool::generateImage(), ccRasterizeTool::generateRaster(), ccRasterizeTool::getFillEmptyCellsStrategyExt(), CommandRasterize::process(), cc2Point5DimEditor::update2DDisplayZoom(), and ccRasterizeTool::updateGrid().
| double ccRasterGrid::maxHeight |
Max height (computed on the NON-EMPTY or INTERPOLATED cells)
Definition at line 213 of file ecvRasterGrid.h.
Referenced by ccVolumeCalcTool::ComputeVolume(), ccRasterizeTool::convertGridToCloud(), define_ccRasterGrid(), ccRasterizeTool::ExportGeoTiff(), ccRasterizeTool::generateASCIIMatrix(), ccRasterizeTool::generateImage(), ccRasterizeTool::getFillEmptyCellsStrategyExt(), CommandRasterize::process(), and ccRasterizeTool::updateGrid().
| double ccRasterGrid::meanHeight |
Average height (computed on the NON-EMPTY or INTERPOLATED cells)
Definition at line 215 of file ecvRasterGrid.h.
Referenced by define_ccRasterGrid(), ccRasterizeTool::ExportGeoTiff(), and ccRasterizeTool::getFillEmptyCellsStrategyExt().
| CCVector3d ccRasterGrid::minCorner |
Min corner (3D)
Definition at line 208 of file ecvRasterGrid.h.
Referenced by define_ccRasterGrid().
| double ccRasterGrid::minHeight |
Min height (computed on the NON-EMPTY or INTERPOLATED cells)
Definition at line 211 of file ecvRasterGrid.h.
Referenced by ccVolumeCalcTool::ComputeVolume(), ccRasterizeTool::convertGridToCloud(), define_ccRasterGrid(), ccRasterizeTool::ExportGeoTiff(), ccRasterizeTool::generateASCIIMatrix(), ccRasterizeTool::generateImage(), ccRasterizeTool::getFillEmptyCellsStrategyExt(), CommandRasterize::process(), and ccRasterizeTool::updateGrid().
| unsigned ccRasterGrid::nonEmptyCellCount |
Number of NON-EMPTY cells.
Definition at line 217 of file ecvRasterGrid.h.
Referenced by ccVolumeCalcTool::ComputeVolume(), and define_ccRasterGrid().
| std::vector<Row> ccRasterGrid::rows |
All cells.
Definition at line 193 of file ecvRasterGrid.h.
Referenced by ccVolumeCalcTool::ComputeVolume(), ccRasterizeTool::ExportGeoTiff(), ccRasterizeTool::generateASCIIMatrix(), ccRasterizeTool::generateContours(), ccRasterizeTool::generateHillshade(), ccRasterizeTool::generateImage(), and ccRasterizeTool::updateGrid().
| std::vector<SF> ccRasterGrid::scalarFields |
Associated scalar fields.
Definition at line 199 of file ecvRasterGrid.h.
Referenced by ccRasterizeTool::ExportGeoTiff(), and ccRasterizeTool::generateRaster().
| bool ccRasterGrid::valid |
Whether the grid is valid/up-to-date.
Definition at line 225 of file ecvRasterGrid.h.
Referenced by define_ccRasterGrid().
| unsigned ccRasterGrid::validCellCount |
Number of VALID cells.
Definition at line 219 of file ecvRasterGrid.h.
Referenced by ccVolumeCalcTool::ComputeVolume(), define_ccRasterGrid(), ccRasterizeTool::ExportGeoTiff(), and ccRasterizeTool::getFillEmptyCellsStrategyExt().
| unsigned ccRasterGrid::width |
Number of columns.
Definition at line 202 of file ecvRasterGrid.h.
Referenced by ccVolumeCalcTool::ComputeVolume(), define_ccRasterGrid(), ccRasterizeTool::ExportGeoTiff(), ccRasterizeTool::generateASCIIMatrix(), ccRasterizeTool::generateContours(), ccRasterizeTool::generateHillshade(), ccRasterizeTool::generateImage(), ccRasterizeTool::generateRaster(), ccRasterizeTool::getFillEmptyCellsStrategyExt(), CommandRasterize::process(), cc2Point5DimEditor::update2DDisplayZoom(), and ccRasterizeTool::updateGrid().