class tsData2RNFloatFile : public tsData2RNFloat

Node storing a 2dim float signal beeing read in from a file

Inheritance:


Public Methods

SoINTERNAL static void initClass()
Makes this class known to the OpenInventor type system.
int readFile(const SbString file)
Reads in file content. Called from constructor.

Public

Action behaviour:
virtual void GLRender(SoGLRenderAction *action)
does GLrender begaviour, calls doAction()
virtual void getBoundingBox(SoGetBoundingBoxAction *action)
calls doAction()
virtual void callback(SoCallbackAction *action)
calls doAction()
virtual void pick(SoPickAction *action)
calls doAction()
New Fields
SoSFString filename
Field containing the filename of the file to be read in
enum Scaling
SoSFEnum dataScaling
Scaling of the data in field 'data'
SoSFEnum dim2Scaling
Scaling of the data in field 'dim2'

Protected Fields

SbBool _fileReadOrError
Flag to remember, if reading the file has been tried without success.

Protected Methods

float __dB(float value)
Does conversion GRID file's raw amplitude/pahe data to dB amplitude. Used by _readFileGrid().
float __frequency_log(float value)
Does conversion GRID file's raw frequency data to log frequency. Used by _readFileGrid().
int _readFileGrid(const SbString file)
returnes TRUE, if reading an GRID file was succesfull.
int _readFileMatlab(const SbString file)
returnes TRUE, if reading an audio file was succesfull. Not yet implemented!
static void dataChangedSensorCB(void *userData, SoSensor* sensor)
for debugging:
virtual ~tsData2RNFloatFile()
Destructor

Private Methods

SO_NODE_HEADER(tsData2RNFloatFile)

Inherited from tsData2RNFloat:

Public

Common data access methods:

virtual SoType getRealClassTypeId()
virtual int getNum()
returns number points sampled in time
virtual int getNumValues()
returns total number points sampled in all dimensions.
virtual float getTime(int index)
returns time when data a t<index> is sampled
virtual const float getTimeMin()
returns time of first sample point
virtual const float getTimeMax()
returns time of last sample point
virtual int getIndex(float time, int startIndex = 0)
returns index of a point in time. Starts search from startIndex (optional)
virtual const void* getValue(int index, int index2)
returnes a value as a pointer!
virtual void getValueMinMax( float& min, float& max)
virtual SbBool isRegularSampled()
returns TRUE because data is regular sampled.
virtual int getIndex2(float dim2Value, int startIndex = 0)
returns index in dim2 (???)
virtual int getNum2()
returnsnumber points sampled in dim2
virtual void getDim2MinMax( float& min, float& max)
returns Min/Max in dim2

Inherited from tsData2Base:

Public Methods

virtual SoType getRealClassTypeId()

Private Methods

SO_NODE_ABSTRACT_HEADER(tsData2Base)

Inherited from tsDataBase:

Public Fields

SoSFNode node

Documentation

Node storing a 2dim float signal beeing read in from a file. Time axis is sampled regularly. 2nd dimension is non-regular sampled, but the same for all points in time.If field <filename> is not empty file with filename taken from field <filename> is read in on construction time (better on first traversal! Future work). Otherwise it habits exactly like its parent class tsData1RFloat. Node's signal data in field <data> is NOT saved when scene graph is written to a file, until field is touched once. Field content is assumed to be the dafault value for this field. Touching this field, deletes his default status and makes it beeing written as a normal Inventor node.

The following file formats are detected:

Grid format format: Private hack to store spectral data of the wavelet analysis system from Daniel D.P.W. Ellis (filename postfix: ".grid"). See cqt3 and aqt2gridcompl for generating and converting this file format.

MATLAB: Matlab ASCII files representing a two-dimensional vector of values (converted to float). Reads data from first matrix in file. Field "Interval" is expected in trivial matrix named "Interval". Sample frequency is expected in trivial matrix named "SampleFreq". Default is 44.1 KHz.

Future work: SDIF: CNMAT's Sound Description Interchange Format. (filename postfix: ".sdif")

SO_NODE_HEADER(tsData2RNFloatFile)

New Fields

SoSFString filename
Field containing the filename of the file to be read in. Changes are not yet recognized. Reading is done only once! (future work!).

enum Scaling

SoSFEnum dataScaling
Scaling of the data in field 'data'. The available scales are:
NO_SCALING: no scaling. LOG, DB: logarithmic scaling following :flog10(value_f*value_f)

SoSFEnum dim2Scaling
Scaling of the data in field 'dim2'. available scales are: (See http: NO_SCALING: no scaling
LOG, PITCH: standard pitch scaling, following: flog10(dim2Value/127.09) / flog10(2). BARK: Bark Scale, dim2Value = 26.81 / (1 + 1960/dim2Value) - 0.53 ERB: Equivalent rectangular Bandwidth, dim2Value = 11.17 * flog((dim2Value + 312) / (dim2Value + 14675)) + 43.0

Action behaviour:

virtual void GLRender(SoGLRenderAction *action)
does GLrender begaviour, calls doAction()

virtual void getBoundingBox(SoGetBoundingBoxAction *action)
calls doAction()

virtual void callback(SoCallbackAction *action)
calls doAction()

virtual void pick(SoPickAction *action)
calls doAction()

SoINTERNAL static void initClass()
Makes this class known to the OpenInventor type system.

int readFile(const SbString file)
Reads in file content. Called from constructor.

int _readFileGrid(const SbString file)
returnes TRUE, if reading an GRID file was succesfull.

int _readFileMatlab(const SbString file)
returnes TRUE, if reading an audio file was succesfull. Not yet implemented!

float __frequency_log(float value)
Does conversion GRID file's raw frequency data to log frequency. Used by _readFileGrid().

float __dB(float value)
Does conversion GRID file's raw amplitude/pahe data to dB amplitude. Used by _readFileGrid().

SbBool _fileReadOrError
Flag to remember, if reading the file has been tried without success.

virtual ~tsData2RNFloatFile()
Destructor

static void dataChangedSensorCB(void *userData, SoSensor* sensor)
for debugging:


This class has no child classes.
Author:
(c) Andreas Lücke
Version:
0.0
See Also:
tsData1Base tsData2Base

alphabetic index hierarchy of classes


This page is part of the tsKit's reference manual by Andreas Lücke.
Back to tsKit-Home

generated by doc++