Last change
on this file since 3177 was
3177,
checked in by mmc, 12 years ago
|
Updated all of the copyright notices to reference the transfer to
the new HUBzero Foundation, LLC.
|
-
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 __RAPPTURE_VTKVIS_CYLINDER_H__ |
---|
9 | #define __RAPPTURE_VTKVIS_CYLINDER_H__ |
---|
10 | |
---|
11 | #include <vtkSmartPointer.h> |
---|
12 | #include <vtkPolyDataMapper.h> |
---|
13 | #include <vtkActor.h> |
---|
14 | #include <vtkCylinderSource.h> |
---|
15 | |
---|
16 | #include "RpShape.h" |
---|
17 | #include "RpVtkDataSet.h" |
---|
18 | |
---|
19 | namespace Rappture { |
---|
20 | namespace VtkVis { |
---|
21 | |
---|
22 | /** |
---|
23 | * \brief VTK PolyData cylinder |
---|
24 | * |
---|
25 | * This class creates a mesh cylinder |
---|
26 | */ |
---|
27 | class Cylinder : public Shape |
---|
28 | { |
---|
29 | public: |
---|
30 | Cylinder(); |
---|
31 | virtual ~Cylinder(); |
---|
32 | |
---|
33 | virtual const char *getClassName() const |
---|
34 | { |
---|
35 | return "Cylinder"; |
---|
36 | } |
---|
37 | |
---|
38 | void setCenter(double center[3]) |
---|
39 | { |
---|
40 | if (_cylinder != NULL) { |
---|
41 | _cylinder->SetCenter(center); |
---|
42 | } |
---|
43 | } |
---|
44 | |
---|
45 | void setHeight(double height) |
---|
46 | { |
---|
47 | if (_cylinder != NULL) { |
---|
48 | _cylinder->SetHeight(height); |
---|
49 | } |
---|
50 | } |
---|
51 | |
---|
52 | void setRadius(double radius) |
---|
53 | { |
---|
54 | if (_cylinder != NULL) { |
---|
55 | _cylinder->SetRadius(radius); |
---|
56 | } |
---|
57 | } |
---|
58 | |
---|
59 | void setResolution(int res) |
---|
60 | { |
---|
61 | if (_cylinder != NULL) { |
---|
62 | _cylinder->SetResolution(res); |
---|
63 | } |
---|
64 | } |
---|
65 | |
---|
66 | void setCapping(bool state) |
---|
67 | { |
---|
68 | if (_cylinder != NULL) { |
---|
69 | _cylinder->SetCapping(state ? 1 : 0); |
---|
70 | } |
---|
71 | } |
---|
72 | |
---|
73 | private: |
---|
74 | virtual void update(); |
---|
75 | |
---|
76 | vtkSmartPointer<vtkCylinderSource> _cylinder; |
---|
77 | }; |
---|
78 | |
---|
79 | } |
---|
80 | } |
---|
81 | |
---|
82 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.