vtkProjectedTetrahedraMapper does not properly support IndependantComponents with 2 components
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
When using a 2-component scalar with IndependantComponents, the two components are not processed through the color/opacity functions provided.
The "Map2DependantComponents" needs to be modified to be more like the following:
template<class ColorType, class ScalarType> void Map2DependentComponents(ColorType *colors, ScalarType *scalars, vtkIdType num_scalars, vtkVolumeProperty *property) { ColorType *c = colors; ScalarType *s = scalars; vtkIdType i;
if (property->GetColorChannels() == 1)
{
vtkPiecewiseFunction *gray = property->GetGrayTransferFunction();
vtkPiecewiseFunction *alpha = property->GetScalarOpacity();
for (i = 0; i < num_scalars; i++, c += 4, s += 2)
{
c[0] = c[1] = c[2] = static_cast<ColorType>(gray->GetValue(s[0]));
c[3] = static_cast<ColorType>(alpha->GetValue(s[1]));
}
}
else
{
vtkColorTransferFunction *rgb = property->GetRGBTransferFunction();
vtkPiecewiseFunction *alpha = property->GetScalarOpacity();
for (i = 0; i < num_scalars; i++, c += 4, s += 2)
{
double trgb[3];
rgb->GetColor(s[0], trgb);
c[0] = static_cast<ColorType>(trgb[0]);
c[1] = static_cast<ColorType>(trgb[1]);
c[2] = static_cast<ColorType>(trgb[2]);
c[3] = static_cast<ColorType>(alpha->GetValue(s[1]));
}
}
}