Commit efe2f95e6eb6ab7191c6431064ed193f91bb5c98
1 parent
945ee13c
changes needed to compile and run the bimsim code
Showing
138 changed files
with
137 additions
and
25 deletions
Show diff stats
1 | -#ifndef RTS_QUAD_H | |
2 | -#define RTS_QUAD_H | |
1 | +#ifndef STIM_QUAD_H | |
2 | +#define STIM_QUAD_H | |
3 | 3 | |
4 | 4 | //enable CUDA_CALLABLE macro |
5 | -#include <stim/cuda/callable.h> | |
5 | +#include <stim/cuda/cudatools/callable.h> | |
6 | 6 | #include <stim/math/vector.h> |
7 | 7 | #include <stim/math/triangle.h> |
8 | 8 | #include <stim/math/quaternion.h> |
... | ... | @@ -13,7 +13,7 @@ |
13 | 13 | namespace stim{ |
14 | 14 | |
15 | 15 | //template for a quadangle class in ND space |
16 | -template <class T, int N = 3> | |
16 | +template <class T> | |
17 | 17 | struct quad |
18 | 18 | { |
19 | 19 | /* |
... | ... | @@ -30,9 +30,9 @@ struct quad |
30 | 30 | T B[N]; |
31 | 31 | T C[N];*/ |
32 | 32 | |
33 | - rts::vec<T, N> A; | |
34 | - rts::vec<T, N> X; | |
35 | - rts::vec<T, N> Y; | |
33 | + stim::vec<T> A; | |
34 | + stim::vec<T> X; | |
35 | + stim::vec<T> Y; | |
36 | 36 | |
37 | 37 | |
38 | 38 | CUDA_CALLABLE quad() |
... | ... | @@ -40,7 +40,7 @@ struct quad |
40 | 40 | |
41 | 41 | } |
42 | 42 | |
43 | - CUDA_CALLABLE quad(vec<T, N> a, vec<T, N> b, vec<T, N> c) | |
43 | + CUDA_CALLABLE quad(vec<T> a, vec<T> b, vec<T> c) | |
44 | 44 | { |
45 | 45 | |
46 | 46 | A = a; |
... | ... | @@ -52,20 +52,20 @@ struct quad |
52 | 52 | /******************************************************************* |
53 | 53 | Constructor - create a quad from a position, normal, and rotation |
54 | 54 | *******************************************************************/ |
55 | - CUDA_CALLABLE quad(rts::vec<T, N> c, rts::vec<T, N> normal, T width, T height, T theta) | |
55 | + CUDA_CALLABLE quad(stim::vec<T> c, stim::vec<T> normal, T width, T height, T theta) | |
56 | 56 | { |
57 | 57 | |
58 | 58 | //compute the X direction - start along world-space X |
59 | - Y = rts::vec<T, N>(0, 1, 0); | |
59 | + Y = stim::vec<T>(0, 1, 0); | |
60 | 60 | if(Y == normal) |
61 | - Y = rts::vec<T, N>(0, 0, 1); | |
61 | + Y = stim::vec<T>(0, 0, 1); | |
62 | 62 | |
63 | 63 | X = Y.cross(normal).norm(); |
64 | 64 | |
65 | 65 | std::cout<<X<<std::endl; |
66 | 66 | |
67 | 67 | //rotate the X axis by theta radians |
68 | - rts::quaternion<T> q; | |
68 | + stim::quaternion<T> q; | |
69 | 69 | q.CreateRotation(theta, normal); |
70 | 70 | X = q.toMatrix3() * X; |
71 | 71 | Y = normal.cross(X); |
... | ... | @@ -85,7 +85,7 @@ struct quad |
85 | 85 | } |
86 | 86 | |
87 | 87 | //boolean comparison |
88 | - bool operator==(const quad<T, N> & rhs) | |
88 | + bool operator==(const quad<T> & rhs) | |
89 | 89 | { |
90 | 90 | if(A == rhs.A && X == rhs.X && Y == rhs.Y) |
91 | 91 | return true; |
... | ... | @@ -96,21 +96,21 @@ struct quad |
96 | 96 | /******************************************* |
97 | 97 | Return the normal for the quad |
98 | 98 | *******************************************/ |
99 | - CUDA_CALLABLE rts::vec<T, N> n() | |
99 | + CUDA_CALLABLE stim::vec<T> n() | |
100 | 100 | { |
101 | 101 | return (X.cross(Y)).norm(); |
102 | 102 | } |
103 | 103 | |
104 | - CUDA_CALLABLE rts::vec<T, N> p(T a, T b) | |
104 | + CUDA_CALLABLE stim::vec<T> p(T a, T b) | |
105 | 105 | { |
106 | - rts::vec<T, N> result; | |
106 | + stim::vec<T> result; | |
107 | 107 | //given the two parameters a, b = [0 1], returns the position in world space |
108 | 108 | result = A + X * a + Y * b; |
109 | 109 | |
110 | 110 | return result; |
111 | 111 | } |
112 | 112 | |
113 | - CUDA_CALLABLE rts::vec<T, N> operator()(T a, T b) | |
113 | + CUDA_CALLABLE stim::vec<T> operator()(T a, T b) | |
114 | 114 | { |
115 | 115 | return p(a, b); |
116 | 116 | } |
... | ... | @@ -127,15 +127,15 @@ struct quad |
127 | 127 | |
128 | 128 | } |
129 | 129 | |
130 | - CUDA_CALLABLE quad<T, N> operator*(T rhs) | |
130 | + CUDA_CALLABLE quad<T> operator*(T rhs) | |
131 | 131 | { |
132 | 132 | //scales the plane by a scalar value |
133 | 133 | |
134 | 134 | //compute the center point |
135 | - rts::vec<T, N> c = A + X*0.5f + Y*0.5f; | |
135 | + stim::vec<T> c = A + X*0.5f + Y*0.5f; | |
136 | 136 | |
137 | 137 | //create the new quadangle |
138 | - quad<T, N> result; | |
138 | + quad<T> result; | |
139 | 139 | result.X = X * rhs; |
140 | 140 | result.Y = Y * rhs; |
141 | 141 | result.A = c - result.X*0.5f - result.Y*0.5f; |
... | ... | @@ -144,7 +144,7 @@ struct quad |
144 | 144 | |
145 | 145 | } |
146 | 146 | |
147 | - CUDA_CALLABLE T dist(vec<T, N> p) | |
147 | + CUDA_CALLABLE T dist(vec<T> p) | |
148 | 148 | { |
149 | 149 | //compute the distance between a point and this quad |
150 | 150 | |
... | ... | @@ -162,7 +162,7 @@ struct quad |
162 | 162 | return d1; |
163 | 163 | } |
164 | 164 | |
165 | - CUDA_CALLABLE T dist_max(vec<T, N> p) | |
165 | + CUDA_CALLABLE T dist_max(vec<T> p) | |
166 | 166 | { |
167 | 167 | T da = (A - p).len(); |
168 | 168 | T db = (A+X - p).len(); |
... | ... | @@ -176,7 +176,7 @@ struct quad |
176 | 176 | } //end namespace rts |
177 | 177 | |
178 | 178 | template <typename T, int N> |
179 | -std::ostream& operator<<(std::ostream& os, rts::quad<T, N> R) | |
179 | +std::ostream& operator<<(std::ostream& os, stim::quad<T> R) | |
180 | 180 | { |
181 | 181 | os<<R.str(); |
182 | 182 | return os; | ... | ... |
1 | +[General] | ... | ... |
No preview for this file type
1 | +[General] | ... | ... |
1 | +biology/fibernet.h | |
2 | +biomodels/flow.h | |
3 | +biomodels/network.h | |
4 | +cuda/array_abs.cuh | |
5 | +cuda/array_add.cuh | |
6 | +cuda/array_cart2polar.cuh | |
7 | +cuda/array_multiply.cuh | |
8 | +cuda/arraymath.cuh | |
9 | +cuda/callable.h | |
10 | +cuda/conv2.cuh | |
11 | +cuda/cost.h | |
12 | +cuda/devices.h | |
13 | +cuda/down_sample.cuh | |
14 | +cuda/error.h | |
15 | +cuda/filter.h | |
16 | +cuda/gaussian_blur.cuh | |
17 | +cuda/glbind.h | |
18 | +cuda/gradient.cuh | |
19 | +cuda/local_max.cuh | |
20 | +cuda/sharedmem.cuh | |
21 | +cuda/threads.h | |
22 | +cuda/timer.h | |
23 | +cuda/update_dir.cuh | |
24 | +cuda/vote.cuh | |
25 | +envi/bil.h | |
26 | +envi/binary.h | |
27 | +envi/bip.h | |
28 | +envi/bsq.h | |
29 | +envi/envi.h | |
30 | +envi/envi_header.h | |
31 | +gl/error.h | |
32 | +gl/gl_spider.h | |
33 | +gl/gl_texture.h | |
34 | +gl/rts_glShaderObject.h | |
35 | +gl/rts_glShaderProgram.h | |
36 | +gl/rts_glShaderUniform.h | |
37 | +gl/rts_glUtilities.h | |
38 | +gl/rtsSourceCode.h | |
39 | +gl/texture.h | |
40 | +grids/grid.h | |
41 | +grids/image_stack.h | |
42 | +image/CImg.h | |
43 | +image/image.h | |
44 | +image/image_contour_detection.h | |
45 | +math/bessel.h | |
46 | +math/complex.h | |
47 | +math/complexfield.cuh | |
48 | +math/constants.h | |
49 | +math/field.cuh | |
50 | +math/function.h | |
51 | +math/legendre.h | |
52 | +math/matrix.h | |
53 | +math/plane.h | |
54 | +math/quad.h | |
55 | +math/quaternion.h | |
56 | +math/realfield.cuh | |
57 | +math/rect.h | |
58 | +math/spharmonics.h | |
59 | +math/triangle.h | |
60 | +math/vector.h | |
61 | +optics/beam.h | |
62 | +optics/efield.cuh | |
63 | +optics/esphere.cuh | |
64 | +optics/halfspace.cuh | |
65 | +optics/material.h | |
66 | +optics/mirst-1d.cuh | |
67 | +optics/planewave.h | |
68 | +parser/arguments.h | |
69 | +parser/filename.h | |
70 | +parser/parser.h | |
71 | +parser/wildcards.h | |
72 | +ui/progressbar.h | |
73 | +visualization/camera.h | |
74 | +visualization/colormap.h | |
75 | +visualization/gl_spharmonics.h | |
76 | +visualization/glObj.h | |
77 | +visualization/obj.h | |
0 | 78 | \ No newline at end of file | ... | ... |