43 void Foam::OBJstream::writeAndCheck(
const char c)
49 else if (startOfLine_)
87 for (
const char* iter = str; *iter; ++iter)
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') <<
' ' <<
p.x() <<
' ' <<
p.y() <<
' ' <<
p.z() <<
nl;
183 write(
'v') <<
' ' <<
p.x() <<
' ' <<
p.y() <<
' ' <<
p.z() <<
nl;
193 write(
'l') <<
' ' << nVertices_-1 <<
' ' << nVertices_ <<
nl;
202 write(
'l') <<
' ' << nVertices_-1 <<
' ' << nVertices_ <<
nl;
216 write(
'l') <<
' ' << nVertices_-1 <<
' ' << nVertices_ <<
nl;
229 write(
'l') <<
' ' << nVertices_-1 <<
' ' << nVertices_ <<
nl;
240 const label start = nVertices_+1;
247 for (
int i = 0; i < 3; ++i)
249 write(
' ') << i+start;
251 write(
' ') << start <<
'\n';
256 for (
int i = 0; i < 3; ++i)
258 write(
' ') << i+start;
268 const UList<point>&
points,
272 const label start = nVertices_+1;
281 write(
' ') << i+start;
283 write(
' ') << start <<
'\n';
290 write(
' ') << i+start;
301 const UList<point>&
points,
305 const label start = nVertices_+1;
307 for (
const label fp :
f)
316 write(
' ') << i+start;
318 write(
' ') << start <<
'\n';
325 write(
' ') << i+start;
335 const UList<face>& faces,
342 const label start = nVertices_+1;
351 <<
e.first()+start <<
' ' 352 <<
e.second()+start <<
nl;
360 for (
const label fp :
f)
362 write(
' ') << fp+start;
373 const UList<edge>& edges,
374 const UList<point>&
points,
383 label objPointId = nVertices_+1;
385 Map<label> markedPoints(2*edges.size());
387 for (
const edge&
e : edges)
389 if (markedPoints.insert(
e.first(), objPointId))
394 if (markedPoints.insert(
e.second(), objPointId))
401 for (
const edge&
e : edges)
404 << markedPoints[
e.first()] <<
' ' 405 << markedPoints[
e.second()] <<
nl;
410 const label start = nVertices_+1;
414 for (
const edge&
e : edges)
417 <<
e.first()+start <<
' ' 418 <<
e.second()+start <<
nl;
428 const treeBoundBox& bb,
432 const label start = nVertices_+1;
441 <<
e.first()+start <<
' ' 442 <<
e.second()+start <<
nl;
450 for (
const label fp :
f)
452 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.
virtual Ostream & write(const char c)
Write character.
A triangle primitive used to calculate face normals and swept volumes. Uses referred points...
A class for handling file names.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
OBJstream(const fileName &pathname, IOstreamOption streamOpt=IOstreamOption())
Construct from pathname (ASCII, uncompressed)
Output to file stream, using an OSstream.
constexpr char nl
The newline '\n' character (0x0a)
A simple container for options an IOstream can normally have.
static const faceList faces
Face to point addressing, using octant corner points.
virtual Ostream & writeQuoted(const std::string &str, const bool quoted=true)
Write std::string surrounded by quotes.
os writeQuoted(("# "+outputName+"\), false)
#define forAll(list, i)
Loop across all elements in list.
defineTypeName(manifoldCellsMeshObject)
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
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.
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.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
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...
virtual bool write(const token &tok)
Write token to stream or otherwise handle it.
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.
const volScalarField & p0
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())