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

Revision 1007, 2.2 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;
51                                Index   mV1;
52                                Index mT0;
53                                Index   mT1;
54                                float x;
55                                float   y;
56                                float   z;
57                               
58                                std::vector<Index>      mModfaces;
59
60                                //      Indicates the the step is obligatory to execute
61                                //      joined width the following step.
62                                unsigned int obligatorio;
63                        };
64
65                        // Name of mesh.
66                        char* meshName;
67
68                        /// Stores all the simplification steps.
69                        std::vector<Step> mSteps;
70
71                        /// Loads a simplification sequence from a Serializer.
72                        void Load(Serializer &s);
73
74                        /// Saves the contents of the data structures.
75                        void Save(Serializer &s);
76
77                        // 'Inserts the mesh name into the meshsimplificationsequence
78                        void putMeshName(char *);
79
80                        char *getMeshName(void);
81        };
82}
83
84#endif
85
Note: See TracBrowser for help on using the repository browser.