Public Types | Public Member Functions | Protected Attributes

mitk::GenericLookupTable< T > Class Template Reference

Template class for generating lookup-tables. More...

#include <mitkGenericLookupTable.h>

Inheritance diagram for mitk::GenericLookupTable< T >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef unsigned int IdentifierType
typedef T ValueType
typedef std::map
< IdentifierType, ValueType
LookupTableType
typedef GenericLookupTable Self

Public Member Functions

 GenericLookupTable ()
virtual ~GenericLookupTable ()
virtual const char * GetNameOfClass () const
void SetTableValue (IdentifierType id, ValueType value)
bool ValueExists (IdentifierType id) const
ValueType GetTableValue (IdentifierType id) const
const LookupTableTypeGetLookupTable () const
bool operator== (const Self &lookupTable) const
bool operator!= (const Self &lookupTable) const
virtual Selfoperator= (const Self &other)

Protected Attributes

LookupTableType m_LookupTable

Detailed Description

template<typename T>
class mitk::GenericLookupTable< T >

Template class for generating lookup-tables.

This class template can be instantiated for all classes/internal types that fulfills these requirements:

The main purpose of this class is to be used in conjunction with GenericLookupTableProperty. This enables passing of arbitrary lookup tables to mappers to configure the rendering process.

Definition at line 48 of file mitkGenericLookupTable.h.


Member Typedef Documentation

template<typename T>
typedef unsigned int mitk::GenericLookupTable< T >::IdentifierType

Definition at line 51 of file mitkGenericLookupTable.h.

template<typename T>
typedef std::map< IdentifierType, ValueType > mitk::GenericLookupTable< T >::LookupTableType

Definition at line 53 of file mitkGenericLookupTable.h.

template<typename T>
typedef GenericLookupTable mitk::GenericLookupTable< T >::Self
template<typename T>
typedef T mitk::GenericLookupTable< T >::ValueType

Definition at line 52 of file mitkGenericLookupTable.h.


Constructor & Destructor Documentation

template<typename T>
mitk::GenericLookupTable< T >::GenericLookupTable (  ) [inline]

Definition at line 57 of file mitkGenericLookupTable.h.

{}
template<typename T>
virtual mitk::GenericLookupTable< T >::~GenericLookupTable (  ) [inline, virtual]

Definition at line 58 of file mitkGenericLookupTable.h.

    {
    }

Member Function Documentation

template<typename T>
const LookupTableType& mitk::GenericLookupTable< T >::GetLookupTable (  ) const [inline]
template<typename T>
virtual const char* mitk::GenericLookupTable< T >::GetNameOfClass (  ) const [inline, virtual]

Reimplemented in mitk::BoolLookupTable, mitk::FloatLookupTable, mitk::IntLookupTable, and mitk::StringLookupTable.

Definition at line 62 of file mitkGenericLookupTable.h.

    {
      return "GenericLookupTable";
    } 
template<typename T>
ValueType mitk::GenericLookupTable< T >::GetTableValue ( IdentifierType  id ) const [inline]

Definition at line 78 of file mitkGenericLookupTable.h.

Referenced by mitk::EnhancedPointSetVtkMapper3D::ApplyProperties(), and mitkPropertyListTest().

    {
      typename LookupTableType::const_iterator it = m_LookupTable.find(id);
      if (it != m_LookupTable.end())
        return it->second;
      else
        throw std::range_error("id does not exist in the lookup table");
    }
template<typename T>
bool mitk::GenericLookupTable< T >::operator!= ( const Self lookupTable ) const [inline]

Definition at line 96 of file mitkGenericLookupTable.h.

    {
      return !(m_LookupTable == lookupTable.m_LookupTable);
    }
template<typename T>
virtual Self& mitk::GenericLookupTable< T >::operator= ( const Self other ) [inline, virtual]

Definition at line 101 of file mitkGenericLookupTable.h.

                                                        : this needs to be unit tested!
    {
      if ( this == &other )
      {
        return *this;
      }
      else
      {
        m_LookupTable.clear();
        m_LookupTable = other.m_LookupTable;
        return *this;
      }
    }
template<typename T>
bool mitk::GenericLookupTable< T >::operator== ( const Self lookupTable ) const [inline]

Definition at line 92 of file mitkGenericLookupTable.h.

    {
      return (m_LookupTable == lookupTable.m_LookupTable);
    }
template<typename T>
void mitk::GenericLookupTable< T >::SetTableValue ( IdentifierType  id,
ValueType  value 
) [inline]
template<typename T>
bool mitk::GenericLookupTable< T >::ValueExists ( IdentifierType  id ) const [inline]

Definition at line 72 of file mitkGenericLookupTable.h.

    {
      typename LookupTableType::const_iterator it = m_LookupTable.find(id);
      return (it != m_LookupTable.end());
    }

Member Data Documentation

template<typename T>
LookupTableType mitk::GenericLookupTable< T >::m_LookupTable [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines