Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::Material Class Reference

#include <mitkMaterial.h>

Inheritance diagram for mitk::Material:
Collaboration diagram for mitk::Material:

Public Types

enum  InterpolationType { Flat, Gouraud, Phong }
 
enum  RepresentationType { Points, Wireframe, Surface }
 
typedef Material Self
 
typedef itk::Object Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef itk::RGBPixel< double > Color
 

Public Member Functions

virtual std::vector< std::string > GetClassHierarchy () const
 
virtual const char * GetClassName () const
 
virtual bool Assignable (const Material &other) const
 
virtual Materialoperator= (const Material &other)
 
virtual void SetColor (Color color)
 
virtual void SetColor (double red, double green, double blue)
 
virtual void SetColorCoefficient (double coefficient)
 
virtual void SetSpecularColor (Color color)
 
virtual void SetSpecularColor (double red, double green, double blue)
 
virtual void SetSpecularCoefficient (double specularCoefficient)
 
virtual void SetSpecularPower (double specularPower)
 
virtual void SetOpacity (double opacity)
 
virtual void SetInterpolation (InterpolationType interpolation)
 
virtual void SetRepresentation (RepresentationType representation)
 
virtual void SetLineWidth (float lineWidth)
 
virtual Color GetColor () const
 
virtual double GetColorCoefficient () const
 
virtual Color GetSpecularColor () const
 
virtual double GetSpecularCoefficient () const
 
virtual double GetSpecularPower () const
 
virtual double GetOpacity () const
 
virtual InterpolationType GetInterpolation () const
 
virtual RepresentationType GetRepresentation () const
 
virtual int GetVtkInterpolation () const
 
virtual int GetVtkRepresentation () const
 
virtual float GetLineWidth () const
 
virtual void Initialize (const Material &property)
 
virtual bool operator== (const Material &property) const
 
void PrintSelf (std::ostream &os, itk::Indent) const override
 
virtual void SetName (std::string _arg)
 
virtual std::string GetName () const
 

Static Public Member Functions

static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 
static Pointer New (Color color, double opacity=1.0f)
 
static Pointer New (double red, double green, double blue, double opacity=1.0f)
 
static Pointer New (double red, double green, double blue, double colorCoefficient, double specularCoefficient, double specularPower, double opacity)
 
static Pointer New (Color color, double colorCoefficient, double specularCoefficient, double specularPower, double opacity)
 
static Pointer New (const Material &_arg)
 
static Pointer New (const Material &property, double red, double green, double blue, double opacity=1.0, std::string name="")
 

Protected Member Functions

 Material ()
 
 Material (Color color, double opacity=1.0f)
 
 Material (double red, double green, double blue, double opacity=1.0f)
 
 Material (double red, double green, double blue, double colorCoefficient, double specularCoefficient, double specularPower, double opacity)
 
 Material (Color color, double colorCoefficient, double specularCoefficient, double specularPower, double opacity)
 
 Material (const Material &property)
 
 Material (const Material &property, double red, double green, double blue, double opacity=1.0, std::string name="")
 
virtual void InitializeStandardValues ()
 
virtual void Update ()
 

Protected Attributes

std::string m_Name
 
Color m_Color
 
Color m_SpecularColor
 
double m_ColorCoefficient
 
double m_SpecularCoefficient
 
double m_SpecularPower
 
double m_Opacity
 
float m_LineWidth
 
InterpolationType m_Interpolation
 
RepresentationType m_Representation
 

Detailed Description

Encapsulates 3D visualization properties which are forwarded to vtk for color mapping. This includes color, specular coefficient and power, opacity interpolation type (flat, gouraud, phong) and representation (points, wireframe or surface).

See also
vtkProperty

Definition at line 38 of file mitkMaterial.h.

Member Typedef Documentation

typedef itk::RGBPixel<double> mitk::Material::Color

Definition at line 41 of file mitkMaterial.h.

Definition at line 41 of file mitkMaterial.h.

Definition at line 41 of file mitkMaterial.h.

Definition at line 41 of file mitkMaterial.h.

typedef itk::Object mitk::Material::Superclass

Definition at line 41 of file mitkMaterial.h.

Member Enumeration Documentation

Enumerator
Flat 
Gouraud 
Phong 

Definition at line 45 of file mitkMaterial.h.

Enumerator
Points 
Wireframe 
Surface 

Definition at line 52 of file mitkMaterial.h.

Constructor & Destructor Documentation

mitk::Material::Material ( )
protected

Constructor. Materials are set to the following default values: Color (0.5, 0.5, 0.5) color coefficient 1.0, specular color (1.0, 1.0, 1.0), specular coefficient 1.0, specular power 10, opacity 1.0, interpolation Gouraud, representation Surface.

Parameters
nodeoptinally a data tree node may be defined to which the properties are forwarded. Please note, that if this node doesn't have the needed properties associated, they will be added.

Definition at line 94 of file mitkMaterial.cpp.

mitk::Material::Material ( Color  color,
double  opacity = 1.0f 
)
protected

Constructor. All values besides the given ones are set to defaults as described in the default constructor

Parameters
colorthe material color in RGB. Each RGB value should be in the range [0..1]
opacitythe opacity of the material. 0.0 means fully transparent and 1.0 means solid.
nodeoptinally a data tree node may be defined to which the properties are forwarded. Please note, that if this node doesn't have the needed properties associated, they will be added.

Definition at line 25 of file mitkMaterial.cpp.

References GetColorCoefficient(), GetInterpolation(), GetLineWidth(), GetRepresentation(), GetSpecularCoefficient(), GetSpecularColor(), GetSpecularPower(), InitializeStandardValues(), m_Name, SetColor(), SetColorCoefficient(), SetInterpolation(), SetLineWidth(), SetOpacity(), SetRepresentation(), SetSpecularCoefficient(), SetSpecularColor(), and SetSpecularPower().

mitk::Material::Material ( double  red,
double  green,
double  blue,
double  opacity = 1.0f 
)
protected

Constructor. All values besides the given ones are set to defaults as described in the default constructor

Parameters
redthe red component of the materials color (range [0..1])
greenthe green component of the materials color (range [0..1])
bluethe blue component of the materials color (range [0..1])
opacitythe opacity of the material. 0.0 means fully transparent and 1.0 means solid.
nodeoptionally a data tree node may be defined to which the properties are forwarded. Please note, that if this node doesn't have the needed properties associated, they will be added.

Definition at line 40 of file mitkMaterial.cpp.

mitk::Material::Material ( double  red,
double  green,
double  blue,
double  colorCoefficient,
double  specularCoefficient,
double  specularPower,
double  opacity 
)
protected

Constructor. All values besides the given ones are set to defaults as described in the default constructor

Parameters
redthe red component of the materials color (range [0..1])
greenthe green component of the materials color (range [0..1])
bluethe blue component of the materials color (range [0..1])
colorCoefficienta scaling factor for the color coefficient which will be multiplied with each color component (range [0..1]).
specularCoefficientcontrols in combination with the specular power how shiny the material will appear (range [0..1]).
specularPowercontrols in combination with the specular coefficient how shiny the material will appear (range [0..inf]).
opacitythe opacity of the material. 0.0 means fully transparent and 1.0 means solid.
nodeoptionally a data tree node may be defined to which the properties are forwarded. Please note, that if this node doesn't have the needed properties associated, they will be added.

Definition at line 55 of file mitkMaterial.cpp.

mitk::Material::Material ( Color  color,
double  colorCoefficient,
double  specularCoefficient,
double  specularPower,
double  opacity 
)
protected

Constructor. All values besides the given ones are set to defaults as described in the default constructor

Parameters
colorthe material color in RGB. Each RGB value should be in the range [0..1]
colorCoefficienta scaling factor for the color coefficient which will be multiplied with each color component (range [0..1]).
specularCoefficientcontrols in combination with the specular power how shiny the material will appear (range [0..1]).
specularPowercontrols in combination with the specular coefficient how shiny the material will appear (range [0..inf]).
opacitythe opacity of the material. 0.0 means fully transparent and 1.0 means solid.
nodeoptionally a data tree node may be defined to which the properties are forwarded. Please note, that if this node doesn't have the needed properties associated, they will be added.

Definition at line 76 of file mitkMaterial.cpp.

mitk::Material::Material ( const Material property)
protected

Copy constructor

Definition at line 108 of file mitkMaterial.cpp.

References Initialize().

mitk::Material::Material ( const Material property,
double  red,
double  green,
double  blue,
double  opacity = 1.0,
std::string  name = "" 
)
protected

Copy constructor, provided for convinience. The values are copied from property and afterwards the values provided for red green blue and opacity are written into the object.

Definition at line 113 of file mitkMaterial.cpp.

Member Function Documentation

bool mitk::Material::Assignable ( const Material other) const
virtual

Definition at line 122 of file mitkMaterial.cpp.

References GetOpacity().

virtual std::vector<std::string> mitk::Material::GetClassHierarchy ( ) const
inlinevirtual

Definition at line 41 of file mitkMaterial.h.

virtual const char* mitk::Material::GetClassName ( ) const
virtual
mitk::Material::Color mitk::Material::GetColor ( ) const
virtual
Returns
the color of the material

Definition at line 219 of file mitkMaterial.cpp.

Referenced by Initialize(), and operator==().

double mitk::Material::GetColorCoefficient ( ) const
virtual
Returns
the color coefficient of the material. Range is [0..1]

Definition at line 224 of file mitkMaterial.cpp.

Referenced by Initialize(), Material(), and operator==().

mitk::Material::InterpolationType mitk::Material::GetInterpolation ( ) const
virtual
Returns
the interpolation method used for rendering.

Definition at line 249 of file mitkMaterial.cpp.

Referenced by Initialize(), Material(), and operator==().

float mitk::Material::GetLineWidth ( ) const
virtual
Returns
the line width used for wireframe rendering as a fraction of screen units

Definition at line 287 of file mitkMaterial.cpp.

Referenced by Initialize(), Material(), and operator==().

virtual std::string mitk::Material::GetName ( ) const
virtual

returns the name associated with the material property

Referenced by Initialize(), and operator==().

double mitk::Material::GetOpacity ( ) const
virtual
Returns
the opacity of the material. Ranges from 0 to 1

Definition at line 244 of file mitkMaterial.cpp.

Referenced by Assignable(), Initialize(), and operator==().

mitk::Material::RepresentationType mitk::Material::GetRepresentation ( ) const
virtual
Returns
the representation type used for rendering.

Definition at line 254 of file mitkMaterial.cpp.

Referenced by Initialize(), Material(), and operator==().

double mitk::Material::GetSpecularCoefficient ( ) const
virtual
Returns
the specular coefficient used for rendering. Range is [0..1]

Definition at line 234 of file mitkMaterial.cpp.

Referenced by Initialize(), Material(), and operator==().

mitk::Material::Color mitk::Material::GetSpecularColor ( ) const
virtual
Returns
the specular color of the material in rgb values, which range from 0 .. 1

Definition at line 229 of file mitkMaterial.cpp.

Referenced by Initialize(), Material(), and operator==().

double mitk::Material::GetSpecularPower ( ) const
virtual
Returns
the specular power. Ranges from 0 to infinity

Definition at line 239 of file mitkMaterial.cpp.

Referenced by Initialize(), Material(), and operator==().

static const char* mitk::Material::GetStaticNameOfClass ( )
inlinestatic

Definition at line 41 of file mitkMaterial.h.

int mitk::Material::GetVtkInterpolation ( ) const
virtual
Returns
the interpolation method used for rendering using the predefined vtk constants.

Definition at line 259 of file mitkMaterial.cpp.

int mitk::Material::GetVtkRepresentation ( ) const
virtual
Returns
the representation type used for rendering using the predefined vtk constants.

Definition at line 273 of file mitkMaterial.cpp.

void mitk::Material::Initialize ( const Material property)
virtual

Fills the current materials with the properties of the given material.

Parameters
propertythe materials which should be copied in the current materials

Definition at line 292 of file mitkMaterial.cpp.

References GetColor(), GetColorCoefficient(), GetInterpolation(), GetLineWidth(), GetName(), GetOpacity(), GetRepresentation(), GetSpecularCoefficient(), GetSpecularColor(), and GetSpecularPower().

Referenced by Material().

void mitk::Material::InitializeStandardValues ( )
protectedvirtual

Definition at line 320 of file mitkMaterial.cpp.

Referenced by Material().

static Pointer mitk::Material::New ( void  )
inlinestatic

Constructor. Materials are set to the following default values: Color (0.5, 0.5, 0.5) color coefficient 1.0, specular color (1.0, 1.0, 1.0), specular coefficient 1.0, specular power 10, opacity 1.0, interpolation Gouraud, representation Surface.

Parameters
nodeoptinally a data tree node may be defined to which the properties are forwarded. Please note, that if this node doesn't have the needed properties associated, they will be added.

Definition at line 68 of file mitkMaterial.h.

static Pointer mitk::Material::New ( Color  color,
double  opacity = 1.0f 
)
inlinestatic

Constructor. All values besides the given ones are set to defaults as described in the default constructor

Parameters
colorthe material color in RGB. Each RGB value should be in the range [0..1]
opacitythe opacity of the material. 0.0 means fully transparent and 1.0 means solid.
nodeoptinally a data tree node may be defined to which the properties are forwarded. Please note, that if this node doesn't have the needed properties associated, they will be added.

Definition at line 86 of file mitkMaterial.h.

static Pointer mitk::Material::New ( double  red,
double  green,
double  blue,
double  opacity = 1.0f 
)
inlinestatic

Constructor. All values besides the given ones are set to defaults as described in the default constructor

Parameters
redthe red component of the materials color (range [0..1])
greenthe green component of the materials color (range [0..1])
bluethe blue component of the materials color (range [0..1])
opacitythe opacity of the material. 0.0 means fully transparent and 1.0 means solid.
nodeoptionally a data tree node may be defined to which the properties are forwarded. Please note, that if this node doesn't have the needed properties associated, they will be added.

Definition at line 105 of file mitkMaterial.h.

static Pointer mitk::Material::New ( double  red,
double  green,
double  blue,
double  colorCoefficient,
double  specularCoefficient,
double  specularPower,
double  opacity 
)
inlinestatic

Constructor. All values besides the given ones are set to defaults as described in the default constructor

Parameters
redthe red component of the materials color (range [0..1])
greenthe green component of the materials color (range [0..1])
bluethe blue component of the materials color (range [0..1])
colorCoefficienta scaling factor for the color coefficient which will be multiplied with each color component (range [0..1]).
specularCoefficientcontrols in combination with the specular power how shiny the material will appear (range [0..1]).
specularPowercontrols in combination with the specular coefficient how shiny the material will appear (range [0..inf]).
opacitythe opacity of the material. 0.0 means fully transparent and 1.0 means solid.
nodeoptionally a data tree node may be defined to which the properties are forwarded. Please note, that if this node doesn't have the needed properties associated, they will be added.

Definition at line 130 of file mitkMaterial.h.

static Pointer mitk::Material::New ( Color  color,
double  colorCoefficient,
double  specularCoefficient,
double  specularPower,
double  opacity 
)
inlinestatic

Constructor. All values besides the given ones are set to defaults as described in the default constructor

Parameters
colorthe material color in RGB. Each RGB value should be in the range [0..1]
colorCoefficienta scaling factor for the color coefficient which will be multiplied with each color component (range [0..1]).
specularCoefficientcontrols in combination with the specular power how shiny the material will appear (range [0..1]).
specularPowercontrols in combination with the specular coefficient how shiny the material will appear (range [0..inf]).
opacitythe opacity of the material. 0.0 means fully transparent and 1.0 means solid.
nodeoptionally a data tree node may be defined to which the properties are forwarded. Please note, that if this node doesn't have the needed properties associated, they will be added.

Definition at line 161 of file mitkMaterial.h.

static Pointer mitk::Material::New ( const Material _arg)
inlinestatic

Copy constructor

Definition at line 172 of file mitkMaterial.h.

static Pointer mitk::Material::New ( const Material property,
double  red,
double  green,
double  blue,
double  opacity = 1.0,
std::string  name = "" 
)
inlinestatic

Copy constructor, provided for convinience. The values are copied from property and afterwards the values provided for red green blue and opacity are written into the object.

Definition at line 178 of file mitkMaterial.h.

mitk::Material & mitk::Material::operator= ( const Material other)
virtual

Definition at line 137 of file mitkMaterial.cpp.

bool mitk::Material::operator== ( const Material property) const
virtual

comparison operator which uses the member variables for comparison

Definition at line 306 of file mitkMaterial.cpp.

References GetColor(), GetColorCoefficient(), GetInterpolation(), GetLineWidth(), GetName(), GetOpacity(), GetRepresentation(), GetSpecularCoefficient(), GetSpecularColor(), and GetSpecularPower().

void mitk::Material::PrintSelf ( std::ostream &  os,
itk::Indent   
) const
override

Dumps the properties to the out stream out

Definition at line 346 of file mitkMaterial.cpp.

References GetName().

void mitk::Material::SetColor ( Color  color)
virtual

Definition at line 153 of file mitkMaterial.cpp.

Referenced by Material().

void mitk::Material::SetColor ( double  red,
double  green,
double  blue 
)
virtual

Sets the materials color in RGB space. The rgb components have to be in the range [0..1]

Parameters
redthe red component of the materials color (range [0..1])
greenthe green component of the materials color (range [0..1])
bluethe blue component of the materials color (range [0..1])

Definition at line 159 of file mitkMaterial.cpp.

void mitk::Material::SetColorCoefficient ( double  coefficient)
virtual

Sets a attenuation coefficient for the color. A value of 0 results in a black object. VAlid range is [0..1]

Parameters
coefficientthe color attenuation coefficient

Definition at line 165 of file mitkMaterial.cpp.

Referenced by Material().

void mitk::Material::SetInterpolation ( InterpolationType  interpolation)
virtual

Sets the surface interpolation method of the object rendered using the given materials. Valid Interopation types are Flat, Gouraud and Phong. See any computer graphics book for their meaning

Parameters
interpolationthe interpolation method used for rendering of surfaces.

Definition at line 201 of file mitkMaterial.cpp.

Referenced by Material().

void mitk::Material::SetLineWidth ( float  lineWidth)
virtual

Set/Get the width of a Line. The width is expressed in screen units. The default is 1.0.

Definition at line 213 of file mitkMaterial.cpp.

Referenced by Material().

virtual void mitk::Material::SetName ( std::string  _arg)
virtual

Sets an optional name which may be associated with the material property Please note, that this name is NOT forwarded to the data tree node as the node name

void mitk::Material::SetOpacity ( double  opacity)
virtual

Sets the opacity of the material, which controls how transparent the object appears. Valid range is [0..1], where 0 means fully transparent and 1 means a solid surface.

Parameters
opacitythe new opacity of the material

Definition at line 195 of file mitkMaterial.cpp.

Referenced by Material().

void mitk::Material::SetRepresentation ( RepresentationType  representation)
virtual

Sets the surface representation method of the object rendered using the given materials. Valid Interopation types are Points, Wireframe and Surface.

Parameters
representationthe representation method used for rendering of surfaces.

Definition at line 207 of file mitkMaterial.cpp.

Referenced by Material().

void mitk::Material::SetSpecularCoefficient ( double  specularCoefficient)
virtual

Sets the specular coefficient which controls the shininess of the object together with the specular power

Parameters
specularCoefficientthe new specular coefficient. Valid range is [0..1]

Definition at line 183 of file mitkMaterial.cpp.

Referenced by Material().

void mitk::Material::SetSpecularColor ( Color  color)
virtual

Sets the specular color

Parameters
colorthe specular color in RGB. Each RGB value should be in the range [0..1]

Definition at line 171 of file mitkMaterial.cpp.

Referenced by Material().

void mitk::Material::SetSpecularColor ( double  red,
double  green,
double  blue 
)
virtual

Sets the specular color

Parameters
redthe red component of the specular color (range [0..1])
greenthe green component of the specular color (range [0..1])
bluethe blue component of the specular color (range [0..1])

Definition at line 177 of file mitkMaterial.cpp.

void mitk::Material::SetSpecularPower ( double  specularPower)
virtual

Sets the specular power which controls the shininess of the object together with the specular coefficient

Parameters
specularCoefficientthe new specular coefficient. Valid range is [0..inf]

Definition at line 189 of file mitkMaterial.cpp.

Referenced by Material().

void mitk::Material::Update ( )
protectedvirtual

Definition at line 334 of file mitkMaterial.cpp.

Member Data Documentation

Color mitk::Material::m_Color
protected

Definition at line 465 of file mitkMaterial.h.

double mitk::Material::m_ColorCoefficient
protected

Definition at line 469 of file mitkMaterial.h.

InterpolationType mitk::Material::m_Interpolation
protected

Definition at line 479 of file mitkMaterial.h.

float mitk::Material::m_LineWidth
protected

Definition at line 477 of file mitkMaterial.h.

std::string mitk::Material::m_Name
protected

Definition at line 463 of file mitkMaterial.h.

Referenced by Material().

double mitk::Material::m_Opacity
protected

Definition at line 475 of file mitkMaterial.h.

RepresentationType mitk::Material::m_Representation
protected

Definition at line 481 of file mitkMaterial.h.

double mitk::Material::m_SpecularCoefficient
protected

Definition at line 471 of file mitkMaterial.h.

Color mitk::Material::m_SpecularColor
protected

Definition at line 467 of file mitkMaterial.h.

double mitk::Material::m_SpecularPower
protected

Definition at line 473 of file mitkMaterial.h.


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