Commit 9095631e authored by Allison Vacanti's avatar Allison Vacanti Committed by Kitware Robot

Merge topic 'volume-clip-artifact'

5c6bde06 Fix volume clip bug and add regression test.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !4338
parents e1b0b757 5c6bde06
......@@ -27,10 +27,10 @@
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>
#include <vtkRTAnalyticSource.h>
#include <vtkSmartPointer.h>
#include <vtkTestUtilities.h>
#include <vtkVolumeProperty.h>
#include <vtkXMLImageDataReader.h>
int TestGPURayCastClipping(int argc, char *argv[])
{
......@@ -38,15 +38,9 @@ int TestGPURayCastClipping(int argc, char *argv[])
vtkNew<vtkGPUVolumeRayCastMapper> volumeMapper;
vtkNew<vtkXMLImageDataReader> reader;
const char* volumeFile = vtkTestUtilities::ExpandDataFileName(
argc, argv, "Data/vase_1comp.vti");
reader->SetFileName(volumeFile);
reader->Update();
volumeMapper->SetInputConnection(reader->GetOutputPort());
delete [] volumeFile;
vtkNew<vtkRTAnalyticSource> wavelet;
wavelet->Update();
volumeMapper->SetInputConnection(wavelet->GetOutputPort());
volumeMapper->GetInput()->GetScalarRange(scalarRange);
volumeMapper->SetBlendModeToComposite();
......@@ -77,7 +71,7 @@ int TestGPURayCastClipping(int argc, char *argv[])
colorTransferFunction->AddRGBPoint(scalarRange[1], 1.0, 0.5, 0.1);
// Test cropping now
const double* bounds = reader->GetOutput()->GetBounds();
const double* bounds = wavelet->GetOutput()->GetBounds();
vtkNew<vtkPlane> clipPlane1;
clipPlane1->SetOrigin(0.45 * (bounds[0] + bounds[1]), 0.0, 0.0);
clipPlane1->SetNormal(0.8, 0.0, 0.0);
......
7d2c50a7692a0921ed0c5a55d2b9a9bc94663e02139254506396bc177cb8158a179c7cb348eb4f3dc0da1bccbf0d35d2855030eedd83d9de9bcefdb9b366be5a
c8aceb3f3c76bc86e167e77d1ca7e424d38fd82bd272dbde6e3f9e71d42eb23968c6938dcfee1bc99174be6a67558e06dfdd4cae1dc1a644c9d00aa837ee86c1
......@@ -2376,6 +2376,12 @@ namespace vtkvolume
\n }\
\n }\
\n\
\n if (any(greaterThan(startPosTex, in_texMax[0])) ||\
\n any(lessThan(startPosTex, in_texMin[0])))\
\n {\
\n return false;\
\n }\
\n\
\n return true;\
\n}\
\n");
......
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