Alternaria
fit cylinders and ellipsoids to fungus
Lateral_hypha Class Reference

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

#include <hypha.h>

Inheritance diagram for Lateral_hypha:
Collaboration diagram for Lateral_hypha:

List of all members.

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_hyphaclone () const
 Clones this Lateral_hypha.
Lateral_hyphaoperator= (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_densitydensity
 Parameters for density functions over this Lateral_hypha.

Detailed Description

An Alterneria hypha modeled as a cylinder.

Definition at line 413 of file hypha.h.


Constructor & Destructor Documentation

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.

Parameters:
centroid_xX-coord of the Structure::centroid.
centroid_yY-coord of the Structure::centroid.
centroid_zZ-coord of the Structure::centroid.
lat_distNormalized distance from parent Structure::begin_pt.
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 Lateral_hypha.
levelLevel of the hypha.
densityLateral_hypha_density parameters for probabilities.
Exceptions:
jwscxx::base::Arg_errorLateral_hypha values are not in the density parameter ranges.

Definition at line 1442 of file hypha.cpp.

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.

Parameters:
parentParent Structure to add this Lateral_hypha to.
lat_distNormalized distance from parent Structure::begin_pt.
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 Lateral_hypha.
densityLateral_hypha_density parameters for probabilities.
Exceptions:
jwscxx::base::Arg_errorLateral_hypha values are not in the density parameter range.
Apical_errorThe parent already has an apical growth.

Definition at line 1484 of file hypha.cpp.

Lateral_hypha::Lateral_hypha ( const Lateral_hypha h)

Constructs a Lateral_hypha by copying another.

Parameters:
hLateral_hypha to construct a new one from.

Definition at line 1507 of file hypha.cpp.


Member Function Documentation

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

Clones this Lateral_hypha.

Returns:
A pointer to a cloned Lateral_hypha.

Implements Lateral_structure.

Definition at line 1514 of file hypha.cpp.

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

Copies a Lateral_hypha into this Lateral_hypha.

Parameters:
hLateral_hypha to copy.
Returns:
A reference to this Lateral_hypha with h copied into it.

Definition at line 1525 of file hypha.cpp.

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);
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 1577 of file hypha.cpp.

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.

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 1745 of file hypha.cpp.

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

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

Implements Structure.

Definition at line 507 of file hypha.h.

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

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

Definition at line 513 of file hypha.h.


Member Data Documentation

Parameters for density functions over this Lateral_hypha.

Reimplemented from Lateral_structure.

Definition at line 519 of file hypha.h.


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