TRIsurfaceFormatCore.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM 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
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::fileFormats::TRIsurfaceFormatCore
26 
27 Description
28  Internal class used by the TRIsurfaceFormat
29 
30 SourceFiles
31  TRIsurfaceFormatCore.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef TRIsurfaceFormatCore_H
36 #define TRIsurfaceFormatCore_H
37 
38 #include "surfaceFormatsCore.H"
39 #include "triFace.H"
40 
41 #include "IFstream.H"
42 #include "Ostream.H"
43 #include "OFstream.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 namespace fileFormats
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class TRIsurfaceFormatCore Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 :
58  public surfaceFormatsCore
59 {
60  // Private Data
61 
62  bool sorted_;
63 
64  //- The points supporting the facets
65  pointField points_;
66 
67  //- The zones associated with the faces
68  List<label> zoneIds_;
69 
70  //- The solid count, in the order of their first appearance
71  List<label> sizes_;
72 
73 
74  // Private Member Functions
75 
76  //- Disallow default bitwise copy construct
78 
79  //- Disallow default bitwise assignment
80  void operator=(const TRIsurfaceFormatCore&);
81 
82  bool read(const fileName&);
83 
84 
85 public:
86 
87  // Constructors
88 
89  //- Read from file, filling in the information
91 
92 
93  //- Destructor
95 
96 
97  // Member Functions
98 
99  //- File read was already sorted
100  bool sorted() const
101  {
102  return sorted_;
103  }
104 
105  //- Flush all values
106  void clear()
107  {
108  sorted_ = true;
109  points_.clear();
110  zoneIds_.clear();
111  sizes_.clear();
112  }
113 
114  //- Return full access to the points
115  pointField& points()
116  {
117  return points_;
118  }
119 
120  //- Return full access to the zones
122  {
123  return zoneIds_;
124  }
125 
126  //- The list of zone sizes in the order of their first appearance
127  List<label>& sizes()
128  {
129  return sizes_;
130  }
131 };
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace fileFormats
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
List< label > & zoneIds()
Return full access to the zones.
A class for handling file names.
Definition: fileName.H:69
pointField & points()
Return full access to the points.
List< label > & sizes()
The list of zone sizes in the order of their first appearance.
void clear()
Clear the list, i.e. set size to zero.
Definition: List.C:356
bool sorted() const
File read was already sorted.
Internal class used by the TRIsurfaceFormat.
A collection of helper functions for reading/writing surface formats.
Namespace for OpenFOAM.