// Approx2D.h -- Analysis of 2D Mondrian scenes that can use float values. //Only a slight modification of Approximator, which is only a slight //modification of Deductor // // // DESCRIPTION // // Copyright © Timothy 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 CApprox2D; class CRegApprox2D { 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 CRegApprox2D(int id, const CApprox2D * master); CRegApprox2D(){} //default constructor void deleteOld(); bool operator == (CRegApprox2D); 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(int &a,int b){if(b>a){a=b; return true;}return false;} inline bool min(int &a,int b){if(ba){a=b; return true;}return false;} inline bool min(float &a,float b){if(b