42 bool Foam::triSurface::readTRI(
const fileName& TRIfileName)
44 IFstream TRIfile(TRIfileName);
49 <<
"Cannot read file " << TRIfileName
53 SLList<STLpoint> STLpoints;
54 SLList<label> STLlabels;
55 HashTable<label, string> STLsolidNames;
62 string line = getLineNoComment(TRIfile);
69 IStringStream lineStream(line);
78 if (!lineStream)
break;
105 word rawSolidName(lineStream);
107 word solidName(
"patch" + rawSolidName(1, rawSolidName.size()-1));
112 STLsolidNames.find(solidName);
114 if (fnd != STLsolidNames.end())
120 Pout<<
"Mapping triangle colour 0" << rawSolidName
121 <<
" to region " << maxRegion <<
" name " << solidName
124 region = maxRegion++;
125 STLsolidNames.insert(solidName, region);
127 STLlabels.append(region);
136 rawPoints[pointi++] = *iter;
161 patches_.
setSize(names.size());
165 patches_[nameI].name() = names[nameI];
166 patches_[nameI].geometricType() =
"empty";
Non-intrusive singly-linked list.
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
friend class const_iterator
Declare friendship with the const_iterator.
friend class const_iterator
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
void setSize(const label)
Reset size of List.
T & operator[](const label)
Return element of UList.
pointField & storedPoints()
Non-const access to global points.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
vectorField pointField
pointField is a vectorField.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
prefixOSstream Pout(cout, "Pout")
List< string > stringList
A List of strings.
Read a hex label from an input stream.