Go to the documentation of this file.
54 const bool mustTriangulate = this->isTri();
61 <<
"Cannot read file " << filename
77 lookup.insert(
"zone0", zoneI);
83 string line = this->getLineNoComment(is);
89 line += this->getLineNoComment(is);
100 lineStream >>
x >>
y >> z;
120 zoneI = dynSizes.size();
136 line.find_first_not_of(
' ', endNum);
138 if (startNum == string::npos)
143 endNum =
line.find(
' ', startNum);
146 if (endNum != string::npos)
148 vertexSpec =
line.substr(startNum, endNum-startNum);
152 vertexSpec =
line.substr(startNum,
line.size() - startNum);
158 if (slashPos != string::npos)
170 dynVertices.
append(vertI - 1);
176 if (mustTriangulate &&
f.size() > 3)
180 for (
label fp1 = 1; fp1 <
f.size() - 1; fp1++)
182 label fp2 =
f.fcIndex(fp1);
200 this->storedPoints().
transfer(dynPoints);
202 this->sortFacesAndStore(dynFaces.
xfer(), dynZones.
xfer(), sorted);
205 this->addZones(dynSizes, dynNames,
true);
225 ? surfaceFormatsCore::oneZone(faceLst,
"")
235 <<
"Cannot open file for writing " << filename
240 os <<
"# Wavefront OBJ file written " << clock::dateTime().c_str() <<
nl
243 <<
"# points : " << pointLst.size() <<
nl
244 <<
"# faces : " << faceLst.
size() <<
nl
245 <<
"# zones : " << zones.
size() <<
nl;
250 os <<
"# " << zoneI <<
" " << zones[zoneI].name()
251 <<
" (nFaces: " << zones[zoneI].
size() <<
")" <<
nl;
255 <<
"# <points count=\"" << pointLst.size() <<
"\">" <<
nl;
260 const point& pt = pointLst[ptI];
262 os <<
"v " << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
nl;
265 os <<
"# </points>" <<
nl
267 <<
"# <faces count=\"" << faceLst.
size() <<
"\">" <<
endl;
284 const Face&
f = faceLst[
faceMap[faceIndex++]];
289 os <<
' ' <<
f[fp] + 1;
298 const Face&
f = faceLst[faceIndex++];
303 os <<
' ' <<
f[fp] + 1;
309 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 words, derived from string.
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.
fileName lessExt() const
Return file name without extension (part before last .)
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
word name() const
Return file name (part beyond last /)
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.
graph_traits< Graph >::vertices_size_type size_type
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
Input from memory buffer stream.
const word & name() const
Return name.
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 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...
void transfer(List< T > &)
Transfer contents of the argument List into this.
Various functions to operate on Lists.
const fileName & name() const
Return the name of the stream.
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.
word name(const complex &)
Return a string representation of a complex.
const List< label > & faceMap() const
Const access to the faceMap, zero-sized when unused.
stressControl lookup("compactNormalStress") >> compactNormalStress