File: Kinetic_insert_event.cpp

package info (click to toggle)
cgal 4.0-5
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 65,068 kB
  • sloc: cpp: 500,870; ansic: 102,544; sh: 321; python: 92; makefile: 75; xml: 2
file content (38 lines) | stat: -rw-r--r-- 1,223 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#define CGAL_CHECK_EXPENSIVE
#define CGAL_CHECK_EXACTNESS

#include <CGAL/Kinetic/Sort.h>
#include <CGAL/Kinetic/Insert_event.h>
#include <CGAL/Kinetic/Exact_simulation_traits.h>

int main()
{

    typedef CGAL::Kinetic::Exact_simulation_traits Simulation_traits;
    typedef Simulation_traits::Kinetic_kernel::Point_1 Moving_point_1;
    typedef CGAL::Kinetic::Insert_event<Simulation_traits::Active_points_1_table> Insert_event;
    typedef CGAL::Kinetic::Sort<Simulation_traits> KDS;

    Simulation_traits tr(0, 10000.0);
    Simulation_traits::Simulator::Handle sp= tr.simulator_handle();

    KDS kds(tr);


    //CGAL_SET_LOG_LEVEL(CGAL::Kinetic::Log::LOTS);
    std::ifstream in("data/points_1");
    in >> *tr.active_points_1_table_handle();
    std::cout << *tr.active_points_1_table_handle();
    sp->new_event(Simulation_traits::Simulator::Time(3),
		  Insert_event(Moving_point_1(Moving_point_1::Coordinate(0)),
			       tr.active_points_1_table_handle()));

    while (sp->next_event_time()
    < sp->end_time()) {
        sp->set_current_event_number(sp->current_event_number()+10);
        std::cout << "At time " << sp->current_time() << ":\n";
        std::cout << kds;
    }

    return EXIT_SUCCESS;
}