11 #include <vtkVersion.h>
13 #include <vtkTubeFilter.h>
16 #include <vtkFloatArray.h>
17 #include <vtkProperty.h>
18 #include <vtkPolyData.h>
19 #include <vtkPolyDataMapper.h>
20 #include <vtkSmartPointer.h>
28 Axes (std::string name,
float size = 1.0) :
32 axes_->SetOrigin (0, 0, 0);
33 axes_->SetScaleFactor (size);
37 axes_colors->Allocate (6);
38 axes_colors->InsertNextValue (0.0);
39 axes_colors->InsertNextValue (0.0);
40 axes_colors->InsertNextValue (0.5);
41 axes_colors->InsertNextValue (0.5);
42 axes_colors->InsertNextValue (1.0);
43 axes_colors->InsertNextValue (1.0);
46 axes_data->GetPointData ()->SetScalars (axes_colors);
49 axes_tubes->SetInputData (axes_data);
50 axes_tubes->SetRadius (axes_->GetScaleFactor () / 100.0);
51 axes_tubes->SetNumberOfSides (6);
54 axes_mapper->SetScalarModeToUsePointData ();
55 axes_mapper->SetInputData (axes_tubes->GetOutput ());
58 axes_actor_->GetProperty ()->SetLighting (
false);
59 axes_actor_->SetMapper (axes_mapper);