Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/Beta/3D/Sommet.hpp

Go to the documentation of this file.
00001 // Classe des sommets 3D en coordonnées homogènes.
00002 
00003 #ifndef __J2K__Sommet_HPP__
00004 #define __J2K__Sommet_HPP__
00005 
00006 #include <j2k/Fred/3d/Matrice44.hpp>
00007 #include <fstream.h>
00008 
00009 // Class Pre-declaration 
00010 class Pixel;
00011 class Sommet2D;
00012  class Sommet3D;
00013   class Sommet3DH;
00014 
00015 DefType(Pixel)
00016 DefType(Sommet2D)
00017 DefType(Sommet3D)
00018 DefType(Sommet3DH)
00019 
00020 //////////////////////////////////////////////////////////////////////////
00021 // Pixel class with Screen Coordonates.
00022 //////////////////////////////////////////////////////////////////////////
00023 class Pixel {
00024 public:
00025  long x, y;
00026 
00027  Pixel(): x( 0L ), y( 0L ) { }
00028  Pixel( long X, long Y  ) : x(  X  ), y(  Y  ) { }
00029  Pixel( const Pixel& p  ) : x( p.x ), y( p.y ) { }
00030 };
00031 
00032 //////////////////////////////////////////////////////////////////////////
00033 // Sommets 2D class
00034 //////////////////////////////////////////////////////////////////////////
00035 class Sommet2D {
00036 public:
00037  realtype x, y;
00038 
00039  Sommet2D(): x( 0.0 ), y( 0.0 ) { }
00040  Sommet2D( realtype X, realtype Y ) : x(  X  ), y(  Y  ) { }
00041  Sommet2D( const Sommet2D& s      ) : x( s.x ), y( s.y ) { }
00042 
00043  const Sommet2D& operator=( const Sommet2D& v );
00044 };
00045 
00046 //////////////////////////////////////////////////////////////////////////
00047 // Sommets 3D class
00048 //////////////////////////////////////////////////////////////////////////
00049 class Sommet3D : public Sommet2D {
00050 public:
00051  realtype z;
00052 
00053  Sommet3D() : z( 0.0 ) { }
00054  Sommet3D( realtype X,
00055            realtype Y,
00056            realtype Z ) : Sommet2D( X, Y ), z( Z ) { }
00057 
00058  Sommet3D( const Sommet3D& s ) : Sommet2D( s.x, s.y ), z( s.z ) { }
00059 
00060  const Sommet3D& operator=( const Sommet3D& v );
00061  const Sommet3D& operator=( const Sommet2D& v );
00062 };
00063 
00064 //////////////////////////////////////////////////////////////////////////
00065 // Sommets 3D class with homogeneous coordonates
00066 //////////////////////////////////////////////////////////////////////////
00067 class Sommet3DH : public Sommet3D {
00068 
00069 public:
00070  realtype  w;
00071 
00072  Sommet3DH() : w( 1.0 ) { }
00073 
00074  Sommet3DH( realtype X,
00075             realtype Y,
00076             realtype Z,
00077             realtype W ): Sommet3D( X, Y, Z ), w( W ) { }
00078 
00079  Sommet3DH( const Sommet3DH& s ) : Sommet3D( s.x, s.y, s.z ), w( s.w ) { }
00080 
00081  // Multiplication by a generic transformation matrix
00082  Sommet3DH& multiplyByMatrix( const Matrice44& m );
00083 
00084  const Sommet3DH& operator=(  const Sommet3DH& v );
00085  const Sommet3DH& operator=(  const Sommet3D&  v );
00086  const Sommet3DH& operator=(  const Sommet2D&  v );
00087 };
00088 
00089 // Read from a formated stream
00090 istream& operator>>( istream& in, const Pixel&     p );
00091 istream& operator>>( istream& in, const Sommet2D&  s );
00092 istream& operator>>( istream& in, const Sommet3D&  s );
00093 istream& operator>>( istream& in, const Sommet3DH& s );
00094 
00095 // Write to a formated stream
00096 ostream& operator<<( ostream& out, const Pixel&     p );
00097 ostream& operator<<( ostream& out, const Sommet2D&  s );
00098 ostream& operator<<( ostream& out, const Sommet3D&  s );
00099 ostream& operator<<( ostream& out, const Sommet3DH& s );
00100 
00101 #endif
00102 

Generated on Sun Oct 14 18:46:08 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001