mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: meshTools output for treeBoundBox, points.
ENH: OBJstream output for treeBoundBox
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -26,6 +26,7 @@ License
|
||||
#include "meshTools.H"
|
||||
#include "polyMesh.H"
|
||||
#include "hexMatcher.H"
|
||||
#include "treeBoundBox.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -209,16 +210,31 @@ void Foam::meshTools::writeOBJ
|
||||
}
|
||||
|
||||
|
||||
void Foam::meshTools::writeOBJ
|
||||
(
|
||||
Ostream& os,
|
||||
const UList<point>& pts
|
||||
)
|
||||
{
|
||||
forAll(pts, i)
|
||||
{
|
||||
const point& pt = pts[i];
|
||||
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Foam::meshTools::writeOBJ
|
||||
(
|
||||
Ostream& os,
|
||||
const triad& t,
|
||||
const point& pt
|
||||
const point& origin
|
||||
)
|
||||
{
|
||||
forAll(t, dirI)
|
||||
{
|
||||
writeOBJ(os, pt, pt + t[dirI]);
|
||||
writeOBJ(os, origin, origin + t[dirI]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -231,10 +247,9 @@ void Foam::meshTools::writeOBJ
|
||||
label& count
|
||||
)
|
||||
{
|
||||
os << "v" << ' ' << p1.x() << ' ' << p1.y() << ' ' << p1.z() << endl;
|
||||
os << "v" << ' ' << p2.x() << ' ' << p2.y() << ' ' << p2.z() << endl;
|
||||
|
||||
os << "l" << " " << (count + 1) << " " << (count + 2) << endl;
|
||||
os << "v " << p1.x() << ' ' << p1.y() << ' ' << p1.z() << nl;
|
||||
os << "v " << p2.x() << ' ' << p2.y() << ' ' << p2.z() << nl;
|
||||
os << "l " << (count + 1) << " " << (count + 2) << endl;
|
||||
|
||||
count += 2;
|
||||
}
|
||||
@ -247,12 +262,28 @@ void Foam::meshTools::writeOBJ
|
||||
const point& p2
|
||||
)
|
||||
{
|
||||
os << "v" << ' ' << p1.x() << ' ' << p1.y() << ' ' << p1.z() << endl;
|
||||
os << "v " << p1.x() << ' ' << p1.y() << ' ' << p1.z() << nl;
|
||||
os << "vn "
|
||||
<< (p2.x() - p1.x()) << ' '
|
||||
<< (p2.y() - p1.y()) << ' '
|
||||
<< (p2.z() - p1.z()) << endl;
|
||||
}
|
||||
|
||||
os << "vn"
|
||||
<< ' ' << p2.x() - p1.x()
|
||||
<< ' ' << p2.y() - p1.y()
|
||||
<< ' ' << p2.z() - p1.z() << endl;
|
||||
|
||||
void Foam::meshTools::writeOBJ
|
||||
(
|
||||
Ostream& os,
|
||||
const treeBoundBox& bb
|
||||
)
|
||||
{
|
||||
writeOBJ(os, bb.points());
|
||||
|
||||
forAll(treeBoundBox::edges, edgei)
|
||||
{
|
||||
const edge& e = treeBoundBox::edges[edgei];
|
||||
|
||||
os << "l " << (e[0] + 1) << ' ' << (e[1] + 1) << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -261,7 +292,7 @@ void Foam::meshTools::writeOBJ
|
||||
Ostream& os,
|
||||
const cellList& cells,
|
||||
const faceList& faces,
|
||||
const pointField& points,
|
||||
const UList<point>& points,
|
||||
const labelList& cellLabels
|
||||
)
|
||||
{
|
||||
@ -342,7 +373,7 @@ Foam::label Foam::meshTools::findEdge
|
||||
{
|
||||
forAll(candidates, i)
|
||||
{
|
||||
label edgeI = candidates[i];
|
||||
const label edgeI = candidates[i];
|
||||
|
||||
const edge& e = edges[edgeI];
|
||||
|
||||
|
||||
@ -49,8 +49,9 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class primitiveMesh;
|
||||
class polyMesh;
|
||||
class primitiveMesh;
|
||||
class treeBoundBox;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Namespace meshTools Declaration
|
||||
@ -101,23 +102,30 @@ namespace meshTools
|
||||
|
||||
// OBJ writing
|
||||
|
||||
//- Write obj representation of point
|
||||
//- Write obj representation of a point
|
||||
void writeOBJ
|
||||
(
|
||||
Ostream& os,
|
||||
const point& pt
|
||||
);
|
||||
|
||||
//- Write obj representation of a triad. Requires the location of the
|
||||
//- Write obj representation of points
|
||||
void writeOBJ
|
||||
(
|
||||
Ostream& os,
|
||||
const UList<point>& pts
|
||||
);
|
||||
|
||||
//- Write obj representation of a triad. Requires the origin of the
|
||||
// triad to be supplied
|
||||
void writeOBJ
|
||||
(
|
||||
Ostream& os,
|
||||
const triad& t,
|
||||
const point& pt
|
||||
const point& origin
|
||||
);
|
||||
|
||||
//- Write obj representation of a line connecting two points
|
||||
//- Write obj representation of a line connecting two points.
|
||||
// Need to keep track of points that have been added. count starts at 0
|
||||
void writeOBJ
|
||||
(
|
||||
@ -135,13 +143,20 @@ namespace meshTools
|
||||
const point& p2
|
||||
);
|
||||
|
||||
//- Write obj representation of tree-bounding box as a series of lines
|
||||
void writeOBJ
|
||||
(
|
||||
Ostream& os,
|
||||
const treeBoundBox& bb
|
||||
);
|
||||
|
||||
//- Write obj representation of faces subset
|
||||
template<class FaceType>
|
||||
void writeOBJ
|
||||
(
|
||||
Ostream& os,
|
||||
const UList<FaceType>&,
|
||||
const pointField&,
|
||||
const UList<FaceType>& faces,
|
||||
const UList<point>& points,
|
||||
const labelList& faceLabels
|
||||
);
|
||||
|
||||
@ -150,17 +165,17 @@ namespace meshTools
|
||||
void writeOBJ
|
||||
(
|
||||
Ostream& os,
|
||||
const UList<FaceType>&,
|
||||
const pointField&
|
||||
const UList<FaceType>& faces,
|
||||
const UList<point>& points
|
||||
);
|
||||
|
||||
//- Write obj representation of cell subset
|
||||
void writeOBJ
|
||||
(
|
||||
Ostream& os,
|
||||
const cellList&,
|
||||
const faceList&,
|
||||
const pointField&,
|
||||
const cellList& cells,
|
||||
const faceList& faces,
|
||||
const UList<point>& points,
|
||||
const labelList& cellLabels
|
||||
);
|
||||
|
||||
@ -170,7 +185,7 @@ namespace meshTools
|
||||
//- Is edge used by cell
|
||||
bool edgeOnCell
|
||||
(
|
||||
const primitiveMesh&,
|
||||
const primitiveMesh& mesh,
|
||||
const label celli,
|
||||
const label edgeI
|
||||
);
|
||||
@ -178,7 +193,7 @@ namespace meshTools
|
||||
//- Is edge used by face
|
||||
bool edgeOnFace
|
||||
(
|
||||
const primitiveMesh&,
|
||||
const primitiveMesh& mesh,
|
||||
const label facei,
|
||||
const label edgeI
|
||||
);
|
||||
@ -186,7 +201,7 @@ namespace meshTools
|
||||
//- Is face used by cell
|
||||
bool faceOnCell
|
||||
(
|
||||
const primitiveMesh&,
|
||||
const primitiveMesh& mesh,
|
||||
const label celli,
|
||||
const label facei
|
||||
);
|
||||
@ -203,7 +218,7 @@ namespace meshTools
|
||||
//- Return edge between two mesh vertices. Returns -1 if no edge.
|
||||
label findEdge
|
||||
(
|
||||
const primitiveMesh&,
|
||||
const primitiveMesh& mesh,
|
||||
const label v0,
|
||||
const label v1
|
||||
);
|
||||
@ -211,7 +226,7 @@ namespace meshTools
|
||||
//- Return edge shared by two faces. Throws error if no edge found.
|
||||
label getSharedEdge
|
||||
(
|
||||
const primitiveMesh&,
|
||||
const primitiveMesh& mesh,
|
||||
const label f0,
|
||||
const label f1
|
||||
);
|
||||
@ -219,7 +234,7 @@ namespace meshTools
|
||||
//- Return face shared by two cells. Throws error if none found.
|
||||
label getSharedFace
|
||||
(
|
||||
const primitiveMesh&,
|
||||
const primitiveMesh& mesh,
|
||||
const label cell0,
|
||||
const label cell1
|
||||
);
|
||||
@ -227,7 +242,7 @@ namespace meshTools
|
||||
//- Get faces on cell using edgeI. Throws error if no two found.
|
||||
void getEdgeFaces
|
||||
(
|
||||
const primitiveMesh&,
|
||||
const primitiveMesh& mesh,
|
||||
const label celli,
|
||||
const label edgeI,
|
||||
label& face0,
|
||||
@ -238,17 +253,17 @@ namespace meshTools
|
||||
// connected to vertex but not edgeI. Throws error if none found.
|
||||
label otherEdge
|
||||
(
|
||||
const primitiveMesh&,
|
||||
const primitiveMesh& mesh,
|
||||
const labelList& edgeLabels,
|
||||
const label edgeI,
|
||||
const label vertI
|
||||
const label thisEdgeI,
|
||||
const label thisVertI
|
||||
);
|
||||
|
||||
//- Return face on cell using edgeI but not facei. Throws error
|
||||
// if none found.
|
||||
label otherFace
|
||||
(
|
||||
const primitiveMesh&,
|
||||
const primitiveMesh& mesh,
|
||||
const label celli,
|
||||
const label facei,
|
||||
const label edgeI
|
||||
@ -258,7 +273,7 @@ namespace meshTools
|
||||
// if face not internal.
|
||||
label otherCell
|
||||
(
|
||||
const primitiveMesh&,
|
||||
const primitiveMesh& mesh,
|
||||
const label celli,
|
||||
const label facei
|
||||
);
|
||||
@ -267,7 +282,7 @@ namespace meshTools
|
||||
// of startVertI)
|
||||
label walkFace
|
||||
(
|
||||
const primitiveMesh&,
|
||||
const primitiveMesh& mesh,
|
||||
const label facei,
|
||||
const label startEdgeI,
|
||||
const label startVertI,
|
||||
@ -309,19 +324,19 @@ namespace meshTools
|
||||
//- Given edge on hex find other 'parallel', non-connected edges.
|
||||
void getParallelEdges
|
||||
(
|
||||
const primitiveMesh&,
|
||||
const primitiveMesh& mesh,
|
||||
const label celli,
|
||||
const label e0,
|
||||
label&,
|
||||
label&,
|
||||
label&
|
||||
label& e1,
|
||||
label& e2,
|
||||
label& e3
|
||||
);
|
||||
|
||||
//- Given edge on hex find all 'parallel' (i.e. non-connected)
|
||||
// edges and average direction of them
|
||||
vector edgeToCutDir
|
||||
(
|
||||
const primitiveMesh&,
|
||||
const primitiveMesh& mesh,
|
||||
const label celli,
|
||||
const label edgeI
|
||||
);
|
||||
@ -330,7 +345,7 @@ namespace meshTools
|
||||
// return one of them.
|
||||
label cutDirToEdge
|
||||
(
|
||||
const primitiveMesh&,
|
||||
const primitiveMesh& mesh,
|
||||
const label celli,
|
||||
const vector& cutDir
|
||||
);
|
||||
|
||||
@ -28,7 +28,7 @@ void Foam::meshTools::writeOBJ
|
||||
(
|
||||
Ostream& os,
|
||||
const UList<FaceType>& faces,
|
||||
const pointField& points,
|
||||
const UList<point>& points,
|
||||
const labelList& faceLabels
|
||||
)
|
||||
{
|
||||
@ -64,7 +64,7 @@ void Foam::meshTools::writeOBJ
|
||||
(
|
||||
Ostream& os,
|
||||
const UList<FaceType>& faces,
|
||||
const pointField& points
|
||||
const UList<point>& points
|
||||
)
|
||||
{
|
||||
labelList allFaces(faces.size());
|
||||
|
||||
@ -24,8 +24,8 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "OBJstream.H"
|
||||
//#include "token.H"
|
||||
#include "primitivePatch.H"
|
||||
#include "treeBoundBox.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -98,51 +98,13 @@ Foam::Ostream& Foam::OBJstream::write(const char* str)
|
||||
|
||||
Foam::Ostream& Foam::OBJstream::write(const word& str)
|
||||
{
|
||||
write(str.c_str());
|
||||
return *this;
|
||||
return writeQuoted(str, false);
|
||||
}
|
||||
|
||||
|
||||
Foam::Ostream& Foam::OBJstream::write(const string& str)
|
||||
{
|
||||
OFstream::write(token::BEGIN_STRING);
|
||||
|
||||
int backslash = 0;
|
||||
for (string::const_iterator iter = str.begin(); iter != str.end(); ++iter)
|
||||
{
|
||||
char c = *iter;
|
||||
|
||||
if (c == '\\')
|
||||
{
|
||||
backslash++;
|
||||
// suppress output until we know if other characters follow
|
||||
continue;
|
||||
}
|
||||
else if (c == token::NL)
|
||||
{
|
||||
lineNumber_++;
|
||||
backslash++; // backslash escape for newline
|
||||
}
|
||||
else if (c == token::END_STRING)
|
||||
{
|
||||
backslash++; // backslash escape for quote
|
||||
}
|
||||
|
||||
// output pending backslashes
|
||||
while (backslash)
|
||||
{
|
||||
OFstream::write('\\');
|
||||
backslash--;
|
||||
}
|
||||
|
||||
writeAndCheck(c);
|
||||
}
|
||||
|
||||
// silently drop any trailing backslashes
|
||||
// they would otherwise appear like an escaped end-quote
|
||||
|
||||
OFstream::write(token::END_STRING);
|
||||
return *this;
|
||||
return writeQuoted(str, true);
|
||||
}
|
||||
|
||||
|
||||
@ -159,7 +121,7 @@ Foam::Ostream& Foam::OBJstream::writeQuoted
|
||||
int backslash = 0;
|
||||
for
|
||||
(
|
||||
string::const_iterator iter = str.begin();
|
||||
std::string::const_iterator iter = str.begin();
|
||||
iter != str.end();
|
||||
++iter
|
||||
)
|
||||
@ -199,7 +161,15 @@ Foam::Ostream& Foam::OBJstream::writeQuoted
|
||||
else
|
||||
{
|
||||
// output unquoted string, only advance line number on newline
|
||||
write(str.c_str());
|
||||
for
|
||||
(
|
||||
std::string::const_iterator iter = str.begin();
|
||||
iter != str.end();
|
||||
++iter
|
||||
)
|
||||
{
|
||||
writeAndCheck(*iter);
|
||||
}
|
||||
}
|
||||
|
||||
return *this;
|
||||
@ -208,8 +178,7 @@ Foam::Ostream& Foam::OBJstream::writeQuoted
|
||||
|
||||
Foam::Ostream& Foam::OBJstream::write(const point& pt)
|
||||
{
|
||||
write("v ") << pt.x() << ' ' << pt.y() << ' ' << pt.z()
|
||||
<< nl;
|
||||
write("v ") << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -217,8 +186,7 @@ Foam::Ostream& Foam::OBJstream::write(const point& pt)
|
||||
Foam::Ostream& Foam::OBJstream::write(const point& pt, const vector& n)
|
||||
{
|
||||
write(pt);
|
||||
OFstream::write("vn ") << n.x() << ' ' << n.y()
|
||||
<< ' ' << n.z() << nl;
|
||||
OFstream::write("vn ") << n.x() << ' ' << n.y() << ' ' << n.z() << nl;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -261,7 +229,7 @@ Foam::Ostream& Foam::OBJstream::write
|
||||
const bool lines
|
||||
)
|
||||
{
|
||||
label start = nVertices_;
|
||||
const label start = nVertices_+1; // 1-offset for obj included here
|
||||
write(f.a());
|
||||
write(f.b());
|
||||
write(f.c());
|
||||
@ -270,16 +238,16 @@ Foam::Ostream& Foam::OBJstream::write
|
||||
write('l');
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
write(' ') << start+1+i;
|
||||
write(' ') << i+start;
|
||||
}
|
||||
write(' ') << start+1 << '\n';
|
||||
write(' ') << start << '\n';
|
||||
}
|
||||
else
|
||||
{
|
||||
write('f');
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
write(' ') << start+1+i;
|
||||
write(' ') << i+start;
|
||||
}
|
||||
write('\n');
|
||||
}
|
||||
@ -294,7 +262,7 @@ Foam::Ostream& Foam::OBJstream::write
|
||||
const bool lines
|
||||
)
|
||||
{
|
||||
label start = nVertices_;
|
||||
const label start = nVertices_+1; // 1-offset for obj included here
|
||||
forAll(f, i)
|
||||
{
|
||||
write(points[f[i]]);
|
||||
@ -304,16 +272,16 @@ Foam::Ostream& Foam::OBJstream::write
|
||||
write('l');
|
||||
forAll(f, i)
|
||||
{
|
||||
write(' ') << start+1+i;
|
||||
write(' ') << i+start;
|
||||
}
|
||||
write(' ') << start+1 << '\n';
|
||||
write(' ') << start << '\n';
|
||||
}
|
||||
else
|
||||
{
|
||||
write('f');
|
||||
forAll(f, i)
|
||||
{
|
||||
write(' ') << start+1+i;
|
||||
write(' ') << i+start;
|
||||
}
|
||||
write('\n');
|
||||
}
|
||||
@ -323,19 +291,19 @@ Foam::Ostream& Foam::OBJstream::write
|
||||
|
||||
Foam::Ostream& Foam::OBJstream::write
|
||||
(
|
||||
const faceList& fcs,
|
||||
const UList<face>& faces,
|
||||
const pointField& points,
|
||||
const bool lines
|
||||
)
|
||||
{
|
||||
SubList<face> allFcs(fcs, fcs.size());
|
||||
SubList<face> allFcs(faces, faces.size());
|
||||
|
||||
primitivePatch pp(allFcs, points);
|
||||
|
||||
const pointField& localPoints = pp.localPoints();
|
||||
const faceList& localFaces = pp.localFaces();
|
||||
|
||||
label start = nVertices_;
|
||||
const label start = nVertices_+1; // 1-offset for obj included here
|
||||
|
||||
forAll(localPoints, i)
|
||||
{
|
||||
@ -349,7 +317,7 @@ Foam::Ostream& Foam::OBJstream::write
|
||||
{
|
||||
const edge& e = edges[edgeI];
|
||||
|
||||
write("l ") << start+e[0]+1 << ' ' << start+e[1]+1 << nl;
|
||||
write("l ") << e[0]+start << ' ' << e[1]+start << nl;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -360,7 +328,7 @@ Foam::Ostream& Foam::OBJstream::write
|
||||
write('f');
|
||||
forAll(f, i)
|
||||
{
|
||||
write(' ') << start+f[i]+1;
|
||||
write(' ') << f[i]+start;
|
||||
}
|
||||
write('\n');
|
||||
}
|
||||
@ -369,4 +337,108 @@ Foam::Ostream& Foam::OBJstream::write
|
||||
}
|
||||
|
||||
|
||||
Foam::Ostream& Foam::OBJstream::write
|
||||
(
|
||||
const UList<edge>& edges,
|
||||
const UList<point>& points,
|
||||
const bool compact
|
||||
)
|
||||
{
|
||||
if (compact)
|
||||
{
|
||||
// Code similar to PrimitivePatch::calcMeshData()
|
||||
// Unsorted version
|
||||
|
||||
label objPointId = nVertices_+1; // 1-offset for obj included here
|
||||
|
||||
Map<label> markedPoints(2*edges.size());
|
||||
forAll(edges, edgei)
|
||||
{
|
||||
const edge& e = edges[edgei];
|
||||
|
||||
if (markedPoints.insert(e[0], objPointId))
|
||||
{
|
||||
write(points[e[0]]);
|
||||
++objPointId;
|
||||
}
|
||||
if (markedPoints.insert(e[1], objPointId))
|
||||
{
|
||||
write(points[e[1]]);
|
||||
++objPointId;
|
||||
}
|
||||
}
|
||||
|
||||
forAll(edges, edgei)
|
||||
{
|
||||
const edge& e = edges[edgei];
|
||||
|
||||
write("l ")
|
||||
<< markedPoints[e[0]] << ' '
|
||||
<< markedPoints[e[1]] << nl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const label start = nVertices_+1; // 1-offset for obj included here
|
||||
|
||||
forAll(points, i)
|
||||
{
|
||||
write(points[i]);
|
||||
}
|
||||
|
||||
forAll(edges, edgei)
|
||||
{
|
||||
const edge& e = edges[edgei];
|
||||
|
||||
write("l ")
|
||||
<< e[0]+start << ' ' << e[1]+start << nl;
|
||||
}
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Foam::Ostream& Foam::OBJstream::write
|
||||
(
|
||||
const treeBoundBox& bb,
|
||||
const bool lines
|
||||
)
|
||||
{
|
||||
const label start = nVertices_+1; // 1-offset for obj included here
|
||||
|
||||
pointField points(bb.points());
|
||||
forAll(points, i)
|
||||
{
|
||||
write(points[i]);
|
||||
}
|
||||
|
||||
if (lines)
|
||||
{
|
||||
forAll(treeBoundBox::edges, edgei)
|
||||
{
|
||||
const edge& e = treeBoundBox::edges[edgei];
|
||||
|
||||
write("l ") << e[0]+start << ' ' << e[1]+start << nl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(treeBoundBox::faces, facei)
|
||||
{
|
||||
const face& f = treeBoundBox::faces[facei];
|
||||
|
||||
write('f');
|
||||
forAll(f, i)
|
||||
{
|
||||
write(' ') << f[i]+start;
|
||||
}
|
||||
write('\n');
|
||||
}
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -25,7 +25,7 @@ Class
|
||||
Foam::OBJstream
|
||||
|
||||
Description
|
||||
OFstream which keeps track of vertices
|
||||
OFstream that keeps track of vertices
|
||||
|
||||
SourceFiles
|
||||
OBJstream.C
|
||||
@ -47,6 +47,8 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class treeBoundBox;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class OBJstream Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -64,7 +66,7 @@ class OBJstream
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
void writeAndCheck(const char);
|
||||
void writeAndCheck(const char c);
|
||||
|
||||
public:
|
||||
|
||||
@ -105,21 +107,22 @@ public:
|
||||
using Ostream::write;
|
||||
|
||||
//- Write character
|
||||
virtual Ostream& write(const char);
|
||||
virtual Ostream& write(const char c);
|
||||
|
||||
//- Write character string
|
||||
virtual Ostream& write(const char*);
|
||||
virtual Ostream& write(const char* str);
|
||||
|
||||
//- Write word
|
||||
virtual Ostream& write(const word&);
|
||||
virtual Ostream& write(const word& str);
|
||||
|
||||
virtual Ostream& write(const string&);
|
||||
//- Write string
|
||||
virtual Ostream& write(const string& str);
|
||||
|
||||
//- Write std::string surrounded by quotes.
|
||||
// Optional write without quotes.
|
||||
virtual Ostream& writeQuoted
|
||||
(
|
||||
const std::string&,
|
||||
const std::string& str,
|
||||
const bool quoted=true
|
||||
);
|
||||
|
||||
@ -127,41 +130,57 @@ public:
|
||||
// Direct write functionality
|
||||
|
||||
//- Write point
|
||||
Ostream& write(const point&);
|
||||
Ostream& write(const point& pt);
|
||||
|
||||
//- Write point and vector normal ('vn')
|
||||
Ostream& write(const point&, const vector&);
|
||||
Ostream& write(const point& pt, const vector& n);
|
||||
|
||||
//- Write edge as points with line
|
||||
Ostream& write(const edge&, const UList<point>&);
|
||||
//- Write edge as points and line
|
||||
Ostream& write(const edge& e, const UList<point>& points);
|
||||
|
||||
//- Write line
|
||||
Ostream& write(const linePointRef&);
|
||||
Ostream& write(const linePointRef& ln);
|
||||
|
||||
//- Write line with points and vector normals ('vn')
|
||||
Ostream& write
|
||||
(
|
||||
const linePointRef&,
|
||||
const linePointRef& ln,
|
||||
const vector& n0,
|
||||
const vector& n1
|
||||
);
|
||||
|
||||
//- Write triangle as points with lines or filled polygon
|
||||
Ostream& write(const triPointRef&, const bool lines = true);
|
||||
//- Write triangle as points and lines/filled-polygon
|
||||
Ostream& write(const triPointRef& f, const bool lines = true);
|
||||
|
||||
//- Write face as points with lines or filled polygon
|
||||
//- Write face as points and lines/filled-polygon
|
||||
Ostream& write
|
||||
(
|
||||
const face&,
|
||||
const UList<point>&,
|
||||
const face& f,
|
||||
const UList<point>& points,
|
||||
const bool lines = true
|
||||
);
|
||||
|
||||
//- Write patch as points and faces with lines or filled polygons
|
||||
//- Write patch faces as points and lines/filled-polygon
|
||||
Ostream& write
|
||||
(
|
||||
const faceList&,
|
||||
const pointField&,
|
||||
const UList<face>& faces,
|
||||
const pointField& points,
|
||||
const bool lines = true
|
||||
);
|
||||
|
||||
//- Write edges as points and lines.
|
||||
// Optionally eliminate unused points.
|
||||
Ostream& write
|
||||
(
|
||||
const UList<edge>& edges,
|
||||
const UList<point>& points,
|
||||
const bool compact = false
|
||||
);
|
||||
|
||||
//- Write tree-bounding box as lines/filled-polygons
|
||||
Ostream& write
|
||||
(
|
||||
const treeBoundBox& bb,
|
||||
const bool lines = true
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user