2 #include <vtkProperty.h> 3 #include <vtkTextProperty.h> 4 #include <vtkOutlineFilter.h> 5 #include <vtkStructuredGridGeometryFilter.h> 6 #include <vtkAxesActor.h> 7 #include <vtkCaptionActor2D.h> 17 RGBTable surface_rgb={{0,0,0,1},{1,1,0,0}};
19 warp = vtkSmartPointer<vtkWarpScalar>::New();
20 gridfunc= vtkSmartPointer<vtkStructuredGrid>::New();
31 vtkSmartPointer<vtkStructuredGridGeometryFilter>geometry =
32 vtkSmartPointer<vtkStructuredGridGeometryFilter>::New();
33 geometry->SetInputDataObject(
gridfunc);
38 warp->SetInputConnection(geometry->GetOutputPort());
42 vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
44 mapper->SetInputConnection(
warp->GetOutputPort());
46 mapper->SetInputConnection(geometry->GetOutputPort());
50 vtkSmartPointer<vtkActor> surfplot = vtkSmartPointer<vtkActor>::New();
51 surfplot->SetMapper(mapper);
52 mapper->SetLookupTable(
lut);
53 mapper->UseLookupTableScalarRangeOn();
57 vtkSmartPointer<vtkOutlineFilter> outlinefilter = vtkSmartPointer<vtkOutlineFilter>::New();
59 outlinefilter->SetInputConnection(
warp->GetOutputPort());
61 outlinefilter->SetInputConnection(geometry->GetOutputPort());
63 vtkSmartPointer<vtkPolyDataMapper>outlineMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
64 outlineMapper->SetInputConnection(outlinefilter->GetOutputPort());
65 vtkSmartPointer<vtkActor>
outline = vtkSmartPointer<vtkActor>::New();
66 outline->SetMapper(outlineMapper);
67 outline->GetProperty()->SetColor(0, 0, 0);
70 vtkSmartPointer<vtkAxesActor>
axes = vtkSmartPointer<vtkAxesActor>::New();
71 axes->SetShaftTypeToCylinder();
72 axes->SetNormalizedShaftLength( 0.85, 0.85, 0.85);
73 axes->SetNormalizedTipLength( 0.15, 0.15, 0.15);
74 axes->SetCylinderRadius( 0.500 * axes->GetCylinderRadius() );
75 axes->SetConeRadius( 1.025 * axes->GetConeRadius() );
76 axes->SetSphereRadius( 1.500 * axes->GetSphereRadius() );
77 vtkSmartPointer<vtkTextProperty> text_prop_ax = axes->GetXAxisCaptionActor2D()->
78 GetCaptionTextProperty();
79 text_prop_ax->SetColor(0.0, 0.0, 0.0);
80 text_prop_ax->SetFontFamilyToArial();
81 text_prop_ax->SetFontSize(8);
82 axes->GetYAxisCaptionActor2D()->SetCaptionTextProperty(text_prop_ax);
83 axes->GetZAxisCaptionActor2D()->SetCaptionTextProperty(text_prop_ax);
void RTBuildVTKPipeline() override final
All functions prefixed with "RT" shall be called only from render thread.
vtkSmartPointer< vtkWarpScalar > warp
vtkSmartPointer< vtkStructuredGrid > gridfunc
vtkSmartPointer< vtkLookupTable > BuildLookupTable(RGBTable &xrgb, size_t size)
vtkSmartPointer< vtkLookupTable > lut
std::vector< RGBPoint > RGBTable
vtkSmartPointer< vtkScalarBarActor > BuildColorBar(vtkSmartPointer< vtkPolyDataMapper > mapper, int irank=0)