Table of Contents
Graph Explorer Plugin
Following the basics of the Graph Explorer plugin which holds GraphObjects and SecGraphs, are described.
Objects
GraphObject
A GraphObject can be used to load graph structures from file into the GraphObeject explorer and use them as read only assets. The graph structure can either be cloned and then added to the graph or only an instance of it can be used in the graph. A GraphObject is stored in the original file format and can be viewed from the GraphObjectExplorer. To use it in RGG the class GraphObjectRef with the name if the object.
GraphObjectRef gr = new GraphObjectRef("myTree"); [ A ==> gr.cloneGraph(); // relace A with a clone of the graph B ==> gr; // replaces B with an instantiation of the graph ]
SecGraph
A SecGraph object extends the GraphObject to creates a fully functional secondary graph, that can be manipulated and is stored in the same XML format as the project graph. Similar to the ObjectGraph a SecGraph can be used through the SecGraphRef class, either by importing (through the SecGraphExplorer) or by creating in RGG.
SecGraphRef sgr = new SecGraphRef("test") // a empty SecGraphReference sgr ==> F RL(30)F; // add a graph structure to the empty secGraph SecGraphRef sgr = new SecGraphRef("tmp",first((*RGGRoot*))); // a new SecGraphRef containing a clone of the subgraph below RGGRoot SecGraphRef sgr = new SecGraphRef("tmp",GraphObejctRef("myTree")); // a secGraph contaiing a clone of the GraphObject myTree
Additionally a SecGraph can also be an attribute of a Node (including the rgg classes). In this case the xml file containing the graph is automatically created using the EmbeddedSharedObject-conzept.
module A (float len) { SecGraphImpl sg; { sg = new SecGraphImpl(workbench()); sg ==> F F RL F; } }==> sg;
To interact with the SecGraph object through RGG or XL, the function setCurrent and releaseCurrent are implemented. These functions change the currently used lock and RGGGraph in GroIMP, allowing to execute code on another graph. Additionally it is possible to apply a entire RGG function on a SecGraph.
On the GUI level it is possible to edit the secondary graph on the 2d graph and the 3d view.
UI
The plugin creates
Class relationships
The objects follow the structure of references commonly used in GroIMP, therefore the functionalities of are implemented interfaces (SecGraph, GraphObject) which then are implemented each by an implementation that holds the “real” function as a Reference class that can be accessed an used the reslove() function to forward the function calls to the *impl class.