User Tools

Site Tools


rgg:rgg-manual

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rgg:rgg-manual [2024/04/26 17:13] gaetanrgg:rgg-manual [2024/10/11 13:00] (current) – [XL and Java extension] gaetan
Line 1: Line 1:
 ====== Table of Contents ====== ====== Table of Contents ======
 +  * [[:rgg:rgg-manual#java|XL and Java extension]]
   * [[:RGG:rgg-manual#rgg|GroIMP's Relational Growth Grammars]]   * [[:RGG:rgg-manual#rgg|GroIMP's Relational Growth Grammars]]
   * [[:RGG:rgg-manual#graph_manipulations|Graph Manipulations]]   * [[:RGG:rgg-manual#graph_manipulations|Graph Manipulations]]
   * [[:RGG:rgg-manual#additional_formats|Additional formats]]   * [[:RGG:rgg-manual#additional_formats|Additional formats]]
  
-==== List of Figures ==== 
-  - [[:RGG:ch01#f-rgg-panels|Panels in the RGG Layout]] 
  
-====== GroIMP's Relational Growth Grammars ======+====== XL and Java extension ======
  
-==== Overview ====+The programming language XL is defined as an extension of the Java programming language. Thus the XL programming language benefits from the well-grounded concepts of structured, modular and object-oriented programming on which the Java programming is based. Being an extension not only at the level of the language specification, but also at the binary level, all existing Java libraries can be addressed immediately by XL programmes. This introduces at once an enormous power, since the Java programming language is known for being a language with a comprehensive set of high-quality, freely available run-time libraries, including sophisticated graphical user interface components, internet communications, 2D- and 3D-graphics, and XML support.
  
 +Within a XL (or RGG) file, it is possible to write both XL code and Java code. XL sections are defined with ''['' '']'' brackets. Java sections are defined with ''{'' ''}'' brackets.
  
-//Growth grammars// are a rule-based approach to the modelling of dynamic systems. In contrast to conventional imperative programming languages, rule-based approaches provide a natural and concise way of modelling: Most systems to be modeled behave according to a set of rules, and our perception works this way and not imperatively using a list of operations which have to be processed step by step.+It is highly recommended to learn a basic usage of [[https://docs.oracle.com/en/java/|Java]] to efficiently code in RGG.
  
-Relational growths grammars (RGG) are part of the current research at the [[http://www-gs.informatik.tu-cottbus.de/|Chair for Practical Computer Science / Graphics Systems]] at the Brandenburg University of Technology Cottbus (Germany) and its cooperation partners. They are defined as a unification of L-systems and graph grammars. This user manual explains how relational growths grammars are used within GroIMP, more information about relational growth grammars can be found at the web page [[http://www.grogra.de/|www.grogra.de]], more information about the programming language XL, which is used within GroIMP as an implementation of the calculus of relational growth grammars, can be found in the [[:GroIMP-Platform:XL-language|XL language speficication]].+See more
 +  * [[http://www.grogra.de/|www.grogra.de]] 
 +  * [[:GroIMP-Platform:XL-language|XL Overview]] 
 +  * [[:GroIMP-Platform:XL-language|XL language speficication]] 
 +  * [[:rgg:basic_operations|XL basic operations]] 
 +  * [[:rgg:basic_objects|XL class and methods]] 
 +  * [[:tutorials:rgg-code-structure | Introdcution to rgg code structure]]
  
-==== Opening a RGG file ==== 
  
  
-GroIMP understands relational growth grammars written in the language XL, which is based on Java, see [[http://www.grogra.de/|www.grogra.de]] and the [[:GroIMP-Platform:XL-language|XL language speficication]]. At the web page, there exist some example XL files, which you should download in order to have a starting point. Or, if you have installed the Examples-plugin, just select the menu File/Show Examples. A simple, classical example is the Koch curve whose XL source is shown here, you may create the file ''Koch.xl'by Copy&Paste.+====== GroIMP's Relational Growth Grammars ======
  
-<code java> 
-import de.grogra.rgg.*; 
-import de.grogra.lsystem.*; 
  
-public class Koch extends RGG { +//Growth grammars// are a rule-based approach to the modelling of dynamic systems. In contrast to conventional imperative programming languages, rule-based approaches provide a natural and concise way of modelling: Most systems to be modeled behave according to a set of rules, and our perception works this way and not imperatively using a list of operations which have to be processed step by step.
-    public void derivation() [ +
-        Axiom ==> F(10) RU(120) F(10) RU(120) F(10); +
-        F(x) ==> F(x/3) RU(-60) F(x/3) RU(120) F(x/3) RU(-60) F(x/3); +
-    ] +
-+
-</code>+
  
-You can open an XL file like the one shown file via the menu item File/Open, this creates a new project containing the XL fileFor good RGG modelling workflow, you should switch to the RGG panel layout in the menu Panels/Set Layout. This brings up the most frequently used panelsRGG toolbar, 3D view, text editor, attribute editor, file exporermeta object browser, message panel, and XL consolesee [[:RGG:ch01s02#f-rgg-panels|Figure 1.1, "Panels in the RGG Layout"]].+Relational growths grammars (RGG) are part of the current research at the [[http://www-gs.informatik.tu-cottbus.de/|Chair for Practical Computer Science / Graphics Systems]] at the Brandenburg University of Technology Cottbus (Germany) and its cooperation partnersThey are defined as unification of L-systems and graph grammars. This user manual explains how relational growths grammars are used within GroIMP, more information about relational growth grammars can be found at the web page [[http://www.grogra.de/|www.grogra.de]]more information about the programming language XL, which is used within GroIMP as an implementation of the calculus of relational growth grammars, can be found in the [[http://134.76.18.36/wordpress/the-xl-language-specification/|XL language speficication]].
  
-**Figure 1.1. Panels in the RGG Layout**+See more: 
 +  [[:rgg:getting-started|Getting started with RGG]]
  
-{{:rgg:panels.png}} 
- 
-The meta object browser displays objects which have an influence on the scene, but which are not part of the material scene. The RGG object is an example of such an object, and if you open an XL file containing an RGG class, an instance of this class will be created automatically (if the file can be compiled successfully) and inserted into the list of meta objects. By a double click on the RGG object, its editable attributes (the public fields which are declared in its class and are annotated by ''de.grogra.annotation.Editable'') are shown in the attribute editor. 
- 
-==== Working with a Relational Growth Grammar ==== 
- 
- 
-After an RGG object has been loaded successfully from an XL file, its public methods are made available in the RGG toolbar. Each method appears twice: In the list prefixed with Apply, a click invokes the method once, in the list prefixed with Run, a click starts the repeated invocation of the method. To stop this loop, click the Stop button in the toolbar. Initially, buttons for the first method are accessible immediately; to see a button list for the other methods, you have to click on the small arrow at the right button border. 
- 
-Normally, RGG methods cause the application of graph grammar rules to the scene. This is the case for the examples provided at GroIMP's web page, and you should try these examples to get familiar with GroIMP's RGG facilities. 
- 
-The XL source code of a relational growth grammar can be edited in GroIMP's internal text editor, just double-click on the XL file in the file explorer. Whenever modifications of an XL file are saved using the text editor's Save button, it is recompiled, and the RGG object becomes reinitialized. Compilation errors are shown in the message panel and contain hypertext links to their source code locations. 
- 
-If the filename ends in ''.rgg'' instead of ''.xl'', a simplified syntax is used. In this case, the most common import statements are implicit, as is the enclosing ''RGG''-class declaration. 
  
 ====== Graph Manipulations ====== ====== Graph Manipulations ======
  
-You can find more information on the graph operations [[:groimp-platform:xl-language|here]]. +To manipulate the Graph in RGG so called rewriting rules are used.  
- +These rules consist of three elements: 
-The list of graph operations can be found [[:groimp-platform:graph_operator|here]]. +  *  a pattern on the left side defined by an XL-query and/or XL-Operators 
- +   an graph-operator that describes how the right side is interpreted 
-An example with the most used graph operations can be found [[:Tutorials:common_graph_operator|here]]+   and a right side with a new graph structure( described by [[:3d-guide:3d-manipulations#turtle_commands|turtle geometry]] and a graph-syntax) and/or instruction to change the nodes of the pattern on the left side.
- +
-The graph support queries following [[:groimp-platform:graph_queries|this syntax]].+
  
-An example with basic queries can be found [[:Tutorials:common_graph_queries|here]].+See more: 
 +    * [[:groimp-platform:xl-language|More information on the graph operations]] 
 +    * [[:groimp-platform:graph_operator|List of graph operations]] 
 +    * [[:groimp-platform:graph_queries|Query syntax]] 
 +    * [[:groimp-platform:xl-operators|List of XL operators]]
  
 +Tutorials:
 +  * [[:Tutorials:common_rewriting_rules|basic rewriting rules]]
 +  * [[:Tutorials:common_graph_queries|basic XL queries]]
 +  * [[:Tutorials:common_graph_operator|basic graph operations]]
  
 ====== Additional formats ====== ====== Additional formats ======
rgg/rgg-manual.1714144404.txt.gz · Last modified: 2024/04/26 17:13 by gaetan