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);
81 IStringStream lineStream(line);
82 lineStream >>
nPoints >> nElems >> nEdges;
87 for (
point& pt : pointLst)
91 line = this->getLineNoComment(is);
93 IStringStream lineStream(line);
94 lineStream >>
x >>
y >> z;
102 DynamicList<Face> dynFaces(nElems);
104 for (label facei = 0; facei < nElems; ++facei)
106 line = this->getLineNoComment(is);
109 IStringStream lineStream(line);
112 lineStream >> nVerts;
114 List<label> verts(nVerts);
118 lineStream >> verts[vertI];
123 if (faceTraits<Face>::isTri() &&
f.size() > 3)
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]});
136 dynFaces.append(Face(
f));
142 MeshedSurface<Face> surf(std::move(pointLst), std::move(dynFaces));
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;
213 for (
const surfZone& zone : zoneLst)
215 os <<
"# <zone name=\"" << zone.name() <<
"\">" <<
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;
vectorField pointField
pointField is a vectorField.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
A class for handling file names.
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
const pointField & points() const
Input/output from string buffers.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
const labelUList & faceMap() const
bool good() const noexcept
Generic templated field type.
DynamicList< T, SizeMin > & append(const T &val)
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)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Output to file stream, using an OSstream.
#define FatalErrorInFunction
const word & name() const noexcept
A surface zone on a MeshedSurface.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const UList< Face > & surfFaces() const
vector point
Point is a vector.
UList< label > labelUList
A UList of labels.
const UList< surfZone > & surfZones() const