glc_bsrep.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00025
00026 #ifndef GLC_BSREP_H_
00027 #define GLC_BSREP_H_
00028
00029 #include <QString>
00030 #include <QFileInfo>
00031 #include <QDataStream>
00032 #include <QUuid>
00033 #include <QDateTime>
00034
00035 #include "../glc_config.h"
00036 #include "glc_3drep.h"
00037
00040
00041
00042 class GLC_LIB_EXPORT GLC_BSRep
00043 {
00045
00047
00048 public:
00050 GLC_BSRep(const QString& absoluteFileName= QString(), bool useCompression= true);
00051
00053 GLC_BSRep(const GLC_BSRep&);
00054
00056 virtual ~GLC_BSRep();
00058
00059
00061
00062 public:
00063
00065 inline QString absoluteFileName() const
00066 {return m_FileInfo.fileName();}
00067
00069 bool repIsUpToDate(const QDateTime&);
00070
00072 GLC_3DRep loadRep();
00073
00075 GLC_BoundingBox boundingBox();
00076
00078 static QString suffix();
00080
00082
00084
00085 public:
00087 void setAbsoluteFileName(const QString&);
00088
00090 bool save(const GLC_3DRep&);
00091
00093 inline void setCompressionUsage(bool usage)
00094 {m_UseCompression= usage;}
00095
00097 inline void setCompressionLevel(int level)
00098 {m_CompressionLevel= level;}
00099
00101
00102 private:
00104
00106
00108 bool open(QIODevice::OpenMode);
00109
00111 bool close();
00112
00114 void writeHeader(const QDateTime&);
00115
00117 bool headerIsOk();
00118
00120 bool timeStampOk(const QDateTime&);
00121
00123
00125 private:
00127 static const QString m_Suffix;
00128
00130 static const QUuid m_Uuid;
00131
00133 static const quint32 m_Version;
00134
00136 QFileInfo m_FileInfo;
00137
00139 QFile* m_pFile;
00140
00142 QDataStream m_DataStream;
00143
00145 bool m_UseCompression;
00146
00148 int m_CompressionLevel;
00149
00150 };
00151
00152 #endif