// $Revision: 1.5 $ // Copyright (C) 1995 Taligent, Inc. All rights reserved. #if 0 --------------------------------------------------------------------------- > Class: | TStandardGraph > Taxonomy Category: | Documented Samples | Stock Browser:Graphing Framework > Interface Category: | Sample. > Inherits From: | MGraphic > Inherited By: | None. > Purpose: | This class is an MGraphic that draws 2-D graphs. It allows the client to have the graph be of any physical size on the screen, with the axes having as many or few values as necessary. > 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: TStandardGraph::TStandardGraph ; | 1. TStandardGraph () | 2. TStandardGraph (const TGraphRange & xRange, const TGraphRange & yRange, const TGPoint & axisLengths =kDefaultAxisLengths) | 3. TStandardGraph (const TStandardGraph & source) > Interface Category: | Sample. > Purpose: | 1. Default constructor. | 2. Properly initializes the graph. | 3. Copy constructor. > Calling Context: | 1. Called by the stream-in operators and anyone who wants an empty graph. However, the graph is not able to draw anything properly until the ranges of the axes are set. | 2. Called by most clients. | 3. Called to copy an object. > Parameters: = 1. Takes no parameters. = 2. const TGraphRange & xRange -The range of values for the x-axis. If you pass it TGraphRange(25, 75), the x-axis starts at the value 25 and goes to 75. = 2. const TGraphRange & yRange -The range of values for the y-axis. If you pass it TGraphRange(25, 75), the y-axis starts at the value 25 and goes to 75. = 2. const TGPoint & axisLengths =These are the axis lengths in points. = 3. const TStandardGraph & 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 --------------------------------------------------------------------------- > Member Function: TStandardGraph::~ TStandardGraph ; | virtual ~ TStandardGraph () > 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: TStandardGraph::operator =; | TStandardGraph & operator =(const TStandardGraph & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TStandardGraph & source -The object to be copied. > 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: TStandardGraph::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | Sample. > Purpose: | Stream-out operator. > Calling Context: | Called to stream out data. > Parameters: = TStream & toStream -The stream the object streams itself out 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: TStandardGraph::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | Sample. > Purpose: | Stream-in operator. > Calling Context: | Called to stream in data. > Parameters: = TStream & fromStream -The stream the object streams itself in 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: TStandardGraph::Draw ; | virtual void Draw (TGrafPort & port) const > Interface Category: | Sample. > Purpose: | Draws the graph. It just iterates through its list of drawers and tells them to draw. > Calling Context: | Often called in other objects' Draw member functions. > Parameters: = TGrafPort & port -The grafport to be drawn into. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStandardGraph::GetGeometricBounds ; | virtual TGRect GetGeometricBounds () const > Interface Category: | Sample. > Purpose: | Returns the bounds of the graph based off of its geometry. It does not take bundle information into account. > Calling Context: | Called whenever a client needs to know the bounds of the whole graph. > Parameters: = Takes no parameters. > Return Value: | The geometry-based bounds of the whole graph. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStandardGraph::TransformBy ; | virtual void TransformBy (const TGrafMatrix & matrix) > Interface Category: | Sample. > Purpose: | Transforms the whole graph, including its drawers. > Calling Context: | Often called by the ScaleBy, TranslateBy, and RotateBy MGraphic routines. > Parameters: = const TGrafMatrix & matrix -The matrix that should be set for the needed transformations. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStandardGraph::GetAxisLengths ; | virtual const TGPoint & GetAxisLengths () const > Interface Category: | Sample. > Purpose: | Returns the length, in points, of both axes. > Calling Context: | Call this function directly. > Parameters: = Takes no parameters. > Return Value: | A point containing the x- and y-axis lengths in points. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStandardGraph::GetXRange ; | virtual const TGraphRange & GetXRange () const > Interface Category: | Sample. > Purpose: | Returns the range of values of the x-axis. > Calling Context: | Call this function directly. > Parameters: = Takes no parameters. > Return Value: | A TGraphRange containing the range of values of the x-axis. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStandardGraph::GetYRange ; | virtual const TGraphRange & GetYRange () const > Interface Category: | Sample. > Purpose: | Returns the range of values of the y-axis. > Calling Context: | Call this function directly. > Parameters: = Takes no parameters. > Return Value: | A TGraphRange containing the range of values of the y-axis. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStandardGraph::MapValuesToPoint ; | 1. virtual TGPoint MapValuesToPoint (GraphValue xValue, GraphValue yValue) const | 2. virtual TGPoint MapValuesToPoint (const TGPoint & valuesToBeConverted) const > Interface Category: | Sample. > Purpose: | 1. Takes an x- and a y GraphValue and maps them to a real-screen point based on the range of values and the length of the axes. | 2. Takes a TGPoint and maps it to a real-screen point based on the range of values and the length of the axes. > Calling Context: | 1. Usually called from the Draw member function of TGraphDrawer objects. | 2. Usually called from the Draw member function of TGraphDrawer objects. > Parameters: = 1. GraphValue xValue -The value on the x-axis. = 1. GraphValue yValue -The value on the y-axis. = 2. const TGPoint & valuesToBeConverted -The point based on graph values, not real-screen values. > Return Value: | Returns a scaled point. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStandardGraph::AdoptDrawer ; | virtual void AdoptDrawer (TGraphDrawer * drawer) > Interface Category: | Sample. > Purpose: | Adopts a drawer. The drawer is used in the Draw member function. > Calling Context: | Usually called when setting up a graph. > Parameters: = TGraphDrawer * drawer -The drawer to adopt. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStandardGraph::OrphanDrawer ; | virtual TGraphDrawer * OrphanDrawer (const TGraphDrawer & drawer) > Interface Category: | Sample. > Purpose: | Releases ownership of a particular drawer. > Calling Context: | Call this function directly. > Parameters: = const TGraphDrawer & drawer -The drawer to release. > Return Value: | Returns the drawer if it is found. It returns NIL otherwise. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStandardGraph::CreateDrawerIterator ; | TIteratorOver < TGraphDrawer > * CreateDrawerIterator () const > Interface Category: | Sample. > Purpose: | Returns an iterator of all of the adopted drawers. This is the only way to get at the list of drawers. > Calling Context: | Call this function directly. > Parameters: = Takes no parameters. > Return Value: | Returns an iterator of all of the adopted drawers. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStandardGraph::GetMatrix ; | const TGrafMatrix & GetMatrix () const > Interface Category: | Sample. > Purpose: | Accesses the matrix. > Calling Context: | Called by derived classes in their Draw functions. > Parameters: = Takes no parameters. > Return Value: | Returns a const reference to the fMatrix data member. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStandardGraph::PrepareAllDrawers ; | virtual void PrepareAllDrawers () const > Interface Category: | Sample. > Purpose: | Gives this graph's adopted drawers a chance to do some preprocessing before drawing. > Calling Context: | Called by this class. > 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: TStandardGraph::DeleteAllDrawers ; | virtual void DeleteAllDrawers () > Interface Category: | Sample. > Purpose: | Deletes this graph's collection of adopted drawers. > Calling Context: | Call this function directly. > 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: TStandardGraph::SetRanges ; | virtual void SetRanges (const TGraphRange & xRange, const TGraphRange & yRange, bool prepareDrawers =false) > Interface Category: | Sample. > Purpose: | Sets the new ranges of values for the x- and y-axes. > Calling Context: | Call this function directly. > Parameters: = const TGraphRange & xRange -The new range of values for the x-axis. = const TGraphRange & yRange -The new range of values for the y-axis. = bool prepareDrawers =false -If true, this graph calls TGraphDrawer::Prepare for each of its adopted drawers. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStandardGraph::SetYRange ; | virtual void SetYRange (const TGraphRange & range, bool prepareDrawers =false) > Interface Category: | Sample. > Purpose: | Sets the range of values for the y-axis. > Calling Context: | Call this function directly. > Parameters: = const TGraphRange & range -The new range of values for the y-axis. = bool prepareDrawers =false -If true, this graph calls TGraphDrawer::Prepare for each of its adopted drawers. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStandardGraph::SetXRange ; | virtual void SetXRange (const TGraphRange & range, bool prepareDrawers =false) > Interface Category: | Sample. > Purpose: | Sets the range of values for the x-axis. > Calling Context: | Call this function directly. > Parameters: = const TGraphRange & range -The new range of values for the x-axis. = bool prepareDrawers =false -If true, this graph calls TGraphDrawer::Prepare for each of its adopted drawers. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStandardGraph::SetAxisLengths ; | virtual void SetAxisLengths (const TGPoint & axisLengths, bool prepareDrawers =false) > Interface Category: | Sample. > Purpose: | Sets the x- and y-axis lengths in points. > Calling Context: | Call this function directly. > Parameters: = const TGPoint & axisLengths -The new axis lengths in points. = bool prepareDrawers =false -If true, the graph calls TGraphDrawer::Prepare for each of its adopted drawers. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TStandardGraph::GetRanges ; | virtual void GetRanges (TGraphRange & xRange, TGraphRange & yRange) const > Interface Category: | Sample. > Purpose: | Returns the current x- and y-axis ranges. > Calling Context: | Call this function directly. > Parameters: = TGraphRange & xRange -The graph range to copy the x-axis range into. = TGraphRange & yRange -The graph range to copy the y-axis range into. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif