use an element buffer for rendering
This commit is contained in:
30
src/util.h
30
src/util.h
@ -1,23 +1,39 @@
|
||||
#ifndef UTIL_H
|
||||
#define UTIL_H
|
||||
|
||||
#include "my_mesh.h"
|
||||
|
||||
|
||||
template <typename Mesh>
|
||||
class HalfedgeLoopRange {
|
||||
MyMesh &mesh;
|
||||
const HalfedgeHandle &start;
|
||||
Mesh &mesh;
|
||||
const typename Mesh::HalfedgeHandle &start;
|
||||
|
||||
public:
|
||||
HalfedgeLoopRange(MyMesh &mesh, const HalfedgeHandle &start)
|
||||
HalfedgeLoopRange(Mesh &mesh, const typename Mesh::HalfedgeHandle &start)
|
||||
:mesh(mesh), start(start) {}
|
||||
MyMesh::HalfedgeLoopIter begin() {
|
||||
typename Mesh::HalfedgeLoopIter begin() {
|
||||
return mesh.hl_begin(start);
|
||||
}
|
||||
MyMesh::HalfedgeLoopIter end() {
|
||||
typename Mesh::HalfedgeLoopIter end() {
|
||||
return mesh.hl_end(start);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename Mesh>
|
||||
class ConstHalfedgeLoopRange {
|
||||
Mesh &mesh;
|
||||
const typename Mesh::HalfedgeHandle &start;
|
||||
|
||||
public:
|
||||
ConstHalfedgeLoopRange(Mesh &mesh, const typename Mesh::HalfedgeHandle &start)
|
||||
:mesh(mesh), start(start) {}
|
||||
typename Mesh::HalfedgeLoopIter begin() {
|
||||
return mesh.chl_begin(start);
|
||||
}
|
||||
typename Mesh::HalfedgeLoopIter end() {
|
||||
return mesh.chl_end(start);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user