Commit 119fc436 authored by Cory Quammen's avatar Cory Quammen Committed by Kitware Robot
Browse files

Merge topic '17236-disable-slice-lighting'

cefa13bc Add release not on disabling Slice representation lighting
3b5624d0

 Slice representation: disable lighting
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Utkarsh Ayachit's avatarUtkarsh Ayachit <utkarsh.ayachit@kitware.com>
Merge-request: !2558
parents b339527d cefa13bc
Pipeline #108084 passed with stage
in 0 seconds
# Slice representation lighting is turned off
Lighting on the Slice representation has the undesirable effect of
darkening the Slice with the default light, which is off center with
respect to the view and focal points. We assume the common use case
for this representation is to view the data as directly as possible to
match colors on the slice with colors in the color legend. To better
support this use case, lighting is disabled for this representation.
......@@ -49,6 +49,7 @@ vtkImageSliceRepresentation::vtkImageSliceRepresentation()
this->SliceMapper = vtkPVImageSliceMapper::New();
this->Actor = vtkPVLODActor::New();
this->Actor->SetMapper(this->SliceMapper);
this->Actor->GetProperty()->LightingOff();
}
//----------------------------------------------------------------------------
......@@ -160,6 +161,7 @@ int vtkImageSliceRepresentation::ProcessViewRequest(
if (producerPort)
{
this->SliceMapper->SetInputConnection(producerPort);
this->Actor->GetProperty()->ShadingOff();
}
}
return 1;
......@@ -377,33 +379,3 @@ void vtkImageSliceRepresentation::SetUseXYPlane(int val)
{
this->SliceMapper->SetUseXYPlane(val);
}
//----------------------------------------------------------------------------
void vtkImageSliceRepresentation::SetAmbient(double ambient)
{
this->Actor->GetProperty()->SetAmbient(ambient);
}
//----------------------------------------------------------------------------
void vtkImageSliceRepresentation::SetDiffuse(double diffuse)
{
this->Actor->GetProperty()->SetDiffuse(diffuse);
}
//----------------------------------------------------------------------------
void vtkImageSliceRepresentation::SetSpecular(double specular)
{
this->Actor->GetProperty()->SetSpecular(specular);
}
//----------------------------------------------------------------------------
void vtkImageSliceRepresentation::SetSpecularPower(double val)
{
this->Actor->GetProperty()->SetSpecularPower(val);
}
//----------------------------------------------------------------------------
void vtkImageSliceRepresentation::SetSpecularColor(double r, double g, double b)
{
this->Actor->GetProperty()->SetSpecularColor(r, g, b);
}
......@@ -140,17 +140,6 @@ public:
*/
vtkPVLODActor* GetActor() { return this->Actor; }
//@{
/**
* Pass lighting parameters to vtkProperty.
*/
void SetAmbient(double ambient);
void SetDiffuse(double diffuse);
void SetSpecular(double specular);
void SetSpecularPower(double val);
void SetSpecularColor(double r, double g, double b);
//@}
protected:
vtkImageSliceRepresentation();
~vtkImageSliceRepresentation() override;
......
......@@ -5423,47 +5423,7 @@
min="0"
name="range" />
</DoubleVectorProperty>
<DoubleVectorProperty command="SetAmbient"
default_values="0.0"
name="Ambient"
number_of_elements="1">
<DoubleRangeDomain max="1"
min="0"
name="range" />
</DoubleVectorProperty>
<DoubleVectorProperty command="SetDiffuse"
default_values="1.0"
name="Diffuse"
number_of_elements="1">
<DoubleRangeDomain max="1"
min="0"
name="range" />
</DoubleVectorProperty>
<DoubleVectorProperty command="SetSpecular"
default_values="0.0"
name="Specular"
number_of_elements="1">
<DoubleRangeDomain max="1"
min="0"
name="range" />
</DoubleVectorProperty>
<DoubleVectorProperty command="SetSpecularPower"
default_values="100.0"
name="SpecularPower"
number_of_elements="1">
<DoubleRangeDomain max="100"
min="0"
name="range" />
</DoubleVectorProperty>
<DoubleVectorProperty command="SetSpecularColor"
default_values="1.0 1.0 1.0"
name="SpecularColor"
number_of_elements="3">
<DoubleRangeDomain max="1 1 1"
min="0 0 0"
name="range" />
</DoubleVectorProperty>
<!-- End of ImageSliceRepresentation -->
<!-- End of ImageSliceRepresentation -->
</RepresentationProxy>
 
<!-- ================================================================== -->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment