1 | #ifndef __GEO_MESH_SIMP_SEQUENCE__
|
---|
2 | #define __GEO_MESH_SIMP_SEQUENCE__
|
---|
3 |
|
---|
4 | #include <string>
|
---|
5 | #include <vector>
|
---|
6 | #include "GeoBase.h"
|
---|
7 | #include "GeoSerializable.h"
|
---|
8 | #include <iostream>
|
---|
9 | #include <fstream>
|
---|
10 |
|
---|
11 | namespace Geometry
|
---|
12 | {
|
---|
13 | /// Represents the simplification sequence applied to a given mesh.
|
---|
14 | /** This class stores information about the simplification process, giving for each step the vertex that collapses,
|
---|
15 | the vertex that remains unchanged, the two triangles that disappear and the new triangles that come out.
|
---|
16 | It also offers a method to generate a mesh simplification sequence format file.
|
---|
17 | \n
|
---|
18 | This file begins with a line stating the name of the mesh file it refers to.
|
---|
19 |
|
---|
20 | Every line gives the following information: \n
|
---|
21 | \n
|
---|
22 | -# Vertex that collapses. -> asumo mV0\n
|
---|
23 | -# Vertex that remains unchanged. -> asumo mV1\n
|
---|
24 | -# The two triangles that disappear.\n -> no tiene por qué ser 2 ??????
|
---|
25 | -# & as a separator.\n
|
---|
26 | -# The list of new triangles.\n
|
---|
27 | .
|
---|
28 | \n
|
---|
29 | */
|
---|
30 |
|
---|
31 | class MeshSimplificationSequence: public Serializable
|
---|
32 | {
|
---|
33 | public:
|
---|
34 |
|
---|
35 | /// Class constructor.
|
---|
36 | MeshSimplificationSequence(void);
|
---|
37 |
|
---|
38 | /// Class destructor.
|
---|
39 | ~MeshSimplificationSequence(void);
|
---|
40 |
|
---|
41 | /// Copy constructor
|
---|
42 | //MeshSimplificationSequence(const MeshSimplificationSequence&);
|
---|
43 |
|
---|
44 | /// Assignment operator
|
---|
45 | //MeshSimplificationSequence& operator =(const MeshSimplificationSequence&);
|
---|
46 |
|
---|
47 | /// Represents a simplification step in the sequence.
|
---|
48 | struct Step
|
---|
49 | {
|
---|
50 | Index mV0, mV1;
|
---|
51 | Index mT0, mT1;
|
---|
52 | float x,y,z;
|
---|
53 | std::vector<Index> mModfaces;
|
---|
54 |
|
---|
55 | // Indicates the the step is obligatory to execute
|
---|
56 | // joined width the following step.
|
---|
57 | unsigned int obligatorio;
|
---|
58 | };
|
---|
59 |
|
---|
60 | char* meshName; // Nombre del mesh para guardar en el fichero de la secuencia de simplificación.
|
---|
61 |
|
---|
62 | /// Stores all the simplification steps.
|
---|
63 | std::vector<Step> mSteps;
|
---|
64 |
|
---|
65 | /// Loads a simplification sequence from a Serializer.
|
---|
66 | void Load(Serializer &s);
|
---|
67 |
|
---|
68 | /// Saves the contents of the data structures.
|
---|
69 | void Save(Serializer &s);
|
---|
70 |
|
---|
71 | // 'Inserts the mesh name into the meshsimplificationsequence
|
---|
72 | void putMeshName(char *);
|
---|
73 |
|
---|
74 | char *getMeshName(void);
|
---|
75 | };
|
---|
76 | }
|
---|
77 |
|
---|
78 | #endif
|
---|