13 #ifndef mitkMaterial_h
14 #define mitkMaterial_h
17 #include <itkObject.h>
18 #include <itkRGBPixel.h>
19 #include <itkVectorContainer.h>
22 #include <vtkSystemIncludes.h>
40 typedef itk::RGBPixel<double>
Color;
69 smartPtr->UnRegister();
85 static Pointer
New(
Color color,
double opacity = 1.0f)
87 Pointer smartPtr =
new Material(color, opacity);
88 smartPtr->UnRegister();
105 static Pointer
New(
double red,
double green,
double blue,
double opacity = 1.0f)
107 Pointer smartPtr =
new Material(red, green, blue, opacity);
108 smartPtr->UnRegister();
131 static Pointer
New(
double red,
134 double colorCoefficient,
135 double specularCoefficient,
136 double specularPower,
139 Pointer smartPtr =
new Material(red, green, blue, colorCoefficient, specularCoefficient, specularPower, opacity);
140 smartPtr->UnRegister();
163 Color color,
double colorCoefficient,
double specularCoefficient,
double specularPower,
double opacity)
165 Pointer smartPtr =
new Material(color, colorCoefficient, specularCoefficient, specularPower, opacity);
166 smartPtr->UnRegister();
189 const Material &property,
double red,
double green,
double blue,
double opacity = 1.0, std::string name =
"")
191 Pointer smartPtr =
new Material(property, red, green, blue, opacity, name);
192 smartPtr->UnRegister();
230 virtual void SetColor(
double red,
double green,
double blue);
402 void PrintSelf(std::ostream &os, itk::Indent)
const override;
410 itkSetMacro(Name, std::string);
415 itkGetConstMacro(Name, std::string);
453 Material(
double red,
double green,
double blue,
double opacity = 1.0f);
476 double colorCoefficient,
477 double specularCoefficient,
478 double specularPower,
498 Material(
Color color,
double colorCoefficient,
double specularCoefficient,
double specularPower,
double opacity);
510 const Material &property,
double red,
double green,
double blue,
double opacity = 1.0, std::string name =
"");
Encapsulates 3D visualization properties which are forwarded to VTK for color mapping.
static Pointer New(Color color, double opacity=1.0f)
Create a new Material with the given color and opacity.
itk::RGBPixel< double > Color
virtual double GetColorCoefficient() const
Get the color coefficient of the material.
static Pointer New(double red, double green, double blue, double opacity=1.0f)
Create a new Material with the given RGB color components and opacity.
static Pointer New(Color color, double colorCoefficient, double specularCoefficient, double specularPower, double opacity)
Create a new Material with the given color and lighting properties.
virtual void SetSpecularCoefficient(double specularCoefficient)
Set the specular coefficient which controls the shininess of the object together with the specular po...
static Pointer New(double red, double green, double blue, double colorCoefficient, double specularCoefficient, double specularPower, double opacity)
Create a new Material with full control over color and lighting properties.
virtual Color GetColor() const
Get the color of the material.
virtual double GetSpecularCoefficient() const
Get the specular coefficient used for rendering.
virtual RepresentationType GetRepresentation() const
Get the representation type used for rendering.
Material(double red, double green, double blue, double opacity=1.0f)
Constructor with RGB components and opacity.
virtual float GetLineWidth() const
Get the line width used for wireframe rendering.
virtual void SetSpecularPower(double specularPower)
Set the specular power which controls the shininess of the object together with the specular coeffici...
virtual void SetColor(Color color)
Set the material color in RGB space.
virtual int GetVtkInterpolation() const
Get the interpolation method as a VTK constant.
virtual void SetSpecularColor(Color color)
Set the specular color.
virtual void Initialize(const Material &property)
Fill the current material with the properties of the given material.
double m_SpecularCoefficient
Material()
Default constructor.
InterpolationType m_Interpolation
virtual void SetOpacity(double opacity)
Set the opacity of the material.
mitkClassMacroItkParent(Material, itk::Object)
virtual double GetOpacity() const
Get the opacity of the material.
virtual Material & operator=(const Material &other)
Assignment operator. Copies all properties from the other material.
virtual void SetLineWidth(float lineWidth)
Set the width of a Line.
static Pointer New(const Material &property, double red, double green, double blue, double opacity=1.0, std::string name="")
Copy constructor with color and opacity override.
mitkNewMacro1Param(Material, const Material &)
Copy constructor.
virtual void SetColor(double red, double green, double blue)
Set the material color in RGB space.
void PrintSelf(std::ostream &os, itk::Indent) const override
Print the material properties to the given output stream.
virtual InterpolationType GetInterpolation() const
Get the interpolation method used for rendering.
Material(const Material &property)
Copy constructor.
virtual int GetVtkRepresentation() const
Get the representation type as a VTK constant.
virtual void SetColorCoefficient(double coefficient)
Set an attenuation coefficient for the color.
Material(const Material &property, double red, double green, double blue, double opacity=1.0, std::string name="")
Copy constructor with color and opacity override.
RepresentationType m_Representation
Material(double red, double green, double blue, double colorCoefficient, double specularCoefficient, double specularPower, double opacity)
Constructor with full control over color and lighting properties.
virtual void SetSpecularColor(double red, double green, double blue)
Set the specular color using RGB components.
virtual void InitializeStandardValues()
Initialize all member variables to standard default values.
virtual bool operator==(const Material &property) const
Comparison operator which uses the member variables for comparison.
Material(Color color, double opacity=1.0f)
Constructor with color and opacity.
virtual void SetInterpolation(InterpolationType interpolation)
Set the surface interpolation method of the object.
virtual void SetRepresentation(RepresentationType representation)
Set the surface representation method of the object.
Material(Color color, double colorCoefficient, double specularCoefficient, double specularPower, double opacity)
Constructor with color and lighting properties.
virtual bool Assignable(const Material &other) const
Check whether the given material can be assigned to this one.
static Pointer New()
Create a new Material with default values.
double m_ColorCoefficient
virtual Color GetSpecularColor() const
Get the specular color of the material.
virtual double GetSpecularPower() const
Get the specular power.
virtual void Update()
Re-apply all current property values, triggering Modified().
Data class for storing polygonal surfaces (vtkPolyData).
Find image slices visible on a given plane.
itk::VectorContainer< unsigned int, Material::Pointer > MaterialVectorContainer