|
Open CASCADE Technology 7.8.2.dev
|
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. | |
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 |
Return TRUE 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 |
Return TRUE if vertex position should be stored with double floating point precision; FALSE by default.
|
inline |
Return TRUE if file has been opened.
|
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.
|
inline |
Set if point colors should be written.
|
inline |
Set if vertex position should be stored with double floating point precision.
Set if normals should be written.
|
inline |
Set if surface Id should be written as element attribute; FALSE by default.
|
inline |
Set surface id to write with element.
Set if UV / texture coordinates should be written.
|
inline |
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 Standard_Integer | theNbNodes, |
| const Standard_Integer | theNbElems, | ||
| const TColStd_IndexedDataMapOfStringString & | 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 Graphic3d_Vec4i & | theQuad | ) |
Writing a quad.
| bool RWPly_PlyWriterContext::WriteTriangle | ( | const Graphic3d_Vec3i & | theTri | ) |
Writing a triangle.
| 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.
| [in] | thePoint | 3D point coordinates |
| [in] | theNorm | surface normal direction at the point |
| [in] | theUV | surface/texture UV coordinates |
| [in] | theColor | RGB color values |