#include <CGAL/IO/Window_stream.h>
The functionality described in this section is provided through LEDA or
the CGAL port of the LEDA window lib. The CGAL port has an interface
close to the LEDA window, but operations using LEDA geometry classes
were removed and the names of the used types and enums were changed from
leda_name to CGAL::name, leda_string
was replaced by std::string and leda_list was replaced
by std::list.
If the window port is used, the macro CGAL_USE_CGAL_WINDOW is
defined. The header file <CGAL/IO/cgal_window_redefine.h> offers
redefinitions of the LEDA names. If you use this file you should include
it after the inclusion of your other CGAL headers.
The CGAL port of the LEDA window lib can be downloaded for various platforms
from the CGAL web page. Note that Algorithmic Solutions Software GmbH
has offered us the possibility to provide the ported version of the LEDA
window.
An instance of type Window_stream is a two-dimensional window for graphical IO. The input and output operations perform a mapping from object coordinates to window coordinates. Actually, Window_stream is identical to the LEDA class leda_window, if LEDA is used and to the ported version of the LEDA window class, if LEDA is not used. Therefore, the rich functionality of leda_window is available on Window_stream as well, for example panels. In addition, the class Window_stream provides input and output operators for the classes which are defined in the CGAL kernel. Instances of Window_stream should be initialized with a coordinate frame (by calling member function init) and must be displayed (by calling member function display) before drawing.
For further information on leda_window, we refer to the LEDA manual.
| |
creates a squared window with maximal possible edge length
(minimum of width and height of the display).
| |
| |
creates a maximal squared window with frame label .
| |
| |
creates a window W of physical size width height pixels.
| |
| |
creates a window W of physical size width height pixels
and frame label label.
|
In addition, instances of type Window_stream can be created by the functions
|
| |||
creates a window of 512 512 pixels, sets the window label to CGAL, and initializes the object space that is mapped to the physical window to [-1.0, 1.0] [-1.0, 1.0]. Returns a pointer to the window created. | ||||
|
| |||
creates a window of 512 512 pixels, sets the window label to CGAL, initializes the object space that is mapped to the physical window to [-1.0, 1.0] [-1.0, 1.0] and displays it at default position on the display. Returns a pointer to the window created. | ||||
|
| |||
creates a window of width height pixels, sets the window label to str, and initializes the -range in object space that is mapped to the physical window by [-x_extension, x_extension]. The -range is initialized such that the origin is at the center of the window. Returns a pointer to the window created. | ||||
|
| |||
creates a window of width height pixels, sets the window label to str, and initializes the -range in object space that is mapped to the physical window by [-x_extension, x_extension]. The -range is initialized such that the origin is at the center of the window. The window is displayed at default position on the display. Returns a pointer to the window created. |
To display a window, the following functions can be used. Note that W.display() has to be called before all drawing operations on W and that all operations adding panel items to W have to be called before the first call of W.display().
|
| opens W and displays it at the default position, i.e. with its right upper corner in the upper right corner of the screen. |
|
| |
opens W and displays it with its left upper corner at position (x,y). | ||
|
| |
|
| |
opens W and displays it with its left upper corner at position (x,y) relative to the upper left corner of window W0. |
See the LEDA Manual [MNSU] for further operations on leda_window.
The output operator is defined for all geometric classes in the CGAL kernel.
|
| |
inserts object c into the stream W. | ||
|
| |
changes the foreground color for the next objects that will be inserted into W. |
Note that CGAL points are drawn using LEDA functions for drawing nodes of a graph. Before drawing points, the size for drawing nodes should be adjusted, either by calling member function set_node_width(int) or by
|
| |
sets a few default values for drawing in window w. In particular, node width is set to 3 and line width to 2. |
The input operator is defined for all geometric classes in the CGAL kernel. The coordinates of the geometric objects are in object space. Data are entered with the left mouse button.
|
| |
extracts object c from the stream W. |
3D objects can be used with Window_stream. The stream output operator << projects them to the -plane. The stream input operator >> sets the coordinate to zero.
#include <CGAL/IO/window_stream_xy_3.h>