Go to the documentation of this file.
61 <<
"Cannot read file " << filename
66 string hdr = this->getLineNoComment(is);
70 <<
"OFF file " << filename <<
" does not start with 'OFF'"
78 string line = this->getLineNoComment(is);
81 lineStream >>
nPoints >> nElems >> nEdges;
89 line = this->getLineNoComment(is);
92 lineStream >>
x >>
y >> z;
94 pointLst[pointi] =
point(
x,
y, z);
101 for (
label facei = 0; facei < nElems; ++facei)
103 line = this->getLineNoComment(is);
109 lineStream >> nVerts;
115 lineStream >> verts[vertI];
124 for (
label fp1 = 1; fp1 <
f.size() - 1; fp1++)
126 label fp2 =
f.fcIndex(fp1);
128 dynFaces.
append(Face{
f[0],
f[fp1],
f[fp2]});
164 <<
"Cannot open file for writing " << filename
170 <<
"# Geomview OFF file written " << clock::dateTime().c_str() <<
nl
172 <<
"# points : " << pointLst.
size() <<
nl
173 <<
"# faces : " << faceLst.
size() <<
nl
174 <<
"# zones : " << zoneLst.
size() <<
nl;
179 os <<
"# " << zoneI <<
" " << zoneLst[zoneI].name()
180 <<
" (nFaces: " << zoneLst[zoneI].
size() <<
")" <<
nl;
184 <<
"# nPoints nFaces nEdges" <<
nl
185 << pointLst.
size() <<
' ' << faceLst.
size() <<
' ' << 0 <<
nl
187 <<
"# <points count=\"" << pointLst.
size() <<
"\">" <<
endl;
192 os << pointLst[ptI].x() <<
' '
193 << pointLst[ptI].y() <<
' '
194 << pointLst[ptI].z() <<
" #" << ptI <<
endl;
197 os <<
"# </points>" <<
nl
199 <<
"# <faces count=\"" << faceLst.
size() <<
"\">" <<
endl;
204 os <<
"# <zone name=\"" << zoneLst[zoneI].name() <<
"\">" <<
endl;
206 const label nLocalFaces = zoneLst[zoneI].
size();
210 for (
label i=0; i<nLocalFaces; ++i)
212 const Face&
f = faceLst[
faceMap[faceIndex++]];
215 for (
const label verti :
f)
221 os <<
' ' << zoneI <<
endl;
226 for (
label i=0; i<nLocalFaces; ++i)
228 const Face&
f = faceLst[faceIndex++];
231 for (
const label verti :
f)
237 os <<
' ' << zoneI <<
endl;
240 os <<
"# </zone>" <<
endl;
242 os <<
"# </faces>" <<
endl;
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
A class for handling file names.
bool useFaceMap() const
Use faceMap?
Input from file stream, using an ISstream.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
const pointField & points() const
Return const access to the points.
Input/output from string buffers.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
const labelUList & faceMap() const
Const access to the faceMap, zero-sized when unused.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Input from string buffer, using a ISstream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Output to file stream, using an OSstream.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Input/output from file streams.
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
const UList< Face > & surfFaces() const
Return const access to the faces.
vector point
Point is a vector.
bool good() const
Return true if next operation might succeed.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
const UList< surfZone > & surfZones() const
Const access to the surface zones.