ccOctreeProxy.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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_OCTREE_PROXY_HEADER
  18. #define CC_OCTREE_PROXY_HEADER
  19. //Local
  20. #include "ccHObject.h"
  21. //CCCoreLib
  22. #include <ccOctree.h>
  23. //! Octree structure proxy
  24. /** Implements ccHObject while holding a (shared) pointer on the octree instance (--> safer)
  25. **/
  26. class QCC_DB_LIB_API ccOctreeProxy : public ccHObject
  27. {
  28. public:
  29. //! Default constructor
  30. ccOctreeProxy(ccOctree::Shared octree = ccOctree::Shared(nullptr), QString name = "Octree");
  31. //! Destructor
  32. virtual ~ccOctreeProxy() = default;
  33. //! Sets the associated octree
  34. inline void setOctree(ccOctree::Shared octree) { m_octree = octree; }
  35. //! Returns the associated octree
  36. inline ccOctree::Shared getOctree() const { return m_octree; }
  37. //Inherited from ccHObject
  38. virtual CC_CLASS_ENUM getClassID() const override { return CC_TYPES::POINT_OCTREE; }
  39. virtual ccBBox getOwnBB(bool withGLFeatures = false) override;
  40. protected:
  41. //Inherited from ccHObject
  42. virtual void drawMeOnly(CC_DRAW_CONTEXT& context) override;
  43. protected: //members
  44. //! Associated octree
  45. ccOctree::Shared m_octree;
  46. };
  47. #endif //CC_OCTREE_PROXY_HEADER