Skip to content

Commit

Permalink
Merge topic 'fix_clipping_issue' into master
Browse files Browse the repository at this point in the history
723ef37 FIX: Reset clipping planes
  • Loading branch information
sankhesh authored and Code Review committed Oct 14, 2014
2 parents 2c684c6 + 723ef37 commit 1edb598
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class vtkOpenGLGPUVolumeRayCastMapper::vtkInternal
this->Initialized = false;
this->ValidTransferFunction = false;
this->LoadDepthTextureExtensionsSucceeded = false;
this->CameraWasInsideInLastUpdate = false;
this->CubeVBOId = 0;
#ifndef __APPLE__
this->CubeVAOId = 0;
Expand Down Expand Up @@ -246,6 +247,7 @@ class vtkOpenGLGPUVolumeRayCastMapper::vtkInternal
bool Initialized;
bool ValidTransferFunction;
bool LoadDepthTextureExtensionsSucceeded;
bool CameraWasInsideInLastUpdate;

GLuint CubeVBOId;
#ifndef __APPLE__
Expand Down Expand Up @@ -1086,7 +1088,8 @@ bool vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::IsCameraInside(
void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateVolumeGeometry(
vtkRenderer* ren, vtkVolume* vol, vtkImageData* input)
{
if (input != this->PrevInput || this->IsCameraInside(ren, vol))
if (input != this->PrevInput || this->IsCameraInside(ren, vol) ||
this->CameraWasInsideInLastUpdate)
{
vtkNew<vtkTessellatedBoxSource> boxSource;
boxSource->SetBounds(this->LoadedBounds);
Expand Down Expand Up @@ -1203,10 +1206,13 @@ void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateVolumeGeometry(
clip->SetPlanes(planes.GetPointer());

densityPolyData->SetInputConnection(clip->GetOutputPort());

this->CameraWasInsideInLastUpdate = true;
}
else
{
densityPolyData->SetInputConnection(boxSource->GetOutputPort());
this->CameraWasInsideInLastUpdate = false;
}

densityPolyData->SetNumberOfSubdivisions(2);
Expand Down

0 comments on commit 1edb598

Please sign in to comment.