source: vtkvis/trunk/Cylinder.h @ 4640

Last change on this file since 4640 was 3680, checked in by ldelgass, 11 years ago

Improved cloud support in vtkvis: handle ugrids with no cells as well as
polydata clouds, add cloudstyle options to some graphics objects.

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