summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnthony LaTorre <tlatorre9@gmail.com>2011-08-08 11:03:07 -0400
committerAnthony LaTorre <tlatorre9@gmail.com>2011-08-08 11:03:07 -0400
commitf6109fc8939c55a9ef8244806d00b3ee07ee1b13 (patch)
tree0a3d84cc5fb29412743999b3d28654442389422f /src
parent3a8a4c4dd095ff25a1dbe70e387e166f43a5644b (diff)
downloadchroma-f6109fc8939c55a9ef8244806d00b3ee07ee1b13.tar.gz
chroma-f6109fc8939c55a9ef8244806d00b3ee07ee1b13.tar.bz2
chroma-f6109fc8939c55a9ef8244806d00b3ee07ee1b13.zip
add a simple event viewer. view events by running ./camera.py <detector_name> -i <name_of_io_file>.
Diffstat (limited to 'src')
-rw-r--r--src/mesh.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesh.h b/src/mesh.h
index ec5a508..e0170ff 100644
--- a/src/mesh.h
+++ b/src/mesh.h
@@ -148,6 +148,23 @@ __global__ void set_colors(unsigned int *colors)
g_colors = colors;
}
+__global__ void color_solids(int nthreads, unsigned int ntriangles, int *solid_id_map, int *solid_ids, unsigned int *solid_colors)
+{
+ int id = blockIdx.x*blockDim.x + threadIdx.x;
+
+ if (id >= nthreads)
+ return;
+
+ int solid_id = solid_ids[id];
+ unsigned int color = solid_colors[id];
+
+ for (int i=0; i < ntriangles; i++)
+ {
+ if (solid_id_map[i] == solid_id)
+ g_colors[i] = color;
+ }
+}
+
} // extern "c"
#endif