source: branches/blt4/packages/vizservers/vtkvis/GraphicsObject.cpp @ 3892

Last change on this file since 3892 was 3892, checked in by gah, 11 years ago
File size: 1.3 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright (C) 2004-2012  HUBzero Foundation, LLC
4 *
5 * Author: Leif Delgass <ldelgass@purdue.edu>
6 */
7
8#include "GraphicsObject.h"
9#include "Renderer.h"
10#include "Trace.h"
11
12using namespace VtkVis;
13
14void GraphicsObject::setDataSet(DataSet *dataSet,
15                                Renderer *renderer)
16{
17    if (_dataSet != dataSet) {
18        _dataSet = dataSet;
19
20        if (renderer != NULL &&
21            dataSet != NULL &&
22            renderer->getUseCumulativeRange()) {
23            renderer->getCumulativeDataRange(_dataRange,
24                                             _dataSet->getActiveScalarsName(),
25                                             1);
26        } else if (_dataSet != NULL) {
27            _dataSet->getScalarRange(_dataRange);
28        }
29
30        update();
31    }
32}
33
34void GraphicsObject::updateRanges(Renderer *renderer)
35{
36    if (_dataSet == NULL) {
37        ERROR("called before setDataSet");
38        return;
39    }
40    if (renderer == NULL) {
41        ERROR("NULL renderer");
42        return;
43    }
44
45    if (renderer->getUseCumulativeRange()) {
46        renderer->getCumulativeDataRange(_dataRange,
47                                         _dataSet->getActiveScalarsName(),
48                                         1);
49    } else {
50        _dataSet->getScalarRange(_dataRange);
51    }
52}
Note: See TracBrowser for help on using the repository browser.