Last change
on this file since 4059 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.3 KB
|
Rev | Line | |
---|
[3154] | 1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
| 2 | /* |
---|
[3177] | 3 | * Copyright (C) 2004-2012 HUBzero Foundation, LLC |
---|
[3154] | 4 | * |
---|
| 5 | * Author: Leif Delgass <ldelgass@purdue.edu> |
---|
| 6 | */ |
---|
| 7 | |
---|
[3615] | 8 | #ifndef VTKVIS_POLYGON_H |
---|
| 9 | #define VTKVIS_POLYGON_H_ |
---|
[3154] | 10 | |
---|
| 11 | #include <vtkSmartPointer.h> |
---|
| 12 | #include <vtkPolyDataMapper.h> |
---|
| 13 | #include <vtkActor.h> |
---|
| 14 | #include <vtkRegularPolygonSource.h> |
---|
| 15 | |
---|
[3616] | 16 | #include "Shape.h" |
---|
[3621] | 17 | #include "DataSet.h" |
---|
[3154] | 18 | |
---|
| 19 | namespace VtkVis { |
---|
| 20 | |
---|
| 21 | /** |
---|
| 22 | * \brief VTK PolyData regular n-sided polygon |
---|
| 23 | * |
---|
| 24 | * This class creates a regular n-sided polygon |
---|
| 25 | */ |
---|
| 26 | class Polygon : public Shape |
---|
| 27 | { |
---|
| 28 | public: |
---|
| 29 | Polygon(); |
---|
| 30 | virtual ~Polygon(); |
---|
| 31 | |
---|
| 32 | virtual const char *getClassName() const |
---|
| 33 | { |
---|
| 34 | return "Polygon"; |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | void setNumberOfSides(int numSides) |
---|
| 38 | { |
---|
| 39 | if (_polygon != NULL) { |
---|
| 40 | _polygon->SetNumberOfSides(numSides); |
---|
| 41 | } |
---|
| 42 | } |
---|
| 43 | |
---|
| 44 | void setCenter(double center[3]) |
---|
| 45 | { |
---|
| 46 | if (_polygon != NULL) { |
---|
| 47 | _polygon->SetCenter(center); |
---|
| 48 | } |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | void setNormal(double normal[3]) |
---|
| 52 | { |
---|
| 53 | if (_polygon != NULL) { |
---|
| 54 | _polygon->SetNormal(normal); |
---|
| 55 | } |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | void setRadius(double radius) |
---|
| 59 | { |
---|
| 60 | if (_polygon != NULL) { |
---|
| 61 | _polygon->SetRadius(radius); |
---|
| 62 | } |
---|
| 63 | } |
---|
| 64 | |
---|
[3683] | 65 | void flipNormals(bool state); |
---|
| 66 | |
---|
[3154] | 67 | private: |
---|
| 68 | virtual void update(); |
---|
| 69 | |
---|
| 70 | vtkSmartPointer<vtkRegularPolygonSource> _polygon; |
---|
| 71 | }; |
---|
| 72 | |
---|
| 73 | } |
---|
| 74 | |
---|
| 75 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.