33 #ifndef __H__UG_cylinder_soma_projector
34 #define __H__UG_cylinder_soma_projector
75 GlobalAttachments::declare_attachment<NPSurfParam>(
"npSurfParams",
true);
91 GlobalAttachments::declare_attachment<NPSurfParam>(
"npSurfParams",
true);
137 GlobalAttachments::declare_attachment<NPSurfParam>(
"npSurfParams",
true);
149 m_aSurfParams = GlobalAttachments::attachment<Attachment<NeuriteProjector::SurfaceParams> >(
"npSurfParams");
153 "No surface parameter attachment for neurite projector attached to grid.");
166 m_cah.set_grid(spMG);
171 template <
class TElem>
176 typename TElem::ConstVertexArray vrts = parent->vertices();
177 size_t numVrts = parent->num_vertices();
185 vector3 parentCenter (0, 0, 0);
187 for(
size_t i = 0; i < numVrts; ++i){
193 avDist /= (
number)numVrts;
200 if(len >
SMALL * avDist){
214 template <
class TElem>
216 size_t numSomaVerts = 0;
217 size_t nVrt = parent->num_vertices();
218 for (
size_t i = 0; i < nVrt; ++i) {
223 return numSomaVerts >= 2;
226 template <
class TElem>
250 template <
class Archive>
251 void serialize( Archive& ar,
const unsigned int version)
254 ar & make_nvp(
"axis",
m_axis);
255 ar & make_nvp(
"soma",
m_soma);;
#define UG_EMPTY_BASE_CLASS_SERIALIZATION(clsDerived, clsBase)
Definition: boost_serialization.h:51
int * refcount_ptr() const
WARNING: this method is DANGEROUS!
Definition: smart_pointer.h:263
A generic specialization of IAttachment.
Definition: attachment_pipe.h:263
handler for attachments in a multi-grid
Definition: copy_attachment_handler.h:103
Base-class for edges.
Definition: grid_base_objects.h:397
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
static bool is_declared(const std::string &name)
Definition: global_attachments.h:111
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
bool has_vertex_attachment(IAttachment &attachment)
Definition: grid.h:798
Definition: multi_grid.h:72
Adjusts vertex coordinates during refinement.
Definition: refinement_projector.h:55
void set_pos(Vertex *v, const vector3 &p)
Definition: refinement_projector.h:157
virtual void set_geometry(SPIGeometry3d geometry)
Definition: refinement_projector.h:76
vector3 pos(Vertex *v) const
Definition: refinement_projector.h:149
virtual SPIGeometry3d geometry() const
Definition: refinement_projector.h:81
Projects new vertices onto a sphere during refinement.
Definition: soma_projector.h:54
virtual number new_vertex(Vertex *vrt, Edge *parent)
called when a new vertex was created from an old edge.
Definition: soma_projector.h:115
void project_to_soma_surface(Vertex *vrt, TElem *parent)
Definition: soma_projector.h:227
void attach_surf_params()
helper method to attach surface parameters and do a consistency check
Definition: soma_projector.h:142
SomaProjector(SPIGeometry3d geometry, const vector3 ¢er, const vector3 &axis, const vector3 &soma, const number &rad)
Definition: soma_projector.h:96
virtual void set_geometry(SPIGeometry3d geometry)
Definition: soma_projector.h:60
virtual ~SomaProjector()
Definition: soma_projector.h:112
CopyAttachmentHandler< Vertex, Attachment< NeuriteProjector::SurfaceParams > > m_cah
Definition: soma_projector.h:58
SomaProjector()
Definition: soma_projector.h:67
vector3 m_center
Definition: soma_projector.h:260
Grid::VertexAttachmentAccessor< Attachment< NeuriteProjector::SurfaceParams > > m_aaSurfParams
Definition: soma_projector.h:57
virtual number new_vertex(Vertex *vrt, Face *parent)
called when a new vertex was created from an old face.
Definition: soma_projector.h:121
void check_attachment()
check if global attachment was declared
Definition: soma_projector.h:134
void serialize(Archive &ar, const unsigned int version)
Definition: soma_projector.h:251
Attachment< NeuriteProjector::SurfaceParams > m_aSurfParams
Definition: soma_projector.h:56
bool vertex_at_soma_surf(Vertex *vrt, TElem *parent)
Definition: soma_projector.h:215
vector3 m_soma
Definition: soma_projector.h:262
SomaProjector(const vector3 ¢er, const vector3 &axis, const vector3 &soma, const number &rad)
Definition: soma_projector.h:79
vector3 m_axis
Definition: soma_projector.h:261
friend class boost::serialization::access
Definition: soma_projector.h:248
virtual number new_vertex(Vertex *vrt, Volume *parent)
called when a new vertex was created from an old volume.
Definition: soma_projector.h:127
number m_somaRad
Definition: soma_projector.h:263
number perform_projection(Vertex *vrt, TElem *parent)
Definition: soma_projector.h:172
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
#define UG_COND_THROW(cond, msg)
UG_COND_THROW(cond, msg) : performs a UG_THROW(msg) if cond == true.
Definition: error.h:61
double number
Definition: types.h:124
number DistancePointToRay(const vector_t &v, const vector_t &from, const vector_t &dir)
calculates the distance of a point to a ray
Definition: math_util_impl.hpp:225
number ProjectPointToRay(vector_t &vOut, const vector_t &v, const vector_t &from, const vector_t &dir)
finds the projection of v onto the ray defined by from and dir
Definition: math_util_impl.hpp:160
vector_t::value_type VecLength(const vector_t &v)
returns the length of v. Slower than VecLengthSq.
Definition: math_vector_functions_common_impl.hpp:341
void VecSubtract(vector_t &vOut, const vector_t &v1, const vector_t &v2)
subtracts v2 from v1 and stores the result in a vOut
Definition: math_vector_functions_common_impl.hpp:226
MathVector< 3, number > vector3
a 3d vector
Definition: ugmath_types.h:72
void VecAdd(vector_t &vOut, const vector_t &v1, const vector_t &v2)
adds two MathVector<N>s and stores the result in a third one
Definition: math_vector_functions_common_impl.hpp:185
void VecScale(vector_t &vOut, const vector_t &v, typename vector_t::value_type s)
scales a MathVector<N>
Definition: math_vector_functions_common_impl.hpp:252
const number SMALL
Definition: math_constants.h:41