Class: TBasicCanvasGraphic

Declaration: BasicCanvasGraphic.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCanvasGraphic

Inherited By:

None.

Purpose:

A canvas graphic that can be constructed from any MGraphic.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Intended to be used as is, not likely to be derived but can be derived.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TBasicCanvasGraphic::TBasicCanvasGraphic

  1. TBasicCanvasGraphic (const MGraphic & thePrototype)
  2. TBasicCanvasGraphic (MGraphic * adoptPrototype)
  3. TBasicCanvasGraphic (const TBasicCanvasGraphic &)

Interface Category:

API.

Purpose:

  1. Constructs from a reference to an MGraphic.
  2. Constructs from an adopted pointer to an MGraphic.
  3. Copy constructor.

Calling Context:

  1. Called to create a new basic canvas graphic.
  2. Called to create a new basic canvas graphic.
  3. Called to copy a basic canvas graphic.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBasicCanvasGraphic::~TBasicCanvasGraphic

virtual ~ TBasicCanvasGraphic ()

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: TBasicCanvasGraphic::operator=

TBasicCanvasGraphic & operator =(const TBasicCanvasGraphic &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBasicCanvasGraphic::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: TBasicCanvasGraphic::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: TBasicCanvasGraphic::AdoptBundle

virtual void AdoptBundle (TGrafBundle *)

Interface Category:

API.

Purpose:

Adopts a bundle into the graphic.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The adopted bundle is simply adopted into the MGraphic that the basic canvas graphic wraps.

Member Function: TBasicCanvasGraphic::OrphanBundle

virtual TGrafBundle * OrphanBundle ()

Interface Category:

API.

Purpose:

Orphans the current bundle of the graphic.

Calling Context:

Call this function directly.

Parameters:

Return Value:

TGrafBundle * -The orphaned bundle.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The orphaned bundle is simply orphaned from the MGraphic that the basic canvas graphic wraps.

Member Function: TBasicCanvasGraphic::GetBundle

virtual const TGrafBundle * GetBundle () const

Interface Category:

API.

Purpose:

Gets the current bundle of the graphic for read-only access.

Calling Context:

Call this function directly.

Parameters:

Return Value:

const TGrafBundle * -A const pointer to the graphic's current bundle.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The bundle is simply the bundle returned from GetBundle of the MGraphic that the basic canvas graphic wraps.

Member Function: TBasicCanvasGraphic::HandleDraw

virtual void HandleDraw (TGrafPort &) const

Interface Category:

API.

Purpose:

Draws the MGraphic that the basic canvas graphic wraps.

Calling Context:

Called by MCanvasGraphic::Draw, which links the graphic's transform to the port before calling HandleDraw.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBasicCanvasGraphic::HandleGetBounds

virtual TGRect HandleGetBounds () const

Interface Category:

API.

Purpose:

Returns the bounding rectangle of the MGraphic that the basic canvas graphic wraps.

Calling Context:

Called by MCanvasGraphic::GetGeometricBounds and MCanvasGraphic::GetLooseFitBounds, which apply the graphic's transform to the returned bounds.

Parameters:

Return Value:

TGRect -The bounds.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Simply returns the TGRect returned from the GetLooseFitBounds of the MGraphic that the basic canvas graphic wraps.

Member Function: TBasicCanvasGraphic::HandleHit

virtual bool HandleHit (const TGPoint &) const

Interface Category:

API.

Purpose:

Detects the intersection of the point with the graphic's untransformed geometry.

Calling Context:

Called by MCanvasGraphic::Hit, which provides a point that has been untransformed by the graphic's transform.

Parameters:

Return Value:

Returns true if the point intersects ( hits ) the wrapped MGraphic; false, otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Basic canvas graphics interpret a hit as an intersection of the point with the wrapped MGraphic's loose fit bounds.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.