1 | #ifndef __GEO_TREE_SIMP_SEQUENCE__
|
---|
2 | #define __GEO_TREE_SIMP_SEQUENCE__
|
---|
3 |
|
---|
4 | #include <string>
|
---|
5 | #include <vector>
|
---|
6 | #include "GeoBase.h"
|
---|
7 | #include "GeoSerializable.h"
|
---|
8 |
|
---|
9 | namespace Geometry
|
---|
10 | {
|
---|
11 | /// Represents the simplification sequence applied to a given mesh.
|
---|
12 | /** This class stores information about the simplification process, giving for each step the four triangles that compose the two leaves that will be collapsed
|
---|
13 | and the two triangles of the new leaf.
|
---|
14 | It also offers a method to generate a tree simplification sequence format file.
|
---|
15 | \n
|
---|
16 | This file begins with a line stating the name of the mesh file it refers to.
|
---|
17 |
|
---|
18 | This file stores the leaves geometry and at the end of the file one line for each leaf collapse operation. \n
|
---|
19 | \n
|
---|
20 | begin\n
|
---|
21 | v / vertex sequence
|
---|
22 | v\n
|
---|
23 | v
\n
|
---|
24 | f // faces sequence (two faces compose one leaf) including new faces\n
|
---|
25 | f // added due to the simplification process\n
|
---|
26 | f
\n
|
---|
27 | end\n
|
---|
28 | // one collapse record per line\n
|
---|
29 | \n
|
---|
30 | Those records gives the following information:\n
|
---|
31 |
|
---|
32 | -# The four triangles that compose the two leaves that will be collapsed.\n
|
---|
33 | -# & as a separator.\n
|
---|
34 | -# The two triangles for the new leaf.\n
|
---|
35 | .
|
---|
36 |
|
---|
37 | */
|
---|
38 | class TreeSimplificationSequence : public Serializable
|
---|
39 | {
|
---|
40 | public:
|
---|
41 | /// Class constructor
|
---|
42 | TreeSimplificationSequence(void);
|
---|
43 |
|
---|
44 | /// Class destructor
|
---|
45 | ~TreeSimplificationSequence(void);
|
---|
46 |
|
---|
47 | /// Copy constructor
|
---|
48 | //TreeSimplificationSequence(const TreeSimplificationSequence&);
|
---|
49 |
|
---|
50 | /// Assignment operator
|
---|
51 | //TreeSimplificationSequence& operator =(const TreeSimplificationSequence&);
|
---|
52 |
|
---|
53 | /// Represents a Simplification Step in the sequence.
|
---|
54 | struct Step
|
---|
55 | {
|
---|
56 | Index mV0, mV1;
|
---|
57 | Index mT0, mT1;
|
---|
58 | Index mNewQuad[4];
|
---|
59 | };
|
---|
60 |
|
---|
61 | /// Stores all the simplification steps.
|
---|
62 | std::vector<Step> mSteps;
|
---|
63 |
|
---|
64 | /// Loads a Simplification Sequence from a Serializer.
|
---|
65 | void Load(Serializer &s);
|
---|
66 |
|
---|
67 | /// Saves the contents of the data structures.
|
---|
68 | void Save(Serializer &s);
|
---|
69 |
|
---|
70 | char* meshName; // Nombre del mesh para guardar en el fichero de la secuencia de simplificación.
|
---|
71 | // 'Inserts the mesh name into the meshsimplificationsequence
|
---|
72 | void putMeshName(char *);
|
---|
73 | char *getMeshName(void);
|
---|
74 | };
|
---|
75 | }
|
---|
76 |
|
---|
77 | #endif |
---|