\ccAnchor{http://qt.nokia.com/}{Qt} is a {\sc Gui} toolkit for cross-platform application development. % +-----------------------------------------------------+ \section{Introduction} This chapter describes classes that help to visualize two dimensional \cgal\ objects with the \ccAnchor{http://doc.qt.nokia.com/latest/graphicsview.html}{Qt Graphics View Framework}. This framework uses the model view paradigm. \ccAnchor{http://doc.qt.nokia.com/latest/qgraphicsitem.html}{\ccc{QGraphicsItem}}s are stored in a \ccAnchor{http://doc.qt.nokia.com/latest/qgraphicsscene.html}{\ccc{QGraphicsScene}} and are displayed in a \ccAnchor{http://doc.qt.nokia.com/latest/qgraphicsview.html}{\ccc{QGraphicsView}}. The items have a paint method which is called when an item is in the visible area of a view. The framework is also responsible for dispatching events from the view via the scene to the items. The framework is extensible in the sense that users can add classes derived from \ccc{QGraphicsItem}. Besides visualizing \ccc{QGraphicsItem}s users want to enter geometric objects. We provide the input generators for all 2D \cgal\ kernel objects. The package includes also a class for providing zooming, panning, and scrolling to the graphics view. The following sections describe the interaction between all these classes, We finally describe the internals of a \ccc{QGraphicsItem}. \subsection{Naming Conventions} As Qt and \cgal\ have different naming conventions, and as this package brings them together we adopted the following, hybrid naming conventions. \begin{itemize} \item All header files are in the directory \ccc{CGAL/Qt/}. \item Class names are concatenated capitalized words, and function names are concatenated capitalized word with the first word in lowercase. The rationale is that these classes are related to Qt, and that they sometimes are derived classes that have to override member functions adhering to this naming scheme. \item All classes are in the nested namespace \ccc{CGAL::Qt}. \end{itemize} \section{Overall Design} In Figure~\ref{graphicsview:uml} you see four classes depicted in grey, that come from the Qt Graphics View Framework. The \ccAnchor{http://doc.qt.nokia.com/latest/qgraphicsscene.html}{\ccc{QGraphicsScene}} contains \ccAnchor{http://doc.qt.nokia.com/latest/qgraphicsitem.html}{\ccc{QGraphicsItem}}s, which get displayed in any number of \ccAnchor{http://doc.qt.nokia.com/latest/qgraphicsview.html}{\ccc{QGraphicsView}}s. The views are widgets, that is they take screen space in an application. The fourth class is the \ccAnchor{http://doc.qt.nokia.com/latest/qobject.html}{\ccc{QObject}}. It plays an important role in Qt for event handling and memory management. First, it allows to add \ccAnchor{http://doc.qt.nokia.com/latest/signalsandslots.html}{signals and slots}, and to connect them. Second, it allows to install \ccAnchor{http://doc.qt.nokia.com/latest/eventsandfilters.html}{event filters}. \begin{figure}[t] \begin{ccTexOnly} \begin{center} \includegraphics[width=0.95\linewidth]{GraphicsView/uml-design} \end{center} \end{ccTexOnly} \begin{ccHtmlOnly}