43void 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 ") << 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;
289 const label start = nVertices_+1;
293 write(localPoints[i]);
301 const edge&
e = edges[edgeI];
303 write(
"l ") <<
e[0]+start <<
' ' <<
e[1]+start <<
nl;
310 const face&
f = localFaces[facei];
335 label objPointId = nVertices_+1;
340 const edge&
e = edges[edgei];
342 if (markedPoints.
insert(
e[0], objPointId))
347 if (markedPoints.
insert(
e[1], objPointId))
356 const edge&
e = edges[edgei];
359 << markedPoints[
e[0]] <<
' '
360 << markedPoints[
e[1]] <<
nl;
365 const label start = nVertices_+1;
374 const edge&
e = edges[edgei];
377 <<
e[0]+start <<
' ' <<
e[1]+start <<
nl;
391 const label start = nVertices_+1;
405 write(
"l ") <<
e[0]+start <<
' ' <<
e[1]+start <<
nl;
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
The IOstreamOption is a simple container for options an IOstream can normally have.
A HashTable to objects of type <T> with a label key.
OFstream that keeps track of vertices.
virtual Ostream & writeQuoted(const std::string &str, const bool quoted=true)
Write std::string surrounded by quotes.
Output to file stream, using an OSstream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of faces which address into the list of points.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
const List< face_type > & localFaces() const
Return patch faces addressing into local point list.
A List obtained as a section of another List.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void size(const label n)
Older name for setAddressableSize.
const Cmpt & z() const
Access to the vector z component.
const Cmpt & y() const
Access to the vector y component.
const Cmpt & x() const
Access to the vector x component.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A face is a list of labels corresponding to mesh vertices.
A class for handling file names.
virtual bool write()
Write the output fields.
Standard boundBox with extra functionality for use in octree.
static const edgeList edges
Edge to point addressing.
static const faceList faces
Face to point addressing.
tmp< pointField > points() const
Vertex coordinates. In octant coding.
A triangle primitive used to calculate face normals and swept volumes.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
os writeQuoted(("# "+outputName+"\n"), false)
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.