Commit 36c0f18b authored by Sankhesh Jhaveri's avatar Sankhesh Jhaveri

Support rectilinear grids in the fixed point ray cast helpers

This change does not add complete support for rectilinear grids in the
fixed point ray cast mapper but just patches code requiring a dataset
type.
parent f1bb9597
......@@ -21,6 +21,7 @@
#include "vtkFixedPointVolumeRayCastMapper.h"
#include "vtkImageData.h"
#include "vtkObjectFactory.h"
#include "vtkRectilinearGrid.h"
#include "vtkRenderWindow.h"
#include "vtkVolume.h"
#include "vtkVolumeProperty.h"
......
......@@ -21,6 +21,7 @@
#include "vtkFixedPointVolumeRayCastMapper.h"
#include "vtkImageData.h"
#include "vtkObjectFactory.h"
#include "vtkRectilinearGrid.h"
#include "vtkRenderWindow.h"
#include "vtkVolume.h"
#include "vtkVolumeProperty.h"
......
......@@ -21,6 +21,7 @@
#include "vtkFixedPointVolumeRayCastMapper.h"
#include "vtkImageData.h"
#include "vtkObjectFactory.h"
#include "vtkRectilinearGrid.h"
#include "vtkRenderWindow.h"
#include "vtkVolume.h"
#include "vtkVolumeProperty.h"
......
......@@ -21,6 +21,7 @@
#include "vtkFixedPointVolumeRayCastMapper.h"
#include "vtkImageData.h"
#include "vtkObjectFactory.h"
#include "vtkRectilinearGrid.h"
#include "vtkRenderWindow.h"
#include "vtkVolume.h"
#include "vtkVolumeProperty.h"
......
......@@ -808,14 +808,31 @@
mapper->GetRayCastImage()->GetImageMemorySize(imageMemorySize); \
mapper->GetRayCastImage()->GetImageViewportSize(imageViewportSize); \
mapper->GetRayCastImage()->GetImageOrigin(imageOrigin); \
mapper->GetInput()->GetDimensions(dim); \
vtkImageData* imData = vtkImageData::SafeDownCast(mapper->GetInput()); \
vtkRectilinearGrid* rGrid = vtkRectilinearGrid::SafeDownCast(mapper->GetInput()); \
if (imData) \
{ \
imData->GetDimensions(dim); \
} \
else if (rGrid) \
{ \
rGrid->GetDimensions(dim); \
} \
mapper->GetTableShift(shift); \
mapper->GetTableScale(scale); \
\
int* rowBounds = mapper->GetRowBounds(); \
unsigned short* image = mapper->GetRayCastImage()->GetImage(); \
vtkRenderWindow* renWin = mapper->GetRenderWindow(); \
int components = mapper->GetInput()->GetNumberOfScalarComponents(); \
int components = 1; \
if (imData) \
{ \
components = imData->GetNumberOfScalarComponents(); \
} \
else if (rGrid) \
{ \
components = rGrid->GetNumberOfScalarComponents(); \
} \
int cropping = (mapper->GetCropping() && mapper->GetCroppingRegionFlags() != 0x2000); \
\
components = (components < 4) ? components : 4; \
......
......@@ -20,6 +20,7 @@
#include "vtkFixedPointVolumeRayCastMapper.h"
#include "vtkImageData.h"
#include "vtkObjectFactory.h"
#include "vtkRectilinearGrid.h"
#include "vtkRenderWindow.h"
#include "vtkVolume.h"
#include "vtkVolumeProperty.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment