ccGriddedTools.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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_GRIDDED_CLOUD_TOOLS_HEADER
  18. #define CC_GRIDDED_CLOUD_TOOLS_HEADER
  19. //Local
  20. #include "ccPointCloud.h"
  21. class ccGBLSensor;
  22. class ccGLMatrix;
  23. //! Tools dedicated to gridded clouds
  24. class QCC_DB_LIB_API ccGriddedTools
  25. {
  26. public:
  27. //! Grid (angular) parameters
  28. struct GridParameters
  29. {
  30. GridParameters()
  31. : minPhi(0)
  32. , maxPhi(0)
  33. , minTheta(0)
  34. , maxTheta(0)
  35. , deltaPhiRad(0)
  36. , deltaThetaRad(0)
  37. , maxRange(0)
  38. {}
  39. PointCoordinateType minPhi, maxPhi;
  40. PointCoordinateType minTheta, maxTheta;
  41. PointCoordinateType deltaPhiRad, deltaThetaRad;
  42. PointCoordinateType maxRange;
  43. };
  44. //! Detects the given grid parameters (angular span, etc.)
  45. /** \param cloud associated cloud
  46. \param grid scan grid
  47. \param parameters output parameters
  48. \param verbose whether the process should output some detailed information in the log/console or not
  49. \param cloudToSensorTrans transformation from cloud coordinate system to the sensor coordinate system (optional)
  50. \return success
  51. **/
  52. static bool DetectParameters( const ccPointCloud* cloud,
  53. const ccPointCloud::Grid::Shared grid,
  54. GridParameters& parameters,
  55. bool verbose = false,
  56. ccGLMatrix* cloudToSensorTrans = nullptr);
  57. //! Determines the (TLS) sensor parameters from the relative position of gridded points
  58. /** \param cloud cloud on which to compute the sensor parameters (should be a single grid)
  59. \param grid scan grid
  60. \param cloudToSensorTrans transformation from cloud coordinate system to the sensor coordinate system (optional)
  61. \return sensor (if successful) or 0 otherwise
  62. **/
  63. static ccGBLSensor* ComputeBestSensor( ccPointCloud* cloud,
  64. ccPointCloud::Grid::Shared grid,
  65. ccGLMatrix* cloudToSensorTrans = nullptr);
  66. };
  67. #endif