You are here: Surpac Concepts > Macros > SCL > SCL Graphics Drawing > SclGraphicsSetHeuristics
GEOVIA Surpac

SclGraphicsSetHeuristics

Overview

Heuristics are hints that you can give the underlying rendering system to apply when painting the graphics image. The rendering system is free to ignore these hints.

Synopsis

SclGraphicsSetHeuristics $heuristics

Arguments

  • heuristics
  • Pass by value. The only heuristic that is of use at this time is the quick moves heuristic. Quick moves instructs the rendering system that updates for a node are going to come very quickly, generally to achieve some type of animation, and that it should try and render these changes with great speed. Set no quick moves on a node that has previously had quick moves enabled after the high frequency of updates is no longer required.

    Quick-move mode should be used judiciously if you use it too much, it might become "slow move" mode, since all quick-move geometry is redrawn on every update.

Returns

Nothing

Examples

#
# This example shows how animation can be achieved by successively
# inserting and deleting markers at slightly different locations
#
set segKey [SclGraphicsOpen mynode]
  SclGraphicsSetHeuristics "quick moves"
  
  # insert the marker and retain its key for later deletion  
  set key [SclGraphicsInsertMarker 2450 6750 150]
  SclGraphicsSetMarkerSymbol {[*]}
  SclGraphicsSetMarkerSize 2
  SclGraphicsSetColour yellow
  set y 6750
  for {set i 0} {$i < 100} {incr i} {
    # animate by deleting the marker and inserting another at a
    # different location
    SclGraphicsDeleteByKey $key
    set y [expr $y + 1]
      if {$i == 50} {
        # let's make the marker red after a little while
        SclGraphicsSetColour red
      
      }
    set key [SclGraphicsInsertMarker 2450 $y 150]
    SclGraphicsUpdateDisplay
  }
  SclGraphicsSetHeuristics "no quick moves"
SclGraphicsClose