The Object Oriented Architecture of TGS
TGS is built up of a collection of objects, with appropriate linkages
and control structures between the different objects.
Although TGS is written using C++ and uses an object oriented
architecture, it is not necessary for the application program to be
written in C++. All API functions are duplicated using
standard function calls compatible with languages such as C,
Pascal, and Fortran.
TGS Session and System Objects:
TGCL_Session -
the session object. This stores all the operational parameters for
the current session.
Generally one session object is used per application.
TGCL_System -
the complete TGS system object. Multiple objects allow
multiple windows within an application.
The session and system objects provide the overall organization and
control of TGS.
The session object has the job of managing a complete operating
environment.
Generally there is one session object per TGS application
running on the system. This approach allows dynamic link libraries to
handle each separate application program individually. In addition it
allows complex TGS environments to exist with multiple configurations
running simultaneously, even in embedded equipment.
The system object has the job of managing a single drawing or display
window.
Resources:
TGCL_Resource -
generic TGS resource (drawing tool).
(abstract class)
- TGCL_Pen
- TGCL_Brush
- TGCL_Font
The resources used in a drawing are owned and managed by an individual
system object. A resource table within the system object stores pointers
to the resource objects.
2D Primitives:
TGCL_Primitive -
Generic TGS primitive.
(abstract class)
A primitive table within the system object stores pointers to the
primitive objects. Each time the drawing or display image is processed,
the table is scanned from start to finish. Hence primitives later in the
table can overdraw those earlier in the table.
Control primitives are not displayed,
but pass commands to the system
object. These are generally used for changes to the scaling system.
Complex drawings can have multiple groups of control primitives and
graphic primitives. This allows different parts of a drawing to be
scaled and positioned separately.
Graphic primitives are used to produce the images.
All standard geometric elements are provided as well as paths and bitmaps.
A path is a compound curve, generated from series of line
segments, arcs, and bezier curves. Paths may be closed, and filled with a
brush as required. Multiple sub-paths can exist per path.
A bitmap is a scanned image containing pixel data.
The bitmap primitive stores the pixel data, a color lookup table for 1, 2, 4,
and 8 bit per pixel formats (not required for the 32 bit full color format),
and floating point coordinates storing the corners of the bitmap for scaling
and positioning.
Groups and Symbols:
TGCL_Group (concrete class)
- TGCL_Symbol (abstract class)
A group is a collection of primitives that can be operated on
collectively for editing purposes.
Symbols are a special class of group.
They are individually written objects that control the operation of one or
more primitives, generally for animation purposes.
One example of a symbol is a special form of text that
remains upright, regardless of display rotation. When the display is updated
this symbol reads the rotation angle of the display and sends a command to
the text primitive it owns to rotate it in the opposite direction.
|