source: branches/nanovis2/packages/vizservers/vtkvis/RpPolygon.cpp @ 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: 909 bytes
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#include <vtkPolyDataMapper.h>
9#include <vtkActor.h>
10#include <vtkRegularPolygonSource.h>
11
12#include "RpPolygon.h"
13#include "Trace.h"
14
15using namespace Rappture::VtkVis;
16
17Polygon::Polygon() :
18    Shape()
19{
20}
21
22Polygon::~Polygon()
23{
24    TRACE("Deleting Polygon");
25}
26
27void Polygon::update()
28{
29    if (_polygon == NULL) {
30        _polygon = vtkSmartPointer<vtkRegularPolygonSource>::New();
31    }
32
33    if (_pdMapper == NULL) {
34        _pdMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
35        _pdMapper->SetResolveCoincidentTopologyToPolygonOffset();
36        _pdMapper->ScalarVisibilityOff();
37    }
38
39    _pdMapper->SetInputConnection(_polygon->GetOutputPort());
40
41    initProp();
42
43    getActor()->SetMapper(_pdMapper);
44    _pdMapper->Update();
45}
Note: See TracBrowser for help on using the repository browser.