source: trunk/packages/vizservers/vtkvis/RpSphere.cpp @ 3492

Last change on this file since 3492 was 3177, checked in by mmc, 12 years ago

Updated all of the copyright notices to reference the transfer to
the new HUBzero Foundation, LLC.

  • Property svn:eol-style set to native
File size: 1005 bytes
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#include <cassert>
9
10#include <vtkDataSet.h>
11#include <vtkPolyData.h>
12#include <vtkPolyDataMapper.h>
13#include <vtkActor.h>
14#include <vtkProperty.h>
15#include <vtkTransform.h>
16#include <vtkSphereSource.h>
17
18#include "RpSphere.h"
19#include "Trace.h"
20
21using namespace Rappture::VtkVis;
22
23Sphere::Sphere() :
24    Shape()
25{
26}
27
28Sphere::~Sphere()
29{
30    TRACE("Deleting Sphere");
31}
32
33void Sphere::update()
34{
35    if (_sphere == NULL) {
36        _sphere = vtkSmartPointer<vtkSphereSource>::New();
37    }
38
39    if (_pdMapper == NULL) {
40        _pdMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
41        _pdMapper->SetResolveCoincidentTopologyToPolygonOffset();
42        _pdMapper->ScalarVisibilityOff();
43    }
44
45    _pdMapper->SetInputConnection(_sphere->GetOutputPort());
46
47    initProp();
48
49    getActor()->SetMapper(_pdMapper);
50    _pdMapper->Update();
51}
Note: See TracBrowser for help on using the repository browser.