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

Rasterize tool (dialog) More...

#include <ecvRasterizeTool.h>

Inheritance diagram for ccRasterizeTool:
Collaboration diagram for ccRasterizeTool:

Classes

struct  ExportBands
 Bands to be exported. More...
 

Public Member Functions

 ccRasterizeTool (ccGenericPointCloud *cloud, QWidget *parent=0)
 Default constructor. More...
 
 ~ccRasterizeTool ()
 Destructor. More...
 
- Public Member Functions inherited from cc2Point5DimEditor
 cc2Point5DimEditor ()
 Default constructor. More...
 
virtual ~cc2Point5DimEditor ()
 Destructor. More...
 

Static Public Member Functions

static bool ExportGeoTiff (QString outputFilename, const ExportBands &exportBands, ccRasterGrid::EmptyCellFillOption fillEmptyCellsStrategy, const ccRasterGrid &grid, const ccBBox &gridBBox, unsigned char Z, double customHeightForEmptyCells=std::numeric_limits< double >::quiet_NaN(), ccGenericPointCloud *originCloud=0, int visibleSfIndex=-1)
 Exports a raster grid as a geotiff file. More...
 

Protected Types

enum  LayerType { LAYER_HEIGHT = 0 , LAYER_RGB = 1 , LAYER_SF = 2 }
 Layer types. More...
 

Protected Slots

ccPointCloudgenerateCloud (bool autoExport=true) const
 Exports the grid as a cloud. More...
 
void generateRaster () const
 Exports the grid as a raster. More...
 
void generateMesh () const
 Exports the grid as a mesh. More...
 
void exportContourLines ()
 Exports the (already generated) contour lines. More...
 
void generateContours ()
 Generates a contour plot. More...
 
void generateHillshade ()
 Generates hillshade. More...
 
void removeContourLines ()
 Removes all displayed contour lines. More...
 
void testAndAccept ()
 Accepts the dialog (if some conditions are met) and save settings. More...
 
void testAndReject ()
 Rejects the dialog (if some conditions are met) More...
 
void saveSettings ()
 Save persistent settings and 'accept' dialog. More...
 
void activeLayerChanged (int, bool autoRedraw=true)
 Called when the active layer changes. More...
 
void projectionDirChanged (int)
 Called when the projection direction changes. More...
 
void projectionTypeChanged (int)
 Called when the projection type changes. More...
 
void resampleOptionToggled (bool)
 Called when the 'resampled' option changes. More...
 
void sfProjectionTypeChanged (int)
 Called when the SF projection type changes. More...
 
virtual bool showGridBoxEditor () override
 
void fillEmptyCellStrategyChanged (int)
 Called when the empty cell filling strategy changes. More...
 
void gridOptionChanged ()
 Called when the an option of the grid generation has changed. More...
 
void updateGridInfo ()
 Updates the gid info. More...
 
void updateGridAndDisplay ()
 Update the grid and the 2D display. More...
 
virtual void generateImage () const
 Exports the grid as an image. More...
 
virtual void generateASCIIMatrix () const
 Exports the grid as an ASCII matrix. More...
 

Protected Member Functions

virtual double getGridStep () const override
 Returns projection grid step. More...
 
virtual unsigned char getProjectionDimension () const override
 Returns projection dimension. More...
 
virtual ccRasterGrid::ProjectionType getTypeOfProjection () const override
 Returns type of projection. More...
 
double getCustomHeightForEmptyCells () const
 Returns user defined height for empty cells. More...
 
ccRasterGrid::EmptyCellFillOption getFillEmptyCellsStrategyExt (double &emptyCellsHeight, double &minHeight, double &maxHeight) const
 Returns strategy for empty cell filling (extended version) More...
 
bool exportAsSF (ccRasterGrid::ExportableFields field) const
 
bool resampleOriginalCloud () const
 
ccRasterGrid::ProjectionType getTypeOfSFInterpolation () const
 Returns type of SF interpolation. More...
 
virtual void gridIsUpToDate (bool state) override
 Declares whether the grid is up-to-date or not. More...
 
void loadSettings ()
 Load persistent settings. More...
 
bool updateGrid (bool interpolateSF=false)
 Updates the grid. More...
 
bool canClose ()
 Tests if the dialog can be safely closed. More...
 
void addNewContour (ccPolyline *poly, double height, unsigned subIndex)
 Adds a new contour line. More...
 
ccPointCloudconvertGridToCloud (const std::vector< ccRasterGrid::ExportableFields > &exportedFields, bool interpolateSF, bool interpolateColors, bool copyHillshadeSF, QString activeSFName, bool exportToOriginalCS) const
 Converts the grid to a cloud with scalar field(s) More...
 
- Protected Member Functions inherited from cc2Point5DimEditor
virtual ccBBox getCustomBBox () const
 Returns custom bbox. More...
 
virtual void update2DDisplayZoom (ccBBox &box)
 Updates the 2D display zoom. More...
 
virtual bool showGridBoxEditor ()
 Show grid box editor and update. More...
 
virtual QString getGridSizeAsString () const
 Returns the grid size as a string. More...
 
virtual bool getGridSize (unsigned &width, unsigned &height) const
 Returns the grid size. More...
 
void createBoundingBoxEditor (const ccBBox &gridBBox, QWidget *parent)
 Creates the bounding-box editor. More...
 
void create2DView (QFrame *parentFrame)
 Creates the 2D view. More...
 
ccRasterGrid::EmptyCellFillOption getFillEmptyCellsStrategy (QComboBox *comboBox) const
 Returns the empty cell strategy (for a given combo-box) More...
 
ccPointCloudconvertGridToCloud (const std::vector< ccRasterGrid::ExportableFields > &exportedFields, bool interpolateSF, bool interpolateColors, bool resampleInputCloudXY, bool resampleInputCloudZ, ccGenericPointCloud *inputCloud, bool fillEmptyCells, double emptyCellsHeight, bool exportToOriginalCS) const
 Shortcut to ccRasterGrid::convertToCloud. More...
 

Protected Attributes

ccGenericPointCloudm_cloud
 Associated cloud. More...
 
std::vector< ccPolyline * > m_contourLines
 Contour lines. More...
 
- Protected Attributes inherited from cc2Point5DimEditor
ccRasterGrid m_grid
 Raster grid. More...
 
ccBoundingBoxEditorDlgm_bbEditorDlg
 Associated dialog. More...
 
ccPointCloudm_rasterCloud
 'Raster' cloud More...
 

Detailed Description

Rasterize tool (dialog)

Definition at line 23 of file ecvRasterizeTool.h.

Member Enumeration Documentation

◆ LayerType

Layer types.

Enumerator
LAYER_HEIGHT 
LAYER_RGB 
LAYER_SF 

Definition at line 178 of file ecvRasterizeTool.h.

Constructor & Destructor Documentation

◆ ccRasterizeTool()

◆ ~ccRasterizeTool()

ccRasterizeTool::~ccRasterizeTool ( )

Destructor.

Definition at line 180 of file ecvRasterizeTool.cpp.

References removeContourLines().

Member Function Documentation

◆ activeLayerChanged

◆ addNewContour()

◆ canClose()

bool ccRasterizeTool::canClose ( )
protected

Tests if the dialog can be safely closed.

Definition at line 486 of file ecvRasterizeTool.cpp.

References m_contourLines.

Referenced by testAndAccept(), and testAndReject().

◆ convertGridToCloud()

◆ exportAsSF()

bool ccRasterizeTool::exportAsSF ( ccRasterGrid::ExportableFields  field) const
protected

Returns whether a given field count should be exported as SF (only if a cloud is generated!)

Definition at line 214 of file ecvRasterizeTool.cpp.

References ccRasterGrid::PER_CELL_AVG_VALUE, ccRasterGrid::PER_CELL_COUNT, ccRasterGrid::PER_CELL_MAX_VALUE, ccRasterGrid::PER_CELL_MIN_VALUE, ccRasterGrid::PER_CELL_VALUE_RANGE, and ccRasterGrid::PER_CELL_VALUE_STD_DEV.

Referenced by generateCloud().

◆ exportContourLines

◆ ExportGeoTiff()

bool ccRasterizeTool::ExportGeoTiff ( QString  outputFilename,
const ExportBands exportBands,
ccRasterGrid::EmptyCellFillOption  fillEmptyCellsStrategy,
const ccRasterGrid grid,
const ccBBox gridBBox,
unsigned char  Z,
double  customHeightForEmptyCells = std::numeric_limits<double>::quiet_NaN(),
ccGenericPointCloud originCloud = 0,
int  visibleSfIndex = -1 
)
static

◆ fillEmptyCellStrategyChanged

void ccRasterizeTool::fillEmptyCellStrategyChanged ( int  )
protectedslot

Called when the empty cell filling strategy changes.

Definition at line 341 of file ecvRasterizeTool.cpp.

References ccRasterGrid::FILL_CUSTOM_HEIGHT, cc2Point5DimEditor::getFillEmptyCellsStrategy(), gridIsUpToDate(), and ccRasterGrid::INTERPOLATE_DELAUNAY.

Referenced by ccRasterizeTool().

◆ generateASCIIMatrix

◆ generateCloud

◆ generateContours

void ccRasterizeTool::generateContours ( )
protectedslot

Generates a contour plot.

Definition at line 1680 of file ecvRasterizeTool.cpp.

References ccHObject::addChild(), addNewContour(), cloudViewer::PointCloudTpl< T >::addPoint(), cloudViewer::ReferenceCloud::addPointIndex(), Isolines< T >::createOnePixelBorder(), cloudViewer::ScalarField::currentSize(), error(), CVLog::Error(), Isolines< T >::find(), cloudViewer::utility::floor(), cloudViewer::ReferenceCloud::getAssociatedCloud(), Isolines< T >::getContourLength(), Isolines< T >::getContourX(), Isolines< T >::getContourY(), ccPointCloud::getCurrentDisplayedScalarField(), cc2Point5DimEditor::getCustomBBox(), ecvDisplayTools::GetMainWindow(), cloudViewer::ScalarField::getMax(), ccObject::getMetaData(), cloudViewer::ScalarField::getMin(), cloudViewer::GenericIndexedCloud::getPoint(), getProjectionDimension(), cloudViewer::ScalarField::getValue(), ccRasterGrid::gridStep, height, ccRasterGrid::height, Isolines< T >::isContourClosed(), cloudViewer::BoundingBoxTpl< T >::isValid(), ccRasterGrid::isValid(), LAYER_HEIGHT, LAYER_RGB, m_contourLines, cc2Point5DimEditor::m_grid, cc2Point5DimEditor::m_rasterCloud, max(), ccPolyline::MetaKeyConstAltitude(), min(), cloudViewer::BoundingBoxTpl< T >::minCorner(), nProgress, cloudViewer::NormalizedProgress::oneStep(), params, CVLog::Print(), CVLog::PrintDebug(), ecvDisplayTools::RedrawDisplay(), removeContourLines(), cloudViewer::ReferenceCloud::reserve(), ccPointCloud::reserve(), ccRasterGrid::rows, cloudViewer::Polyline::setClosed(), ccObject::setEnabled(), ecvProgressDialog::setInfo(), ccObject::setMetaData(), ecvProgressDialog::setMethodTitle(), Isolines< T >::setThreshold(), cloudViewer::ReferenceCloud::size(), size, ecvProgressDialog::start(), Tuple3Tpl< Type >::u, cloudViewer::ScalarField::ValidValue(), ccRasterGrid::width, Tuple3Tpl< Type >::x, X, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

Referenced by ccRasterizeTool().

◆ generateHillshade

◆ generateImage

◆ generateMesh

◆ generateRaster

◆ getCustomHeightForEmptyCells()

double ccRasterizeTool::getCustomHeightForEmptyCells ( ) const
protected

Returns user defined height for empty cells.

Definition at line 355 of file ecvRasterizeTool.cpp.

Referenced by generateRaster(), and getFillEmptyCellsStrategyExt().

◆ getFillEmptyCellsStrategyExt()

◆ getGridStep()

double ccRasterizeTool::getGridStep ( ) const
overrideprotectedvirtual

Returns projection grid step.

Implements cc2Point5DimEditor.

Definition at line 210 of file ecvRasterizeTool.cpp.

Referenced by updateGrid().

◆ getProjectionDimension()

unsigned char ccRasterizeTool::getProjectionDimension ( ) const
overrideprotectedvirtual

Returns projection dimension.

Returns
dimension as int (0: X, 1: Y, 2:Z)

Implements cc2Point5DimEditor.

Definition at line 240 of file ecvRasterizeTool.cpp.

Referenced by exportContourLines(), generateContours(), generateMesh(), generateRaster(), and updateGrid().

◆ getTypeOfProjection()

ccRasterGrid::ProjectionType ccRasterizeTool::getTypeOfProjection ( ) const
overrideprotectedvirtual

◆ getTypeOfSFInterpolation()

ccRasterGrid::ProjectionType ccRasterizeTool::getTypeOfSFInterpolation ( ) const
protected

Returns type of SF interpolation.

interpolateSFCheckBox->isEnabled() ||

Definition at line 375 of file ecvRasterizeTool.cpp.

References ccRasterGrid::INVALID_PROJECTION_TYPE, ccRasterGrid::PROJ_AVERAGE_VALUE, ccRasterGrid::PROJ_MAXIMUM_VALUE, and ccRasterGrid::PROJ_MINIMUM_VALUE.

Referenced by generateCloud(), updateGrid(), and updateGridAndDisplay().

◆ gridIsUpToDate()

void ccRasterizeTool::gridIsUpToDate ( bool  state)
overrideprotectedvirtual

◆ gridOptionChanged

void ccRasterizeTool::gridOptionChanged ( )
protectedslot

Called when the an option of the grid generation has changed.

Definition at line 353 of file ecvRasterizeTool.cpp.

References gridIsUpToDate().

Referenced by ccRasterizeTool(), and resampleOptionToggled().

◆ loadSettings()

void ccRasterizeTool::loadSettings ( )
protected

Load persistent settings.

Definition at line 400 of file ecvRasterizeTool.cpp.

References ecvPS::HeightGridGeneration().

Referenced by ccRasterizeTool().

◆ projectionDirChanged

void ccRasterizeTool::projectionDirChanged ( int  dir)
protectedslot

Called when the projection direction changes.

Definition at line 268 of file ecvRasterizeTool.cpp.

References gridIsUpToDate(), and updateGridInfo().

Referenced by ccRasterizeTool().

◆ projectionTypeChanged

void ccRasterizeTool::projectionTypeChanged ( int  index)
protectedslot

Called when the projection type changes.

Definition at line 254 of file ecvRasterizeTool.cpp.

References gridIsUpToDate(), and ccRasterGrid::PROJ_AVERAGE_VALUE.

Referenced by ccRasterizeTool().

◆ removeContourLines

void ccRasterizeTool::removeContourLines ( )
protectedslot

◆ resampleOptionToggled

void ccRasterizeTool::resampleOptionToggled ( bool  state)
protectedslot

Called when the 'resampled' option changes.

Definition at line 247 of file ecvRasterizeTool.cpp.

References getTypeOfProjection(), gridOptionChanged(), and ccRasterGrid::PROJ_AVERAGE_VALUE.

Referenced by ccRasterizeTool().

◆ resampleOriginalCloud()

bool ccRasterizeTool::resampleOriginalCloud ( ) const
protected

Returns whether the output cloud should use the original cloud or the grid as 'support'

Definition at line 235 of file ecvRasterizeTool.cpp.

Referenced by convertGridToCloud().

◆ saveSettings

void ccRasterizeTool::saveSettings ( )
protectedslot

Save persistent settings and 'accept' dialog.

Definition at line 512 of file ecvRasterizeTool.cpp.

References ecvPS::HeightGridGeneration().

Referenced by testAndAccept().

◆ sfProjectionTypeChanged

void ccRasterizeTool::sfProjectionTypeChanged ( int  index)
protectedslot

Called when the SF projection type changes.

Definition at line 264 of file ecvRasterizeTool.cpp.

References gridIsUpToDate().

Referenced by ccRasterizeTool().

◆ showGridBoxEditor

bool ccRasterizeTool::showGridBoxEditor ( )
overrideprotectedvirtualslot

Definition at line 197 of file ecvRasterizeTool.cpp.

References cc2Point5DimEditor::showGridBoxEditor(), and updateGridInfo().

Referenced by ccRasterizeTool().

◆ testAndAccept

void ccRasterizeTool::testAndAccept ( )
protectedslot

Accepts the dialog (if some conditions are met) and save settings.

Definition at line 499 of file ecvRasterizeTool.cpp.

References canClose(), and saveSettings().

Referenced by ccRasterizeTool().

◆ testAndReject

void ccRasterizeTool::testAndReject ( )
protectedslot

Rejects the dialog (if some conditions are met)

Definition at line 506 of file ecvRasterizeTool.cpp.

References canClose().

Referenced by ccRasterizeTool().

◆ updateGrid()

◆ updateGridAndDisplay

◆ updateGridInfo

void ccRasterizeTool::updateGridInfo ( )
protectedslot

Updates the gid info.

Definition at line 206 of file ecvRasterizeTool.cpp.

References cc2Point5DimEditor::getGridSizeAsString().

Referenced by ccRasterizeTool(), projectionDirChanged(), and showGridBoxEditor().

Member Data Documentation

◆ m_cloud

◆ m_contourLines

std::vector<ccPolyline*> ccRasterizeTool::m_contourLines
protected

Contour lines.

Definition at line 184 of file ecvRasterizeTool.h.

Referenced by addNewContour(), canClose(), exportContourLines(), generateContours(), and removeContourLines().


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