| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /********************************************************************** 00002 VRS - The Virtual Rendering System 00003 Copyright (C) 2001 Computer Graphics Systems Group at the 00004 Hasso-Plattner-Institute, Potsdam, Germany. 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 This library is distributed in the hope that it will be useful, but 00010 WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 See the GNU Lesser General Public License for more details. 00013 You should have received a copy of the GNU Lesser+ General Public 00014 License along with this library; if not, write to the FreeSoftware 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA, 02111-1307, USA. 00016 **********************************************************************/ 00017 // $Id: mesh.h 6159 2007-11-27 08:19:36Z Konstantin_Baumann $ 00018 // $Date: 2007-11-27 09:19:36 +0100 (Tue, 27 Nov 2007) $ 00019 // $Revision: 6159 $ 00020 // $State$ 00021 // $Author: Konstantin_Baumann $ 00022 // 00023 // $Log$ 00024 // Revision 1.26 2005/01/03 01:43:08 klimetschek 00025 // - modified win32 project layout, splitted vrs.vcproj into vrs_container, vrs_core, vrs_sg, vrs_image, vrs_opengl and vrs_io 00026 // - removed vrs.vcproj 00027 // minor things: 00028 // - added all glutexamples to vrs4glut.sln 00029 // - fixed some problems in glutexamples 00030 // - removed all project references from all VS projects (using solution wide project dependencies instead) 00031 // 00032 // Revision 1.25 2004/06/28 09:44:52 kirsch 00033 // changed mesh orientation 00034 // 00035 // Revision 1.24 2004/06/27 12:57:53 kirsch 00036 // forward included iterator 00037 // 00038 // Revision 1.23 2004/03/12 16:28:38 baumann 00039 // macros VRS_NAMESPACE_BEGIN/_END expanded and removed 00040 // 00041 // Revision 1.22 2004/01/19 11:43:57 baumann 00042 // serialization mechanism improved 00043 // 00044 // Revision 1.21 2003/11/07 14:19:24 kirsch 00045 // removed leading underscore from include guards 00046 // 00047 // Revision 1.20 2003/07/23 17:04:49 baumann 00048 // code cleanup (especially untabified) 00049 // 00050 // Revision 1.19 2003/05/21 10:23:42 baumann 00051 // changes due to iVRS 00052 // 00053 // Revision 1.18 2003/05/21 08:00:00 nienhaus 00054 // namespace changed for PrimitiveType 00055 // 00056 // Revision 1.17 2003/05/21 07:22:06 baumann 00057 // changes due to iVRS 00058 // 00059 // Revision 1.16 2003/05/19 14:09:17 kirsch 00060 // PolygonSet/Mesh contain per-vertex data now which have an abstract meaning 00061 // instead of being directly bound to hardware registers. The mapping to 00062 // the graphics hardware is done by the VertexAttributeMap attribute. 00063 // Mesh inherits from PolygonSet now 00064 // removed MeshSimplifier (handled by PolygonSetPainterGL now) 00065 // removed legacy rendering path in PolygonSetPainterGL (all Iterators are 00066 // now rendered as vertex arrays even if this means converting them first) 00067 // 00068 // Revision 1.15 2003/04/16 12:02:43 kirsch 00069 // allow construction of an empty mesh 00070 // 00071 // Revision 1.14 2003/04/15 13:03:44 kirsch 00072 // added 3 additional texture coord iterators to polygonset, lineset, 00073 // pointset and mesh 00074 // 00075 // Revision 1.13 2002/10/29 10:32:52 baumann 00076 // macros VRS_CLASSNAME_* and VRS_IMPL_TYPEINFO_* removed 00077 // 00078 // Revision 1.12 2002/03/06 13:25:35 kosta 00079 // classes Mesh and MeshSimplifier completely rewritten 00080 // 00081 // Revision 1.11 2002/03/05 20:21:23 kosta 00082 // mesh-interface cleaned up 00083 // 00084 // Revision 1.10 2002/03/04 11:08:34 kersting 00085 // directory structure changes 00086 // 00087 // Revision 1.9 2002/03/03 21:44:24 kosta 00088 // VRS_TYPEINFO-macro rewritten 00089 // 00090 // Revision 1.8 2002/02/19 10:34:09 kosta 00091 // undone all changes since 2002-02-15 00092 // 00093 // Revision 1.5 2002/02/05 07:48:25 kosta 00094 // new persistency macros: 00095 // VRS_SERIALIZABLE(CLASS_NAME); 00096 // VRS_SERIALIZABLE_ABSTRACT_CLASS(CLASS_NAME); 00097 // VRS_SERIALIZABLE_NO_SO_CLASS(CLASS_NAME) 00098 // 00099 // Revision 1.4 2002/02/04 13:07:19 kosta 00100 // VRS_SERIALIZABLE macros completely rewritten 00101 // 00102 // Revision 1.3 2002/01/15 16:25:54 kosta 00103 // macros rewritten for a better namespace support 00104 // 00105 // Revision 1.2 2001/11/13 16:36:30 kirsch 00106 // changed line feed to unix style (removed control-M) 00107 // 00108 // Revision 1.1.1.1 2001/06/08 08:09:20 kirsch 00109 // imported alpha-version by olli 00110 // 00111 00112 00113 #ifndef VRS_MESH_H 00114 #define VRS_MESH_H 00115 00116 #include <vrs/polygonset.h> 00117 #include <vrs/color.h> 00118 00119 namespace VRS { 00120 00121 template<class T> class Iterator; 00122 00123 class VRS_CORE_API Mesh : public PolygonSet { 00124 public: 00125 Mesh( 00126 unsigned int columns = 0, unsigned int rows = 0, 00127 Iterator<Vector>* vertexitr = 0, 00128 Iterator<Vector>* normalitr = 0, 00129 Iterator<Color>* coloritr = 0, 00130 Iterator<Vector>* texture0itr = 0, 00131 Iterator<Vector>* texture1itr = 0, 00132 Iterator<Vector>* texture2itr = 0, 00133 Iterator<Vector>* texture3itr = 0 00134 ); 00144 void setVertexIterator(unsigned int columns, unsigned int rows, Iterator<Vector>* iter); 00155 virtual void setType(PolygonSet::PrimitiveType primitiveType); 00158 virtual void setIndexIterator(Iterator<unsigned int>* iter); 00160 virtual void setRangeIterator(Iterator<unsigned int>* iter); 00162 virtual void setPrimitiveIterator(Iterator<PrimitiveType>* iter); 00164 00165 Iterator<Vector>* constructNormalIterator(bool wrapX, bool wrapY); 00171 unsigned int columns() const; 00173 unsigned int rows() const; 00175 00176 VRS_TYPEINFO(Mesh, PolygonSet); 00177 VRS_SERIALIZABLE(Mesh); 00178 00179 private: 00180 Iterator<unsigned int>* constructIndexIterator() const; 00181 00182 unsigned int columns_; 00183 unsigned int rows_; 00184 }; 00185 00186 } // namespace VRS 00187 00188 #endif // VRS_MESH_H