6 #ifndef CNOID_UTIL_TRIANGULATOR_H_INCLUDED
7 #define CNOID_UTIL_TRIANGULATOR_H_INCLUDED
10 #include <boost/dynamic_bitset.hpp>
19 this->vertices = &vertices;
25 int apply(
const std::vector<int>& polygon);
38 enum Convexity { FLAT, CONVEX, CONCAVE };
41 const std::vector<int>* orgPolygon;
42 std::vector<int> triangles_;
43 std::vector<int> workPolygon;
45 boost::dynamic_bitset<> earMask;
47 inline const SFVec3f& vertex(
int localIndex){
48 return (*vertices)[(*orgPolygon)[localIndex]];
51 inline const SFVec3f& workVertex(
int workPolygonIndex){
52 return (*vertices)[(*orgPolygon)[workPolygon[workPolygonIndex]]];
55 Convexity calcConvexity(
int ear);
56 bool checkIfEarContainsOtherVertices(
int ear);