Refactoring mesh generation code.
This commit is contained in:
26
include/AbstractSurfacePatch.h
Normal file
26
include/AbstractSurfacePatch.h
Normal 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__ */
|
@ -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__ */
|
||||
|
29
include/IndexedSurfacePatch.h
Normal file
29
include/IndexedSurfacePatch.h
Normal 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__ */
|
Reference in New Issue
Block a user