moveToBetterPosition
This pice of code is more a genertic Houdini utility than a real skylineEngine module. Its purpose is to be a replacement to the moveToGoodPosition provided by Houdini to accomodate the nodes
moveToBetterPosition: A function to accomodate all nodes in a Houdini graph in a "nice" manner. We use pyDot (http://dkbza.org/pydot.html), which is a wrapper around Graphviz (http://www.graphviz.org/). In particular, we use *dot*, a tool for``hierarchical'' or layered drawings of directed graphs. The layout algorithm aims edges in the same direction (top to bottom, or left to right) and then attempts to avoid edge crossings and reduce edge length.
The main function of this module is move. Now we will ennumerate its parameters and their usage.
move(container, fileName, xFactor, yFactor, createImage)
- container
- the node containing the nodes to sort. e.g. a geo or a subnet node. It's a compulsory parameter.
- fileName
- moveToBetterPosition uses a temporary file to store a Graphviz intermediate file in 'plain' format. The provided name will be appended a ".plain" extension. The file will be created in the current $HIP folder. This file will NOT be deleted afterwards. Its default value is "test_moveToBetterPosition" (extensions will be added automatically: .plain for the generated file, .jpg for the optional image)
- xFactor, yFactor
- horizontal and vertical scaling factors. There is no predefined set of values that will satisfy all requirements. Default values are (1,1).
- createImage
- Optionally, moveToBetterPosition will create an image file in .jpg format with the layout of the graph. The filename will be the one provided with the '.jpg' extension. By default, it's FALSE.
Downloads
moveToBetterPosition can be downloaded here
Known issues
In order to work, moveToBetterPosition creates a temporary file (by default with the name test_moveToBetterPosition.plain) in the path given by Houdini's $HIP variable. I've not been able to find a better way to do it...
People Involved
- moveToBetterPosition v1.0 Gustavo Patow (with help from Kenneth Alonso)