| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /****************************************************************************** 00002 * VRS - The Virtual Rendering System 00003 * Copyright (C) 2003 Computer Graphics Systems Group at the 00004 * Hasso-Plattner-Institute (HPI), Potsdam, Germany. 00005 * 00006 * This library is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU Lesser General Public License as published by 00008 * the Free Software Foundation; either version 2.1 of the License, or (at 00009 * your option) any later version. This library is distributed in the hope 00010 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 00011 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Lesser General Public License for more details. You should have received 00013 * a copy of the GNU Lesser+ General Public License along with this library; if 00014 * not, write to the FreeSoftware Foundation, Inc., 59 Temple Place, Suite 330, 00015 * Boston, MA, 02111-1307, USA. 00016 ******************************************************************************/ 00017 00018 // $Id: vertexattributeindexgl.h 6058 2007-09-07 16:01:00Z Konstantin_Baumann $ 00019 // $Date: 2007-09-07 18:01:00 +0200 (Fri, 07 Sep 2007) $ 00020 // $Revision: 6058 $ 00021 // $State$ 00022 // $Author: Konstantin_Baumann $ 00023 // 00024 // $Log$ 00025 // Revision 1.8 2005/01/03 01:43:10 klimetschek 00026 // - modified win32 project layout, splitted vrs.vcproj into vrs_container, vrs_core, vrs_sg, vrs_image, vrs_opengl and vrs_io 00027 // - removed vrs.vcproj 00028 // minor things: 00029 // - added all glutexamples to vrs4glut.sln 00030 // - fixed some problems in glutexamples 00031 // - removed all project references from all VS projects (using solution wide project dependencies instead) 00032 // 00033 // Revision 1.7 2004/11/03 14:45:07 saar 00034 // Class comment changed (Doxygen style) 00035 // 00036 // Revision 1.6 2004/05/27 14:36:41 kirsch 00037 // in shape simplification loop, propagate bounding box of simplificated shape to simplified shape 00038 // 00039 // Revision 1.5 2004/05/27 13:16:28 kirsch 00040 // added clear() methods 00041 // 00042 // Revision 1.4 2004/03/12 16:28:41 baumann 00043 // macros VRS_NAMESPACE_BEGIN/_END expanded and removed 00044 // 00045 // Revision 1.3 2004/01/19 11:43:58 baumann 00046 // serialization mechanism improved 00047 // 00048 // Revision 1.2 2004/01/19 07:28:03 baumann 00049 // serialization mechanism improved 00050 // 00051 // Revision 1.1 2003/05/07 14:21:55 baumann 00052 // - class VertexAttributeSetGL renamed to VertexAttributeShapeGL 00053 // - class VertexAttributeMapSetGL renamed to MappedVertexAttributeShapeGL 00054 // - class VertexAttributeDataGL added, which is a VRS::Attribute storing vertex 00055 // attribute data in vertex arrays 00056 // - class VertexAttributeIndexGL added, which is a VRS::Shape that provides index 00057 // information for vertex attribute data stored in VertexAttributeDataGL objects 00058 // 00059 00060 #ifndef VRS_OPENGL_VERTEXATTRIBUTEINDEXGL_H 00061 #define VRS_OPENGL_VERTEXATTRIBUTEINDEXGL_H 00062 00063 #include <vrs/shape.h> 00064 #include <vrs/opengl/vertexattributebufferobjectgl.h> 00065 00066 namespace VRS { 00067 00068 class EngineGL; 00069 00072 class VRS_CORE_API VertexAttributeIndexGL : public Shape { 00073 00074 public: 00075 enum Type { INDEX, RANGE, PRIMITIVE, NOT_USED }; 00076 VRS_SERIALIZABLE_CLASS_ENUM(Type); 00078 00079 VertexAttributeIndexGL( 00080 GLenum primitiveType, // GL_TRIANGLES, GL_TRIANGLE_STRIP, ... 00081 const Bounds& bbox = Bounds(), 00082 Type type1 = NOT_USED, BaseVertexAttributeBufferObjectGL* object1 = NULL, 00083 Type type2 = NOT_USED, BaseVertexAttributeBufferObjectGL* object2 = NULL, 00084 Type type3 = NOT_USED, BaseVertexAttributeBufferObjectGL* object3 = NULL); 00086 00087 VertexAttributeIndexGL( 00088 const Bounds& bbox = Bounds(), 00089 Type type1 = NOT_USED, BaseVertexAttributeBufferObjectGL* object1 = NULL, 00090 Type type2 = NOT_USED, BaseVertexAttributeBufferObjectGL* object2 = NULL, 00091 Type type3 = NOT_USED, BaseVertexAttributeBufferObjectGL* object3 = NULL); 00093 00094 BaseVertexAttributeBufferObjectGL* getBufferObject(Type type) const; 00099 void setBufferObject(Type type, BaseVertexAttributeBufferObjectGL* object); 00103 GLenum getPrimitiveType() const; 00109 void setPrimitiveType(GLenum primitiveType); 00111 00112 void clear(); 00114 00117 UINT usedMemory() const; 00121 void setBoundingBox(const Bounds&); 00123 virtual Bounds boundingBox() const; 00125 00129 virtual SO<Iterator<Matrix> > getInstanceTransformationIterator() const; 00133 virtual void setInstanceTransformationIterator(SO<Iterator<Matrix> > instanceTransforms); 00134 00135 VRS_TYPEINFO(VertexAttributeIndexGL, Shape); 00136 00137 private: 00138 SO<BaseVertexAttributeBufferObjectGL> bufferObjects_[NOT_USED]; 00139 Bounds bbox_; 00140 GLenum primitiveType_; 00141 SO<Iterator<Matrix> > m_instanceTransformations; 00142 }; 00143 00144 } // namespace VRS 00145 00146 #endif // VRS_OPENGL_VERTEXATTRIBUTEINDEXGL_H