Changeset 5812


Ignore:
Timestamp:
Aug 20, 2015 11:31:53 AM (8 years ago)
Author:
ldelgass
Message:

Fixes for setting active vectors (use same code for scalars and vectors)

Location:
vtkvis/branches/1.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vtkvis/branches/1.8/DataSet.cpp

    r4739 r5812  
    473473    bool found = false;
    474474    if (_dataSet != NULL) {
    475         if (_dataSet->GetPointData() != NULL) {
    476             if (_dataSet->GetPointData()->SetActiveVectors(name) >= 0) {
    477                 TRACE("Set active point data vectors to %s", name);
    478                 found = true;
    479             }
    480         }
    481         if (_dataSet->GetCellData() != NULL) {
    482             if (_dataSet->GetCellData()->SetActiveVectors(name) >= 0) {
    483                 TRACE("Set active cell data vectors to %s", name);
    484                 found = true;
    485             }
    486         }
    487     }
    488 
     475        if (!hasField(name)) {
     476            ERROR("No field named %s in %s", name, getName().c_str());
     477        } else {
     478            if (_dataSet->GetPointData() != NULL) {
     479                if (_dataSet->GetPointData()->SetActiveVectors(name) >= 0) {
     480                    TRACE("Set active point data vectors for %s to %s", getName().c_str(), name);
     481                    found = true;
     482                }
     483            }
     484            if (_dataSet->GetCellData() != NULL) {
     485                if (_dataSet->GetCellData()->SetActiveVectors(name) >= 0) {
     486                    TRACE("Set active cell data vectors for %s to %s", getName().c_str(), name);
     487                    found = true;
     488                }
     489            }
     490        }
     491    }
     492#ifdef WANT_TRACE
     493    if (_dataSet->GetPointData() != NULL) {
     494        if (_dataSet->GetPointData()->GetVectors() != NULL) {
     495            TRACE("Point data vectors for %s: %s", getName().c_str(), _dataSet->GetPointData()->GetVectors()->GetName());
     496        } else {
     497            TRACE("NULL point data vectors for %s", getName().c_str());
     498        }
     499    }
     500    if (_dataSet->GetCellData() != NULL) {
     501        if (_dataSet->GetCellData()->GetVectors() != NULL) {
     502            TRACE("Cell data vectors for %s: %s", getName().c_str(), _dataSet->GetCellData()->GetVectors()->GetName());
     503        } else {
     504            TRACE("NULL cell data vectors for %s", getName().c_str());
     505        }
     506    }
     507#endif
    489508    return found;
    490509}
  • vtkvis/branches/1.8/Renderer.cpp

    r4813 r5812  
    428428    bool needRangeUpdate = false;
    429429    do {
    430         if (strcmp(itr->second->getActiveVectorsName(), vectorName) != 0) {
     430        const char *name = itr->second->getActiveVectorsName();
     431        if (name == NULL || (strcmp(name, vectorName) != 0)) {
    431432            if (!itr->second->setActiveVectors(vectorName)) {
    432433                ret = false;
Note: See TracChangeset for help on using the changeset viewer.