How to use the Planar Map demo

This program demonstrates the use of planar maps with intersections and some other CGAL libraries. There are three kind of traits for planar maps: 1. segments planar map - consist only segments. 2. Polylines planar map - consist only polylines which are set of connected segments 3. Conics planar map - consist only conics which are a curve defined by (at most) two degree equation,e.g., segment, circle, ellipse, parabola and hyperbola.

### Choosing traits type for planar map

- Segments planar map
- Polylines planar map
- Conics planar map

### Editing

- Insert object
- Delete object
- Drag
- Point location
- Vertical ray shooting (up/down)
- Split
- Merge
- Lower/Upper envelope

### Snap Mode

- Snap to point
- Snap to grid

### Options

- Overlay
- Properties
- Show/Hide grid
- Unbounded edge (background) color
- Edge (planar map) color
- Vertex color
- Point location strategy

### File Handling

- File format
- Open special format file
- Open planar map file
- Save file

### Segments planar map

By default, this option is selected when starting the application. Press the "segment traits" button from the toolbar or go to the menu bar -> options -> segments traits.

### Polylines planar map

Press the "polyline traits" button from the toolbar or go to the menu bar -> options -> polyline traits.

### Conics planar map

Press the "conic traits" button from the toolbar or go to the menu bar -> options -> conic traits.

### Insert object

First, press the "Insert" button, the type of object that can be inserted depends on the selected traits type. Segments: left click the mouse to choose the source point, move the mouse to determine the segment and close it with another left click. Polyline: left click the mouse to choose the source point, keep on moving the mouse and left click to add another middle points, right click to close it. Conics: when the conic traits is selected there are five options of conic curves at the toolbar (segment, circle, ellipse, circle arc, 5 points arc) segments : circle: left click the mouse to choose the center, move the mouse to choose radius and left click to close it. Ellipse : the ellipse is obtained by an enclosing rectangle. left click the mouse to choose one corner and left click again to choose the opposite corner. Circle arc: choose three non-collinear points by left clicking on the mouse. 5 points arc: choose five points by left clicking with the mouse.

### Delete

Press the delete button and left click any object at the planar map to remove it.

### Drag

Press the "drag" button, left click any object while dragging it and release the mouse button to put it.

### Point location

Press the "point location" button, and left click on any point and face containing that point will be highlighted.

### Vertical ray shooting

Shooting direction (up/down) is determined by the button/menu item selected. Left click on any point at the planar map and a ray will be shot until hitting a curve or vertex and it will be highlighted.

### Split

Press the split button, choose a splitter segment (the same as with drawing segments) which intersects a curve at the planar map and at the intersection, a new vertex will be added, that is the edge will be split.

### Merge

Press the merge button, choose a subcurve that can be merged by left click, it will be painted red and stays red if its mergeable, and then choose another neighbor sub_curve that can be merged with it, and it will be painted green and the edge will be merged, that is the vertex between them will be removed. A right click on the mouse at any time will repaint the previous edges selected to edge color and cancel the current merge action.

### Lower/Upper envelope

Press the (lower/upper) envelope button, and the (lower/upper) envelope of the planar map will be highlighted.

### Snap to point

To allow both point and grid snap modes, press the snap mode button or go to menu bar -> Snap mode -> Snap Mode. By default the point snap mode is activated. Snap to point allows the user to use an existed planar map point in insertion of new curves and in the split operation.

### Snap to grid

After the Snap mode button was clicked (see explanation above), you can choose to use the grid snap mode by clicking the Grid Snap Mode button or go to menu bar -> Snap mode -> Grid Snap Mode. Snap to grid allows the user to use the grid points in insertion of new curves and in the split operation.

### Overlay

To overlay two or more planar maps, go to menu bar -> Options -> Overlay. A dialog box will open with a list of the current planar maps on the left side. Drag and drop the planar maps that you want to overlay to the right side and press OK. You can only overlay planar maps with the same traits, therefore, after you choose the first one, you can only choose planar maps of the same traits.

### Properties

To change the properties go to menu bar -> Options -> Properties.
The properties are:

- Height - window height.
- Width - window width.
- Line width - curves width.
- Scaling factor - determines the level of the zoom in/out operations.
- Display mode - allow choosing between different or uniform colors in overlay.
- Grid cube size - change the size of the grid.
- Remove curve mode - choose between delete the original curve or the chosen sub-curve.
- Vertex radius - change vertex size.
- Draw vertex not in intersection - allow to draw only the intersected vertices.

### Show/Hide grid

Allow to see the grid without using the grid snap mode.

### Unbounded face (background) color

Allow to choose different colors for the unbounded face (equivalent to the background).

### Edge (planar map) color

Allow to choose different colors for the edges (the planar map).

### Vertex color

Allow to choose different colors for the vertices

### Point location strategy

Allow to choose different strategies for point location. By default, "simple" is selected.

### File format

Files have two main formats:

- Planar map format (Arr) - describe all the planar map components.
- Special format (dat) - the demo knows to read curves in a special format.

### Open special format file

Go to menu bar -> File -> Open Segment/Polyline/Conic File, and load a suitable file.

### Open planar map file

Go to menu bar -> File -> Open Segment/Polyline Arr File, and load a suitable file. Opening of a conic/polyline Arr file is not supported yet.

### Save file

Go to menu bar -> File -> Save/Save as.

Last modified: 19/12/2007