Duck typing interface allowing to handle different VTK datatypes with the same code.
833 auto geometry=vtkSmartPointer<vtkDataSetSurfaceFilter>::New();
834 geometry->SetInputConnection(
data_producer->GetOutputPort());
836 auto transgeometry=vtkSmartPointer<vtkTransformFilter>::New();
837 transgeometry->SetInputConnection(geometry->GetOutputPort());
842 if (
state.show_domain_boundary &&
state.spacedim==3)
844 vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
845 mapper->SetInputConnection(transgeometry->GetOutputPort());
846 splot=vtkSmartPointer<vtkActor>::New();
847 if (
state.spacedim==3)
849 splot->GetProperty()->SetOpacity(
state.domain_opacity);
850 splot->GetProperty()->SetColor(
state.domain_surface_color);
854 splot->GetProperty()->SetOpacity(1.0);
855 splot->GetProperty()->SetColor(0,0,0);
858 splot->SetMapper(mapper);
863 if (
state.show_domain_box&&
state.spacedim==3)
866 vtkSmartPointer<vtkOutlineFilter>outlinefilter = vtkSmartPointer<vtkOutlineFilter>::New();
867 outlinefilter->SetInputConnection(transgeometry->GetOutputPort());
868 vtkSmartPointer<vtkPolyDataMapper> outlineMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
869 outlineMapper->SetInputConnection(outlinefilter->GetOutputPort());
870 outline = vtkSmartPointer<vtkActor>::New();
871 outline->SetMapper(outlineMapper);
872 outline->GetProperty()->SetColor(0, 0, 0);
877 if (
state.show_domain_axes)
879 axes=vtkSmartPointer<vtkCubeAxesActor2D>::New();
880 double unscaled_data_bounds[6];
881 unscaled_data_bounds[0]=
data_bounds[0]/this->
state.coordinate_scale_factor_xyz[0];
882 unscaled_data_bounds[1]=
data_bounds[1]/this->
state.coordinate_scale_factor_xyz[0];
883 unscaled_data_bounds[2]=
data_bounds[2]/this->
state.coordinate_scale_factor_xyz[1];
884 unscaled_data_bounds[3]=
data_bounds[3]/this->
state.coordinate_scale_factor_xyz[1];
885 unscaled_data_bounds[4]=
data_bounds[4]/this->
state.coordinate_scale_factor_xyz[2];
886 unscaled_data_bounds[5]=
data_bounds[5]/this->
state.coordinate_scale_factor_xyz[2];
887 axes->SetRanges(unscaled_data_bounds);
888 axes->SetUseRanges(1);
889 axes->SetInputConnection(transgeometry->GetOutputPort());
890 axes->GetProperty()->SetColor(0, 0, 0);
891 axes->SetFontFactor(1.5);
892 axes->SetCornerOffset(0);
893 axes->SetNumberOfLabels(3);
894 axes->SetInertia(100);
895 axes->SetLabelFormat(
"%6.2g");
898 axes->SetCamera(renderer->GetActiveCamera());
900 if (
state.spacedim==2)
904 axes->ZAxisVisibilityOff();
908 axes->SetXLabel(
"x");
909 axes->SetYLabel(
"y");
910 axes->SetZLabel(
"z");
912 auto textprop=
axes->GetAxisLabelTextProperty();
913 textprop->ItalicOff();
915 textprop->SetFontFamilyToCourier();
916 textprop->SetColor(0,0,0);
918 textprop=
axes->GetAxisTitleTextProperty();
919 textprop->ItalicOff();
921 textprop->SetFontFamilyToCourier();
922 textprop->SetColor(0,0,0);