next up previous contents index
Next: Methods for Scene handling Up: Scenes - A Collection Previous: Scenes - A Collection

Methods on Scene

 


     

(SCENE *)GRAPE(Scene, "new-instance")(name)
CLASS *Scene
char *name

This method creates a new instance of class Scene with name "name" and allocates the necessary memory. The transformation matrix is set to the identity matrix.

     

GRAPE(scene, "free")()
SCENE *scene
The Scene implementation of "free" (cf. 5.4.4.1) sends "delete" to all instances which belong to this scene, i.e. to object, next_scene and suprop.

     

GRAPE(scene, "display")()
SCENE *scene

If an instance of class Scene receives a message "display" all transformations will be executed and the corresponding method will be send to the objects. The "display" affects the standard graphic device.

     

GRAPE(scene, "universal")(method)
SCENE *scene
char *method

The message method is send to the next_scene and to the object. Furthermore this method behaves like "display".

     

(SCENE *)GRAPE(scene, "expand")()
SCENE *scene

Sometimes it is useful to combine a list of scenes into one new node or expand an existing geometry object to a scene. The new scene contains the old scene and all connected instances which then can be handled as one scene. The return value is the pointer to the new scene.

     

GRAPE(scene, "reflect-send")()
SCENE *scene

This method creates a new scene by an interactive procedure. The necessary object will be chosen from the scene's list of objects by picking (cf. method "find-pick") into the actual graphic device. At last this object will be reflected at a line (defined by two points) or a plane (defined by three points). The points are defined by picking, too. The new object will be integrated in the scene as the last node.

This picking is controlled with the mouse buttons:

   left button   -- mark the points one after another
   middle button -- abort
   right button  -- perform reflection

To pick a certain point means to choose the nearest point of the geometry in the current scene with the actual projection on the graphic window.

     

GRAPE(scene, "reflect-delete-send")()
SCENE *scene

This method removes the last scene in the actual scene's list. If the actual scene was extended by reflections this scene is the last reflected object.

     

GRAPE(scene, "find-pick")(v, u, w, obj, dist)
INSTANCE *scene
VEC3 v
double u, w, *dist
INSTANCE **obj

In the instance scene a point v is searched so that this point is nearer to the straight (u, w, .) than dist. The global transformation matrices are taken into account. If a point is found then *obj is set to the scene the object with this point belongs to, v to this nearest point and dist the new distance. Combined with the method "pick" this one is useful to pick points or objects with the mouse. It has to be assured that the method "find-pick" is implemented on all scene's objects.

     

GRAPE(scene, "interpol")(scene2, f, mat1, mat2)
SCENE *scene
SCENE *scene2
double f
MATRIX44 mat1, mat2

According to the method "display" an instance of class Scene is displayed on the actual standard device. The object's data are transferred directly without creating any segments. The new object is an temporarily generated interpolation of both objects according to the following rule:

scene * mat1 * (1 - f) + scene2 * mat2 * f

The parameters mat1 and mat2 define the transformations performed on the corresponding objects before the interpolation takes place. If NULL is provided the identical transformation is performed.

     

(SCENE *)GRAPE(Scene, "read")()
SCENE * scene
CLASS * Scene

"read" reads instances of class Scene (written by the obsolete "write" method) from the standard textdevice.


next up previous contents index
Next: Methods for Scene handling Up: Scenes - A Collection Previous: Scenes - A Collection

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.