ccContourLinesGenerator.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #pragma once
  2. //##########################################################################
  3. //# #
  4. //# CLOUDCOMPARE #
  5. //# #
  6. //# This program is free software; you can redistribute it and/or modify #
  7. //# it under the terms of the GNU General Public License as published by #
  8. //# the Free Software Foundation; version 2 or later of the License. #
  9. //# #
  10. //# This program is distributed in the hope that it will be useful, #
  11. //# but WITHOUT ANY WARRANTY; without even the implied warranty of #
  12. //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  13. //# GNU General Public License for more details. #
  14. //# #
  15. //# COPYRIGHT: EDF R&D / TELECOM ParisTech (ENST-TSI) #
  16. //# #
  17. //##########################################################################
  18. struct ccRasterGrid;
  19. class ccPolyline;
  20. class ccScalarField;
  21. class QWidget;
  22. //CCCoreLib
  23. #include <CCGeom.h>
  24. //system
  25. #include <vector>
  26. //! Contour lines generator
  27. class ccContourLinesGenerator
  28. {
  29. public:
  30. //! Contour lines generation parameters
  31. struct Parameters
  32. {
  33. double startAltitude = 0.0;
  34. double maxAltitude = 0.0;
  35. double step = 0.0; //gap between levels
  36. ccScalarField* altitudes = nullptr; //optional scalar field that stores the 'altitudes' (may be null, in which case the grid 'h' values are used directly)
  37. int minVertexCount = 3; //minimum number of vertices per contour line
  38. bool projectContourOnAltitudes = false;
  39. double emptyCellsValue = std::numeric_limits<double>::quiet_NaN();
  40. /* The parameters below are only required if GDAL is not required */
  41. QWidget* parentWidget = nullptr; //for progress dialog
  42. bool ignoreBorders = false;
  43. };
  44. //! Generates contour lines
  45. /** \warning contour lines are always generated in the XY plane
  46. **/
  47. static bool GenerateContourLines( ccRasterGrid* rasterGrid,
  48. const CCVector2d& gridMinCornerXY, //grid min corner (2D)
  49. const Parameters& params,
  50. std::vector<ccPolyline*>& contourLines);
  51. };