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) :
31 axes_->SetOrigin (0, 0, 0);
32 axes_->SetScaleFactor (size);
36 axes_colors->Allocate (6);
37 axes_colors->InsertNextValue (0.0);
38 axes_colors->InsertNextValue (0.0);
39 axes_colors->InsertNextValue (0.5);
40 axes_colors->InsertNextValue (0.5);
41 axes_colors->InsertNextValue (1.0);
42 axes_colors->InsertNextValue (1.0);
45 axes_data->GetPointData ()->SetScalars (axes_colors);
48 axes_tubes->SetInputData (axes_data);
49 axes_tubes->SetRadius (axes_->GetScaleFactor () / 100.0);
50 axes_tubes->SetNumberOfSides (6);
53 axes_mapper->SetScalarModeToUsePointData ();
54 axes_mapper->SetInputData (axes_tubes->GetOutput ());
57 axes_actor_->GetProperty ()->SetLighting (
false);
58 axes_actor_->SetMapper (axes_mapper);
vtkSmartPointer< vtkAxes > getAxes() const
vtkSmartPointer< vtkActor > getAxesActor() const
Axes(std::string name, float size=1.0)
void addActor(vtkActor *actor)