#ifndef SAILSELECTION_H #define SAILSELECTION_H #include #include #include using namespace std; struct trapezoid { const int tws_min_thin; // TWS at top-left corner const int tws_min_deep; // TWS at bottom-left corner const int tws_max_thin; // TWS at top-right corner const int tws_max_deep; // TWS at bottom-right corner const int twa_min_thin; // TWA at top-left corner const int twa_min_deep; // TWA at top-right corner const int twa_max_thin; // TWA at bottom-left corner const int twa_max_deep; // TWA at bottom-right corner }; struct sail_zone { const string name; const string display_name; const trapezoid primary; const trapezoid overlap; const bool is_reef; }; struct sail_rec { string name; string display_name; string range; // "uprange", "downrange", or "" for reefs bool is_reef; friend ostream& operator<<(ostream& os, const sail_rec& r); }; class SSC { private: static const vector zones; string compute_range_tag(const sail_zone& z, double tws, double twa) const; string reef(double tws, double twa) const; public: vector lookup(double tws, double twa) const; }; #endif