f956fd20cc
- aggiunta scrittura binaria - tolte GetKey, Load e Save da interfaccia IGeoObj.
49 lines
2.0 KiB
C++
49 lines
2.0 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2014-2014
|
|
//----------------------------------------------------------------------------
|
|
// File : NgeWriter.h Data : 12.04.14 Versione : 1.5d5
|
|
// Contenuto : Dichiarazione della classe NgeWriter.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 12.04.14 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "NgeConst.h"
|
|
#include "/EgtDev/Include/EGkPoint3d.h"
|
|
#include "/EgtDev/Include/EGkColor.h"
|
|
#include <fstream>
|
|
|
|
//----------------------------------------------------------------------------
|
|
class NgeWriter
|
|
{
|
|
public :
|
|
NgeWriter( void) : m_bBinary( false) {}
|
|
~NgeWriter( void)
|
|
{ Close() ; }
|
|
bool Init( const std::string& sFileOut, bool bBinary) ;
|
|
bool Close( void) ;
|
|
void WriteUchar( unsigned char ucVal, const char* szSep, bool bEndL = false) ;
|
|
void WriteBool( bool bVal, const char* szSep, bool bEndL = false) ;
|
|
void WriteInt( int nVal, const char* szSep, bool bEndL = false) ;
|
|
void WriteDouble( double dVal, const char* szSep, bool bEndL = false, int nPrec = 6) ;
|
|
void WriteVector( const Vector3d& vtV, const char* szSep, bool bEndL = false, int nPrec = 9) ;
|
|
void WritePoint( const Point3d& ptP, const char* szSep, bool bEndL = false, int nPrec = 6) ;
|
|
void WritePointW( const Point3d& ptP, double dW, const char* szSep, bool bEndL = false,
|
|
int nPrecP = 6, int nPrecW = 9) ;
|
|
void WriteFrame( const Frame3d& frF, const char* szSep, bool bEndL, int nPrecP = 6, int nPrecV = 9) ;
|
|
void WriteString( const std::string& sVal, const char* szSep, bool bEndL = false) ;
|
|
void WriteKey( int nKey, bool bEndL) ;
|
|
void WriteCol( const Color& cCol, const char* szSep, bool bEndL = false) ;
|
|
|
|
|
|
private :
|
|
bool m_bBinary ;
|
|
std::ofstream m_OutFile ;
|
|
|
|
} ;
|