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

Method PlaceAxes

Rendering/Annotation/vtkSpiderPlotActor.cxx:411–791  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

409#define VTK_RING_PTS 64
410//------------------------------------------------------------------------------
411int vtkSpiderPlotActor::PlaceAxes(vtkViewport* viewport, const int* vtkNotUsed(size))
412{
413 vtkIdType i, j, k;
414 vtkDataObject* input = this->GetInput();
415 vtkFieldData* field = input->GetFieldData();
416 double v = 0.0;
417
418 this->Initialize();
419
420 if (!field)
421 {
422 return 0;
423 }
424
425 // Determine the shape of the field
426 int numComponents = field->GetNumberOfComponents(); // number of components
427 // Note: numComponents also includes the non-numeric arrays.
428
429 int numColumns = 0; // number of "columns" -- includes only numeric arrays.
430 vtkIdType numRows = VTK_ID_MAX; // figure out number of rows
431 vtkIdType numTuples;
432 vtkDataArray* array;
433 for (i = 0; i < field->GetNumberOfArrays(); i++)
434 {
435 array = field->GetArray(i);
436 if (!array)
437 {
438 // skip over non-numeric arrays.
439 continue;
440 }
441 numColumns += array->GetNumberOfComponents();
442 numTuples = array->GetNumberOfTuples();
443 numRows = std::min(numTuples, numRows);
444 }
445
446 // Determine the number of independent variables
447 if (this->IndependentVariables == VTK_IV_COLUMN)
448 {
449 this->N = numColumns;
450 }
451 else // row
452 {
453 this->N = numRows;
454 }
455
456 if (this->N <= 0 || this->N >= VTK_ID_MAX)
457 {
458 this->N = 0;
459 vtkErrorMacro(<< "No field data to plot");
460 return 0;
461 }
462
463 // We need to loop over the field to determine the range of
464 // each independent variable.
465 this->Mins = new double[this->N];
466 this->Maxs = new double[this->N];
467 for (i = 0; i < this->N; i++)
468 {

Callers 1

BuildPlotMethod · 0.95

Calls 15

GetInputMethod · 0.95
InitializeMethod · 0.95
GetAxisLabelMethod · 0.95
vtkAxisRangeClass · 0.85
PiFunction · 0.85
AllocateEstimateMethod · 0.80
SetLinesMethod · 0.80
SetFontSizeMethod · 0.80
SetScalarsMethod · 0.80

Tested by

no test coverage detected