Class: TGraphicHierarchy

Declaration: Graphics.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MGraphic

Inherited By:

TGraphicGroup

Purpose:

TGraphicHierarchy is an abstract base class that defines a hierarchy protocol for graphics that are grouped into a conglomerate graphic. This protocol creates an iterator that allows hierarchies of graphics to traverse themselves, accessing the MGraphic at each node. All that TGraphicHierarchy adds to its base class, MGraphic, is the pure virtual function CreateIterator.

Instantiation:

Abstract class; do not allocate.

Deriving Classes:

Derived classes override CreateIterator to return an iterator object (itself derived from TGraphicIterator). The iterator implements a standard set of member functions needed to access the MGraphics in the hierarchy. TGraphicHierarchy has a concrete derived class, TGraphicGroup, which implements a graphic's hierarchy as a tree structure. You can create other derived classes of TGraphicHierarchy to implement hierarchies using other sorts of data structures, with corresponding iterators.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TGraphicHierarchy::~TGraphicHierarchy

virtual ~ TGraphicHierarchy ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGraphicHierarchy::CreateIterator

virtual TGraphicIterator * CreateIterator () const

Interface Category:

API.

Purpose:

Creates a TGraphicIterator which iterates through the first level of the hierarchy.

Calling Context:

Call concrete derived classes' CreateIterator functions directly.

Parameters:

Return Value:

Returns a graphic iterator for the first level of this hierarchy.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This is a pure virtual function.

Member Function: TGraphicHierarchy::Draw

virtual void Draw (TGrafPort & port) const

Interface Category:

API.

Purpose:

Draws the TGraphicHierarchy to the specific TGrafPort.

Calling Context:

Call concrete derived classes' Draw functions directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This is a pure virtual function.

Member Function: TGraphicHierarchy::GetGeometricBounds

virtual TGRect GetGeometricBounds () const

Interface Category:

API.

Purpose:

Gets the bounding rectangle of the TGraphicHierarchy's geometry, without considering any area added by the bundle. (For example, the pen is a bundled attribute that can increase the area of the graphic by adding a border that extends beyond the bounds of the geometry.)

Calling Context:

Called during hit detection. You can also call concrete derived classes' GetGeometricBounds functions directly.

Parameters:

Return Value:

Returns the bounding rectangle, which is the smallest axis-aligned rectangle that encloses the graphic hierarchy's geometry.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This is a pure virtual function.

Member Function: TGraphicHierarchy::TransformBy

virtual void TransformBy (const TGrafMatrix &)

Interface Category:

API.

Purpose:

Transforms the TGraphicHierarchy's shape and position by applying the specified transformation matrix.

Calling Context:

Called by the Graphics system. You can also call concrete derived classes' TransformBy functions directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGraphicHierarchy::operator>>=

virtual TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGraphicHierarchy::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGraphicHierarchy::TGraphicHierarchy

  1. TGraphicHierarchy ()
  2. TGraphicHierarchy (TGrafBundle * adoptBundle)
  3. TGraphicHierarchy (const TGraphicHierarchy &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Creates a TGraphicHierarchy with the specified attribute bundle.
  3. Copy constructor.

Calling Context:

  1. Called by the stream-in operators. You should not call this function directly because this is an abstract class.
  2. You should not call this function directly because this is an abstract class.
  3. Called to copy an object. You should not call this function directly because this is an abstract class.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGraphicHierarchy::operator=

TGraphicHierarchy & operator =(const TGraphicHierarchy & source)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

Returns a const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This is a protected function because the class is abstract.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.