VTKFIG  0.20.20181114
Easy VTK based in situ visualization
void vtkfig::XYPlot::RTBuildAllVTKPipelines ( vtkSmartPointer< vtkRenderer >  renderer)
finaloverrideprivatevirtual

Build vtk.

Reimplemented from vtkfig::Figure.

Definition at line 182 of file vtkfigXYPlot.cxx.

183  {
184 
185  XYPlotActor->GetProperty()->SetColor(PlotState.axes_rgb);
186  XYPlotActor->SetBorder(20);
187  XYPlotActor->GetPositionCoordinate()->SetValue(0.0, 0.0, 0);
188  XYPlotActor->GetPosition2Coordinate()->SetValue(1.0, 1.0, 0);
189 
190 
191  if (PlotState.adjust_labels)
192  {
193  XYPlotActor->SetAdjustXLabels(1);
194  XYPlotActor->SetAdjustYLabels(1);
195  }
196  else
197  {
198  XYPlotActor->SetAdjustXLabels(0);
199  XYPlotActor->SetAdjustYLabels(0);
200  }
201 
202  // We build our own legened box which is
203  // not cluttered with grid lines
204  // XYPlotActor->LegendOn();
205  // XYPlotActor->SetLegendBox(1);
206  // XYPlotActor->SetLegendBorder(1);
207 
208 
209  XYPlotActor->PlotPointsOff();
210  XYPlotActor->PlotLinesOn();
211  XYPlotActor->PlotCurvePointsOn();
212  XYPlotActor->PlotCurveLinesOn();
213 
214 
215 
216  XYPlotActor->SetNumberOfXLabels(PlotState.nxlabels);
217  XYPlotActor->SetNumberOfYLabels(PlotState.nylabels);
218  XYPlotActor->SetNumberOfXMinorTicks(10);
219  XYPlotActor->SetNumberOfYMinorTicks(10);
220 
221 
222 
223  int fs=30;
224  XYPlotActor->SetTitleFontSize(fs);
225  XYPlotActor->SetTitleShadow(0);
226  XYPlotActor->SetTitleItalic(0);
227  XYPlotActor->SetTitleBold(1);
228  XYPlotActor->SetTitleColor(0,0,0);
229 
230  XYPlotActor->SetAdjustTitlePosition(0);
231  XYPlotActor->SetTitlePosition(0.5,0.95);
232 
233 
234  XYPlotActor->SetAxisTitleFontSize(fs);
235  XYPlotActor->SetAxisTitleItalic(0);
236  XYPlotActor->SetAxisTitleShadow(0);
237  XYPlotActor->SetAxisTitleBold(1);
238  XYPlotActor->SetAxisTitleColor(0,0,0);
239 
240  XYPlotActor->SetAxisLabelFontSize(fs);
241  XYPlotActor->SetAxisLabelShadow(0);
242  XYPlotActor->SetAxisLabelItalic(0);
243  XYPlotActor->SetAxisLabelColor(0,0,0);
244  XYPlotActor->SetYTitlePositionToVCenter();
245 
246 
247 
248  XYPlotActor->SetXValuesToValue();
250 
251 
252  if (PlotState.legend_show)
253  {
254  this->LegendActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
255  this->LegendActor->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();
256  this->LegendActor->GetPosition2Coordinate()->SetReferenceCoordinate( NULL );
257 
258 
259  this->LegendActor->SetPosition(PlotState.legend_posx,PlotState.legend_posy);
260  this->LegendActor->SetPosition2(
261  PlotState.legend_posx+PlotState.legend_w,
262  PlotState.legend_posy+PlotState.legend_h);
263  this->LegendActor->SetBorder(true);
264  this->LegendActor->SetBox(true);
265  LegendActor->GetProperty()->DeepCopy(XYPlotActor->GetProperty());
266  LegendActor->ScalarVisibilityOff();
267  auto text_prop = LegendActor->GetEntryTextProperty();
268  text_prop->ItalicOff();
269  text_prop->SetFontFamilyToArial();
270  text_prop->SetFontSize(fs);
271 
272 
274  }
275 
276  }
void RTAddActor2D(vtkSmartPointer< vtkActor2D > prop)
Add vtk Actor to renderer showing figure.
struct vtkfig::XYPlot::@4 PlotState
General state of the XYPlot.
vtkSmartPointer< vtkXYPlotActor > XYPlotActor
The main graphics actor.
Definition: vtkfigXYPlot.h:175
vtkSmartPointer< vtkLegendBoxActor > LegendActor
We create our own legend box.
Definition: vtkfigXYPlot.h:180

+ Here is the call graph for this function: