Commit cc8715ef39dca79ec54bd9171422e14e12bd0020

Authored by dmayerich
1 parent a47a23a9

organization

rts/cuda_callable.h renamed to rts/cuda/callable.h
rts/cuda_handle_error.h renamed to rts/cuda/error.h
rts/cuda_timer.h renamed to rts/cuda/timer.h
envi/EnviClose.h renamed to rts/envi/EnviClose.h
envi/EnviFid.h renamed to rts/envi/EnviFid.h
envi/EnviHeader.h renamed to rts/envi/EnviHeader.h
envi/EnviOpen.h renamed to rts/envi/EnviOpen.h
envi/EnviRead.h renamed to rts/envi/EnviRead.h
envi/EnviWrite.h renamed to rts/envi/EnviWrite.h
envi/rtsEnvi.h renamed to rts/envi/envi.h
rts/rtsComplex.h renamed to rts/math/complex.h
rts/legendre.h renamed to rts/math/legendre.h
1 1 #ifndef RTS_LEGENDRE_H
2 2 #define RTS_LEGENDRE_H
3 3  
4   -#include "rts/cuda_callable.h"
  4 +#include "rts/cuda/callable.h"
5 5  
6 6 namespace rts{
7 7  
... ...
rts/rtsMatrix.h renamed to rts/math/matrix.h
rts/rtsPoint.h renamed to rts/math/point.h
rts/rtsQuad.h renamed to rts/math/quad.h
... ... @@ -2,9 +2,9 @@
2 2 #define RTS_RECT_H
3 3  
4 4 //enable CUDA_CALLABLE macro
5   -#include "rts/cuda_callable.h"
6   -#include "rts/rtsVector.h"
7   -#include "rts/rtsPoint.h"
  5 +#include "rts/cuda/callable.h"
  6 +#include "rts/math/vector.h"
  7 +#include "rts/math/point.h"
8 8 #include <iostream>
9 9  
10 10 namespace rts{
... ... @@ -105,7 +105,7 @@ struct rtsQuad
105 105 rts::rtsPoint<T, N> result;
106 106 //given the two parameters a, b = [0 1], returns the position in world space
107 107 result = A + X * a + Y * b;
108   -
  108 +
109 109 return result;
110 110 }
111 111  
... ... @@ -155,4 +155,4 @@ std::ostream&amp; operator&lt;&lt;(std::ostream&amp; os, rts::rtsQuad&lt;T, N&gt; R)
155 155 }
156 156  
157 157  
158   -#endif
159 158 \ No newline at end of file
  159 +#endif
... ...
rts/rtsQuaternion.h renamed to rts/math/quaternion.h
1   -#include "rtsMatrix.h"
  1 +#include "rts/math/matrix.h"
2 2  
3 3 #ifndef RTS_QUATERNION_H
4 4 #define RTS_QUATERNION_H
... ... @@ -19,7 +19,7 @@ public:
19 19 void CreateRotation(T theta, rtsVector<T, 3> axis);
20 20 rtsQuaternion<T> operator*(rtsQuaternion<T> &rhs);
21 21 rtsMatrix<T, 3> toMatrix();
22   -
  22 +
23 23  
24 24 rtsQuaternion();
25 25 rtsQuaternion(T w, T x, T y, T z);
... ... @@ -60,7 +60,7 @@ rtsQuaternion&lt;T&gt; rtsQuaternion&lt;T&gt;::operator *(rtsQuaternion&lt;T&gt; &amp;param)
60 60  
61 61 A = (w + x)*(param.w + param.x);
62 62 B = (z - y)*(param.y - param.z);
63   - C = (w - x)*(param.y + param.z);
  63 + C = (w - x)*(param.y + param.z);
64 64 D = (y + z)*(param.w - param.x);
65 65 E = (x + z)*(param.x + param.y);
66 66 F = (x - z)*(param.x - param.y);
... ... @@ -69,8 +69,8 @@ rtsQuaternion&lt;T&gt; rtsQuaternion&lt;T&gt;::operator *(rtsQuaternion&lt;T&gt; &amp;param)
69 69  
70 70 rtsQuaternion<T> result;
71 71 result.w = B + (-E - F + G + H) /2;
72   - result.x = A - (E + F + G + H)/2;
73   - result.y = C + (E - F + G - H)/2;
  72 + result.x = A - (E + F + G + H)/2;
  73 + result.y = C + (E - F + G - H)/2;
74 74 result.z = D + (E - F - G + H)/2;
75 75  
76 76 return result;
... ...
rts/sbessel.h renamed to rts/math/spherical_bessel.h
rts/rtsVector.h renamed to rts/math/vector.h
rts/material.h renamed to rts/optics/material.h
... ... @@ -8,7 +8,7 @@
8 8 #include <complex>
9 9 #include <algorithm>
10 10 #include <sstream>
11   -#include "rts/rtsComplex.h"
  11 +#include "rts/math/complex.h"
12 12  
13 13 #define PI 3.14159
14 14  
... ...
rts/rect.h deleted
1   -#ifndef RTS_RECT_H
2   -#define RTS_RECT_H
3   -
4   -//enable CUDA_CALLABLE macro
5   -#include "rts/cuda_callable.h"
6   -#include "rts/rtsVector.h"
7   -#include "rts/rtsPoint.h"
8   -#include <iostream>
9   -
10   -namespace rts{
11   -
12   -//template for a rectangle class in ND space
13   -template <class T, int N>
14   -struct rect
15   -{
16   - /*
17   - C------------------>O
18   - ^ ^
19   - | |
20   - Y |
21   - | |
22   - | |
23   - A---------X-------->B
24   - */
25   -
26   - /*T A[N];
27   - T B[N];
28   - T C[N];*/
29   -
30   - rts::rtsPoint<T, N> A;
31   - rts::rtsVector<T, N> X;
32   - rts::rtsVector<T, N> Y;
33   -
34   -
35   - CUDA_CALLABLE rect()
36   - {
37   -
38   - }
39   -
40   - CUDA_CALLABLE rect(rtsPoint<T, N> a, rtsPoint<T, N> b, rtsPoint<T, N> c)
41   - {
42   -
43   - A = a;
44   - X = b - a;
45   - Y = c - a;
46   -
47   - }
48   -
49   - CUDA_CALLABLE rect(rts::rtsPoint<T, N> pMin, rts::rtsPoint<T, N> pMax, rts::rtsVector<T, N> normal)
50   - {
51   -
52   - //assign the corner rtsPoint
53   - A = pMin;
54   -
55   - //compute the vector from pMin to pMax
56   - rts::rtsVector<T, 3> v0;
57   - v0 = pMax - pMin;
58   -
59   - //compute the cross product of A and the plane normal
60   - rts::rtsVector<T, 3> v1;
61   - v1 = v0.cross(normal);
62   -
63   -
64   - //calculate rtsPoint B
65   - rts::rtsPoint<T, 3> B;
66   - B = A + v0 * 0.5 + v1 * 0.5;
67   -
68   - //calculate rtsPoint C
69   - rts::rtsPoint<T, 3> C;
70   - C = A + v0 * 0.5 - v1 * 0.5;
71   -
72   - //calculate X and Y
73   - X = B - A;
74   - Y = C - A;
75   -
76   -
77   -
78   -
79   - }
80   -
81   - /*CUDA_CALLABLE rect(rts::rtsPoint<T, N> p, rts::vector<T, N> x, rts::vector<T, N> y, T sx, T sy)
82   - {
83   - //This constructor creates a rect given a position, orientation, and size
84   - // p = center position of the rect
85   - // x = x-axis for the rectangle
86   - // y = y-axis for the rectangle
87   - // sx = size of the rect along the A-B axis
88   - // sy = size of the rect along the A-C axis
89   -
90   - //normalize x and y
91   - rts::vector<T, N> nx = x.norm();
92   - rts::vector<T, N> ny = y.norm();
93   -
94   - //compute X and Y
95   - X = sx * x;
96   - Y = sy * y;
97   -
98   - //compute A
99   - A = p - 0.5 * X - 0.5 * Y;
100   -
101   - }*/
102   -
103   - CUDA_CALLABLE rts::rtsPoint<T, N> p(T a, T b)
104   - {
105   - rts::rtsPoint<T, N> result;
106   - //given the two parameters a, b = [0 1], returns the position in world space
107   - result = A + X * a + Y * b;
108   -
109   - return result;
110   - }
111   -
112   - CUDA_CALLABLE rts::rtsPoint<T, N> operator()(T a, T b)
113   - {
114   - return p(a, b);
115   - }
116   -
117   - std::string toStr()
118   - {
119   - std::stringstream ss;
120   -
121   - ss<<"A = "<<A<<std::endl;
122   - ss<<"B = "<<A + X<<std::endl;
123   - ss<<"C = "<<A + X + Y<<std::endl;
124   - ss<<"D = "<<A + Y<<std::endl;
125   -
126   - return ss.str();
127   -
128   - }
129   -
130   - CUDA_CALLABLE rect<T, N> operator*(T rhs)
131   - {
132   - //scales the plane by a scalar value
133   -
134   - //compute the center rtsPoint
135   - rts::rtsPoint<T, N> c = A + X*0.5 + Y*0.5;
136   -
137   - //create the new rectangle
138   - rect<T, N> result;
139   - result.X = X * rhs;
140   - result.Y = Y * rhs;
141   - result.A = c - result.X*0.5 - result.Y*0.5;
142   -
143   - return result;
144   -
145   - }
146   -};
147   -
148   -} //end namespace rts
149   -
150   -template <typename T, int N>
151   -std::ostream& operator<<(std::ostream& os, rts::rect<T, N> R)
152   -{
153   - os<<R.toStr();
154   - return os;
155   -}
156   -
157   -
158   -#endif
159 0 \ No newline at end of file
rts/rtsProgressBar.h renamed to rts/tools/progressbar.h