Cities () : DataSet () { Load ("data/cities/geonames_cities5000.txt"); city_name = StrColumn (0); latitude = FloatColumn (1); longitude = FloatColumn (2); LoadShaders ("shaders/foggy.vert", "shaders/null.frag"); for (int64 i = 0 ; i < Count () ; i++) { Vect globe_position = LatLongToSphereSurface (GLOBE_RADIUS, latitude[i], longitude[i]); SetPointLocation (i, globe_position.x, globe_position.y, globe_position.z); // INFORM ( city_name[i] + ", " // + ToStr (longitude[i]) + ", " // + ToStr (latitude[i]) ); SetPointColor (i, HSB (0.12, 0.2, 1.0, 1.0)); SetPointSize (i, 2.0); } DataReady (); }
// 八对称性 void CIconOperate::_draw_circle_8(int xc, int yc, int x, int y,DWORD c) { SetPointColor(xc + x, yc + y, c); SetPointColor(xc - x, yc + y, c); SetPointColor(xc + x, yc - y, c); SetPointColor(xc - x, yc - y, c); SetPointColor(xc + y, yc + x, c); SetPointColor(xc - y, yc + x, c); SetPointColor(xc + y, yc - x, c); SetPointColor(xc - y, yc - x, c); }
/* perform layout repositions points */ void Component::performLayout(){ if(!shouldLayout()) return; //Layout SetPointPosition(0, 0, 0); SetPointPosition(1, GetWidth(), 0); SetPointPosition(2, GetWidth(), GetHeight()); SetPointPosition(3, 0, GetHeight()); //Color for(int point=0; point<GetNbPoints(); point++){ SetPointColor(point, GetColor()); SetPointOutlineColor(point, GetOutlineColor()); } //After layout is done m_shouldLayout = false; }
CountryBorders () : DataSet () { Load ("data/Tissot_indicatrix_world_map_equirectangular_proj_360x180_coords_cleaner2.txt"); // Interpret the 0th and 1th column in the data as floats, // and the 2th column as ints longitude = FloatColumn (0); latitude = FloatColumn (1); drawitude = IntColumn (2); LoadShaders ("shaders/foggy.vert", "shaders/null.frag"); for (int64 i = 4 ; i < Count () ; i++) { float64 mapped_longitude = Range (longitude[i], 0.0, 360.0, -180.0, 180.0) - 0.2; // todo: - .2 because the borders data is a tad off float64 mapped_latitude = Range (latitude[i], 0.0, 180.0, 90.0, -90.0) + 0.25; // todo: + .25 because the borders data is a tad off Vect globe_position = LatLongToSphereSurface (GLOBE_RADIUS - 0.5, mapped_latitude, mapped_longitude); SetPointLocation (i, globe_position.x, globe_position.y, globe_position.z); SetPointColor (i, HSB (0.5, 0.0, 0.2, 1.0 * drawitude[i])); } DataReady (); SetDrawMode (GL_LINE_STRIP); RotationAnimateChase (0.75); TranslationAnimateChase (0.25); }