Kinetic Visualization
 All Classes Functions Variables Pages
Slicing.h
1 #pragma once
2 
3 #include "Shader.h"
4 #include "GLM/gtx.hpp"
5 #include "GLM/gtc.hpp"
6 #include "GLM/gtx/type_ptr.hpp"
7 
8 
9 class Slicing
10 
11 {
12 
13 public:
15  Slicing();
17  ~Slicing();
18 
22  void init();
28  void resize(int width, int height);
32  void render();
33 
38  void setSlicingTextureHandle(GLuint tex);
43  void setTransferTextureHandle(GLuint tex);
48  void setTransferFunction(bool active);
55  void setVolumeSize(float width, float height,float depth);
60  void setTextureLoaded(bool loaded);
61 
67  void setXSlice(float x);
73  void setYSlice(float y);
79  void setZSlice(float z);
80 
81 protected:
82 
83 private:
85  Shader* shader;
87  int screenWidth;
89  int screenHeight;
91  glm::mat4 view;
92 
94  bool textureLoaded;
96  float volumeWidth;
98  float volumeHeight;
100  float volumeDepth;
101 
103  glm::vec4* quadVerticesX;
105  glm::vec4* quadVerticesY;
107  glm::vec4* quadVerticesZ;
108 
110  glm::vec3* quadTexCoordsX;
112  glm::vec3* quadTexCoordsY;
114  glm::vec3* quadTexCoordsZ;
115 
117  GLuint slicingTextureHandle;
119  GLuint transferTextureHandle;
121  bool transferFunction;
122 
124  void calculateTexturePosition();
132  void setQuadVerticesX(float PosX, float PosY, float sizeX, float sizeY);
140  void setQuadVerticesY(float PosX, float PosY, float sizeX, float sizeY);
148  void setQuadVerticesZ(float PosX, float PosY, float sizeX, float sizeY);
149 };