// $Revision: 1.10 $ // Copyright (C) 1995 Taligent, Inc. All rights reserved. #if 0 --------------------------------------------------------------------------- > Class: | MRefreshable > Taxonomy Category: | ConcurrentGraphics | Refresh Subsystem > Interface Category: | Sample. > Inherits From: | None. > Inherited By: | TAbstractActor | TSimulationBackground > Purpose: | Provides abstract protocol needed by TRefreshThread for managing refreshable (renderable) objects. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | TAbstractActor, TSimulationBackground. > Concurrency: | _Not_ multithread safe. > Resource Use: | No special requirements. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MRefreshable::MRefreshable ; | MRefreshable () > Interface Category: | Sample. > Purpose: | Default constructor. > Calling Context: | Called by the streaming operators and derived classes. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MRefreshable::PreRefresh ; | virtual void PreRefresh (const TTime & interval) > Interface Category: | Sample. > Purpose: | Does pre-refresh processing. > Calling Context: | _Always_ called by TRefreshThead prior to calling Draw. > Parameters: = const TTime & interval -Amount of time that has passed since last refresh. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | The interval parameter can be used to drive time-based animation. This member function should be called by derived classes when it is overridden. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MRefreshable::PostRefresh ; | virtual void PostRefresh (const TTime & interval) > Interface Category: | Sample. > Purpose: | Performs post-refresh processing. > Calling Context: | Called by the Refresh thread. > Parameters: = const TTime & interval -Amount of time that has elapsed since last refresh occurred. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | This function is _always_ called if PreRefresh is called, even if no refresh was needed and Draw was not called. This member function must be called by derived classes when overriding PostRefresh. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MRefreshable::Draw ; | virtual void Draw (TGrafPort & port) const > Interface Category: | Sample. > Purpose: | Draws the object in the specified port. > Calling Context: | Called by the Refresh thread. > Parameters: = TGrafPort & port -The port to draw in. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MRefreshable::~ MRefreshable ; | virtual ~ MRefreshable () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TRefreshThread > Taxonomy Category: | ConcurrentGraphics | Refresh Subsystem > Interface Category: | Sample. > Inherits From: | TPeriodicThread > Inherited By: | None. > Purpose: | This class provides a thread that renders a set of MRefreshable objects on a background at periodic intervals. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | None. > Concurrency: | _Not_ multithread safe. TRefreshThread must be paused before any of its member functions are called. > Resource Use: | TRefreshThread does not own its MRefreshable objects. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TRefreshThread::TRefreshThread ; | TRefreshThread (TGrafPort * port, const TTime & rate =kDefaultFrameRate) > Interface Category: | Sample. > Purpose: | Constructs a TRefreshThread that renders into the specified port at the specified rate. > Calling Context: | Called by clients. > Parameters: = TGrafPort * port -The port to render in. = const TTime & rate =kDefaultFrameRate -Rate at which to render. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. TRefreshThread must be. > Other Considerations: | If a background is going to be used, the port parameter should point to an off-screen port. Rendering operations are not clipped, so drawing a background typically leaves part of the image invalid (erased). --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TRefreshThread::Add ; | virtual void Add (MRefreshable * object) > Interface Category: | Sample. > Purpose: | Adds an object to list of objects to be rendered. > Calling Context: | Called by clients. > Parameters: = MRefreshable * object -Object to be rendered. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. TRefreshThread must be. > Other Considerations: | The thread must be paused before objects are added. Objects are not owned by the thread. Objects should be removed before they are destroyed. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TRefreshThread::Remove ; | virtual MRefreshable * Remove (MRefreshable & object) > Interface Category: | Sample. > Purpose: | Removes object from list of rendered objects. > Calling Context: | Called by clients. > Parameters: = MRefreshable & object -Object to be removed. > Return Value: | Pointer to object removed or NIL if object was not being rendered (previously added). > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. TRefreshThread must be. > Other Considerations: | The thread must be paused before objects are removed. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TRefreshThread::RemoveAll ; | virtual void RemoveAll () > Interface Category: | Sample. > Purpose: | Removes all objects from list so nothing but the background is rendered (if one has been set). > Calling Context: | Called by clients. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. TRefreshThread must be. > Other Considerations: | The thread must be paused before objects are removed. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TRefreshThread::SetBackground ; | virtual void SetBackground (MRefreshable * background) > Interface Category: | Sample. > Purpose: | Sets a new background to be rendered in areas not covered by other objects. If NIL is passed, no background is rendered. > Calling Context: | Called by clients. > Parameters: = MRefreshable * background -New background. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. TRefreshThread must be. > Other Considerations: | Thread must be paused before this function is called. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TRefreshThread::HandleIntervalPassed ; | virtual void HandleIntervalPassed (const TTime & interval) > Interface Category: | Sample. > Purpose: | Protected function that performs rendering. > Calling Context: | Called by base class (TPeriodicThread). > Parameters: = const TTime & interval -Amount of time that has passed since the last time this function was called. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. TRefreshThread must be. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TRefreshThread::GetDelayInterval ; | virtual void GetDelayInterval (TTime & interval) const > Interface Category: | Sample. > Purpose: | Returns the refresh rate in the interval parameter. > Calling Context: | Called by base class (TPeriodicThread). > Parameters: = TTime & interval -The refresh rate. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. TRefreshThread must be. > Other Considerations: | None --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TRefreshThread::CreateRefreshInterest ; | TInterest * CreateRefreshInterest () > Interface Category: | Sample. > Purpose: | Creates an interest for notification of when rendering has occurred. The notification sent is a TSimulationRefreshNotification. > Calling Context: | Called by clients. > Parameters: = Takes no parameters. > Return Value: | New notification interest. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. TRefreshThread must be. > Other Considerations: | Caller is responsible for deleting the interest object --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TRefreshThread::~ TRefreshThread ; | virtual ~ TRefreshThread () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. TRefreshThread must be. > Other Considerations: | None. --------------------------------------------------------------------------- #endif