Go to the documentation of this file.
32 #include "triSurface.H"
66 if (space != string::npos)
68 cmd =
line.substr(0, space);
94 if (space != string::npos &&
line.substr(0, space) == cmd)
110 const string errorMsg
116 <<
"Cannot find command " << cmd
131 <<
"Cannot read file " << ACfileName
138 string version =
line.substr(4);
142 WarningIn(
"bool triSurface::readAC(const fileName& ACfileName)")
143 <<
"When reading AC3D file " << ACfileName
144 <<
" read header " <<
line <<
" with version " << version
145 <<
endl <<
"Only tested reading with version 'b'."
146 <<
" This might give problems" <<
endl;
155 FatalErrorIn(
"bool triSurface::readAC(const fileName& ACfileName)")
156 <<
"Cannot find \"OBJECT world\" in file " << ACfileName
174 label patchStartVert = 0;
178 readUpto(
"OBJECT", ACfile,
args,
" while reading patch " + patchI);
181 string patchName =
string(
"patch") +
name(patchI);
187 while (ACfile.
good())
194 <<
"Did not read up to \"kids 0\" while reading patch "
195 << patchI <<
" from file " << ACfileName
203 nameStream >> patchName;
205 else if (cmd ==
"rot")
215 WarningIn(
"triSurface::readAC(const fileName&)")
216 <<
"rot (rotation tensor) command not implemented"
217 <<
"Line:" << cmd <<
' ' <<
args <<
endl
218 <<
"while reading patch " << patchI <<
endl;
220 else if (cmd ==
"loc")
224 lineStream >> loc.
x() >> loc.
y() >> loc.
z();
226 else if (cmd ==
"numvert")
230 for (
label vertI = 0; vertI < nVerts; vertI++)
238 lineStream >> pt.
x() >> pt.
y() >> pt.
z();
244 else if (cmd ==
"numsurf")
248 for (
label triI = 0; triI < nTris; triI++)
250 static string errorMsg =
251 string(
" while reading face ")
252 +
name(triI) +
" on patch " +
name(patchI)
253 +
" from file " + ACfileName;
264 <<
"Can only read surfaces with 3 vertices."
266 <<
"Detected " <<
size <<
" when reading triangle "
267 << triI <<
" of patch " << patchI
297 patchStartVert += nVerts;
299 else if (cmd ==
"kids")
308 <<
"Can only read objects without kids."
309 <<
" Encountered " << nKids <<
" kids when"
310 <<
" reading patch " << patchI
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
const Field< point > & points() const
Return reference to global points.
A class for handling words, derived from string.
A class for handling file names.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
The geometricSurfacePatch is like patchIdentifier but for surfaces. Holds type, name and index.
static bool readCmd(IFstream &ACfile, string &cmd, string &args)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A class for handling character strings derived from std::string.
const geometricSurfacePatchList & patches() const
static label parseInt(const string &str)
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.
ISstream & getLine(string &)
Raw, low-level getline into a string function.
static bool readUpto(const string &cmd, IFstream &ACfile, string &args)
triSurface()
Construct null.
graph_traits< Graph >::vertices_size_type size_type
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
static const sphericalTensor I(1)
Input from memory buffer stream.
bool readAC(const fileName &)
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)
label size() const
Return the number of elements in the UList.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool stitchTriangles(const pointField &rawPoints, const scalar tol=SMALL, const bool verbose=false)
Function to stitch the triangles by removing duplicate points.
Triangle with additional region number.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
#define WarningIn(functionName)
Report a warning using Foam::Warning.
bool good() const
Return true if next operation might succeed.
Foam::argList args(argc, argv)
word name(const complex &)
Return a string representation of a complex.