Commit 0e1e9466 authored by Sankhesh Jhaveri's avatar Sankhesh Jhaveri

Clamp volume component weights to between 0.0 and 1.0

parent 94d03e0b
......@@ -475,13 +475,12 @@ void vtkVolumeProperty::SetComponentWeight(int index, double value)
return;
}
if (this->ComponentWeight[index] == value)
double val = value < 0.0 ? 0.0 : (value > 1.0 ? 1.0 : value);
if (this->ComponentWeight[index] != val)
{
return;
this->ComponentWeight[index] = val;
this->Modified();
}
this->ComponentWeight[index] = value;
this->Modified();
}
double vtkVolumeProperty::GetComponentWeight(int index)
......
......@@ -109,7 +109,8 @@ public:
//@{
/**
* Set/Get the scalar component weights
* Set/Get the scalar component weights.
* Clamped between the range of (0.0, 1.0)
*/
virtual void SetComponentWeight(int index, double value);
virtual double GetComponentWeight(int index);
......
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