VTKFIG  0.20.20181114
Easy VTK based in situ visualization
void myplot0::RTBuildAllVTKPipelines ( vtkSmartPointer< vtkRenderer >  renderer)
inlinevirtual

Default implementation for 2D/3d datasets.

Reimplemented from vtkfig::Figure.

Definition at line 81 of file example-axis.cxx.

82  {
83  auto coordsys=vtkSmartPointer<CoordSystemActor>::New();
84  coordsys->SetUse2DMode(1);
85  coordsys->SetBounds(0,1,0.001,100,0,0);
86 // coordsys->SetYAxisRange(0,1);
87 
88  coordsys->SetXTitle("x");
89  coordsys->SetXUnits("cm");
90  coordsys->SetYTitle("y");
91 // coordsys->SetLogScaleY();
92 
93  // coordsys->SetScreenSize(0.1);
94  // coordsys->SetLabelOffset(2);
95 
96  coordsys->SetCamera(renderer->GetActiveCamera());
97 
98 
99 
100  Figure::RTAddActor(coordsys);
101 
102 
103 
104  auto polyLinePoints = vtkSmartPointer<vtkPoints>::New();
105  auto polyLine = vtkSmartPointer<vtkPolyLine>::New();
106  int N=100;
107  polyLinePoints->SetNumberOfPoints(N);
108  polyLine->GetPointIds()->SetNumberOfIds(N);
109 
110 
111  double x=0.0;
112  double h=1.0/N;
113  for (int i=0;i<N;i++,x+=h)
114  {
115  polyLinePoints->InsertPoint(i, x, exp(sin(10.0*x)), 0);
116  polyLine->GetPointIds()->SetId(i,i);
117  }
118 
119  auto polyLineGrid = vtkSmartPointer<vtkUnstructuredGrid>::New();
120  polyLineGrid->Allocate(1, 1);
121  polyLineGrid->InsertNextCell(polyLine->GetCellType(), polyLine->GetPointIds());
122  polyLineGrid->SetPoints(polyLinePoints);
123 
124  auto polyLineMapper = vtkSmartPointer<vtkDataSetMapper>::New();
125  polyLineMapper->SetInputData(polyLineGrid);
126 
127  auto polyLineActor =vtkSmartPointer<vtkActor>::New();
128  polyLineActor->SetMapper(polyLineMapper);
129  polyLineActor->GetProperty()->SetColor(1,0,0);
130  polyLineActor->GetProperty()->SetLineWidth(2.5);
131  polyLineActor->GetProperty()->BackfaceCullingOn();
132 
133  Figure::RTAddActor(polyLineActor);
134 
135  auto lbox=vtkSmartPointer<vtkLegendBoxActor>::New();
136 
137  }