MantisBT - VTK
View Issue Details
0012113VTK(No Category)public2011-04-20 14:532013-04-05 20:26
Julien Finet 
Julien Finet 
normalminoralways
closedfixed 
 
 
0012113: vtkColorTransferFunction::SetNodeValue() doesn't refresh function range
vtkColorTransferFunction::SetNodeValue() doesn't update the current range.
The new X of the control point can be outside of the current range, however the range is not updated.
Solutions:
+vtkColorTransferFunction::SetNodeValue() can call SortAndUpdateRange()
+Expose vtkColorTransferFunction::MovePoint() (it updates correctly the range) to the public API. If the user knows he just want to move the point, then he can call MovePoint() instead.
vtkColorTransferFunction* ctf = vtkColorTransferFunction::New();
ctf->AddHSVSegment(0., 0., 1., 1., 0.3333, 0.3333, 1., 1.);
ctf->AddHSVSegment(0.3333, 0.3333, 1., 1., 0.6666, 0.666, 1., 1.);
ctf->AddHSVSegment(0.6666, 0.6666, 1., 1., 1., 0., 1., 1.);
ctf->GetRange(); -> [0., 1.]
double firstPoint[6];
ctf->GetNodeValue(0, firstPoint);
firstPoint[0] = -1.;
ctf->SetNodeValue(0, firstPoint); // move the first point in 0. to -1.
ctf->GetRange(); -> [0., 1.] should be [-1., 1.]
A work around (time consuming) is to use AdjustRange() after calling vtkColorTransferFunction::SetNodeValue().
No tags attached.
Issue History
2011-04-20 14:53Julien FinetNew Issue
2011-04-20 15:07Julien FinetNote Added: 0026234
2011-04-20 16:22Julien FinetAssigned To => Julien Finet
2011-04-20 16:22Julien FinetStatusbacklog => tabled
2011-05-05 16:19Julien FinetNote Added: 0026441
2011-05-05 16:19Julien FinetStatustabled => @80@
2011-05-05 16:19Julien FinetResolutionopen => fixed
2011-06-16 13:12Zack GalbreathCategoryDevelopment => (No Category)
2013-04-05 20:26Berk GeveciStatuscustomer review => closed

Notes
(0026234)
Julien Finet   
2011-04-20 15:07   
vtkColorTransferFunction::RemovePoint() doesn't refresh the range neither.
(0026441)
Julien Finet   
2011-05-05 16:19   
Fixed on April 22th 2011.
Commit SHA1: ec97c6e7cc768b0b25f2
Change-ID: I5944e923555346ce246cbc22581d15f381a29676