From ee17b90b85ed02d46daf671d28522da6293f1ec7 Mon Sep 17 00:00:00 2001 From: Jiaming Guo Date: Wed, 18 Jan 2017 14:59:41 -0600 Subject: [PATCH] make it compatible on linux --- stim/biomodels/network.h | 4 ++-- stim/math/circle.h | 4 +++- stim/structures/kdtree.cuh | 2 +- stim/visualization/cylinder.h | 26 +++++++++++++++----------- stim/visualization/swc.h | 2 +- 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/stim/biomodels/network.h b/stim/biomodels/network.h index 4559390..782f418 100644 --- a/stim/biomodels/network.h +++ b/stim/biomodels/network.h @@ -71,7 +71,7 @@ class network{ /// Constructor - creates an edge from a list of points by calling the stim::fiber constructor ///@param p is an array of positions in space - edge(centerline p) : cylinder(p){} + edge(stim::centerline p) : cylinder(p){} /// Copy constructor creates an edge from a cylinder edge(stim::cylinder f) : cylinder(f) {} @@ -673,7 +673,7 @@ public: //compare each point in the current network to the field produced by A kdt.create(c, n_data, MaxTreeLevels); // build a KD tree - std::vector> relation; // the relationship between GT and T corresponding to NN + std::vector > relation; // the relationship between GT and T corresponding to NN relation.resize(A.E.size()); for(unsigned e = 0; e < A.E.size(); e++){ //for each edge in A diff --git a/stim/math/circle.h b/stim/math/circle.h index 9e94a0f..23b5c1a 100644 --- a/stim/math/circle.h +++ b/stim/math/circle.h @@ -35,6 +35,8 @@ public: using stim::plane::rotate; using stim::plane::setU; + using stim::plane::init; + ///base constructor ///@param th value of the angle of the starting point from 0 to 360. CUDA_CALLABLE @@ -137,7 +139,7 @@ public: bool operator==(const circle & rhs) { - if(P == rhs.P && U == rhs.U && Y == rhs.Y) + if(P == rhs.P && U == rhs.U) return true; else return false; diff --git a/stim/structures/kdtree.cuh b/stim/structures/kdtree.cuh index c21492e..c0c751a 100644 --- a/stim/structures/kdtree.cuh +++ b/stim/structures/kdtree.cuh @@ -360,7 +360,7 @@ namespace stim { //bb.init(&h_reference_points[0]); //aaboundingboxing(bb, h_reference_points, reference_count); - std::vector < typename cpu_kdtree::point> reference_points(reference_count); // restore the reference points in particular way + std::vector < typename cpu_kdtree::point > reference_points(reference_count); // restore the reference points in particular way for (size_t j = 0; j < reference_count; j++) for (size_t i = 0; i < D; i++) reference_points[j].dim[i] = h_reference_points[j * D + i]; // creating a tree on cpu diff --git a/stim/visualization/cylinder.h b/stim/visualization/cylinder.h index 50d8e8e..9c218cf 100644 --- a/stim/visualization/cylinder.h +++ b/stim/visualization/cylinder.h @@ -11,6 +11,8 @@ namespace stim template class cylinder : public centerline { protected: + + using stim::centerline::d; std::vector< stim::vec3 > U; //stores the array of U vectors defining the Frenet frame std::vector< T > R; //stores a list of magnitudes for each point in the centerline (assuming mags[0] is the radius) @@ -36,23 +38,25 @@ public: using stim::centerline::size; using stim::centerline::at; + using stim::centerline::L; + using stim::centerline::length; - cylinder() : centerline(){} - - cylinder(centerline& c) : centerline(c) { - init(); - } + cylinder() : centerline(){} - cylinder(centerline& c, T r) : centerline(c) { + cylinder(centerlinec) : centerline(c) { init(); - //add_mag(r); } + //cylinder(centerlinec, T r) : centerline(c) { + // init(); + // //add_mag(r); + //} + //initialize a cylinder with a list of points and magnitude values - cylinder(centerline& c, std::vector r) : centerline(c){ - init(); - //add_mag(r); - } + //cylinder(centerlinec, std::vector r) : centerline(c){ + // init(); + // //add_mag(r); + //} //copy the original radius void copy_r(std::vector radius) { diff --git a/stim/visualization/swc.h b/stim/visualization/swc.h index 365aeca..634ab5b 100644 --- a/stim/visualization/swc.h +++ b/stim/visualization/swc.h @@ -85,7 +85,7 @@ namespace stim { template class swc { public: - std::vector< typename swc_tree::swc_node> node; + std::vector< typename swc_tree::swc_node > node; swc() {}; // default constructor // load the swc as tree nodes -- libgit2 0.21.4