\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.5.1 - Kinetic Data Structures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
CGAL::Kinetic::Qt_widget_2< Simulator > Class Template Reference

#include <CGAL/Kinetic/IO/Qt_widget_2.h>

Definition

The class Kinetic::Qt_widget_2 implements a graphical interface for 2D kinetic data structures.

#include <CGAL/basic.h>
#include <CGAL/Kinetic/Exact_simulation_traits.h>
#include <CGAL/Kinetic/Delaunay_triangulation_2.h>
#include <CGAL/Kinetic/Delaunay_triangulation_vertex_base_2.h>
#include <CGAL/Kinetic/Delaunay_triangulation_recent_edges_visitor_2.h>
#include <CGAL/Kinetic/Enclosing_box_2.h>
#include <CGAL/Kinetic/IO/Qt_moving_points_2.h>
#include <CGAL/Kinetic/IO/Qt_triangulation_2.h>
#include <CGAL/Kinetic/IO/Qt_widget_2.h>
#include <CGAL/Kinetic/Insert_event.h>
int main(int argc, char *argv[])
{
typedef CGAL::Kinetic::Exact_simulation_traits Traits;
typedef CGAL::Triangulation_data_structure_2<
CGAL::Kinetic::Delaunay_triangulation_vertex_base_2<Traits::Instantaneous_kernel>,
// Color edges based on how recently they were created
// Keeps the points confined
CGAL_SET_LOG_LEVEL(CGAL::Log::LOTS);
// Run from time 0 until a really large value of time
Traits tr(0, 10000000);
Box::Handle box= new Box(tr);
KDel::Handle kdel= new KDel(tr);
Qt_gui::Handle qtsim= new Qt_gui(argc, argv, tr.simulator_handle());
Qt_mps::Handle qtmps= new Qt_mps(qtsim, tr);
Qt_triangulation::Handle qtdel= new Qt_triangulation(kdel, tr.instantaneous_kernel_object(), qtsim);
Traits::Kinetic_kernel::Point_2 p;
std::cin >> p;
tr.active_points_2_table_handle()->insert(p);
return qtsim->begin_event_loop();
}

Types

typedef unspecified_type Listener
 The listener base to listen for when to update the picture. More...
 

Creation

 Qt_widget_2 (int argc, char *argv[], Simulator::Handle)
 default constructor.
 

Member Typedef Documentation

template<typename Simulator >
typedef unspecified_type CGAL::Kinetic::Qt_widget_2< Simulator >::Listener

The listener base to listen for when to update the picture.

This class includes an extra method Qt_widget widget() which returns the Qt_widget object which can be used for drawing.