1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | cfMesh: A library for mesh generation
5 \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6 \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of cfMesh.
11 cfMesh is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 3 of the License, or (at your
14 option) any later version.
16 cfMesh is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
28 A class containing point label and its coordinates. It is used for
29 exchanging data over processors
33 \*---------------------------------------------------------------------------*/
35 #ifndef labelledPoint_H
36 #define labelledPoint_H
40 #include "contiguous.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Class labelledPoint Declaration
49 \*---------------------------------------------------------------------------*/
70 //- Construct from point and label
71 labelledPoint(const label pl, const point& p)
82 //- return point label
83 inline label pointLabel() const
88 inline label& pointLabel()
93 //- return point coordinates
94 inline const point& coordinates() const
99 inline point& coordinates()
106 inline void operator=(const labelledPoint& lp)
108 pLabel_ = lp.pLabel_;
109 coords_ = lp.coords_;
112 inline bool operator==(const labelledPoint& lp) const
114 if( pLabel_ == lp.pLabel_ )
120 inline bool operator!=(const labelledPoint& lp) const
122 return !this->operator==(lp);
126 friend Ostream& operator<<(Ostream& os, const labelledPoint& lp)
128 os << token::BEGIN_LIST;
129 os << lp.pLabel_ << token::SPACE;
130 os << lp.coords_ << token::END_LIST;
132 // Check state of Ostream
133 os.check("operator<<(Ostream&, const labelledPoint&");
138 friend Istream& operator>>(Istream& is, labelledPoint& lp)
140 // Read beginning of labelledPoint
141 is.readBegin("labelledPoint");
146 // Read end of labelledPoint
147 is.readEnd("labelledPoint");
149 // Check state of Istream
150 is.check("operator>>(Istream&, labelledPoint");
156 //- Specify data associated with labelledPoint type is contiguous
158 inline bool contiguous<labelledPoint>() {return true;}
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 } // End namespace Foam
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 // ************************************************************************* //