![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
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. | |
Auxiliary low-level tool writing PLY file.
| RWPly_PlyWriterContext::RWPly_PlyWriterContext | ( | ) |
Empty constructor.
| RWPly_PlyWriterContext::~RWPly_PlyWriterContext | ( | ) |
Destructor, will emit error message if file was not closed.
Correctly close the file.
|
inline |
Return TRUE if point colors should be written as vertex attribute; FALSE by default.
|
inline |
Return TRUE if normals should be written as vertex attribute; FALSE by default.
|
inline |
Set if surface Id should be written as element attribute; FALSE by default.
|
inline |
Return TRUE if UV / texture coordinates should be written as vertex attribute; FALSE by default.
|
inline |
Set if vertex position should be stored with double floating point precision.
|
inline |
Open file for writing.
|
inline |
Return number of written elements.
|
inline |
Return number of written vertices.
| bool RWPly_PlyWriterContext::Open | ( | const TCollection_AsciiString & | theName, |
| const std::shared_ptr< std::ostream > & | theStream = std::shared_ptr< std::ostream >() ) |
Open file for writing.
Set if point colors should be written.
Set if vertex position should be stored with double floating point precision.
Set if normals should be written.
Set if surface Id should be written as element attribute; FALSE by default.
Set surface id to write with element.
Set if UV / texture coordinates should be written.
Set vertex offset to be applied to element indices.
|
inline |
Return surface id to write with element; 0 by default.
|
inline |
Return vertex offset to be applied to element indices; 0 by default.
| bool RWPly_PlyWriterContext::WriteHeader | ( | const int | theNbNodes, |
| const int | theNbElems, | ||
| const NCollection_IndexedDataMap< TCollection_AsciiString, TCollection_AsciiString > & | theFileInfo ) |
Write the header.
| [in] | theNbNodes | number of vertex nodes |
| [in] | theNbElems | number of mesh elements |
| [in] | theFileInfo | optional comments |
| bool RWPly_PlyWriterContext::WriteQuad | ( | const NCollection_Vec4< int > & | theQuad | ) |
Writing a quad.
| bool RWPly_PlyWriterContext::WriteTriangle | ( | const NCollection_Vec3< int > & | theTri | ) |
Writing a triangle.
| 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.
| [in] | thePoint | 3D point coordinates |
| [in] | theNorm | surface normal direction at the point |
| [in] | theUV | surface/texture UV coordinates |
| [in] | theColor | RGB color values |