GLC_BSRep : The 3D Binary serialised representation. More...
#include <glc_bsrep.h>
Public Member Functions | |
Constructor | |
| GLC_BSRep (const QString &absoluteFileName=QString(), bool useCompression=true) | |
| Default constructor. | |
| GLC_BSRep (const GLC_BSRep &) | |
| Copy constructor. | |
| virtual | ~GLC_BSRep () |
| Destructor. | |
Set Functions | |
| void | setAbsoluteFileName (const QString &) |
| Set the binary representation file name. | |
| bool | save (const GLC_3DRep &) |
| Save the GLC_3DRep in serialised binary. | |
| void | setCompressionUsage (bool usage) |
| Set the compression usage for saving a 3DREP in binary format. | |
| void | setCompressionLevel (int level) |
| Set the compression level if compression is used when saving in binary format. | |
Private Member Functions | |
| bool | open (QIODevice::OpenMode) |
| Open the file. | |
| bool | close () |
| Close the file. | |
| void | writeHeader (const QDateTime &) |
| Write the header. | |
| bool | headerIsOk () |
| Check the header. | |
| bool | timeStampOk (const QDateTime &) |
| Check the time Stamp. | |
Private Attributes | |
| QFileInfo | m_FileInfo |
| the Binary representation file informations | |
| QFile * | m_pFile |
| The brep file. | |
| QDataStream | m_DataStream |
| The Data stream. | |
| bool | m_UseCompression |
| Compress Data. | |
| int | m_CompressionLevel |
| The compression level. | |
Static Private Attributes | |
| static const QString | m_Suffix |
| The binary rep suffix. | |
| static const QUuid | m_Uuid |
| The binary rep magic number. | |
| static const quint32 | m_Version = 102 |
| The binary rep version. | |
| static QMutex | m_CompressionMutex |
| Compression Mutex. | |
Get Functions | |
|
| |
| QString | absoluteFileName () const |
| Return the binary representation file name. | |
| bool | isUsable (const QDateTime &) |
| Return true if the binary rep is usable. | |
| GLC_3DRep | loadRep () |
| Load the binary rep. | |
| GLC_BoundingBox | boundingBox () |
| Return the bounding box of the binary representation. | |
| static QString | suffix () |
| Return bsrep suffix. | |
GLC_BSRep : The 3D Binary serialised representation.
Definition at line 41 of file glc_bsrep.h.
| GLC_BSRep::GLC_BSRep | ( | const QString & | absoluteFileName = QString(), |
|
| bool | useCompression = true | |||
| ) |
Default constructor.
Definition at line 41 of file glc_bsrep.cpp.
References m_DataStream, and setAbsoluteFileName().
| GLC_BSRep::GLC_BSRep | ( | const GLC_BSRep & | binaryRep | ) |
| GLC_BSRep::~GLC_BSRep | ( | ) | [virtual] |
| QString GLC_BSRep::absoluteFileName | ( | ) | const [inline] |
Return the binary representation file name.
Definition at line 64 of file glc_bsrep.h.
| GLC_BoundingBox GLC_BSRep::boundingBox | ( | void | ) |
Return the bounding box of the binary representation.
Definition at line 161 of file glc_bsrep.cpp.
References close(), headerIsOk(), m_DataStream, open(), and timeStampOk().
Referenced by loadRep().
| bool GLC_BSRep::close | ( | ) | [private] |
Close the file.
Definition at line 273 of file glc_bsrep.cpp.
References m_DataStream, and m_pFile.
Referenced by boundingBox(), isUsable(), loadRep(), and save().
| bool GLC_BSRep::headerIsOk | ( | ) | [private] |
Check the header.
Definition at line 308 of file glc_bsrep.cpp.
References m_DataStream, m_pFile, m_Uuid, m_Version, and glc::version().
Referenced by boundingBox(), isUsable(), and loadRep().
| bool GLC_BSRep::isUsable | ( | const QDateTime & | timeStamp | ) |
Return true if the binary rep is usable.
Definition at line 71 of file glc_bsrep.cpp.
References GLC_TraceLog::addTrace(), close(), GLC_FileFormatException::FileNotFound, headerIsOk(), GLC_TraceLog::isEnable(), m_FileInfo, open(), and timeStampOk().
Referenced by GLC_CacheManager::isUsable().
| GLC_3DRep GLC_BSRep::loadRep | ( | ) |
Load the binary rep.
Definition at line 103 of file glc_bsrep.cpp.
References boundingBox(), close(), GLC_FileFormatException::FileNotFound, GLC_FileFormatException::FileNotSupported, headerIsOk(), m_DataStream, m_FileInfo, open(), GLC_Rep::setFileName(), timeStampOk(), and GLC_FileFormatException::WrongFileFormat.
Referenced by GLC_3dxmlToWorld::create3DrepFrom3dxmlRep(), GLC_3dxmlToWorld::loadExternalRef3D(), and GLC_3dxmlToWorld::loadExternRepresentations().
| bool GLC_BSRep::open | ( | QIODevice::OpenMode | mode | ) | [private] |
Open the file.
Definition at line 248 of file glc_bsrep.cpp.
References GLC_TraceLog::addTrace(), GLC_TraceLog::isEnable(), m_DataStream, m_FileInfo, and m_pFile.
Referenced by boundingBox(), isUsable(), loadRep(), and save().
| bool GLC_BSRep::save | ( | const GLC_3DRep & | rep | ) |
Save the GLC_3DRep in serialised binary.
Check if the currentFileInfo is valid and writable
Definition at line 199 of file glc_bsrep.cpp.
References GLC_3DRep::boundingBox(), close(), GLC_3DRep::faceCount(), GLC_Rep::lastModified(), m_CompressionLevel, m_DataStream, m_pFile, m_UseCompression, open(), and writeHeader().
Referenced by GLC_CacheManager::addToCache().
| void GLC_BSRep::setAbsoluteFileName | ( | const QString & | fileName | ) |
Set the binary representation file name.
Definition at line 188 of file glc_bsrep.cpp.
References m_FileInfo, and m_Suffix.
Referenced by GLC_BSRep(), and GLC_CacheManager::isUsable().
| void GLC_BSRep::setCompressionLevel | ( | int | level | ) | [inline] |
Set the compression level if compression is used when saving in binary format.
Definition at line 96 of file glc_bsrep.h.
Referenced by GLC_CacheManager::addToCache().
| void GLC_BSRep::setCompressionUsage | ( | bool | usage | ) | [inline] |
Set the compression usage for saving a 3DREP in binary format.
Definition at line 92 of file glc_bsrep.h.
| QString GLC_BSRep::suffix | ( | ) | [static] |
Return bsrep suffix.
Definition at line 179 of file glc_bsrep.cpp.
References m_Suffix.
Referenced by GLC_CacheManager::binary3DRep(), GLC_CacheManager::isCashed(), and GLC_CacheManager::isUsable().
| bool GLC_BSRep::timeStampOk | ( | const QDateTime & | timeStamp | ) | [private] |
Check the time Stamp.
Definition at line 331 of file glc_bsrep.cpp.
References m_DataStream, and m_pFile.
Referenced by boundingBox(), isUsable(), and loadRep().
| void GLC_BSRep::writeHeader | ( | const QDateTime & | dateTime | ) | [private] |
Write the header.
Definition at line 287 of file glc_bsrep.cpp.
References m_DataStream, m_pFile, m_Uuid, and m_Version.
Referenced by save().
int GLC_BSRep::m_CompressionLevel [private] |
QMutex GLC_BSRep::m_CompressionMutex [static, private] |
Compression Mutex.
Definition at line 150 of file glc_bsrep.h.
QDataStream GLC_BSRep::m_DataStream [private] |
The Data stream.
Definition at line 141 of file glc_bsrep.h.
Referenced by boundingBox(), close(), GLC_BSRep(), headerIsOk(), loadRep(), open(), save(), timeStampOk(), and writeHeader().
QFileInfo GLC_BSRep::m_FileInfo [private] |
the Binary representation file informations
Definition at line 135 of file glc_bsrep.h.
Referenced by isUsable(), loadRep(), open(), and setAbsoluteFileName().
QFile* GLC_BSRep::m_pFile [private] |
The brep file.
Definition at line 138 of file glc_bsrep.h.
Referenced by close(), headerIsOk(), open(), save(), timeStampOk(), writeHeader(), and ~GLC_BSRep().
const QString GLC_BSRep::m_Suffix [static, private] |
The binary rep suffix.
Definition at line 126 of file glc_bsrep.h.
Referenced by setAbsoluteFileName(), and suffix().
bool GLC_BSRep::m_UseCompression [private] |
const QUuid GLC_BSRep::m_Uuid [static, private] |
The binary rep magic number.
Definition at line 129 of file glc_bsrep.h.
Referenced by headerIsOk(), and writeHeader().
const quint32 GLC_BSRep::m_Version = 102 [static, private] |
The binary rep version.
Definition at line 132 of file glc_bsrep.h.
Referenced by headerIsOk(), and writeHeader().