Class: TScaleCanvasGraphicCmd

Declaration: CanvasCommands.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TChangeCanvasGraphicCmd

Inherited By:

None.

Purpose:

Scales all the canvas graphics in the target selection.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Intended to be used as is but can also be derived.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TScaleCanvasGraphicCmd::TScaleCanvasGraphicCmd

  1. TScaleCanvasGraphicCmd ()
  2. TScaleCanvasGraphicCmd (const TGPoint & centerOfScale)
  3. TScaleCanvasGraphicCmd (const TGPoint & scaleFactor, const TGPoint & centerOfScale)
  4. TScaleCanvasGraphicCmd (const TScaleCanvasGraphicCmd &)

Interface Category:

API.

Purpose:

  1. Default constructor, assumes TGPoint(0,0) as the center of scale.
  2. Constructs from a center of scale.
  3. Constructs from a scale factor and a center of scale.
  4. Copy constructor.

Calling Context:

  1. Called by the stream-in operators and to create a new command.
  2. Called to create a new command.
  3. Called to create a new command.
  4. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The center of scale must remain constant throughout the execution of an incremental scale command.

Member Function: TScaleCanvasGraphicCmd::~TScaleCanvasGraphicCmd

virtual ~ TScaleCanvasGraphicCmd ()

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

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScaleCanvasGraphicCmd::operator=

TScaleCanvasGraphicCmd & operator =(const TScaleCanvasGraphicCmd &)

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: TScaleCanvasGraphicCmd::SetScaleFactor

virtual void SetScaleFactor (const TGPoint &)

Interface Category:

API.

Purpose:

Sets the scale factor used for scaling graphics when the command is done.

Calling Context:

Typically called by the same client that creates the command.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Can be called multiple times after command construction for incremental commands. A point specifies the scale factor in the x- and y-directions.

Member Function: TScaleCanvasGraphicCmd::BeginChange

virtual void BeginChange (MCanvasRepresentation &, MCanvasGraphic &)

Interface Category:

API.

Purpose:

Scales the specified canvas graphic and saves undo information to later restore the graphic in UndoChange.

Calling Context:

Called by TChangeCanvasGraphicCmd::HandleDoBegin.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

TCanvasGraphicAssociationsWith is used to save the entire graphic for undo.

Member Function: TScaleCanvasGraphicCmd::ContinueChange

virtual void ContinueChange (MCanvasRepresentation &, MCanvasGraphic &)

Interface Category:

API.

Purpose:

Scales the specified canvas graphic.

Calling Context:

Called by TChangeCanvasGraphicCmd::HandleDoIncrement.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TScaleCanvasGraphicCmd::UndoChange

virtual void UndoChange (MCanvasRepresentation &, MCanvasGraphic &)

Interface Category:

API.

Purpose:

Undoes the prior changes to a specified canvas graphic and saves redo information to later restore the graphic in RedoChange.

Calling Context:

Called for each canvas graphic in the target selection by TChangeCanvasGraphicCmd::HandleUndo.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

TCanvasGraphicAssociationsWith is used to save the entire graphic for undo and redo. Undo is accomplished by calling MCanvasRepresentation::Swap to swap the saved graphic for the current one.

Member Function: TScaleCanvasGraphicCmd::RedoChange

virtual void RedoChange (MCanvasRepresentation &, MCanvasGraphic &)

Interface Category:

API.

Purpose:

Redoes changes to a specified canvas graphic and saves undo information to later restore the graphic in UndoChange.

Calling Context:

Called for each canvas graphic in the target selection by TChangeCanvasGraphicCmd::HandleRedo.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

TCanvasGraphicAssociationsWith is used to save the entire graphic for undo and redo. Redo is accomplished by calling MCanvasRepresentation::Swap to swap the saved graphic for the current one.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.