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

Method ProcessRequest

Rendering/Core/vtkImageSliceMapper.cxx:75–241  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

73
74//------------------------------------------------------------------------------
75vtkTypeBool vtkImageSliceMapper::ProcessRequest(
76 vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
77{
78 // compute display extent
79 if (request->Has(vtkStreamingDemandDrivenPipeline::REQUEST_INFORMATION()))
80 {
81 int wholeExtent[6];
82 int* extent = this->DataWholeExtent;
83
84 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
85 inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), wholeExtent);
86
87 for (int k = 0; k < 6; k++)
88 {
89 extent[k] = wholeExtent[k];
90 }
91
92 if (this->Cropping)
93 {
94 for (int i = 0; i < 3; i++)
95 {
96 extent[2 * i] = std::max(extent[2 * i], this->CroppingRegion[2 * i]);
97 extent[2 * i + 1] = std::min(extent[2 * i + 1], this->CroppingRegion[2 * i + 1]);
98 }
99 }
100
101 double* spacing = this->DataSpacing;
102 double* origin = this->DataOrigin;
103 double* dir = this->DataDirection;
104
105 inInfo->Get(vtkDataObject::SPACING(), spacing);
106 inInfo->Get(vtkDataObject::ORIGIN(), origin);
107
108 vtkMatrix4x4* matrix = this->GetDataToWorldMatrix();
109 if (inInfo->Has(vtkDataObject::DIRECTION()))
110 {
111 inInfo->Get(vtkDataObject::DIRECTION(), dir);
112 }
113 else
114 {
115 vtkMatrix3x3::Identity(dir);
116 }
117 // prepend indextophysical matrix
118 double i2p[16];
119 for (int i = 0; i < 3; ++i)
120 {
121 i2p[i * 4] = dir[i * 3] * spacing[0];
122 i2p[i * 4 + 1] = dir[i * 3 + 1] * spacing[1];
123 i2p[i * 4 + 2] = dir[i * 3 + 2] * spacing[2];
124 i2p[i * 4 + 3] = origin[i];
125 i2p[12 + i] = 0.0;
126 }
127 i2p[15] = 1.0;
128 if (matrix)
129 {
130 vtkMatrix4x4::Multiply4x4(matrix->GetData(), i2p, i2p);
131 }
132

Callers

nothing calls this directly

Calls 15

GetSliceFromCameraMethod · 0.95
GetInformationObjectMethod · 0.80
GetDataToWorldMatrixMethod · 0.80
GetActiveCameraMethod · 0.80
maxFunction · 0.50
minFunction · 0.50
IdentityFunction · 0.50
MultiplyPointFunction · 0.50
InvertFunction · 0.50
TransposeFunction · 0.50
NormalizeFunction · 0.50

Tested by

no test coverage detected