source: branches/Rappture 1.2/packages/vizservers/vtkvis/RpPseudoColor.h @ 3208

Last change on this file since 3208 was 3177, checked in by mmc, 12 years ago

Updated all of the copyright notices to reference the transfer to
the new HUBzero Foundation, LLC.

  • 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) 2004-2012  HUBzero Foundation, LLC
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                            Renderer *renderer);
47
48    virtual void setClippingPlanes(vtkPlaneCollection *planes);
49
50    void setColorMode(ColorMode mode, DataSet::DataAttributeType type,
51                      const char *name, double range[2] = NULL);
52
53    void setColorMode(ColorMode mode,
54                      const char *name, double range[2] = NULL);
55
56    void setColorMode(ColorMode mode);
57
58    void setColorMap(ColorMap *colorMap);
59
60    /**
61     * \brief Return the ColorMap in use
62     */
63    ColorMap *getColorMap()
64    {
65        return _colorMap;
66    }
67
68    void updateColorMap();
69
70    virtual void updateRanges(Renderer *renderer);
71
72private:
73    virtual void update();
74
75    ColorMap *_colorMap;
76    ColorMode _colorMode;
77    std::string _colorFieldName;
78    DataSet::DataAttributeType _colorFieldType;
79    double _colorFieldRange[2];
80    double _vectorMagnitudeRange[2];
81    double _vectorComponentRange[3][2];
82    Renderer *_renderer;
83
84    vtkSmartPointer<vtkLookupTable> _lut;
85    vtkSmartPointer<vtkDataSetMapper> _dsMapper;
86};
87
88}
89}
90
91#endif
Note: See TracBrowser for help on using the repository browser.