- Timestamp:
- 02/22/07 16:17:24 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoLodStripsLibrary.h
r1788 r2150 51 51 typedef std::vector <Long> LongVector; 52 52 53 /// LodStripsLibrary interface class. 53 54 class LodStripsLibraryData 55 { 56 public: 57 58 SmallIntVector mFileVertices; 59 std::vector <LODRegisterType> mFileChangesLOD; 60 LongVector mData; 61 std::vector<unsigned int> p_changes; 62 }; 63 64 /// The LodStripsLibrary interface class. 54 65 /** This module contains functions that handle the levels of detail 55 66 * of the input multiresolution objects made of polygonal meshes. … … 58 69 * that is, at the level of detail requested. These models use 59 70 * triangle strips to reduce storage usage and to speed up realistic 60 * rendering. 61 \n\n 62 63 Inputs:\n 64 - The module receives a file describing a multiresolution object. 65 . 66 67 Outputs:\n 68 - The module returns a strip set that represents the level of 69 detail requested. 70 . 71 72 */ 73 class LodStripsLibraryData 74 { 75 public: 76 77 SmallIntVector mFileVertices; 78 std::vector <LODRegisterType> mFileChangesLOD; 79 LongVector mData; 80 std::vector<unsigned int> p_changes; 81 }; 71 * rendering. */ 82 72 83 73 class GEOLODLIBRARYDLL_API LodStripsLibrary : public Geometry::LodObject … … 138 128 void LoadStripMesh(const LodStripsLibraryData *, Mesh *geomesh); 139 129 140 // Geometry::CREATEINDEXDATAFUNC create_index_data_func;141 142 130 // Strips vector. 143 131 SmallIntVector *mStrips; … … 159 147 public: 160 148 161 IndexData *GetIndexDataInterface(void) 149 /// Class constructor 150 /** Constructs a LodStrips multiresolution object from: 151 - The LodStrips decimation information (this can be obtained using the class Geometry::MeshLoader) 152 - The Mesh object defining the geometry of the model at its full level of detail (this can be obtained using the class Geometry::MeshLoader) 153 - a user-defined Geometry::IndexData instance 154 */ 155 LodStripsLibrary(const LodStripsLibraryData *, 156 Mesh *geomesh, 157 IndexData *userindexdata); 158 159 /// Class destructor. 160 ~LodStripsLibrary(void); 161 162 /// changes the level of detail of the object to a specified factor 163 /** The value specified to chane the LOD must be in the range [0,1] ([min,max]) 164 After the LOD is calculated, this function automatically updates the indices 165 using the IndexData interface provided in the constructor.*/ 166 virtual void GoToLod(Real); 167 168 /// Returns the number of triangles of the highest LOD. 169 uint32 MaxFaces() const; 170 171 /// Returns the number of triangles of the lowest LOD. 172 uint32 MinFaces() const; 173 174 /// Returns the index count at the current LOD of a certain submesh 175 uint32 GetValidIndexCount(int submeshid) const 176 { 177 return indices_x_submesh[submeshid]; 178 } 179 180 /// Retrieves the total number of strips of all submeshes 181 uint32 GetTotalStripCount(void) const 182 { 183 return mTotalStrips; 184 } 185 186 /// Returns the number of strips of a given submesh 187 uint32 GetSubMeshtripCount(int submeshid) const 188 { 189 return mStripsSubmesh[submeshid]; 190 } 191 192 /// Gets the triangle count at the current LOD 193 uint32 GetCurrentTriangleCount(void) const 194 { 195 return current_triangle_count; 196 } 197 198 /// Gets the current LOD factos 199 virtual Real GetCurrentLodFactor(void) const 200 { 201 return lodFactor; 202 } 203 204 // Retrieves the IndexData index interface 205 Geometry::IndexData *GetIndexDataInterface(void) const 162 206 { 163 207 return dataRetrievalInterface; 164 208 } 165 166 /** Constructor, receives as a parameter the name of the file 167 * including the multiresolution object. 168 */ 169 LodStripsLibrary( const LodStripsLibraryData *, 170 Mesh *geomesh, 171 IndexData *userindexdata = NULL); 172 173 /// Destructor. 174 ~LodStripsLibrary(void); 175 176 /// Returns de current LOD and changes to the specified LOD. 177 virtual void GoToLod(Real); 178 179 /// Establishes the new LOD range. 180 /// Only the LODs in that range are stored and used. 181 void TrimByLod(uint32, uint32); 182 183 /// Returns the number of triangles of the highest LOD. 184 uint32 MaxFaces(); 185 186 /// Returns the number of triangles of the lowest LOD. 187 uint32 MinFaces(); 188 189 /// Returns the number of vertices of the highest LOD. 190 uint32 MaxVertices(); 191 192 /// Returns the number of vertices of the lowest LOD. 193 uint32 MinVertices(); 194 195 uint32 GetValidIndexCount(int submeshid) const 196 { 197 return indices_x_submesh[submeshid]; 198 } 199 200 uint32 GetTotalStripCount(void) const 201 { 202 return mTotalStrips; 203 } 204 205 uint32 GetSubMeshtripCount(int submeshid) const 206 { 207 return mStripsSubmesh[submeshid]; 208 } 209 210 uint32 GetCurrentTriangleCount(void) const 211 { 212 return current_triangle_count; 213 } 214 215 virtual Real GetCurrentLodFactor(void) const 216 { 217 return lodFactor; 218 } 209 210 // deprecated functions 211 // void TrimByLod(uint32, uint32); 212 /* uint32 MaxVertices(); 213 uint32 MinVertices();*/ 219 214 }; 220 215 }
Note: See TracChangeset
for help on using the changeset viewer.