2010-10-05 17:51:17 +03:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "../src/cmph_types.h"
|
|
|
|
|
2010-09-10 10:07:06 +03:00
|
|
|
class TriGraph {
|
|
|
|
struct Edge {
|
2010-10-05 17:51:17 +03:00
|
|
|
Edge() { }
|
2010-09-10 10:07:06 +03:00
|
|
|
Edge(cmph_uint32 v0, cmph_uint32 v1, cmph_uint32 v2);
|
|
|
|
cmph_uint32 vertices[3];
|
|
|
|
};
|
|
|
|
struct ConnectedEdge {
|
|
|
|
Edge current;
|
|
|
|
Edge next;
|
|
|
|
};
|
|
|
|
|
|
|
|
TriGraph(cmph_uint32 nedges, cmph_uint32 nvertices);
|
2010-10-05 17:51:17 +03:00
|
|
|
void AddEdge(const Edge& edge);
|
2010-09-10 10:07:06 +03:00
|
|
|
void RemoveEdge(cmph_uint32 current_edge);
|
2010-10-05 17:51:17 +03:00
|
|
|
void ExtractEdgesAndClear(std::vector<ConnectedEdge>* edges);
|
2010-09-10 10:07:06 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
cmph_uint32 nedges_;
|
2010-10-05 17:51:17 +03:00
|
|
|
std::vector<ConnectedEdge> edges_;
|
|
|
|
std::vector<cmph_uint32> first_edge_;
|
|
|
|
std::vector<cmph_uint8> vertex_degree_;
|
2010-09-10 10:07:06 +03:00
|
|
|
};
|