source: trunk/packages/vizservers/vtkvis/RpContour3D.h @ 2973

Last change on this file since 2973 was 2612, checked in by ldelgass, 13 years ago

Refactor vtkvis to support setting colormap fields by name/attribute type
rather than always using active scalars/vectors. Also convert common
graphics objects set methods in Renderer to template methods and separate
core and graphics object related methods to separate files.

  • Property svn:eol-style set to native
File size: 1.6 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_CONTOUR3D_H__
9#define __RAPPTURE_VTKVIS_CONTOUR3D_H__
10
11#include <vtkSmartPointer.h>
12#include <vtkContourFilter.h>
13#include <vtkLookupTable.h>
14#include <vtkPolyDataMapper.h>
15#include <vtkActor.h>
16#include <vtkPlaneCollection.h>
17
18#include <vector>
19
20#include "ColorMap.h"
21#include "RpVtkGraphicsObject.h"
22
23namespace Rappture {
24namespace VtkVis {
25
26/**
27 * \brief 3D Contour isosurfaces (geometry)
28 */
29class Contour3D : public VtkGraphicsObject {
30public:
31    Contour3D(int numContours);
32
33    Contour3D(const std::vector<double>& contours);
34
35    virtual ~Contour3D();
36
37    virtual const char *getClassName() const
38    {
39        return "Contour3D";
40    }
41
42    virtual void setClippingPlanes(vtkPlaneCollection *planes);
43
44    void setContours(int numContours);
45
46    void setContourList(const std::vector<double>& contours);
47
48    int getNumContours() const;
49
50    const std::vector<double>& getContourList() const;
51
52    void setColorMap(ColorMap *colorMap);
53
54    /**
55     * \brief Return the ColorMap in use
56     */
57    ColorMap *getColorMap()
58    {
59        return _colorMap;
60    }
61
62    void updateColorMap();
63
64    virtual void updateRanges(Renderer *renderer);
65
66private:
67    Contour3D();
68
69    virtual void update();
70
71    int _numContours;
72    std::vector<double> _contours;
73    ColorMap *_colorMap;
74
75    vtkSmartPointer<vtkContourFilter> _contourFilter;
76    vtkSmartPointer<vtkLookupTable> _lut;
77    vtkSmartPointer<vtkPolyDataMapper> _contourMapper;
78};
79
80}
81}
82
83#endif
Note: See TracBrowser for help on using the repository browser.