[vtk-developers] [VTK 0012113]: vtkColorTransferFunction::SetNodeValue() doesn't refresh function range

Mantis Bug Tracker mantis at public.kitware.com
Wed Apr 20 14:53:35 EDT 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=12113 
====================================================================== 
Reported By:                Julien Finet
Assigned To:                
====================================================================== 
Project:                    VTK
Issue ID:                   12113
Category:                   Development
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-04-20 14:53 EDT
Last Modified:              2011-04-20 14:53 EDT
====================================================================== 
Summary:                    vtkColorTransferFunction::SetNodeValue() doesn't
refresh function range
Description: 
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. 

Steps to Reproduce: 
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.]

Additional Information: 
A work around (time consuming) is to use AdjustRange() after calling
vtkColorTransferFunction::SetNodeValue().

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-04-20 14:53 Julien Finet   New Issue                                    
======================================================================




More information about the vtk-developers mailing list