vcglib/apps/nexus/extraction.h

62 lines
1.1 KiB
C
Raw Normal View History

2005-01-14 16:41:10 +01:00
#ifndef NXS_EXTRACTION_H
#define NXS_EXTRACTION_H
#include "history.h"
#include <vector>
#include <wrap/gui/frustum.h>
namespace nxs {
class Metric;
class NexusMt;
class Extraction {
public:
struct HeapNode {
History::Node *node;
float error;
unsigned int extr;
unsigned int draw;
unsigned int disk;
HeapNode(History::Node *_node, float _error): node(_node), error(_error),
extr(0), draw(0), disk(0) {}
bool operator<(const HeapNode &node) const {
return error < node.error; }
};
Metric *metric;
vcg::Frustumf frustum;
float target_error;
unsigned int extr_used, extr_max;
unsigned int draw_used, draw_max;
unsigned int disk_used, disk_max;
std::vector<bool> visited;
std::vector<HeapNode> heap;
std::vector<unsigned int> selected;
Extraction();
~Extraction();
void Extract(NexusMt *mt);
// void Update(std::vector<unsigned int> &selected);
protected:
void Select();
void Visit(History::Node *node);
bool Expand(HeapNode &node);
void Diff(HeapNode &node);
private:
NexusMt *mt;
};
}//namespace
#endif