ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccRasterGrid Struct Reference

Raster grid type. More...

#include <ecvRasterGrid.h>

Collaboration diagram for ccRasterGrid:

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...
 
ccPointCloudconvertToCloud (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< Rowrows
 All cells. More...
 
std::vector< SFscalarFields
 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...
 

Detailed Description

Raster grid type.

Definition at line 53 of file ecvRasterGrid.h.

Member Typedef Documentation

◆ Row

using ccRasterGrid::Row = std::vector<ccRasterCell>

Row.

Definition at line 190 of file ecvRasterGrid.h.

◆ SF

using ccRasterGrid::SF = std::vector<double>

Scalar field.

Definition at line 196 of file ecvRasterGrid.h.

Member Enumeration Documentation

◆ EmptyCellFillOption

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.

◆ ExportableFields

Exportable fields.

Enumerator
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 

Definition at line 79 of file ecvRasterGrid.h.

◆ InterpolationType

Types of interpolation.

Enumerator
NONE 
DELAUNAY 

Definition at line 122 of file ecvRasterGrid.h.

◆ ProjectionType

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.

Constructor & Destructor Documentation

◆ ccRasterGrid()

ccRasterGrid::ccRasterGrid ( )

Default constructor.

◆ ~ccRasterGrid()

virtual ccRasterGrid::~ccRasterGrid ( )
virtual

Destructor.

Member Function Documentation

◆ clear()

void ccRasterGrid::clear ( )

Clears the grid.

◆ computeCellCenter()

CCVector2d ccRasterGrid::computeCellCenter ( int  i,
int  j,
unsigned char  X,
unsigned char  Y 
) const
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().

◆ computeCellPos()

std::pair<int, int> ccRasterGrid::computeCellPos ( const CCVector3 P,
unsigned char  X,
unsigned char  Y 
) const
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().

◆ ComputeGridSize()

static bool ccRasterGrid::ComputeGridSize ( unsigned char  Z,
const ccBBox box,
double  gridStep,
unsigned &  width,
unsigned &  height 
)
static

Computes the raster size for a given bounding-box.

Referenced by define_ccRasterGrid(), cc2Point5DimEditor::getGridSize(), CommandRasterize::process(), and CommandVolume25D::process().

◆ convertToCloud()

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

◆ fillEmptyCells()

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().

◆ fillWith()

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().

◆ GetDefaultFieldName()

static QString ccRasterGrid::GetDefaultFieldName ( ExportableFields  field)
static

Returns the default name of a given field.

Referenced by ccRasterizeTool::ccRasterizeTool(), and define_ccRasterGrid().

◆ init()

bool ccRasterGrid::init ( unsigned  w,
unsigned  h,
double  gridStep,
const CCVector3d minCorner 
)

◆ InterpolationTypeFromEmptyCellFillOption()

static InterpolationType ccRasterGrid::InterpolationTypeFromEmptyCellFillOption ( EmptyCellFillOption  option)
static

Converts the empty cells fill option to the corresponding interpolation type

◆ isValid()

◆ reset()

void ccRasterGrid::reset ( )

Resets the grid.

Referenced by define_ccRasterGrid().

◆ setValid()

void ccRasterGrid::setValid ( bool  state)
inline

Sets valid.

Definition at line 163 of file ecvRasterGrid.h.

Referenced by ccVolumeCalcTool::ComputeVolume(), and define_ccRasterGrid().

◆ updateCellStats()

void ccRasterGrid::updateCellStats ( )

Updates the statistics about the cells.

Referenced by define_ccRasterGrid().

◆ updateNonEmptyCellCount()

unsigned ccRasterGrid::updateNonEmptyCellCount ( )

Updates the number of non-empty cells.

Referenced by define_ccRasterGrid().

Member Data Documentation

◆ gridStep

◆ hasColors

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().

◆ height

◆ maxHeight

◆ meanHeight

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().

◆ minCorner

CCVector3d ccRasterGrid::minCorner

Min corner (3D)

Definition at line 208 of file ecvRasterGrid.h.

Referenced by define_ccRasterGrid().

◆ minHeight

◆ nonEmptyCellCount

unsigned ccRasterGrid::nonEmptyCellCount

Number of NON-EMPTY cells.

Definition at line 217 of file ecvRasterGrid.h.

Referenced by ccVolumeCalcTool::ComputeVolume(), and define_ccRasterGrid().

◆ rows

◆ scalarFields

std::vector<SF> ccRasterGrid::scalarFields

Associated scalar fields.

Definition at line 199 of file ecvRasterGrid.h.

Referenced by ccRasterizeTool::ExportGeoTiff(), and ccRasterizeTool::generateRaster().

◆ valid

bool ccRasterGrid::valid

Whether the grid is valid/up-to-date.

Definition at line 225 of file ecvRasterGrid.h.

Referenced by define_ccRasterGrid().

◆ validCellCount

unsigned ccRasterGrid::validCellCount

◆ width


The documentation for this struct was generated from the following file: