1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
2 | /* |
---|
3 | * Copyright (C) 2004-2013 HUBzero Foundation, LLC |
---|
4 | * |
---|
5 | * Author: Leif Delgass <ldelgass@purdue.edu> |
---|
6 | */ |
---|
7 | |
---|
8 | #ifndef VTKVIS_IMAGE_CUTPLANE_H |
---|
9 | #define VTKVIS_IMAGE_CUTPLANE_H |
---|
10 | |
---|
11 | #include <vtkSmartPointer.h> |
---|
12 | #include <vtkLookupTable.h> |
---|
13 | #include <vtkImageSlice.h> |
---|
14 | #include <vtkImageResliceMapper.h> |
---|
15 | #include <vtkPolyDataMapper.h> |
---|
16 | #include <vtkActor.h> |
---|
17 | #include <vtkPlaneCollection.h> |
---|
18 | #include <vtkPlane.h> |
---|
19 | #include <vtkOutlineSource.h> |
---|
20 | |
---|
21 | #include "ColorMap.h" |
---|
22 | #include "Types.h" |
---|
23 | #include "GraphicsObject.h" |
---|
24 | |
---|
25 | namespace VtkVis { |
---|
26 | |
---|
27 | /** |
---|
28 | * \brief Color-mapped plot of orthogonal slices through a data set |
---|
29 | * |
---|
30 | * The DataSet must be image data (3D uniform grid) |
---|
31 | */ |
---|
32 | class ImageCutplane : public GraphicsObject { |
---|
33 | public: |
---|
34 | enum InterpType { |
---|
35 | INTERP_NEAREST, |
---|
36 | INTERP_LINEAR, |
---|
37 | INTERP_CUBIC |
---|
38 | }; |
---|
39 | |
---|
40 | ImageCutplane(); |
---|
41 | virtual ~ImageCutplane(); |
---|
42 | |
---|
43 | virtual const char *getClassName() const |
---|
44 | { |
---|
45 | return "ImageCutplane"; |
---|
46 | } |
---|
47 | |
---|
48 | virtual void setColor(float color[3]); |
---|
49 | |
---|
50 | virtual void setAmbient(double ambient); |
---|
51 | |
---|
52 | virtual void setDiffuse(double diffuse); |
---|
53 | |
---|
54 | virtual void setOpacity(double opacity); |
---|
55 | |
---|
56 | virtual void setClippingPlanes(vtkPlaneCollection *planes); |
---|
57 | |
---|
58 | void setColorMap(ColorMap *colorMap); |
---|
59 | |
---|
60 | void setUseWindowLevel(bool state); |
---|
61 | |
---|
62 | void setWindow(double window); |
---|
63 | |
---|
64 | void setLevel(double level); |
---|
65 | |
---|
66 | void setOutlineVisibility(bool state); |
---|
67 | |
---|
68 | void selectVolumeSlice(Axis axis, double ratio); |
---|
69 | |
---|
70 | void setSliceVisibility(Axis axis, bool state); |
---|
71 | |
---|
72 | void setInterpolationType(InterpType type); |
---|
73 | |
---|
74 | /** |
---|
75 | * \brief Return the ColorMap in use |
---|
76 | */ |
---|
77 | ColorMap *getColorMap() |
---|
78 | { |
---|
79 | return _colorMap; |
---|
80 | } |
---|
81 | |
---|
82 | void updateColorMap(); |
---|
83 | |
---|
84 | virtual void updateRanges(Renderer *renderer); |
---|
85 | |
---|
86 | private: |
---|
87 | virtual void initProp(); |
---|
88 | virtual void update(); |
---|
89 | |
---|
90 | ColorMap *_colorMap; |
---|
91 | Renderer *_renderer; |
---|
92 | |
---|
93 | vtkSmartPointer<vtkLookupTable> _lut; |
---|
94 | vtkSmartPointer<vtkImageSlice> _actor[3]; |
---|
95 | vtkSmartPointer<vtkActor> _borderActor[3]; |
---|
96 | vtkSmartPointer<vtkImageResliceMapper> _mapper[3]; |
---|
97 | vtkSmartPointer<vtkPolyDataMapper> _borderMapper[3]; |
---|
98 | vtkSmartPointer<vtkPlane> _cutPlane[3]; |
---|
99 | vtkSmartPointer<vtkOutlineSource> _outlineSource[3]; |
---|
100 | }; |
---|
101 | |
---|
102 | } |
---|
103 | |
---|
104 | #endif |
---|