PtexExtractor/PtexUtilizer.h
#if defined(JAMBUILD)
#else
#include "../../include/Mudbox/mudbox.h"
#include "../../include/MapExtractor/MapExtractorInterface.h"
#endif
#include "PtexLayout.h"
#include "ptex/Ptexture.h"
class PtexUtilizer : public Utilizer
{
struct FaceData
{
FaceData( unsigned int iWidth, unsigned int iHeight, unsigned int iChannelCount );
unsigned int m_iSamplesLeft;
unsigned int m_iWidth;
unsigned int m_iHeight;
};
enum Format
{
eFormat8bitInteger,
eFormat16bitInteger,
eFormat16bitFloat,
eFormat32bitFloat
};
PtexUtilizer( void );
QString MapTypeName(
void )
const {
return QObject::tr(
"Ptex"); };
virtual Layout *CreateLayout( void ) { return new PtexLayout; };
virtual void StoreData(
const Data &cData,
const TargetLocation &cTarget,
const SurfacePoint & );
virtual void Serialize(
Stream & );
virtual bool IsValid( void ) { return !m_sFileName.Value().isEmpty() && Utilizer::IsValid(); };
inline void SetFormat( Format eFormat ) { m_eFormat = eFormat; };
virtual void Prepare( Layout *, class Sampler * );
static void WriteMeshData( PtexWriter *pWriter,
const Mesh *pMesh );
private:
void OpenFile(
const Mesh *pMesh );
void CloseFile( void );
class PtexWriter *m_pWriter;
unsigned int m_iPtexFaceCount;
int m_iChannelCount;
abool m_bIncludeMeshData;
unsigned int m_iFacesProcessed;
const PtexLayout *m_pLayout;
};