Go to the documentation of this file.
43 scalar a = readScalar(is);
44 scalar
b = readScalar(is);
45 scalar
c = readScalar(is);
54 bool Foam::fileFormats::TRIReader::readFile(
const fileName& filename)
59 IFstream is(filename);
63 <<
"Cannot read file " << filename
69 DynamicList<STLpoint> dynPoints;
70 DynamicList<label> dynZones;
71 DynamicList<word> dynNames;
72 DynamicList<label> dynSizes;
77 dynSizes.append(zoneI);
78 lookup.insert(
"zoneI", zoneI);
91 IStringStream lineStream(line);
95 if (!lineStream)
break;
106 lineStream >> zeroChar;
108 const word rawName(lineStream);
109 const word
name(
"zone" + rawName.substr(1));
114 if (zoneI != iter.val())
122 zoneI = dynSizes.size();
125 dynNames.append(
name);
130 dynZones.append(zoneI);
142 dynNames[nZone] = dynNames[zonei];
143 dynSizes[nZone] = dynSizes[zonei];
150 dynNames.setCapacity(nZone);
151 dynSizes.setCapacity(nZone);
154 points_.transfer(dynPoints);
198 return mergePointsMap
208 const scalar mergeTol,
A class for handling file names.
constexpr doubleScalar doubleScalarSMALL
Input/output from string buffers.
#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.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
word name(const complex &c)
Return string representation of complex.
const cellModel * lookup(const word &modelName)
Deprecated(2017-11) equivalent to cellModel::ptr static method.
void transfer(List< T > &list)
Istream and Ostream manipulators taking arguments.
label mergePoints(const PointList &points, const scalar mergeTol, const bool verbose, labelList &pointMap, typename PointList::const_reference origin=PointList::value_type::zero)
Sorts and merges points. All points closer than/equal mergeTol get merged.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A vertex point or facet normal representation for STL files.
const dimensionedScalar c
Speed of light in a vacuum.
static STLpoint getSTLpoint(Istream &is)