41 #ifndef CXTEXTURESLICEPAINTER_H_
42 #define CXTEXTURESLICEPAINTER_H_
44 #include "cxResourceVisualizationExport.h"
46 #include <boost/shared_ptr.hpp>
53 #ifndef CX_VTK_OPENGL2
54 #include <vtkOpenGLRepresentationPainter.h>
57 class vtkOpenGLRenderWindow;
58 class vtkUniformVariables;
65 #if !defined(CX_VTK_OPENGL2) && !defined(WIN32)
83 void SetColorAttribute(
float window,
float level,
float llr,
float alpha);
84 void initializeRendering();
85 void setUniformiArray(vtkUniformVariables* uniforms, QString name,
int val);
86 void setUniformfArray(vtkUniformVariables* uniforms, QString name,
float val);
87 void eachRenderInternal(vtkSmartPointer<vtkShaderProgram2> shader);
105 virtual void ReleaseGraphicsResources(vtkWindow *);
106 void PrintSelf(ostream& os, vtkIndent indent);
108 void setShaderPath(QString path);
109 void SetColorAttribute(
int index,
float window,
float level,
float llr,
float alpha);
112 void releaseGraphicsResources(
int index);
114 static bool LoadRequiredExtensions(vtkOpenGLExtensionManager* mgr);
119 virtual void PrepareForRendering(vtkRenderer*, vtkActor*);
120 void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags,
bool forceCompileOnly);
121 bool CanRender(vtkRenderer*, vtkActor*);
122 static bool LoadRequiredExtension(vtkOpenGLExtensionManager* mgr, QString
id);
123 void ClearGraphicsResources();
126 QString loadShaderFile();
127 void buildProgram(QString shaderSource, vtkOpenGLRenderWindow* renderWindow);
129 QString replaceShaderSourceMacros(QString shaderSource);
131 bool hasLoadedExtensions;
134 vtkWeakPointer<vtkRenderWindow> LastContext;
135 vtkSmartPointer<vtkShaderProgram2> Shader;
136 std::vector<SingleVolumePainterHelper> mElement;
139 #endif //CX_VTK_OPENGL2
Helper class for GPU rendering of slices.
boost::shared_ptr< class GPUImageDataBuffer > GPUImageDataBufferPtr
boost::shared_ptr< class GPUImageLutBuffer > GPUImageLutBufferPtr