Go to the documentation of this file.
62 <<
"Cannot read file " << filename <<
nl
67 string hdr = this->getLineNoComment(is);
71 <<
"OFF file " << filename <<
" does not start with 'OFF'"
79 string line = this->getLineNoComment(is);
82 lineStream >>
nPoints >> nElems >> nEdges;
87 for (
point& pt : pointLst)
91 line = this->getLineNoComment(is);
94 lineStream >>
x >>
y >> z;
104 for (label facei = 0; facei < nElems; ++facei)
106 line = this->getLineNoComment(is);
112 lineStream >> nVerts;
118 lineStream >> verts[vertI];
127 for (label fp1 = 1; fp1 <
f.size() - 1; fp1++)
129 label fp2 =
f.fcIndex(fp1);
131 dynFaces.
append(Face{
f[0],
f[fp1],
f[fp2]});
160 streamOpt.
format(IOstream::ASCII);
173 <<
"Cannot write file " << filename <<
nl
179 <<
"# Geomview OFF file written " << clock::dateTime().c_str() <<
nl
181 <<
"# points : " << pointLst.
size() <<
nl
182 <<
"# faces : " << faceLst.
size() <<
nl
183 <<
"# zones : " << zoneLst.
size() <<
nl;
188 os <<
"# " << zoneI <<
" " << zoneLst[zoneI].name()
189 <<
" (nFaces: " << zoneLst[zoneI].
size() <<
")" <<
nl;
193 <<
"# nPoints nFaces nEdges" <<
nl
194 << pointLst.
size() <<
' ' << faceLst.
size() <<
' ' << 0 <<
nl
196 <<
"# <points count=\"" << pointLst.
size() <<
"\">" <<
nl;
201 os << pointLst[ptI].x() <<
' '
202 << pointLst[ptI].y() <<
' '
203 << pointLst[ptI].z() <<
" #" << ptI <<
nl;
206 os <<
"# </points>" <<
nl
208 <<
"# <faces count=\"" << faceLst.
size() <<
"\">" <<
nl;
217 for (label nLocal =
zone.size(); nLocal--; ++faceIndex)
220 (useFaceMap ?
faceMap[faceIndex] : faceIndex);
222 const Face&
f = faceLst[facei];
225 for (
const label verti :
f)
231 os <<
' ' << zoneIndex <<
nl;
234 os <<
"# </zone>" <<
nl;
238 os <<
"# </faces>" <<
nl;
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
A class for handling file names.
bool useFaceMap() const
Can/should 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.
Base class for mesh zones.
streamFormat format() const noexcept
Get the current stream format.
const pointField & points() const
Return const access to the points.
Input/output from string buffers.
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.
bool good() const noexcept
True if next operation might succeed.
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
The IOstreamOption is a simple container for options an IOstream can normally have.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Input from string buffer, using a ISstream. Always UNCOMPRESSED.
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.
const word & name() const noexcept
The zone name.
A surface zone on a MeshedSurface.
const UList< Face > & surfFaces() const
Return const access to the faces.
void size(const label n)
Older name for setAddressableSize.
vector point
Point is a vector.
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.