Class: MDrawable

Declaration: Graphics.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

MGraphic3D TPage MGraphic TLabel

Purpose:

MDrawable is an abstract base mixin for 2-D and 3-D graphic objects. MDrawable allows a graphic object to draw itself. It also allows a graphic object to be put into a collection, because MDrawable is derived from MCollectible. MDrawable::Draw allows any MDrawable derived class to present itself to the port and the device. (The device or port might not actually be a rendering port.)

Instantiation:

Abstract class; do not allocate.

Deriving Classes:

All deriving classes must define their Draw() behavior and override the Draw() member function.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: MDrawable::~MDrawable

virtual ~ MDrawable ()

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: MDrawable::Draw

virtual void Draw (TGrafPort & port) const

Interface Category:

API.

Purpose:

Draws the graphic to the specific TGrafPort. This is a pure virtual function.

Calling Context:

Call concrete derived classes' Draw functions directly.

Parameters:

Return Value:

None.

Exceptions:

Determined by derived classes.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: MDrawable::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: MDrawable::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: MDrawable::MDrawable

  1. MDrawable ()
  2. MDrawable (const MDrawable &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators.
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This is a protected function because the class is abstract.

Member Function: MDrawable::operator=

MDrawable & operator =(const MDrawable & 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.