Transform.hh

00001 /**********************************************************************
00002  * blaRAY -- photon mapper/raytracer
00003  * (C) 2008 by Tomasz bla Fortuna <bla@thera.be>, <bla@af.gliwice.pl>
00004  *
00005  * This program is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation, either version 3 of the License, or
00008  * any later version.
00009  *
00010  * See Docs/LICENSE
00011  *********************/
00012 
00013 #ifndef _TRANSFORM_H_
00014 #define _TRANSFORM_H_
00015 
00016 #include "Matrix.hh"
00017 
00018 namespace Math {
00019 
00030         class Transform : public Matrix {
00031         public:
00033                 enum Direction { ROT_X, ROT_Y, ROT_Z };
00034 
00036                 Transform();
00037 
00039                 Transform(const Matrix &M);
00040 
00043                 Transform(Double x, Double y, Double z);
00044 
00046                 Transform(Direction D, Double Angle);
00047 
00048                 void RotateX(Double Angle); 
00049                 void RotateY(Double Angle); 
00050                 void RotateZ(Double Angle); 
00053                 void Translate(Double x, Double y, Double z);
00054 
00056                 void Resize(Double x, Double y, Double z);
00057 
00058         };
00059 
00061         class Rotate {
00062         public:
00064                 inline static Transform X(Double Angle) {
00065                         return Transform(Transform::ROT_X, Angle);
00066                 }
00067 
00069                 inline static Transform Y(Double Angle) {
00070                         return Transform(Transform::ROT_Y, Angle);
00071                 }
00072 
00074                 inline static Transform Z(Double Angle) {
00075                         return Transform(Transform::ROT_Z, Angle);
00076                 }
00077         };
00078 
00083         class Translate : public Transform {
00084         public:
00086                 Translate(Double x, Double y, Double z) : Transform(x, y, z) {};
00087         };
00088 
00093         class Scale : public Transform {
00094         public:
00096                 Scale(Double x, Double y, Double z) : Transform()
00097                 {
00098                         Resize(x, y, z);
00099                 };
00100         };
00101 
00102 };
00103 
00104 #endif

Generated on Wed Mar 12 00:34:58 2008 for blaRAY by  doxygen 1.5.5