OpenFOAM logo
Open Source CFD Toolkit

PSstream.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     PSstream
00027 
00028 Description
00029     PSstream provides code to implement a simple plotting postscript
00030     by declaring it to be an object.
00031 
00032 SourceFiles
00033     PSstream.C
00034     PSstreamIO.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef PSstream_H
00039 #define PSstream_H
00040 
00041 #include "Gstream.H"
00042 #include "OFstream.H"
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 class GEvent;
00050 
00051 
00052 /*---------------------------------------------------------------------------*\
00053                            Class PSstream Declaration
00054 \*---------------------------------------------------------------------------*/
00055 
00056 class PSstream
00057 :
00058     public virtual Gstream
00059 {
00060     // Private data
00061 
00062         fileName postFileName;
00063         OFstream postFile;
00064 
00065     // Private Member Functions
00066 
00067         //- Disallow default bitwise copy construct and assignment
00068         PSstream(const PSstream&);
00069         void operator=(const PSstream&);
00070 
00071         // x() and y() : return the raw PSstream coordinates associated
00072         // with particular points
00073 
00074         int x(const point2D&);
00075         int y(const point2D&);
00076 
00077         // and the X and Y values of the point associated with a particular
00078         // coord
00079 
00080         double x(const coord2D&);
00081         double y(const coord2D&);
00082 
00083 
00084 public:
00085 
00086     // Constructors
00087 
00088         //- Construct from components
00089         PSstream
00090         (
00091             const word& winName,
00092             const colour&,
00093             const colour&,
00094             double,
00095             double,
00096             double = 0.5,
00097             double = 0.5,
00098             int widthX = 800,
00099             int widthY = 800
00100         );
00101 
00102 
00103     // Destructor
00104 
00105         virtual ~PSstream();
00106 
00107 
00108     // Member Functions
00109 
00110         // Event Handlers
00111 
00112             //- Wait for any keypress then return true
00113             int waitForEvent();
00114             int waitForEvent(GEvent&);
00115 
00116         // Change Context
00117 
00118             virtual void setColour(const colour&);
00119             virtual void setLineStyle(const lineStyle&);
00120             virtual void clear();
00121 
00122         // Draw
00123 
00124             virtual void draw(const line2D&);
00125             virtual void draw(const rectangle2D&);
00126             virtual void draw(const polygon2D&);
00127             virtual void draw(const string2D&);
00128             virtual void draw(const structuredScalars2D&);
00129 };
00130 
00131 
00132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00133 
00134 } // End namespace Foam
00135 
00136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00137 
00138 // include inline implementaions
00139 
00140 #include "PSstreamI.H"
00141 
00142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00143 
00144 #endif
00145 
00146 // ************************************************************************* //
For further information go to www.openfoam.org