Draw the geometry

Draw a geometry by calling the appropriate TGrafPort::Draw function and passing the needed parameters. There is a Draw function for a specific set of the 2D and 3D geometries because a small, welldefined set of basic 2D and 3D geometries are supported by graphics devices.

The code below shows the overloaded TGrafPort::Draw function declaration and calls for a TGLine.

Geometry with attribute bundle and matrix

      TGrafPort::Draw(    const TGLine& line, 
                          const TGrafBundle& bundle,
                          const TGrafMatrix& modelMatrix = TGrafMatrix::GetIdentity() );
      
      myPort.Draw( myLine, itsBundle, aMatrix );
This Draw function takes a geometry, an attribute bundle, and a matrix. This parameter list tells the drawing port to concatenate the supplied bundle and model matrix to the graphic state; draw the geometry; and use the scene attributes, clip area, and view matrix of the graphic state.

Geometry only

      TGrafPort::Draw( const TGLine& geometry );
      
      myPort.Draw( myLine );
This Draw function takes a single geometry without an attribute bundle or matrix. This parameter list tells the drawing port to draw the geometry sent to it and to use the graphic state of the drawing port.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker