source: branches/nanovis2/packages/vizservers/vtkvis/RpArrow.h @ 3305

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

sync with trunk

  • 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 __RAPPTURE_VTKVIS_ARROW_H__
9#define __RAPPTURE_VTKVIS_ARROW_H__
10
11#include <vtkSmartPointer.h>
12#include <vtkPolyDataMapper.h>
13#include <vtkActor.h>
14#include <vtkArrowSource.h>
15
16#include "RpShape.h"
17#include "RpVtkDataSet.h"
18
19namespace Rappture {
20namespace VtkVis {
21
22/**
23 * \brief VTK PolyData 3D Arrow
24 *
25 * This class creates a mesh arrow
26 */
27class Arrow : public Shape
28{
29public:
30    Arrow();
31    virtual ~Arrow();
32
33    virtual const char *getClassName() const
34    {
35        return "Arrow";
36    }
37
38    void setTipLength(double len)
39    {
40        if (_arrow != NULL) {
41            _arrow->SetTipLength(len);
42        }
43    }
44
45    void setRadii(double tipRadius, double shaftRadius)
46    {
47        if (_arrow != NULL) {
48            _arrow->SetTipRadius(tipRadius);
49            _arrow->SetShaftRadius(shaftRadius);
50        }
51    }
52
53    void setResolution(int tipRes, int shaftRes)
54    {
55        if (_arrow != NULL) {
56            _arrow->SetTipResolution(tipRes);
57            _arrow->SetShaftResolution(shaftRes);
58        }
59    }
60
61    void setInvert(bool state)
62    {
63        if (_arrow != NULL) {
64            _arrow->SetInvert(state);
65        }
66    }
67
68private:
69    virtual void update();
70
71    vtkSmartPointer<vtkArrowSource> _arrow;
72};
73
74}
75}
76
77#endif
Note: See TracBrowser for help on using the repository browser.