Commit ba00d36a authored by T.J. Corona's avatar T.J. Corona

Enable/disable clipping planes in vtkOpenGLGlyph3DMapper

This commit is in reference to issue #15373.
parent ae30efa5
Pipeline #1203 passed with stage
......@@ -330,7 +330,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