2011-09-11 13:07:18 +04:00
|
|
|
#include "CGALCache.h"
|
|
|
|
#include "printutils.h"
|
|
|
|
#include "CGAL_Nef_polyhedron.h"
|
|
|
|
|
|
|
|
CGALCache *CGALCache::inst = NULL;
|
|
|
|
|
|
|
|
void CGALCache::insert(const std::string &id, const CGAL_Nef_polyhedron &N)
|
|
|
|
{
|
|
|
|
this->cache.insert(id, new CGAL_Nef_polyhedron(N), N.weight());
|
2011-12-26 22:15:51 +04:00
|
|
|
#ifdef DEBUG
|
2011-09-11 13:07:18 +04:00
|
|
|
PRINTF("CGAL Cache insert: %s (%d verts)", id.substr(0, 40).c_str(), N.weight());
|
2011-12-26 22:15:51 +04:00
|
|
|
#endif
|
2011-09-11 13:07:18 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void CGALCache::print()
|
|
|
|
{
|
|
|
|
PRINTF("CGAL Polyhedrons in cache: %d", this->cache.size());
|
|
|
|
PRINTF("Vertices in cache: %d", this->cache.totalCost());
|
|
|
|
}
|