2D decorations for the OpenGL canvas.
A decoration is a 2-D drawing at canvas position x,y.
x,y : (int) window coordinates of the insertion point drawGL() : function that draws the decoration at (x,y).
This should only use openGL function that are allowed in a display list.
Create a decoration at canvas coordinates x,y
Decoration objects have the following methods:
A viewport decoration showing a text.
Create a text actor
GlutText objects have the following methods:
A viewport decoration showing a colorscale legend.
ColorLegend objects have the following methods:
A 2D-rectangle on the canvas.
Rectangle objects have the following methods:
A 2D-grid on the canvas.
Grid objects have the following methods:
A straight line on the canvas.
Line objects have the following methods:
A collection of straight lines on the canvas.
Initially a Line Drawing.
data can be a 2-plex Formex or equivalent coordinate data. The z-coordinates of the Formex are unused. A (n,2,2) shaped array will do as well.
LineDrawing objects have the following methods:
Functions defined in the module decors
- decors.drawDot(x, y)¶
- Draw a dot at canvas coordinates (x,y).
- decors.drawLine(x1, y1, x2, y2)¶
- Draw a straight line from (x1,y1) to (x2,y2) in canvas coordinates.
- decors.drawGrid(x1, y1, x2, y2, nx, ny)¶
Draw a rectangular grid of lines
The rectangle has (x1,y1) and and (x2,y2) as opposite corners. There are (nx,ny) subdivisions along the (x,y)-axis. So the grid has (nx+1) * (ny+1) lines. nx=ny=1 draws a rectangle. nx=0 draws 1 vertical line (at x1). nx=-1 draws no vertical lines. ny=0 draws 1 horizontal line (at y1). ny=-1 draws no horizontal lines.
- decors.drawRect(x1, y1, x2, y2)¶
- decors.drawRectangle(x1, y1, x2, y2, color)¶