home *** CD-ROM | disk | FTP | other *** search
/ Photo CD Demo 1 / Demo.bin / graphtal / bondngbx.h < prev    next >
C/C++ Source or Header  |  1992-10-19  |  1KB  |  50 lines

  1. /*
  2.  * BoundingBox.h - definition of class BoundingBox.
  3.  *
  4.  * Copyright (C) 1992, Christoph Streit (streit@iam.unibe.ch)
  5.  * All rights reserved.
  6.  *
  7.  * This software may be freely copied, modified, and redistributed
  8.  * provided that this copyright notice is preserved on all copies.
  9.  *
  10.  * You may not distribute this software, in whole or in part, as part of
  11.  * any commercial product without the express consent of the authors.
  12.  *
  13.  * There is no warranty or other guarantee of fitness of this software
  14.  * for any purpose.  It is provided solely "as is".
  15.  *
  16.  */
  17.  
  18. #ifndef BoundingBox_H
  19. # define BoundingBox_H
  20.  
  21. #include "Vector.h"
  22.  
  23. //___________________________________________________________ BoundingBox
  24.  
  25. class TransMatrix;
  26.  
  27. class BoundingBox
  28. {
  29. public:
  30.   BoundingBox();
  31.  
  32.   void expand(const Vector&);
  33.   void expand(const BoundingBox&);
  34.   BoundingBox transform(const TransMatrix&) const;
  35.   real xmin() const { return vmin[0]; }
  36.   real xmax() const { return vmax[0]; }
  37.   real ymin() const { return vmin[1]; }
  38.   real ymax() const { return vmax[1]; }
  39.   real zmin() const { return vmin[2]; }
  40.   real zmax() const { return vmax[2]; }
  41.  
  42.   friend ostream& operator<<(ostream&, const BoundingBox&);
  43.  
  44. private:
  45.   Vector vmin, vmax;
  46. };
  47.  
  48. #endif // BoundingBox
  49.  
  50.