MCPcopy Create free account
hub / github.com/Kitware/VTK / BuildPlot

Method BuildPlot

Rendering/Annotation/vtkSpiderPlotActor.cxx:324–387  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

322
323//------------------------------------------------------------------------------
324int vtkSpiderPlotActor::BuildPlot(vtkViewport* viewport)
325{
326 // Initialize
327 vtkDebugMacro(<< "Building spider plot");
328
329 // Make sure input is up to date, and that the data is the correct shape to
330 // plot.
331 if (!this->GetInput())
332 {
333 vtkErrorMacro(<< "Nothing to plot!");
334 return 0;
335 }
336
337 if (!this->TitleTextProperty)
338 {
339 vtkErrorMacro(<< "Need title text property to render plot");
340 return 0;
341 }
342 if (!this->LabelTextProperty)
343 {
344 vtkErrorMacro(<< "Need label text property to render plot");
345 return 0;
346 }
347
348 // Viewport change may not require rebuild
349 int positionsHaveChanged = 0;
350 if (viewport->GetMTime() > this->BuildTime ||
351 (viewport->GetVTKWindow() && viewport->GetVTKWindow()->GetMTime() > this->BuildTime))
352 {
353 int* lastPosition = this->PositionCoordinate->GetComputedViewportValue(viewport);
354 int* lastPosition2 = this->Position2Coordinate->GetComputedViewportValue(viewport);
355 if (lastPosition[0] != this->LastPosition[0] || lastPosition[1] != this->LastPosition[1] ||
356 lastPosition2[0] != this->LastPosition2[0] || lastPosition2[1] != this->LastPosition2[1])
357 {
358 this->LastPosition[0] = lastPosition[0];
359 this->LastPosition[1] = lastPosition[1];
360 this->LastPosition2[0] = lastPosition2[0];
361 this->LastPosition2[1] = lastPosition2[1];
362 positionsHaveChanged = 1;
363 }
364 }
365
366 // Check modified time to see whether we have to rebuild.
367 this->ConnectionHolder->GetInputAlgorithm()->Update();
368
369 if (positionsHaveChanged || this->GetMTime() > this->BuildTime ||
370 this->GetInput()->GetMTime() > this->BuildTime ||
371 this->LabelTextProperty->GetMTime() > this->BuildTime ||
372 this->TitleTextProperty->GetMTime() > this->BuildTime)
373 {
374 vtkDebugMacro(<< "Rebuilding plot");
375
376 // Build axes
377 const int* size = viewport->GetSize();
378 if (!this->PlaceAxes(viewport, size))
379 {
380 return 0;
381 }

Callers 2

RenderOverlayMethod · 0.95
RenderOpaqueGeometryMethod · 0.95

Calls 9

GetInputMethod · 0.95
PlaceAxesMethod · 0.95
GetVTKWindowMethod · 0.80
GetMTimeMethod · 0.45
UpdateMethod · 0.45
GetInputAlgorithmMethod · 0.45
GetSizeMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected