source: branches/nanovis2/packages/vizservers/vtkvis/RpHeightMap.h @ 3305

Last change on this file since 3305 was 3305, checked in by ldelgass, 11 years ago

sync with trunk

  • Property svn:eol-style set to native
File size: 3.2 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_HEIGHTMAP_H__
9#define __RAPPTURE_VTKVIS_HEIGHTMAP_H__
10
11#include <vtkSmartPointer.h>
12#include <vtkAlgorithmOutput.h>
13#include <vtkContourFilter.h>
14#include <vtkLookupTable.h>
15#include <vtkDataSetMapper.h>
16#include <vtkActor.h>
17#include <vtkPlaneCollection.h>
18#include <vtkGaussianSplatter.h>
19#include <vtkExtractVOI.h>
20#include <vtkWarpScalar.h>
21#include <vtkAssembly.h>
22#include <vtkPolyData.h>
23#include <vtkPlane.h>
24
25#include <vector>
26
27#include "ColorMap.h"
28#include "RpTypes.h"
29#include "RpVtkGraphicsObject.h"
30
31namespace Rappture {
32namespace VtkVis {
33
34/**
35 * \brief Color-mapped plot of data set
36 */
37class HeightMap : public VtkGraphicsObject {
38public:
39    HeightMap(int numContours, double heightScale = 1.0);
40
41    HeightMap(const std::vector<double>& contours, double heightScale = 1.0);
42
43    virtual ~HeightMap();
44
45    virtual const char *getClassName() const
46    {
47        return "HeightMap";
48    }
49
50    virtual void setDataSet(DataSet *dataSet,
51                            Renderer *renderer);
52
53    virtual void setLighting(bool state);
54
55    virtual void setEdgeVisibility(bool state);
56
57    virtual void setEdgeColor(float color[3]);
58
59    virtual void setEdgeWidth(float edgeWidth);
60
61    virtual void setClippingPlanes(vtkPlaneCollection *planes);
62
63    virtual void setAspect(double aspect);
64
65    void selectVolumeSlice(Axis axis, double ratio);
66
67    void setHeightScale(double scale);
68
69    double getHeightScale()
70    {
71        return _warpScale;
72    }
73
74    void setNumContours(int numContours);
75
76    void setContourList(const std::vector<double>& contours);
77
78    int getNumContours() const;
79
80    const std::vector<double>& getContourList() const;
81
82    void setColorMap(ColorMap *colorMap);
83
84    /**
85     * \brief Return the ColorMap in use
86     */
87    ColorMap *getColorMap()
88    {
89        return _colorMap;
90    }
91
92    void updateColorMap();
93
94    virtual void updateRanges(Renderer *renderer);
95
96    void setContourLineVisibility(bool state);
97
98    void setContourSurfaceVisibility(bool state);
99
100    void setContourEdgeColor(float color[3]);
101
102    void setContourEdgeWidth(float edgeWidth);
103
104private:
105    HeightMap();
106
107    virtual void initProp();
108    virtual void update();
109
110    vtkAlgorithmOutput *initWarp(vtkAlgorithmOutput *input);
111    vtkAlgorithmOutput *initWarp(vtkPolyData *input);
112
113    int _numContours;
114    std::vector<double> _contours;
115    ColorMap *_colorMap;
116
117    float _contourEdgeColor[3];
118    float _contourEdgeWidth;
119    double _warpScale;
120    double _dataScale;
121    Axis _sliceAxis;
122    bool _pipelineInitialized;
123
124    vtkSmartPointer<vtkLookupTable> _lut;
125    vtkSmartPointer<vtkDataSetMapper> _dsMapper;
126    vtkSmartPointer<vtkContourFilter> _contourFilter;
127    vtkSmartPointer<vtkPolyDataMapper> _contourMapper;
128    vtkSmartPointer<vtkGaussianSplatter> _pointSplatter;
129    vtkSmartPointer<vtkExtractVOI> _volumeSlicer;
130    vtkSmartPointer<vtkPlane> _cutPlane;
131    vtkSmartPointer<vtkWarpScalar> _warp;
132    vtkSmartPointer<vtkActor> _dsActor;
133    vtkSmartPointer<vtkActor> _contourActor;
134};
135
136}
137}
138
139#endif
Note: See TracBrowser for help on using the repository browser.