Volume Renderer DoF
Volume.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
4 #include <string>
5 #include <iostream>
6 
7 #include <QtWidgets\qprogressbar.h>
8 #include <QtWidgets\qprogressdialog.h>
9 
10 
11 //-------------------------------------------------------------------------------------------------
12 // Voxel
13 //-------------------------------------------------------------------------------------------------
14 
15 class Voxel
16 {
17  public:
18 
19  Voxel();
20  Voxel(const Voxel &other);
21  Voxel(const float value);
22 
23  ~Voxel();
24 
25 
26  // VOXEL VALUE
27 
28  void setValue(const float value);
29  const float getValue() const;
30 
31 
32  // OPERATORS
33 
34  const bool operator==(const Voxel &other) const;
35  const bool operator!=(const Voxel &other) const;
36  const bool operator>(const Voxel &other) const;
37  const bool operator>=(const Voxel &other) const;
38  const bool operator<(const Voxel &other) const;
39  const bool operator<=(const Voxel &other) const;
40 
41  const Voxel operator+(const Voxel &other) const;
42  const Voxel operator-(const Voxel &other) const;
43  const Voxel operator*(const float &value) const;
44  const Voxel operator/(const float &value) const;
45 
46  const Voxel& operator+=(const Voxel &other);
47  const Voxel& operator-=(const Voxel &other);
48  const Voxel& operator*=(const float &value);
49  const Voxel& operator/=(const float &value);
50 
51 
52  private:
53 
54  float m_Value;
55 
56 };
57 
58 
59 //-------------------------------------------------------------------------------------------------
60 // Volume
61 //-------------------------------------------------------------------------------------------------
62 
63 class Volume
64 {
65 
66  public:
67 
68  Volume();
69  ~Volume();
70 
71 
72  // VOLUME DATA
73 
74  const Voxel& voxel(const int i) const;
75  const Voxel& voxel(const int x, const int y, const int z) const;
76  const Voxel* voxels() const;
77 
78  const int width() const;
79  const int height() const;
80  const int depth() const;
81 
82  const int size() const;
83 
84  bool loadFromFile(QString filename, QProgressBar* progressBar);
85  //bool loadFromFile(QString filename, QProgressDialog* progressBar);
86  const std::vector<Voxel>& getVoxels();
87 
88  // TEST
89  const unsigned int getTXO() const;
90 
91 
92  private:
93 
94  std::vector<Voxel> m_Voxels;
95 
96  int m_Width;
97  int m_Height;
98  int m_Depth;
99 
100  int m_Size;
101 
102  //test
103  unsigned int txo;
104 
105 };
const bool operator>=(const Voxel &other) const
Definition: Volume.cpp:54
const Voxel & operator*=(const float &value)
Definition: Volume.cpp:81
Voxel()
Definition: Volume.cpp:10
Definition: Volume.h:63
const Voxel operator+(const Voxel &other) const
Definition: Volume.cpp:93
const bool operator<(const Voxel &other) const
Definition: Volume.cpp:59
const Voxel operator*(const float &value) const
Definition: Volume.cpp:107
const bool operator<=(const Voxel &other) const
Definition: Volume.cpp:64
void setValue(const float value)
Definition: Volume.cpp:29
const Voxel & operator+=(const Voxel &other)
Definition: Volume.cpp:69
const Voxel operator/(const float &value) const
Definition: Volume.cpp:114
const Voxel & operator-=(const Voxel &other)
Definition: Volume.cpp:75
const bool operator!=(const Voxel &other) const
Definition: Volume.cpp:44
const Voxel operator-(const Voxel &other) const
Definition: Volume.cpp:100
Definition: Volume.h:15
const float getValue() const
Definition: Volume.cpp:34
~Voxel()
Definition: Volume.cpp:25
const bool operator==(const Voxel &other) const
Definition: Volume.cpp:39
const bool operator>(const Voxel &other) const
Definition: Volume.cpp:49
const Voxel & operator/=(const float &value)
Definition: Volume.cpp:87