source: vtkvis/trunk/Cone.h @ 4591

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