TEST(Tiling, DISABLED_read_patches) { vector< shared_ptr<Patch> > cooked_patches; read_patches(cooked_patches, "cooker_patches_100"); set_color(cooked_patches); for (auto it = cooked_patches.begin() + 6; it != cooked_patches.begin() + 11; ++it) { /*if ((*it)->motions.size() > 4) { patches.push_back(*it); break; }*/ //if ((*it)->motions.size() < 2) { vector< shared_ptr<Patch> > patches; patches.push_back(*it); PatchesViewer * v = new PatchesViewer(patches); v->get_camera().distance += 2; //} } // int count_ = 0; // for (auto it = cooked_patches.begin(); it != cooked_patches.end(); ++it) { ///*if ((*it)->motions.size() > 4) { // patches.push_back(*it); // break; //}*/ //if ((*it)->motions.size() < 2) { // if (count_++ > 4) break; // vector< shared_ptr<Patch> > patches; // patches.push_back(*it); // PatchesViewer * v = new PatchesViewer(patches); // v->get_camera().distance += 2; //} // } PatchesViewer * v = new PatchesViewer(cooked_patches); v->get_camera().distance += 2; }
TEST(CTiling, DISABLED_stitching) { vector< shared_ptr<Patch> > cooked_patches; read_patches(cooked_patches, "cooker_patches_25"); map<string,Patch> patch_types; for (auto it = cooked_patches.begin(); it != cooked_patches.end(); ++it) { patch_types[(*it)->name] = (**it); } Env env; env.set_scatter_range(-6, 6, -6, 6, 100, 700); Patch * seed = new Patch(*cooked_patches[5]); env.put_center(*seed); vector< shared_ptr<Patch> > patches; patches.push_back(shared_ptr<Patch>(seed)); char patch_size [128] = "15"; if (!stitch_patches(patches, atoi(patch_size), patch_types, env)) { cout << "Dead End Scene" << endl; } set_color(patches); DontSlip noslipfoot(18, 19, 24, 3, 4, 20); for (auto it = patches.begin(); it != patches.end(); ++it) noslipfoot.hold_foot(**it); PatchesViewer * v = new PatchesViewer(patches, env); v->get_camera().distance += 2; }
int show_range_diff(const char *range1, const char *range2, int creation_factor, struct diff_options *diffopt) { int res = 0; struct string_list branch1 = STRING_LIST_INIT_DUP; struct string_list branch2 = STRING_LIST_INIT_DUP; if (read_patches(range1, &branch1)) res = error(_("could not parse log for '%s'"), range1); if (!res && read_patches(range2, &branch2)) res = error(_("could not parse log for '%s'"), range2); if (!res) { find_exact_matches(&branch1, &branch2); get_correspondences(&branch1, &branch2, creation_factor); output(&branch1, &branch2, diffopt); } string_list_clear(&branch1, 1); string_list_clear(&branch2, 1); return res; }
TEST(CTiling, DISABLED_patchView) { vector< shared_ptr<Patch> > cooked_patches; //read_patches(cooked_patches, "hand_chicken"); read_patches(cooked_patches, "cooked_rawData_Hello_combi_3"); double offset = 0.0; for (auto it = cooked_patches.begin(); it != cooked_patches.end(); ) { /*if ((*it)->motions.size() == 1) { it = cooked_patches.erase(it); } else */ { (*it)->translate(cml::vector3(offset, 0., 0.)); ++it; offset += 7.0; } } DontSlip noslipfoot; for (auto it = cooked_patches.begin(); it != cooked_patches.end(); ++it) noslipfoot.hold_foot(**it); PatchesViewer * v = new PatchesViewer(cooked_patches); v->get_camera().distance += 2; }
//TEST(CTiling, tiling) TEST(CTiling, DISABLED_tiling) { vector<shared_ptr<Patch> > cooked_patches; //read_patches(cooked_patches, "hand_chicken"); //read_patches(cooked_patches, "cooked_rawData_chicken_combi_3"); //read_patches(cooked_patches, "cooked_rawData_dance_combi_4"); //read_patches(cooked_patches, "cooked_rawData_Hello_combi_3"); read_patches(cooked_patches, "cooked_rawData_dance_combi_3"); //read_patches(cooked_patches, "cooked_rawData_catchMe_combi_7"); vector<string> dNote; /* dNote.push_back("u3"); dNote.push_back("2");*/ remove_dangling_patch(cooked_patches, dNote); vector< shared_ptr<Patch> > patches; Env env; tiling_by_example(patches, env, cooked_patches, "general", 20); //if (false) { PatchesViewer * v = new PatchesViewer(patches, env); v->get_camera().distance += 2; vector<ml::Motion> view_m; convert_patch_to_motion(view_m, patches); DontSlip noslipfoot; for (auto it = view_m.begin(); it != view_m.end(); ++it) { noslipfoot.hold_foot(*it); } MotionsViewer * mv = new MotionsViewer(view_m); mv->get_camera().distance += 2; } if (false) { map<string, Patch> *patch_type = new map<string, Patch>(); get_patch(patch_type); vector< shared_ptr<Patch> > patch_type_vector; for (auto it = patch_type->begin(); it != patch_type->end(); ++it) { patch_type_vector.push_back(shared_ptr<Patch>(new Patch(it->second))); } vector< shared_ptr<Patch> > result_patches; Env env; tiling_by_example(result_patches, env, patch_type_vector, "dance", 2); /*DontSlip noslipfoot(18, 19, 24, 3, 4, 20); for (auto it = patches.begin(); it != patches.end(); ++it) noslipfoot.hold_foot(**it);*/ PatchesViewer * v = new PatchesViewer(result_patches, env); v->get_camera().distance += 2; } if (false) { double offset = 0.0; for (auto it = cooked_patches.begin(); it != cooked_patches.end(); ) { /*if ((*it)->motions.size() == 1) { it = cooked_patches.erase(it); } else */ { (*it)->translate(cml::vector3(offset, 0., 0.)); ++it; offset += 7.0; } } PatchesViewer * v = new PatchesViewer(cooked_patches); v->get_camera().distance += 2; } }