Medical Imaging Interaction Toolkit  2023.12.00
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 34 of file mitkMaterial.h.

Member Typedef Documentation

◆ Color

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

Definition at line 37 of file mitkMaterial.h.

◆ ConstPointer

Definition at line 37 of file mitkMaterial.h.

◆ Pointer

Definition at line 37 of file mitkMaterial.h.

◆ Self

Definition at line 37 of file mitkMaterial.h.

◆ Superclass

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

Definition at line 37 of file mitkMaterial.h.

Member Enumeration Documentation

◆ InterpolationType

Enumerator
Flat 
Gouraud 
Phong 

Definition at line 41 of file mitkMaterial.h.

◆ RepresentationType

Enumerator
Points 
Wireframe 
Surface 

Definition at line 48 of file mitkMaterial.h.

Constructor & Destructor Documentation

◆ Material() [1/7]

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.

◆ Material() [2/7]

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.

◆ Material() [3/7]

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.

◆ Material() [4/7]

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.

◆ Material() [5/7]

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.

◆ Material() [6/7]

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

Copy constructor

◆ Material() [7/7]

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

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

Member Function Documentation

◆ Assignable()

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

◆ GetClassHierarchy()

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

Definition at line 37 of file mitkMaterial.h.

◆ GetClassName()

virtual const char* mitk::Material::GetClassName ( ) const
virtual

◆ GetColor()

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

◆ GetColorCoefficient()

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

◆ GetInterpolation()

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

◆ GetLineWidth()

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

◆ GetName()

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

returns the name associated with the material property

◆ GetOpacity()

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

◆ GetRepresentation()

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

◆ GetSpecularCoefficient()

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

◆ GetSpecularColor()

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

◆ GetSpecularPower()

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

◆ GetStaticNameOfClass()

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

Definition at line 37 of file mitkMaterial.h.

◆ GetVtkInterpolation()

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

◆ GetVtkRepresentation()

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

◆ Initialize()

virtual 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

◆ InitializeStandardValues()

virtual void mitk::Material::InitializeStandardValues ( )
protectedvirtual

◆ New() [1/7]

static Pointer mitk::Material::New ( )
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.

Definition at line 61 of file mitkMaterial.h.

◆ New() [2/7]

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.

Definition at line 142 of file mitkMaterial.h.

◆ New() [3/7]

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.

Definition at line 76 of file mitkMaterial.h.

◆ New() [4/7]

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

Copy constructor

Definition at line 153 of file mitkMaterial.h.

◆ New() [5/7]

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 convenience. 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 159 of file mitkMaterial.h.

◆ New() [6/7]

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.

Definition at line 114 of file mitkMaterial.h.

◆ New() [7/7]

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.

Definition at line 92 of file mitkMaterial.h.

◆ operator=()

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

◆ operator==()

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

comparison operator which uses the member variables for comparison

◆ PrintSelf()

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

Dumps the properties to the out stream out

◆ SetColor() [1/2]

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

◆ SetColor() [2/2]

virtual 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])

◆ SetColorCoefficient()

virtual 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

◆ SetInterpolation()

virtual 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.

◆ SetLineWidth()

virtual 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.

◆ SetName()

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

◆ SetOpacity()

virtual 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

◆ SetRepresentation()

virtual 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.

◆ SetSpecularCoefficient()

virtual 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]

◆ SetSpecularColor() [1/2]

virtual 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]

◆ SetSpecularColor() [2/2]

virtual 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])

◆ SetSpecularPower()

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

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

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

◆ Update()

virtual void mitk::Material::Update ( )
protectedvirtual

Member Data Documentation

◆ m_Color

Color mitk::Material::m_Color
protected

Definition at line 431 of file mitkMaterial.h.

◆ m_ColorCoefficient

double mitk::Material::m_ColorCoefficient
protected

Definition at line 435 of file mitkMaterial.h.

◆ m_Interpolation

InterpolationType mitk::Material::m_Interpolation
protected

Definition at line 445 of file mitkMaterial.h.

◆ m_LineWidth

float mitk::Material::m_LineWidth
protected

Definition at line 443 of file mitkMaterial.h.

◆ m_Name

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

Definition at line 429 of file mitkMaterial.h.

◆ m_Opacity

double mitk::Material::m_Opacity
protected

Definition at line 441 of file mitkMaterial.h.

◆ m_Representation

RepresentationType mitk::Material::m_Representation
protected

Definition at line 447 of file mitkMaterial.h.

◆ m_SpecularCoefficient

double mitk::Material::m_SpecularCoefficient
protected

Definition at line 437 of file mitkMaterial.h.

◆ m_SpecularColor

Color mitk::Material::m_SpecularColor
protected

Definition at line 433 of file mitkMaterial.h.

◆ m_SpecularPower

double mitk::Material::m_SpecularPower
protected

Definition at line 439 of file mitkMaterial.h.


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