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;
63 #if !defined(CX_VTK_OPENGL2) && !defined(WIN32) 81 void SetColorAttribute(
float window,
float level,
float llr,
float alpha);
82 void initializeRendering();
83 void setUniformiArray(vtkUniformVariables* uniforms, QString name,
int val);
84 void setUniformfArray(vtkUniformVariables* uniforms, QString name,
float val);
85 void eachRenderInternal(vtkSmartPointer<vtkShaderProgram2> shader);
103 virtual void ReleaseGraphicsResources(vtkWindow *);
104 void PrintSelf(ostream& os, vtkIndent indent);
106 void setShaderPath(QString path);
107 void SetColorAttribute(
int index,
float window,
float level,
float llr,
float alpha);
110 void releaseGraphicsResources(
int index);
112 static bool LoadRequiredExtensions(vtkOpenGLExtensionManager* mgr);
117 virtual void PrepareForRendering(vtkRenderer*, vtkActor*);
118 void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
unsigned long typeflags,
bool forceCompileOnly);
119 bool CanRender(vtkRenderer*, vtkActor*);
120 static bool LoadRequiredExtension(vtkOpenGLExtensionManager* mgr, QString
id);
121 void ClearGraphicsResources();
124 QString loadShaderFile();
125 void buildProgram(QString shaderSource, vtkOpenGLRenderWindow* renderWindow);
127 QString replaceShaderSourceMacros(QString shaderSource);
129 bool hasLoadedExtensions;
132 vtkWeakPointer<vtkRenderWindow> LastContext;
133 vtkSmartPointer<vtkShaderProgram2> Shader;
134 std::vector<SingleVolumePainterHelper> mElement;
137 #endif //CX_VTK_OPENGL2
Helper class for GPU rendering of slices.
boost::shared_ptr< class GPUImageDataBuffer > GPUImageDataBufferPtr
boost::shared_ptr< class GPUImageLutBuffer > GPUImageLutBufferPtr
Namespace for all CustusX production code.