source: trunk/packages/vizservers/vtkvis/RpGlyphs.h @ 2314

Last change on this file since 2314 was 2269, checked in by ldelgass, 13 years ago

Add glyphs command/object for rendering 3D glyph objects at all points in a
data set with scaling and color mapping. Useful for vector field hedgehogs
and general 3D scatter plots. Still need to deal with data ranges better and
add options for using vector mag. vs. components for scaling, etc.
Also compute point data when only cell data is present and point data is needed.
Probably this should be done in the DataSet? class instead to minimize
duplicating work.

  • Property svn:eol-style set to native
File size: 1.7 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_GLYPHS_H__
9#define __RAPPTURE_VTKVIS_GLYPHS_H__
10
11#include <vector>
12
13#include <vtkSmartPointer.h>
14#include <vtkProp.h>
15#include <vtkActor.h>
16#include <vtkGlyph3D.h>
17#include <vtkLookupTable.h>
18#include <vtkPlaneCollection.h>
19
20#include "RpVtkDataSet.h"
21#include "ColorMap.h"
22
23namespace Rappture {
24namespace VtkVis {
25
26/**
27 * \brief 3D Glyphs
28 */
29class Glyphs {
30public:
31    enum GlyphShape {
32        ARROW,
33        CONE,
34        CUBE,
35        CYLINDER,
36        DODECAHEDRON,
37        ICOSAHEDRON,
38        OCTAHEDRON,
39        SPHERE,
40        TETRAHEDRON
41    };
42
43    Glyphs();
44    virtual ~Glyphs();
45
46    void setDataSet(DataSet *dataset);
47
48    DataSet *getDataSet();
49
50    vtkProp *getProp();
51
52    void setGlyphShape(GlyphShape shape);
53
54    void setScaleFactor(double scale);
55
56    void setLookupTable(vtkLookupTable *lut);
57
58    vtkLookupTable *getLookupTable();
59
60    ColorMap *getColorMap();
61
62    void setOpacity(double opacity);
63
64    double getOpacity();
65
66    void setVisibility(bool state);
67
68    bool getVisibility();
69
70    void setClippingPlanes(vtkPlaneCollection *planes);
71
72    void setLighting(bool state);
73
74private:
75    void initProp();
76    void update();
77
78    DataSet *_dataSet;
79
80    double _opacity;
81    bool _lighting;
82
83    GlyphShape _glyphShape;
84    double _scaleFactor;
85
86    vtkSmartPointer<vtkLookupTable> _lut;
87    vtkSmartPointer<vtkActor> _prop;
88    vtkSmartPointer<vtkGlyph3D> _glyphGenerator;
89    vtkSmartPointer<vtkPolyDataAlgorithm> _glyphSource;
90    vtkSmartPointer<vtkPolyDataMapper> _pdMapper;
91};
92
93}
94}
95
96#endif
Note: See TracBrowser for help on using the repository browser.