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
|
Foam::Ostream& Foam::OBJstream::write
|
||||||
(
|
(
|
||||||
const face& f,
|
const face& f,
|
||||||
|
|||||||
@ -39,13 +39,14 @@ SourceFiles
|
|||||||
#include "point.H"
|
#include "point.H"
|
||||||
#include "edge.H"
|
#include "edge.H"
|
||||||
#include "face.H"
|
#include "face.H"
|
||||||
|
#include "triPointRef.H"
|
||||||
|
#include "linePointRef.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class OBJstream Declaration
|
Class OBJstream Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -134,6 +135,9 @@ public:
|
|||||||
//- Write line
|
//- Write line
|
||||||
Ostream& write(const linePointRef&);
|
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
|
//- Write face as points with lines or filled polygon
|
||||||
Ostream& write
|
Ostream& write
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user