25 : h(
std::numeric_limits<double>::quiet_NaN()),
98 const std::vector<ExportableFields>& exportedFields,
101 bool resampleInputCloudXY,
102 bool resampleInputCloudZ,
108 double emptyCellsHeight,
109 bool exportToOriginalCS)
const;
113 PROJ_MINIMUM_VALUE = 0,
114 PROJ_AVERAGE_VALUE = 1,
115 PROJ_MAXIMUM_VALUE = 2,
116 PROJ_MEDIAN_VALUE = 3,
117 PROJ_INVERSE_VAR_VALUE = 4,
118 INVALID_PROJECTION_TYPE = 255,
130 unsigned char projectionDimension,
132 bool interpolateEmptyCells,
139 FILL_MINIMUM_HEIGHT = 1,
140 FILL_MAXIMUM_HEIGHT = 2,
141 FILL_CUSTOM_HEIGHT = 3,
142 FILL_AVERAGE_HEIGHT = 4,
143 INTERPOLATE_DELAUNAY = 5,
154 double customCellHeight = 0);
163 inline void setValid(
bool state) { valid = state; }
170 unsigned char Y)
const {
174 int i =
static_cast<int>((relativePos.
u[
X] / gridStep + 0.5));
175 int j =
static_cast<int>((relativePos.
u[Y] / gridStep + 0.5));
184 unsigned char Y)
const {
185 return {minCorner.
u[
X] + (i + 0.5) * gridStep,
186 minCorner.u[Y] + (j + 0.5) * gridStep};
190 using Row = std::vector<ccRasterCell>;
196 using SF = std::vector<double>;
float PointCoordinateType
Type of the coordinates of a (N-D) point.
static Vector3Tpl fromArray(const int a[3])
Constructor from an int array.
A 3D cloud interface with associated features (color, normals, octree, etc.)
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Graphical progress indicator (thread-safe)
bool interpolateColors(const ccHObject::Container &selectedEntities, QWidget *parent)
Interpolate colors from on entity and transfer them to another one.
double avgHeight
Average height value.
unsigned nbPoints
Number of points projected in this cell.
ccRasterCell()
Default constructor.
unsigned pointIndex
Nearest point index (if any)
PointCoordinateType maxHeight
Max height value.
PointCoordinateType minHeight
Min height value.
double stdDevHeight
Height std.dev.
InterpolationType
Types of interpolation.
ExportableFields
Exportable fields.
@ PER_CELL_UNIQUE_COUNT_VALUE
@ PER_CELL_PERCENTILE_VALUE
void updateCellStats()
Updates the statistics about the cells.
void clear()
Clears the grid.
CCVector2d computeCellCenter(int i, int j, unsigned char X, unsigned char Y) const
Computes the position of the center of a given cell.
unsigned validCellCount
Number of VALID cells.
unsigned nonEmptyCellCount
Number of NON-EMPTY cells.
void setValid(bool state)
Sets valid.
ProjectionType
Types of projection.
double gridStep
Grid step ('pixel' size)
ccRasterGrid()
Default constructor.
std::vector< ccRasterCell > Row
Row.
unsigned height
Number of rows.
bool hasColors
Whether the (average) colors are available or not.
bool init(unsigned w, unsigned h, double gridStep, const CCVector3d &minCorner)
Initializes / resets the grid.
double meanHeight
Average height (computed on the NON-EMPTY or INTERPOLATED cells)
std::vector< double > SF
Scalar field.
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.
std::vector< SF > scalarFields
Associated scalar fields.
CCVector3d minCorner
Min corner (3D)
static QString GetDefaultFieldName(ExportableFields field)
Returns the default name of a given field.
void reset()
Resets the grid.
std::vector< Row > rows
All cells.
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.
static bool ComputeGridSize(unsigned char Z, const ccBBox &box, double gridStep, unsigned &width, unsigned &height)
Computes the raster size for a given bounding-box.
double maxHeight
Max height (computed on the NON-EMPTY or INTERPOLATED cells)
unsigned updateNonEmptyCellCount()
Updates the number of non-empty cells.
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)
bool isValid() const
Returns whether the grid is 'valid' or not.
unsigned width
Number of columns.
EmptyCellFillOption
Option for handling empty cells.
static InterpolationType InterpolationTypeFromEmptyCellFillOption(EmptyCellFillOption option)
virtual ~ccRasterGrid()
Destructor.
bool valid
Whether the grid is valid/up-to-date.
double minHeight
Min height (computed on the NON-EMPTY or INTERPOLATED cells)
void fillEmptyCells(EmptyCellFillOption fillEmptyCellsStrategy, double customCellHeight=0)
Fills the empty cell (for all strategies but 'INTERPOLATE_DELAUNAY')