source: vtkvis/trunk/Arc.cpp @ 5224

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

Use imroved Arc API (arc can only represent a circular section, and setting
two endpoints could cause problems with endpts and center colinear and radii
from center to two endpoints differing). New API uses a center, start point,
normal and sweep angle. Also change Line to support polylines: protocol is
changed to require a Tcl list for point coordinates instead of a fixed 2
endpoints.

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