/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011, Purdue Research Foundation * * Author: Leif Delgass */ #ifndef __RAPPTURE_VTKVIS_HEIGHTMAP_H__ #define __RAPPTURE_VTKVIS_HEIGHTMAP_H__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ColorMap.h" #include "RpTypes.h" #include "RpVtkGraphicsObject.h" namespace Rappture { namespace VtkVis { /** * \brief Color-mapped plot of data set */ class HeightMap : public VtkGraphicsObject { public: HeightMap(int numContours, double heightScale = 1.0); HeightMap(const std::vector& contours, double heightScale = 1.0); virtual ~HeightMap(); virtual const char *getClassName() const { return "HeightMap"; } virtual void setDataSet(DataSet *dataSet, Renderer *renderer); virtual void setLighting(bool state); virtual void setEdgeVisibility(bool state); virtual void setEdgeColor(float color[3]); virtual void setEdgeWidth(float edgeWidth); virtual void setClippingPlanes(vtkPlaneCollection *planes); void selectVolumeSlice(Axis axis, double ratio); void setHeightScale(double scale); double getHeightScale() { return _warpScale; } void setNumContours(int numContours); void setContourList(const std::vector& contours); int getNumContours() const; const std::vector& getContourList() const; void setColorMap(ColorMap *colorMap); /** * \brief Return the ColorMap in use */ ColorMap *getColorMap() { return _colorMap; } void updateColorMap(); virtual void updateRanges(Renderer *renderer); void setContourLineVisibility(bool state); void setContourSurfaceVisibility(bool state); void setContourEdgeColor(float color[3]); void setContourEdgeWidth(float edgeWidth); private: HeightMap(); virtual void initProp(); virtual void update(); vtkAlgorithmOutput *initWarp(vtkAlgorithmOutput *input); vtkAlgorithmOutput *initWarp(vtkPolyData *input); int _numContours; std::vector _contours; ColorMap *_colorMap; float _contourEdgeColor[3]; float _contourEdgeWidth; double _warpScale; double _dataScale; Axis _sliceAxis; bool _pipelineInitialized; vtkSmartPointer _lut; vtkSmartPointer _dsMapper; vtkSmartPointer _contourFilter; vtkSmartPointer _contourMapper; vtkSmartPointer _pointSplatter; vtkSmartPointer _volumeSlicer; vtkSmartPointer _cutPlane; vtkSmartPointer _warp; vtkSmartPointer _dsActor; vtkSmartPointer _contourActor; }; } } #endif