Alternaria
fit cylinders and ellipsoids to fungus
Apical_hypha Class Reference

An Alterneria hypha modeled as a cylinder. More...

#include <hypha.h>

Inheritance diagram for Apical_hypha:
Collaboration diagram for Apical_hypha:

List of all members.

Public Member Functions

 Apical_hypha (float centroid_x, float centroid_y, float centroid_z, float length, float width, float base_theta, float base_psi, float theta, float psi, float opacity, size_t level, const class Apical_hypha_density *density) throw (jwscxx::base::Arg_error)
 Creates a parent-less Apical_hypha positioned w.r.t. a centroid.
 Apical_hypha (Structure *parent, float length, float width, float base_theta, float base_psi, float theta, float psi, float opacity, const class Apical_hypha_density *density) throw (jwscxx::base::Arg_error, Apical_error)
 Creates an Apical_hypha and attaches it to a parent.
 Apical_hypha (const Apical_hypha &h)
 Constructs a Apical_hypha by copying another.
 Apical_hypha (const class Spore &s, float width, const Apical_hypha_density *density) throw (jwscxx::base::Arg_error)
 Constructs an Apical_hypha by copying a Spore.
Apical_hyphaclone () const
 Clones this Apical_hypha.
Apical_hyphaoperator= (const Apical_hypha &h)
 Copies a Apical_hypha into this Apical_hypha.
class Apical_hypha_densityget_density () const
 Returns the density parameters used by this Structure.
Apical_hyphasplit_into_apical (const Apical_hypha *rvals_1, const Apical_hypha *rvals_2) throw (jwscxx::base::Arg_error)
 Stochastically splits this Apical_hypha into this and another Apical_hypha.
Apical_hyphamerge_with_apical (const Apical_hypha *rvals) throw (jwscxx::base::Arg_error)
 Stochastically merges this Apical_hypha with its Apical_hypha::apical.
Apical_hyphamerge_with_apical (class Spore **spore_out, const class Spore *rvals) throw (jwscxx::base::Arg_error)
 Stochastically merges this Apical_hypha with its Apical_hypha::apical into a Spore.
class Lateral_hyphasplit_into_lateral (const Apical_hypha *rvals_1, const class Lateral_hypha *rvals_2) throw (jwscxx::base::Arg_error)
 Stochastically splits this Apical_hypha into this and another Lateral_hypha.
class Lateral_hyphamerge_with_lateral (class Lateral_hypha *lateral, const Apical_hypha *rvals) throw (jwscxx::base::Arg_error)
 Stochastically merges this Apical_hypha with one of its Apical_hypha::laterals.
void replace (class Spore *spore) throw (jwscxx::base::Arg_error)
 Replaces this Apical_hypha with a Spore.
bool draw_in_matblock_f (jwsc::Matblock_f *M_blk, float x, float y, float z, float x_scale, float y_scale, float z_scale, bool fill=true) const
 Draws this Apical_hypha in a matrix block.
float get_intersection (jwsc::Vector_f **isect_out, uint32_t n, const jwsc::Vector_f *p1_in, const jwsc::Vector_f *p2_in) throw (jwscxx::base::Arg_error)
 Draws this Apical_hypha in an OpenGL environment.
const char * get_type_str () const
 Returns the type of this Structure in the form of a string.

Static Public Member Functions

static const char * type_str ()
 Returns the type of this Structure in the form of a string.

Protected Member Functions

void update_log_prob ()
 Updates Structure::log_prob.

Protected Attributes

class Apical_hypha_densitydensity
 Parameters for density functions over an Apical_hypha.

Detailed Description

An Alterneria hypha modeled as a cylinder.

Definition at line 77 of file hypha.h.


Constructor & Destructor Documentation

Apical_hypha::Apical_hypha ( float  centroid_x,
float  centroid_y,
float  centroid_z,
float  length,
float  width,
float  base_theta,
float  base_psi,
float  theta,
float  psi,
float  opacity,
size_t  level,
const class Apical_hypha_density density 
) throw (jwscxx::base::Arg_error)

Creates a parent-less Apical_hypha positioned w.r.t. a centroid.

Parameters:
centroid_xX-coord of the Structure::centroid.
centroid_yY-coord of the Structure::centroid.
centroid_zZ-coord of the Structure::centroid.
lengthLength from the Structure::begin_pt to Structure::end_pt.
widthWidth of the Structure.
base_thetaEuler angle: base rotation about the x-axis.
base_psiEuler angle: base rotation about the z-axis.
thetaEuler angle: rotation about the x-axis.
psiEuler angle: rotation about the z-axis.
opacityOpacity of the Apical_hypha.
levelLevel of the hypha.
densityApical_hypha_density parameters for probabilities.
Exceptions:
jwscxx::base::Arg_errorApical_hypha values are not in the density parameter ranges.

Definition at line 612 of file hypha.cpp.

Apical_hypha::Apical_hypha ( Structure parent,
float  length,
float  width,
float  base_theta,
float  base_psi,
float  theta,
float  psi,
float  opacity,
const class Apical_hypha_density density 
) throw (jwscxx::base::Arg_error, Apical_error)

Creates an Apical_hypha and attaches it to a parent.

Parameters:
parentParent Structure to add this Apical_hypha to.
lengthLength from the Structure::begin_pt to Structure::end_pt.
widthWidth of the Structure.
base_thetaEuler angle: base rotation about the x-axis.
base_psiEuler angle: base rotation about the z-axis.
thetaEuler angle: rotation about the x-axis.
psiEuler angle: rotation about the z-axis.
opacityOpacity of the Apical_hypha.
densityApical_hypha_density parameters for probabilities.
Exceptions:
jwscxx::base::Arg_errorApical_hypha values are not in the density parameter range.
Apical_errorThe parent already has an apical growth.

Definition at line 652 of file hypha.cpp.

Apical_hypha::Apical_hypha ( const Apical_hypha h)

Constructs a Apical_hypha by copying another.

Parameters:
hApical_hypha to construct a new one from.

Definition at line 674 of file hypha.cpp.

Apical_hypha::Apical_hypha ( const class Spore s,
float  width,
const Apical_hypha_density density 
) throw (jwscxx::base::Arg_error)

Constructs an Apical_hypha by copying a Spore.

Parameters:
sSpore to construct a new Apical_hypha from.

Definition at line 682 of file hypha.cpp.


Member Function Documentation

Apical_hypha * Apical_hypha::clone ( ) const [virtual]

Clones this Apical_hypha.

Returns:
A pointer to a cloned Apical_hypha.

Implements Apical_structure.

Definition at line 716 of file hypha.cpp.

Apical_hypha & Apical_hypha::operator= ( const Apical_hypha h)

Copies a Apical_hypha into this Apical_hypha.

Parameters:
hApical_hypha to copy.
Returns:
A reference to this Apical_hypha with h copied into it.

Definition at line 727 of file hypha.cpp.

class Apical_hypha_density* Apical_hypha::get_density ( ) const [inline]

Returns the density parameters used by this Structure.

Reimplemented from Structure.

Definition at line 142 of file hypha.h.

Apical_hypha * Apical_hypha::split_into_apical ( const Apical_hypha rvals_1,
const Apical_hypha rvals_2 
) throw (jwscxx::base::Arg_error)

Stochastically splits this Apical_hypha into this and another Apical_hypha.

Parameters:
rvals_1Random values to use for the stochastic split.
rvals_2Random values to use for the stochastic split.
Returns:
The Apical_hypha that was split into this Apical_hypha::apical.
Exceptions:
jwscxx::base::Arg_errorThe change would result in a Structure parameter that is not consistent with the parameter density functions.

Definition at line 748 of file hypha.cpp.

Apical_hypha * Apical_hypha::merge_with_apical ( const Apical_hypha rvals) throw (jwscxx::base::Arg_error)

Stochastically merges this Apical_hypha with its Apical_hypha::apical.

Parameters:
rvalsRandom values to use for the stochastic merge.
Returns:
The Apical_hypha::apical that was merged with this Apical_hypha.
Note:
The apical and laterals from this Apical_hypha::apical are removed and merged into this Apical_hypha. So the returned Apical_hypha is safe to delete.
Exceptions:
jwscxx::base::Arg_errorThe change would result in a Structure parameter that is not consistent with the parameter density functions or there is no apical to merge with.

Definition at line 773 of file hypha.cpp.

Apical_hypha * Apical_hypha::merge_with_apical ( class Spore **  spore_out,
const class Spore rvals 
) throw (jwscxx::base::Arg_error)

Stochastically merges this Apical_hypha with its Apical_hypha::apical into a Spore.

Parameters:
spore_outResult parameter. The merged Spore on return.
rvalsRandom values to use for the stochastic merge.
Returns:
The Apical_hypha::apical that was merged with this Apical_hypha.
Note:
The apical and laterals from this and its Apical_hypha::apical are removed and put in the merged Spore. So this and the returned Apical_hypha are safe to delete.
Exceptions:
jwscxx::base::Arg_errorThe change would result in a Structure parameter that is not consistent with the parameter density functions or there is no apical to merge with.

Definition at line 808 of file hypha.cpp.

Lateral_hypha * Apical_hypha::split_into_lateral ( const Apical_hypha rvals_1,
const class Lateral_hypha rvals_2 
) throw (jwscxx::base::Arg_error)

Stochastically splits this Apical_hypha into this and another Lateral_hypha.

Parameters:
rvals_1Random values to use for the stochastic split.
rvals_2Random values to use for the stochastic split.
Returns:
The Lateral_hypha that was split into this Apical_hypha::laterals.
Exceptions:
jwscxx::base::Arg_errorThe change would result in a Structure parameter that is not consistent with the parameter density functions.

Definition at line 859 of file hypha.cpp.

Lateral_hypha * Apical_hypha::merge_with_lateral ( class Lateral_hypha lateral,
const Apical_hypha rvals 
) throw (jwscxx::base::Arg_error)

Stochastically merges this Apical_hypha with one of its Apical_hypha::laterals.

Parameters:
lateralLateral_hypha to merge with this Apical_hypha.
rvalsRandom values to use for the stochastic merge.
Returns:
The Lateral_hypha that was merged with this Apical_hypha.
Note:
The apical and laterals from lateral are removed and merged into this Apical_hypha. So the returned Lateral_hypha is safe to delete.
Exceptions:
jwscxx::base::Arg_errorThe change would result in a Structure parameter that is not consistent with the parameter density functions.
Warning:
This Apical_hypha must not have an apical and lateral must be found in this Apical_hypha::laterals.

Definition at line 887 of file hypha.cpp.

void Apical_hypha::replace ( class Spore spore) throw (jwscxx::base::Arg_error)

Replaces this Apical_hypha with a Spore.

Parameters:
sporeSpore to use for replacement.
Note:
This Apical_hypha is safe to delete after upon return.

Definition at line 902 of file hypha.cpp.

bool Apical_hypha::draw_in_matblock_f ( jwsc::Matblock_f *  M_blk,
float  x,
float  y,
float  z,
float  x_scale,
float  y_scale,
float  z_scale,
bool  fill = true 
) const [virtual]

Draws this Apical_hypha in a matrix block.

The drawing planes (M_blk) have normal vectors <x,y,z> = <0,0,1> in 3-space, i.e., parallel to the xy-plane. The parameter z specifies the distance of the drawing plane from the origin (0,0,1).

The parameters x, y, and z specify the location of M_blk->elts[0][0][0] in the hypha coordinate system. Increasing indices of M_blk correspond to increasing values of x, y, and z scaled by x_scale, y_scale and z_scale, respectively.

Formally, the center of the (i,j,k)th element of M_blk is

      x_0 = x + x_scale*(i + 0.5); 
      y_0 = y + y_scale*(j + 0.5); 
      z_0 = z + z_scale*(k + 0.5);

The position of (x_0,y_0,z_0) in M_blk is given by

      i = floor((x_0 - x) / x_scale + 0.5);
      j = floor((y_0 - y) / y_scale + 0.5);
      k = floor((z_0 - z) / z_scale + 0.5);
Parameters:
M_blkMatrix block to draw the Hypha in.
xPosition of the first M_blk column index in the hypha coordinate system.
yPosition of the first M_blk row index in the hypha coordinate system.
zPosition of the first M_blk matrix index in the hypha coordinate system.
x_scaleNumber of hypha coordinate system units per column.
y_scaleNumber of hypha coordinate system units per row.
z_scaleNumber of hypha coordinate system units per matrix.
fillSet to 1 if the hypha is to be filled; 0 otherwise.
Returns:
True if any of the structures intersect with something other than one of its children.

Implements Structure.

Definition at line 950 of file hypha.cpp.

float Apical_hypha::get_intersection ( jwsc::Vector_f **  isect_out,
uint32_t  n,
const jwsc::Vector_f *  p1_in,
const jwsc::Vector_f *  p2_in 
) throw (jwscxx::base::Arg_error) [virtual]

Draws this Apical_hypha in an OpenGL environment.

Calculates an intersection point between a line and this Apical_hypha, if it exists.

Parameters:
quadGLUquadric to use for drawing.
scaleNumber of GL units per hypha coordinate system units.
isect_outResult parameter. If *isect_out is NULL, an vector in R^3 is allocated; otherwise its space is re-used.
nThe number of the intersection to return, counting begins at points going from p1 to p2.
p1_inEnd point of the line to intersect.
p2_inEnd point of the line to intersect.
Returns:
If the n^th intersection point is found, its parametric distance along the line from p1_in to p2_in is returned in the range [0,1]. Otherwise a value < 0 is returned.
Exceptions:
jwscxx::base::Arg_errorThe line end-points p1 and p2 must be in R^3. The intersection number to return n must be 1 or 2.

Implements Structure.

Definition at line 1116 of file hypha.cpp.

const char* Apical_hypha::get_type_str ( ) const [inline, virtual]

Returns the type of this Structure in the form of a string.

Implements Structure.

Definition at line 244 of file hypha.h.

static const char* Apical_hypha::type_str ( ) [inline, static]

Returns the type of this Structure in the form of a string.

Definition at line 250 of file hypha.h.

void Apical_hypha::update_log_prob ( ) [protected, virtual]

Updates Structure::log_prob.

Calls the base virtual update_log_prob members.

Reimplemented from Apical_structure.

Definition at line 1227 of file hypha.cpp.


Member Data Documentation

Parameters for density functions over an Apical_hypha.

Reimplemented from Apical_structure.

Definition at line 262 of file hypha.h.


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