cc2.5DimEditor.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. //##########################################################################
  2. //# #
  3. //# CLOUDCOMPARE #
  4. //# #
  5. //# This program is free software; you can redistribute it and/or modify #
  6. //# it under the terms of the GNU General Public License as published by #
  7. //# the Free Software Foundation; version 2 or later of the License. #
  8. //# #
  9. //# This program is distributed in the hope that it will be useful, #
  10. //# but WITHOUT ANY WARRANTY; without even the implied warranty of #
  11. //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  12. //# GNU General Public License for more details. #
  13. //# #
  14. //# COPYRIGHT: EDF R&D / TELECOM ParisTech (ENST-TSI) #
  15. //# #
  16. //##########################################################################
  17. #ifndef CC_2_5D_EDITOR_HEADER
  18. #define CC_2_5D_EDITOR_HEADER
  19. //qCC_db
  20. #include <ccRasterGrid.h>
  21. class ccBoundingBoxEditorDlg;
  22. class ccGLWindowInterface;
  23. class QWidget;
  24. class QFrame;
  25. class QComboBox;
  26. //! 2.5D data editor (generic interface)
  27. class cc2Point5DimEditor
  28. {
  29. public:
  30. //! Default constructor
  31. cc2Point5DimEditor();
  32. //! Destructor
  33. virtual ~cc2Point5DimEditor();
  34. protected: //standard methods
  35. //! Returns projection grid step
  36. virtual double getGridStep() const = 0;
  37. //! Returns projection dimension
  38. /** \return dimension as int (0: X, 1: Y, 2:Z)
  39. **/
  40. virtual unsigned char getProjectionDimension() const = 0;
  41. //! Returns type of projection
  42. virtual ccRasterGrid::ProjectionType getTypeOfProjection() const = 0;
  43. //! Returns custom bbox
  44. virtual ccBBox getCustomBBox() const;
  45. //! Declares whether the grid is up-to-date or not
  46. virtual void gridIsUpToDate(bool state) = 0;
  47. //! Updates the 2D display zoom
  48. virtual void update2DDisplayZoom(ccBBox& box);
  49. protected: //raster grid related stuff
  50. //! Show grid box editor and update
  51. /** \return whether the box was modified or not
  52. **/
  53. virtual bool showGridBoxEditor();
  54. //! Returns the grid size as a string
  55. virtual QString getGridSizeAsString() const;
  56. //! Returns the grid size
  57. virtual bool getGridSize(unsigned& width, unsigned& height) const;
  58. //! Creates the bounding-box editor
  59. void createBoundingBoxEditor(const ccBBox& gridBBox, QWidget* parent);
  60. //! Creates the 2D view
  61. void create2DView(QFrame* parentFrame);
  62. //! Returns the empty cell strategy (for a given combo-box)
  63. ccRasterGrid::EmptyCellFillOption getFillEmptyCellsStrategy(QComboBox* comboBox) const;
  64. //! Shortcut to ccRasterGrid::convertToCloud
  65. ccPointCloud* convertGridToCloud( bool exportHeightStats,
  66. bool exportSFStats,
  67. const std::vector<ccRasterGrid::ExportableFields>& exportedStatistics,
  68. bool projectSFs,
  69. bool projectColors,
  70. bool resampleInputCloudXY,
  71. bool resampleInputCloudZ, //only considered if resampleInputCloudXY is true!
  72. ccGenericPointCloud* inputCloud,
  73. double percentileValue,
  74. bool exportToOriginalCS,
  75. bool appendGridSizeToSFNames,
  76. ccProgressDialog* progressDialog = nullptr) const;
  77. protected: //members
  78. //! Raster grid
  79. ccRasterGrid m_grid;
  80. //! Associated dialog
  81. ccBoundingBoxEditorDlg* m_bbEditorDlg;
  82. //! 2D display
  83. ccGLWindowInterface* m_glWindow;
  84. //! 'Raster' cloud
  85. ccPointCloud* m_rasterCloud;
  86. };
  87. #endif //CC_2_5D_EDITOR_HEADER