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. | |
| bool | m_VersionIsCompatible |
| Flag to know if the version is compatible. | |
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 = 101 |
| The binary rep version. | |
Get Functions | |
|
| |
| QString | absoluteFileName () const |
| Return the binary representation file name. | |
| bool | repIsUpToDate (const QDateTime &) |
| Return true if the binary rep is up to date. | |
| 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 42 of file glc_bsrep.h.
| GLC_BSRep::GLC_BSRep | ( | const QString & | absoluteFileName = QString(), |
|
| bool | useCompression = true | |||
| ) |
Default constructor.
Definition at line 40 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 65 of file glc_bsrep.h.
| GLC_BoundingBox GLC_BSRep::boundingBox | ( | void | ) |
Return the bounding box of the binary representation.
Definition at line 167 of file glc_bsrep.cpp.
References headerIsOk(), m_DataStream, open(), and timeStampOk().
Referenced by loadRep().
| bool GLC_BSRep::close | ( | ) | [private] |
Close the file.
Definition at line 263 of file glc_bsrep.cpp.
References m_DataStream, and m_pFile.
Referenced by loadRep(), repIsUpToDate(), and save().
| bool GLC_BSRep::headerIsOk | ( | ) | [private] |
Check the header.
Definition at line 297 of file glc_bsrep.cpp.
References m_DataStream, m_pFile, m_Uuid, m_Version, and m_VersionIsCompatible.
Referenced by boundingBox(), loadRep(), and repIsUpToDate().
| GLC_3DRep GLC_BSRep::loadRep | ( | ) |
Load the binary rep.
Definition at line 108 of file glc_bsrep.cpp.
References boundingBox(), close(), GLC_FileFormatException::FileNotFound, GLC_FileFormatException::FileNotSupported, headerIsOk(), m_DataStream, m_FileInfo, open(), 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 240 of file glc_bsrep.cpp.
References m_DataStream, m_FileInfo, and m_pFile.
Referenced by boundingBox(), loadRep(), repIsUpToDate(), and save().
| bool GLC_BSRep::repIsUpToDate | ( | const QDateTime & | timeStamp | ) |
Return true if the binary rep is up to date.
Definition at line 71 of file glc_bsrep.cpp.
References close(), GLC_FileFormatException::FileNotFound, headerIsOk(), m_FileInfo, m_VersionIsCompatible, open(), timeStampOk(), and GLC_FileFormatException::WrongFileFormat.
Referenced by GLC_CacheManager::isUsable().
| 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 204 of file glc_bsrep.cpp.
References GLC_3DRep::boundingBox(), close(), GLC_Rep::lastModified(), m_CompressionLevel, m_DataStream, 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 193 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 97 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 93 of file glc_bsrep.h.
| QString GLC_BSRep::suffix | ( | ) | [static] |
Return bsrep suffix.
Definition at line 184 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 318 of file glc_bsrep.cpp.
References m_DataStream, and m_pFile.
Referenced by boundingBox(), loadRep(), and repIsUpToDate().
| void GLC_BSRep::writeHeader | ( | const QDateTime & | dateTime | ) | [private] |
Write the header.
Definition at line 277 of file glc_bsrep.cpp.
References m_DataStream, m_pFile, m_Uuid, and m_Version.
Referenced by save().
int GLC_BSRep::m_CompressionLevel [private] |
QDataStream GLC_BSRep::m_DataStream [private] |
The Data stream.
Definition at line 142 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 136 of file glc_bsrep.h.
Referenced by loadRep(), open(), repIsUpToDate(), and setAbsoluteFileName().
QFile* GLC_BSRep::m_pFile [private] |
The brep file.
Definition at line 139 of file glc_bsrep.h.
Referenced by close(), headerIsOk(), open(), timeStampOk(), writeHeader(), and ~GLC_BSRep().
const QString GLC_BSRep::m_Suffix [static, private] |
The binary rep suffix.
Definition at line 127 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 130 of file glc_bsrep.h.
Referenced by headerIsOk(), and writeHeader().
const quint32 GLC_BSRep::m_Version = 101 [static, private] |
The binary rep version.
Definition at line 133 of file glc_bsrep.h.
Referenced by headerIsOk(), and writeHeader().
bool GLC_BSRep::m_VersionIsCompatible [private] |
Flag to know if the version is compatible.
Definition at line 151 of file glc_bsrep.h.
Referenced by headerIsOk(), and repIsUpToDate().