source: GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoMeshSimpSequence.h @ 986

Revision 986, 2.1 KB checked in by gumbau, 18 years ago (diff)
Line 
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
11namespace 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                        // Name of mesh.
61                        char* meshName;
62
63                        /// Stores all the simplification steps.
64                        std::vector<Step> mSteps;
65
66                        /// Loads a simplification sequence from a Serializer.
67                        void Load(Serializer &s);
68
69                        /// Saves the contents of the data structures.
70                        void Save(Serializer &s);
71
72                        // 'Inserts the mesh name into the meshsimplificationsequence
73                        void putMeshName(char *);
74
75                        char *getMeshName(void);
76        };
77}
78
79#endif
Note: See TracBrowser for help on using the repository browser.