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

Method ComputeBounds

Rendering/VolumeOpenGL2/vtkMultiBlockVolumeMapper.cxx:163–195  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

161
162//------------------------------------------------------------------------------
163void vtkMultiBlockVolumeMapper::ComputeBounds()
164{
165 auto input = this->GetDataObjectTreeInput();
166 assert(input != nullptr);
167 if (input->GetMTime() == this->BoundsComputeTime)
168 {
169 // don't need to recompute bounds.
170 return;
171 }
172
173 // Loop over the hierarchy of data objects to compute bounds
174 vtkBoundingBox bbox;
175 vtkCompositeDataIterator* iter = input->NewIterator();
176 for (iter->GoToFirstItem(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
177 {
178 if (vtkImageData* img = vtkImageData::SafeDownCast(iter->GetCurrentDataObject()))
179 if (img)
180 {
181 double bds[6];
182 img->GetBounds(bds);
183 bbox.AddBounds(bds);
184 }
185 }
186 iter->Delete();
187
188 vtkMath::UninitializeBounds(this->Bounds);
189 if (bbox.IsValid())
190 {
191 bbox.GetBounds(this->Bounds);
192 }
193
194 this->BoundsComputeTime = input->GetMTime();
195}
196
197//------------------------------------------------------------------------------
198vtkDataObjectTree* vtkMultiBlockVolumeMapper::GetDataObjectTreeInput()

Callers 1

GetBoundsMethod · 0.95

Calls 13

UninitializeBoundsFunction · 0.85
DeleteMethod · 0.65
assertFunction · 0.50
GetMTimeMethod · 0.45
NewIteratorMethod · 0.45
GoToFirstItemMethod · 0.45
IsDoneWithTraversalMethod · 0.45
GoToNextItemMethod · 0.45
GetCurrentDataObjectMethod · 0.45
GetBoundsMethod · 0.45
AddBoundsMethod · 0.45

Tested by

no test coverage detected