ug4
ug::SomaProjector Class Reference

Projects new vertices onto a sphere during refinement. More...

#include <soma_projector.h>

+ Inheritance diagram for ug::SomaProjector:

Public Member Functions

virtual number new_vertex (Vertex *vrt, Edge *parent)
 called when a new vertex was created from an old edge. More...
 
virtual number new_vertex (Vertex *vrt, Face *parent)
 called when a new vertex was created from an old face. More...
 
virtual number new_vertex (Vertex *vrt, Volume *parent)
 called when a new vertex was created from an old volume. More...
 
 SomaProjector ()
 
 SomaProjector (const vector3 &center, const vector3 &axis, const vector3 &soma, const number &rad)
 
 SomaProjector (SPIGeometry3d geometry, const vector3 &center, const vector3 &axis, const vector3 &soma, const number &rad)
 
virtual ~SomaProjector ()
 
- Public Member Functions inherited from ug::RefinementProjector
virtual SPIGeometry3d geometry () const
 
virtual number new_vertex (Vertex *vrt, Vertex *parent)
 called when a new vertex was created from an old vertex. More...
 
virtual void refinement_begins (const ISubGrid *sg)
 called before refinement begins More...
 
virtual bool refinement_begins_requires_subgrid () const
 
virtual void refinement_ends ()
 called when refinement is done More...
 
 RefinementProjector ()
 
 RefinementProjector (SPElementCallback cb)
 
 RefinementProjector (SPIGeometry3d geometry)
 
 RefinementProjector (SPIGeometry3d geometry, SPElementCallback concernedElems)
 
virtual void set_concerned_elements (SPElementCallback cb)
 
virtual ~RefinementProjector ()
 

Protected Member Functions

virtual void set_geometry (SPIGeometry3d geometry)
 
- Protected Member Functions inherited from ug::RefinementProjector
IGeometry3dgeom ()
 
const IGeometry3dgeom () const
 
template<class TElem >
bool is_concerned (TElem *e)
 
vector3 pos (Vertex *v) const
 
void set_pos (Vertex *v, const vector3 &p)
 

Private Member Functions

void attach_surf_params ()
 helper method to attach surface parameters and do a consistency check More...
 
void check_attachment ()
 check if global attachment was declared More...
 
template<class TElem >
number perform_projection (Vertex *vrt, TElem *parent)
 
template<class TElem >
void project_to_soma_surface (Vertex *vrt, TElem *parent)
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 
template<class TElem >
bool vertex_at_soma_surf (Vertex *vrt, TElem *parent)
 

Private Attributes

Grid::VertexAttachmentAccessor< Attachment< NeuriteProjector::SurfaceParams > > m_aaSurfParams
 
Attachment< NeuriteProjector::SurfaceParamsm_aSurfParams
 
vector3 m_axis
 
CopyAttachmentHandler< Vertex, Attachment< NeuriteProjector::SurfaceParams > > m_cah
 
vector3 m_center
 
vector3 m_soma
 
number m_somaRad
 

Friends

class boost::serialization::access
 

Detailed Description

Projects new vertices onto a sphere during refinement.

For projection during refinement the radius property is ignored. Instead the distance to the center of a newly inserted vertex is calculated as the average distance of the vertices of the parent element to the center. The radius property thus defaults to -1.

You may still specify a radius. This radius can be used for auto-fitting of the center and for reprojecting a set of vertices onto the sphere.

Only vertices which are at the soma (axial parameter: -1) are projected on the surface. This works well for good natured connecting neurites.

Constructor & Destructor Documentation

◆ SomaProjector() [1/3]

ug::SomaProjector::SomaProjector ( )
inline

◆ SomaProjector() [2/3]

ug::SomaProjector::SomaProjector ( const vector3 center,
const vector3 axis,
const vector3 soma,
const number rad 
)
inline

◆ SomaProjector() [3/3]

ug::SomaProjector::SomaProjector ( SPIGeometry3d  geometry,
const vector3 center,
const vector3 axis,
const vector3 soma,
const number rad 
)
inline

◆ ~SomaProjector()

virtual ug::SomaProjector::~SomaProjector ( )
inlinevirtual

Member Function Documentation

◆ attach_surf_params()

void ug::SomaProjector::attach_surf_params ( )
inlineprivate

◆ check_attachment()

void ug::SomaProjector::check_attachment ( )
inlineprivate

check if global attachment was declared

References ug::GlobalAttachments::is_declared().

Referenced by attach_surf_params().

◆ new_vertex() [1/3]

virtual number ug::SomaProjector::new_vertex ( Vertex vrt,
Edge parent 
)
inlinevirtual

called when a new vertex was created from an old edge.

Reimplemented from ug::RefinementProjector.

References perform_projection().

◆ new_vertex() [2/3]

virtual number ug::SomaProjector::new_vertex ( Vertex vrt,
Face parent 
)
inlinevirtual

called when a new vertex was created from an old face.

Reimplemented from ug::RefinementProjector.

References perform_projection().

◆ new_vertex() [3/3]

virtual number ug::SomaProjector::new_vertex ( Vertex vrt,
Volume parent 
)
inlinevirtual

called when a new vertex was created from an old volume.

Reimplemented from ug::RefinementProjector.

References perform_projection().

◆ perform_projection()

◆ project_to_soma_surface()

template<class TElem >
void ug::SomaProjector::project_to_soma_surface ( Vertex vrt,
TElem *  parent 
)
inlineprivate

old vertex position

  1. P = (x',y',z') = (x - x0, y - y0, z - z0)
  2. |P| = sqrt(x'^2 + y'^2 + z'^2)
  3. Q = (radius/|P|)*P
  4. R = Q + (x0,y0,z0)
  5. Set new position
  6. set the surface parameters for the new vertex

References m_aaSurfParams, m_soma, m_somaRad, ug::RefinementProjector::pos(), ug::RefinementProjector::set_pos(), ug::VecAdd(), ug::VecLength(), ug::VecScale(), and ug::VecSubtract().

Referenced by perform_projection().

◆ serialize()

template<class Archive >
void ug::SomaProjector::serialize ( Archive &  ar,
const unsigned int  version 
)
inlineprivate

◆ set_geometry()

virtual void ug::SomaProjector::set_geometry ( SPIGeometry3d  geometry)
inlineprotectedvirtual

◆ vertex_at_soma_surf()

template<class TElem >
bool ug::SomaProjector::vertex_at_soma_surf ( Vertex vrt,
TElem *  parent 
)
inlineprivate

References m_aaSurfParams.

Referenced by perform_projection().

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Member Data Documentation

◆ m_aaSurfParams

◆ m_aSurfParams

Attachment<NeuriteProjector::SurfaceParams> ug::SomaProjector::m_aSurfParams
private

Referenced by attach_surf_params().

◆ m_axis

vector3 ug::SomaProjector::m_axis
private

Referenced by perform_projection(), and serialize().

◆ m_cah

◆ m_center

vector3 ug::SomaProjector::m_center
private

Referenced by perform_projection(), and serialize().

◆ m_soma

vector3 ug::SomaProjector::m_soma
private

◆ m_somaRad

number ug::SomaProjector::m_somaRad
private

The documentation for this class was generated from the following file: