Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

mitk::ShaderProperty Class Reference

#include <mitkShaderProperty.h>

Inheritance diagram for mitk::ShaderProperty:
Inheritance graph
[legend]
Collaboration diagram for mitk::ShaderProperty:
Collaboration graph
[legend]

List of all members.

Classes

class  Element

Public Types

typedef ShaderProperty Self
typedef EnumerationProperty Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer

Public Member Functions

virtual const char * GetClassName () const
IdType GetShaderId ()
std::string GetShaderName ()
void SetShader (const IdType &i)
void SetShader (const std::string &i)

Static Public Member Functions

static Pointer New ()
static Pointer New (const IdType &_arg)
static Pointer New (const std::string &_arg)

Protected Member Functions

 ShaderProperty ()
 ShaderProperty (const IdType &value)
 Sets the scalar mode to the given value. If it is not valid, the scalar mode is set to default (0).
 ShaderProperty (const std::string &value)
 Sets the scalar mode to the given value. If it is not valid, the representation is set to default (0).
bool AddEnum (const std::string &name)
void AddShaderTypes ()

Protected Attributes

std::list< ElementshaderList

Detailed Description

Encapsulates the shader enumeration

Definition at line 29 of file mitkShaderProperty.h.


Member Typedef Documentation

typedef itk::SmartPointer<const Self> mitk::ShaderProperty::ConstPointer

Reimplemented from mitk::EnumerationProperty.

Definition at line 38 of file mitkShaderProperty.h.

typedef itk::SmartPointer<Self> mitk::ShaderProperty::Pointer

Reimplemented from mitk::EnumerationProperty.

Definition at line 38 of file mitkShaderProperty.h.

Reimplemented from mitk::EnumerationProperty.

Definition at line 38 of file mitkShaderProperty.h.

Reimplemented from mitk::EnumerationProperty.

Definition at line 38 of file mitkShaderProperty.h.


Constructor & Destructor Documentation

mitk::ShaderProperty::ShaderProperty (  ) [protected]

Constructor. Sets the representation to a default value of surface(2)

Definition at line 25 of file mitkShaderProperty.cpp.

References AddShaderTypes(), and SetShader().

mitk::ShaderProperty::ShaderProperty ( const IdType value ) [protected]

Sets the scalar mode to the given value. If it is not valid, the scalar mode is set to default (0).

Parameters:
valuethe integer representation of the scalar mode

Definition at line 31 of file mitkShaderProperty.cpp.

{
  AddShaderTypes();
  SetShader(value);
}
mitk::ShaderProperty::ShaderProperty ( const std::string &  value ) [protected]

Sets the scalar mode to the given value. If it is not valid, the representation is set to default (0).

Parameters:
valuethe string representation of the scalar mode

Definition at line 37 of file mitkShaderProperty.cpp.

{
  AddShaderTypes();
  SetShader(value);
}

Member Function Documentation

bool mitk::ShaderProperty::AddEnum ( const std::string &  name ) [protected]

this function is overridden as protected, so that the user may not add additional invalid scalar mode types.

Definition at line 87 of file mitkShaderProperty.cpp.

References mitk::ShaderProperty::Element::name.

{
  Element e;
  
  e.name=name;
  
  bool success=Superclass::AddEnum( e.name, (IdType)shaderList.size() );  
  
  shaderList.push_back(e);
  
  return success;
}
void mitk::ShaderProperty::AddShaderTypes (  ) [protected]

Adds the enumeration types as defined by vtk to the list of known enumeration values.

Definition at line 71 of file mitkShaderProperty.cpp.

References mitk::ShaderRepository::GetGlobalShaderRepository(), and mitk::ShaderRepository::GetShaders().

Referenced by ShaderProperty().

{  
  AddEnum( "fixed" );
  
  std::list<mitk::ShaderRepository::Shader::Pointer> *l
    = mitk::ShaderRepository::GetGlobalShaderRepository()->GetShaders();
    
  std::list<mitk::ShaderRepository::Shader::Pointer>::const_iterator i = l->begin();
  
  while( i != l->end() )
  {
    AddEnum( (*i)->name );
    i++;
  }
}
virtual const char* mitk::ShaderProperty::GetClassName (  ) const [virtual]

Reimplemented from mitk::EnumerationProperty.

mitk::EnumerationProperty::IdType mitk::ShaderProperty::GetShaderId (  )

Returns the current scalar mode value as defined by VTK constants.

Returns:
the current scalar mode as VTK constant.

Definition at line 60 of file mitkShaderProperty.cpp.

{
  return GetValueAsId();
}
std::string mitk::ShaderProperty::GetShaderName (  )

Definition at line 65 of file mitkShaderProperty.cpp.

{
  return GetValueAsString();
}
static Pointer mitk::ShaderProperty::New ( const std::string &  _arg ) [inline, static]

Definition at line 44 of file mitkShaderProperty.h.

static Pointer mitk::ShaderProperty::New (  ) [static]
static Pointer mitk::ShaderProperty::New ( const IdType _arg ) [inline, static]

Definition at line 42 of file mitkShaderProperty.h.

void mitk::ShaderProperty::SetShader ( const std::string &  i )

Definition at line 52 of file mitkShaderProperty.cpp.

{
  if ( IsValidEnumerationValue( value ) )
    SetValue( value );
  else
    SetValue( (IdType)0 );
}
void mitk::ShaderProperty::SetShader ( const IdType i )

Definition at line 44 of file mitkShaderProperty.cpp.

Referenced by ShaderProperty().

{
  if ( IsValidEnumerationValue( value ) )
    SetValue( value );
  else
    SetValue( (IdType)0 );
}

Member Data Documentation

std::list<Element> mitk::ShaderProperty::shaderList [protected]

Definition at line 57 of file mitkShaderProperty.h.


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