source: trunk/packages/vizservers/vtkvis/Volume.h @ 3961

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

Add volume blendmode option for VTK volume renderer. Also, don't change field
active scalar if requested field not found in dataset (previously, active
scalar field would be cleared to NULL if field not found).

  • 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    ColorMap *_colorMap;
70    vtkSmartPointer<vtkAbstractVolumeMapper> _volumeMapper;
71};
72
73}
74
75#endif
Note: See TracBrowser for help on using the repository browser.