1 /*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkAMRVolumeMapper.cxx
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14 =========================================================================*/
15 #include "vtkAMRVolumeMapper.h"
16
17 #include "vtkAMRResampleFilter.h"
18 #include "vtkBoundingBox.h"
19 #include "vtkCamera.h"
20 #include "vtkCompositeDataPipeline.h"
21 #include "vtkDataSet.h"
22 #include "vtkExecutive.h"
23 #include "vtkInformation.h"
24 #include "vtkInformationVector.h"
25 #include "vtkMath.h"
26 #include "vtkMatrix4x4.h"
27 #include "vtkMultiBlockDataSet.h"
28 #include "vtkMultiThreader.h"
29 #include "vtkObjectFactory.h"
30 #include "vtkOverlappingAMR.h"
31 #include "vtkRenderWindow.h"
32 #include "vtkRenderer.h"
33 #include "vtkSmartVolumeMapper.h"
34 #include "vtkUniformGrid.h"
35
36 #include "vtkNew.h"
37 #include "vtkTimerLog.h"
38
39 vtkStandardNewMacro(vtkAMRVolumeMapper);
40
41 // Construct a vtkAMRVolumeMapper
42 //------------------------------------------------------------------------------
vtkAMRVolumeMapper()43 vtkAMRVolumeMapper::vtkAMRVolumeMapper()
44 {
45 this->InternalMapper = vtkSmartVolumeMapper::New();
46 this->Resampler = vtkAMRResampleFilter::New();
47 this->HasMetaData = false;
48 this->Resampler->SetDemandDrivenMode(0);
49 this->Grid = nullptr;
50 this->NumberOfSamples[0] = 128;
51 this->NumberOfSamples[1] = 128;
52 this->NumberOfSamples[2] = 128;
53 this->RequestedResamplingMode = 0; // Frustrum Mode
54 this->FreezeFocalPoint = false;
55 this->LastFocalPointPosition[0] = this->LastFocalPointPosition[1] =
56 this->LastFocalPointPosition[2] = 0.0;
57 // Set the camera position to focal point distance to
58 // something that would indicate an initial update is needed
59 this->LastPostionFPDistance = -1.0;
60 this->ResamplerUpdateTolerance = 10e-8;
61 this->GridNeedsToBeUpdated = true;
62 this->UseDefaultThreading = false;
63 }
64
65 //------------------------------------------------------------------------------
~vtkAMRVolumeMapper()66 vtkAMRVolumeMapper::~vtkAMRVolumeMapper()
67 {
68 this->InternalMapper->Delete();
69 this->InternalMapper = nullptr;
70 this->Resampler->Delete();
71 this->Resampler = nullptr;
72 if (this->Grid)
73 {
74 this->Grid->Delete();
75 this->Grid = nullptr;
76 }
77 }
78
79 //------------------------------------------------------------------------------
SetInputData(vtkImageData * vtkNotUsed (genericInput))80 void vtkAMRVolumeMapper::SetInputData(vtkImageData* vtkNotUsed(genericInput))
81 {
82 vtkErrorMacro("Mapper expects a hierarchical dataset as input");
83 this->Resampler->SetInputConnection(0, nullptr);
84 }
85
86 //------------------------------------------------------------------------------
SetInputData(vtkDataSet * vtkNotUsed (genericInput))87 void vtkAMRVolumeMapper::SetInputData(vtkDataSet* vtkNotUsed(genericInput))
88 {
89 vtkErrorMacro("Mapper expects a hierarchical dataset as input");
90 this->Resampler->SetInputConnection(0, nullptr);
91 }
92
93 //------------------------------------------------------------------------------
SetInputData(vtkRectilinearGrid * vtkNotUsed (genericInput))94 void vtkAMRVolumeMapper::SetInputData(vtkRectilinearGrid* vtkNotUsed(genericInput))
95 {
96 vtkErrorMacro("Mapper expects a hierarchical dataset as input");
97 this->Resampler->SetInputConnection(0, nullptr);
98 }
99
100 //------------------------------------------------------------------------------
SetInputData(vtkOverlappingAMR * hdata)101 void vtkAMRVolumeMapper::SetInputData(vtkOverlappingAMR* hdata)
102 {
103 this->SetInputDataInternal(0, hdata);
104 }
105
106 //------------------------------------------------------------------------------
SetInputConnection(int port,vtkAlgorithmOutput * input)107 void vtkAMRVolumeMapper::SetInputConnection(int port, vtkAlgorithmOutput* input)
108 {
109 if ((this->Resampler->GetNumberOfInputConnections(0) > 0) &&
110 (this->Resampler->GetInputConnection(port, 0) == input))
111 {
112 return;
113 }
114 this->Resampler->SetInputConnection(port, input);
115 this->vtkVolumeMapper::SetInputConnection(port, input);
116 if (this->Grid)
117 {
118 this->Grid->Delete();
119 this->Grid = nullptr;
120 }
121 }
122 //------------------------------------------------------------------------------
GetBounds()123 double* vtkAMRVolumeMapper::GetBounds()
124 {
125 vtkOverlappingAMR* hdata;
126 hdata = vtkOverlappingAMR::SafeDownCast(this->Resampler->GetInputDataObject(0, 0));
127 if (!hdata)
128 {
129 vtkMath::UninitializeBounds(this->Bounds);
130 }
131 else
132 {
133 hdata->GetBounds(this->Bounds);
134 }
135 return this->Bounds;
136 }
137 //------------------------------------------------------------------------------
FillInputPortInformation(int vtkNotUsed (port),vtkInformation * info)138 int vtkAMRVolumeMapper::FillInputPortInformation(int vtkNotUsed(port), vtkInformation* info)
139 {
140 info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkOverlappingAMR");
141 return 1;
142 }
143
144 //------------------------------------------------------------------------------
SelectScalarArray(int arrayNum)145 void vtkAMRVolumeMapper::SelectScalarArray(int arrayNum)
146 {
147 this->InternalMapper->SelectScalarArray(arrayNum);
148 }
149
150 //------------------------------------------------------------------------------
SelectScalarArray(const char * arrayName)151 void vtkAMRVolumeMapper::SelectScalarArray(const char* arrayName)
152 {
153 this->InternalMapper->SelectScalarArray(arrayName);
154 }
155
156 //------------------------------------------------------------------------------
GetScalarModeAsString()157 const char* vtkAMRVolumeMapper::GetScalarModeAsString()
158 {
159 return this->InternalMapper->GetScalarModeAsString();
160 }
161
162 //------------------------------------------------------------------------------
GetArrayName()163 char* vtkAMRVolumeMapper::GetArrayName()
164 {
165 return this->InternalMapper->GetArrayName();
166 }
167
168 //------------------------------------------------------------------------------
GetArrayId()169 int vtkAMRVolumeMapper::GetArrayId()
170 {
171 return this->InternalMapper->GetArrayId();
172 }
173
174 //------------------------------------------------------------------------------
GetArrayAccessMode()175 int vtkAMRVolumeMapper::GetArrayAccessMode()
176 {
177 return this->InternalMapper->GetArrayAccessMode();
178 }
179 //------------------------------------------------------------------------------
SetScalarMode(int mode)180 void vtkAMRVolumeMapper::SetScalarMode(int mode)
181 {
182 this->vtkVolumeMapper::SetScalarMode(mode);
183 // for the internal mapper we need to convert all cell based
184 // modes to point based since this is what the resample filter is doing
185 int newMode = mode;
186 if (mode == VTK_SCALAR_MODE_USE_CELL_DATA)
187 {
188 newMode = VTK_SCALAR_MODE_USE_POINT_DATA;
189 }
190 else if (mode == VTK_SCALAR_MODE_USE_CELL_FIELD_DATA)
191 {
192 newMode = VTK_SCALAR_MODE_USE_POINT_FIELD_DATA;
193 }
194
195 this->InternalMapper->SetScalarMode(newMode);
196 }
197 //------------------------------------------------------------------------------
SetBlendMode(int mode)198 void vtkAMRVolumeMapper::SetBlendMode(int mode)
199 {
200 this->InternalMapper->SetBlendMode(mode);
201 }
202 //------------------------------------------------------------------------------
GetBlendMode()203 int vtkAMRVolumeMapper::GetBlendMode()
204 {
205 return this->InternalMapper->GetBlendMode();
206 }
207 //------------------------------------------------------------------------------
SetCropping(vtkTypeBool mode)208 void vtkAMRVolumeMapper::SetCropping(vtkTypeBool mode)
209 {
210 this->InternalMapper->SetCropping(mode);
211 }
212 //------------------------------------------------------------------------------
GetCropping()213 vtkTypeBool vtkAMRVolumeMapper::GetCropping()
214 {
215 return this->InternalMapper->GetCropping();
216 }
217 //------------------------------------------------------------------------------
SetCroppingRegionFlags(int mode)218 void vtkAMRVolumeMapper::SetCroppingRegionFlags(int mode)
219 {
220 this->InternalMapper->SetCroppingRegionFlags(mode);
221 }
222 //------------------------------------------------------------------------------
GetCroppingRegionFlags()223 int vtkAMRVolumeMapper::GetCroppingRegionFlags()
224 {
225 return this->InternalMapper->GetCroppingRegionFlags();
226 }
227 //------------------------------------------------------------------------------
SetCroppingRegionPlanes(double arg1,double arg2,double arg3,double arg4,double arg5,double arg6)228 void vtkAMRVolumeMapper::SetCroppingRegionPlanes(
229 double arg1, double arg2, double arg3, double arg4, double arg5, double arg6)
230 {
231 this->InternalMapper->SetCroppingRegionPlanes(arg1, arg2, arg3, arg4, arg5, arg6);
232 }
233 //------------------------------------------------------------------------------
GetCroppingRegionPlanes(double * planes)234 void vtkAMRVolumeMapper::GetCroppingRegionPlanes(double* planes)
235 {
236 this->InternalMapper->GetCroppingRegionPlanes(planes);
237 }
238 //------------------------------------------------------------------------------
GetCroppingRegionPlanes()239 double* vtkAMRVolumeMapper::GetCroppingRegionPlanes()
240 {
241 return this->InternalMapper->GetCroppingRegionPlanes();
242 }
243 //------------------------------------------------------------------------------
SetRequestedRenderMode(int mode)244 void vtkAMRVolumeMapper::SetRequestedRenderMode(int mode)
245 {
246 this->InternalMapper->SetRequestedRenderMode(mode);
247 }
248 //------------------------------------------------------------------------------
GetRequestedRenderMode()249 int vtkAMRVolumeMapper::GetRequestedRenderMode()
250 {
251 return this->InternalMapper->GetRequestedRenderMode();
252 }
253 //------------------------------------------------------------------------------
SetInterpolationMode(int mode)254 void vtkAMRVolumeMapper::SetInterpolationMode(int mode)
255 {
256 this->InternalMapper->SetInterpolationMode(mode);
257 }
258 //------------------------------------------------------------------------------
GetInterpolationMode()259 int vtkAMRVolumeMapper::GetInterpolationMode()
260 {
261 return this->InternalMapper->GetInterpolationMode();
262 }
263 //------------------------------------------------------------------------------
ReleaseGraphicsResources(vtkWindow * window)264 void vtkAMRVolumeMapper::ReleaseGraphicsResources(vtkWindow* window)
265 {
266 this->InternalMapper->ReleaseGraphicsResources(window);
267 }
268 //------------------------------------------------------------------------------
Render(vtkRenderer * ren,vtkVolume * vol)269 void vtkAMRVolumeMapper::Render(vtkRenderer* ren, vtkVolume* vol)
270 {
271 // Hack - Make sure the camera is in the right mode for moving the focal point
272 ren->GetActiveCamera()->SetFreezeFocalPoint(this->FreezeFocalPoint);
273 // If there is no grid initially we need to see if we can create one
274 // The grid is not created if it is an interactive render; meaning the desired
275 // time is less than the previous time to draw
276 if (!(this->Grid &&
277 (1.0 / ren->GetRenderWindow()->GetDesiredUpdateRate() <
278 this->InternalMapper->GetTimeToDraw())))
279 {
280 if (!this->HasMetaData)
281 {
282 // If there is no meta data then the resample filter has not been updated
283 // with the proper frustrun bounds else it would have been done when
284 // processing request information
285 this->UpdateResampler(ren, nullptr);
286 }
287 if (this->GridNeedsToBeUpdated)
288 {
289 this->UpdateGrid();
290 }
291
292 if (this->Grid == nullptr)
293 {
294 // Could not create a grid
295 return;
296 }
297
298 this->InternalMapper->SetInputData(this->Grid);
299 }
300 // Enable threading for the internal volume renderer and the reset the
301 // original value when done - need when running inside of ParaView
302 if (this->UseDefaultThreading)
303 {
304 int maxNumThreads = vtkMultiThreader::GetGlobalMaximumNumberOfThreads();
305 vtkMultiThreader::SetGlobalMaximumNumberOfThreads(0);
306 this->InternalMapper->Render(ren, vol);
307 vtkMultiThreader::SetGlobalMaximumNumberOfThreads(maxNumThreads);
308 }
309 else
310 {
311 this->InternalMapper->Render(ren, vol);
312 }
313 }
314 //------------------------------------------------------------------------------
UpdateResampler(vtkRenderer * ren,vtkOverlappingAMR * amr)315 void vtkAMRVolumeMapper::UpdateResampler(vtkRenderer* ren, vtkOverlappingAMR* amr)
316 {
317 // Set the bias of the resample filter to be the projection direction
318 double bvec[3];
319 vtkCamera* cam = ren->GetActiveCamera();
320 double d, d2, fp[3], pd, gb[6];
321 d = cam->GetDistance();
322 cam->GetFocalPoint(fp);
323
324 if (this->Grid)
325 {
326 // Compare distances with the grid's bounds
327 this->Grid->GetBounds(gb);
328 vtkBoundingBox bbox(gb);
329 double maxL = bbox.GetMaxLength();
330 // If the grid's max length is 0 then we need to update
331 if (maxL > 0.0)
332 {
333 pd = fabs(d - this->LastPostionFPDistance) / this->LastPostionFPDistance;
334 if ((this->LastPostionFPDistance > 0.0) && (pd <= this->ResamplerUpdateTolerance))
335 {
336 // Lets see if the focal point has not moved enough to cause an update
337 d2 = vtkMath::Distance2BetweenPoints(fp, this->LastFocalPointPosition) / (maxL * maxL);
338 if (d2 <= (this->ResamplerUpdateTolerance * this->ResamplerUpdateTolerance))
339 {
340 // nothing needs to be updated
341 return;
342 }
343 else
344 {
345 // int oops = 1;
346 }
347 }
348 }
349 }
350 cam->GetDirectionOfProjection(bvec);
351 this->Resampler->SetBiasVector(bvec);
352 this->Resampler->SetUseBiasVector(true);
353 this->LastPostionFPDistance = d;
354 this->LastFocalPointPosition[0] = fp[0];
355 this->LastFocalPointPosition[1] = fp[1];
356 this->LastFocalPointPosition[2] = fp[2];
357
358 if (this->RequestedResamplingMode == 0)
359 {
360 this->UpdateResamplerFrustrumMethod(ren, amr);
361 }
362 else
363 {
364 // This is the focal point approach where we
365 // center the grid on the focal point and set its length
366 // to be the distance between the camera and its focal point
367 double p[3];
368 p[0] = fp[0] - d;
369 p[1] = fp[1] - d;
370 p[2] = fp[2] - d;
371 // Now set the min/max of the resample filter
372 this->Resampler->SetMin(p);
373 p[0] = fp[0] + d;
374 p[1] = fp[1] + d;
375 p[2] = fp[2] + d;
376 this->Resampler->SetMax(p);
377 this->Resampler->SetNumberOfSamples(this->NumberOfSamples);
378 }
379 // The grid may have changed
380 this->GridNeedsToBeUpdated = true;
381 }
382
383 //------------------------------------------------------------------------------
UpdateResamplerFrustrumMethod(vtkRenderer * ren,vtkOverlappingAMR * amr)384 void vtkAMRVolumeMapper::UpdateResamplerFrustrumMethod(vtkRenderer* ren, vtkOverlappingAMR* amr)
385 {
386 double bounds[6];
387 // If we have been passed a valid amr then assume this is the proper
388 // meta data to use
389 if (amr)
390 {
391 amr->GetBounds(bounds);
392 }
393 else
394 {
395 // Make sure the bounds are up to date
396 this->GetBounds(bounds);
397 }
398
399 double computed_bounds[6];
400 if (vtkAMRVolumeMapper::ComputeResamplerBoundsFrustumMethod(
401 ren->GetActiveCamera(), ren, bounds, computed_bounds))
402 {
403 vtkBoundingBox bbox(computed_bounds);
404 // Now set the min/max of the resample filter
405 this->Resampler->SetMin(const_cast<double*>(bbox.GetMinPoint()));
406 this->Resampler->SetMax(const_cast<double*>(bbox.GetMaxPoint()));
407 this->Resampler->SetNumberOfSamples(this->NumberOfSamples);
408 }
409 }
410
411 //------------------------------------------------------------------------------
ComputeResamplerBoundsFrustumMethod(vtkCamera * camera,vtkRenderer * renderer,const double bounds[6],double out_bounds[6])412 bool vtkAMRVolumeMapper::ComputeResamplerBoundsFrustumMethod(
413 vtkCamera* camera, vtkRenderer* renderer, const double bounds[6], double out_bounds[6])
414 {
415 vtkMath::UninitializeBounds(out_bounds);
416
417 // First we need to create a bounding box that represents the visible region
418 // of the camera in World Coordinates
419
420 // In order to produce as tight of bounding box as possible we need to determine
421 // the z range in view coordinates of the data and then project that part
422 // of the view volume back into world coordinates
423
424 // We would just use the renderer's WorldToView and ViewToWorld methods but those
425 // implementations are not efficient for example ViewToWorld would do 8
426 // matrix inverse ops when all we really need to do is one
427
428 // Get the camera transformation
429 vtkMatrix4x4* matrix =
430 camera->GetCompositeProjectionTransformMatrix(renderer->GetTiledAspectRatio(), 0, 1);
431
432 int i, j, k;
433 double pnt[4], tpnt[4];
434 vtkBoundingBox bbox;
435 pnt[3] = 1.0;
436 for (i = 0; i < 2; i++)
437 {
438 pnt[0] = bounds[i];
439 for (j = 2; j < 4; j++)
440 {
441 pnt[1] = bounds[j];
442 for (k = 4; k < 6; k++)
443 {
444 pnt[2] = bounds[k];
445 matrix->MultiplyPoint(pnt, tpnt);
446 if (tpnt[3])
447 {
448 bbox.AddPoint(tpnt[0] / tpnt[3], tpnt[1] / tpnt[3], tpnt[2] / tpnt[3]);
449 }
450 else
451 {
452 vtkGenericWarningMacro("UpdateResampler: Found an Ideal Point going to VC!");
453 }
454 }
455 }
456 }
457
458 double zRange[2];
459 if (bbox.IsValid())
460 {
461 zRange[0] = bbox.GetMinPoint()[2];
462 zRange[1] = bbox.GetMaxPoint()[2];
463 // Normalize the z values to make sure they are between -1 and 1
464 for (i = 0; i < 2; i++)
465 {
466 if (zRange[i] < -1.0)
467 {
468 zRange[i] = -1.0;
469 }
470 else if (zRange[i] > 1.0)
471 {
472 zRange[i] = 1.0;
473 }
474 }
475 }
476 else
477 {
478 // Since we could not find a valid bounding box assume that the
479 // zrange is -1 to 1
480 zRange[0] = -1.0;
481 zRange[1] = 1.0;
482 }
483
484 // Now that we have the z range of the data in View Coordinates lets
485 // convert that part of the View Volume back into World Coordinates
486 double mat[16];
487 // Need the inverse
488 vtkMatrix4x4::Invert(*matrix->Element, mat);
489
490 bbox.Reset();
491 // Compute the bounding box
492 for (i = -1; i < 2; i += 2)
493 {
494 pnt[0] = i;
495 for (j = -1; j < 2; j += 2)
496 {
497 pnt[1] = j;
498 for (k = 0; k < 2; k++)
499 {
500 pnt[2] = zRange[k];
501 vtkMatrix4x4::MultiplyPoint(mat, pnt, tpnt);
502 if (tpnt[3])
503 {
504 bbox.AddPoint(tpnt[0] / tpnt[3], tpnt[1] / tpnt[3], tpnt[2] / tpnt[3]);
505 }
506 else
507 {
508 vtkGenericWarningMacro("UpdateResampler: Found an Ideal Point going to WC!");
509 }
510 }
511 }
512 }
513
514 // Check to see if the box is valid
515 if (!bbox.IsValid())
516 {
517 return false; // There is nothing we can do
518 }
519 bbox.GetBounds(out_bounds);
520 return true;
521 }
522
523 //------------------------------------------------------------------------------
UpdateGrid()524 void vtkAMRVolumeMapper::UpdateGrid()
525 {
526 // This is for debugging
527 #define PRINTSTATS 0
528 #if PRINTSTATS
529 vtkNew<vtkTimerLog> timer;
530 int gridDim[3];
531 double gridOrigin[3];
532 timer->StartTimer();
533 #endif
534 this->Resampler->Update();
535 #if PRINTSTATS
536 timer->StopTimer();
537 std::cerr << "Resample Time:" << timer->GetElapsedTime() << " ";
538 std::cerr << "New Bounds: [" << bbox.GetMinPoint()[0] << ", " << bbox.GetMaxPoint()[0] << "], ["
539 << bbox.GetMinPoint()[1] << ", " << bbox.GetMaxPoint()[1] << "], ["
540 << bbox.GetMinPoint()[2] << ", " << bbox.GetMaxPoint()[2] << "\n";
541 #endif
542 vtkMultiBlockDataSet* mb = this->Resampler->GetOutput();
543 if (!mb)
544 {
545 return;
546 }
547 unsigned int nb = mb->GetNumberOfBlocks();
548 if (!nb)
549 {
550 // No new grid was created
551 return;
552 }
553 if (nb != 1)
554 {
555 vtkErrorMacro("UpdateGrid: Resampler created more than 1 Grid!");
556 }
557 if (this->Grid)
558 {
559 this->Grid->Delete();
560 }
561 this->Grid = vtkUniformGrid::SafeDownCast(mb->GetBlock(0));
562 this->Grid->Register(nullptr);
563 this->GridNeedsToBeUpdated = false;
564 #if PRINTSTATS
565 this->Grid->GetDimensions(gridDim);
566 this->Grid->GetOrigin(gridOrigin);
567 std::cerr << "Grid Dimensions: (" << gridDim[0] << ", " << gridDim[1] << ", " << gridDim[2]
568 << ") Origin:(" << gridOrigin[0] << ", " << gridOrigin[1] << ", " << gridOrigin[2]
569 << ")\n";
570 #endif
571 }
572 //------------------------------------------------------------------------------
ProcessUpdateExtentRequest(vtkRenderer * vtkNotUsed (ren),vtkInformation * info,vtkInformationVector ** inputVector,vtkInformationVector * outputVector)573 void vtkAMRVolumeMapper::ProcessUpdateExtentRequest(vtkRenderer* vtkNotUsed(ren),
574 vtkInformation* info, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
575 {
576 this->Resampler->RequestUpdateExtent(info, inputVector, outputVector);
577 }
578 //------------------------------------------------------------------------------
ProcessInformationRequest(vtkRenderer * ren,vtkInformation * info,vtkInformationVector ** inputVector,vtkInformationVector * outputVector)579 void vtkAMRVolumeMapper::ProcessInformationRequest(vtkRenderer* ren, vtkInformation* info,
580 vtkInformationVector** inputVector, vtkInformationVector* outputVector)
581 {
582 vtkInformation* input = inputVector[0]->GetInformationObject(0);
583 if (!(input && input->Has(vtkCompositeDataPipeline::COMPOSITE_DATA_META_DATA())))
584 {
585 this->HasMetaData = false;
586 this->Resampler->SetDemandDrivenMode(0);
587 return;
588 }
589
590 if (!this->HasMetaData)
591 {
592 this->HasMetaData = true;
593 this->Resampler->SetDemandDrivenMode(1);
594 }
595 vtkOverlappingAMR* amrMetaData = vtkOverlappingAMR::SafeDownCast(
596 input->Get(vtkCompositeDataPipeline::COMPOSITE_DATA_META_DATA()));
597
598 this->UpdateResampler(ren, amrMetaData);
599 this->Resampler->RequestInformation(info, inputVector, outputVector);
600 }
601 //------------------------------------------------------------------------------
602
603 // Print the vtkAMRVolumeMapper
PrintSelf(ostream & os,vtkIndent indent)604 void vtkAMRVolumeMapper::PrintSelf(ostream& os, vtkIndent indent)
605 {
606 this->Superclass::PrintSelf(os, indent);
607 os << indent << "ScalarMode: " << this->GetScalarModeAsString() << endl;
608
609 if (this->ScalarMode == VTK_SCALAR_MODE_USE_POINT_FIELD_DATA ||
610 this->ScalarMode == VTK_SCALAR_MODE_USE_CELL_FIELD_DATA)
611 {
612 if (this->ArrayAccessMode == VTK_GET_ARRAY_BY_ID)
613 {
614 os << indent << "ArrayId: " << this->ArrayId << endl;
615 }
616 else
617 {
618 os << indent << "ArrayName: " << this->ArrayName << endl;
619 }
620 }
621 os << indent << "UseDefaultThreading:" << this->UseDefaultThreading << "\n";
622 os << indent << "ResampledUpdateTolerance: " << this->ResamplerUpdateTolerance << "\n";
623 os << indent << "NumberOfSamples: ";
624 for (int i = 0; i < 3; ++i)
625 {
626 os << this->NumberOfSamples[i] << " ";
627 }
628 os << std::endl;
629 os << indent << "RequestedResamplingMode: " << this->RequestedResamplingMode << "\n";
630 os << indent << "FreezeFocalPoint: " << this->FreezeFocalPoint << "\n";
631 }
632 //------------------------------------------------------------------------------
633