Last change
on this file since 4807 was
3683,
checked in by ldelgass, 11 years ago
|
Improvements to 3D shapes in vtkvis. Add preliminary, experimental grouping.
|
-
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_ARROW_H |
---|
9 | #define VTKVIS_ARROW_H |
---|
10 | |
---|
11 | #include <vtkSmartPointer.h> |
---|
12 | #include <vtkPolyDataMapper.h> |
---|
13 | #include <vtkActor.h> |
---|
14 | #include <vtkArrowSource.h> |
---|
15 | |
---|
16 | #include "Shape.h" |
---|
17 | #include "DataSet.h" |
---|
18 | |
---|
19 | namespace VtkVis { |
---|
20 | |
---|
21 | /** |
---|
22 | * \brief VTK PolyData 3D Arrow |
---|
23 | * |
---|
24 | * This class creates a mesh arrow |
---|
25 | */ |
---|
26 | class Arrow : public Shape |
---|
27 | { |
---|
28 | public: |
---|
29 | Arrow(); |
---|
30 | virtual ~Arrow(); |
---|
31 | |
---|
32 | virtual const char *getClassName() const |
---|
33 | { |
---|
34 | return "Arrow"; |
---|
35 | } |
---|
36 | |
---|
37 | void setTipLength(double len) |
---|
38 | { |
---|
39 | if (_arrow != NULL) { |
---|
40 | _arrow->SetTipLength(len); |
---|
41 | } |
---|
42 | } |
---|
43 | |
---|
44 | void setRadii(double tipRadius, double shaftRadius) |
---|
45 | { |
---|
46 | if (_arrow != NULL) { |
---|
47 | _arrow->SetTipRadius(tipRadius); |
---|
48 | _arrow->SetShaftRadius(shaftRadius); |
---|
49 | } |
---|
50 | } |
---|
51 | |
---|
52 | void setResolution(int tipRes, int shaftRes) |
---|
53 | { |
---|
54 | if (_arrow != NULL) { |
---|
55 | _arrow->SetTipResolution(tipRes); |
---|
56 | _arrow->SetShaftResolution(shaftRes); |
---|
57 | } |
---|
58 | } |
---|
59 | |
---|
60 | /** |
---|
61 | * \brief Invert head/tail of arrow |
---|
62 | */ |
---|
63 | void setInvert(bool state) |
---|
64 | { |
---|
65 | if (_arrow != NULL) { |
---|
66 | _arrow->SetInvert(state); |
---|
67 | } |
---|
68 | } |
---|
69 | |
---|
70 | void flipNormals(bool state); |
---|
71 | |
---|
72 | private: |
---|
73 | virtual void update(); |
---|
74 | |
---|
75 | vtkSmartPointer<vtkArrowSource> _arrow; |
---|
76 | }; |
---|
77 | |
---|
78 | } |
---|
79 | |
---|
80 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.