20 #ifndef CXTEXTURESLICEPAINTER_H_
21 #define CXTEXTURESLICEPAINTER_H_
23 #include "cxResourceVisualizationExport.h"
25 #include <boost/shared_ptr.hpp>
32 #ifndef CX_VTK_OPENGL2
33 #include <vtkOpenGLRepresentationPainter.h>
36 class vtkOpenGLRenderWindow;
37 class vtkUniformVariables;
42 #if !defined(CX_VTK_OPENGL2) && !defined(WIN32)
60 void SetColorAttribute(
float window,
float level,
float llr,
float alpha);
61 void initializeRendering();
62 void setUniformiArray(vtkUniformVariables* uniforms, QString name,
int val);
63 void setUniformfArray(vtkUniformVariables* uniforms, QString name,
float val);
64 void eachRenderInternal(vtkSmartPointer<vtkShaderProgram2> shader);
82 virtual void ReleaseGraphicsResources(vtkWindow *);
83 void PrintSelf(ostream& os, vtkIndent indent);
85 void setShaderPath(QString path);
86 void SetColorAttribute(
int index,
float window,
float level,
float llr,
float alpha);
89 void releaseGraphicsResources(
int index);
91 static bool LoadRequiredExtensions(vtkOpenGLExtensionManager* mgr);
96 virtual void PrepareForRendering(vtkRenderer*, vtkActor*);
97 void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags,
bool forceCompileOnly);
98 bool CanRender(vtkRenderer*, vtkActor*);
99 static bool LoadRequiredExtension(vtkOpenGLExtensionManager* mgr, QString
id);
100 void ClearGraphicsResources();
103 QString loadShaderFile();
104 void buildProgram(QString shaderSource, vtkOpenGLRenderWindow* renderWindow);
106 QString replaceShaderSourceMacros(QString shaderSource);
108 bool hasLoadedExtensions;
111 vtkWeakPointer<vtkRenderWindow> LastContext;
112 vtkSmartPointer<vtkShaderProgram2> Shader;
113 std::vector<SingleVolumePainterHelper> mElement;
116 #endif //CX_VTK_OPENGL2