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

  1. /*
  2.  * ViewTransform.h - class definition general view transformation.
  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 ViewTransform_H
  19. # define ViewTransform_H
  20.  
  21. #include <iostream.h>
  22. #include "Vector.h"
  23. #include "TransMatrix.h"
  24. #include "BoundingBox.h"
  25.  
  26. //___________________________________________________________ ViewTransform
  27.  
  28. class ViewTransform
  29. {
  30. public:
  31.   ViewTransform(const Vector&, const Vector&, const Vector&, real, int, int);
  32.   ViewTransform(const BoundingBox&, const Vector&, real, int, int);
  33.  
  34.   Vector transformWorld2Screen(const Vector&);
  35.   Vector transformWorld2View(const Vector&);
  36.   Vector transformView2Screen(const Vector&);
  37.  
  38.   const Vector& getEye()    const { return eye; }
  39.   const Vector& getLookat() const { return lookat; }
  40.   const Vector& getUp()     const { return up; }
  41.   real getFov()             const { return fov; }
  42.   int getResX()             const { return resX; }
  43.   int getResY()             const { return resY; }
  44.   const TransMatrix& getViewmat() const { return viewmat; }
  45.  
  46.   friend ostream& operator<<(ostream&, const ViewTransform&);
  47.  
  48. private:
  49.   void buildView();
  50.  
  51.   TransMatrix viewmat;
  52.   Vector eye, lookat, up;
  53.   real fov;
  54.   int resX, resY;
  55.   real widthOfViewplane;
  56. };
  57.  
  58.  
  59. #endif // ViewTransform_H
  60.