[774] | 1 | /* ==========================================================================
|
---|
| 2 | * (C) 2005 Universidad Jaime I de Castellón
|
---|
| 3 | * ==========================================================================
|
---|
| 4 | * PROYECT: GAME TOOLS
|
---|
| 5 | * ==========================================================================*/
|
---|
| 6 | /** CONTENT: Make triangle strips meshes from triangle list meshes.
|
---|
| 7 | *
|
---|
| 8 | *
|
---|
| 9 | * @file GeoMeshStripifier.h
|
---|
| 10 | /*===========================================================================*/
|
---|
| 11 |
|
---|
| 12 | #ifndef __GEO_STRIPIFIER__
|
---|
| 13 | #define __GEO_STRIPIFIER__
|
---|
| 14 |
|
---|
| 15 | #include <GeoMesh.h>
|
---|
| 16 |
|
---|
| 17 | namespace Geometry
|
---|
| 18 | {
|
---|
| 19 |
|
---|
| 20 | /// Stripifier interface class.
|
---|
| 21 | /** This module implements methods that extract triangle strips from triangle meshes.
|
---|
| 22 | \n
|
---|
| 23 |
|
---|
| 24 | Inputs:\n
|
---|
| 25 | - This module receives a pointer to a Geometry::Mesh object containing the model to be stripified.
|
---|
| 26 | .
|
---|
| 27 |
|
---|
| 28 | Outputs:\n
|
---|
| 29 | - The stripified mesh, contained also in a Geometry::Mesh object.
|
---|
| 30 | .
|
---|
| 31 |
|
---|
| 32 | */
|
---|
| 33 | class MeshStripifier
|
---|
| 34 | {
|
---|
| 35 | public:
|
---|
| 36 | /// Class constructor, receives as a parameter a const pointer to the object that describes a mesh.
|
---|
| 37 | MeshStripifier ();
|
---|
| 38 | MeshStripifier (const Geometry::Mesh *);
|
---|
| 39 |
|
---|
| 40 | /// virtual class destructor.
|
---|
| 41 | virtual ~MeshStripifier (void);
|
---|
| 42 |
|
---|
| 43 | /// Copy constructor
|
---|
| 44 | //MeshStripifier(const MeshStripifier&);
|
---|
| 45 |
|
---|
| 46 | /// Assignment operator
|
---|
| 47 | //MeshStripifier& operator =(const MeshStripifier&);
|
---|
| 48 |
|
---|
| 49 | /// Starts the stripification process. This is a pure virtual method and must be overloaded in a derived class that implements a stripification algorithm.
|
---|
| 50 | virtual int Stripify()=0;
|
---|
| 51 |
|
---|
| 52 | /// Returns the stripified mesh.
|
---|
| 53 | Mesh * GetMesh ();
|
---|
| 54 |
|
---|
[826] | 55 | // Sets what is the mesh that stores the leaves
|
---|
[841] | 56 | void setSubMeshLeaves(size_t);
|
---|
[826] | 57 |
|
---|
[774] | 58 | protected:
|
---|
| 59 |
|
---|
| 60 | // Progress bar function.
|
---|
| 61 | Geometry::TIPOFUNC mUPB;
|
---|
| 62 |
|
---|
| 63 | // Mesh object.
|
---|
| 64 | Geometry::Mesh *mGeoMesh;
|
---|
[826] | 65 |
|
---|
| 66 | // Index of the submesh leaves.
|
---|
[841] | 67 | size_t mSubMeshLeaves;
|
---|
[826] | 68 |
|
---|
[774] | 69 | };
|
---|
| 70 |
|
---|
| 71 | class CustomStripifier : public MeshStripifier
|
---|
| 72 | {
|
---|
| 73 | public:
|
---|
| 74 |
|
---|
| 75 | /// Class constructor, receives as a parameter a const pointer to the object that describes a mesh.
|
---|
| 76 | CustomStripifier();
|
---|
| 77 |
|
---|
| 78 | CustomStripifier( const Geometry::Mesh *geoMesh);
|
---|
| 79 |
|
---|
| 80 | /// Class destructor.
|
---|
| 81 | ~CustomStripifier(void);
|
---|
| 82 |
|
---|
| 83 | /// Copy constructor
|
---|
| 84 | //CustomStripifier(const CustomStripifier&);
|
---|
| 85 |
|
---|
| 86 | /// Assignment operator
|
---|
| 87 | //CustomStripifier& operator =(const CustomStripifier&);
|
---|
| 88 |
|
---|
| 89 | /// Starts the stripification process. This is a custom stripification method.
|
---|
| 90 | int Stripify();
|
---|
| 91 |
|
---|
| 92 | /// Returns the stripified mesh.
|
---|
| 93 | Mesh * GetMesh();
|
---|
| 94 |
|
---|
| 95 | // Set the progress bar function.
|
---|
| 96 | void SetProgressFunc(Geometry::TIPOFUNC upb);
|
---|
[826] | 97 |
|
---|
| 98 | // Sets what is the submesh that stores the leaves
|
---|
| 99 | void SetSubMeshLeaves(size_t submesh);
|
---|
[774] | 100 | };
|
---|
| 101 |
|
---|
| 102 | }
|
---|
| 103 |
|
---|
| 104 | #endif
|
---|
| 105 |
|
---|