Next: An Example Low-Level Display
Up: GraphicDevice
Previous: The attribute Function
The most important methods on GraphicDevice are described at the
beginning of section 9.2.
- (GRAPHICDEVICE *) GRAPE(dev1, "copy")(dev2, name)
-
GRAPHICDEVICE *dev1, *dev2
char *name
This method copies the usual data (matrices etc.) of the graphic device
dev1 to dev2 if this is an instance. If dev2 is a
subclass (e.g. GraphicGt) of GraphicDevice a new instance
of this class will be created with the pointer dev2. The named
instance's return value is dev2.
- (int *) GRAPE(dev, "grid-patch")()
-
- (int *) GRAPE(dev, "global-grid-patch")()
-
- (int *) GRAPE(dev, "set-grid-patch")(mode)
-
- (int *) GRAPE(dev, "set-glbl-gr-ptch")(mode)
-
GRAPHICDEVICE *dev
int mode
Any graphic device has two different modes. If patches are display able
they will be displayed shaded with normals at the vertices or displayed
flat without normal information. Otherwise only wire frames are
displayed.
The current mode is hold in the device instance variable
grid_patch. The values are G_GRID for wire frames and
G_PATCH for patch models. The variable grid_patch may be
read. To change the mode use the method "grid-patch" which return
value is the new mode. An unconditional setting of the mode is done by
"set-grid-patch" and not by assignment at all.
If the global value global_grid_patch is set to G_GRID,
"set-grid-patch" will not switch to another mode then G_GRID.
This is because of the implementation of the GraphicDevice subclasses
which have no hardware 3D support: they will work very much faster if no
patches are drawn.
- GRAPE(dev, "get-pick-pos")(pickx, picky, pickkey)
-
GRAPHICDEVICE *dev
double *pickx, *picky
int *pickkey
The coordinates of the current mouse position in the actual graphic
device will be stored in *pickx and *picky in the range of
-1.0 and 1.0. *pickkey holds the actual mouse or keyboard event.
Unfortunately the values are coded in decimal.
The codes are:
If the mouse does not point into the graphic window pickkey is
set to zero, but pickx, picky have any values.
- (LAYER *)GRAPE(dev, "create-config")()
-
GRAPHICDEVICE *dev
Create a Layer for editing device specific values.
If this method is supplied by a subclass of GraphicDevice, one can
fine tune its settings.
- GRAPE(dev, "show-lights")()
-
GRAPHICDEVICE *dev
Display balls and arrows for the lightsources. This method is used by the
light menu option.
- GRAPE(dev, "supported")(display)
-
GRAPHICDEVICE *dev
char *display
Returns non NULL if the display described by display supports
this subclass of GraphicDevice. This does not work well with the class
GraphicGt, which is the reason why users of this class have to supply
environment strings for this purpose.
Next: An Example Low-Level Display
Up: GraphicDevice
Previous: The attribute Function
SFB 256 Universität Bonn and IAM Universität Freiburg Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik,
Universität Bonn.