ccEntityAction.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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: CloudCompare project #
  16. //# #
  17. //##########################################################################
  18. //qCC_db
  19. #include <ccMesh.h>
  20. #include <ccPointCloud.h>
  21. #include <ccPointCloudInterpolator.h>
  22. class QWidget;
  23. class ccMainAppInterface;
  24. namespace ccEntityAction
  25. {
  26. // Colours
  27. bool setColor(ccHObject::Container selectedEntities, bool colorize, QWidget* parent = nullptr);
  28. bool rgbToGreyScale(const ccHObject::Container &selectedEntities);
  29. bool setColorGradient(const ccHObject::Container &selectedEntities, QWidget* parent = nullptr);
  30. bool changeColorLevels(const ccHObject::Container &selectedEntities, QWidget* parent = nullptr);
  31. bool interpolateColors(const ccHObject::Container &selectedEntities, QWidget* parent = nullptr);
  32. bool convertTextureToColor(const ccHObject::Container& selectedEntities, QWidget* parent = nullptr);
  33. bool enhanceRGBWithIntensities(const ccHObject::Container &selectedEntities, QWidget* parent = nullptr);
  34. bool rgbGaussianFilter(const ccHObject::Container &selectedEntities, ccPointCloud::RgbFilterOptions filterParams, QWidget* parent = nullptr);
  35. // Scalar Fields
  36. bool sfGaussianFilter(const ccHObject::Container &selectedEntities, ccPointCloud::RgbFilterOptions filterParams, QWidget* parent = nullptr);
  37. bool sfConvertToRGB(const ccHObject::Container &selectedEntities, QWidget* parent = nullptr);
  38. bool sfConvertToRandomRGB(const ccHObject::Container &selectedEntities, QWidget* parent = nullptr);
  39. bool sfRename(const ccHObject::Container &selectedEntities, QWidget* parent = nullptr);
  40. bool sfAddIdField(const ccHObject::Container &selectedEntities, bool storeAsInt = false);
  41. bool sfSplitCloud(const ccHObject::Container &selectedEntities, ccMainAppInterface *app);
  42. bool sfSetAsCoord(ccHObject* entity, QWidget* parent = nullptr);
  43. bool sfSetAsCoord(const ccHObject::Container &selectedEntities, QWidget* parent = nullptr);
  44. bool exportCoordToSF(const ccHObject::Container &selectedEntities, QWidget* parent = nullptr);
  45. bool setSFsAsNormal(ccHObject* entity, QWidget* parent = nullptr);
  46. bool exportNormalToSF(const ccHObject::Container &selectedEntities, QWidget* parent = nullptr, bool* exportDimensions = nullptr);
  47. bool sfArithmetic(const ccHObject::Container &selectedEntities, QWidget* parent = nullptr);
  48. bool sfFromColor(const ccHObject::Container &selectedEntities, QWidget* parent = nullptr);
  49. bool sfFromColor(const ccHObject::Container &selectedEntities, bool exportR, bool exportG, bool exportB, bool exportAlpha, bool exportComposite);
  50. bool interpolateSFs(const ccHObject::Container &selectedEntities, ccMainAppInterface *parent);
  51. bool interpolateSFs(ccPointCloud *source, ccPointCloud *dst, int sfIndex, ccPointCloudInterpolator::Parameters& params, QWidget* parent = nullptr);
  52. bool sfAddConstant(ccPointCloud* cloud, QString sfName, bool integerValue, QWidget* parent = nullptr);
  53. bool processMeshSF(const ccHObject::Container &selectedEntities, ccMesh::MESH_SCALAR_FIELD_PROCESS process, QWidget* parent = nullptr);
  54. // Normals
  55. bool computeNormals(const ccHObject::Container &selectedEntities, QWidget* parent = nullptr);
  56. bool invertNormals(const ccHObject::Container &selectedEntities);
  57. bool orientNormalsFM(const ccHObject::Container &selectedEntities, QWidget* parent = nullptr);
  58. bool orientNormalsMST(const ccHObject::Container &selectedEntities, QWidget* parent = nullptr);
  59. //! Normals conversion destinations
  60. enum class NORMAL_CONVERSION_DEST {
  61. HSV_COLORS,
  62. DIP_DIR_SFS
  63. };
  64. //! Converts a cloud's normals
  65. bool convertNormalsTo(const ccHObject::Container &selectedEntities, NORMAL_CONVERSION_DEST dest);
  66. // Octrees
  67. bool computeOctree(const ccHObject::Container &selectedEntities, QWidget* parent = nullptr);
  68. // Properties
  69. enum class CLEAR_PROPERTY {
  70. COLORS = 0,
  71. NORMALS,
  72. CURRENT_SCALAR_FIELD,
  73. ALL_SCALAR_FIELDS
  74. };
  75. bool clearProperty(ccHObject::Container selectedEntities, CLEAR_PROPERTY property, QWidget* parent = nullptr);
  76. enum class TOGGLE_PROPERTY {
  77. ACTIVE = 0,
  78. VISIBLE,
  79. COLOR,
  80. NORMALS,
  81. SCALAR_FIELD,
  82. MATERIAL,
  83. NAME
  84. };
  85. bool toggleProperty(const ccHObject::Container &selectedEntities, TOGGLE_PROPERTY property);
  86. // Stats
  87. bool statisticalTest(const ccHObject::Container &selectedEntities, QWidget* parent = nullptr);
  88. bool computeStatParams(const ccHObject::Container &selectedEntities, QWidget* parent = nullptr);
  89. }