| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /****************************************************************************** 00002 * VRS - The Virtual Rendering System 00003 * Copyright (C) 2000-2004 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: batchgeometrygl.h 6014 2007-08-09 07:51:16Z Konstantin_Baumann $ 00019 // 00020 // $Log$ 00021 // Revision 1.2 2005/01/03 01:43:09 klimetschek 00022 // - modified win32 project layout, splitted vrs.vcproj into vrs_container, vrs_core, vrs_sg, vrs_image, vrs_opengl and vrs_io 00023 // - removed vrs.vcproj 00024 // minor things: 00025 // - added all glutexamples to vrs4glut.sln 00026 // - fixed some problems in glutexamples 00027 // - removed all project references from all VS projects (using solution wide project dependencies instead) 00028 // 00029 // Revision 1.1 2004/12/07 15:53:09 buchholz 00030 // new optimization class for overcoming PolygonSet overhead 00031 // 00032 00033 #ifndef VRS_OPENGL_BATCHGEOMETRYGL_H 00034 #define VRS_OPENGL_BATCHGEOMETRYGL_H 00035 00036 #include <vrs/opengl/bufferobjectgl.h> 00037 #include <vrs/shape.h> 00038 00039 namespace VRS { 00040 00041 class MappedVertexAttributeShapeGL; 00042 00049 class VRS_CORE_API BatchGeometryGL : public Shape { 00050 public: 00051 00053 BatchGeometryGL(); 00054 00066 SO<Iterator<unsigned int> > changeSubshapes( 00067 SO<Iterator<unsigned int> > shapesToRemove = NULL, 00068 SO<Iterator<SO<MappedVertexAttributeShapeGL> > > newShapes = NULL, 00069 BufferObjectGL::UsagePattern usagePattern = BufferObjectGL::STATIC_DRAW 00070 ); 00071 00073 SO<MappedVertexAttributeShapeGL> extractSubshapes( 00074 SO<Iterator<unsigned int> > subshapeNumbers, 00075 BufferObjectGL::UsagePattern usagePattern = BufferObjectGL::STATIC_DRAW 00076 ) const; 00077 00078 static const unsigned int InvalidIndex; 00079 00081 SO<MappedVertexAttributeShapeGL> getGeometry() const; 00082 00087 SO<Iterator<unsigned int> > getVertexOffsets() const; 00088 00090 SO<Iterator<unsigned int> > getIndexOffsets() const; 00091 00092 // Returns the number of combined subshapes 00093 unsigned int getNumberOfSubshapes() const; 00094 00108 static bool mergeable(SO<Iterator<SO<MappedVertexAttributeShapeGL> > > shapes, bool assertionMode = false); 00109 00112 bool insertable(SO<Iterator<SO<MappedVertexAttributeShapeGL> > > shapes, bool assertionMode = false); 00113 00116 static SO<MappedVertexAttributeShapeGL> merge( 00117 SO<Iterator<SO<MappedVertexAttributeShapeGL> > > shapes, 00118 BufferObjectGL::UsagePattern usagePattern = BufferObjectGL::STATIC_DRAW); 00119 00120 00123 unsigned int findSubshape(unsigned int primitiveNumber) const; 00124 00125 virtual Bounds boundingBox() const; 00126 00127 VRS_TYPEINFO(BatchGeometryGL, Shape); 00128 00129 private: 00130 00131 SO<MappedVertexAttributeShapeGL> shape_; 00132 SO<Iterator<unsigned int> > vertexOffsets_; 00133 SO<Iterator<unsigned int> > indexOffsets_; 00134 }; 00135 00136 } // namespace VRS 00137 00138 #endif // VRS_OPENGL_BATCHGEOMETRYGL_H 00139