Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

subdivide.C

Go to the documentation of this file.
00001 /**********************************************************************
00002  * subdivide.C:
00003  **********************************************************************/
00004 #include "std/config.H"
00005 #include "mi.H"
00006 #include "lmesh.H"
00007 
00008 int 
00009 main(int argc, char *argv[])
00010 {
00011    int num_levels = 1;
00012 
00013    if (argc == 2)
00014       num_levels = max(atoi(argv[1]), 0);
00015    else if(argc != 1) {
00016       err_msg("Usage: %s [ num_levels ] < mesh.sm > mesh-sub.sm", argv[0]);
00017       return 1;
00018    }
00019 
00020    LMESHptr mesh = LMESH::read_jot_stream(cin);
00021    if (!mesh || mesh->empty())
00022       return 1; // didn't work
00023    mesh->set_subdiv_loc_calc(new LoopLoc());
00024 
00025    if (Config::get_var_bool("JOT_PRINT_MESH")) {
00026       cerr << "input mesh:" << endl;
00027       mesh->print();
00028    }
00029 
00030    if (num_levels > 0)
00031       mesh->update_subdivision(num_levels);
00032 
00033    if (Config::get_var_bool("JOT_PRINT_MESH")) {
00034       cerr << "level " << num_levels << " mesh:" << endl;
00035       mesh->cur_mesh()->print();
00036    }
00037 
00038    mesh->cur_mesh()->write_stream(cout);
00039 
00040    return 0;
00041 }
00042 
00043 /* end of file subdivide.C */

Generated on Mon Sep 18 11:39:33 2006 for jot by  doxygen 1.4.4