home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Multimedia / k3d-setup-0.7.11.0.exe / include / k3d / k3dsdk / iprojection.h < prev    next >
C/C++ Source or Header  |  2008-11-07  |  3KB  |  103 lines

  1. #ifndef K3DSDK_IPROJECTION_H
  2. #define K3DSDK_IPROJECTION_H
  3.  
  4. // K-3D
  5. // Copyright (c) 1995-2004, Timothy M. Shead
  6. //
  7. // Contact: tshead@k-3d.com
  8. //
  9. // This program is free software; you can redistribute it and/or
  10. // modify it under the terms of the GNU General Public
  11. // License as published by the Free Software Foundation; either
  12. // version 2 of the License, or (at your option) any later version.
  13. //
  14. // This program is distributed in the hope that it will be useful,
  15. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  17. // General Public License for more details.
  18. //
  19. // You should have received a copy of the GNU General Public
  20. // License along with this program; if not, write to the Free Software
  21. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  22.  
  23. /** \file
  24.         \brief Declares abstract interfaces that encapsulate viewing projections
  25.         \author Tim Shead (tshead@k-3d.com)
  26. */
  27.  
  28. #include "k3d-platform-config.h"
  29.  
  30. #include "iunknown.h"
  31. #ifdef    K3D_API_WIN32
  32. #ifdef    near
  33. #undef    near
  34. #endif    // near
  35. #ifdef    far
  36. #undef    far
  37. #endif    // far
  38. #endif    // K3D_API_WIN32
  39.  
  40. namespace k3d
  41. {
  42.  
  43. // Forward declarations
  44. class iproperty;
  45.  
  46. /////////////////////////////////////////////////////////////////////////////
  47. // iprojection
  48.  
  49. /// Abstract interface encapsulating a 3D-to-2D viewing projection
  50. class iprojection :
  51.     public virtual k3d::iunknown
  52. {
  53. public:
  54.  
  55. protected:
  56.     iprojection() {}
  57.     iprojection(const iprojection&) {}
  58.     iprojection& operator=(const iprojection&) { return *this; }
  59.     virtual ~iprojection() {}
  60. };
  61.  
  62. /// Abstract interface encapsulating a standard perspective (truncated pyramid, or frustum) transformation
  63. class iperspective :
  64.     public iprojection
  65. {
  66. public:
  67.     virtual iproperty& left() = 0;
  68.     virtual iproperty& right() = 0;
  69.     virtual iproperty& top() = 0;
  70.     virtual iproperty& bottom() = 0;
  71.     virtual iproperty& near() = 0;
  72.     virtual iproperty& far() = 0;
  73.  
  74. protected:
  75.     iperspective() {}
  76.     iperspective(const iperspective&) {}
  77.     iperspective& operator=(const iperspective&) { return *this; }
  78.     virtual ~iperspective() {}
  79. };
  80.  
  81. /// Abstract interface encapsulating a standard orthographic transformation
  82. class iorthographic :
  83.     public iprojection
  84. {
  85. public:
  86.     virtual iproperty& left() = 0;
  87.     virtual iproperty& right() = 0;
  88.     virtual iproperty& top() = 0;
  89.     virtual iproperty& bottom() = 0;
  90.     virtual iproperty& near() = 0;
  91.     virtual iproperty& far() = 0;
  92.  
  93. protected:
  94.     iorthographic() {}
  95.     iorthographic(const iorthographic&) {}
  96.     iorthographic& operator=(const iorthographic&) { return *this; }
  97.     virtual ~iorthographic() {}
  98. };
  99.  
  100. } // namespace k3d
  101.  
  102. #endif // !K3DSDK_IPROJECTION_H
  103.