source: vtkvis/branches/1.7/Volume.h @ 4777

Last change on this file since 4777 was 4608, checked in by ldelgass, 10 years ago

Merge r4243 from trunk: resampling non-uniform grids for volumes

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright (C) 2004-2012  HUBzero Foundation, LLC
4 *
5 * Author: Leif Delgass <ldelgass@purdue.edu>
6 */
7
8#ifndef VTKVIS_VOLUME_H
9#define VTKVIS_VOLUME_H
10
11#include <vtkSmartPointer.h>
12#include <vtkProp.h>
13#include <vtkVolume.h>
14#include <vtkAbstractVolumeMapper.h>
15#include <vtkPlaneCollection.h>
16
17#include "GraphicsObject.h"
18#include "ColorMap.h"
19
20namespace VtkVis {
21
22/**
23 * \brief Volume Rendering
24 *
25 * Currently the DataSet must be image data (3D uniform grid),
26 * or an UnstructuredGrid
27 */
28class Volume : public GraphicsObject {
29public:
30    enum BlendMode {
31        BLEND_COMPOSITE = 0,
32        BLEND_MAX_INTENSITY,
33        BLEND_MIN_INTENSITY,
34        BLEND_ADDITIVE
35    };
36
37    Volume();
38    virtual ~Volume();
39
40    virtual const char *getClassName() const
41    {
42        return "Volume";
43    }
44
45    void getSpacing(double spacing[3]);
46
47    double getAverageSpacing();
48
49    virtual void setOpacity(double opacity);
50
51    virtual void setClippingPlanes(vtkPlaneCollection *planes);
52
53    void setColorMap(ColorMap *cmap);
54
55    ColorMap *getColorMap();
56
57    void updateColorMap();
58
59    virtual void updateRanges(Renderer *renderer);
60
61    void setSampleDistance(float d);
62
63    void setBlendMode(BlendMode mode);
64
65private:
66    virtual void initProp();
67    virtual void update();
68
69    bool _useUgridMapper;
70
71    ColorMap *_colorMap;
72    vtkSmartPointer<vtkAbstractVolumeMapper> _volumeMapper;
73};
74
75}
76
77#endif
Note: See TracBrowser for help on using the repository browser.