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 the label of the object it is associated to and
33 \*---------------------------------------------------------------------------*/
35 #ifndef refLabelledPoint_H
36 #define refLabelledPoint_H
38 #include "labelledPoint.H"
39 #include "contiguous.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class refLabelledPoint Declaration
48 \*---------------------------------------------------------------------------*/
50 class refLabelledPoint
53 //- label of the object it is associated to
56 //- point to be transferred
69 //- Construct from label and labelledPoint
70 refLabelledPoint(const label pl, const labelledPoint& p)
81 //- return label of the object it is associated to
82 inline label objectLabel() const
87 //- return labelledPoint
88 inline const labelledPoint& lPoint() const
95 inline void operator=(const refLabelledPoint& lp)
97 objectLabel_ = lp.objectLabel_;
101 inline bool operator==(const refLabelledPoint& lp) const
103 if( objectLabel_ == lp.objectLabel_ )
109 inline bool operator!=(const refLabelledPoint& lp) const
111 return !this->operator==(lp);
115 friend Ostream& operator<<(Ostream& os, const refLabelledPoint& lp)
117 os << token::BEGIN_LIST;
118 os << lp.objectLabel_ << token::SPACE;
119 os << lp.p_ << token::END_LIST;
121 // Check state of Ostream
122 os.check("operator<<(Ostream&, const refLabelledPoint&");
127 friend Istream& operator>>(Istream& is, refLabelledPoint& lp)
129 // Read beginning of refLabelledPoint
130 is.readBegin("refLabelledPoint");
132 is >> lp.objectLabel_;
135 // Read end of refLabelledPoint
136 is.readEnd("refLabelledPoint");
138 // Check state of Istream
139 is.check("operator>>(Istream&, refLabelledPoint");
145 //- Specify data associated with refLabelledPoint type is contiguous
147 inline bool contiguous<refLabelledPoint>() {return true;}
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 } // End namespace Foam
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 // ************************************************************************* //