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

Method CheckInputs

Rendering/Core/vtkLabeledContourMapper.cxx:456–518  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

454
455//------------------------------------------------------------------------------
456bool vtkLabeledContourMapper::CheckInputs(vtkRenderer* ren)
457{
458 vtkPolyData* input = this->GetInput();
459 if (!input)
460 {
461 vtkErrorMacro(<< "No input data!");
462 return false;
463 }
464
465 if (!input->GetPoints())
466 {
467 vtkErrorMacro(<< "No points in dataset!");
468 return false;
469 }
470
471 if (!input->GetPointData())
472 {
473 vtkErrorMacro(<< "No point data in dataset!");
474 return false;
475 }
476
477 vtkCellArray* lines = input->GetLines();
478 if (!lines)
479 {
480 vtkErrorMacro(<< "No lines in dataset!");
481 return false;
482 }
483
484 vtkDataArray* scalars = input->GetPointData()->GetScalars();
485 if (!scalars)
486 {
487 vtkErrorMacro(<< "No scalars in dataset!");
488 return false;
489 }
490
491 vtkTextRenderer* tren = vtkTextRenderer::GetInstance();
492 if (!tren)
493 {
494 vtkErrorMacro(<< "Text renderer unavailable.");
495 return false;
496 }
497
498 if (this->TextProperties->GetNumberOfItems() == 0)
499 {
500 vtkErrorMacro(<< "No text properties set!");
501 return false;
502 }
503
504 // Print a warning if stenciling is not enabled:
505 vtkRenderWindow* win = ren->GetRenderWindow();
506 if (!this->Internal->AlreadyWarnedAboutStencils && win)
507 {
508 if (win->GetStencilCapable() == 0)
509 {
510 vtkWarningMacro(<< "Stenciling is not enabled in the render window. "
511 "Isoline labels will have artifacts. To fix this, "
512 "call vtkRenderWindow::StencilCapableOn().");
513 this->Internal->AlreadyWarnedAboutStencils = true;

Callers 1

RenderMethod · 0.95

Calls 7

GetInputMethod · 0.95
GetPointsMethod · 0.45
GetPointDataMethod · 0.45
GetLinesMethod · 0.45
GetScalarsMethod · 0.45
GetNumberOfItemsMethod · 0.45
GetRenderWindowMethod · 0.45

Tested by

no test coverage detected