34 int precision )
const {
36 if (!fp.open(QFile::WriteOnly | QFile::Text))
return false;
38 QTextStream stream(&fp);
39 stream.setRealNumberNotation(QTextStream::FixedNotation);
40 stream.setRealNumberPrecision(precision);
43 for (
unsigned i = 0; i < 4; ++i) {
50 return (fp.error() == QFile::NoError);
55 if (!fp.open(QFile::ReadOnly | QFile::Text))
return false;
57 QTextStream stream(&fp);
60 for (
unsigned i = 0; i < 4; ++i) {
62 stream >>
m_mat[i + 4];
63 stream >>
m_mat[i + 8];
64 stream >>
m_mat[i + 12];
69 return (fp.error() == QFile::NoError);
125 double t = (index - trans1.
getIndex()) / dt;
126 assert(t >= 0 && t <= 1);
137 assert(out.isOpen() && (out.openMode() & QIODevice::WriteOnly));
140 if (dataVersion >= 34) {
141 if (out.write((
const char*)&
m_index,
sizeof(
double)) < 0)
159 assert(in.isOpen() && (in.openMode() & QIODevice::ReadOnly));
float PointCoordinateType
Type of the coordinates of a (N-D) point.
bool fromFile(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
bool toFile(QFile &out, short dataVersion) const override
void invert()
Inverts transformation.
static ccGLMatrixTpl Interpolate(float coef, const ccGLMatrixTpl< float > &glMat1, const ccGLMatrixTpl< float > &glMat2)
Interpolates two matrices at relative position 'coef'.
short minimumFileVersion() const override
void transpose()
Transposes matrix (in place)
float m_mat[OPENGL_MATRIX_SIZE]
Internal 4x4 GL-style matrix data.
Float version of ccGLMatrixTpl.
static bool CorruptError()
Sends a custom error message (corrupted file) and returns 'false'.
QMultiMap< unsigned, unsigned > LoadedIDMap
Map of loaded unique IDs (old ID --> new ID)
static bool ReadError()
Sends a custom error message (read error) and returns 'false'.
static bool WriteError()
Sends a custom error message (write error) and returns 'false'.
QTextStream & endl(QTextStream &stream)