vtkOpenGLLabeledContourMapper.h 2.15 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkOpenGLLabeledContourMapper.h

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
15 16 17 18 19 20
/**
 * @class   vtkOpenGLLabeledContourMapper
 *
 * vtkOpenGLLabeledContourMapper is an override for vtkLabeledContourMapper
 * that implements stenciling using the OpenGL2 API.
*/
21

22 23
#ifndef vtkOpenGLLabeledContourMapper_h
#define vtkOpenGLLabeledContourMapper_h
24 25 26 27

#include "vtkRenderingOpenGL2Module.h" // For export macro
#include "vtkLabeledContourMapper.h"

28
class vtkMatrix4x4;
Ken Martin's avatar
Ken Martin committed
29
class vtkOpenGLHelper;
30

31 32 33 34 35 36
class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLLabeledContourMapper
    : public vtkLabeledContourMapper
{
public:
  static vtkOpenGLLabeledContourMapper *New();
  vtkTypeMacro(vtkOpenGLLabeledContourMapper, vtkLabeledContourMapper)
37
  virtual void PrintSelf(ostream &os, vtkIndent indent);
38

39 40 41
  /**
   * Release graphics resources
   */
42 43
  void ReleaseGraphicsResources(vtkWindow *win);

44 45 46 47 48 49 50 51 52 53 54 55 56 57
protected:
  vtkOpenGLLabeledContourMapper();
  ~vtkOpenGLLabeledContourMapper();

  // We override this for compatibilty with the OpenGL backend:
  // The old backend pushes actor matrices onto the matrix stack, so the text
  // actors already accounted for any transformations on this mapper's actor.
  // The new backend passes each actor's matrix to the shader individually, and
  // this mapper's actor matrix doesn't affect the label rendering.
  bool CreateLabels(vtkActor *actor);

  bool ApplyStencil(vtkRenderer *ren, vtkActor *act);
  bool RemoveStencil();

Ken Martin's avatar
Ken Martin committed
58
  vtkOpenGLHelper *StencilBO;
59 60 61
  vtkMatrix4x4 *TempMatrix4;


62
private:
63
  vtkOpenGLLabeledContourMapper(const vtkOpenGLLabeledContourMapper&) VTK_DELETE_FUNCTION;
64
  void operator=(const vtkOpenGLLabeledContourMapper&) VTK_DELETE_FUNCTION;
65 66 67
};

#endif