source: branches/nanovis2/packages/vizservers/vtkvis/RpPolygon.h @ 3175

Last change on this file since 3175 was 3175, 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) 2012, Purdue Research Foundation
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
19namespace Rappture {
20namespace VtkVis {
21
22/**
23 * \brief VTK PolyData regular n-sided polygon
24 *
25 * This class creates a regular n-sided polygon
26 */
27class Polygon : public Shape
28{
29public:
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
66private:
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.