00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _SIGNALTYPES_MATRIX_H
00011 #define _SIGNALTYPES_MATRIX_H
00012
00013 #ifdef __GEDDEI_BUILD
00014 #include "signaltype.h"
00015 #else
00016 #include <geddei/signaltype.h>
00017 #endif
00018 using namespace Geddei;
00019
00020 namespace SignalTypes
00021 {
00022
00027 class Matrix: public SignalType
00028 {
00029 virtual void serialise(QSocketSession &sink) const;
00030 virtual void deserialise(QSocketSession &source);
00031 virtual const uint id() const { return 3; }
00032 virtual SignalType *copyBE() const { return new Matrix(theWidth, theHeight, theFrequency); }
00033 virtual const bool sameAsBE(const SignalType *cmp) const;
00034
00035 protected:
00036 uint theWidth;
00037 uint theHeight;
00038 float thePitchWidth;
00039 float thePitchHeight;
00040
00041 public:
00047 const uint width() const { return theWidth; }
00048
00054 const uint height() const { return theHeight; }
00055
00061 const float pitchWidth() const { return thePitchWidth; }
00062
00069 const float pitchHeight() const { return thePitchHeight; }
00070
00085 Matrix(const uint width = 1, const uint height = 1, const float frequency = 0, const float pitchWidth = 0, const float pitchHeight = 0) : SignalType(width * height, frequency), theWidth(width), theHeight(height), thePitchWidth(pitchWidth), thePitchHeight(pitchHeight) {}
00086 };
00087
00096 class SquareMatrix: public Matrix
00097 {
00098 virtual const uint id() const { return 4; }
00099 virtual SignalType *copyBE() const { return new SquareMatrix(theWidth, theFrequency); }
00100
00101 public:
00109 const uint size() const { return theWidth; }
00110
00117 const float pitch() const { return thePitchWidth; }
00118
00129 SquareMatrix(const uint size = 1, const float frequency = 0., const float pitch = 0.) : Matrix(size, size, frequency, pitch, pitch) {}
00130 };
00131
00132 };
00133
00134 #endif