Data Class Reference

Data storage for the density data read in from a file. More...

#include <Data.h>

Collaboration diagram for Data:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Data (const std::string &aFilename)
 Filename should not include the extension.
 ~Data ()
unsigned int xdim () const
 Size (Indices) in x dimension.
unsigned int ydim () const
 Size (Indices) in y dimension.
Vector< float > getData (unsigned int aX, unsigned int aY) const
 Gets the flow value for a specific data index.
int getDataCount ()
float getDataPiece (float aX, float aY, unsigned int aDataIndex) const
Vector< float > getFlow (float aX, float aY) const
unsigned int countDataPieces () const
 Number of available data pieces.
Vector< float > minPos () const
 Smallest coordinate value of the data.
Vector< float > maxPos () const
 Largest coordinate value of the data.
std::pair< float, float > getDataRange (unsigned int aDataIndex) const
 Gets the range of the data piece aDataIndex.

Private Types

typedef std::vector< std::pair<
float, float > > 
RangeType

Private Member Functions

DataPointgetDataPoint (unsigned int aX, unsigned int aY) const
float getDataPiece (unsigned int aX, unsigned int aY, unsigned int aDataIndex) const
 Gets the value of the data piece aDataIndex.
Vector< float > getPosition (unsigned int aX, unsigned int aY) const
 Gets the grid-Position.
Vector< float > getFlow (unsigned int aX, unsigned int aY) const
void newDataIndex (float aX, float aY) const
 Transforms world-coords in data-indizes.
 Data (const Data &other)
Dataoperator= (Data &other)

Private Attributes

DataPointmData
float * mXCellDiff
float * mYCellDiff
unsigned int mCurrentX
unsigned int mCurrentY
RangeType mDataRanges
unsigned int mX
unsigned int mY
unsigned int mDataCount

Detailed Description

Data storage for the density data read in from a file.


Member Typedef Documentation

typedef std::vector< std::pair<float, float> > Data::RangeType [private]
 


Constructor & Destructor Documentation

Data::Data const std::string &  aFilename  ) 
 

Filename should not include the extension.

E.g., pass "block" to open block.gri and block.00000.dat.

Data::~Data  ) 
 

Data::Data const Data other  )  [private]
 


Member Function Documentation

unsigned int Data::countDataPieces  )  const [inline]
 

Number of available data pieces.

They can be accessed using getDataPiece(); they lie in the range [0..countDataPieces()[

Vector<float> Data::getData unsigned int  aX,
unsigned int  aY
const [inline]
 

Gets the flow value for a specific data index.

Prefer getFlow() over this function, as that one handles world coordinates.

int Data::getDataCount  )  [inline]
 

Returns:
number of additional data pieces

float Data::getDataPiece unsigned int  aX,
unsigned int  aY,
unsigned int  aDataIndex
const [inline, private]
 

Gets the value of the data piece aDataIndex.

the position must be given in data-indizes.

float Data::getDataPiece float  aX,
float  aY,
unsigned int  aDataIndex
const [inline]
 

Returns:
returns the dataPiece[aDataIndex] of the given world-coord-position. bilinear interpolation is used.

DataPoint& Data::getDataPoint unsigned int  aX,
unsigned int  aY
const [inline, private]
 

std::pair<float, float> Data::getDataRange unsigned int  aDataIndex  )  const [inline]
 

Gets the range of the data piece aDataIndex.

The range is calculated from the read-in data.

Returns:
A pair, where .first is the minimum and .second the maximum

Vector<float> Data::getFlow unsigned int  aX,
unsigned int  aY
const [inline, private]
 

Vector<float> Data::getFlow float  aX,
float  aY
const [inline]
 

Returns:
returns the flow-vector of the given world-coord-position. bilinear interpolation is used.

Vector<float> Data::getPosition unsigned int  aX,
unsigned int  aY
const [inline, private]
 

Gets the grid-Position.

z-coord is set to 0 the position must be given in data-indizes.

Vector<float> Data::maxPos  )  const [inline]
 

Largest coordinate value of the data.

(World) coordinates lie in the range [minPos(), maxPos()].

Vector<float> Data::minPos  )  const [inline]
 

Smallest coordinate value of the data.

(World) coordinates lie in the range [minPos(), maxPos()].

void Data::newDataIndex float  aX,
float  aY
const [inline, private]
 

Transforms world-coords in data-indizes.

this function uses mLastPos and mLastIndex to optimize data-access z-coords aren't used.

Parameters:
aX,aY,: the upper left corner of the bounding rectangle. (the lower right corner is at (returnVec.x()+1, returnVec.y()+1, 0))

Data& Data::operator= Data other  )  [private]
 

unsigned int Data::xdim  )  const [inline]
 

Size (Indices) in x dimension.

unsigned int Data::ydim  )  const [inline]
 

Size (Indices) in y dimension.


Member Data Documentation

unsigned int Data::mCurrentX [mutable, private]
 

unsigned int Data::mCurrentY [mutable, private]
 

DataPoint* Data::mData [private]
 

unsigned int Data::mDataCount [private]
 

RangeType Data::mDataRanges [private]
 

unsigned int Data::mX [private]
 

float* Data::mXCellDiff [private]
 

unsigned int Data::mY [private]
 

float* Data::mYCellDiff [private]
 


The documentation for this class was generated from the following files:
Generated on Mon Jan 23 19:45:00 2006 for Visualization by  doxygen 1.4.6