User Tools

Site Tools


groimp-platform:visit-resolution

Display visitor resolution

To display a scene (2d or 3d) the graph is visited by a DisplayVisitor. The display visitor visit all Nodes that are connected through Branch and/or Successor edges to the root (see more on the 3d display visitor).

The DisplayVisitor is used at every display update: highlight, picking, graph update, navigation in the scene, … So in complex graph it can be useful to: limit the number of visits (e.g. by disabling highlight) or, simplify the visits (e.g. using resolution index).

Resolution index

Every node in GroIMP have a resolution index. By default its value is 0. The possible values are integers in the range of 0 to 7.

Visitors also have a resolution index, 7 by default.

Node can additionally implements the interface de.grogra.imp.ResolutionSensitive to get notified by the visitor based on their resolution indexes. The visitor set the State of the Node before the visitation implementation happens, so the Node can behave differently based on his State.

When a visitor visits a node there are three possible event:

  • The Visitor has a strictly higher resolution index than the node. If the node is ResolutionSensitive, its State is set to NORMAL (which is the default value). Then, the visitor continue.
  • The Visitor and the Node have the same resolution index. The Node State is set to PASSED. Then, the visitor continue.
  • The Visitor has a strictly lower resolution index than the node. The Node State is set to STOPPED. The node is visited, but it stops the visitor from visiting its children Nodes. The Visitor will still continue to visit the rest of the graph.

The resolution indexes of Node can be set with the Attribute editor, or with the method setResolution(int).

The resolution of the DisplayVisitor can be set in the options.

groimp-platform/visit-resolution.txt · Last modified: 2024/11/06 17:46 by gaetan