Alternaria
fit cylinders and ellipsoids to fungus
|
An Alterneria hypha modeled as a cylinder. More...
#include <hypha.h>
Public Member Functions | |
Lateral_hypha (float centroid_x, float centroid_y, float centroid_z, float lat_dist, float length, float width, float base_theta, float base_psi, float theta, float psi, float opacity, size_t level, const class Lateral_hypha_density *density) throw (jwscxx::base::Arg_error) | |
Constructs a parent-less Lateral_hypha positioned w.r.t. a centroid. | |
Lateral_hypha (Structure *parent, float lat_dist, float length, float width, float base_theta, float base_psi, float theta, float psi, float opacity, const class Lateral_hypha_density *density) throw (jwscxx::base::Arg_error, Apical_error) | |
Constructs a Lateral_hypha and attaches it to a parent. | |
Lateral_hypha (const Lateral_hypha &h) | |
Constructs a Lateral_hypha by copying another. | |
Lateral_hypha * | clone () const |
Clones this Lateral_hypha. | |
Lateral_hypha & | operator= (const Lateral_hypha &h) |
Copies a Lateral_hypha into this Lateral_hypha. | |
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 Lateral_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 Lateral_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 Attributes | |
class Lateral_hypha_density * | density |
Parameters for density functions over this Lateral_hypha. |
Lateral_hypha::Lateral_hypha | ( | float | centroid_x, |
float | centroid_y, | ||
float | centroid_z, | ||
float | lat_dist, | ||
float | length, | ||
float | width, | ||
float | base_theta, | ||
float | base_psi, | ||
float | theta, | ||
float | psi, | ||
float | opacity, | ||
size_t | level, | ||
const class Lateral_hypha_density * | density | ||
) | throw (jwscxx::base::Arg_error) |
Constructs a parent-less Lateral_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. |
lat_dist | Normalized distance from parent Structure::begin_pt. |
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 Lateral_hypha. |
level | Level of the hypha. |
density | Lateral_hypha_density parameters for probabilities. |
jwscxx::base::Arg_error | Lateral_hypha values are not in the density parameter ranges. |
Lateral_hypha::Lateral_hypha | ( | Structure * | parent, |
float | lat_dist, | ||
float | length, | ||
float | width, | ||
float | base_theta, | ||
float | base_psi, | ||
float | theta, | ||
float | psi, | ||
float | opacity, | ||
const class Lateral_hypha_density * | density | ||
) | throw (jwscxx::base::Arg_error, Apical_error) |
Constructs a Lateral_hypha and attaches it to a parent.
parent | Parent Structure to add this Lateral_hypha to. |
lat_dist | Normalized distance from parent Structure::begin_pt. |
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 Lateral_hypha. |
density | Lateral_hypha_density parameters for probabilities. |
jwscxx::base::Arg_error | Lateral_hypha values are not in the density parameter range. |
Apical_error | The parent already has an apical growth. |
Lateral_hypha::Lateral_hypha | ( | const Lateral_hypha & | h | ) |
Constructs a Lateral_hypha by copying another.
h | Lateral_hypha to construct a new one from. |
Lateral_hypha * Lateral_hypha::clone | ( | ) | const [virtual] |
Clones this Lateral_hypha.
Implements Lateral_structure.
Lateral_hypha & Lateral_hypha::operator= | ( | const Lateral_hypha & | h | ) |
Copies a Lateral_hypha into this Lateral_hypha.
h | Lateral_hypha to copy. |
bool Lateral_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 Lateral_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 Lateral_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 Lateral_hypha in an OpenGL environment.
Calculates an intersection point between a line and this Lateral_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* Lateral_hypha::get_type_str | ( | ) | const [inline, virtual] |
static const char* Lateral_hypha::type_str | ( | ) | [inline, static] |
class Lateral_hypha_density* Lateral_hypha::density [protected] |
Parameters for density functions over this Lateral_hypha.
Reimplemented from Lateral_structure.