#ifndef GREEDYINSERT_INCLUDED // -*- C++ -*- #define GREEDYINSERT_INCLUDED #include "Heap.hpp" #include "Subdivision.hpp" #include "Map.hpp" class TrackedTriangle : public Triangle { // // candidate position int sx, sy; public: TrackedTriangle(Edge *e, int t=NOT_IN_HEAP) : Triangle(e, t) { } void update(Subdivision&); void setCandidate(int x,int y, real) { sx=x; sy=y; } void getCandidate(int *x, int *y) { *x=sx; *y=sy; } virtual real redo(void*); }; class Candidate { public: int x, y; real import; real factor; Candidate() { import = -HUGE; factor = 1.0f; } void consider(int sx, int sy, real i, real f) { if( i*f > import*factor ) { x = sx; y = sy; import = i; factor = f; } } }; class Array2OfByte { protected: int w, h; unsigned char *data; public: Array2OfByte() { data = NULL; w=0; h=0; } Array2OfByte(int i, int j) { init(i, j); } ~Array2OfByte() { if(data!=NULL) delete [] data; data = NULL; } void init(int i, int j, unsigned char set=0) { w=i; h=j; data = new unsigned char[w*h]; for(int a=0;a