1 /*=========================================================================
2 
3   Program:   Visualization Toolkit
4   Module:    vtkHandleSource.cxx
5 
6   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7   All rights reserved.
8   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10      This software is distributed WITHOUT ANY WARRANTY; without even
11      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12      PURPOSE.  See the above copyright notice for more information.
13 
14 =========================================================================*/
15 #include "vtkHandleSource.h"
16 
17 //------------------------------------------------------------------------------
vtkHandleSource()18 vtkHandleSource::vtkHandleSource()
19 {
20   this->SetNumberOfInputPorts(0);
21 }
22 
23 //------------------------------------------------------------------------------
GetPosition(double pos[3])24 void vtkHandleSource::GetPosition(double pos[3])
25 {
26   for (int i = 0; i < 3; i++)
27   {
28     pos[i] = this->GetPosition()[i];
29   }
30 }
31 
32 //------------------------------------------------------------------------------
GetDirection(double dir[3])33 void vtkHandleSource::GetDirection(double dir[3])
34 {
35   for (int i = 0; i < 3; i++)
36   {
37     dir[i] = this->GetDirection()[i];
38   }
39 }
40 
41 //------------------------------------------------------------------------------
PrintSelf(ostream & os,vtkIndent indent)42 void vtkHandleSource::PrintSelf(ostream& os, vtkIndent indent)
43 {
44   this->Superclass::PrintSelf(os, indent);
45 
46   os << indent << "Directional: " << this->Directional << "\n";
47   os << indent << "Position: (" << this->GetPosition()[0] << ", " << this->GetPosition()[1] << ", "
48      << this->GetPosition()[2] << ")\n";
49 
50   if (this->Directional)
51   {
52     os << indent << "Direction: (" << this->GetDirection()[0] << ", " << this->GetDirection()[1]
53        << ", " << this->GetDirection()[2] << ")\n";
54   }
55   else
56   {
57     os << indent << "Direction: (none)\n";
58   }
59 
60   os << indent << "Size: " << this->GetSize() << "\n";
61 }
62