source: vtkvis/branches/1.8/HeightMap.h @ 5826

Last change on this file since 5826 was 5826, checked in by ldelgass, 9 years ago

remove unused method

  • Property svn:eol-style set to native
File size: 4.2 KB
RevLine 
[2260]1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
[3177]3 * Copyright (C) 2004-2012  HUBzero Foundation, LLC
[2260]4 *
5 * Author: Leif Delgass <ldelgass@purdue.edu>
6 */
7
[3615]8#ifndef VTKVIS_HEIGHTMAP_H
9#define VTKVIS_HEIGHTMAP_H
[2260]10
11#include <vtkSmartPointer.h>
[2270]12#include <vtkAlgorithmOutput.h>
[2260]13#include <vtkContourFilter.h>
14#include <vtkLookupTable.h>
[3680]15#include <vtkPolyDataMapper.h>
[2260]16#include <vtkActor.h>
17#include <vtkPlaneCollection.h>
18#include <vtkGaussianSplatter.h>
19#include <vtkExtractVOI.h>
20#include <vtkWarpScalar.h>
[3330]21#include <vtkPolyDataNormals.h>
[2328]22#include <vtkAssembly.h>
[3680]23#include <vtkDataSet.h>
[2457]24#include <vtkPlane.h>
[2260]25
26#include <vector>
27
[2402]28#include "ColorMap.h"
[3616]29#include "Types.h"
[3621]30#include "GraphicsObject.h"
[2260]31
32namespace VtkVis {
33
34/**
35 * \brief Color-mapped plot of data set
36 */
[3621]37class HeightMap : public GraphicsObject {
[2260]38public:
[3680]39    enum CloudStyle {
40        CLOUD_MESH,
41        CLOUD_SPLAT
42    };
[3330]43    enum ColorMode {
44        COLOR_BY_SCALAR,
45        COLOR_BY_VECTOR_MAGNITUDE,
46        COLOR_BY_VECTOR_X,
47        COLOR_BY_VECTOR_Y,
48        COLOR_BY_VECTOR_Z,
49        COLOR_CONSTANT
50    };
51
[2423]52    HeightMap(int numContours, double heightScale = 1.0);
[2402]53
[2423]54    HeightMap(const std::vector<double>& contours, double heightScale = 1.0);
[2402]55
[2260]56    virtual ~HeightMap();
57
[2328]58    virtual const char *getClassName() const
59    {
60        return "HeightMap";
61    }
[2260]62
[2580]63    virtual void setDataSet(DataSet *dataSet,
[2612]64                            Renderer *renderer);
[2260]65
[2328]66    virtual void setLighting(bool state);
[2260]67
[3330]68    virtual void setColor(float color[3]);
69
[2328]70    virtual void setEdgeVisibility(bool state);
71
72    virtual void setEdgeColor(float color[3]);
73
74    virtual void setEdgeWidth(float edgeWidth);
75
76    virtual void setClippingPlanes(vtkPlaneCollection *planes);
77
[3189]78    virtual void setAspect(double aspect);
79
[3680]80    void setCloudStyle(CloudStyle style);
81
[2260]82    void selectVolumeSlice(Axis axis, double ratio);
83
84    void setHeightScale(double scale);
85
[2517]86    double getHeightScale()
87    {
88        return _warpScale;
89    }
90
[3330]91    void setInterpolateBeforeMapping(bool state);
92
[2423]93    void setNumContours(int numContours);
[2260]94
95    void setContourList(const std::vector<double>& contours);
96
97    int getNumContours() const;
98
99    const std::vector<double>& getContourList() const;
100
[3330]101    void setContourLineColorMapEnabled(bool mode);
102
103    void setColorMode(ColorMode mode, DataSet::DataAttributeType type,
104                      const char *name, double range[2] = NULL);
105
106    void setColorMode(ColorMode mode,
107                      const char *name, double range[2] = NULL);
108
109    void setColorMode(ColorMode mode);
110
[2402]111    void setColorMap(ColorMap *colorMap);
[2260]112
[2402]113    /**
114     * \brief Return the ColorMap in use
115     */
116    ColorMap *getColorMap()
117    {
118        return _colorMap;
119    }
[2260]120
[2402]121    void updateColorMap();
122
[2612]123    virtual void updateRanges(Renderer *renderer);
[2402]124
[2423]125    void setContourLineVisibility(bool state);
[2260]126
[2423]127    void setContourSurfaceVisibility(bool state);
128
[2260]129    void setContourEdgeColor(float color[3]);
130
131    void setContourEdgeWidth(float edgeWidth);
132
[2328]133private:
[2402]134    HeightMap();
135
[2328]136    virtual void initProp();
137    virtual void update();
[2260]138
[3330]139    void computeDataScale();
140
[2270]141    vtkAlgorithmOutput *initWarp(vtkAlgorithmOutput *input);
[2260]142
143    int _numContours;
144    std::vector<double> _contours;
145
[3330]146    bool _contourColorMap;
[2260]147    float _contourEdgeColor[3];
148    float _contourEdgeWidth;
149    double _warpScale;
[2290]150    double _dataScale;
151    Axis _sliceAxis;
[2270]152    bool _pipelineInitialized;
[2260]153
[3680]154    CloudStyle _cloudStyle;
[3330]155    ColorMap *_colorMap;
156    ColorMode _colorMode;
157    std::string _colorFieldName;
158    DataSet::DataAttributeType _colorFieldType;
159    double _colorFieldRange[2];
160    double _vectorMagnitudeRange[2];
161    double _vectorComponentRange[3][2];
162    Renderer *_renderer;
163
[2260]164    vtkSmartPointer<vtkLookupTable> _lut;
[3680]165    vtkSmartPointer<vtkPolyDataMapper> _mapper;
[2260]166    vtkSmartPointer<vtkContourFilter> _contourFilter;
167    vtkSmartPointer<vtkPolyDataMapper> _contourMapper;
[3680]168    vtkSmartPointer<vtkGaussianSplatter> _splatter;
[2260]169    vtkSmartPointer<vtkExtractVOI> _volumeSlicer;
[2457]170    vtkSmartPointer<vtkPlane> _cutPlane;
[2260]171    vtkSmartPointer<vtkWarpScalar> _warp;
[3330]172    vtkSmartPointer<vtkPolyDataNormals> _normalsGenerator;
[2260]173    vtkSmartPointer<vtkActor> _dsActor;
174    vtkSmartPointer<vtkActor> _contourActor;
175};
176
177}
178
179#endif
Note: See TracBrowser for help on using the repository browser.