OpenFOAM logo
Open Source CFD Toolkit

polygon2D.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     polygon2D
00027 
00028 Description
00029     General 2D polygon.
00030 
00031 SourceFiles
00032     polygon2DI.H
00033     polygon2D.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef polygon2D_H
00038 #define polygon2D_H
00039 
00040 #include "shape2D.H"
00041 #include "point2D.H"
00042 #include "List.H"
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 class Gstream;
00050 class Istream;
00051 class Ostream;
00052 
00053 /*---------------------------------------------------------------------------*\
00054                            Class polygon2D Declaration
00055 \*---------------------------------------------------------------------------*/
00056 
00057 class polygon2D
00058 :
00059     public virtual shape2D
00060 {
00061     // Private data
00062 
00063         List<point2D> vertices;
00064 
00065 public:
00066 
00067     // Constructors
00068 
00069         //- Construct from components
00070         inline polygon2D
00071         (
00072             const point2D&,
00073             const point2D&,
00074             const point2D&
00075         );
00076 
00077 
00078         //- Construct from Istream
00079         polygon2D(Istream&);
00080 
00081 
00082     // Destructor
00083 
00084         virtual ~polygon2D();
00085 
00086 
00087     // Member Functions
00088 
00089         //- Access
00090         inline const List<point2D>& verts() const;
00091 
00092         //- Draw
00093         virtual void draw(Gstream&) const;
00094 
00095         //- Write
00096         virtual void write(Ostream&) const;
00097 
00098 
00099     // Member Operators
00100 
00101         inline void operator=(const polygon2D&);
00102 
00103 
00104     // Friend Operators
00105 
00106         inline friend Gstream& operator<<(Gstream&, const polygon2D&);
00107 
00108 
00109     // IOstream Operators
00110 
00111         inline friend Ostream& operator<<(Ostream&, const polygon2D&);
00112 };
00113 
00114 
00115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00116 
00117 } // End namespace Foam
00118 
00119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00120 
00121 #include "polygon2DI.H"
00122 
00123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00124 
00125 #endif
00126 
00127 // ************************************************************************* //
For further information go to www.openfoam.org