Go to the documentation of this file.
61 <<
"Cannot read file " << filename
83 string line = this->getLineNoComment(is);
86 while (
line.removeEnd(
'\\'))
88 line += this->getLineNoComment(is);
94 if (tokens.size() < 2)
110 readScalar(tokens[1]),
111 readScalar(tokens[2]),
112 readScalar(tokens[3])
122 const auto iterGroup = groupLookup.
cfind(groupName);
124 if (iterGroup.found())
126 if (zoneId != *iterGroup)
134 zoneId = dynSizes.size();
135 groupLookup.
insert(groupName, zoneId);
136 dynNames.
append(groupName);
151 groupLookup.
insert(
"zone0", 0);
159 for (
const auto& tok : tokens)
168 const string vrtSpec(tok);
169 const auto slash = vrtSpec.find(
'/');
173 slash != string::npos
178 dynVerts.
append(vertId - 1);
187 for (
label fp1 = 1; fp1 <
f.size() - 1; fp1++)
189 const label fp2 =
f.fcIndex(fp1);
191 dynFaces.
append(Face{
f[0],
f[fp1],
f[fp2]});
196 else if (
f.size() >= 3)
207 this->storedPoints().
transfer(dynPoints);
209 this->sortFacesAndStore(dynFaces, dynZones, sorted);
212 this->addZones(dynSizes, dynNames);
213 this->addZonesToFaces();
235 ? surfaceFormatsCore::oneZone(faceLst,
"")
239 const bool useFaceMap = (surf.
useFaceMap() && zones.size() > 1);
245 <<
"Cannot open file for writing " << filename
250 os <<
"# Wavefront OBJ file written " << clock::dateTime().c_str() <<
nl
253 <<
"# points : " << pointLst.
size() <<
nl
254 <<
"# faces : " << faceLst.
size() <<
nl
255 <<
"# zones : " << zones.size() <<
nl;
260 os <<
"# " << zonei <<
" " << zones[zonei].name()
261 <<
" (nFaces: " << zones[zonei].size() <<
")" <<
nl;
265 <<
"# <points count=\"" << pointLst.
size() <<
"\">" <<
nl;
268 for (
const point& pt : pointLst)
270 os <<
"v " << pt.x() <<
' ' << pt.y() <<
' ' << pt.z() <<
nl;
273 os <<
"# </points>" <<
nl
275 <<
"# <faces count=\"" << faceLst.
size() <<
"\">" <<
nl;
290 for (
label i=0; i<nLocalFaces; ++i)
292 const Face&
f = faceLst[
faceMap[faceIndex++]];
295 for (
const label verti :
f)
297 os <<
' ' << verti + 1;
304 for (
label i=0; i<nLocalFaces; ++i)
306 const Face&
f = faceLst[faceIndex++];
309 for (
const label verti :
f)
311 os <<
' ' << verti + 1;
317 os <<
"# </faces>" <<
nl;
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
static std::string nameLessExt(const std::string &str)
Return basename, without extension.
A class for handling words, derived from Foam::string.
A class for handling file names.
virtual const fileName & name() const
Read/write access to the name of the stream.
bool useFaceMap() const
Use faceMap?
Input from file stream, using an ISstream.
thermo validate(args.executable(), "h")
Base class for mesh zones.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
const pointField & points() const
Return const access to the points.
Foam::SubStrings< StringType > splitSpace(const StringType &str)
Split string into sub-strings at whitespace (TAB, NL, VT, FF, CR, SPC)
Sub-ranges of a string with a structure similar to std::match_results, but without the underlying reg...
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.
void clear()
Clear the addressed list, i.e. set the size to zero.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const word & name() const
Return name.
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_iterator cfind(const Key &key) const
Find and return an const_iterator set at the hashed entry.
Input/output from file streams.
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
A surface zone on a MeshedSurface.
void transfer(List< T > &lst)
Transfer contents of the argument List into this.
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.
bool good() const
Return true if next operation might succeed.
const UList< surfZone > & surfZones() const
Const access to the surface zones.