You are here: Surpac Concepts > Macros > SCL > SCL Overview > SCL Graphics Commands Overview
GEOVIA Surpac

Scl Graphics drawing commands

The Scl Graphics drawing commands provide a controlled interface to the 3D graphics rendering system used in the Surpac product range. Because the SclGraphics commands provide a more direct interface to the 3D rendering system the Scl author has greater freedom to achieve their result than is possible by using the SclDraw command or by working through the various drawing functions available in Surpac.

Effective use of the Scl Graphics commands requires that the Scl author understand some key concepts of the graphics rendering system.

  • Graphics database
  • All geometry rendered is stored in a graphics database. The graphics database is transient and only exists while Surpac is running. There is no permanent disk copy of the database.

    The Graphics database has a hierarchical organisation with each node of the hierarchy being called a container.

    Each node in the graphics database can contain other items which may be other nodes, geometry or rendering attributes. As each node may contain other node it is possible for the Scl author to build a complex node hierarchy with different items of geometry organised into different nodes to suit the needs of the author. For example, if a vehicle were to be drawn, the author might create a node called car, which might contain the nodes wheels, doors, engine, etc. with each of these nodes containing the necessary geometry to create the required image.

  • Geometry
  • A complex 3D image is built from a number of component items of geometry. Items of geometry that may be drawn include markers, polylines, polygons, text and shells. Geometry is effectively the coordinates, lines and faces that define the image that is to be drawn.

    • Polylines and polygons are similar because they each are defined as a number of points, each having XYZ coordinates. Polygons though can be rendered with the interior face as a solid colour, different to the edges if required, whereas polylines can only be rendered as a line, although a variety of line styles can be used.
    • Markers can be drawn at a point in space defined by XYZ coordinates using a symbol from a predefined symbol list. The size of the markers is expressed using a number that is related to the size of the containing screen where a marker size of 1 is approximately 3% if the containing window height. A marker size of 2 will be twice this size while a marker size of 0.5 is half this size.
    • Text is defined as a string of characters and can be drawn at any orientation and with any alignment with respect to the XYZ point at which the text is inserted.
    • A shell is a complex geometric object that is defined as a number of faces with each face being defined by the points or vertices that make up that face. DTMs and 3DM trisolations are drawn using this shell primitive. Attributes of shells that can be modified include, edge and face colour and edge and face pattern.

    There are no Scl commands to set the screen extents so to ensure that the geometry inserted using the SclGraphics commands is visible you must ensure that it falls with the screen extents defined by string or triangle data that is currently displayed.

  • Rendering attributes
  • Rendering attributes are the colours, line styles, markers, edge styles, text fonts etc. that define how the image is to be rendered. All items of a particular type of geometry, polylines for example, that are in the same node will be rendered using the same colour. If you must have polylines of different colours then they must exist in different nodes.

  • Inheritance
  • Rendering attributes are inherited down the node hierarchy although each node may contain its own idea about any rendering attribute. Therefore if a node named car contains a node named wheel and the line colour in the car node is defined to be red, then all lines in the wheel node will also be drawn red.

    If the wheel node has its own line colour setting of say blue, then all lines in the wheel node will be blue.

  • Update cycle
  • The graphics database is rendered to the screen at intervals determined by Surpac. This always occurs after the script execution has terminated but will also occur at other times such as when a form is displayed. This may not give the desired result especially if you plan to animate some part of the geometry by moving it to different locations and updating the image after each move.

    The SclGraphicsUpdateDisplay command permits you to insist that the graphics database is rendered immediately. This permits the image to be rendered inside loops that might be used to simulate animation.