Esempio n. 1
0
int main( int argc, char *argv[] ) {
  if ( argc >= 3 ) {
    std::cout << "usage: " << argv[0] << " [filename]" << std::endl;
  }

  ifstream ifs( (argc == 1) ? "data/sites2.cin" : argv[1] );
  assert( ifs );

  SDG2          sdg;
  SDG2::Site_2  site;

  // read the sites from the stream and insert them in the diagram
  while ( ifs >> site ) {
    sdg.insert( site );
  }

  ifs.close();

  //std::cout << "About to validate diagram ..." << std::endl;

  // validate the diagram
  //assert( sdg.is_valid(true, 1) );
  //cout << endl << endl;

  //std::cout << "Diagram validated." << std::endl;
  std::cout
     << "About to print sdg for input file: "
     << ((argc == 1) ? "data/sites2.cin" : argv[1])
     << std::endl ;

  sdg.file_output_verbose(std::cout);

  return 0;
}
int main( int argc, char *argv[] ) {
  if ( ! (( argc == 1 ) || (argc == 2)) ) {
    std::cout <<"usage: "<< argv[0] <<" [filename]\n";
  }

  ifstream ifs( (argc == 1) ? "data/sites2.cin" : argv[1] );
  assert( ifs );

  SDG2          sdg;
  SDG2::Site_2  site;

  // read the sites from the stream and insert them in the diagram
  while ( ifs >> site ) {
    sdg.insert( site );
    CGAL_SDG_DEBUG( sdg.file_output_verbose(std::cout); );
    CGAL_assertion( sdg.is_valid(false, 1) );
  }