Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
RWPly_PlyWriterContext Class Reference

Auxiliary low-level tool writing PLY file. More...

#include <RWPly_PlyWriterContext.hxx>

Public Member Functions

 RWPly_PlyWriterContext ()
 Empty constructor.
 
 ~RWPly_PlyWriterContext ()
 Destructor, will emit error message if file was not closed.
 
vertex attributes parameters

Return TRUE if vertex position should be stored with double floating point precision; FALSE by default.

bool IsDoublePrecision () const
 Set if vertex position should be stored with double floating point precision.
 
void SetDoublePrecision (bool theDoublePrec)
 Set if vertex position should be stored with double floating point precision.
 
bool HasNormals () const
 Return TRUE if normals should be written as vertex attribute; FALSE by default.
 
void SetNormals (const bool theHasNormals)
 Set if normals should be written.
 
bool HasTexCoords () const
 Return TRUE if UV / texture coordinates should be written as vertex attribute; FALSE by default.
 
void SetTexCoords (const bool theHasTexCoords)
 Set if UV / texture coordinates should be written.
 
bool HasColors () const
 Return TRUE if point colors should be written as vertex attribute; FALSE by default.
 
void SetColors (bool theToWrite)
 Set if point colors should be written.
 
element attributes parameters

Return TRUE if surface Id should be written as element attribute; FALSE by default.

bool HasSurfaceId () const
 Set if surface Id should be written as element attribute; FALSE by default.
 
void SetSurfaceId (bool theSurfId)
 Set if surface Id should be written as element attribute; FALSE by default.
 

writing into file

Return TRUE if file has been opened.

bool IsOpened () const
 Open file for writing.
 
bool Open (const TCollection_AsciiString &theName, const std::shared_ptr< std::ostream > &theStream=std::shared_ptr< std::ostream >())
 Open file for writing.
 
bool WriteHeader (const int theNbNodes, const int theNbElems, const NCollection_IndexedDataMap< TCollection_AsciiString, TCollection_AsciiString > &theFileInfo)
 Write the header.
 
bool WriteVertex (const gp_Pnt &thePoint, const NCollection_Vec3< float > &theNorm, const NCollection_Vec2< float > &theUV, const NCollection_Vec4< uint8_t > &theColor)
 Write single point with all attributes.
 
int NbWrittenVertices () const
 Return number of written vertices.
 
int VertexOffset () const
 Return vertex offset to be applied to element indices; 0 by default.
 
void SetVertexOffset (int theOffset)
 Set vertex offset to be applied to element indices.
 
int SurfaceId () const
 Return surface id to write with element; 0 by default.
 
void SetSurfaceId (int theSurfId)
 Set surface id to write with element.
 
bool WriteTriangle (const NCollection_Vec3< int > &theTri)
 Writing a triangle.
 
bool WriteQuad (const NCollection_Vec4< int > &theQuad)
 Writing a quad.
 
int NbWrittenElements () const
 Return number of written elements.
 
bool Close (bool theIsAborted=false)
 Correctly close the file.
 

Detailed Description

Auxiliary low-level tool writing PLY file.

Constructor & Destructor Documentation

◆ RWPly_PlyWriterContext()

RWPly_PlyWriterContext::RWPly_PlyWriterContext ( )

Empty constructor.

◆ ~RWPly_PlyWriterContext()

RWPly_PlyWriterContext::~RWPly_PlyWriterContext ( )

Destructor, will emit error message if file was not closed.

Member Function Documentation

◆ Close()

bool RWPly_PlyWriterContext::Close ( bool theIsAborted = false)

Correctly close the file.

Returns
FALSE in case of writing error

◆ HasColors()

bool RWPly_PlyWriterContext::HasColors ( ) const
inline

Return TRUE if point colors should be written as vertex attribute; FALSE by default.

◆ HasNormals()

bool RWPly_PlyWriterContext::HasNormals ( ) const
inline

Return TRUE if normals should be written as vertex attribute; FALSE by default.

◆ HasSurfaceId()

bool RWPly_PlyWriterContext::HasSurfaceId ( ) const
inline

Set if surface Id should be written as element attribute; FALSE by default.

◆ HasTexCoords()

bool RWPly_PlyWriterContext::HasTexCoords ( ) const
inline

Return TRUE if UV / texture coordinates should be written as vertex attribute; FALSE by default.

◆ IsDoublePrecision()

bool RWPly_PlyWriterContext::IsDoublePrecision ( ) const
inline

Set if vertex position should be stored with double floating point precision.

◆ IsOpened()

bool RWPly_PlyWriterContext::IsOpened ( ) const
inline

Open file for writing.

◆ NbWrittenElements()

int RWPly_PlyWriterContext::NbWrittenElements ( ) const
inline

Return number of written elements.

◆ NbWrittenVertices()

int RWPly_PlyWriterContext::NbWrittenVertices ( ) const
inline

Return number of written vertices.

◆ Open()

bool RWPly_PlyWriterContext::Open ( const TCollection_AsciiString & theName,
const std::shared_ptr< std::ostream > & theStream = std::shared_ptr< std::ostream >() )

Open file for writing.

◆ SetColors()

void RWPly_PlyWriterContext::SetColors ( bool theToWrite)
inline

Set if point colors should be written.

◆ SetDoublePrecision()

void RWPly_PlyWriterContext::SetDoublePrecision ( bool theDoublePrec)
inline

Set if vertex position should be stored with double floating point precision.

◆ SetNormals()

void RWPly_PlyWriterContext::SetNormals ( const bool theHasNormals)
inline

Set if normals should be written.

◆ SetSurfaceId() [1/2]

void RWPly_PlyWriterContext::SetSurfaceId ( bool theSurfId)
inline

Set if surface Id should be written as element attribute; FALSE by default.

◆ SetSurfaceId() [2/2]

void RWPly_PlyWriterContext::SetSurfaceId ( int theSurfId)
inline

Set surface id to write with element.

◆ SetTexCoords()

void RWPly_PlyWriterContext::SetTexCoords ( const bool theHasTexCoords)
inline

Set if UV / texture coordinates should be written.

◆ SetVertexOffset()

void RWPly_PlyWriterContext::SetVertexOffset ( int theOffset)
inline

Set vertex offset to be applied to element indices.

◆ SurfaceId()

int RWPly_PlyWriterContext::SurfaceId ( ) const
inline

Return surface id to write with element; 0 by default.

◆ VertexOffset()

int RWPly_PlyWriterContext::VertexOffset ( ) const
inline

Return vertex offset to be applied to element indices; 0 by default.

◆ WriteHeader()

bool RWPly_PlyWriterContext::WriteHeader ( const int theNbNodes,
const int theNbElems,
const NCollection_IndexedDataMap< TCollection_AsciiString, TCollection_AsciiString > & theFileInfo )

Write the header.

Parameters
[in]theNbNodesnumber of vertex nodes
[in]theNbElemsnumber of mesh elements
[in]theFileInfooptional comments

◆ WriteQuad()

bool RWPly_PlyWriterContext::WriteQuad ( const NCollection_Vec4< int > & theQuad)

Writing a quad.

◆ WriteTriangle()

bool RWPly_PlyWriterContext::WriteTriangle ( const NCollection_Vec3< int > & theTri)

Writing a triangle.

◆ WriteVertex()

bool RWPly_PlyWriterContext::WriteVertex ( const gp_Pnt & thePoint,
const NCollection_Vec3< float > & theNorm,
const NCollection_Vec2< float > & theUV,
const NCollection_Vec4< uint8_t > & theColor )

Write single point with all attributes.

Parameters
[in]thePoint3D point coordinates
[in]theNormsurface normal direction at the point
[in]theUVsurface/texture UV coordinates
[in]theColorRGB color values

The documentation for this class was generated from the following file: