-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathslice.h
More file actions
50 lines (37 loc) · 1.12 KB
/
Copy pathslice.h
File metadata and controls
50 lines (37 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef SLICE_H
#define SLICE_H
#include "global.h"
#include "rendering/renderable.h"
#include <vtkSmartPointer.h>
#include <vtkMatrix4x4.h>
class vtkImageData;
class vtkImageReslice;
class Slice : public Renderable
{
public:
Slice(vtkSmartPointer<vtkImageData> data);
// (GL context)
void bind();
void setSlice(const Matrix4& mat, float clipDist, float zoomFactor);
bool isEmpty() const { return mEmpty; }
void setOpaque(bool opaque);
// (GL context)
void render(const Matrix4& projectionMatrix, const Matrix4& modelViewMatrix);
private:
// (GL context)
void updateTexture();
// (GL context)
void switchMaterial(MaterialSharedPtr newMaterial);
MaterialSharedPtr mMaterial;
MaterialSharedPtr mDefaultMaterial, mOpaqueMaterial;
GLuint mTextureHandle;
vtkSmartPointer<vtkImageData> mData;
Synchronized<vtkSmartPointer<vtkImageReslice>> mSliceFilter;
vtkSmartPointer<vtkMatrix4x4> mTransformMatrix;
bool mBound, mEmpty, mDirty, mOpaque;
GLint mVertexAttrib, mTexCoordAttrib;
GLint mProjectionUniform, mModelViewUniform;
Synchronized<std::vector<unsigned char>> mTextureData;
double mRange[2];
};
#endif /* SLICE_H */