Refactoring mesh generation code.

This commit is contained in:
David Williams
2007-10-07 16:33:53 +00:00
parent 8137b1eb46
commit 52446c765d
9 changed files with 149 additions and 28 deletions

View File

@ -0,0 +1,26 @@
#ifndef __AbstractSurfacePatch_H__
#define __AbstractSurfacePatch_H__
#include "SurfaceTypes.h"
#include "Surfacevertex.h"
namespace Ogre
{
class AbstractSurfacePatch
{
public:
AbstractSurfacePatch();
virtual ~AbstractSurfacePatch();
SurfaceVertexIterator getVerticesBegin(void);
SurfaceVertexIterator getVerticesEnd(void);
virtual void addTriangle(const SurfaceVertex& v0,const SurfaceVertex& v1,const SurfaceVertex& v2) = 0;
virtual void fillVertexAndIndexData(std::vector<SurfaceVertex>& vecVertices, std::vector<ushort>& vecIndices) = 0;
protected:
std::set<SurfaceVertex> m_listVertices;
};
}
#endif /* __AbstractSurfacePatch_H__ */

View File

@ -1,5 +1,5 @@
#ifndef __SurfacePatch_H__
#define __SurfacePatch_H__
#ifndef __HalfEdgeSurfacePatch_H__
#define __HalfEdgeSurfacePatch_H__
#include <set>
#include <list>
@ -12,11 +12,11 @@
namespace Ogre
{
class SurfacePatch : public AbstractSurfacePatch
class HalfEdgeSurfacePatch : public AbstractSurfacePatch
{
public:
SurfacePatch();
~SurfacePatch();
HalfEdgeSurfacePatch();
~HalfEdgeSurfacePatch();
//This allow users of the class to iterate over its contents.
SurfaceEdgeIterator getEdgesBegin(void);
@ -51,4 +51,4 @@ namespace Ogre
};
}
#endif /* __SurfacePatch_H__ */
#endif /* __HalfEdgeSurfacePatch_H__ */

View File

@ -0,0 +1,29 @@
#ifndef __IndexedSurfacePatch_H__
#define __IndexedSurfacePatch_H__
#include <set>
#include <list>
#include "AbstractSurfacePatch.h"
#include "IntegralVector3.h"
#include "SurfaceTypes.h"
#include "VolumeIterator.h"
namespace Ogre
{
class IndexedSurfacePatch : public AbstractSurfacePatch
{
public:
IndexedSurfacePatch();
~IndexedSurfacePatch();
void addTriangle(const SurfaceVertex& v0,const SurfaceVertex& v1,const SurfaceVertex& v2);
void fillVertexAndIndexData(std::vector<SurfaceVertex>& vecVertices, std::vector<ushort>& vecIndices);
private:
std::vector<SurfaceVertexIterator> m_vecTriangleIndices;
};
}
#endif /* __IndexedSurfacePatch_H__ */