00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef QSMATRIX_H
00019 #define QSMATRIX_H
00020
00021 #ifdef HAVE_CONFIG_H
00022 #include <config.h>
00023 #endif
00024 #include<qstring.h>
00025 #include<qobject.h>
00026 #include"qsserializable.h"
00027
00028 class QSData;
00029
00046 class QSMatrix : public QObject, public QSSerializable {
00047 Q_OBJECT
00048 public:
00052 QSMatrix();
00056 virtual ~QSMatrix();
00061 virtual double value( int row, int col ) = 0;
00067 virtual QString string( int row, int col ) { return QString::number(value(row,col),'g',9); }
00071 virtual int rows() const = 0;
00075 virtual int cols() const = 0;
00080 virtual bool resize( int rows, int cols );
00085 virtual bool transpose() { return false; }
00089 void copyRange( int row, int col, QSMatrix *src, int srcStartRow, int srcStartCol, int srcEndRow, int srcEndCol );
00094 virtual void setDataObject( QSData *data, int channel );
00098 QSData *dataObject() const { return m_data_object; }
00102 int channel() const { return m_channel; }
00107 virtual void setValue( int row, int col, double value );
00111 virtual void setString( int row, int col, const QString& string );
00115 virtual bool isReference() const;
00120 virtual bool isEditable() const;
00124 virtual bool isString() const;
00128 virtual void dataChanging();
00132 virtual void dataChanged();
00136 virtual void loadStateFromStream( QDataStream& stream, QSObjectFactory *factory );
00140 virtual void saveStateToStream( QDataStream& stream, QSObjectFactory *factory );
00141
00142 protected:
00143 QSData *m_data_object;
00144 int m_channel;
00145
00146 QSMatrix( const QSMatrix& );
00147 void operator=(const QSMatrix& );
00148
00149 };
00150 #endif
00151
00152
00153
00154
00155
00156
00157
00158