00001 ////////////////////////////////////////////////////////////////////// 00002 // 6/6/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_SubdivPlanarQuadM_H__3B8C720A_3269_439D_B67D_27B68936C7E8__INCLUDED_) 00020 #define AFX_SubdivPlanarQuadM_H__3B8C720A_3269_439D_B67D_27B68936C7E8__INCLUDED_ 00021 00022 #if _MSC_VER > 1000 00023 #pragma once 00024 #endif // _MSC_VER > 1000 00025 00026 #include "multiPrim.h" 00027 #include "../texCoordGen/scaleTexGen2D.h" 00028 00029 namespace glift { 00030 00031 ///////////////////////////////////////////////////////////////////////// 00032 /// 00033 /// SubdivPlanarQuadM.h: interface for the SubdivPlanarQuadM class. 00034 /// 00035 /// - A subdivided planar quad. 00036 /// - Currently 'primType' can ONLY be GL_QUAD_STRIP or GL_TRIANGLE_STRIP. 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 with a normal = <0,0,1> 00039 /// - If 'genTexCoords' is true, but no 'altTexGen' is given, the ScaleTexGen2D texCoord 00040 /// generator is used. The 'altTexGen' parameter is used for alternate tex coord generation. 00041 /// - Generates MULTIPLE primitives (hence the M in the name) 00042 /////////////////////////////////////////////////////////////////////// 00043 00044 class _export_ SubdivPlanarQuadM : public MultiPrim 00045 { 00046 public: 00047 SubdivPlanarQuadM( GLenum primType, const gutz::vec2i& subDiv, 00048 const gutz::vec2f& lowerLeft, const gutz::vec2f& upperRight, /// z=0.0 00049 bool genTexCoords=false, bool genNorms=false, 00050 TexCoordGen* altTexGen=NULL); 00051 00052 SubdivPlanarQuadM( GLenum primType, const gutz::vec2i& subDiv, 00053 const gutz::vec2f& lowerLeft, const gutz::vec2f& upperRight, float z=0.0f, 00054 bool genTexCoords=false, bool genNorms=false, 00055 TexCoordGen* altTexGen=NULL); 00056 00057 gutz::vec2f lowerLeft() const {return m_lowerLeft;} 00058 gutz::vec2f upperRight() const {return m_upperRight;} 00059 float z() const {return m_z;} 00060 gutz::vec2i subDiv() const {return m_subDiv;} 00061 00062 private: 00063 gutz::vec2f m_lowerLeft; 00064 gutz::vec2f m_upperRight; 00065 float m_z; 00066 gutz::vec2i m_subDiv; /// Number of subdivisions in each dimension 00067 00068 SubdivPlanarQuadM();/// Disallow default construction, copy, and assignment 00069 00070 VecSinglePrimP createStrips( GLenum primType, const gutz::vec2i& subDiv, const gutz::vec2f& lowerLeft, 00071 const gutz::vec2f& upperRight, float z, 00072 bool genTexCoords, bool genNorms, TexCoordGen* texGen ); 00073 }; 00074 00075 } /// End of namespace glift 00076 00077 #endif /// !defined(AFX_SubdivPlanarQuadM_H__3B8C720A_3269_439D_B67D_27B68936C7E8__INCLUDED_)