// file: examples/Apollonius_graph_2/example2.C #include // standard includes #include #include #include #if defined CGAL_USE_LEDA # include #elif defined CGAL_USE_CORE # include #endif #if defined CGAL_USE_LEDA || defined CGAL_USE_CORE # include #endif #if defined CGAL_USE_LEDA // If LEDA is present use leda_real as the exact number type for // Filtered_exact typedef CGAL::Filtered_exact NT; #elif defined CGAL_USE_CORE // Othwrwise if CORE is present use CORE's Expr as the exact number // type for Filtered_exact typedef CGAL::Filtered_exact NT; #else // Otherwise just use double. This may cause numerical errors but it // is still worth doing it to show how to define correctly the traits // class typedef double NT; #endif #include typedef CGAL::Simple_cartesian Kernel; // typedefs for the traits and the algorithm #include #include // the traits class is now going to assume that the operations // +,-,*,/ and sqrt are supported exactly typedef CGAL::Apollonius_graph_traits_2 Traits; typedef CGAL::Apollonius_graph_2 Apollonius_graph; int main() { std::ifstream ifs("data/sites.cin"); assert( ifs ); Apollonius_graph ag; Apollonius_graph::Site_2 site; // read the sites and insert them in the Apollonius graph while ( ifs >> site ) { ag.insert(site); } // validate the Apollonius graph assert( ag.is_valid(true, 1) ); std::cout << std::endl; return 0; }