Package renderer.scene.util
Class DrawSceneGraph
- java.lang.Object
-
- renderer.scene.util.DrawSceneGraph
-
public class DrawSceneGraph extends Object
This program converts aScene
data 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.png
image file is created from ascene.dot
file with the following command-line.> dot.exe -Tpng -O scene.dot
See
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 boolean
drawCameraDetails
Control the details shown in aCamera
node.static boolean
drawVector
Control the display ofVector
nodes.static boolean
drawVectorDetails
Control the details shown in aVector
node.static boolean
drawVertexList
Control the details shown below aModel
node.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
draw(Scene scene, String fileName)
This method converts aScene
data structure into a dot language description.static String
model2dot(Model model, String nodeName)
This method generates a dot language description of the tree rooted at aModel
node.static String
position2dot(Position position, String positionName)
This method generates a dot language description of the DAG rooted at aPosition
node.static String
scene2dot(Scene scene)
This method generates a dot language description of the DAG rooted at aScene
node.
-
-
-
Field Detail
-
drawCameraDetails
public static boolean drawCameraDetails
Control the details shown in aCamera
node.
-
drawVector
public static boolean drawVector
Control the display ofVector
nodes.
-
drawVectorDetails
public static boolean drawVectorDetails
Control the details shown in aVector
node.
-
drawVertexList
public static boolean drawVertexList
Control the details shown below aModel
node.
-
-
Method Detail
-
draw
public static void draw(Scene scene, String fileName)
This method converts aScene
data 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
-Scene
that 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 aScene
node.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)
-
-