01_user_documentation:05_object:11_wrapped_graphs:01_graphobjects
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| 01_user_documentation:05_object:11_wrapped_graphs:01_graphobjects [2026/09/23 14:52] – groimp | 01_user_documentation:05_object:11_wrapped_graphs:01_graphobjects [2026/09/23 15:25] (current) – groimp | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| A read only wrappedGraph that can be used as a resource similar to a shader or an image. | A read only wrappedGraph that can be used as a resource similar to a shader or an image. | ||
| - | ====== ====== | + | ===== UI management |
| GraphObject are managed through the [[..: | GraphObject are managed through the [[..: | ||
| Line 9: | Line 9: | ||
| A GraphObject can be viewed in 2D and 3D by selecting it in the explorer and pressing view3d or view2d in the attribute editor. The changes done in the views will only last until the project is reloaded, since the graph structure is read only. | A GraphObject can be viewed in 2D and 3D by selecting it in the explorer and pressing view3d or view2d in the attribute editor. The changes done in the views will only last until the project is reloaded, since the graph structure is read only. | ||
| + | |||
| + | ===== RGG ===== | ||
| + | |||
| + | Each GraphObject added to the explorer can be referenced from RGG using the function '' | ||
| + | |||
| + | ==== Load as instance ==== | ||
| + | |||
| + | If a GraphObjectRef or a GraphObject is added to a RGG production it will automatically return an instance of the graph structure, similar to an instantiation rule. | ||
| + | |||
| + | This code fore example will display the entire tree.qsm file but adds only one node to the graph. | ||
| + | <code java> | ||
| + | protected void init()[ | ||
| + | Axiom ==> graphobject(" | ||
| + | ] | ||
| + | </ | ||
| + | |||
| + | This works in any RGG production e.g. replacement- or instantiation-rules. | ||
| + | |||
| + | ==== cloning the graph ==== | ||
| + | |||
| + | It is also possible to use the GraphObject as source for the graph structure, in this case the '' | ||
| + | |||
| + | For example this code will add all shoots from the tree.qsm as cylinders to the graph. | ||
| + | <code java> | ||
| + | protected void init()[ | ||
| + | Axiom ==> graphobject(" | ||
| + | ] | ||
| + | </ | ||
| + | |||
| + | The cloned objects are fully independent from the original GrpahObject. | ||
| + | |||
| + | |||
| + | ==== Querying the graph ==== | ||
| + | |||
| + | It is possible to query the GraphObject or the GraphObjectRef in the same way as the project graph to retrieve information. This can be useful to compare or adjust the project to a imported structure. | ||
| + | The Syntax for this queries is similar to the one on the main Graph. | ||
| + | For example to count the number of shoots on GrpahObject called tree.qsm: | ||
| + | |||
| + | <code java> | ||
| + | println(count(graphobject(" | ||
| + | </ | ||
| + | |||
| + | The query it self, the part in the '' | ||
| + | |||
| + | It would also be possible to use this to assign values: | ||
| + | |||
| + | <code java> | ||
| + | graphobject(" | ||
| + | </ | ||
| + | |||
| + | But once again this is read only so it will not be stored when the project is closed. | ||
| + | |||
01_user_documentation/05_object/11_wrapped_graphs/01_graphobjects.1790175178.txt.gz · Last modified: by groimp
