void test_star_ellipse(int seed, int index, star_params const& par_p, star_params const& par_q, p_q_settings const& settings) { typedef bg::model::d2::point_xy<T> point_type; typedef bg::model::polygon<point_type, Clockwise, Closed> polygon; polygon p, q; make_star(p, par_p); make_star(q, par_q); std::ostringstream out; out << "rse_" << seed << "_" << index; test_overlay_p_q<polygon, T>(out.str(), p, q, settings); }
int main() { char buf[80]; struct sockaddr_in s_addr; int i, sock; if ((sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { fprintf(stderr, "Failed to create socket\n"); exit(1); } s_addr.sin_family = AF_INET; s_addr.sin_addr.s_addr = inet_addr("127.0.0.1"); s_addr.sin_port = htons(55443); if (connect(sock, (struct sockaddr *) &s_addr, sizeof(s_addr)) < 0) { fprintf(stderr, "Failed to connect socket\n"); exit(1); } sleep(1); make_star(buf, sock); return 0; }
void test_star_comb(int star_point_count, int comb_comb_count, double factor1, double factor2, bool do_union, p_q_settings const& settings) { Polygon star, comb; make_star(star, add<Polygon>, star_point_count, factor1, factor2); make_comb(comb, add<Polygon>, comb_comb_count); std::ostringstream out; out << "star_comb"; test_overlay_p_q < Polygon, typename bg::coordinate_type<Polygon>::type >(out.str(), star, comb, settings); }
void test_star(int count, int min_points, int max_points, T rotation, p_q_settings const& settings) { boost::timer t; typedef bg::model::d2::point_xy<T> point_type; typedef bg::model::polygon<point_type> polygon; int n = 0; for (int c = 0; c < count; c++) { for (int i = min_points; i <= max_points; i++) { std::ostringstream out; out << "_" << string_from_type<T>::name() << "_" << string_from_type<CalculationType>::name() << "_" << i << "_int"; polygon p; make_star(p, i * 2 + 1, 0.5, 1.0); polygon q; make_star(q, i * 2 + 1, 0.5, 1.0, rotation); if (! test_overlay_p_q < polygon, CalculationType >(out.str(), p, q, settings)) { return; } n++; } } std::cout << "polygons: " << n << " type: " << string_from_type<T>::name() << " time: " << t.elapsed() << std::endl; }
static SkScalar make_star_13(SkPath* path) { return make_star(path, 13); }
static SkScalar make_star_5(SkPath* path) { return make_star(path, 5); }