## OpenGL Domain Editor

The OpenGL editor basically works in the same way as the standard Java2D domain editor. The main difference is that it uses OpenGL to perform accelerated drawing operations on hardware supporting OpenGL. It features perspective rendering and elements are drawn filled, not outlined.

The mouse behaviour differs from the standard editor on the usage of the middle mouse button. In the OpenGL editor it is always used to translate the camera position, regardless of the mouse mode, while it's used to move all selected points in the standard editor.

All important mouse modes from the standard editor are also available in the OpenGL editor. Most of them work exactly the same way, while some mouse modes show slight differences in direct comparison. The two circle creation modes have been replaced by a single mode supporting both clockwise and anticlockwise (hold down SHIFT or CTRL) circles.

The OpenGL editor features two toolbars: One on the left containing all available mouse modes, and one on the top containing the other options and switches. Additional features are only accessible via the popup menu, which contains all available domain editor operations.

### Mesh refinement

The OpenGL editor features a new mesh refinement mode additionally to the default one. It does not work by allowing the user to select multiple elements and refining them independently from each other. Instead it works by pressing the hotkey CTRL-F or by choosing it from the popupmenu while the cursor is pointing on the point the user wants to refine around.

The following pictures show how the four quads around the selected point in the middle are refined by that operation. Two iterations are shown.

The method is not restricted to regular grids as shown in the following example:

### Mesh relaxation

Right now there are two different mesh relaxation operations available in the OpenGL editor: The umbrella operator and the laplace operator. The umbrella operator is exactly the same relaxation operator as used by the standard editor. It's advantage is that it keeps the neighboring edge's aspect ratios, avoiding interpenetrating elements.

The laplace operator relaxes the mesh by calculating the average position of all neighboring nodes for all selected nodes. The new position is then set to the middle between the node's old position and the average position of it's neighbors.