Go to the documentation of this file.
58 line.find_first_not_of(
' ', endNum);
60 if (startNum == string::npos)
65 endNum =
line.find(
' ', startNum);
68 if (endNum != string::npos)
70 vertexSpec =
line.substr(startNum, endNum-startNum);
74 vertexSpec =
line.substr(startNum,
line.size() - startNum);
80 if (slashPos != string::npos)
92 dynVertices.
append(vertI - 1);
105 <<
"Cannot read file " << filename
134 lineStream >>
x >>
y >> z;
152 for (
label i = 1; i < dynVertices.size(); i++)
154 edge edgeRead(dynVertices[i-1], dynVertices[i]);
156 dynUsedPoints[edgeRead[0]] = edgeRead[0];
157 dynUsedPoints[edgeRead[1]] = edgeRead[1];
159 dynEdges.
append(edgeRead);
176 if (dynVertices.size() == 2)
178 for (
label i = 1; i < dynVertices.size(); i++)
180 edge edgeRead(dynVertices[i-1], dynVertices[i]);
182 dynUsedPoints[edgeRead[0]] = edgeRead[0];
183 dynUsedPoints[edgeRead[1]] = edgeRead[1];
185 dynEdges.
append(edgeRead);
196 if (dynUsedPoints[pointI] >= 0)
200 dynPoints[nUsed] = dynPoints[pointI];
201 dynUsedPoints[pointI] = nUsed;
213 if (nUsed != dynUsedPoints.size())
217 edge&
e = dynEdges[edgeI];
219 e[0] = dynUsedPoints[
e[0]];
220 e[1] = dynUsedPoints[
e[1]];
242 <<
"Cannot open file for writing " << filename
250 <<
"# points : " << pointLst.size() <<
nl
251 <<
"# lines : " << edgeLst.
size() <<
nl;
254 <<
"# <points count=\"" << pointLst.size() <<
"\">" <<
nl;
259 const point&
p = pointLst[ptI];
261 os <<
"v " <<
p.x() <<
' ' <<
p.y() <<
' ' <<
p.z() <<
nl;
264 os <<
"# </points>" <<
nl
266 <<
"# <edges count=\"" << edgeLst.
size() <<
"\">" <<
endl;
271 const edge&
e = edgeLst[edgeI];
273 os <<
"l " << (
e[0] + 1) <<
" " << (
e[1] + 1) <<
nl;
275 os <<
"# </edges>" <<
endl;
edgeList & storedEdges()
Non-const access to the edges.
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 read(const char *, int32_t &)
pointField & storedPoints()
Non-const access to global points.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
Ostream & endl(Ostream &os)
Add newline and flush stream.
fileName lessExt() const
Return file name without extension (part before last .)
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.
void clear()
Clear the addressed list, i.e. set the size to zero.
graph_traits< Graph >::vertices_size_type size_type
Input from memory buffer stream.
const double e
Elementary charge.
virtual void clear()
Clear all storage.
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.
static string dateTime()
Return the current wall-clock date/time as a string.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
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.
Points connected by edges.
void setSize(const label)
Alter the addressed list size.