Commit 4c22ec74 authored by Ken Martin's avatar Ken Martin

pass clipping planes for imageslicemapper

The imageslicemapper in OpenGL2 was not handling its
clipping planes properly.
parent 7f213b19
......@@ -20,15 +20,17 @@
#include "vtkTestUtilities.h"
#include "vtkRegressionTestImage.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkInteractorStyleImage.h"
#include "vtkRenderWindow.h"
#include "vtkRenderer.h"
#include "vtkCamera.h"
#include "vtkImageData.h"
#include "vtkImageSliceMapper.h"
#include "vtkImageProperty.h"
#include "vtkImageSlice.h"
#include "vtkImageSliceMapper.h"
#include "vtkInteractorStyleImage.h"
#include "vtkNew.h"
#include "vtkPlane.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderer.h"
#include "vtkTIFFReader.h"
int TestImageSliceMapperBackground(int argc, char* argv[])
......@@ -63,6 +65,10 @@ int TestImageSliceMapperBackground(int argc, char* argv[])
imageMapper->SetInputConnection(reader->GetOutputPort());
imageMapper->CroppingOn();
imageMapper->SetCroppingRegion(100, 107, 100, 107, 0, 0);
vtkNew<vtkPlane> cplane;
cplane->SetNormal(-0.5,0.5,0);
cplane->SetOrigin(105,105,0);
imageMapper->AddClippingPlane(cplane.Get());
double *bounds = imageMapper->GetBounds();
double point[3];
......
5b7cf00ecf5acf17279a095b930c38eb
93c18b08789ca38ea806d7288e2d9ba1
......@@ -461,6 +461,7 @@ void vtkOpenGLImageSliceMapper::RenderPolygon(
{
actor->GetTexture()->Render(ren);
}
actor->GetMapper()->SetClippingPlanes(this->GetClippingPlanes());
actor->GetMapper()->Render(ren, actor);
if (textured)
{
......@@ -587,6 +588,7 @@ void vtkOpenGLImageSliceMapper::RenderBackground(
}
}
actor->GetMapper()->SetClippingPlanes(this->GetClippingPlanes());
actor->GetMapper()->Render(ren, actor);
vtkOpenGLCheckErrorMacro("failed after RenderBackground");
......
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