#ifndef __GEO_LODSTRIPS_CONSTRUCTOR__ #define __GEO_LODSTRIPS_CONSTRUCTOR__ #include #include "GeoMeshSimpSequence.h" #include "GeoMesh.h" #include "auxiliar.h" #include "Container.h" namespace Geometry { /// Construction module for general multiresolution models. /** This module stores general mesh multiresolution * representations using our own specific file format. It takes as inputs the strips provided by the stripification module and the edge collapse sequence computed by the simplification module. It builds a multiresolution representation and generates a LODStrips file.\n The LodStrips file begins with a line stating the name of the mesh file it refers to. This filetype has three different kinds of records storing the information required for the multiresolution model. All the records of the same kind are output following the right order. Those lines starting with a 'd' include:\n -# Strip to modify.\n -# Number of collapses.\n -# Number of vertex repetitions.\n -# Number of edge repetitions.\n . \n Those beginning with a 'p' include the number of strips affected by a LOD change.\n\n And finally, the ones starting with a 'b' include all the information needed for collapses and repetitions. \n\n Inputs:\n - A strip set provided by the stripification module (Geometry::Mesh class).\n - An edge collapse sequence computed by the simplification module (Geometry::MeshSimplificationSequence class). Outputs:\n - The module writes a file with the LODStrips information. - It also writes the LODStrips mesh into a file. */ class LodStripsConstructor : public Serializable { protected: int igual(Geometry::Vector3,Geometry::Vector3); int igual(Geometry::Vector2,Geometry::Vector2); private: // Lista de flyVectors, un flyVector tiene 4 componentes: // x,y,z: coordenadas 3D del vertice // w: se guarda el nº del vertice que simplifica a éste, // el siguiente // Lista que contiene el modelo en varias tiras y cada tira // contiene la secuencia // de vertices que la forma uint32 MARCA; //Para delimitar el final de tira. uint32 TOTALTIRAS; uint32 TOTALVERTS; uint32 TOTALCAMBIOS; uint32 TOTALCARAS; uint32 MARCAVACIO; uint32 TOTALINDICES; // Index of the submesh leaves. size_t mSubMeshLeaves; Mesh *mGeoMesh; Mesh *mInitialMesh; const Geometry::Mesh *meshoriginal; /*const */MeshSimplificationSequence *mGeoMeshSQ; int NumVertsRepetidos; std::vector cVerts; std::vector > cStrips; VECTORINT *lStripsV; uint32 **vStrips; tipoVertice *vVerts; std::vector Ordenacion; uint32 *pCurrentData; uint32 *pCambios; LODData *vCambios; //vector cCambios; std::vector cCambios; //VECTORUNINT cDatos; std::vector cDatos; uint32 *vDatos; //0: No test 1: plano 2: esfera //------------------------------- //Lods disponibles uint32 LodsDisp; void GenerarModeloCompleto(Geometry::TIPOFUNC upb); void CalcularCambiosLODsVNuevaED(Geometry::TIPOFUNC upb); void OrdenarModeloVQSLIM(Geometry::TIPOFUNC upb); void GenerarModeloV(Geometry::TIPOFUNC upb); void CopiarVectors2ArraysNUEVAED(); void leeVerticesyTirasDeMesh(); // Sort submesh bones. void sortBones(); public: /// Constructor, gets a stripified mesh // and a simplification sequence, // and generates the multiresolution model. LodStripsConstructor( const Mesh *, const MeshSimplificationSequence *, size_t submesh=-1, Geometry::TIPOFUNC upb=NULL); // Destructor ~LodStripsConstructor(); /// Copy constructor //LodStripsConstructor(const LodStripsConstructor&); /// Assignment operator //LodStripsConstructor& operator =(const LodStripsConstructor&); /// Load void Load(Serializer &s); /// Saves the multiresolution model into a LODStrip file and the // LODStrips mesh using the serializer given as a parameter. void Save (Serializer &s); /// GetMesh: Return de current Mesh. Mesh * GetMesh(); /// Sets what is the submesh that stores the leaves. void SetSubMeshLeaves(size_t submesh); }; } #endif