source: branches/vtkvis_threaded/RpPseudoColor.h @ 2549

Last change on this file since 2549 was 2496, checked in by ldelgass, 13 years ago

Merge 2480:2494 from trunk

  • Property svn:eol-style set to native
File size: 2.0 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright (C) 2011, Purdue Research Foundation
4 *
5 * Author: Leif Delgass <ldelgass@purdue.edu>
6 */
7
8#ifndef __RAPPTURE_VTKVIS_PSEUDOCOLOR_H__
9#define __RAPPTURE_VTKVIS_PSEUDOCOLOR_H__
10
11#include <vtkSmartPointer.h>
12#include <vtkLookupTable.h>
13#include <vtkDataSetMapper.h>
14#include <vtkActor.h>
15#include <vtkPlaneCollection.h>
16
17#include "ColorMap.h"
18#include "RpVtkGraphicsObject.h"
19
20namespace Rappture {
21namespace VtkVis {
22
23/**
24 * \brief Color-mapped plot of data set
25 */
26class PseudoColor : public VtkGraphicsObject {
27public:
28    enum ColorMode {
29        COLOR_BY_SCALAR,
30        COLOR_BY_VECTOR_MAGNITUDE,
31        COLOR_BY_VECTOR_X,
32        COLOR_BY_VECTOR_Y,
33        COLOR_BY_VECTOR_Z,
34        COLOR_CONSTANT
35    };
36
37    PseudoColor();
38    virtual ~PseudoColor();
39
40    virtual const char *getClassName() const
41    {
42        return "PseudoColor";
43    }
44
45    virtual void setDataSet(DataSet *dataSet,
46                            bool useCumulative,
47                            double scalarRange[2],
48                            double vectorMagnitudeRange[2],
49                            double vectorComponentRange[3][2]);
50
51    virtual void setClippingPlanes(vtkPlaneCollection *planes);
52
53    void setColorMode(ColorMode mode);
54
55    void setColorMap(ColorMap *colorMap);
56
57    /**
58     * \brief Return the ColorMap in use
59     */
60    ColorMap *getColorMap()
61    {
62        return _colorMap;
63    }
64
65    void updateColorMap();
66
67    virtual void updateRanges(bool useCumulative,
68                              double scalarRange[2],
69                              double vectorMagnitudeRange[2],
70                              double vectorComponentRange[3][2]);
71
72private:
73    virtual void update();
74
75    ColorMode _colorMode;
76    ColorMap *_colorMap;
77    double _vectorMagnitudeRange[2];
78    double _vectorComponentRange[3][2];
79
80    vtkSmartPointer<vtkLookupTable> _lut;
81    vtkSmartPointer<vtkDataSetMapper> _dsMapper;
82};
83
84}
85}
86
87#endif
Note: See TracBrowser for help on using the repository browser.