Package renderer.scene.util
Class DrawSceneGraph
- java.lang.Object
-
- renderer.scene.util.DrawSceneGraph
-
public class DrawSceneGraph extends Object
This program converts aScenedata structure into a DOT description of the scene. The DOT description is written to a file and that file is processed by the dot.exe program to produce a png file graphical image of the scene data structure.A
scene.pngimage file is created from ascene.dotfile with the following command-line.> dot.exe -Tpng -O scene.dotSee
https://www.graphviz.org/Documentation.phpThis class has four static boolean variables that can be used to control the complexity of the scene graph drawing.
-
-
Field Summary
Fields Modifier and Type Field Description static booleandrawCameraDetailsControl the details shown in aCameranode.static booleandrawMatrixControl the display ofMatrixnodes.static booleandrawMatrixDetailsControl the details shown in aMatrixnode.static booleandrawVertexListControl the details shown below aModelnode.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddraw(Scene scene, String fileName)This method converts aScenedata structure into a dot language description.static Stringmodel2dot(Model model, String nodeName)This method generates a dot language description of the tree rooted at aModelnode.static Stringposition2dot(Position position, String positionName)This method generates a dot language description of the DAG rooted at aPositionnode.static Stringscene2dot(Scene scene)This method generates a dot language description of the DAG rooted at aScenenode.
-
-
-
Field Detail
-
drawCameraDetails
public static boolean drawCameraDetails
Control the details shown in aCameranode.
-
drawMatrix
public static boolean drawMatrix
Control the display ofMatrixnodes.
-
drawMatrixDetails
public static boolean drawMatrixDetails
Control the details shown in aMatrixnode.
-
drawVertexList
public static boolean drawVertexList
Control the details shown below aModelnode.
-
-
Method Detail
-
draw
public static void draw(Scene scene, String fileName)
This method converts aScenedata structure into a dot language description. The dot code for the scene is written into a dot file. Then the dot.exe program is called to convert the dot file into a png image of the scene data structure.- Parameters:
scene-Scenethat needs to be converted to a dot descriptionfileName- base name for the dot and png files
-
scene2dot
public static String scene2dot(Scene scene)
This method generates a dot language description of the DAG rooted at aScenenode.This method generates the dot code for the forest of top-level positions just below the scene node. Each position node just below the scene node is the root of a DAG. This method calls the
position2dot()method to traverse the DAG of each top-level position.
-
position2dot
public static String position2dot(Position position, String positionName)
-
-