// Approximator.h -- Analysis of 1D float value Mondrian scenes, // // // DESCRIPTION // // Copyright © Tim Bahls, Daniel Scharstien 2004. // /////////////////////////////////////////////////////////////////////////// // unknown float value #define UNKNOWN -9876 #define UNKNOWNF -9876.5f #define MAX 1234.5f #define MIN -1234.5f #ifndef WIN32 #define __max(a,b) (((a) > (b)) ? (a) : (b)) #define __min(a,b) (((a) < (b)) ? (a) : (b)) #endif #include "Scene.h" class CRegApprox { public: int id; // its own index int nFrames; float minVel; float maxVel; float minLen; float maxLen; float*minmin; //lowest possible value of left edge in each frame float*maxmin; //highest possible value of left edge in each frame float*minmax; //lowest possible value of right edge in each frame float*maxmax; //highest possible value of right edge in each frame int*xmins; //minimum seen value in each frame int*xmaxes; //maximum seen value in each frame int*leftIDs; //id of region to the left int*rightIDs;//id of region to the right // constructor CRegApprox(int id, int inFrames); CRegApprox(){} //default bool operator == (CRegApprox); bool limitV(int f1, int f2, float*minA, float*maxA); bool limitP(int f1, int f2, float*&minA, float*&maxA); bool restrictVel(); bool restrictLen(); bool restrictPosition(); inline bool max(float &a,float b){if(b>a){a=b; return true;}return false;} inline bool min(float &a,float b){if(b