Go to the documentation of this file.
43 void Foam::OBJstream::writeAndCheck(
const char c)
49 else if (startOfLine_)
87 for (
const char* iter = str; *iter; ++iter)
97 return writeQuoted(str,
false);
103 return writeQuoted(str,
true);
109 const std::string& str,
116 for (
auto iter = str.cbegin(); iter != str.cend(); ++iter)
118 writeAndCheck(*iter);
126 unsigned backslash = 0;
127 for (
auto iter = str.cbegin(); iter != str.cend(); ++iter)
129 const char c = *iter;
166 write(
"v ") << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
nl;
183 write(
"l ") << nVertices_-1 <<
' ' << nVertices_ <<
nl;
192 write(
"l ") << nVertices_-1 <<
' ' << nVertices_ <<
nl;
206 write(
"l ") << nVertices_-1 <<
' ' << nVertices_ <<
nl;
217 const label start = nVertices_+1;
224 for (
int i = 0; i < 3; i++)
226 write(
' ') << i+start;
228 write(
' ') << start <<
'\n';
233 for (
int i = 0; i < 3; i++)
235 write(
' ') << i+start;
250 const label start = nVertices_+1;
260 write(
' ') << i+start;
262 write(
' ') << start <<
'\n';
269 write(
' ') << i+start;
288 const pointField& localPoints = pp.localPoints();
289 const faceList& localFaces = pp.localFaces();
291 const label start = nVertices_+1;
295 write(localPoints[i]);
303 const edge&
e = edges[edgeI];
305 write(
"l ") <<
e[0]+start <<
' ' <<
e[1]+start <<
nl;
312 const face&
f = localFaces[facei];
337 label objPointId = nVertices_+1;
342 const edge&
e = edges[edgei];
344 if (markedPoints.insert(
e[0], objPointId))
349 if (markedPoints.insert(
e[1], objPointId))
358 const edge&
e = edges[edgei];
361 << markedPoints[
e[0]] <<
' '
362 << markedPoints[
e[1]] <<
nl;
367 const label start = nVertices_+1;
376 const edge&
e = edges[edgei];
379 <<
e[0]+start <<
' ' <<
e[1]+start <<
nl;
393 const label start = nVertices_+1;
407 write(
"l ") <<
e[0]+start <<
' ' <<
e[1]+start <<
nl;
const Cmpt & x() const
Access to the vector x component.
virtual bool write(const token &tok)
Write token to stream or otherwise handle it.
A class for handling words, derived from Foam::string.
A class for handling file names.
tmp< pointField > points() const
Vertex coordinates. In octant coding.
A List obtained as a section of another List.
virtual Ostream & writeQuoted(const std::string &str, const bool quoted=true)
Write std::string surrounded by quotes.
Standard boundBox with extra functionality for use in octree.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
End string with double quote.
static const edgeList edges
Edge to point addressing.
virtual Ostream & write(const char c)
Write character.
const Cmpt & z() const
Access to the vector z component.
#define forAll(list, i)
Loop across all elements in list.
A triangle primitive used to calculate face normals and swept volumes.
static const faceList faces
Face to point addressing.
The IOstreamOption is a simple container for options an IOstream can normally have.
Output to file stream, using an OSstream.
const Cmpt & y() const
Access to the vector y component.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const dimensionedScalar e
Elementary charge.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
const dimensionedScalar c
Speed of light in a vacuum.
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
A face is a list of labels corresponding to mesh vertices.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
defineTypeNameAndDebug(combustionModel, 0)
Begin string with double quote.
A list of faces which address into the list of points.
OBJstream(const fileName &pathname, IOstreamOption streamOpt=IOstreamOption())
Construct from pathname.