source: GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoLodStripsConstructor.h @ 774

Revision 774, 3.9 KB checked in by gumbau, 18 years ago (diff)

GTGeometry and GeoTool? initial imports

Line 
1#ifndef __GEO_LODSTRIPS_CONSTRUCTOR__
2#define __GEO_LODSTRIPS_CONSTRUCTOR__
3
4#include <windows.h>
5#include "GeoMeshSimpSequence.h"
6#include "GeoMesh.h"
7#include "auxiliar.h"
8
9namespace Geometry
10{
11        /// Construction module for general multiresolution models.
12        /** This module stores general mesh multiresolution
13         *      representations using our own specific file format.
14         It takes as inputs the strips provided by the
15         stripification module and the edge collapse
16         sequence computed by the simplification module.
17         It builds a multiresolution representation and generates
18         a LODStrips file.\n
19
20         The LodStrips file begins with a line stating the name
21         of the mesh file it refers to.
22         This filetype has three different kinds of records
23         storing the information required for the multiresolution
24         model. All the records of the same kind are output following
25         the right order.
26
27         Those lines starting with a 'd' include:\n
28
29         -# Strip to modify.\n
30         -# Number of collapses.\n
31         -# Number of vertex repetitions.\n
32         -# Number of edge repetitions.\n
33         .
34         \n
35         Those beginning with a 'p' include the number of
36         strips affected by a LOD change.\n\n
37
38         And finally, the ones starting with a 'b' include
39         all the information needed for collapses and repetitions.
40         \n\n
41
42Inputs:\n
43- A strip set provided by the stripification module
44(Geometry::Mesh class).\n
45- An edge collapse sequence computed by
46the simplification module
47(Geometry::MeshSimplificationSequence class).
48
49Outputs:\n
50- The module writes a file with the LODStrips information.
51- It also writes the LODStrips mesh into a file.
52*/
53        class LodStripsConstructor : public Serializable
54        {
55                protected:
56
57                        int igual(Geometry::Vector3,Geometry::Vector3);
58                        int igual(Geometry::Vector2,Geometry::Vector2);
59
60                private:
61
62                        //      Lista de flyVectors, un flyVector tiene 4 componentes:
63                        //  x,y,z: coordenadas 3D del vertice
64                        //  w: se guarda el nº del vertice que simplifica a éste,
65                        //  el siguiente
66                        //      Lista que contiene el modelo en varias tiras y cada tira
67                        //      contiene la secuencia
68
69                        // de vertices que la forma
70                        uint32 MARCA; //Para delimitar el final de tira.
71                        uint32 TOTALTIRAS;
72                        uint32 TOTALVERTS;
73                        uint32 TOTALCAMBIOS;
74                        uint32 TOTALCARAS;
75                        uint32 MARCAVACIO;
76                        uint32 TOTALINDICES;
77
78                        Mesh    *geoMesh;
79                        const   Geometry::Mesh *meshoriginal;
80                        const   MeshSimplificationSequence *geoMeshSQ;
81                        int             NumVertsRepetidos;
82
83                        VECTORVERTEX                            cVerts;
84                        vector  <VECTORINT>     cStrips;
85
86                        VECTORINT *lStripsV;
87                        uint32 **vStrips;
88                        tipoVertice *vVerts;
89
90                        vector <tipoOrden> Ordenacion;
91
92                        uint32 *pCurrentData;
93                        uint32 *pCambios;
94                        LODData *vCambios;
95                        vector <LODData> cCambios;
96                        VECTORUNINT cDatos;
97                        uint32 *vDatos;
98
99                        //0: No test 1: plano  2: esfera
100                        //-------------------------------
101                        //Lods disponibles
102                        uint32 LodsDisp;
103
104                        void GenerarModeloCompleto(Geometry::TIPOFUNC   upb);
105
106                        void CalcularCambiosLODsVNuevaED(Geometry::TIPOFUNC     upb);
107
108                        void OrdenarModeloVQSLIM(Geometry::TIPOFUNC     upb);
109
110                        void GenerarModeloV(Geometry::TIPOFUNC  upb);
111
112                        void CopiarVectors2ArraysNUEVAED();
113
114                        void leeVerticesyTirasDeMesh();
115
116                public:
117
118                        /// Constructor, gets a stripified mesh
119                        //      and a simplification sequence,
120                        //      and generates the multiresolution model.
121                        LodStripsConstructor(   const Mesh                      *,
122                                        const MeshSimplificationSequence        *,
123                                        Geometry::TIPOFUNC                                                              upb);
124
125                        // Destructor
126                        ~LodStripsConstructor();
127
128                        /// Copy constructor
129                        //LodStripsConstructor(const LodStripsConstructor&);
130
131                        /// Assignment operator
132                        //LodStripsConstructor& operator =(const LodStripsConstructor&);
133
134                        /// Load
135                        void Load(Serializer &s);
136
137                        /// Saves the multiresolution model into a LODStrip file and the
138                        //      LODStrips mesh using the serializer given as a parameter.
139                        void Save (Serializer &s);
140
141                        ///     GetMesh: Return de current Mesh.
142                        Mesh    *       GetMesh();
143        };
144
145}
146
147#endif
148
Note: See TracBrowser for help on using the repository browser.