Class: MCanvasSelection

Declaration: GrafEdit.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MToolTarget

Inherited By:

TStandardCanvasModelSelection

Purpose:

Abstract base class for all canvas selections. Used to reference a set of canvas graphics in a single canvas representation in an address-space independent manner.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Abstract base class; must be derived.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: MCanvasSelection::MCanvasSelection

  1. MCanvasSelection (const MCanvasSelection &)
  2. MCanvasSelection ()

Interface Category:

API.

Purpose:

  1. Copy constructor.
  2. Default constructor.

Calling Context:

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

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: MCanvasSelection::~MCanvasSelection

virtual ~ MCanvasSelection ()

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: MCanvasSelection::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Returns a unique value that can assist in identifying the object or comparing it to other objects.

Calling Context:

Called to generate a hash value.

Parameters:

Return Value:

Returns 0.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: MCanvasSelection::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: MCanvasSelection::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 TStandardException (kStreamBadVersion,0) if streaming in a version other than kOriginalVersion. Passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: MCanvasSelection::operator=

MCanvasSelection & operator =(const MCanvasSelection &)

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: MCanvasSelection::SelectGraphic

  1. virtual void SelectGraphic (const MCanvasGraphic &)
  2. virtual void SelectGraphic (const TCanvasGraphicID &)

Interface Category:

API.

Purpose:

Adds the specified graphic to the selection.

Calling Context:

Typically called from a command or from a canvas view.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: MCanvasSelection::DeselectGraphic

  1. virtual void DeselectGraphic (const MCanvasGraphic &)
  2. virtual void DeselectGraphic (const TCanvasGraphicID &)

Interface Category:

API.

Purpose:

Removes the specified graphic from the selection.

Calling Context:

Typically called from a command or from a canvas view.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: MCanvasSelection::SelectAllGraphics

virtual void SelectAllGraphics ()

Interface Category:

API.

Purpose:

Adds all the graphics in the underlying representation to the selection.

Calling Context:

Typically called from a command or from a canvas view.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: MCanvasSelection::DeselectAllGraphics

virtual void DeselectAllGraphics ()

Interface Category:

API.

Purpose:

Removes all graphics from the selection.

Calling Context:

Typically called from a command or from a canvas view.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: MCanvasSelection::IsGraphicSelected

  1. virtual bool IsGraphicSelected (const MCanvasGraphic &) const
  2. virtual bool IsGraphicSelected (const TCanvasGraphicID &) const

Interface Category:

API.

Purpose:

Identifies whether the specified graphic is in the selection.

Calling Context:

Typically called from a command or from a canvas view.

Parameters:

Return Value:

Returns true if the graphic is in the selection.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: MCanvasSelection::NumberOfSelectedGraphics

virtual long NumberOfSelectedGraphics () const

Interface Category:

API.

Purpose:

Identifies the number of graphics that are in the selection.

Calling Context:

Typically called from a command or from a canvas view.

Parameters:

Return Value:

long -The number of selected graphics.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: MCanvasSelection::CreateIterator

virtual TCanvasSelectionIterator * CreateIterator ()

Interface Category:

API.

Purpose:

Creates an iterator to iterate over graphics in the selection.

Calling Context:

Typically called from a command.

Parameters:

Return Value:

TCanvasSelectionIterator -A new iterator for the selection.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: MCanvasSelection::EnumerateGraphics

virtual void EnumerateGraphics (TCanvasGraphicFilter &, TCanvasGraphicFunnel &) const

Interface Category:

API.

Purpose:

Passively iterates over selected graphics in the underlying representation. The filter controls which graphics are enumerated and in which order. The funnel defines how each enumerated graphic is processed.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Pure virtual function; must be implemented in derived classes.

Member Function: MCanvasSelection::GetCanvasRepresentationForWriting

virtual MCanvasRepresentation * GetCanvasRepresentationForWriting ()

Interface Category:

API.

Purpose:

Provides access to the underlying canvas representation, for the purpose of writing.

Calling Context:

Call this function directly.

Parameters:

Return Value:

MCanvasRepresentation * -A pointer to the canvas representation.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Pure virtual function; must be implemented in derived classes.

Member Function: MCanvasSelection::GetCanvasRepresentationForReading

virtual MCanvasRepresentation * GetCanvasRepresentationForReading () const

Interface Category:

API.

Purpose:

Provides access to the underlying canvas representation, for the purpose of reading.

Calling Context:

Call this function directly.

Parameters:

Return Value:

MCanvasRepresentation * -A pointer to the canvas representation.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Pure virtual function; must be implemented in derived classes.

Member Function: MCanvasSelection::Invalidate

virtual void Invalidate (const TGArea &)

Interface Category:

API.

Purpose:

Does whatever is required when selected graphics are changed.

Calling Context:

Called by clients after changing selected graphics.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Pure virtual function; must be implemented in derived classes.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.