ccBBox.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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_BBOX_HEADER
  18. #define CC_BBOX_HEADER
  19. //Local
  20. #include "ccDrawableObject.h"
  21. //CCCoreLib
  22. #include <BoundingBox.h>
  23. //! Bounding box structure
  24. /** Supports several operators such as addition (to a matrix or a vector) and
  25. multiplication (by a matrix or a scalar).
  26. **/
  27. class QCC_DB_LIB_API ccBBox : public CCCoreLib::BoundingBox
  28. {
  29. public:
  30. //! Default constructor
  31. ccBBox() : CCCoreLib::BoundingBox() {}
  32. //! Constructor from two vectors (lower min. and upper max. corners)
  33. ccBBox(const CCVector3& bbMinCorner, const CCVector3& bbMaxCorner, bool valid) : CCCoreLib::BoundingBox(bbMinCorner, bbMaxCorner, valid) {}
  34. //! Constructor from two vectors (lower min. and upper max. corners)
  35. ccBBox(const CCCoreLib::BoundingBox& bbox) : CCCoreLib::BoundingBox(bbox) {}
  36. //! Applies transformation to the bounding box
  37. const ccBBox operator * (const ccGLMatrix& mat);
  38. //! Applies transformation to the bounding box
  39. const ccBBox operator * (const ccGLMatrixd& mat);
  40. //! Draws bounding box (OpenGL)
  41. /** \param context OpenGL context
  42. * \param col (R,G,B) color
  43. **/
  44. void draw(CC_DRAW_CONTEXT& context, const ccColor::Rgb& col) const;
  45. };
  46. #endif //CC_BBOX_HEADER