Changeset 3976 for trunk


Ignore:
Timestamp:
Oct 2, 2013, 12:13:32 AM (11 years ago)
Author:
ldelgass
Message:

Fix for VTK volume transfer functions, resetting location of a node causes
confusion and re-sorting, so build scaled transfer functions from scratch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/vtkvis/ColorMap.cpp

    r3616 r3976  
    6767{
    6868    vtkSmartPointer<vtkColorTransferFunction> tf = vtkSmartPointer<vtkColorTransferFunction>::New();
    69     tf->DeepCopy(_colorTF);
    7069    double tmp[6];
    71     for (int i = 0; i < tf->GetSize(); i++) {
    72         tf->GetNodeValue(i, tmp);
     70    for (int i = 0; i < _colorTF->GetSize(); i++) {
     71        _colorTF->GetNodeValue(i, tmp);
    7372        tmp[0] = range[0] + tmp[0] * (range[1] - range[0]);
    74         tf->SetNodeValue(i, tmp);
     73        tf->AddRGBPoint(tmp[0], tmp[1], tmp[2], tmp[3], tmp[4], tmp[5]);
    7574    }
    7675    return tf;
     
    8584{
    8685    vtkSmartPointer<vtkPiecewiseFunction> tf = vtkSmartPointer<vtkPiecewiseFunction>::New();
    87     tf->DeepCopy(_opacityTF);
    8886    double tmp[4];
    89     for (int i = 0; i < tf->GetSize(); i++) {
    90         tf->GetNodeValue(i, tmp);
     87    for (int i = 0; i < _opacityTF->GetSize(); i++) {
     88        _opacityTF->GetNodeValue(i, tmp);
    9189        tmp[0] = range[0] + tmp[0] * (range[1] - range[0]);
    92         tf->SetNodeValue(i, tmp);
     90        tf->AddPoint(tmp[0], tmp[1], tmp[2], tmp[3]);
    9391    }
    9492    return tf;
Note: See TracChangeset for help on using the changeset viewer.