Last change
on this file since 3305 was
3305,
checked in by ldelgass, 12 years ago
|
sync with trunk
|
-
Property svn:eol-style set to
native
|
File size:
1.3 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_POLYGON_H__ |
---|
9 | #define __RAPPTURE_VTKVIS_POLYGON_H__ |
---|
10 | |
---|
11 | #include <vtkSmartPointer.h> |
---|
12 | #include <vtkPolyDataMapper.h> |
---|
13 | #include <vtkActor.h> |
---|
14 | #include <vtkRegularPolygonSource.h> |
---|
15 | |
---|
16 | #include "RpShape.h" |
---|
17 | #include "RpVtkDataSet.h" |
---|
18 | |
---|
19 | namespace Rappture { |
---|
20 | namespace VtkVis { |
---|
21 | |
---|
22 | /** |
---|
23 | * \brief VTK PolyData regular n-sided polygon |
---|
24 | * |
---|
25 | * This class creates a regular n-sided polygon |
---|
26 | */ |
---|
27 | class Polygon : public Shape |
---|
28 | { |
---|
29 | public: |
---|
30 | Polygon(); |
---|
31 | virtual ~Polygon(); |
---|
32 | |
---|
33 | virtual const char *getClassName() const |
---|
34 | { |
---|
35 | return "Polygon"; |
---|
36 | } |
---|
37 | |
---|
38 | void setNumberOfSides(int numSides) |
---|
39 | { |
---|
40 | if (_polygon != NULL) { |
---|
41 | _polygon->SetNumberOfSides(numSides); |
---|
42 | } |
---|
43 | } |
---|
44 | |
---|
45 | void setCenter(double center[3]) |
---|
46 | { |
---|
47 | if (_polygon != NULL) { |
---|
48 | _polygon->SetCenter(center); |
---|
49 | } |
---|
50 | } |
---|
51 | |
---|
52 | void setNormal(double normal[3]) |
---|
53 | { |
---|
54 | if (_polygon != NULL) { |
---|
55 | _polygon->SetNormal(normal); |
---|
56 | } |
---|
57 | } |
---|
58 | |
---|
59 | void setRadius(double radius) |
---|
60 | { |
---|
61 | if (_polygon != NULL) { |
---|
62 | _polygon->SetRadius(radius); |
---|
63 | } |
---|
64 | } |
---|
65 | |
---|
66 | private: |
---|
67 | virtual void update(); |
---|
68 | |
---|
69 | vtkSmartPointer<vtkRegularPolygonSource> _polygon; |
---|
70 | }; |
---|
71 | |
---|
72 | } |
---|
73 | } |
---|
74 | |
---|
75 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.