Ignore:
Timestamp:
Sep 21, 2011 2:33:59 PM (13 years ago)
Author:
gah
Message:

updates from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/blt4/packages/vizservers/vtkvis/RpPseudoColor.cpp

    r2542 r2550  
    1010#include <vtkDataSet.h>
    1111#include <vtkPointData.h>
     12#include <vtkCellData.h>
    1213#include <vtkDataSetMapper.h>
    1314#include <vtkUnstructuredGrid.h>
     
    235236    case COLOR_BY_VECTOR_MAGNITUDE: {
    236237        _dsMapper->ScalarVisibilityOn();
    237         _dsMapper->SetScalarModeToUsePointFieldData();
    238238        if (ds->GetPointData() != NULL &&
    239239            ds->GetPointData()->GetVectors() != NULL) {
     240            _dsMapper->SetScalarModeToUsePointFieldData();
    240241            _dsMapper->SelectColorArray(ds->GetPointData()->GetVectors()->GetName());
     242        } else if (ds->GetCellData() != NULL &&
     243                   ds->GetCellData()->GetVectors() != NULL) {
     244            _dsMapper->SetScalarModeToUseCellFieldData();
     245            _dsMapper->SelectColorArray(ds->GetCellData()->GetVectors()->GetName());
    241246        }
    242247        if (_lut != NULL) {
     
    248253    case COLOR_BY_VECTOR_X:
    249254        _dsMapper->ScalarVisibilityOn();
    250         _dsMapper->SetScalarModeToUsePointFieldData();
    251255        if (ds->GetPointData() != NULL &&
    252256            ds->GetPointData()->GetVectors() != NULL) {
     257            _dsMapper->SetScalarModeToUsePointFieldData();
    253258            _dsMapper->SelectColorArray(ds->GetPointData()->GetVectors()->GetName());
     259        } else if (ds->GetCellData() != NULL &&
     260                   ds->GetCellData()->GetVectors() != NULL) {
     261            _dsMapper->SetScalarModeToUseCellFieldData();
     262            _dsMapper->SelectColorArray(ds->GetCellData()->GetVectors()->GetName());
    254263        }
    255264        if (_lut != NULL) {
     
    261270    case COLOR_BY_VECTOR_Y:
    262271        _dsMapper->ScalarVisibilityOn();
    263         _dsMapper->SetScalarModeToUsePointFieldData();
    264272        if (ds->GetPointData() != NULL &&
    265273            ds->GetPointData()->GetVectors() != NULL) {
     274            _dsMapper->SetScalarModeToUsePointFieldData();
    266275            _dsMapper->SelectColorArray(ds->GetPointData()->GetVectors()->GetName());
     276        } else if (ds->GetCellData() != NULL &&
     277                   ds->GetCellData()->GetVectors() != NULL) {
     278            _dsMapper->SetScalarModeToUseCellFieldData();
     279            _dsMapper->SelectColorArray(ds->GetCellData()->GetVectors()->GetName());
    267280        }
    268281        if (_lut != NULL) {
     
    274287    case COLOR_BY_VECTOR_Z:
    275288        _dsMapper->ScalarVisibilityOn();
    276         _dsMapper->SetScalarModeToUsePointFieldData();
    277289        if (ds->GetPointData() != NULL &&
    278290            ds->GetPointData()->GetVectors() != NULL) {
     291            _dsMapper->SetScalarModeToUsePointFieldData();
    279292            _dsMapper->SelectColorArray(ds->GetPointData()->GetVectors()->GetName());
     293        } else if (ds->GetCellData() != NULL &&
     294                   ds->GetCellData()->GetVectors() != NULL) {
     295            _dsMapper->SetScalarModeToUseCellFieldData();
     296            _dsMapper->SelectColorArray(ds->GetCellData()->GetVectors()->GetName());
    280297        }
    281298        if (_lut != NULL) {
Note: See TracChangeset for help on using the changeset viewer.