Inviwo  0.9.10.1
Inviwo documentation
inviwo::discretedata::DataSet Class Reference

Data package containing structure by cell connectivity and data Conglomerate of data grid and several data channels assigned to grid dimensions. More...

#include <dataset.h>

Public Member Functions

 DataSet (const std::shared_ptr< const Connectivity > grid)
 
 DataSet (GridPrimitive size, std::vector< ind > &numCellsPerDim)
 
 DataSet (const DataSet &copy)=default
 
template<typename G >
const std::shared_ptr< const G > getGrid () const
 
template<typename G >
std::shared_ptr< G > getGrid ()
 
std::shared_ptr< ChanneladdChannel (Channel *channel)
 
void addChannel (std::shared_ptr< const Channel > channel)
 
std::shared_ptr< const ChannelgetFirstChannel () const
 
template<typename T , ind N>
std::shared_ptr< const DataChannel< T, N > > getFirstChannel () const
 
std::shared_ptr< const ChannelgetChannel (const std::string &name, GridPrimitive definedOn=GridPrimitive::Vertex) const
 
std::shared_ptr< const ChannelgetChannel (std::pair< std::string, GridPrimitive > &key) const
 
template<typename T , ind N>
std::shared_ptr< const DataChannel< T, N > > getChannel (const std::string &name, GridPrimitive definedOn=GridPrimitive::Vertex) const
 
template<typename T , ind N>
std::shared_ptr< const BufferChannel< T, N > > getAsBuffer (const std::string &name, GridPrimitive definedOn=GridPrimitive::Vertex) const
 
bool removeChannel (std::shared_ptr< const Channel > channel)
 
ind getNumChannels () const
 
std::vector< std::pair< std::string, GridPrimitive > > getChannelNames () const
 
DataChannelMap::const_iterator cbegin () const
 
DataChannelMap::const_iterator cend () const
 

Public Attributes

const std::shared_ptr< const Connectivitygrid
 

Protected Attributes

DataChannelMap channels_
 

Detailed Description

Data package containing structure by cell connectivity and data Conglomerate of data grid and several data channels assigned to grid dimensions.

Author
Anke Friederici and Tino Weinkauf

Constructor & Destructor Documentation

◆ DataSet()

inviwo::discretedata::DataSet::DataSet ( const DataSet copy)
default

Default copy shares Channels and Connectivity

Member Function Documentation

◆ addChannel() [1/2]

std::shared_ptr< Channel > inviwo::discretedata::DataSet::addChannel ( Channel channel)

Add a new channel to the set

Parameters
channelPointer to data, takes memory ownership
Returns
Shared pointer for further handling

◆ addChannel() [2/2]

void inviwo::discretedata::DataSet::addChannel ( std::shared_ptr< const Channel channel)

Add a new channel to the set

Parameters
channelShared pointer to data, remains valid

◆ getAsBuffer()

template<typename T , ind N>
std::shared_ptr< const BufferChannel< T, N > > inviwo::discretedata::DataSet::getAsBuffer ( const std::string &  name,
GridPrimitive  definedOn = GridPrimitive::Vertex 
) const

Returns the specified buffer, converts to buffer or copies

Parameters
nameUnique name of requested buffer
definedOnGridPrimitive type the channel is defined on, default 0D vertices

◆ getChannel() [1/3]

std::shared_ptr< const Channel > inviwo::discretedata::DataSet::getChannel ( const std::string &  name,
GridPrimitive  definedOn = GridPrimitive::Vertex 
) const

Returns the specified channel, returns first instance found

Parameters
nameUnique name of requested channel
definedOnGridPrimitive type the channel is defined on, default 0D vertices

◆ getChannel() [2/3]

std::shared_ptr< const Channel > inviwo::discretedata::DataSet::getChannel ( std::pair< std::string, GridPrimitive > &  key) const

Returns the specified channel if it is in the desired format, returns first instance found

Parameters
keyUnique name and GridPrimitive type the channel is defined on

◆ getChannel() [3/3]

template<typename T , ind N>
std::shared_ptr< const DataChannel< T, N > > inviwo::discretedata::DataSet::getChannel ( const std::string &  name,
GridPrimitive  definedOn = GridPrimitive::Vertex 
) const

Returns the specified channel if it is in the desired format, returns first instance found

Parameters
nameUnique name of requested channel
definedOnGridPrimitive type the channel is defined on, default 0D vertices

◆ getFirstChannel() [1/2]

std::shared_ptr< const Channel > inviwo::discretedata::DataSet::getFirstChannel ( ) const

Returns the first channel from an unordered list.

◆ getFirstChannel() [2/2]

template<typename T , ind N>
std::shared_ptr< const DataChannel< T, N > > inviwo::discretedata::DataSet::getFirstChannel ( ) const

Returns the first channel from an unordered list.

◆ getGrid() [1/2]

template<typename G >
const std::shared_ptr<const G> inviwo::discretedata::DataSet::getGrid ( ) const
inline

Returns a const typed shared pointer to the grid, if casting is possible.

◆ getGrid() [2/2]

template<typename G >
std::shared_ptr<G> inviwo::discretedata::DataSet::getGrid ( )
inline

Returns a typed shared pointer to the grid, if casting is possible.

◆ getNumChannels()

ind inviwo::discretedata::DataSet::getNumChannels ( ) const
inline

Number of channels currently held

◆ removeChannel()

bool inviwo::discretedata::DataSet::removeChannel ( std::shared_ptr< const Channel channel)

Remove channel from set by shared pointer, data remains valid if shared outside Swaps position in vector

Parameters
channelShared pointer to data
Returns
Successful - channel was saved in the set indeed

Member Data Documentation

◆ channels_

DataChannelMap inviwo::discretedata::DataSet::channels_
protected

Set of data channels Indexed by name and defining dimension (0D vertices, 1D edges etc).

◆ grid

const std::shared_ptr<const Connectivity> inviwo::discretedata::DataSet::grid

Connectivity of grid Several grid types are possible (rectlinear, structured, unstructured)


The documentation for this class was generated from the following files: