43 inline void Foam::OBJstream::vertex_state(
const char c)
49 else if (startOfLine_)
64 const fileName& pathname,
65 IOstreamOption streamOpt
68 OFstream(pathname, streamOpt),
100 if (quoted) vertex_state(0);
102 const char* last = (str + len);
105 for (
const char* iter = str; iter != last; ++iter)
110 if (quoted) vertex_state(0);
120 for (
const char* iter = str; *iter; ++iter)
130 return writeQuoted(str.data(), str.size(),
false);
136 return writeQuoted(str.data(), str.size(),
true);
155 const char* iter = str.data();
156 const char* last = (str.data() + str.size());
159 for (; iter != last; ++iter)
161 const char c = *iter;
166 startOfLine_ =
false;
169 startOfLine_ = (
c ==
'\n');
185 write(
'v') <<
' ' <<
p.x() <<
' ' <<
p.y() <<
' ' <<
p.z() <<
nl;
202 write(
'v') <<
' ' <<
p.x() <<
' ' <<
p.y() <<
' ' <<
p.z() <<
nl;
212 write(
'l') <<
' ' << nVertices_-1 <<
' ' << nVertices_ <<
nl;
221 write(
'l') <<
' ' << nVertices_-1 <<
' ' << nVertices_ <<
nl;
235 write(
'l') <<
' ' << nVertices_-1 <<
' ' << nVertices_ <<
nl;
248 write(
'l') <<
' ' << nVertices_-1 <<
' ' << nVertices_ <<
nl;
259 const label start = nVertices_+1;
266 for (
int i = 0; i < 3; ++i)
268 write(
' ') << i+start;
270 write(
' ') << start <<
'\n';
275 for (
int i = 0; i < 3; ++i)
277 write(
' ') << i+start;
287 const UList<point>&
points,
291 const label start = nVertices_+1;
300 write(
' ') << i+start;
302 write(
' ') << start <<
'\n';
309 write(
' ') << i+start;
320 const UList<point>&
points,
324 const label start = nVertices_+1;
326 for (
const label fp :
f)
335 write(
' ') << i+start;
337 write(
' ') << start <<
'\n';
344 write(
' ') << i+start;
354 const UList<face>& faces,
361 const label start = nVertices_+1;
370 <<
e.first()+start <<
' ' 371 <<
e.second()+start <<
nl;
379 for (
const label fp :
f)
381 write(
' ') << fp+start;
392 const UList<edge>& edges,
393 const UList<point>&
points,
402 label objPointId = nVertices_+1;
404 Map<label> markedPoints(2*edges.size());
406 for (
const edge&
e : edges)
408 if (markedPoints.insert(
e.first(), objPointId))
413 if (markedPoints.insert(
e.second(), objPointId))
420 for (
const edge&
e : edges)
423 << markedPoints[
e.first()] <<
' ' 424 << markedPoints[
e.second()] <<
nl;
429 const label start = nVertices_+1;
433 for (
const edge&
e : edges)
436 <<
e.first()+start <<
' ' 437 <<
e.second()+start <<
nl;
447 const treeBoundBox& bb,
451 const label start = nVertices_+1;
460 <<
e.first()+start <<
' ' 461 <<
e.second()+start <<
nl;
469 for (
const label fp :
f)
471 write(
' ') << fp+start;
Ostream & writeFace(const UList< point > &points, const bool lines=true)
Write face loop points with lines/filled-polygon.
const List< face_type > & localFaces() const
Return patch faces addressing into local point list.
A triangle primitive used to calculate face normals and swept volumes. Uses referred points...
const Field< point_type > & localPoints() const
Return pointField of points in patch.
virtual Ostream & write(const char c) override
Write character.
virtual Ostream & writeQuoted(const char *str, std::streamsize len, const bool quoted=true) override
Write character/string content, with/without surrounding quotes.
OBJstream(const fileName &pathname, IOstreamOption streamOpt=IOstreamOption())
Construct from pathname (ASCII, uncompressed)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
defineTypeName(manifoldCellsMeshObject)
Ostream & writeComment(const std::string &str)
Write comment (with '# ' prefix)
vectorField pointField
pointField is a vectorField.
const dimensionedScalar e
Elementary charge.
A class for handling words, derived from Foam::string.
static const edgeList edges
Edge to point addressing, using octant corner points.
virtual Ostream & writeQuoted(const char *str, std::streamsize len, const bool quoted=true) override
Write character/string content, with/without surrounding quotes.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
static const faceList faces
Face to point addressing, using octant corner points.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual bool write(const token &tok) override
Write token to stream or otherwise handle it.
Ostream & writeLine(const point &p0, const point &p1)
Write line joining two points.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const wordList edge
Standard (finite-area) edge field types (scalar, vector, tensor, etc)
PrimitivePatch< SubList< face >, const pointField & > primitivePatch
A PrimitivePatch with a SubList addressing for the faces, const reference for the point field...
const dimensionedScalar c
Speed of light in a vacuum.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
const volScalarField & p0
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())