source: vtkvis/trunk/ImageCutplane.h @ 6226

Last change on this file since 6226 was 4256, checked in by ldelgass, 11 years ago

Add resmapling of non-uniform datasets to imagecutplane. Note: would eventually
like to share the resampled dataset among multiple pipelines (e.g. for volumes
and cutplanes).

File size: 2.3 KB
Line 
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
25namespace 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 */
32class ImageCutplane : public GraphicsObject {
33public:
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
86private:
87    virtual void initProp();
88    virtual void update();
89
90    bool _pipelineInitialized;
91
92    ColorMap *_colorMap;
93    Renderer *_renderer;
94
95    vtkSmartPointer<vtkLookupTable> _lut;
96    vtkSmartPointer<vtkImageSlice> _actor[3];
97    vtkSmartPointer<vtkActor> _borderActor[3];
98    vtkSmartPointer<vtkImageResliceMapper> _mapper[3];
99    vtkSmartPointer<vtkPolyDataMapper> _borderMapper[3];
100    vtkSmartPointer<vtkPlane> _cutPlane[3];
101    vtkSmartPointer<vtkOutlineSource> _outlineSource[3];
102};
103
104}
105
106#endif
Note: See TracBrowser for help on using the repository browser.