next up previous contents index
Next: Suprop Up: Scenes - A Collection Previous: Methods on Scene

Methods for Scene handling

 

Interactive methods sometimes need to handle objects in data hierarchy tree without knowing its structure. The following methods of class Manager can help you doing this.

     

GRAPE(mgr, "goto-instance")(object)
MANAGER *mgr
INSTANCE *object
Search object in the data hierarchy tree and take the minimal number of steps to go there.

   

(SCENE *)GRAPE(mgr, "insert-object")(object, bury, at_head, skip_first)
MANAGER *mgr
INSTANCE *object
int bury, at_head, skip_first
Insert object into the data hierarchy tree at a good place, as object of a Scene instance. If the scene found already has an object a new Scene instance is created and inserted. object is ASSIGNed to the Scene, which is returned upon successful completion.

The flags decide what is thought to be a good place:

bury
if set, follow the next_scene links of scenes to insert the object as deep as possible. If a Scene instance without object is found on this way put object there.
at_head
always insert the object at the top of the data hierarchy tree. You need this or the following flag if you call "insert-object" from a "-send" method that will be called on the new object by the universal mechanism.
skip_first
take the second scene found on the way to the data hierarchy tree top.

Some old style methods which insert new objects into the data hierarchy tree are implemented as service methods ob class Scene, that only work on objects of special classes. Now you can implement these methods on the correct class and use "insert-object" to insert the results.

This method uses

   

(SCENE *)GRAPE(scene, "insert-object")(object, bury)
SCENE *scene
INSTANCE *object
int bury, at_head, skip_first
Insert object as object of a Scene instance. bury is the same as in the method of class Manager.


next up previous contents index
Next: Suprop Up: Scenes - A Collection Previous: Methods on Scene

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.