source: trunk/packages/vizservers/vtkvis/RpHeightMap.h @ 2314

Last change on this file since 2314 was 2290, checked in by ldelgass, 13 years ago
  • Add contour3d (isosurface geometry) command to vtkvis
  • Use depth peeling algorithm (order independent transparency) by default, add 'renderer depthpeel' command to toggle.
  • Use tri strips in some geometry generators for better performance
  • Heightmap: 2D slice resampling of non-image 3D datasets (e.g. points, ugrids) Set a default scaling based on data range. Still some problems where images from resampling have zero values in out-of-bounds pixels (probe filter creates a mask array that could be used). Still need a method/heuristic to select image resolution when resampling.
  • Property svn:eol-style set to native
File size: 2.9 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_HEIGHTMAP_H__
9#define __RAPPTURE_VTKVIS_HEIGHTMAP_H__
10
11#include <vtkSmartPointer.h>
12#include <vtkAlgorithmOutput.h>
13#include <vtkContourFilter.h>
14#include <vtkProbeFilter.h>
15#include <vtkLookupTable.h>
16#include <vtkDataSetMapper.h>
17#include <vtkActor.h>
18#include <vtkPlaneCollection.h>
19#include <vtkGaussianSplatter.h>
20#include <vtkExtractVOI.h>
21#include <vtkWarpScalar.h>
22#include <vtkPropAssembly.h>
23#include <vtkPolyData.h>
24
25#include <vector>
26
27#include "RpVtkDataSet.h"
28
29namespace Rappture {
30namespace VtkVis {
31
32/**
33 * \brief Color-mapped plot of data set
34 */
35class HeightMap {
36public:
37    enum Axis {
38        X_AXIS,
39        Y_AXIS,
40        Z_AXIS
41    };
42
43    HeightMap();
44    virtual ~HeightMap();
45
46    void setDataSet(DataSet *dataset);
47
48    DataSet *getDataSet();
49
50    vtkProp *getProp();
51
52    void selectVolumeSlice(Axis axis, double ratio);
53
54    void setHeightScale(double scale);
55
56    void setContours(int numContours);
57
58    void setContours(int numContours, double range[2]);
59
60    void setContourList(const std::vector<double>& contours);
61
62    int getNumContours() const;
63
64    const std::vector<double>& getContourList() const;
65
66    void setLookupTable(vtkLookupTable *lut);
67
68    vtkLookupTable *getLookupTable();
69
70    void setVisibility(bool state);
71
72    bool getVisibility();
73
74    void setOpacity(double opacity);
75
76    void setEdgeVisibility(bool state);
77
78    void setEdgeColor(float color[3]);
79
80    void setEdgeWidth(float edgeWidth);
81
82    void setContourVisibility(bool state);
83
84    void setContourEdgeColor(float color[3]);
85
86    void setContourEdgeWidth(float edgeWidth);
87
88    void setClippingPlanes(vtkPlaneCollection *planes);
89
90    void setLighting(bool state);
91
92private:
93    vtkAlgorithmOutput *initWarp(vtkAlgorithmOutput *input);
94    vtkAlgorithmOutput *initWarp(vtkPolyData *input);
95    void initProp();
96    void update();
97
98    DataSet * _dataSet;
99
100    int _numContours;
101    std::vector<double> _contours;
102    double _dataRange[2];
103
104    float _edgeColor[3];
105    float _contourEdgeColor[3];
106    float _edgeWidth;
107    float _contourEdgeWidth;
108    double _opacity;
109    double _warpScale;
110    double _dataScale;
111    Axis _sliceAxis;
112    bool _pipelineInitialized;
113
114    vtkSmartPointer<vtkLookupTable> _lut;
115    vtkSmartPointer<vtkDataSetMapper> _dsMapper;
116    vtkSmartPointer<vtkContourFilter> _contourFilter;
117    vtkSmartPointer<vtkPolyDataMapper> _contourMapper;
118    vtkSmartPointer<vtkGaussianSplatter> _pointSplatter;
119    vtkSmartPointer<vtkProbeFilter> _probeFilter;
120    vtkSmartPointer<vtkExtractVOI> _volumeSlicer;
121    vtkSmartPointer<vtkWarpScalar> _warp;
122    vtkSmartPointer<vtkActor> _dsActor;
123    vtkSmartPointer<vtkActor> _contourActor;
124    vtkSmartPointer<vtkPropAssembly> _props;
125};
126
127}
128}
129
130#endif
Note: See TracBrowser for help on using the repository browser.