mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: OBJstream: output triPointRef
This commit is contained in:
@ -238,6 +238,38 @@ Foam::Ostream& Foam::OBJstream::write(const linePointRef& ln)
|
||||
}
|
||||
|
||||
|
||||
Foam::Ostream& Foam::OBJstream::write
|
||||
(
|
||||
const triPointRef& f,
|
||||
const bool lines
|
||||
)
|
||||
{
|
||||
label start = nVertices_;
|
||||
write(f.a());
|
||||
write(f.b());
|
||||
write(f.c());
|
||||
if (lines)
|
||||
{
|
||||
write('l');
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
write(' ') << start+1+i;
|
||||
}
|
||||
write(' ') << start+1 << '\n';
|
||||
}
|
||||
else
|
||||
{
|
||||
write('f');
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
write(' ') << start+1+i;
|
||||
}
|
||||
write('\n');
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Foam::Ostream& Foam::OBJstream::write
|
||||
(
|
||||
const face& f,
|
||||
|
||||
@ -39,13 +39,14 @@ SourceFiles
|
||||
#include "point.H"
|
||||
#include "edge.H"
|
||||
#include "face.H"
|
||||
#include "triPointRef.H"
|
||||
#include "linePointRef.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class OBJstream Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -134,6 +135,9 @@ public:
|
||||
//- Write line
|
||||
Ostream& write(const linePointRef&);
|
||||
|
||||
//- Write triangle as points with lines or filled polygon
|
||||
Ostream& write(const triPointRef&, const bool lines = true);
|
||||
|
||||
//- Write face as points with lines or filled polygon
|
||||
Ostream& write
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user