Go to the documentation of this file.
53 const bool mustTriangulate = this->isTri();
60 <<
"Cannot read file " << filename
65 string hdr = this->getLineNoComment(is);
69 <<
"OFF file " << filename <<
" does not start with 'OFF'"
77 string line = this->getLineNoComment(is);
80 lineStream >>
nPoints >> nElems >> nEdges;
88 line = this->getLineNoComment(is);
91 lineStream >>
x >>
y >> z;
93 pointLst[pointI] =
point(
x,
y, z);
100 for (
label faceI = 0; faceI < nElems; ++faceI)
102 line = this->getLineNoComment(is);
108 lineStream >> nVerts;
114 lineStream >> verts[vertI];
119 if (mustTriangulate &&
f.size() > 3)
123 for (
label fp1 = 1; fp1 <
f.size() - 1; fp1++)
125 label fp2 =
f.fcIndex(fp1);
160 <<
"Cannot open file for writing " << filename
166 <<
"# Geomview OFF file written " << clock::dateTime().c_str() <<
nl
168 <<
"# points : " << pointLst.size() <<
nl
169 <<
"# faces : " << faceLst.
size() <<
nl
170 <<
"# zones : " << zoneLst.
size() <<
nl;
175 os <<
"# " << zoneI <<
" " << zoneLst[zoneI].name()
176 <<
" (nFaces: " << zoneLst[zoneI].
size() <<
")" <<
nl;
180 <<
"# nPoints nFaces nEdges" <<
nl
181 << pointLst.size() <<
' ' << faceLst.
size() <<
' ' << 0 <<
nl
183 <<
"# <points count=\"" << pointLst.size() <<
"\">" <<
endl;
188 os << pointLst[ptI].x() <<
' '
189 << pointLst[ptI].y() <<
' '
190 << pointLst[ptI].z() <<
" #" << ptI <<
endl;
193 os <<
"# </points>" <<
nl
195 <<
"# <faces count=\"" << faceLst.
size() <<
"\">" <<
endl;
200 os <<
"# <zone name=\"" << zoneLst[zoneI].name() <<
"\">" <<
endl;
204 forAll(zoneLst[zoneI], localFaceI)
206 const Face&
f = faceLst[
faceMap[faceIndex++]];
215 os <<
' ' << zoneI <<
endl;
220 forAll(zoneLst[zoneI], localFaceI)
222 const Face&
f = faceLst[faceIndex++];
231 os <<
' ' << zoneI <<
endl;
234 os <<
"# </zone>" <<
endl;
236 os <<
"# </faces>" <<
endl;
Xfer< List< T > > xfer()
Transfer contents to the Xfer container as a plain List.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
A class for handling file names.
#define forAll(list, i)
Loop across all elements in list.
bool useFaceMap() const
Use faceMap?
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
bool read(const char *, int32_t &)
const List< Face > & faces() const
Return const access to the faces.
const pointField & points() const
Return const access to the points.
const List< surfZone > & surfZones() const
Const access to the surface zones.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
A simple container for copying or transferring objects of type <T>.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
Input from memory buffer stream.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void size(const label)
Override size to be inconsistent with allocated storage.
vector point
Point is a vector.
bool good() const
Return true if next operation might succeed.
const List< label > & faceMap() const
Const access to the faceMap, zero-sized when unused.