Open CASCADE Technology  7.6.0
Public Member Functions | Data Fields

RWObj_ObjWriterContext Class Reference

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

#include <RWObj_ObjWriterContext.hxx>

Public Member Functions

 RWObj_ObjWriterContext (const TCollection_AsciiString &theName)
 Main constructor. More...
 
 ~RWObj_ObjWriterContext ()
 Destructor, will emit error message if file was not closed. More...
 
bool IsOpened () const
 Return true if file has been opened. More...
 
bool Close ()
 Correctly close the file. More...
 
bool HasNormals () const
 Return true if normals are defined. More...
 
void SetNormals (const bool theHasNormals)
 Set if normals are defined. More...
 
bool HasTexCoords () const
 Return true if normals are defined. More...
 
void SetTexCoords (const bool theHasTexCoords)
 Set if normals are defined. More...
 
bool WriteHeader (const Standard_Integer theNbNodes, const Standard_Integer theNbElems, const TCollection_AsciiString &theMatLib, const TColStd_IndexedDataMapOfStringString &theFileInfo)
 Write the header. More...
 
const TCollection_AsciiStringActiveMaterial () const
 Return active material or empty string if not set. More...
 
bool WriteActiveMaterial (const TCollection_AsciiString &theMaterial)
 Set active material. More...
 
bool WriteTriangle (const Graphic3d_Vec3i &theTri)
 Writing a triangle. More...
 
bool WriteQuad (const Graphic3d_Vec4i &theQuad)
 Writing a quad. More...
 
bool WriteVertex (const Graphic3d_Vec3 &theValue)
 Writing a vector. More...
 
bool WriteNormal (const Graphic3d_Vec3 &theValue)
 Writing a vector. More...
 
bool WriteTexCoord (const Graphic3d_Vec2 &theValue)
 Writing a vector. More...
 
bool WriteGroup (const TCollection_AsciiString &theValue)
 Writing a group name. More...
 
void FlushFace (Standard_Integer theNbNodes)
 Increment indices shift. More...
 

Data Fields

Standard_Integer NbFaces
 

Detailed Description

Auxiliary low-level tool writing OBJ file.

Constructor & Destructor Documentation

◆ RWObj_ObjWriterContext()

RWObj_ObjWriterContext::RWObj_ObjWriterContext ( const TCollection_AsciiString theName)

Main constructor.

◆ ~RWObj_ObjWriterContext()

RWObj_ObjWriterContext::~RWObj_ObjWriterContext ( )

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

Member Function Documentation

◆ ActiveMaterial()

const TCollection_AsciiString& RWObj_ObjWriterContext::ActiveMaterial ( ) const
inline

Return active material or empty string if not set.

◆ Close()

bool RWObj_ObjWriterContext::Close ( )

Correctly close the file.

◆ FlushFace()

void RWObj_ObjWriterContext::FlushFace ( Standard_Integer  theNbNodes)

Increment indices shift.

◆ HasNormals()

bool RWObj_ObjWriterContext::HasNormals ( ) const
inline

Return true if normals are defined.

◆ HasTexCoords()

bool RWObj_ObjWriterContext::HasTexCoords ( ) const
inline

Return true if normals are defined.

◆ IsOpened()

bool RWObj_ObjWriterContext::IsOpened ( ) const
inline

Return true if file has been opened.

◆ SetNormals()

void RWObj_ObjWriterContext::SetNormals ( const bool  theHasNormals)
inline

Set if normals are defined.

◆ SetTexCoords()

void RWObj_ObjWriterContext::SetTexCoords ( const bool  theHasTexCoords)
inline

Set if normals are defined.

◆ WriteActiveMaterial()

bool RWObj_ObjWriterContext::WriteActiveMaterial ( const TCollection_AsciiString theMaterial)

Set active material.

◆ WriteGroup()

bool RWObj_ObjWriterContext::WriteGroup ( const TCollection_AsciiString theValue)

Writing a group name.

◆ WriteHeader()

bool RWObj_ObjWriterContext::WriteHeader ( const Standard_Integer  theNbNodes,
const Standard_Integer  theNbElems,
const TCollection_AsciiString theMatLib,
const TColStd_IndexedDataMapOfStringString theFileInfo 
)

Write the header.

◆ WriteNormal()

bool RWObj_ObjWriterContext::WriteNormal ( const Graphic3d_Vec3 theValue)

Writing a vector.

◆ WriteQuad()

bool RWObj_ObjWriterContext::WriteQuad ( const Graphic3d_Vec4i theQuad)

Writing a quad.

◆ WriteTexCoord()

bool RWObj_ObjWriterContext::WriteTexCoord ( const Graphic3d_Vec2 theValue)

Writing a vector.

◆ WriteTriangle()

bool RWObj_ObjWriterContext::WriteTriangle ( const Graphic3d_Vec3i theTri)

Writing a triangle.

◆ WriteVertex()

bool RWObj_ObjWriterContext::WriteVertex ( const Graphic3d_Vec3 theValue)

Writing a vector.

Field Documentation

◆ NbFaces

Standard_Integer RWObj_ObjWriterContext::NbFaces

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