BoundingBox.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*!
  2. * \file BoundingBox.h
  3. * \brief
  4. * \author Gapchich Vladislav
  5. * \date 23/10/11
  6. */
  7. #ifndef __BOUNDINGBOX_H__
  8. #define __BOUNDINGBOX_H__
  9. #include "core/image/CoordT.h"
  10. namespace OBJREC
  11. {
  12. //! \brief Contains category ID, top left and bottom right points of the bounding
  13. //! box rectangle.
  14. class BoundingBox
  15. {
  16. public:
  17. BoundingBox();
  18. BoundingBox ( const BoundingBox &copy );
  19. ~BoundingBox();
  20. void setTopLeft ( const NICE::CoordT< int > &aTopLeft );
  21. void setTopLeft ( const int &x, const int &y );
  22. void setBottomRight ( const NICE::CoordT< int > &aBottomRight );
  23. void setBottomRight ( const int &x, const int &y );
  24. void setWidth ( const int &aWidth );
  25. void setHeight ( const int &aHeight );
  26. void setID ( const int &anID );
  27. NICE::CoordT< int > topLeft() const;
  28. NICE::CoordT< int > bottomRight() const;
  29. int width();
  30. int height();
  31. int id() const;
  32. bool isValid() const;
  33. void validate();
  34. private:
  35. NICE::CoordT< int > top_left_;
  36. NICE::CoordT< int > bottom_right_;
  37. /// id interpreted as a class label
  38. int id_;
  39. public:
  40. /// unique id that distinguishs this particular bounding box object from all others
  41. int unique_id_;
  42. };
  43. } //namespace
  44. #endif /* __BOUNDINGBOX_H__ */