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

Method RequestUpdateExtent

Filters/Extraction/vtkExtractRectilinearGrid.cxx:41–98  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

39
40//------------------------------------------------------------------------------
41int vtkExtractRectilinearGrid::RequestUpdateExtent(
42 vtkInformation*, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
43{
44 if (!this->Internal->IsValid())
45 {
46 return 0;
47 }
48
49 int i;
50 // get the info objects
51 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
52
53 bool emptyExtent = false;
54 int uExt[6];
55 for (i = 0; i < 3; i++)
56 {
57 if (this->Internal->GetSize(i) < 1)
58 {
59 uExt[0] = uExt[2] = uExt[4] = 0;
60 uExt[1] = uExt[3] = uExt[5] = -1;
61 emptyExtent = true;
62 break;
63 }
64 }
65
66 if (!emptyExtent)
67 {
68 // Find input update extent based on requested output
69 // extent
70 int oUExt[6];
71 outputVector->GetInformationObject(0)->Get(
72 vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(), oUExt);
73 int oWExt[6]; // For parallel partition this will be different.
74 this->Internal->GetOutputWholeExtent(oWExt);
75 for (i = 0; i < 3; i++)
76 {
77 int idx = oUExt[2 * i] - oWExt[2 * i]; // Extent value to index
78 if (idx < 0 || idx >= this->Internal->GetSize(i))
79 {
80 vtkWarningMacro("Requested extent outside whole extent.");
81 idx = 0;
82 }
83 uExt[2 * i] = this->Internal->GetMappedExtentValueFromIndex(i, idx);
84 int jdx = oUExt[2 * i + 1] - oWExt[2 * i]; // Extent value to index
85 if (jdx < idx || jdx >= this->Internal->GetSize(i))
86 {
87 vtkWarningMacro("Requested extent outside whole extent.");
88 jdx = 0;
89 }
90 uExt[2 * i + 1] = this->Internal->GetMappedExtentValueFromIndex(i, jdx);
91 }
92 }
93 inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(), uExt, 6);
94 // We can handle anything.
95 inInfo->Set(vtkStreamingDemandDrivenPipeline::EXACT_EXTENT(), 0);
96
97 return 1;
98}

Callers

nothing calls this directly

Calls 7

GetInformationObjectMethod · 0.80
IsValidMethod · 0.45
GetSizeMethod · 0.45
GetMethod · 0.45
GetOutputWholeExtentMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected