| 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: scenegraphanalyzer.h 6352 2008-05-22 19:57:33 +0000 (Do, 22 Mai 2008) Henrik_Buchholz $ 00019 // $Date: 2008-05-22 19:57:33 +0000 (Do, 22 Mai 2008) $ 00020 // $Revision: 6352 $ 00021 // $State$ 00022 // $Author: Henrik_Buchholz $ 00023 // 00024 00025 #ifndef VRS_UNIQUETEXTUREMAPPING_H 00026 #define VRS_UNIQUETEXTUREMAPPING_H 00027 00028 #include <vrs/config.h> 00029 00030 namespace VRS { 00031 class PolygonSet; 00032 class ImageTexture2DGL; 00033 //class MipmapTexture2DGL; 00034 template<typename T> class Iterator; 00035 } 00036 00037 using VRS::SO; 00038 00039 namespace VRS { 00040 00041 class VRS_CORE_API UniqueTextureMapping { 00042 public: 00050 struct TexturedMeshComposite { 00051 SO<VRS::Iterator<SO<VRS::PolygonSet> > > geometries; 00052 SO<VRS::Iterator<SO<VRS::ImageTexture2DGL> > > textures; 00053 SO<VRS::Iterator<int> > inputMeshNums; 00054 }; 00055 00056 // Given a set of triangles (polygonset must contain exclusively triangles), this method creates 00057 // texture coordinates and a set of texture atlases in a way that each triangle has its own 00058 // texture space area. 00059 // 'texelPerUnit' indicates the desired texture resolution. 00060 // 'triangles' contains one or more PolygonSets. If multiple PolygonSets are passed, 00061 // this separation is preserved in the result, i.e., each PolygonSet of the 00062 // result will be a part of the input mesh indicated by the groupNumber. 00063 // This can be used to preserve the assignment to scene textures. 00064 // Note: If one or more meshes already contain texture coordinates for scene textures, 00065 // these are moved to texture iterator 2. 00066 static TexturedMeshComposite create( 00067 SO<VRS::Iterator<SO<VRS::PolygonSet> > > triangles, 00068 double texelPerUnit, 00069 int maxAtlasSize 00070 ); 00071 00072 static TexturedMeshComposite createWithoutTextures( 00073 SO<VRS::Iterator<SO<VRS::PolygonSet> > > triangles, 00074 double texelPerUnit, 00075 int maxAtlasSize 00076 ); 00077 }; 00078 00079 } 00080 00081 #endif // LDX_CORE_UNIQUETEXTUREMAPPING_H