23 #include <vtkProperty.h>
42 InitializeStandardValues();
43 SetColor(red, green, blue);
44 SetColorCoefficient(GetColorCoefficient());
45 SetSpecularColor(GetSpecularColor());
46 SetSpecularCoefficient(GetSpecularCoefficient());
47 SetSpecularPower(GetSpecularPower());
49 SetInterpolation(GetInterpolation());
50 SetRepresentation(GetRepresentation());
51 SetLineWidth(GetLineWidth());
58 double colorCoefficient,
59 double specularCoefficient,
63 InitializeStandardValues();
64 SetColor(red, green, blue);
65 SetColorCoefficient(colorCoefficient);
66 SetSpecularColor(GetSpecularColor());
67 SetSpecularCoefficient(specularCoefficient);
68 SetSpecularPower(specularPower);
70 SetInterpolation(GetInterpolation());
71 SetRepresentation(GetRepresentation());
72 SetLineWidth(GetLineWidth());
77 double colorCoefficient,
78 double specularCoefficient,
82 InitializeStandardValues();
84 SetColorCoefficient(colorCoefficient);
85 SetSpecularColor(GetSpecularColor());
86 SetSpecularCoefficient(specularCoefficient);
87 SetSpecularPower(specularPower);
89 SetInterpolation(GetInterpolation());
90 SetRepresentation(GetRepresentation());
91 SetLineWidth(GetLineWidth());
96 InitializeStandardValues();
98 SetColorCoefficient(GetColorCoefficient());
99 SetSpecularColor(GetSpecularColor());
100 SetSpecularCoefficient(GetSpecularCoefficient());
101 SetSpecularPower(GetSpecularPower());
102 SetOpacity(GetOpacity());
103 SetInterpolation(GetInterpolation());
104 SetRepresentation(GetRepresentation());
105 SetLineWidth(GetLineWidth());
114 const Material &property,
double red,
double green,
double blue,
double opacity, std::string name)
116 Initialize(property);
117 SetColor(red, green, blue);
127 dynamic_cast<const Self &
>(other);
131 catch (std::bad_cast)
141 const Self &otherProp(dynamic_cast<const Self &>(other));
143 Initialize(otherProp);
145 catch (std::bad_cast)
161 m_Color.Set(red, green, blue);
167 m_ColorCoefficient = coefficient;
173 m_SpecularColor = specularColor;
179 m_SpecularColor.Set(red, green, blue);
185 m_SpecularCoefficient = specularCoefficient;
191 m_SpecularPower = specularPower;
203 m_Interpolation = interpolation;
209 m_Representation = representation;
215 m_LineWidth = lineWidth;
226 return m_ColorCoefficient;
231 return m_SpecularColor;
236 return m_SpecularCoefficient;
241 return m_SpecularPower;
251 return m_Interpolation;
256 return m_Representation;
261 switch (m_Interpolation)
275 switch (m_Representation)
280 return VTK_WIREFRAME;
294 this->SetColor(property.
GetColor());
303 this->SetName(property.
GetName());
308 const Self *other =
dynamic_cast<const Self *
>(&property);
322 m_Color.Set(0.5, 0.5, 0.0);
323 m_ColorCoefficient = 0.5;
324 m_SpecularColor.Set(1.0, 1.0, 1.0);
325 m_SpecularCoefficient = 0.5;
326 m_SpecularPower = 10.0;
328 m_Interpolation = Gouraud;
336 this->SetColor(this->GetColor());
337 this->SetColorCoefficient(this->GetColorCoefficient());
338 this->SetSpecularColor(this->GetSpecularColor());
339 this->SetSpecularCoefficient(this->GetSpecularCoefficient());
340 this->SetSpecularPower(this->GetSpecularPower());
341 this->SetOpacity(this->GetOpacity());
342 this->SetInterpolation(this->GetInterpolation());
343 this->SetRepresentation(this->GetRepresentation());
348 os <<
"Name: " <<
GetName() << std::endl;
349 os <<
"Color: " << GetColor() << std::endl;
350 os <<
"ColorCoefficient" << GetColorCoefficient() << std::endl;
351 os <<
"SpecularColor: " << GetSpecularColor() << std::endl;
352 os <<
"SpecularCoefficient: " << GetSpecularCoefficient() << std::endl;
353 os <<
"SpecularPower: " << GetSpecularPower() << std::endl;
354 os <<
"Opacity: " << GetOpacity() << std::endl;
355 os <<
"Line width: " << GetLineWidth() << std::endl;
356 switch (GetInterpolation())
359 os <<
"Interpolation: Flat" << std::endl;
362 os <<
"Interpolation: Gouraud" << std::endl;
365 os <<
"Interpolation: Phong" << std::endl;
368 switch (GetRepresentation())
371 os <<
"Representation: Points" << std::endl;
374 os <<
"Representation: Wireframe" << std::endl;
377 os <<
"Representation: Surface" << std::endl;
Class for storing surfaces (vtkPolyData).
void PrintSelf(std::ostream &os, itk::Indent) const override
virtual double GetSpecularPower() const
virtual void SetColor(Color color)
virtual Color GetSpecularColor() const
virtual void SetLineWidth(float lineWidth)
virtual bool Assignable(const Material &other) const
virtual bool operator==(const Material &property) const
virtual void SetRepresentation(RepresentationType representation)
virtual void SetSpecularCoefficient(double specularCoefficient)
virtual int GetVtkRepresentation() const
virtual double GetOpacity() const
virtual void Initialize(const Material &property)
virtual InterpolationType GetInterpolation() const
virtual void InitializeStandardValues()
virtual RepresentationType GetRepresentation() const
virtual void SetInterpolation(InterpolationType interpolation)
virtual double GetSpecularCoefficient() const
virtual int GetVtkInterpolation() const
virtual Material & operator=(const Material &other)
virtual void SetSpecularColor(Color color)
virtual void SetColorCoefficient(double coefficient)
virtual void SetSpecularPower(double specularPower)
static std::string GetName(std::string fileName, std::string suffix)
itk::RGBPixel< double > Color
virtual float GetLineWidth() const
virtual Color GetColor() const
virtual double GetColorCoefficient() const
virtual void SetOpacity(double opacity)
virtual std::string GetName() const