OpenFOAM logo
Open Source CFD Toolkit

colour.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     colour
00027 
00028 Description
00029 
00030 
00031 SourceFiles
00032     colourI.H
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef colour_H
00037 #define colour_H
00038 
00039 #include "scalar.H"
00040 #include "word.H"
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 class Istream;
00048 class Ostream;
00049 
00050 /*---------------------------------------------------------------------------*\
00051                            Class colour Declaration
00052 \*---------------------------------------------------------------------------*/
00053 
00054 class colour
00055 {
00056     // Private data
00057 
00058         word name_;
00059         scalar r_, g_, b_;
00060 
00061 public:
00062 
00063     // Constructors
00064 
00065         //- Construct null
00066         inline colour();
00067 
00068         //- Construct from components
00069         inline colour
00070         (
00071             const word& nam,
00072             const scalar r,
00073             const scalar g,
00074             const scalar b
00075         );
00076 
00077         //- Construct from Istream
00078         inline colour(Istream&);
00079 
00080         //- Construct as copy
00081         inline colour(const colour&);
00082 
00083 
00084     // Destructor
00085 
00086         inline ~colour();
00087 
00088 
00089     // Member Functions
00090 
00091         // Access
00092 
00093             inline const word& name() const;
00094             inline scalar r() const;
00095             inline scalar g() const;
00096             inline scalar b() const;
00097 
00098 
00099     // Member Operators
00100 
00101         inline void operator=(const colour&);
00102 
00103 
00104     // Friend Operators
00105 
00106         inline friend bool operator==(const colour&, const colour&);
00107         inline friend bool operator!=(const colour&, const colour&);
00108 
00109 
00110     // IOstream Operators
00111 
00112         inline friend Istream& operator>>(Istream&, colour&);
00113         inline friend Ostream& operator<<(Ostream&, const colour&);
00114 };
00115 
00116 
00117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00118 
00119 } // End namespace Foam
00120 
00121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00122 
00123 // include inline implementaions
00124 
00125 #include "colourI.H"
00126 
00127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00128 
00129 #endif
00130 
00131 // ************************************************************************* //
For further information go to www.openfoam.org