OpenFOAM logo
Open Source CFD Toolkit

Gstream.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2005 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Gstream
00027 
00028 Description
00029 
00030 SourceFiles
00031     Gstream.C
00032 
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef Gstream_H
00037 #define Gstream_H
00038 
00039 #include "coord2D.H"
00040 #include "point2D.H"
00041 #include "string.H"
00042 #include "word.H"
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 class colour;
00050 class lineStyle;
00051 
00052 class line2D;
00053 class rectangle2D;
00054 class polygon2D;
00055 class string2D;
00056 class structuredScalars2D;
00057 
00058 /*---------------------------------------------------------------------------*\
00059                            Class Gstream Declaration
00060 \*---------------------------------------------------------------------------*/
00061 
00062 class Gstream
00063 {
00064     // Private data
00065 
00066         word winName_;       // Name of window
00067         string font_;       // font name for text
00068 
00069 
00070     // Private Member Functions
00071 
00072         //- Disallow default bitwise copy construct and assignment
00073         Gstream(const Gstream&);
00074         void operator=(const Gstream&);
00075 
00076 
00077 protected:
00078 
00079     // Protected data
00080 
00081         point2D scale_;      // X,Y scaling ratios
00082         point2D center_;     // ratio of centre position to widths
00083         coord2D width_;      // absolute width of window in pixels
00084 
00085 
00086 public:
00087 
00088     // Constructors
00089 
00090         // from components
00091 
00092         Gstream
00093         (
00094             const word&,
00095             const double,
00096             const double,
00097             const double = 0.5,
00098             const double = 0.5,
00099             const int widthX = 800,
00100             const int widthY = 800
00101         );
00102 
00103 
00104     // Destructor
00105 
00106         virtual ~Gstream();
00107 
00108 
00109     // Member Functions
00110 
00111         // Access
00112 
00113             const word& winName()
00114             {
00115                 return winName_;
00116             }
00117 
00118             string font()
00119             {
00120                 return font_;
00121             }
00122 
00123             //- X,Y scaling ratios
00124             const point2D& scale() const
00125             {
00126                 return scale_;
00127             }
00128 
00129             //- ratio of centre position to widths
00130             const point2D& centre() const
00131             {
00132                 return center_;
00133             }
00134 
00135             //- absolute width of window in pixels
00136             const coord2D& width() const
00137             {
00138                 return width_;
00139             }
00140 
00141 
00142         // Change Context
00143 
00144             virtual void setColour(const colour&) = 0;
00145             virtual void setLineStyle(const lineStyle&) = 0;
00146             virtual void clear() = 0;
00147 
00148 
00149         // Draw
00150 
00151             virtual void draw(const line2D&) = 0;
00152             virtual void draw(const rectangle2D&) = 0;
00153             virtual void draw(const polygon2D&) = 0;
00154             virtual void draw(const string2D&) = 0;
00155             virtual void draw(const structuredScalars2D&) = 0;
00156 };
00157 
00158 
00159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00160 
00161 } // End namespace Foam
00162 
00163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00164 
00165 #endif
00166 
00167 // ************************************************************************* //
For further information go to www.openfoam.org