diff --git a/stim/gl/gl_spider.h b/stim/gl/gl_spider.h index a3cf9b5..e49edc6 100644 --- a/stim/gl/gl_spider.h +++ b/stim/gl/gl_spider.h @@ -317,7 +317,8 @@ class gl_spider // : public virtual gl_texture } stim::vec3 v = cyl.surf(pval, result[i][0]); ///find the coordinates of the point at pval on the surface in tissue space. stim::vec3 di = cyl.p(pval); ///find the coord of v in tissue space projected on the centerline. - float rad = cyl.r(pval)/2; ///find the radius at the pvalue's location + float rad = cyl.r(pval); ///find the radius at the pvalue's location + // float rad = cyl.r(pval)/2; ///find the radius at the pvalue's location if( !(v[0] > size[0] || v[1] > size[1] || v[2] > size[2] || v[0] < 0 @@ -374,7 +375,7 @@ class gl_spider // : public virtual gl_texture ///Stored in a display list. ///uses the default d vector <0,0,1> void - genDirectionVectors(float solidAngle = stim::PI/2) + genDirectionVectors(float solidAngle = 3*stim::PI/4) { //Set up the vectors necessary for Rectangle creation. diff --git a/stim/image/image.h b/stim/image/image.h index ff155c4..ea948e9 100644 --- a/stim/image/image.h +++ b/stim/image/image.h @@ -141,7 +141,7 @@ public: //save a Netpbm file void load_netpbm(std::string filename) { - std::ifstream infile(filename, std::ios::in | std::ios::binary); //open an output file + std::ifstream infile(filename.c_str(), std::ios::in | std::ios::binary); //open an output file if (!infile) { std::cout << "Error opening input file in image::load_netpbm()" << std::endl; exit(1); @@ -244,7 +244,7 @@ public: //save a Netpbm file void save_netpbm(std::string filename) { - std::ofstream outfile(filename, std::ios::out | std::ios::binary); //open an output file + std::ofstream outfile(filename.c_str(), std::ios::out | std::ios::binary); //open an output file if(!outfile) { std::cout << "Error generating output file in image::save_netpbm()" << std::endl; exit(1); @@ -356,8 +356,8 @@ public: } /// Returns an std::vector containing each channel as a separate image - std::vector> split() const { - std::vector> r; //create an image array + std::vector > split() const { + std::vector > r; //create an image array r.resize(C()); //create images for each channel for (size_t c = 0; c < C(); c++) { //for each channel @@ -367,7 +367,7 @@ public: } /// Merge a series of single-channel images into a multi-channel image - void merge(std::vector>& list) { + void merge(std::vector >& list) { size_t x = list[0].width(); //calculate the size of the image size_t y = list[0].height(); allocate(x, y, list.size()); //re-allocate the image diff --git a/stim/math/vec3.h b/stim/math/vec3.h index 6e27265..752b094 100644 --- a/stim/math/vec3.h +++ b/stim/math/vec3.h @@ -68,7 +68,7 @@ public: } - /// Convert the vector from cartesian to spherical coordinates (x, y, z -> r, theta, phi where theta = [0, 2*pi]) + /// Convert the vector from cartesian to spherical coordinates (x, y, z -> r, theta, phi where theta = [-PI, PI]) CUDA_CALLABLE vec3 cart2sph() const{ vec3 sph; sph.ptr[0] = len(); @@ -236,6 +236,13 @@ public: return result; } + CUDA_CALLABLE bool operator==(vec3 rhs) const{ + if(rhs[0] == ptr[0] && rhs[1] == ptr[1] && rhs[2] == ptr[2]) + return true; + else + return false; + } + //#ifndef __NVCC__ /// Outputs the vector as a string std::string str() const{ -- libgit2 0.21.4