source: branches/vtkvis_threaded/RpCutplane.h @ 2549

Last change on this file since 2549 was 2524, checked in by ldelgass, 13 years ago

Add cutplane files from trunk 2522

  • Property svn:eol-style set to native
File size: 2.4 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_CUTPLANE_H__
9#define __RAPPTURE_VTKVIS_CUTPLANE_H__
10
11#include <vtkSmartPointer.h>
12#include <vtkLookupTable.h>
13#include <vtkDataSetMapper.h>
14#include <vtkActor.h>
15#include <vtkPlaneCollection.h>
16#include <vtkGaussianSplatter.h>
17#include <vtkExtractVOI.h>
18#include <vtkPlane.h>
19
20#include "ColorMap.h"
21#include "RpVtkGraphicsObject.h"
22
23namespace Rappture {
24namespace VtkVis {
25
26/**
27 * \brief Color-mapped plot of slice through a data set
28 *
29 * Currently the DataSet must be image data (2D uniform grid)
30 */
31class Cutplane : public VtkGraphicsObject {
32public:
33    enum Axis {
34        X_AXIS,
35        Y_AXIS,
36        Z_AXIS
37    };
38    enum ColorMode {
39        COLOR_BY_SCALAR,
40        COLOR_BY_VECTOR_MAGNITUDE,
41        COLOR_BY_VECTOR_X,
42        COLOR_BY_VECTOR_Y,
43        COLOR_BY_VECTOR_Z
44    };
45
46    Cutplane();
47    virtual ~Cutplane();
48
49    virtual const char *getClassName() const
50    {
51        return "Cutplane";
52    }
53
54    virtual void setDataSet(DataSet *dataSet,
55                            bool useCumulative,
56                            double scalarRange[2],
57                            double vectorMagnitudeRange[2],
58                            double vectorComponentRange[3][2]);
59
60    virtual void setClippingPlanes(vtkPlaneCollection *planes);
61
62    void selectVolumeSlice(Axis axis, double ratio);
63
64    void setColorMode(ColorMode mode);
65
66    void setColorMap(ColorMap *colorMap);
67
68    /**
69     * \brief Return the ColorMap in use
70     */
71    ColorMap *getColorMap()
72    {
73        return _colorMap;
74    }
75
76    void updateColorMap();
77
78    virtual void updateRanges(bool useCumulative,
79                              double scalarRange[2],
80                              double vectorMagnitudeRange[2],
81                              double vectorComponentRange[3][2]);
82
83private:
84    virtual void update();
85
86    ColorMode _colorMode;
87    ColorMap *_colorMap;
88    Axis _sliceAxis;
89    double _vectorMagnitudeRange[2];
90    double _vectorComponentRange[3][2];
91
92    vtkSmartPointer<vtkLookupTable> _lut;
93    vtkSmartPointer<vtkDataSetMapper> _mapper;
94    vtkSmartPointer<vtkGaussianSplatter> _pointSplatter;
95    vtkSmartPointer<vtkExtractVOI> _volumeSlicer;
96    vtkSmartPointer<vtkPlane> _cutPlane;
97};
98
99}
100}
101
102#endif
Note: See TracBrowser for help on using the repository browser.