arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

planarQuad.h

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////
00002 // 6/7/02       Aaron Lefohn    Scientific Computing and Imaging Institute
00003 // School of Computing          University of Utah
00004 //
00005 //  This library is free software; you can redistribute it and/or
00006 //  modify it under the terms of the GNU Lesser General Public
00007 //  License as published by the Free Software Foundation; either
00008 //  version 2.1 of the License, or (at your option) any later version.
00009 //
00010 //  This library is distributed in the hope that it will be useful,
00011 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 //  Lesser General Public License for more details.
00014 //
00015 //  You should have received a copy of the GNU Lesser General Public
00016 //  License along with this library; if not, write to the Free Software
00017 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 #if !defined(AFX_PLANARQUAD_H__B5C3452B_60A0_4F40_BB84_19268F764CCC__INCLUDED_)
00020 #define AFX_PLANARQUAD_H__B5C3452B_60A0_4F40_BB84_19268F764CCC__INCLUDED_
00021 
00022 #if _MSC_VER > 1000
00023 #pragma once
00024 #endif // _MSC_VER > 1000
00025 
00026 #include "planarQuadZ.h"
00027 #include "../texCoordGen/quadTexGen.h"
00028 
00029 namespace glift {
00030 
00031 //////////////////////////////////////////////////////////////////////////
00032 ///
00033 /// planarQuad.h: interface for the PlanarQuad class.
00034 /// 
00035 /// - Defines the vertices and texture coordinates for a planar quad.
00036 /// - All members/methods are handled by 'SinglePrim' base class
00037 /// - Lowerleft and upperRight are assumed to be in the XY plane (only the x,y components are read). 
00038 ///   The quad is therefore always orthogonal to the Z axis. 
00039 /// - If 'genTexCoords' is true, but no 'altTexGen' is given, the 'QuadTexGen' texCoord
00040 ///   generator is used. The 'altTexGen' parameter is used for alternate tex coord generation.
00041 ///
00042 ///////////////////////////////////////////////////////////////////////
00043 
00044 class _export_ PlanarQuad : public PlanarQuadZ
00045 {
00046 public:
00047    PlanarQuad( const gutz::vec2f& lowerLeft, const gutz::vec2f& upperRight, /// z=0.0
00048       bool genTexCoords=false, bool genNorms=false, TexCoordGen* altTexGen=NULL);
00049 
00050    PlanarQuad( const gutz::vec2f& lowerLeft, const gutz::vec2f& upperRight, float z,
00051       bool genTexCoords=false, bool genNorms=false, TexCoordGen* altTexGen=NULL);
00052 
00053    virtual gutz::vec2f  lowerLeft()     const {return m_lowerLeft;}
00054    virtual gutz::vec2f  upperRight()    const {return m_upperRight;}
00055    virtual float                        z()                             const {return m_z;}
00056    virtual int                          numActivePatches() const {return 1;}
00057    virtual gutz::vec2i  subDiv()                const {return gutz::vec2i(1,1);}
00058 
00059 private:
00060    gutz::vec2f m_lowerLeft;
00061    float m_z;
00062    gutz::vec2f m_upperRight;
00063 
00064    PlanarQuad(); /// Disallow default construction
00065    gutz::arrayo2f setQuadVertPos( const gutz::vec2f& lowerLeft, const gutz::vec2f& upperRight, float z );
00066    gutz::arrayo2f setNorm();
00067 
00068    void init( const gutz::vec2f lowerLeft, const gutz::vec2f upperRight, float z,
00069       bool genTexCoords, bool genNorms, TexCoordGen* texGen );
00070 };
00071 
00072 } /// End of namespace glift
00073 
00074 #endif /// !defined(AFX_PLANARQUAD_H__B5C3452B_60A0_4F40_BB84_19268F764CCC__INCLUDED_)
00075 
00076 
00077 
00078 

Send questions, comments, and bug reports to:
jmk