Open CASCADE Technology 7.8.0
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
bool IsDoublePrecision () const
 Return TRUE if vertex position should be stored with double floating point precision; FALSE by default.
 
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
bool HasSurfaceId () const
 Return TRUE 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

bool IsOpened () const
 Return TRUE if file has been opened.
 
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 Standard_Integer theNbNodes, const Standard_Integer theNbElems, const TColStd_IndexedDataMapOfStringString &theFileInfo)
 Write the header.
 
bool WriteVertex (const gp_Pnt &thePoint, const Graphic3d_Vec3 &theNorm, const Graphic3d_Vec2 &theUV, const Graphic3d_Vec4ub &theColor)
 Write single point with all attributes.
 
Standard_Integer NbWrittenVertices () const
 Return number of written vertices.
 
Standard_Integer VertexOffset () const
 Return vertex offset to be applied to element indices; 0 by default.
 
void SetVertexOffset (Standard_Integer theOffset)
 Set vertex offset to be applied to element indices.
 
Standard_Integer SurfaceId () const
 Return surface id to write with element; 0 by default.
 
void SetSurfaceId (Standard_Integer theSurfId)
 Set surface id to write with element.
 
bool WriteTriangle (const Graphic3d_Vec3i &theTri)
 Writing a triangle.
 
bool WriteQuad (const Graphic3d_Vec4i &theQuad)
 Writing a quad.
 
Standard_Integer 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

Return TRUE 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

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

◆ IsOpened()

bool RWPly_PlyWriterContext::IsOpened ( ) const
inline

Return TRUE if file has been opened.

◆ NbWrittenElements()

Standard_Integer RWPly_PlyWriterContext::NbWrittenElements ( ) const
inline

Return number of written elements.

◆ NbWrittenVertices()

Standard_Integer 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 ( Standard_Integer  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 ( Standard_Integer  theOffset)
inline

Set vertex offset to be applied to element indices.

◆ SurfaceId()

Standard_Integer RWPly_PlyWriterContext::SurfaceId ( ) const
inline

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

◆ VertexOffset()

Standard_Integer RWPly_PlyWriterContext::VertexOffset ( ) const
inline

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

◆ WriteHeader()

bool RWPly_PlyWriterContext::WriteHeader ( const Standard_Integer  theNbNodes,
const Standard_Integer  theNbElems,
const TColStd_IndexedDataMapOfStringString theFileInfo 
)

Write the header.

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

◆ WriteQuad()

bool RWPly_PlyWriterContext::WriteQuad ( const Graphic3d_Vec4i theQuad)

Writing a quad.

◆ WriteTriangle()

bool RWPly_PlyWriterContext::WriteTriangle ( const Graphic3d_Vec3i theTri)

Writing a triangle.

◆ WriteVertex()

bool RWPly_PlyWriterContext::WriteVertex ( const gp_Pnt thePoint,
const Graphic3d_Vec3 theNorm,
const Graphic3d_Vec2 theUV,
const Graphic3d_Vec4ub 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: