// $Revision: 1.11 $ // Copyright (C) 1995 Taligent, Inc. All rights reserved. #if 0 --------------------------------------------------------------------------- > Class: | TSimulationModel > Taxonomy Category: | ConcurrentGraphics | Interface Subsystem > Interface Category: | Sample. > Inherits From: | TGUIEmbedderModel > Inherited By: | None. > Purpose: | Creates a TSimulationPresenterState. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | None. > Concurrency: | _Not_ multithread safe. > Resource Use: | No special requirements. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationModel::CreateSelection ; | virtual TModelSelection * CreateSelection () const > Interface Category: | Sample. > Purpose: | Creates a whole model selection. > Calling Context: | Called by the Document framework. > Parameters: = Takes no parameters. > Return Value: | A new model selection. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationModel::HandleLevelEnded ; | virtual void HandleLevelEnded (const TNotification & note) > Interface Category: | Sample. > Purpose: | Handles notification from the TSimulationLevel when a level ends. By default, it simply restart the level. > Calling Context: | Called by the Notification framework. > Parameters: = const TNotification & note -Notification object sent by TSimulation level. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationModel::HandleImageChanged ; | virtual void HandleImageChanged (const TNotification & note) > Interface Category: | Sample. > Purpose: | Handles notification sent by TSimulationLevel when the image buffer has been modified. The notification is forwarded to other interested components. > Calling Context: | Called by the Notification framework. > Parameters: = const TNotification & note -Notification object sent by TSimulation level. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationModel::OrphanSimulation ; | virtual TSimulationLevel * OrphanSimulation () > Interface Category: | Sample. > Purpose: | Returns the current TSimulationLevel and begins a new one. > Calling Context: | Called by TSimulationModelSelection to perform Cut/Copy/Paste. > Parameters: = Takes no parameters. > Return Value: | The current simulation level. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Caller owns the returned TSimulationLevel. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationModel::AdoptSimulation ; | virtual void AdoptSimulation (TSimulationLevel * newSimulation) > Interface Category: | Sample. > Purpose: | Discards the currently running simulation and begins running newSimulation. > Calling Context: | Called by TSimulationModelSelection to perform Cut/Copy/Paste. > Parameters: = TSimulationLevel * newSimulation -The new simulation. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationModel::CopySimulation ; | virtual TSimulationLevel * CopySimulation () const > Interface Category: | Sample. > Purpose: | Creates a copy of the currently running simulation. > Calling Context: | Called by TSimulationModelSelection to perform Cut/Copy/Paste. > Parameters: = Takes no parameters. > Return Value: | Returns a copy of the current simulation. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationModel::GetImageChangedInterest ; | virtual TModelInterest GetImageChangedInterest () const > Interface Category: | Sample. > Purpose: | Returns an interest for notification when the image buffer is modified. > Calling Context: | Called by TSimulationView when it is added to the view hierarchy. > Parameters: = Takes no parameters. > Return Value: | Interest for notification when the image buffer is modified > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationModel::StopSimulation ; | virtual void StopSimulation () > Interface Category: | Sample. > Purpose: | Stops the current simulation. Simulation time is stopped and all action is halted. > Calling Context: | Called by TSimulationView to when the simulation is deactivated. > 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: TSimulationModel::StartSimulation ; | virtual void StartSimulation () > Interface Category: | Sample. > Purpose: | Starts the current simulation. > Calling Context: | Called by TSimulationView when the simulation is activated. > 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: TSimulationModel::DoneWithImage ; | virtual void DoneWithImage () const > Interface Category: | Sample. > Purpose: | Releases the image buffer so the simulation can continue. > Calling Context: | Called by clients when done using the image buffer. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Must be preceded by a call to UseImage. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationModel::UseImage ; | virtual const TImage * UseImage () const > Interface Category: | Sample. > Purpose: | Stops the simulation momentarily so the image buffer can be inspected by clients. > Calling Context: | Called by TSimulationModel::UseImage. > Parameters: = Takes no parameters. > Return Value: | The image buffer. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationModel::Hash ; | virtual long Hash () const > Interface Category: | Sample. > Purpose: | Returns a representative hash value. > Calling Context: | Typically called by collection comparators. > Parameters: = Takes no parameters. > Return Value: | A representative hash value. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationModel::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | Sample. > Purpose: | Stream-in operator. > Calling Context: | Called to stream in data. > Parameters: = TStream & fromStream -Stream to read from. > 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. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationModel::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | Sample. > Purpose: | Stream-out operator. > Calling Context: | Called to stream out data. > Parameters: = TStream & toStream -Stream to write to. > 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. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationModel::operator =; | TSimulationModel & operator =(const TSimulationModel & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TSimulationModel & source -Object to copy. > 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. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationModel::~ TSimulationModel ; | virtual ~ TSimulationModel () > 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 --------------------------------------------------------------------------- > Member Function: TSimulationModel::KeyUp ; | virtual bool KeyUp (TKeyUpEvent & event) > Interface Category: | Sample. > Purpose: | Sends key-up event to the simulation. > Calling Context: | Called by TSimulationView when a key is released. > Parameters: = TKeyUpEvent & event -The key-up event. > Return Value: | Returns true if the simulation used the event. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationModel::KeyDown ; | virtual bool KeyDown (TKeyDownEvent & event) > Interface Category: | Sample. > Purpose: | Sends key-down event to the simulation. > Calling Context: | Called by TSimulationView when a key is pressed. > Parameters: = TKeyDownEvent & event -The key-down event. > Return Value: | Returns true if the simulation used the event. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationModel::IsEqual ; | virtual bool IsEqual (const MCollectible * other) const > Interface Category: | Sample. > Purpose: | MCollectible comparison function. > Calling Context: | Typically called by collection comparators. > Parameters: = const MCollectible * other -Object to compare to. > Return Value: | Returns true if other is a TBullet, at the same position, moving at the velocity. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | This interface is obsolete. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationModel::TSimulationModel ; | 1. TSimulationModel () | 2. TSimulationModel (const TSimulationModel & source) > Interface Category: | Sample. > Purpose: | 1. Default constructor. | 2. Copy constructor. > Calling Context: | 1. Called by the stream-in operators. | 2. Called to copy an object. > Parameters: = 1. Takes no parameters. = 2. const TSimulationModel & source -The object to copy. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TSimulationView > Taxonomy Category: | ConcurrentGraphics | Interface Subsystem > Interface Category: | Sample. > Inherits From: | TGUIEmbedderModelView, MKeyEventHandler > Inherited By: | None. > Purpose: | Displays a TSimulationPresenterState. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | None. > Concurrency: | Multithread safe. > Resource Use: | No special requirements. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationView::DrawContents ; | virtual void DrawContents (TGrafPort & port) const > Interface Category: | Sample. > Purpose: | Refreshes a portion of the view by drawing to the supplied GrafPort. > Calling Context: | Called when some or all of the view must be refreshed. > Parameters: = TGrafPort & port -The port to draw into. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationView::HandleActivate ; | virtual void HandleActivate () > Interface Category: | Sample. > Purpose: | Activates the presenter state and prepares the view for notification. > Calling Context: | Called automatically whenever this view becomes the active view. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationView::HandleDeactivate ; | virtual void HandleDeactivate () > Interface Category: | Sample. > Purpose: | Deactivates the presenter state and notification for this view. > Calling Context: | Called automatically when this view goes from active to inactive state. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationView::HandleRefreshNeeded ; | virtual void HandleRefreshNeeded (const TNotification & note) > Interface Category: | Sample. > Purpose: | Updates the screen when refresh is needed. > Calling Context: | Called by the Notification framework when TSimulationLevel registers a refresh. > Parameters: = const TNotification & note -TSimulationRefreshNote. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationView::~ TSimulationView ; | virtual ~ TSimulationView () > 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: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationView::TSimulationView ; | 1. TSimulationView (TGUIBundle * theBundleToAlias) | 2. TSimulationView () | 3. TSimulationView (const TSimulationView & source) > Interface Category: | Sample. > Purpose: | 1. Constructor. | 2. Default constructor. | 3. Copy constructor. > Calling Context: | 1. Called by presenter to create the main content view. | 2. Called by the stream-in operators. | 3. Called to copy an object. > Parameters: = 1. TGUIBundle * theBundleToAlias -Bundle to pass to super class. = 2. Takes no parameters. = 3. const TSimulationView & source -Object to copy. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationView::HandleBeforeDisconnectionFromViewRoot ; | virtual void HandleBeforeDisconnectionFromViewRoot () > Interface Category: | Sample. > Purpose: | Stops simulation and stops processing key events. > Calling Context: | Called by framework. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationView::HandleAfterConnectionToViewRoot ; | virtual void HandleAfterConnectionToViewRoot () > Interface Category: | Sample. > Purpose: | Starts simulation and begins processing key events. > Calling Context: | Called by framework. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationView::KeyUp ; | virtual bool KeyUp (TKeyUpEvent & event) > Interface Category: | Sample. > Purpose: | Handles key-up events from the input system. > Calling Context: | Called by the input system. > Parameters: = TKeyUpEvent & event -The key-up event. > Return Value: | Returns true if key up event was handled. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationView::KeyDown ; | virtual bool KeyDown (TKeyDownEvent & event) | Sample. > Purpose: | Handles key-down events from the Input system. > Calling Context: | Called by the input system. > Parameters: = TKeyDownEvent & event -The key-down event. > Return Value: | Returns true if view handled key-down. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TSimulationSelection > Taxonomy Category: | ConcurrentGraphics | Interface Subsystem > Interface Category: | API. > Inherits From: | TGUIEmbedderModelSelectionFor > Inherited By: | None. > Purpose: | Provides Cut/Copy/Paste for the application. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | None > Concurrency: | _Not_ multithread safe. > Resource Use: | No special requirements. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationSelection::TSimulationSelection ; | 1. TSimulationSelection () | 2. TSimulationSelection (const TModelReference & model) | 3. TSimulationSelection (const TSimulationModel & theModel) | 4. TSimulationSelection (const TSimulationSelection & source) > Interface Category: | API. > Purpose: | 1. Default constructor. | 2. Constructor. | 3. Constructor | 4. Copy constructor. > Calling Context: | 1. Called by the stream-in operators. | 2. Called by TSimulationModel. | 3. Called by clients. | 4. Called to copy an object. > Parameters: = 1. Takes no parameters. = 2. const TModelReference & model -Reference to model to select. = 3. const TSimulationModel & theModel -Model to select. = 4. const TSimulationSelection & source -Object to copy. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationSelection::~ TSimulationSelection ; | ~ TSimulationSelection () > Interface Category: | API. > 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 --------------------------------------------------------------------------- > Member Function: TSimulationSelection::operator =; | TSimulationSelection & operator =(const TSimulationSelection & source) > Interface Category: | API. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TSimulationSelection & source -Object to copy. > 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. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationSelection::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | API. > Purpose: | Stream-out operator. > Calling Context: | Called to stream out data. > Parameters: = TStream & toStream -Stream to write to. > 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. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationSelection::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | API. > Purpose: | Stream-in operator. > Calling Context: | Called to stream in data. > Parameters: = TStream & fromStream -Stream to read from. > 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. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationSelection::CopyDataIntoModelSubclass ; | virtual void CopyDataIntoModelSubclass (TSimulationModel & destModel) const > Interface Category: | API. > Purpose: | Provides support for Copy operations. > Calling Context: | Called by framework. > Parameters: = TSimulationModel & destModel -Model to copy data into. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationSelection::MoveDataOutofModelSubclass ; | virtual void MoveDataOutofModelSubclass (TSimulationModel & destModel) > Interface Category: | API. > Purpose: | Provides support for Paste operation. > Calling Context: | Called by framework. > Parameters: = TSimulationModel & destModel -Model to copy data from. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationSelection::MoveDataIntoModelSubclass ; | virtual void MoveDataIntoModelSubclass (TSimulationModel & sourceModel) > Interface Category: | API. > Purpose: | Provides support for Cut operation. > Calling Context: | Called by framework. > Parameters: = TSimulationModel & sourceModel -Model to put data into. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif