Public Member Functions | |
Phytomer (const PhytomerParameters ¶ms, Shoot *parent_shoot, uint phytomer_index, const helios::vec3 &parent_internode_axis, const helios::vec3 &parent_petiole_axis, helios::vec3 internode_base_origin, const AxisRotation &shoot_base_rotation, float internode_radius, float internode_length_max, float internode_length_scale_factor_fraction, float leaf_scale_factor_fraction, uint rank, PlantArchitecture *plantarchitecture_ptr, helios::Context *context_ptr) | |
Constructor. | |
std::vector< helios::vec3 > | getInternodeNodePositions () const |
Retrieve the positions of nodes associated with an internode. | |
std::vector< float > | getInternodeNodeRadii () const |
Retrieve the radii of nodes associated with an internode. | |
float | calculatePhytomerVolume (uint node_number) const |
Calculates the volume of a phytomer. | |
helios::vec3 | getInternodeAxisVector (float stem_fraction) const |
Retrieves the axis vector of the internode at a given fraction along the internode. | |
helios::vec3 | getPetioleAxisVector (float stem_fraction, uint petiole_index) const |
Retrieves the petiole axis vector for a given stem fraction and petiole index. | |
helios::vec3 | getPeduncleAxisVector (float stem_fraction, uint petiole_index, uint bud_index) const |
Retrieves the peduncle axis vector for a given stem fraction, petiole index, and floral bud index. | |
float | getInternodeLength () const |
Computes the total length of the internode. | |
float | getInternodeRadius () const |
Retrieves the radius of the internode. | |
float | getPetioleLength () const |
Retrieves the length of the petiole. | |
float | getInternodeRadius (float stem_fraction) const |
Retrieves the radius of the internode based on the stem fraction. | |
float | getLeafArea () const |
Calculates the total leaf area for the current phytomer. | |
helios::vec3 | getLeafBasePosition (uint petiole_index, uint leaf_index) const |
Retrieves the position of the base of a leaf within the phytomer. | |
bool | hasLeaf () const |
Checks if the phytomer has a leaf. | |
float | calculateDownstreamLeafArea () const |
Calculates the total leaf area downstream of the current phytomer. | |
void | setInternodeLengthScaleFraction (float internode_scale_factor_fraction, bool update_context_geometry) |
Set the current internode length as a fraction of its maximum length. | |
void | scaleInternodeMaxLength (float scale_factor) |
Scale the fully-elongated (maximum) internode length as a fraction of its current fully-elongated length. | |
void | setInternodeMaxLength (float internode_length_max_new) |
Set the fully-elongated (maximum) internode length. | |
void | setInternodeMaxRadius (float internode_radius_max_new) |
Set the maximum radius of the internode. | |
void | setLeafScaleFraction (uint petiole_index, float leaf_scale_factor_fraction) |
Set the leaf scale as a fraction of its total fully-elongated scale factor. Value is uniformly applied for all leaves/leaflets in the petiole. | |
void | setLeafScaleFraction (float leaf_scale_factor_fraction) |
Set the leaf scale as a fraction of its total fully-elongated scale factor for all petioles in the phytomer. Value is uniformly applied for all leaves/leaflets in the phytomer. | |
void | setLeafPrototypeScale (uint petiole_index, float leaf_prototype_scale) |
Set the fully-elongated (maximum) leaf prototype scale. Value is uniformly applied for all leaves/leaflets in the petiole. | |
void | setLeafPrototypeScale (float leaf_prototype_scale) |
Set the fully-elongated (maximum) leaf prototype scale for all petioles in the phytomer. Value is uniformly applied for all leaves/leaflets in the petiole. | |
void | scaleLeafPrototypeScale (uint petiole_index, float scale_factor) |
Scales the leaf prototype by the given scale factor. Value is uniformly applied for all leaves/leaflets in the petiole. | |
void | scaleLeafPrototypeScale (float scale_factor) |
Scales the leaf prototype by the given scale factor for all petioles in the phytomer. Value is uniformly applied for all leaves/leaflets in the petiole. | |
void | setInflorescenceScaleFraction (FloralBud &fbud, float inflorescence_scale_factor_fraction) const |
Sets the scaling fraction for the inflorescence of a floral bud. | |
void | setPetioleBase (const helios::vec3 &base_position) |
Sets the base position of the petiole to the specified position. | |
void | rotateLeaf (uint petiole_index, uint leaf_index, const AxisRotation &rotation) |
Rotates a specified leaf around its base using the given rotation parameters. | |
void | setVegetativeBudState (BudState state) |
Sets the vegetative bud state for all axillary vegetative buds in the phytomer. | |
void | setVegetativeBudState (BudState state, uint petiole_index, uint bud_index) |
Sets the state of a vegetative bud at the specified petiole and bud indices. | |
void | setFloralBudState (BudState state) |
Sets the floral bud state for all non-terminal buds. | |
void | setFloralBudState (BudState state, uint petiole_index, uint bud_index) |
Sets the state of a specific floral bud. | |
void | setFloralBudState (BudState state, FloralBud &fbud) |
Sets the state of a floral bud. | |
void | removeLeaf () |
Removes the leaf and its associated properties from the phytomer. | |
void | deletePhytomer () |
Deletes the phytomer and its associated components. | |
Static Public Member Functions | |
static helios::vec3 | getAxisVector (float stem_fraction, const std::vector< helios::vec3 > &axis_vertices) |
Computes the normalized vector direction along the axis at a given fraction of the stem. | |
static void | setVegetativeBudState (BudState state, VegetativeBud &vbud) |
Sets the vegetative bud's state to the specified state. | |
Data Fields | |
std::vector< std::vector< helios::vec3 > > | petiole_vertices |
Coordinates of internode tube segments. Index is tube segment within internode. | |
std::vector< std::vector< helios::vec3 > > | leaf_bases |
std::vector< std::vector< std::vector< helios::vec3 > > > | peduncle_vertices |
float | internode_pitch |
float | internode_phyllotactic_angle |
std::vector< std::vector< float > > | petiole_radii |
std::vector< float > | petiole_length |
std::vector< float > | petiole_pitch |
std::vector< float > | petiole_curvature |
std::vector< std::vector< float > > | leaf_size_max |
std::vector< std::vector< AxisRotation > > | leaf_rotation |
std::vector< helios::RGBcolor > | internode_colors |
std::vector< helios::RGBcolor > | petiole_colors |
std::vector< std::vector< uint > > | petiole_objIDs |
std::vector< std::vector< uint > > | leaf_objIDs |
PhytomerParameters | phytomer_parameters |
uint | rank |
helios::int3 | shoot_index |
.x = index of phytomer along shoot, .y = current number of phytomers on parent shoot, .z = maximum number of phytomers on parent shoot | |
uint | plantID |
uint | parent_shoot_ID |
Shoot * | parent_shoot_ptr |
float | age = 0 |
Time since the phytomer was created. | |
bool | isdormant = false |
float | current_internode_scale_factor = 1 |
std::vector< float > | current_leaf_scale_factor |
float | old_phytomer_volume = 0 |
float | downstream_leaf_area = 0 |
std::vector< std::vector< VegetativeBud > > | axillary_vegetative_buds |
std::vector< std::vector< FloralBud > > | floral_buds |
float | internode_radius_initial |
float | internode_radius_max |
float | internode_length_max |
bool | build_context_geometry_petiole = true |
bool | build_context_geometry_peduncle = true |
Friends | |
struct | Shoot |
class | PlantArchitecture |
Definition at line 938 of file PlantArchitecture.h.
Phytomer::Phytomer | ( | const PhytomerParameters & | params, |
Shoot * | parent_shoot, | ||
uint | phytomer_index, | ||
const helios::vec3 & | parent_internode_axis, | ||
const helios::vec3 & | parent_petiole_axis, | ||
helios::vec3 | internode_base_origin, | ||
const AxisRotation & | shoot_base_rotation, | ||
float | internode_radius, | ||
float | internode_length_max, | ||
float | internode_length_scale_factor_fraction, | ||
float | leaf_scale_factor_fraction, | ||
uint | rank, | ||
PlantArchitecture * | plantarchitecture_ptr, | ||
helios::Context * | context_ptr | ||
) |
Constructor.
Definition at line 1351 of file PlantArchitecture.cpp.
float Phytomer::calculateDownstreamLeafArea | ( | ) | const |
Calculates the total leaf area downstream of the current phytomer.
Definition at line 2632 of file PlantArchitecture.cpp.
float Phytomer::calculatePhytomerVolume | ( | uint | node_number | ) | const |
Calculates the volume of a phytomer.
[in] | node_number | The node index of the phytomer whose volume is to be computed. |
Definition at line 1954 of file PlantArchitecture.cpp.
void Phytomer::deletePhytomer | ( | ) |
Deletes the phytomer and its associated components.
This method handles the cleanup and deletion of all parts associated with the phytomer, including internode, leaves, inflorescence structures, and any child or subsequent phytomers within the shoot.
Definition at line 2562 of file PlantArchitecture.cpp.
|
static |
Computes the normalized vector direction along the axis at a given fraction of the stem.
[in] | stem_fraction | Fraction along the stem (value between 0.0 and 1.0) for which the axis vector is computed. |
[in] | axis_vertices | A list of 3D points defining the vertices of the axis. |
Definition at line 334 of file PlantArchitecture.cpp.
helios::vec3 Phytomer::getInternodeAxisVector | ( | float | stem_fraction | ) | const |
Retrieves the axis vector of the internode at a given fraction along the internode.
[in] | stem_fraction | Fraction along the stem (value between 0.0 and 1.0) for which the axis vector is computed. |
Definition at line 313 of file PlantArchitecture.cpp.
float Phytomer::getInternodeLength | ( | ) | const |
Computes the total length of the internode.
Definition at line 360 of file PlantArchitecture.cpp.
std::vector< helios::vec3 > Phytomer::getInternodeNodePositions | ( | ) | const |
Retrieve the positions of nodes associated with an internode.
Definition at line 293 of file PlantArchitecture.cpp.
std::vector< float > Phytomer::getInternodeNodeRadii | ( | ) | const |
Retrieve the radii of nodes associated with an internode.
Definition at line 303 of file PlantArchitecture.cpp.
float Phytomer::getInternodeRadius | ( | ) | const |
Retrieves the radius of the internode.
Definition at line 356 of file PlantArchitecture.cpp.
float Phytomer::getInternodeRadius | ( | float | stem_fraction | ) | const |
Retrieves the radius of the internode based on the stem fraction.
[in] | stem_fraction | Fraction along the stem (value between 0.0 and 1.0) for which the radius is computed. |
Definition at line 374 of file PlantArchitecture.cpp.
float Phytomer::getLeafArea | ( | ) | const |
Calculates the total leaf area for the current phytomer.
Definition at line 378 of file PlantArchitecture.cpp.
helios::vec3 Phytomer::getLeafBasePosition | ( | uint | petiole_index, |
uint | leaf_index | ||
) | const |
Retrieves the position of the base of a leaf within the phytomer.
[in] | petiole_index | Index of the petiole within the phytomer structure. |
[in] | leaf_index | Index of the leaf within the specified petiole. |
Definition at line 393 of file PlantArchitecture.cpp.
helios::vec3 Phytomer::getPeduncleAxisVector | ( | float | stem_fraction, |
uint | petiole_index, | ||
uint | bud_index | ||
) | const |
Retrieves the peduncle axis vector for a given stem fraction, petiole index, and floral bud index.
[in] | stem_fraction | Fraction along the peduncle (value between 0.0 and 1.0) for which the axis vector is computed. |
[in] | petiole_index | Index of the petiole containing the floral bud. |
[in] | bud_index | Index of the floral bud within the petiole. |
Definition at line 324 of file PlantArchitecture.cpp.
helios::vec3 Phytomer::getPetioleAxisVector | ( | float | stem_fraction, |
uint | petiole_index | ||
) | const |
Retrieves the petiole axis vector for a given stem fraction and petiole index.
[in] | stem_fraction | Fraction along the stem (value between 0.0 and 1.0) for which the axis vector is computed. |
[in] | petiole_index | Index of the petiole for which the axis vector is retrieved. |
Definition at line 317 of file PlantArchitecture.cpp.
float Phytomer::getPetioleLength | ( | ) | const |
Retrieves the length of the petiole.
Definition at line 369 of file PlantArchitecture.cpp.
bool Phytomer::hasLeaf | ( | ) | const |
Checks if the phytomer has a leaf.
Definition at line 2628 of file PlantArchitecture.cpp.
void Phytomer::removeLeaf | ( | ) |
Removes the leaf and its associated properties from the phytomer.
This function resets the phytomer's leaf-related attributes, such as petiole radii, vertices, colors, length, and other geometric properties. It also removes associated objects from the context.
Definition at line 2541 of file PlantArchitecture.cpp.
void Phytomer::rotateLeaf | ( | uint | petiole_index, |
uint | leaf_index, | ||
const AxisRotation & | rotation | ||
) |
Rotates a specified leaf around its base using the given rotation parameters.
This function adjusts the leaf's orientation based on the specified petiole and leaf indices and applies the provided axis rotation values.
[in] | petiole_index | Index identifying the petiole to which the leaf belongs |
[in] | leaf_index | Index of the specific leaf within the petiole |
[in] | rotation | AxisRotation object containing pitch, roll, and yaw values for the rotation |
Definition at line 2276 of file PlantArchitecture.cpp.
void Phytomer::scaleInternodeMaxLength | ( | float | scale_factor | ) |
Scale the fully-elongated (maximum) internode length as a fraction of its current fully-elongated length.
[in] | scale_factor | Fraction by which to scale the fully-elongated internode length |
Definition at line 2373 of file PlantArchitecture.cpp.
void Phytomer::scaleLeafPrototypeScale | ( | float | scale_factor | ) |
Scales the leaf prototype by the given scale factor for all petioles in the phytomer. Value is uniformly applied for all leaves/leaflets in the petiole.
[in] | scale_factor | Factor by which to scale the leaf prototype. Values less than 0 are clamped to 0. |
Definition at line 2518 of file PlantArchitecture.cpp.
void Phytomer::scaleLeafPrototypeScale | ( | uint | petiole_index, |
float | scale_factor | ||
) |
Scales the leaf prototype by the given scale factor. Value is uniformly applied for all leaves/leaflets in the petiole.
This function scales the leaf prototype geometry by the specified factor.
petiole_index | Index of the petiole to which the leaf belongs | |
[in] | scale_factor | Factor by which to scale the leaf prototype. Values less than 0 are clamped to 0. |
Definition at line 2494 of file PlantArchitecture.cpp.
void Phytomer::setFloralBudState | ( | BudState | state | ) |
Sets the floral bud state for all non-terminal buds.
[in] | state | New BudState to apply to all non-terminal buds. |
Definition at line 426 of file PlantArchitecture.cpp.
void Phytomer::setFloralBudState | ( | BudState | state, |
FloralBud & | fbud | ||
) |
Sets the state of a floral bud.
[in] | state | New state to set for the floral bud. |
[in,out] | fbud | Reference to the FloralBud object whose state is to be updated. |
Definition at line 446 of file PlantArchitecture.cpp.
Sets the state of a specific floral bud.
[in] | state | The new state to set for the floral bud. |
[in] | petiole_index | The index of the petiole containing the target bud. |
[in] | bud_index | The index of the bud within the specified petiole. |
Definition at line 436 of file PlantArchitecture.cpp.
void Phytomer::setInflorescenceScaleFraction | ( | FloralBud & | fbud, |
float | inflorescence_scale_factor_fraction | ||
) | const |
Sets the scaling fraction for the inflorescence of a floral bud.
[in] | fbud | Reference to the floral bud object whose inflorescence scaling will be updated. |
[in] | inflorescence_scale_factor_fraction | Fractional value (between 0 and 1) representing the new scale factor for the inflorescence. |
Definition at line 2524 of file PlantArchitecture.cpp.
void Phytomer::setInternodeLengthScaleFraction | ( | float | internode_scale_factor_fraction, |
bool | update_context_geometry | ||
) |
Set the current internode length as a fraction of its maximum length.
[in] | internode_scale_factor_fraction | Fraction of the maximum internode length |
[in] | update_context_geometry | If true, the context geometry will be immediately updated to reflect the new internode length. If false, the geometry will be updated the next time Context geometry information is needed. |
Definition at line 2332 of file PlantArchitecture.cpp.
void Phytomer::setInternodeMaxLength | ( | float | internode_length_max_new | ) |
Set the fully-elongated (maximum) internode length.
[in] | internode_length_max_new | Fully-elongated length of the internode |
Definition at line 2384 of file PlantArchitecture.cpp.
void Phytomer::setInternodeMaxRadius | ( | float | internode_radius_max_new | ) |
Set the maximum radius of the internode.
[in] | internode_radius_max_new | Maximum radius of the internode |
Definition at line 2389 of file PlantArchitecture.cpp.
void Phytomer::setLeafPrototypeScale | ( | float | leaf_prototype_scale | ) |
Set the fully-elongated (maximum) leaf prototype scale for all petioles in the phytomer. Value is uniformly applied for all leaves/leaflets in the petiole.
[in] | leaf_prototype_scale | Leaf scale factor for fully-elongated leaf |
Definition at line 2488 of file PlantArchitecture.cpp.
void Phytomer::setLeafPrototypeScale | ( | uint | petiole_index, |
float | leaf_prototype_scale | ||
) |
Set the fully-elongated (maximum) leaf prototype scale. Value is uniformly applied for all leaves/leaflets in the petiole.
petiole_index | Index of the petiole to which the leaf belongs | |
[in] | leaf_prototype_scale | Leaf scale factor for fully-elongated leaf |
Definition at line 2462 of file PlantArchitecture.cpp.
void Phytomer::setLeafScaleFraction | ( | float | leaf_scale_factor_fraction | ) |
Set the leaf scale as a fraction of its total fully-elongated scale factor for all petioles in the phytomer. Value is uniformly applied for all leaves/leaflets in the phytomer.
[in] | leaf_scale_factor_fraction | Fraction of the total fully-elongated leaf scale factor (i.e., =1 for fully-elongated leaf) |
Definition at line 2456 of file PlantArchitecture.cpp.
void Phytomer::setLeafScaleFraction | ( | uint | petiole_index, |
float | leaf_scale_factor_fraction | ||
) |
Set the leaf scale as a fraction of its total fully-elongated scale factor. Value is uniformly applied for all leaves/leaflets in the petiole.
petiole_index | Index of the petiole to which the leaf belongs | |
[in] | leaf_scale_factor_fraction | Fraction of the total fully-elongated leaf scale factor (i.e., =1 for fully-elongated leaf) |
Definition at line 2393 of file PlantArchitecture.cpp.
void Phytomer::setPetioleBase | ( | const helios::vec3 & | base_position | ) |
Sets the base position of the petiole to the specified position.
Updates the position of the petiole, leaf bases, and floral buds, ensuring all associated geometry and objects are translated accordingly.
[in] | base_position | New base position for the petiole |
Definition at line 2242 of file PlantArchitecture.cpp.
void Phytomer::setVegetativeBudState | ( | BudState | state | ) |
Sets the vegetative bud state for all axillary vegetative buds in the phytomer.
[in] | state | The new state to apply to the vegetative buds. |
Definition at line 404 of file PlantArchitecture.cpp.
Sets the state of a vegetative bud at the specified petiole and bud indices.
[in] | state | The desired vegetative bud state. |
[in] | petiole_index | Index of the petiole where the bud is located. |
[in] | bud_index | Index of the bud within the specified petiole. |
Definition at line 412 of file PlantArchitecture.cpp.
|
static |
Sets the vegetative bud's state to the specified state.
[in] | state | The desired state to set for the vegetative bud. |
[in,out] | vbud | Reference to the vegetative bud whose state will be modified. |
Definition at line 422 of file PlantArchitecture.cpp.
|
friend |
Definition at line 1377 of file PlantArchitecture.h.
|
friend |
Definition at line 1376 of file PlantArchitecture.h.
float Phytomer::age = 0 |
Time since the phytomer was created.
Definition at line 1324 of file PlantArchitecture.h.
std::vector<std::vector<VegetativeBud> > Phytomer::axillary_vegetative_buds |
Definition at line 1334 of file PlantArchitecture.h.
bool Phytomer::build_context_geometry_peduncle = true |
Definition at line 1342 of file PlantArchitecture.h.
bool Phytomer::build_context_geometry_petiole = true |
Definition at line 1341 of file PlantArchitecture.h.
float Phytomer::current_internode_scale_factor = 1 |
Definition at line 1327 of file PlantArchitecture.h.
std::vector<float> Phytomer::current_leaf_scale_factor |
Definition at line 1328 of file PlantArchitecture.h.
float Phytomer::downstream_leaf_area = 0 |
Definition at line 1332 of file PlantArchitecture.h.
std::vector<std::vector<FloralBud> > Phytomer::floral_buds |
Definition at line 1335 of file PlantArchitecture.h.
std::vector<helios::RGBcolor> Phytomer::internode_colors |
Definition at line 1307 of file PlantArchitecture.h.
float Phytomer::internode_length_max |
Definition at line 1339 of file PlantArchitecture.h.
float Phytomer::internode_phyllotactic_angle |
Definition at line 1298 of file PlantArchitecture.h.
float Phytomer::internode_pitch |
Definition at line 1298 of file PlantArchitecture.h.
float Phytomer::internode_radius_initial |
Definition at line 1337 of file PlantArchitecture.h.
float Phytomer::internode_radius_max |
Definition at line 1338 of file PlantArchitecture.h.
bool Phytomer::isdormant = false |
Definition at line 1325 of file PlantArchitecture.h.
std::vector<std::vector<helios::vec3> > Phytomer::leaf_bases |
Definition at line 1296 of file PlantArchitecture.h.
std::vector<std::vector<uint> > Phytomer::leaf_objIDs |
Definition at line 1311 of file PlantArchitecture.h.
std::vector<std::vector<AxisRotation> > Phytomer::leaf_rotation |
Definition at line 1305 of file PlantArchitecture.h.
std::vector<std::vector<float> > Phytomer::leaf_size_max |
Definition at line 1304 of file PlantArchitecture.h.
float Phytomer::old_phytomer_volume = 0 |
Definition at line 1330 of file PlantArchitecture.h.
uint Phytomer::parent_shoot_ID |
Definition at line 1320 of file PlantArchitecture.h.
Shoot* Phytomer::parent_shoot_ptr |
Definition at line 1321 of file PlantArchitecture.h.
std::vector<std::vector<std::vector<helios::vec3> > > Phytomer::peduncle_vertices |
Definition at line 1297 of file PlantArchitecture.h.
std::vector<helios::RGBcolor> Phytomer::petiole_colors |
Definition at line 1308 of file PlantArchitecture.h.
std::vector<float> Phytomer::petiole_curvature |
Definition at line 1303 of file PlantArchitecture.h.
std::vector<float> Phytomer::petiole_length |
Definition at line 1301 of file PlantArchitecture.h.
std::vector<std::vector<uint> > Phytomer::petiole_objIDs |
Definition at line 1310 of file PlantArchitecture.h.
std::vector<float> Phytomer::petiole_pitch |
Definition at line 1302 of file PlantArchitecture.h.
std::vector<std::vector<float> > Phytomer::petiole_radii |
Definition at line 1300 of file PlantArchitecture.h.
std::vector<std::vector<helios::vec3> > Phytomer::petiole_vertices |
Coordinates of internode tube segments. Index is tube segment within internode.
Definition at line 1295 of file PlantArchitecture.h.
PhytomerParameters Phytomer::phytomer_parameters |
Definition at line 1313 of file PlantArchitecture.h.
uint Phytomer::plantID |
Definition at line 1319 of file PlantArchitecture.h.
uint Phytomer::rank |
Definition at line 1315 of file PlantArchitecture.h.
helios::int3 Phytomer::shoot_index |
.x = index of phytomer along shoot, .y = current number of phytomers on parent shoot, .z = maximum number of phytomers on parent shoot
Definition at line 1317 of file PlantArchitecture.h.