Alternaria
fit cylinders and ellipsoids to fungus
|
An Alterneria hypha modeled as a cylinder. More...
#include <hypha.h>
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_hypha * | clone () const |
Clones this Apical_hypha. | |
Apical_hypha & | operator= (const Apical_hypha &h) |
Copies a Apical_hypha into this Apical_hypha. | |
class Apical_hypha_density * | get_density () const |
Returns the density parameters used by this Structure. | |
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. | |
Apical_hypha * | merge_with_apical (const Apical_hypha *rvals) throw (jwscxx::base::Arg_error) |
Stochastically merges this Apical_hypha with its Apical_hypha::apical. | |
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. | |
class Lateral_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. | |
class Lateral_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. | |
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_density * | density |
Parameters for density functions over an Apical_hypha. |
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.
centroid_x | X-coord of the Structure::centroid. |
centroid_y | Y-coord of the Structure::centroid. |
centroid_z | Z-coord of the Structure::centroid. |
length | Length from the Structure::begin_pt to Structure::end_pt. |
width | Width of the Structure. |
base_theta | Euler angle: base rotation about the x-axis. |
base_psi | Euler angle: base rotation about the z-axis. |
theta | Euler angle: rotation about the x-axis. |
psi | Euler angle: rotation about the z-axis. |
opacity | Opacity of the Apical_hypha. |
level | Level of the hypha. |
density | Apical_hypha_density parameters for probabilities. |
jwscxx::base::Arg_error | Apical_hypha values are not in the density parameter ranges. |
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.
parent | Parent Structure to add this Apical_hypha to. |
length | Length from the Structure::begin_pt to Structure::end_pt. |
width | Width of the Structure. |
base_theta | Euler angle: base rotation about the x-axis. |
base_psi | Euler angle: base rotation about the z-axis. |
theta | Euler angle: rotation about the x-axis. |
psi | Euler angle: rotation about the z-axis. |
opacity | Opacity of the Apical_hypha. |
density | Apical_hypha_density parameters for probabilities. |
jwscxx::base::Arg_error | Apical_hypha values are not in the density parameter range. |
Apical_error | The parent already has an apical growth. |
Apical_hypha::Apical_hypha | ( | const Apical_hypha & | h | ) |
Constructs a Apical_hypha by copying another.
h | Apical_hypha to construct a new one from. |
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.
s | Spore to construct a new Apical_hypha from. |
Apical_hypha * Apical_hypha::clone | ( | ) | const [virtual] |
Apical_hypha & Apical_hypha::operator= | ( | const Apical_hypha & | h | ) |
Copies a Apical_hypha into this Apical_hypha.
h | Apical_hypha to copy. |
class Apical_hypha_density* Apical_hypha::get_density | ( | ) | const [inline] |
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.
rvals_1 | Random values to use for the stochastic split. |
rvals_2 | Random values to use for the stochastic split. |
jwscxx::base::Arg_error | The change would result in a Structure parameter that is not consistent with the parameter density functions. |
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.
rvals | Random values to use for the stochastic merge. |
jwscxx::base::Arg_error | The change would result in a Structure parameter that is not consistent with the parameter density functions or there is no apical to merge with. |
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.
spore_out | Result parameter. The merged Spore on return. |
rvals | Random values to use for the stochastic merge. |
jwscxx::base::Arg_error | The change would result in a Structure parameter that is not consistent with the parameter density functions or there is no apical to merge with. |
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.
rvals_1 | Random values to use for the stochastic split. |
rvals_2 | Random values to use for the stochastic split. |
jwscxx::base::Arg_error | The change would result in a Structure parameter that is not consistent with the parameter density functions. |
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.
lateral | Lateral_hypha to merge with this Apical_hypha. |
rvals | Random values to use for the stochastic merge. |
jwscxx::base::Arg_error | The change would result in a Structure parameter that is not consistent with the parameter density functions. |
void Apical_hypha::replace | ( | class Spore * | spore | ) | throw (jwscxx::base::Arg_error) |
Replaces this Apical_hypha with a Spore.
spore | Spore to use for replacement. |
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);
M_blk | Matrix block to draw the Hypha in. |
x | Position of the first M_blk column index in the hypha coordinate system. |
y | Position of the first M_blk row index in the hypha coordinate system. |
z | Position of the first M_blk matrix index in the hypha coordinate system. |
x_scale | Number of hypha coordinate system units per column. |
y_scale | Number of hypha coordinate system units per row. |
z_scale | Number of hypha coordinate system units per matrix. |
fill | Set to 1 if the hypha is to be filled; 0 otherwise. |
Implements Structure.
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.
quad | GLUquadric to use for drawing. |
scale | Number of GL units per hypha coordinate system units. |
isect_out | Result parameter. If *isect_out is NULL, an vector in R^3 is allocated; otherwise its space is re-used. |
n | The number of the intersection to return, counting begins at points going from p1 to p2. |
p1_in | End point of the line to intersect. |
p2_in | End point of the line to intersect. |
jwscxx::base::Arg_error | The line end-points p1 and p2 must be in R^3. The intersection number to return n must be 1 or 2. |
Implements Structure.
const char* Apical_hypha::get_type_str | ( | ) | const [inline, virtual] |
static const char* Apical_hypha::type_str | ( | ) | [inline, static] |
void Apical_hypha::update_log_prob | ( | ) | [protected, virtual] |
Updates Structure::log_prob.
Calls the base virtual update_log_prob members.
Reimplemented from Apical_structure.
class Apical_hypha_density* Apical_hypha::density [protected] |
Parameters for density functions over an Apical_hypha.
Reimplemented from Apical_structure.