44 scalar a = readScalar(is);
45 scalar
b = readScalar(is);
46 scalar
c = readScalar(is);
55 bool Foam::fileFormats::TRIReader::readFile(
const fileName& filename)
61 IFstream is(filename);
65 <<
"Cannot read file " << filename <<
nl 71 DynamicList<STLpoint> dynPoints;
72 DynamicList<label> dynZones;
73 DynamicList<word> dynNames;
74 DynamicList<label> dynSizes;
75 HashTable<label> lookup;
79 dynSizes.append(zoneI);
80 lookup.insert(
"zoneI", zoneI);
93 IStringStream lineStream(line);
97 if (!lineStream)
break;
108 lineStream >> zeroChar;
110 const word rawName(lineStream);
111 const word
name(
"zone" + rawName.substr(1));
113 const auto iter = lookup.cfind(
name);
116 if (zoneI != iter.val())
124 zoneI = dynSizes.size();
125 if (lookup.insert(
name, zoneI))
127 dynNames.append(
name);
132 dynZones.append(zoneI);
144 dynNames[nZone] = dynNames[zonei];
145 dynSizes[nZone] = dynSizes[zonei];
152 dynNames.setCapacity(nZone);
153 dynSizes.setCapacity(nZone);
156 points_.transfer(dynPoints);
200 return mergePointsMap
210 const scalar mergeTol,
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Input/output from string buffers.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
constexpr char nl
The newline '\n' character (0x0a)
static STLpoint getSTLpoint(Istream &is)
#define forAll(list, i)
Loop across all elements in list.
label mergePoints(const PointList &points, labelList &pointToUnique, labelList &uniquePoints, const scalar mergeTol=SMALL, const bool verbose=false)
Calculate merge mapping, preserving the original point order. All points closer/equal mergeTol are to...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Istream and Ostream manipulators taking arguments.
Geometric merging of points. See below.
constexpr doubleScalar doubleScalarSMALL
const dimensionedScalar c
Speed of light in a vacuum.
A vertex point or facet normal representation for STL files.