- Timestamp:
- 02/22/07 16:17:24 (18 years ago)
- Location:
- GTP/trunk/Lib/Geom/shared/GTGeometry
- Files:
-
- 3 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 } -
GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoLodTreeLibrary.h
r1552 r2150 17 17 class IndexData; 18 18 class VertexData; 19 /// This class represents a tree object that is able to change its level of detail 20 /** It uses internally a LodStrips object to manage the level of detail of the trunk 21 The level of detail of the object initially is 1.0 (maximum quality) 22 */ 19 23 class LodTreeLibrary : public Geometry::LodObject 20 24 { 21 25 public: 26 /// Class constructor 27 /** Constructs an object from: 28 - LodStrips decimation info (for the trunk) 29 - LodTree simplification info (for the foliage) 30 - the Mesh containing the geometry of the tree 31 - a user-defined Geometry::IndexData instance */ 22 32 LodTreeLibrary( const LodStripsLibraryData *, 23 33 const TreeSimplificationSequence *, 24 34 Geometry::Mesh *treeGeoMesh, 25 35 Geometry::IndexData *user_indexdata); 36 37 /// Class destructor 26 38 ~LodTreeLibrary(void); 27 39 28 // funciones ya descritas en la API 29 /* uint32 GoToTrunkLod(uint32 newlod); 30 uint32 MinTrunkLod(void) const; 31 uint32 MaxTrunkLod(void) const; 32 uint32 GoToFoliageLod(uint32 newlod); 33 uint32 MinFoliageLod(void) const; 34 uint32 MaxFoliageLod(void) const;*/ 40 /// changes the lod of the entire object (trunk and leaves) 41 /** The value specified to chane the LOD must be in the range [0,1] ([min,max]) 42 After the LOD is calculated, this function automatically updates the indices 43 using the IndexData interface provided in the constructor. */ 44 virtual void GoToLod(Real); 35 45 46 /// changes the lod of the trunk 47 /** The value specified to chane the LOD must be in the range [0,1] ([min,max]) 48 After the LOD is calculated, this function automatically updates the indices 49 using the IndexData interface provided in the constructor.*/ 36 50 void GoToTrunkLod(Real); 51 52 /// changes the lod of the foliage 53 /** The value specified to chane the LOD must be in the range [0,1] ([min,max]) 54 After the LOD is calculated, this function automatically updates the indices 55 using the IndexData interface provided in the constructor.*/ 37 56 void GoToFoliageLod(Real); 38 57 39 // changes the lod of the entire object (trunk and leaves) 40 virtual void GoToLod(Real); 58 /// Retrieves the current real LOD factor of the object 41 59 virtual Real GetCurrentLodFactor(void) const { return (currentFoliageLodFactor+trunk->GetCurrentLodFactor())*0.5f; } 60 61 /// Retrieves a reference to the IndexData interface that manages the foliage, provided in the constructor 42 62 virtual Geometry::IndexData * GetIndexDataInterface(void){ return dataRetrievalInterface; } 43 63 44 // new proposed functions 45 // uint32 Get_Trunk_VertexCount(void) const; 46 // uint32 Get_Trunk_MaxIndexCount(uint32 istrip) const; 47 // uint32 CurrentLOD_Trunk_StripCount(void) const; 48 // uint32 CurrentLOD_Trunk_IndexCount(void) const; 49 // uint32 CurrentLOD_Trunk_IndexCountByStrip(uint32 istrip) const; 50 /* const VertexData* Get_Trunk_VertexData(void) const;*/ 51 const IndexData* CurrentLOD_Trunk_Indices(void) const; 64 /// Retrieves a reference to the IndexData interface that manages the trunk 65 const Geometry::IndexData* CurrentLOD_Trunk_Indices(void) const; 66 67 /// Retrieves the index count of the trunk at the current level of detail 68 /** The maximum number of indices that the trunk will use to be rendered */ 52 69 uint32 GetValidTrunkIndexCount(int isubmesh) const { return trunk->GetValidIndexCount(isubmesh); } 53 // uint32 GetValidTrunkOffset(int isubmesh) const { return trunk->GetValidOffset(isubmesh); }54 70 55 // uint32 Get_Foliage_VertexCount(void) const; 71 /// Gets the index count of the foliage at its maximum level of detail 72 /** The maximum number of indices that the foliage will use to be rendered */ 56 73 uint32 Get_Foliage_MaxIndexCount(void) const; 74 75 /// Retrieves the index count of the foliage at the current level of detail 57 76 uint32 CurrentLOD_Foliage_IndexCount(void) const; 58 const IndexData* CurrentLOD_Foliage_Indices(void) const; 59 const VertexData* Get_Foliage_VertexData(void) const; 77 78 79 80 // const IndexData* CurrentLOD_Foliage_Indices(void) const; 81 // const VertexData* Get_Foliage_VertexData(void) const; 82 83 /// Specifies which submesh of the Mesh (provided through the constructor) represents the foliage 84 /** The rest submeshes are considered as aprt of the trunk. 85 This function is useful because the foliage must be rendered with triangle lists and the 86 trunk must be rendered with triangle strips */ 60 87 uint32 GetLeavesSubMesh(void) const { return mLeavesSubMesh; } 61 88 -
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsLibrary.cpp
r2085 r2150 328 328 // Returns the number of triangles of the highest LOD. 329 329 //------------------------------------------------------------------------- 330 uint32 LodStripsLibrary::MaxFaces() 330 uint32 LodStripsLibrary::MaxFaces() const 331 331 { 332 332 /* uint32 number_of_faces; … … 355 355 // Returns the number of triangles of the lowest LOD. 356 356 //------------------------------------------------------------------------- 357 uint32 LodStripsLibrary::MinFaces() 357 uint32 LodStripsLibrary::MinFaces() const 358 358 { 359 359 /* uint32 current_lod;
Note: See TracChangeset
for help on using the changeset viewer.