Commit 161cdbfd authored by T.J. Corona's avatar T.J. Corona Committed by Kitware Robot

Merge topic 'glyph3dmapper-clipping-planes'

ba00d36a Enable/disable clipping planes in vtkOpenGLGlyph3DMapper
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Ken Martin's avatarKen Martin <ken.martin@kitware.com>
Merge-request: !963
parents 276ec98a ba00d36a
......@@ -322,7 +322,31 @@ void vtkOpenGLGlyph3DMapper::Render(vtkRenderer *ren, vtkActor *actor)
{
this->TimeToDraw = 0.0;
this->Timer->StartTimer();
int numClipPlanes = this->GetNumberOfClippingPlanes();
if (numClipPlanes > 6)
{
vtkErrorMacro(<< "OpenGL has a limit of 6 clipping planes");
numClipPlanes = 6;
}
for (int i = 0; i < numClipPlanes; i++)
{
double planeEquation[4];
this->GetClippingPlaneInDataCoords(actor->GetMatrix(), i, planeEquation);
GLenum clipPlaneId = static_cast<GLenum>(GL_CLIP_PLANE0 + i);
glEnable(clipPlaneId);
glClipPlane(clipPlaneId, planeEquation);
}
glCallList(this->DisplayListId);
for (int c = 0; c < numClipPlanes; c++)
{
GLenum clipPlaneId = static_cast<GLenum>(GL_CLIP_PLANE0 + c);
glDisable(clipPlaneId);
}
this->Timer->StopTimer();
this->TimeToDraw += this->Timer->GetElapsedTime();
}
......
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