OpenFOAM logo
Open Source CFD Toolkit

string2DI.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     string2D
00027 
00028 Description
00029     2D string.
00030 
00031 \*---------------------------------------------------------------------------*/
00032 
00033 #include "Gstream.H"
00034 
00035 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00036 
00037 namespace Foam
00038 {
00039 
00040 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00041 
00042 // Construct from components
00043 inline string2D::string2D(const point2D& s, const string& c)
00044 :
00045     start(s),
00046     characters(c),
00047     direction(1.0, 0.0),
00048     Horizontal(true)
00049 {}
00050 
00051 
00052 inline string2D::string2D(const point2D& s, const string& c, const point2D& d)
00053 :
00054     start(s),
00055     characters(c),
00056     direction(d),
00057     Horizontal(false)
00058 {}
00059 
00060 
00061 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00062 
00063 inline bool string2D::horizontal() const
00064 {
00065     return Horizontal;
00066 }
00067 
00068 inline scalar string2D::x() const
00069 {
00070     return start.x();
00071 }
00072 
00073 inline scalar string2D::y() const
00074 {
00075     return start.y();
00076 }
00077 
00078 inline const string& string2D::text() const
00079 {
00080     return characters;
00081 }
00082 
00083 inline const point2D& string2D::startPt() const
00084 {
00085     return start;
00086 }
00087 
00088 
00089 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
00090 
00091 inline void string2D::operator=(const string2D& a)
00092 {
00093     characters = a.characters;
00094     start = a.start;
00095     direction = a.direction;
00096     Horizontal = a.Horizontal;
00097 }
00098 
00099 
00100 // * * * * * * * * * * * * * * * Friend Operators  * * * * * * * * * * * * * //
00101 
00102 inline Gstream& operator<<(Gstream& gs, const string2D& s2D)
00103 {
00104     gs.draw(s2D);
00105     return gs;
00106 }
00107 
00108 
00109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00110 
00111 } // End namespace Foam
00112 
00113 // ************************************************************************* //
For further information go to www.openfoam.org