Public Member Functions | |
PlantArchitecture (helios::Context *context_ptr) | |
Main architectural model class constructor. | |
~PlantArchitecture () | |
Destructor - cleans up internal CollisionDetection instance if owned. | |
void | optionalOutputObjectData (const std::string &object_data_label) |
Add optional output object data values to the Context. | |
void | optionalOutputObjectData (const std::vector< std::string > &object_data_labels) |
Add optional output object data values to the Context. | |
void | loadPlantModelFromLibrary (const std::string &plant_label) |
Load an existing plant model from the library. | |
std::vector< std::string > | getAvailablePlantModels () const |
Get list of all available plant models in the library. | |
uint | buildPlantInstanceFromLibrary (const helios::vec3 &base_position, float age) |
Build a plant instance based on the model currently loaded from the library. | |
std::vector< uint > | buildPlantCanopyFromLibrary (const helios::vec3 &canopy_center_position, const helios::vec2 &plant_spacing_xy, const helios::int2 &plant_count_xy, float age, float germination_rate=1.f) |
Build a canopy of regularly spaced plants based on the model currently loaded from the library. | |
std::vector< uint > | buildPlantCanopyFromLibrary (const helios::vec3 &canopy_center_position, const helios::vec2 &canopy_extent_xy, uint plant_count, float age) |
Build a canopy of randomly scattered plants based on the model currently loaded from the library. | |
ShootParameters | getCurrentShootParameters (const std::string &shoot_type_label) |
Get the shoot parameters structure for a specific shoot type in the current plant model. | |
std::map< std::string, ShootParameters > | getCurrentShootParameters () |
Get the shoot parameters structure for all shoot types in the current plant model. | |
std::map< std::string, PhytomerParameters > | getCurrentPhytomerParameters () |
Get the phytomer parameters structure for all shoot types in the current plant model. | |
void | updateCurrentShootParameters (const std::string &shoot_type_label, const ShootParameters ¶ms) |
Update the parameters of a single shoot type in the current plant model. | |
void | updateCurrentShootParameters (const std::map< std::string, ShootParameters > ¶ms) |
Update the parameters of all shoot types in the current plant model. | |
uint | addPlantInstance (const helios::vec3 &base_position, float current_age) |
Create an instance of a plant. | |
uint | duplicatePlantInstance (uint plantID, const helios::vec3 &base_position, const AxisRotation &base_rotation, float current_age) |
Duplicate an existing plant instance and specify its base position and age. | |
void | deletePlantInstance (uint plantID) |
Delete an existing plant instance. | |
void | deletePlantInstance (const std::vector< uint > &plantIDs) |
Delete multiple existing plant instances. | |
void | setPlantPhenologicalThresholds (uint plantID, float time_to_dormancy_break, float time_to_flower_initiation, float time_to_flower_opening, float time_to_fruit_set, float time_to_fruit_maturity, float time_to_dormancy, float max_leaf_lifespan=1e6, bool is_evergreen=false) |
Specify the threshold values for plant phenological stages. All time values have units of days. | |
void | setPlantCarbohydrateModelParameters (uint plantID, const CarbohydrateParameters &carb_parameters) |
Sets the carbohydrate model parameters for a specific plant. | |
void | setPlantCarbohydrateModelParameters (const std::vector< uint > &plantIDs, const CarbohydrateParameters &carb_parameters) |
Sets carbohydrate model parameters for specified plants. | |
void | disablePlantPhenology (uint plantID) |
Disables the phenological progression of a specified plant instance. | |
void | advanceTime (float time_step_days) |
Advance plant growth by a specified time interval for all plants. | |
void | advanceTime (int time_step_years, float time_step_days) |
Advance plant growth by a specified time interval for all plants. | |
void | advanceTime (uint plantID, float time_step_days) |
Advance plant growth by a specified time interval for a single plant. | |
void | advanceTime (const std::vector< uint > &plantIDs, float time_step_days) |
Advance plant growth by a specified time interval for a specified set of plants. | |
void | adjustFruitForObstacleCollision () |
Adjust fruit objects to prevent collision with solid obstacles via rotation. | |
void | accumulateHourlyLeafPhotosynthesis () const |
Accumulates hourly net photosynthesis for each leaf in the plant architecture. | |
void | defineShootType (const std::string &shoot_type_label, const ShootParameters &shoot_params) |
Define a new shoot type based on a set of ShootParameters. | |
uint | addBaseStemShoot (uint plantID, uint current_node_number, const AxisRotation &base_rotation, float internode_radius, float internode_length_max, float internode_length_scale_factor_fraction, float leaf_scale_factor_fraction, float radius_taper, const std::string &shoot_type_label) |
Define the stem/trunk shoot (base of plant) to start a new plant. This requires a plant instance has already been created using the addPlantInstance() method. | |
uint | appendShoot (uint plantID, int parent_shoot_ID, uint current_node_number, const AxisRotation &base_rotation, float internode_radius, float internode_length_max, float internode_length_scale_factor_fraction, float leaf_scale_factor_fraction, float radius_taper, const std::string &shoot_type_label) |
Manually append a new shoot at the end of an existing shoot. This is used when the characteristics of a shoot change along its length (e.g., from a unifoliate to trifoliate leaf). | |
uint | addChildShoot (uint plantID, int parent_shoot_ID, uint parent_node_index, uint current_node_number, const AxisRotation &shoot_base_rotation, float internode_radius, float internode_length_max, float internode_length_scale_factor_fraction, float leaf_scale_factor_fraction, float radius_taper, const std::string &shoot_type_label, uint petiole_index=0) |
Manually add a child shoot at the axillary bud of a phytomer. | |
uint | addEpicormicShoot (uint plantID, int parent_shoot_ID, float parent_position_fraction, uint current_node_number, float zenith_perturbation_degrees, float internode_radius, float internode_length_max, float internode_length_scale_factor_fraction, float leaf_scale_factor_fraction, float radius_taper, const std::string &shoot_type_label) |
Manually add a child epicormic shoot (water sprout) at an arbitrary position along the shoot. | |
int | appendPhytomerToShoot (uint plantID, uint shootID, const PhytomerParameters &phytomer_parameters, float internode_radius, float internode_length_max, float internode_length_scale_factor_fraction, float leaf_scale_factor_fraction) |
Add a new phytomer at the terminal bud of a shoot. | |
void | enableEpicormicChildShoots (uint plantID, const std::string &epicormic_shoot_type_label, float epicormic_probability_perlength_perday) |
Enable shoot type to produce epicormic child shoots (water sprouts) | |
void | disableInternodeContextBuild () |
Do not build internode primitive geometry in the Context. | |
void | disablePetioleContextBuild () |
Do not build petiole primitive geometry in the Context. | |
void | disablePeduncleContextBuild () |
Do not build peduncle primitive geometry in the Context. | |
void | enableGroundClipping (float ground_height=0.f) |
Enable automatic removal of organs that are below the ground plane. | |
void | enableSoftCollisionAvoidance (const std::vector< uint > &target_object_UUIDs={}, const std::vector< uint > &target_object_IDs={}, bool enable_petiole_collision=false, bool enable_fruit_collision=false) |
Enable collision detection for plant growth avoidance (creates internal CollisionDetection instance) | |
void | disableCollisionDetection () |
Disable collision detection for plant growth and clean up internal CollisionDetection instance. | |
void | setSoftCollisionAvoidanceParameters (float view_half_angle_deg, float look_ahead_distance, int sample_count, float inertia_weight) |
Set collision avoidance parameters. | |
void | setStaticObstacles (const std::vector< uint > &target_UUIDs) |
Mark specific geometry as static for collision detection efficiency. | |
CollisionDetection * | getCollisionDetection () const |
Get access to the internal CollisionDetection instance (for advanced usage) | |
void | setCollisionRelevantOrgans (bool include_internodes, bool include_leaves, bool include_petioles, bool include_flowers, bool include_fruit) |
Set which organ types should participate in collision detection. | |
void | enableSolidObstacleAvoidance (const std::vector< uint > &obstacle_UUIDs, float avoidance_distance=0.5f, bool enable_fruit_adjustment=false, bool enable_obstacle_pruning=false) |
Enable solid obstacle avoidance for plant growth. | |
void | setGeometryUpdateScheduling (int update_frequency=3, bool force_update_on_collision=true) |
Configure Context geometry update scheduling for efficiency. | |
void | enableAttractionPoints (const std::vector< helios::vec3 > &attraction_points, float view_half_angle_deg=80.0f, float look_ahead_distance=0.1f, float attraction_weight=0.6f) |
Enable attraction points to guide plant growth toward specific targets. | |
void | disableAttractionPoints () |
Disable attraction points and revert to natural growth. | |
void | updateAttractionPoints (const std::vector< helios::vec3 > &attraction_points) |
Update attraction points positions (overwrites existing points) | |
void | appendAttractionPoints (const std::vector< helios::vec3 > &attraction_points) |
Update attraction points positions by appending to any existing points. | |
void | setAttractionParameters (float view_half_angle_deg, float look_ahead_distance, float attraction_weight, float obstacle_reduction_factor=0.75f) |
Set attraction parameters. | |
void | enableAttractionPoints (uint plantID, const std::vector< helios::vec3 > &attraction_points, float view_half_angle_deg=80.0f, float look_ahead_distance=0.1f, float attraction_weight=0.6f) |
Enable attraction points for a specific plant. | |
void | disableAttractionPoints (uint plantID) |
Disable attraction points for a specific plant. | |
void | updateAttractionPoints (uint plantID, const std::vector< helios::vec3 > &attraction_points) |
Update attraction points positions for a specific plant (overwrites existing points) | |
void | appendAttractionPoints (uint plantID, const std::vector< helios::vec3 > &attraction_points) |
Append attraction points for a specific plant. | |
void | setAttractionParameters (uint plantID, float view_half_angle_deg, float look_ahead_distance, float attraction_weight, float obstacle_reduction_factor=0.75f) |
Set attraction parameters for a specific plant. | |
bool | detectAttractionPointsInCone (const helios::vec3 &vertex, const helios::vec3 &look_direction, float look_ahead_distance, float half_angle_degrees, helios::vec3 &direction_to_closest) const |
Detects attraction points within a viewing cone from a given position. | |
bool | detectAttractionPointsInCone (const std::vector< helios::vec3 > &attraction_points, const helios::vec3 &vertex, const helios::vec3 &look_direction, float look_ahead_distance, float half_angle_degrees, helios::vec3 &direction_to_closest) const |
Overloaded version that accepts attraction points as a parameter (for plant-specific attraction points) | |
void | initializeCarbohydratePool (float carbohydrate_concentration_molC_m3) const |
Initializes the carbohydrate pool for all shoots of all plant instances. | |
void | initializePlantCarbohydratePool (uint plantID, float carbohydrate_concentration_molC_m3) |
Initializes the carbohydrate pool for a specific plant. | |
void | initializeShootCarbohydratePool (uint plantID, uint shootID, float carbohydrate_concentration_molC_m3) |
Initializes the carbohydrate pool for a specific shoot of a plant. | |
void | setPhytomerLeafScale (uint plantID, uint shootID, uint node_number, float leaf_scale_factor_fraction) |
Adjusts the leaf scaling factor (length as a fraction of its maximal length) for a specific phytomer on a plant shoot. | |
void | setPlantBasePosition (uint plantID, const helios::vec3 &base_position) |
Sets the base position of a plant with the specified ID. | |
void | setPlantLeafElevationAngleDistribution (uint plantID, float Beta_mu_inclination, float Beta_nu_inclination) const |
Sets the leaf elevation angle distribution for a specific plant. | |
void | setPlantLeafElevationAngleDistribution (const std::vector< uint > &plantIDs, float Beta_mu_inclination, float Beta_nu_inclination) const |
Sets the leaf elevation angle distribution for a list of plants. | |
void | setPlantLeafAzimuthAngleDistribution (uint plantID, float eccentricity, float ellipse_rotation_degrees) const |
Sets the azimuth angle distribution for plant leaves. | |
void | setPlantLeafAzimuthAngleDistribution (const std::vector< uint > &plantIDs, float eccentricity, float ellipse_rotation_degrees) const |
Sets the azimuth angle distribution of plant leaves. | |
void | setPlantLeafAngleDistribution (uint plantID, float Beta_mu_inclination, float Beta_nu_inclination, float eccentricity, float ellipse_rotation_degrees) const |
Sets the leaf angle distribution (both elevation and azimuth) for a specific plant. | |
void | setPlantLeafAngleDistribution (const std::vector< uint > &plantIDs, float Beta_mu_inclination, float Beta_nu_inclination, float eccentricity, float ellipse_rotation_degrees) const |
Sets the leaf angle distribution (both elevation and azimuth) for a list of specified plants. | |
void | setPlantAge (uint plantID, float current_age) |
Don't use this. | |
void | harvestPlant (uint plantID) |
Harvests a plant by removing all leaves and fruit. | |
void | removeShootLeaves (uint plantID, uint shootID) |
Removes all leaves from a specified shoot in a specified plant. | |
void | removeShootVegetativeBuds (uint plantID, uint shootID) |
Removes all vegetative buds from a specified shoot in a specified plant. | |
void | removePlantLeaves (uint plantID) |
Removes all leaves from the plant with the specified ID. | |
void | makePlantDormant (uint plantID) |
Makes the specified plant enter a dormant state. | |
void | breakPlantDormancy (uint plantID) |
Breaks the dormancy of all shoots in the specified plant. | |
void | pruneBranch (uint plantID, uint shootID, uint node_index) |
Prunes a branch from a specific plant at a designated node index. | |
std::string | getPlantName (uint plantID) const |
Retrieves the name of the plant associated with a given plant ID. | |
float | getPlantAge (uint plantID) const |
Retrieves the age of a specific plant. | |
uint | getShootNodeCount (uint plantID, uint shootID) const |
Retrieves the number of nodes in a specific shoot of a specific plant. | |
float | getShootTaper (uint plantID, uint shootID) const |
Retrieves the taper of a shoot based on its radius measurements. | |
helios::vec3 | getPlantBasePosition (uint plantID) const |
Retrieves the base position of the specified plant. | |
std::vector< helios::vec3 > | getPlantBasePosition (const std::vector< uint > &plantIDs) const |
Retrieves the base positions of multiple plants. | |
float | sumPlantLeafArea (uint plantID) const |
Sum the one-sided leaf area of all leaves in the plant. | |
float | getPlantStemHeight (uint plantID) const |
Calculate the height of the last internode on the base stem/shoot. | |
float | getPlantHeight (uint plantID) const |
Calculate the height of the highest element in the plant. | |
std::vector< float > | getPlantLeafInclinationAngleDistribution (uint plantID, uint Nbins, bool normalize=true) const |
Calculate the leaf inclination angle distribution of all leaves in the plant. | |
std::vector< float > | getPlantLeafInclinationAngleDistribution (const std::vector< uint > &plantIDs, uint Nbins, bool normalize=true) const |
Calculate the leaf inclination angle distribution of all leaves in multiple plants. | |
std::vector< float > | getPlantLeafAzimuthAngleDistribution (uint plantID, uint Nbins, bool normalize=true) const |
Calculate the leaf azimuth angle distribution of all leaves in the plant. | |
std::vector< float > | getPlantLeafAzimuthAngleDistribution (const std::vector< uint > &plantIDs, uint Nbins, bool normalize=true) const |
Calculate the leaf azimuth angle distribution of all leaves in multiple plants. | |
uint | getPlantLeafCount (uint plantID) const |
Get the total number of leaves on the plant. | |
std::vector< helios::vec3 > | getPlantLeafBases (uint plantID) const |
Get the base positions of all leaves on the plant. | |
std::vector< helios::vec3 > | getPlantLeafBases (const std::vector< uint > &plantIDs) const |
Get the base positions of all leaves for a list of plants. | |
bool | isPlantDormant (uint plantID) const |
Checks if the plant with the given ID is dormant. | |
void | writePlantMeshVertices (uint plantID, const std::string &filename) const |
Write all vertices in the plant to a file for external processing (e.g., bounding volume, convex hull) | |
std::vector< uint > | getAllPlantIDs () const |
Get IDs for all plant instances. | |
std::vector< uint > | getAllPlantObjectIDs (uint plantID) const |
Get object IDs for all organs objects for a given plant. | |
std::vector< uint > | getAllPlantUUIDs (uint plantID) const |
Get primitive UUIDs for all primitives in a given plant. | |
std::vector< uint > | getPlantInternodeObjectIDs (uint plantID) const |
Get object IDs for all internode (Tube) objects for a given plant. | |
std::vector< uint > | getPlantPetioleObjectIDs (uint plantID) const |
Get object IDs for all petiole (Tube) objects for a given plant. | |
std::vector< uint > | getPlantLeafObjectIDs (uint plantID) const |
Get object IDs for all leaf objects for a given plant. | |
std::vector< uint > | getPlantLeafObjectIDs (const std::vector< uint > &plantIDs) const |
Get object IDs for all leaf objects for a list of plants. | |
std::vector< uint > | getPlantPeduncleObjectIDs (uint plantID) const |
Get object IDs for all peduncle (Tube) objects for a given plant. | |
std::vector< uint > | getPlantFlowerObjectIDs (uint plantID) const |
Get object IDs for all inflorescence objects for a given plant. | |
std::vector< uint > | getPlantFruitObjectIDs (uint plantID) const |
Get object IDs for all fruit objects for a given plant. | |
std::vector< uint > | getPlantCollisionRelevantObjectIDs (uint plantID) const |
Get collision-relevant object IDs for a specific plant. | |
std::vector< uint > | getAllUUIDs () const |
Get UUIDs for all existing plant primitives. | |
std::vector< uint > | getAllLeafUUIDs () const |
Get UUIDs for all existing leaf primitives. | |
std::vector< uint > | getAllInternodeUUIDs () const |
Get UUIDs for all existing internode primitives. | |
std::vector< uint > | getAllPetioleUUIDs () const |
Get UUIDs for all existing petiole primitives. | |
std::vector< uint > | getAllPeduncleUUIDs () const |
Get UUIDs for all existing peduncle primitives. | |
std::vector< uint > | getAllFlowerUUIDs () const |
Get UUIDs for all existing flower primitives. | |
std::vector< uint > | getAllFruitUUIDs () const |
Get UUIDs for all existing fruit primitives. | |
std::vector< uint > | getAllObjectIDs () const |
Get object IDs for all existing plant compound objects. | |
void | enableCarbohydrateModel () |
Enables the carbohydrate model in the plant architecture development. | |
void | disableCarbohydrateModel () |
Disables the carbohydrate model. | |
std::string | getPlantString (uint plantID) const |
Retrieves a string representation of a plant based on its ID. | |
uint | generatePlantFromString (const std::string &generation_string, const PhytomerParameters &phytomer_parameters) |
Generates a plant model based on the given generation string and phytomer parameters. | |
uint | generatePlantFromString (const std::string &generation_string, const std::map< std::string, PhytomerParameters > &phytomer_parameters) |
Generates a plant based on the provided description string and phytomer parameters. | |
void | writePlantStructureXML (uint plantID, const std::string &filename) const |
Writes the structure of a plant instance to an XML file. | |
void | writeQSMCylinderFile (uint plantID, const std::string &filename) const |
Writes plant structure to TreeQSM cylinder format. | |
std::vector< uint > | readPlantStructureXML (const std::string &filename, bool quiet=false) |
Reads plant structure data from an XML file. | |
void | disableMessages () |
Disable standard output from this plug-in. | |
void | enableMessages () |
Re-enable standard output from this plug-in. | |
Static Public Member Functions | |
static int | selfTest (int argc, char **argv) |
Unit test routines. | |
Friends | |
struct | Phytomer |
struct | Shoot |
Definition at line 1618 of file PlantArchitecture.h.
|
explicit |
Main architectural model class constructor.
[in] | context_ptr | Pointer to the Helios context. |
Definition at line 91 of file PlantArchitecture.cpp.
PlantArchitecture::~PlantArchitecture | ( | ) |
Destructor - cleans up internal CollisionDetection instance if owned.
Definition at line 109 of file PlantArchitecture.cpp.
void PlantArchitecture::accumulateHourlyLeafPhotosynthesis | ( | ) | const |
Accumulates hourly net photosynthesis for each leaf in the plant architecture.
This function iterates through all the plants in the architecture, handling both dormant and active shoots. It retrieves and processes the net hourly photosynthesis values for each leaf, calculates the hourly contribution in moles of carbon, and updates the cumulative net photosynthesis data.
Definition at line 96 of file CarbohydrateModel.cpp.
uint PlantArchitecture::addBaseStemShoot | ( | uint | plantID, |
uint | current_node_number, | ||
const AxisRotation & | base_rotation, | ||
float | internode_radius, | ||
float | internode_length_max, | ||
float | internode_length_scale_factor_fraction, | ||
float | leaf_scale_factor_fraction, | ||
float | radius_taper, | ||
const std::string & | shoot_type_label | ||
) |
Define the stem/trunk shoot (base of plant) to start a new plant. This requires a plant instance has already been created using the addPlantInstance() method.
[in] | plantID | ID of the plant instance. |
[in] | current_node_number | Number of nodes of the stem shoot. |
[in] | base_rotation | AxisRotation object (pitch, yaw, roll) specifying the orientation of the base of the shoot. |
[in] | internode_radius | Radius of the internodes along the shoot. |
[in] | internode_length_max | Maximum length (i.e., fully elongated) of the internodes along the shoot. |
[in] | internode_length_scale_factor_fraction | Scaling factor of the maximum internode length to determine the actual initial internode length at the time of creation (=1 applies no scaling). |
[in] | leaf_scale_factor_fraction | Scaling factor of the leaf/petiole to determine the actual initial leaf size at the time of creation (=1 applies no scaling). |
[in] | radius_taper | Tapering factor of the internode radius along the shoot (0=constant radius, 1=linear taper to zero radius). |
[in] | shoot_type_label | Label of the shoot type to be used for the base stem shoot. This requires that the shoot type has already been defined using the defineShootType() method. |
Definition at line 2779 of file PlantArchitecture.cpp.
uint PlantArchitecture::addChildShoot | ( | uint | plantID, |
int | parent_shoot_ID, | ||
uint | parent_node_index, | ||
uint | current_node_number, | ||
const AxisRotation & | shoot_base_rotation, | ||
float | internode_radius, | ||
float | internode_length_max, | ||
float | internode_length_scale_factor_fraction, | ||
float | leaf_scale_factor_fraction, | ||
float | radius_taper, | ||
const std::string & | shoot_type_label, | ||
uint | petiole_index = 0 |
||
) |
Manually add a child shoot at the axillary bud of a phytomer.
[in] | plantID | ID of the plant instance. |
[in] | parent_shoot_ID | ID of the shoot to which the new shoot will be added. |
[in] | parent_node_index | Number of the node of the parent shoot at which the new shoot will be added. |
[in] | current_node_number | Number of nodes of the newly added shoot. |
[in] | shoot_base_rotation | AxisRotation object (pitch, yaw, roll) specifying the orientation of the base of the shoot. |
[in] | internode_radius | Initial radius of the internodes along the shoot. |
[in] | internode_length_max | Length of the internode of the newly appended shoot. |
[in] | internode_length_scale_factor_fraction | Scaling factor of the maximum internode length to determine the actual initial internode length at the time of creation (=1 applies no scaling). |
[in] | leaf_scale_factor_fraction | Scaling factor of the leaf/petiole to determine the actual initial leaf size at the time of creation (=1 applies no scaling). |
[in] | radius_taper | Tapering factor of the internode radius along the shoot (0=constant radius, 1=linear taper to zero radius). |
[in] | shoot_type_label | Label of the shoot type to be used for the new shoot. This requires that the shoot type has already been defined using the defineShootType() method. |
[in] | petiole_index | [optional] Index of the petiole within the internode to which the new shoot will be attached (when there are multiple petioles per internode) |
Definition at line 2852 of file PlantArchitecture.cpp.
uint PlantArchitecture::addEpicormicShoot | ( | uint | plantID, |
int | parent_shoot_ID, | ||
float | parent_position_fraction, | ||
uint | current_node_number, | ||
float | zenith_perturbation_degrees, | ||
float | internode_radius, | ||
float | internode_length_max, | ||
float | internode_length_scale_factor_fraction, | ||
float | leaf_scale_factor_fraction, | ||
float | radius_taper, | ||
const std::string & | shoot_type_label | ||
) |
Manually add a child epicormic shoot (water sprout) at an arbitrary position along the shoot.
[in] | plantID | ID of the plant instance. |
[in] | parent_shoot_ID | ID of the shoot to which the new shoot will be added. |
[in] | parent_position_fraction | Position along the parent shoot to add the epicormic shoot as a fraction of the parent shoot length. |
[in] | current_node_number | Number of nodes of the newly added shoot. |
[in] | zenith_perturbation_degrees | Pitch angle of epicormic shoot base away from parent shoot axis (degrees). |
[in] | internode_radius | Initial radius of the internodes along the shoot. |
[in] | internode_length_max | Length of the internode of the newly appended shoot. |
[in] | internode_length_scale_factor_fraction | Scaling factor of the maximum internode length to determine the actual initial internode length at the time of creation (=1 applies no scaling). |
[in] | leaf_scale_factor_fraction | Scaling factor of the leaf/petiole to determine the actual initial leaf size at the time of creation (=1 applies no scaling). |
[in] | radius_taper | Tapering factor of the internode radius along the shoot (0=constant radius, 1=linear taper to zero radius). |
[in] | shoot_type_label | Label of the shoot type to be used for the new shoot. This requires that the shoot type has already been defined using the defineShootType() method. |
Definition at line 2893 of file PlantArchitecture.cpp.
uint PlantArchitecture::addPlantInstance | ( | const helios::vec3 & | base_position, |
float | current_age | ||
) |
Create an instance of a plant.
This is the first step of the plant building process. It creates an empty plant instance that can be built up manually, or using a pre-defined plant type in the library.
[in] | base_position | Cartesian coordinates of the base of the plant. |
[in] | current_age | Age of the plant in days. |
Definition at line 4205 of file PlantArchitecture.cpp.
void PlantArchitecture::adjustFruitForObstacleCollision | ( | ) |
Adjust fruit objects to prevent collision with solid obstacles via rotation.
This method checks all fruit in the plant architecture for collisions with solid obstacles and rotates them about their base position to prevent intersection. The rotation is applied in the opposite direction of the original pitch to simulate natural fruit lifting.
Definition at line 4808 of file PlantArchitecture.cpp.
void PlantArchitecture::advanceTime | ( | const std::vector< uint > & | plantIDs, |
float | time_step_days | ||
) |
Advance plant growth by a specified time interval for a specified set of plants.
[in] | plantIDs | IDs of the plant instances. |
[in] | time_step_days | Time interval in days. |
Definition at line 4348 of file PlantArchitecture.cpp.
void PlantArchitecture::advanceTime | ( | float | time_step_days | ) |
Advance plant growth by a specified time interval for all plants.
[in] | time_step_days | Time interval in days. |
Definition at line 4335 of file PlantArchitecture.cpp.
void PlantArchitecture::advanceTime | ( | int | time_step_years, |
float | time_step_days | ||
) |
Advance plant growth by a specified time interval for all plants.
[in] | time_step_years | Number of years to advance. |
[in] | time_step_days | Number of days to advance (added to number of years). |
Definition at line 4339 of file PlantArchitecture.cpp.
void PlantArchitecture::advanceTime | ( | uint | plantID, |
float | time_step_days | ||
) |
Advance plant growth by a specified time interval for a single plant.
[in] | plantID | ID of the plant instance. |
[in] | time_step_days | Time interval in days. |
Definition at line 4343 of file PlantArchitecture.cpp.
void PlantArchitecture::appendAttractionPoints | ( | const std::vector< helios::vec3 > & | attraction_points | ) |
Update attraction points positions by appending to any existing points.
[in] | attraction_points | Updated vector of 3D positions that plants should grow toward |
void PlantArchitecture::appendAttractionPoints | ( | uint | plantID, |
const std::vector< helios::vec3 > & | attraction_points | ||
) |
Append attraction points for a specific plant.
[in] | plantID | Identifier of the plant to append attraction points for |
[in] | attraction_points | Vector of 3D positions to append to existing attraction points |
int PlantArchitecture::appendPhytomerToShoot | ( | uint | plantID, |
uint | shootID, | ||
const PhytomerParameters & | phytomer_parameters, | ||
float | internode_radius, | ||
float | internode_length_max, | ||
float | internode_length_scale_factor_fraction, | ||
float | leaf_scale_factor_fraction | ||
) |
Add a new phytomer at the terminal bud of a shoot.
[in] | plantID | ID of the plant instance. |
[in] | shootID | ID of the shoot to which the phytomer will be added |
[in] | phytomer_parameters | Parameters of the phytomer to be added |
[in] | internode_radius | Radius of the phytomer internode at the time of creation |
[in] | internode_length_max | Maximum internode length at full elongation |
[in] | internode_length_scale_factor_fraction | Scaling factor of the maximum internode length to determine the actual initial internode length at the time of creation (=1 applies no scaling). |
[in] | leaf_scale_factor_fraction | Scaling factor of the leaf/petiole to determine the actual initial leaf size at the time of creation (=1 applies no scaling). |
Definition at line 2927 of file PlantArchitecture.cpp.
uint PlantArchitecture::appendShoot | ( | uint | plantID, |
int | parent_shoot_ID, | ||
uint | current_node_number, | ||
const AxisRotation & | base_rotation, | ||
float | internode_radius, | ||
float | internode_length_max, | ||
float | internode_length_scale_factor_fraction, | ||
float | leaf_scale_factor_fraction, | ||
float | radius_taper, | ||
const std::string & | shoot_type_label | ||
) |
Manually append a new shoot at the end of an existing shoot. This is used when the characteristics of a shoot change along its length (e.g., from a unifoliate to trifoliate leaf).
[in] | plantID | ID of the plant instance. |
[in] | parent_shoot_ID | ID of the shoot to which the new shoot will be appended. |
[in] | current_node_number | Number of nodes/phytomers of the newly appended shoot. |
[in] | base_rotation | AxisRotation object (pitch, yaw, roll) specifying the orientation of the base of the shoot relative to the parent shoot. |
[in] | internode_radius | Initial radius of the internodes along the shoot. |
[in] | internode_length_max | Length of the internode of the newly appended shoot. |
[in] | internode_length_scale_factor_fraction | Scaling factor of the maximum internode length to determine the actual initial internode length at the time of creation (=1 applies no scaling). |
[in] | leaf_scale_factor_fraction | Scaling factor of the leaf/petiole to determine the actual initial leaf size at the time of creation (=1 applies no scaling). |
[in] | radius_taper | Tapering factor of the internode radius along the shoot (0=constant radius, 1=linear taper to zero radius). |
[in] | shoot_type_label | Label of the shoot type to be used for the new shoot. This requires that the shoot type has already been defined using the defineShootType() method. |
Definition at line 2809 of file PlantArchitecture.cpp.
void PlantArchitecture::breakPlantDormancy | ( | uint | plantID | ) |
Breaks the dormancy of all shoots in the specified plant.
[in] | plantID | Identifier of the plant whose shoots' dormancy should be broken. |
Definition at line 3583 of file PlantArchitecture.cpp.
std::vector< uint > PlantArchitecture::buildPlantCanopyFromLibrary | ( | const helios::vec3 & | canopy_center_position, |
const helios::vec2 & | canopy_extent_xy, | ||
uint | plant_count, | ||
float | age | ||
) |
Build a canopy of randomly scattered plants based on the model currently loaded from the library.
[in] | canopy_center_position | Cartesian coordinates of the center of the canopy boundaries. |
[in] | canopy_extent_xy | Size/extent of the canopy boundaries in the x- and y-directions. |
[in] | plant_count | Number of plants to randomly generate inside canopy bounds. |
[in] | age | Age of the plants in the canopy in days. |
Definition at line 272 of file PlantArchitecture.cpp.
std::vector< uint > PlantArchitecture::buildPlantCanopyFromLibrary | ( | const helios::vec3 & | canopy_center_position, |
const helios::vec2 & | plant_spacing_xy, | ||
const helios::int2 & | plant_count_xy, | ||
float | age, | ||
float | germination_rate = 1.f |
||
) |
Build a canopy of regularly spaced plants based on the model currently loaded from the library.
[in] | canopy_center_position | Cartesian coordinates of the center of the canopy. |
[in] | plant_spacing_xy | Spacing between plants in the canopy in the x- and y-directions. |
[in] | plant_count_xy | Number of plants in the canopy in the x- and y-directions. |
[in] | age | Age of the plants in the canopy in days. |
[in] | germination_rate | [optional] Probability that a plant in the canopy germinates and a plant is created. |
Definition at line 248 of file PlantArchitecture.cpp.
uint PlantArchitecture::buildPlantInstanceFromLibrary | ( | const helios::vec3 & | base_position, |
float | age | ||
) |
Build a plant instance based on the model currently loaded from the library.
[in] | base_position | Cartesian coordinates of the base of the plant. |
[in] | age | Age of the plant in days. |
Definition at line 91 of file PlantLibrary.cpp.
void PlantArchitecture::defineShootType | ( | const std::string & | shoot_type_label, |
const ShootParameters & | shoot_params | ||
) |
Define a new shoot type based on a set of ShootParameters.
[in] | shoot_type_label | User-defined label for the new shoot type. This string is used later to reference this type of shoot. |
[in] | shoot_params | Parameters structure for the new shoot type. |
Definition at line 284 of file PlantArchitecture.cpp.
void PlantArchitecture::deletePlantInstance | ( | const std::vector< uint > & | plantIDs | ) |
Delete multiple existing plant instances.
[in] | plantIDs | IDs of the plant instances to be deleted. |
Definition at line 4286 of file PlantArchitecture.cpp.
void PlantArchitecture::deletePlantInstance | ( | uint | plantID | ) |
Delete an existing plant instance.
[in] | plantID | ID of the plant instance to be deleted. |
Definition at line 4276 of file PlantArchitecture.cpp.
bool PlantArchitecture::detectAttractionPointsInCone | ( | const helios::vec3 & | vertex, |
const helios::vec3 & | look_direction, | ||
float | look_ahead_distance, | ||
float | half_angle_degrees, | ||
helios::vec3 & | direction_to_closest | ||
) | const |
Detects attraction points within a viewing cone from a given position.
This method finds the closest attraction point within a cone defined by the look direction, half-angle, and look-ahead distance. It performs pure geometric calculations without requiring collision detection infrastructure.
[in] | vertex | Starting position (apex of the viewing cone) |
[in] | look_direction | Direction the cone is pointing (will be normalized) |
[in] | look_ahead_distance | Maximum distance to look for attraction points |
[in] | half_angle_degrees | Half-angle of the viewing cone in degrees (0-180) |
[out] | direction_to_closest | Unit vector pointing to the closest attraction point (if found) |
Definition at line 802 of file PlantArchitecture.cpp.
void PlantArchitecture::disableAttractionPoints | ( | ) |
Disable attraction points and revert to natural growth.
Definition at line 5589 of file PlantArchitecture.cpp.
void PlantArchitecture::disableAttractionPoints | ( | uint | plantID | ) |
Disable attraction points for a specific plant.
[in] | plantID | Identifier of the plant to disable attraction points for |
Definition at line 5707 of file PlantArchitecture.cpp.
void PlantArchitecture::disableCarbohydrateModel | ( | ) |
Disables the carbohydrate model.
Definition at line 4201 of file PlantArchitecture.cpp.
void PlantArchitecture::disableCollisionDetection | ( | ) |
Disable collision detection for plant growth and clean up internal CollisionDetection instance.
Definition at line 5315 of file PlantArchitecture.cpp.
void PlantArchitecture::disableInternodeContextBuild | ( | ) |
Do not build internode primitive geometry in the Context.
Definition at line 3004 of file PlantArchitecture.cpp.
void PlantArchitecture::disableMessages | ( | ) |
Disable standard output from this plug-in.
Definition at line 5811 of file PlantArchitecture.cpp.
void PlantArchitecture::disablePeduncleContextBuild | ( | ) |
Do not build peduncle primitive geometry in the Context.
Definition at line 3012 of file PlantArchitecture.cpp.
void PlantArchitecture::disablePetioleContextBuild | ( | ) |
Do not build petiole primitive geometry in the Context.
Definition at line 3008 of file PlantArchitecture.cpp.
void PlantArchitecture::disablePlantPhenology | ( | uint | plantID | ) |
Disables the phenological progression of a specified plant instance.
[in] | plantID | Identifier of the plant whose phenology is to be disabled. |
Definition at line 4326 of file PlantArchitecture.cpp.
uint PlantArchitecture::duplicatePlantInstance | ( | uint | plantID, |
const helios::vec3 & | base_position, | ||
const AxisRotation & | base_rotation, | ||
float | current_age | ||
) |
Duplicate an existing plant instance and specify its base position and age.
[in] | plantID | ID of the existing plant instance to be duplicated. |
[in] | base_position | Cartesian coordinates of the base of the new plant copy. |
[in] | base_rotation | Rotation of the new plant copy. |
[in] | current_age | Age of the new plant copy in days. |
Definition at line 4219 of file PlantArchitecture.cpp.
void PlantArchitecture::enableAttractionPoints | ( | const std::vector< helios::vec3 > & | attraction_points, |
float | view_half_angle_deg = 80.0f , |
||
float | look_ahead_distance = 0.1f , |
||
float | attraction_weight = 0.6f |
||
) |
Enable attraction points to guide plant growth toward specific targets.
[in] | attraction_points | Vector of 3D positions that plants should grow toward |
[in] | view_half_angle_deg | Half-angle of the attraction detection view cone in degrees (default = 80) |
[in] | look_ahead_distance | How far ahead attraction points will be considered in meters (default = 0.1) |
[in] | attraction_weight | Weight factor for attraction vs natural growth (0.0 = ignore attraction, 1.0 = full attraction) (default = 0.6) |
void PlantArchitecture::enableAttractionPoints | ( | uint | plantID, |
const std::vector< helios::vec3 > & | attraction_points, | ||
float | view_half_angle_deg = 80.0f , |
||
float | look_ahead_distance = 0.1f , |
||
float | attraction_weight = 0.6f |
||
) |
Enable attraction points for a specific plant.
[in] | plantID | Identifier of the plant to apply attraction points to |
[in] | attraction_points | Vector of 3D positions that the plant should grow toward |
[in] | view_half_angle_deg | Half-angle of the attraction detection view cone in degrees (default = 80) |
[in] | look_ahead_distance | How far ahead attraction points will be considered in meters (default = 0.1m) |
[in] | attraction_weight | Weight factor for attraction vs natural growth (0.0 = ignore attraction, 1.0 = full attraction) (default = 0.6) |
void PlantArchitecture::enableCarbohydrateModel | ( | ) |
Enables the carbohydrate model in the plant architecture development.
Definition at line 4197 of file PlantArchitecture.cpp.
void PlantArchitecture::enableEpicormicChildShoots | ( | uint | plantID, |
const std::string & | epicormic_shoot_type_label, | ||
float | epicormic_probability_perlength_perday | ||
) |
Enable shoot type to produce epicormic child shoots (water sprouts)
[in] | plantID | ID of the plant instance. |
[in] | epicormic_shoot_type_label | Label of the shoot type corresponding to epicormic shoots. |
[in] | epicormic_probability_perlength_perday | Probability of epicormic shoot formation per unit length of the parent shoot per day. |
Definition at line 2992 of file PlantArchitecture.cpp.
void PlantArchitecture::enableGroundClipping | ( | float | ground_height = 0.f | ) |
Enable automatic removal of organs that are below the ground plane.
[in] | ground_height | [optional] Height of the ground plane (default = 0). |
Definition at line 3016 of file PlantArchitecture.cpp.
void PlantArchitecture::enableMessages | ( | ) |
Re-enable standard output from this plug-in.
Definition at line 5818 of file PlantArchitecture.cpp.
void PlantArchitecture::enableSoftCollisionAvoidance | ( | const std::vector< uint > & | target_object_UUIDs = {} , |
const std::vector< uint > & | target_object_IDs = {} , |
||
bool | enable_petiole_collision = false , |
||
bool | enable_fruit_collision = false |
||
) |
Enable collision detection for plant growth avoidance (creates internal CollisionDetection instance)
[in] | target_object_UUIDs | [optional] Vector of specific UUIDs to avoid (empty = avoid all geometry) |
[in] | target_object_IDs | [optional] Vector of specific object IDs to avoid (empty = avoid all objects) |
[in] | enable_petiole_collision | [optional] Enable collision detection for petioles (default: false) |
[in] | enable_fruit_collision | [optional] Enable collision detection for fruits (default: false) |
Definition at line 5256 of file PlantArchitecture.cpp.
void PlantArchitecture::enableSolidObstacleAvoidance | ( | const std::vector< uint > & | obstacle_UUIDs, |
float | avoidance_distance = 0.5f , |
||
bool | enable_fruit_adjustment = false , |
||
bool | enable_obstacle_pruning = false |
||
) |
Enable solid obstacle avoidance for plant growth.
Designates certain primitives as solid obstacles that plant growth must avoid.
When enabled, plant growth will gradually redirect as it approaches these obstacles, with increasingly strong curvature as distance decreases. The plant will eventually grow parallel to the obstacle surface at a marginal distance.
[in] | obstacle_UUIDs | Vector of primitive UUIDs that represent solid obstacles |
[in] | avoidance_distance | Distance at which obstacle avoidance begins (meters) |
[in] | enable_fruit_adjustment | Enable automatic fruit rotation adjustment to avoid obstacles (default: false) |
[in] | enable_obstacle_pruning | Enable solid obstacle collision pruning (default: true) |
Definition at line 5383 of file PlantArchitecture.cpp.
uint PlantArchitecture::generatePlantFromString | ( | const std::string & | generation_string, |
const PhytomerParameters & | phytomer_parameters | ||
) |
Generates a plant model based on the given generation string and phytomer parameters.
[in] | generation_string | Input string describing the plant generation rules and structure. |
[in] | phytomer_parameters | Parameters that define the characteristics of a single phytomer. |
Definition at line 393 of file InputOutput.cpp.
uint PlantArchitecture::generatePlantFromString | ( | const std::string & | generation_string, |
const std::map< std::string, PhytomerParameters > & | phytomer_parameters | ||
) |
Generates a plant based on the provided description string and phytomer parameters.
[in] | generation_string | A string encoding of the plant structure. |
[in] | phytomer_parameters | A map containing parameter configurations for each type of phytomer. |
Definition at line 399 of file InputOutput.cpp.
std::vector< uint > PlantArchitecture::getAllFlowerUUIDs | ( | ) | const |
Get UUIDs for all existing flower primitives.
Definition at line 4168 of file PlantArchitecture.cpp.
std::vector< uint > PlantArchitecture::getAllFruitUUIDs | ( | ) | const |
Get UUIDs for all existing fruit primitives.
Definition at line 4178 of file PlantArchitecture.cpp.
std::vector< uint > PlantArchitecture::getAllInternodeUUIDs | ( | ) | const |
Get UUIDs for all existing internode primitives.
Definition at line 4138 of file PlantArchitecture.cpp.
std::vector< uint > PlantArchitecture::getAllLeafUUIDs | ( | ) | const |
Get UUIDs for all existing leaf primitives.
Definition at line 4128 of file PlantArchitecture.cpp.
std::vector< uint > PlantArchitecture::getAllObjectIDs | ( | ) | const |
Get object IDs for all existing plant compound objects.
Definition at line 4188 of file PlantArchitecture.cpp.
std::vector< uint > PlantArchitecture::getAllPeduncleUUIDs | ( | ) | const |
Get UUIDs for all existing peduncle primitives.
Definition at line 4158 of file PlantArchitecture.cpp.
std::vector< uint > PlantArchitecture::getAllPetioleUUIDs | ( | ) | const |
Get UUIDs for all existing petiole primitives.
Definition at line 4148 of file PlantArchitecture.cpp.
std::vector< uint > PlantArchitecture::getAllPlantIDs | ( | ) | const |
Get IDs for all plant instances.
Definition at line 3894 of file PlantArchitecture.cpp.
Get object IDs for all organs objects for a given plant.
[in] | plantID | ID of the plant instance. |
Definition at line 3905 of file PlantArchitecture.cpp.
Get primitive UUIDs for all primitives in a given plant.
[in] | plantID | ID of the plant instance. |
Definition at line 3935 of file PlantArchitecture.cpp.
std::vector< uint > PlantArchitecture::getAllUUIDs | ( | ) | const |
Get UUIDs for all existing plant primitives.
Definition at line 4119 of file PlantArchitecture.cpp.
std::vector< std::string > PlantArchitecture::getAvailablePlantModels | ( | ) | const |
Get list of all available plant models in the library.
Definition at line 82 of file PlantLibrary.cpp.
CollisionDetection * PlantArchitecture::getCollisionDetection | ( | ) | const |
Get access to the internal CollisionDetection instance (for advanced usage)
Definition at line 5362 of file PlantArchitecture.cpp.
std::map< std::string, PhytomerParameters > PlantArchitecture::getCurrentPhytomerParameters | ( | ) |
Get the phytomer parameters structure for all shoot types in the current plant model.
Definition at line 141 of file PlantLibrary.cpp.
std::map< std::string, ShootParameters > PlantArchitecture::getCurrentShootParameters | ( | ) |
Get the shoot parameters structure for all shoot types in the current plant model.
Definition at line 132 of file PlantLibrary.cpp.
ShootParameters PlantArchitecture::getCurrentShootParameters | ( | const std::string & | shoot_type_label | ) |
Get the shoot parameters structure for a specific shoot type in the current plant model.
[in] | shoot_type_label | User-defined label for the shoot type. |
Definition at line 123 of file PlantLibrary.cpp.
float PlantArchitecture::getPlantAge | ( | uint | plantID | ) | const |
Retrieves the age of a specific plant.
[in] | plantID | Unique identifier of the plant. |
Definition at line 3501 of file PlantArchitecture.cpp.
std::vector< helios::vec3 > PlantArchitecture::getPlantBasePosition | ( | const std::vector< uint > & | plantIDs | ) | const |
Retrieves the base positions of multiple plants.
[in] | plantIDs | A vector containing the IDs of the plants for which the base positions are required. |
Definition at line 3230 of file PlantArchitecture.cpp.
helios::vec3 PlantArchitecture::getPlantBasePosition | ( | uint | plantID | ) | const |
Retrieves the base position of the specified plant.
[in] | plantID | Identifier of the plant whose base position is being queried. |
Definition at line 3221 of file PlantArchitecture.cpp.
Get collision-relevant object IDs for a specific plant.
[in] | plantID | Plant ID for which to query collision-relevant object IDs |
Returns object IDs for plant organs that are currently enabled for collision detection based on the settings from setCollisionRelevantOrgans().
Definition at line 4077 of file PlantArchitecture.cpp.
Get object IDs for all inflorescence objects for a given plant.
[in] | plantID | ID of the plant instance. |
Definition at line 4029 of file PlantArchitecture.cpp.
Get object IDs for all fruit objects for a given plant.
[in] | plantID | ID of the plant instance. |
Definition at line 4053 of file PlantArchitecture.cpp.
float PlantArchitecture::getPlantHeight | ( | uint | plantID | ) | const |
Calculate the height of the highest element in the plant.
[in] | plantID | ID of the plant instance. |
Definition at line 3288 of file PlantArchitecture.cpp.
Get object IDs for all internode (Tube) objects for a given plant.
[in] | plantID | ID of the plant instance. |
Definition at line 3939 of file PlantArchitecture.cpp.
std::vector< float > PlantArchitecture::getPlantLeafAzimuthAngleDistribution | ( | const std::vector< uint > & | plantIDs, |
uint | Nbins, | ||
bool | normalize = true |
||
) | const |
Calculate the leaf azimuth angle distribution of all leaves in multiple plants.
[in] | plantIDs | Vector of ID of the plant instances. |
[in] | Nbins | Number of bins for the histogram. |
[in] | normalize | [optional] Normalize the histogram (default = true). |
Definition at line 3388 of file PlantArchitecture.cpp.
std::vector< float > PlantArchitecture::getPlantLeafAzimuthAngleDistribution | ( | uint | plantID, |
uint | Nbins, | ||
bool | normalize = true |
||
) | const |
Calculate the leaf azimuth angle distribution of all leaves in the plant.
[in] | plantID | ID of the plant instance. |
[in] | Nbins | Number of bins for the histogram. |
[in] | normalize | [optional] Normalize the histogram (default = true). |
Definition at line 3353 of file PlantArchitecture.cpp.
std::vector< helios::vec3 > PlantArchitecture::getPlantLeafBases | ( | const std::vector< uint > & | plantIDs | ) | const |
Get the base positions of all leaves for a list of plants.
[in] | plantIDs | List of IDs of the plant instances. |
Definition at line 3442 of file PlantArchitecture.cpp.
std::vector< helios::vec3 > PlantArchitecture::getPlantLeafBases | ( | uint | plantID | ) | const |
Get the base positions of all leaves on the plant.
[in] | plantID | ID of the plant instance. |
Definition at line 3415 of file PlantArchitecture.cpp.
Get the total number of leaves on the plant.
[in] | plantID | ID of the plant instance. |
Definition at line 3407 of file PlantArchitecture.cpp.
std::vector< float > PlantArchitecture::getPlantLeafInclinationAngleDistribution | ( | const std::vector< uint > & | plantIDs, |
uint | Nbins, | ||
bool | normalize = true |
||
) | const |
Calculate the leaf inclination angle distribution of all leaves in multiple plants.
[in] | plantIDs | Vector of IDs of the plant instances. |
[in] | Nbins | Number of bins for the histogram. |
[in] | normalize | [optional] Normalize the histogram (default = true). |
Definition at line 3335 of file PlantArchitecture.cpp.
std::vector< float > PlantArchitecture::getPlantLeafInclinationAngleDistribution | ( | uint | plantID, |
uint | Nbins, | ||
bool | normalize = true |
||
) | const |
Calculate the leaf inclination angle distribution of all leaves in the plant.
[in] | plantID | ID of the plant instance. |
[in] | Nbins | Number of bins for the histogram. |
[in] | normalize | [optional] Normalize the histogram (default = true). |
Definition at line 3300 of file PlantArchitecture.cpp.
std::vector< uint > PlantArchitecture::getPlantLeafObjectIDs | ( | const std::vector< uint > & | plantIDs | ) | const |
Get object IDs for all leaf objects for a list of plants.
[in] | plantIDs | List of IDs of the plant instances. |
Definition at line 3997 of file PlantArchitecture.cpp.
Get object IDs for all leaf objects for a given plant.
[in] | plantID | ID of the plant instance. |
Definition at line 3977 of file PlantArchitecture.cpp.
std::string PlantArchitecture::getPlantName | ( | uint | plantID | ) | const |
Retrieves the name of the plant associated with a given plant ID.
[in] | plantID | The unique identifier of the plant. |
Definition at line 3494 of file PlantArchitecture.cpp.
Get object IDs for all peduncle (Tube) objects for a given plant.
[in] | plantID | ID of the plant instance. |
Definition at line 4007 of file PlantArchitecture.cpp.
Get object IDs for all petiole (Tube) objects for a given plant.
[in] | plantID | ID of the plant instance. |
Definition at line 3957 of file PlantArchitecture.cpp.
float PlantArchitecture::getPlantStemHeight | ( | uint | plantID | ) | const |
Calculate the height of the last internode on the base stem/shoot.
[in] | plantID | ID of the plant instance. |
Definition at line 3254 of file PlantArchitecture.cpp.
std::string PlantArchitecture::getPlantString | ( | uint | plantID | ) | const |
Retrieves a string representation of a plant based on its ID.
[in] | plantID | The unique identifier of the plant. |
Definition at line 64 of file InputOutput.cpp.
Retrieves the number of nodes in a specific shoot of a specific plant.
[in] | plantID | The unique identifier of the plant. |
[in] | shootID | The index of the shoot within the plant. |
Definition at line 3865 of file PlantArchitecture.cpp.
Retrieves the taper of a shoot based on its radius measurements.
[in] | plantID | The unique identifier of the plant. |
[in] | shootID | The unique identifier of the shoot within the specified plant. |
Definition at line 3874 of file PlantArchitecture.cpp.
void PlantArchitecture::harvestPlant | ( | uint | plantID | ) |
Harvests a plant by removing all leaves and fruit.
[in] | plantID | The unique identifier of the plant to be harvested. |
Definition at line 3510 of file PlantArchitecture.cpp.
void PlantArchitecture::initializeCarbohydratePool | ( | float | carbohydrate_concentration_molC_m3 | ) | const |
Initializes the carbohydrate pool for all shoots of all plant instances.
[in] | carbohydrate_concentration_molC_m3 | Concentration of carbohydrates in molC per cubic meter |
Definition at line 51 of file CarbohydrateModel.cpp.
void PlantArchitecture::initializePlantCarbohydratePool | ( | uint | plantID, |
float | carbohydrate_concentration_molC_m3 | ||
) |
Initializes the carbohydrate pool for a specific plant.
[in] | plantID | Unique identifier of the plant. |
[in] | carbohydrate_concentration_molC_m3 | Initial carbohydrate concentration in moles of carbon per cubic meter. |
Definition at line 65 of file CarbohydrateModel.cpp.
void PlantArchitecture::initializeShootCarbohydratePool | ( | uint | plantID, |
uint | shootID, | ||
float | carbohydrate_concentration_molC_m3 | ||
) |
Initializes the carbohydrate pool for a specific shoot of a plant.
[in] | plantID | Identifier for the plant whose shoot's carbohydrate pool is being initialized. |
[in] | shootID | Identifier for the shoot of the plant. |
[in] | carbohydrate_concentration_molC_m3 | Carbohydrate concentration in moles of carbon per cubic meter; must be non-negative. |
Definition at line 80 of file CarbohydrateModel.cpp.
bool PlantArchitecture::isPlantDormant | ( | uint | plantID | ) | const |
Checks if the plant with the given ID is dormant.
[in] | plantID | The ID of the plant to check. |
Definition at line 3451 of file PlantArchitecture.cpp.
void PlantArchitecture::loadPlantModelFromLibrary | ( | const std::string & | plant_label | ) |
Load an existing plant model from the library.
[in] | plant_label | User-defined label for the plant model to be loaded. |
Definition at line 76 of file PlantLibrary.cpp.
void PlantArchitecture::makePlantDormant | ( | uint | plantID | ) |
Makes the specified plant enter a dormant state.
[in] | plantID | ID of the plant to be made dormant. |
Definition at line 3572 of file PlantArchitecture.cpp.
void PlantArchitecture::optionalOutputObjectData | ( | const std::string & | object_data_label | ) |
Add optional output object data values to the Context.
[in] | object_data_label | Name of object data (e.g., "age", "rank") |
Definition at line 5238 of file PlantArchitecture.cpp.
void PlantArchitecture::optionalOutputObjectData | ( | const std::vector< std::string > & | object_data_labels | ) |
Add optional output object data values to the Context.
[in] | object_data_labels | Vector of names of object data (e.g., {"age", "rank"}) |
Definition at line 5246 of file PlantArchitecture.cpp.
Prunes a branch from a specific plant at a designated node index.
[in] | plantID | Unique identifier of the plant to prune. |
[in] | shootID | Identifier of the shoot to prune from within the plant. |
[in] | node_index | Index of the node on the shoot where the branch will be pruned. |
Definition at line 3593 of file PlantArchitecture.cpp.
std::vector< uint > PlantArchitecture::readPlantStructureXML | ( | const std::string & | filename, |
bool | quiet = false |
||
) |
Reads plant structure data from an XML file.
Parses the specified XML file containing plant architecture information and extracts relevant data.
[in] | filename | The path to the XML file to load. |
[in] | quiet | [optional] If true, suppresses console output of status messages. |
Definition at line 697 of file InputOutput.cpp.
void PlantArchitecture::removePlantLeaves | ( | uint | plantID | ) |
Removes all leaves from the plant with the specified ID.
[in] | plantID | The unique identifier of the plant whose leaves are to be removed. |
Definition at line 3560 of file PlantArchitecture.cpp.
Removes all leaves from a specified shoot in a specified plant.
[in] | plantID | ID of the plant from which leaves are to be removed. |
[in] | shootID | ID of the shoot within the plant whose leaves are to be removed. |
Definition at line 3528 of file PlantArchitecture.cpp.
Removes all vegetative buds from a specified shoot in a specified plant.
[in] | plantID | ID of the plant from which buds are to be removed. |
[in] | shootID | ID of the shoot within the plant whose buds are to be removed. |
Definition at line 3544 of file PlantArchitecture.cpp.
|
static |
Unit test routines.
Definition at line 1230 of file selfTest.cpp.
void PlantArchitecture::setAttractionParameters | ( | float | view_half_angle_deg, |
float | look_ahead_distance, | ||
float | attraction_weight, | ||
float | obstacle_reduction_factor = 0.75f |
||
) |
Set attraction parameters.
[in] | view_half_angle_deg | Half-angle of the attraction detection view cone in degrees |
[in] | look_ahead_distance | How far ahead attraction points will be considered in meters |
[in] | attraction_weight | Weight factor for attraction vs natural growth (0.0 = ignore attraction, 1.0 = full attraction) |
[in] | obstacle_reduction_factor | Reduction factor for attraction when hard obstacles are present (default = 0.75) |
Definition at line 5639 of file PlantArchitecture.cpp.
void PlantArchitecture::setAttractionParameters | ( | uint | plantID, |
float | view_half_angle_deg, | ||
float | look_ahead_distance, | ||
float | attraction_weight, | ||
float | obstacle_reduction_factor = 0.75f |
||
) |
Set attraction parameters for a specific plant.
[in] | plantID | Identifier of the plant to set attraction parameters for |
[in] | view_half_angle_deg | Half-angle of the attraction detection view cone in degrees |
[in] | look_ahead_distance | How far ahead attraction points will be considered in meters |
[in] | attraction_weight | Weight factor for attraction vs natural growth (0.0 = ignore attraction, 1.0 = full attraction) |
[in] | obstacle_reduction_factor | Reduction factor for attraction when hard obstacles are present (default = 0.75) |
Definition at line 5753 of file PlantArchitecture.cpp.
void PlantArchitecture::setCollisionRelevantOrgans | ( | bool | include_internodes, |
bool | include_leaves, | ||
bool | include_petioles, | ||
bool | include_flowers, | ||
bool | include_fruit | ||
) |
Set which organ types should participate in collision detection.
[in] | include_internodes | Include internode segments in collision detection (default: false) |
[in] | include_leaves | Include leaf surfaces in collision detection (default: true) |
[in] | include_petioles | Include petiole segments in collision detection (default: false) |
[in] | include_flowers | Include flower geometry in collision detection (default: false) |
[in] | include_fruit | Include fruit geometry in collision detection (default: false) |
Definition at line 5366 of file PlantArchitecture.cpp.
void PlantArchitecture::setGeometryUpdateScheduling | ( | int | update_frequency = 3 , |
bool | force_update_on_collision = true |
||
) |
Configure Context geometry update scheduling for efficiency.
[in] | update_frequency | How often to update Context geometry (1=every timestep, 2=every 2 timesteps, etc.) |
[in] | force_update_on_collision | Force Context update when collision avoidance is triggered |
Definition at line 5550 of file PlantArchitecture.cpp.
void PlantArchitecture::setPhytomerLeafScale | ( | uint | plantID, |
uint | shootID, | ||
uint | node_number, | ||
float | leaf_scale_factor_fraction | ||
) |
Adjusts the leaf scaling factor (length as a fraction of its maximal length) for a specific phytomer on a plant shoot.
[in] | plantID | Identifier of the plant. |
[in] | shootID | Identifier of the shoot on the specified plant. |
[in] | node_number | Node number of the phytomer to adjust. |
[in] | leaf_scale_factor_fraction | Fractional scaling factor for the leaf, must be in the range [0, 1]. |
Definition at line 3127 of file PlantArchitecture.cpp.
void PlantArchitecture::setPlantAge | ( | uint | plantID, |
float | current_age | ||
) |
Don't use this.
Definition at line 3489 of file PlantArchitecture.cpp.
void PlantArchitecture::setPlantBasePosition | ( | uint | plantID, |
const helios::vec3 & | base_position | ||
) |
Sets the base position of a plant with the specified ID.
[in] | plantID | Unique identifier of the plant |
[in] | base_position | Coordinates representing the new base position of the plant |
Definition at line 3147 of file PlantArchitecture.cpp.
void PlantArchitecture::setPlantCarbohydrateModelParameters | ( | const std::vector< uint > & | plantIDs, |
const CarbohydrateParameters & | carb_parameters | ||
) |
Sets carbohydrate model parameters for specified plants.
[in] | plantIDs | A vector of plant IDs for which the parameters will be set. |
[in] | carb_parameters | The carbohydrate model parameters to apply. |
Definition at line 4320 of file PlantArchitecture.cpp.
void PlantArchitecture::setPlantCarbohydrateModelParameters | ( | uint | plantID, |
const CarbohydrateParameters & | carb_parameters | ||
) |
Sets the carbohydrate model parameters for a specific plant.
[in] | plantID | Identifier for the plant whose parameters are being set. |
[in] | carb_parameters | Reference to the carbohydrate parameters to assign to the plant. |
Definition at line 4312 of file PlantArchitecture.cpp.
void PlantArchitecture::setPlantLeafAngleDistribution | ( | const std::vector< uint > & | plantIDs, |
float | Beta_mu_inclination, | ||
float | Beta_nu_inclination, | ||
float | eccentricity, | ||
float | ellipse_rotation_degrees | ||
) | const |
Sets the leaf angle distribution (both elevation and azimuth) for a list of specified plants.
This method modifies the elevation angles of leaves in the plants such that they follow a Beta distribution, and the azimuth angles such that they follow an ellipsoidal distribution. The methodology does not simply randomly sample angles from the distribution, but it uses the Hungarian algorithm to minimize the total amount of rotation applied for the whole canopy. This makes the transformed plants look as similar as possible to the original plants while still following the specified distribution. The more leaves in the canopy the more accurate the distribution will be, and the more the plants will look like the originals.
[in] | plantIDs | Vector of plant IDs to which the leaf angle distribution is to be applied. |
[in] | Beta_mu_inclination | Mean parameter for the beta distribution of inclination angles. |
[in] | Beta_nu_inclination | Shape parameter for the beta distribution of inclination angles. |
[in] | eccentricity | Eccentricity value for the ellipse defining the azimuth distribution. |
[in] | ellipse_rotation_degrees | Rotation angle of the ellipse in degrees. |
Definition at line 3208 of file PlantArchitecture.cpp.
void PlantArchitecture::setPlantLeafAngleDistribution | ( | uint | plantID, |
float | Beta_mu_inclination, | ||
float | Beta_nu_inclination, | ||
float | eccentricity, | ||
float | ellipse_rotation_degrees | ||
) | const |
Sets the leaf angle distribution (both elevation and azimuth) for a specific plant.
This method modifies the elevation angles of leaves in the plant such that they follow a Beta distribution, and the azimuth angles such that they follow an ellipsoidal distribution. The methodology does not simply randomly sample angles from the distribution, but it uses the Hungarian algorithm to minimize the total amount of rotation applied for the whole plant. This makes the transformed plant look as similar as possible to the original plant while still following the specified distribution. The more leaves in the plant the more accurate the distribution will be, and the more the plant will look like the original.
[in] | plantID | The unique identifier of the plant. |
[in] | Beta_mu_inclination | The mean inclination angle parameter (Beta distribution). |
[in] | Beta_nu_inclination | The shape parameter nu of the distribution (Beta distribution). |
[in] | eccentricity | Eccentricity value for the ellipse defining the azimuth distribution. |
[in] | ellipse_rotation_degrees | Rotation angle of the ellipse in degrees. |
Definition at line 3196 of file PlantArchitecture.cpp.
void PlantArchitecture::setPlantLeafAzimuthAngleDistribution | ( | const std::vector< uint > & | plantIDs, |
float | eccentricity, | ||
float | ellipse_rotation_degrees | ||
) | const |
Sets the azimuth angle distribution of plant leaves.
This method modifies the azimuth angles of leaves in the plants such that they follow a Beta distribution. The methodology does not simply randomly sample angles from the Beta distribution, but it uses the Hungarian algorithm to minimize the total amount of rotation applied for the whole canopy. This makes the transformed plants look as similar as possible to the original plants while still following the specified distribution. The more leaves in the canopy the more accurate the distribution will be, and the more the plants will look like the originals.
[in] | plantIDs | List of plant IDs to which the angle distribution will be applied. |
[in] | eccentricity | Eccentricity value for the ellipse defining the azimuth distribution. |
[in] | ellipse_rotation_degrees | Rotation angle of the ellipse in degrees. |
Definition at line 3188 of file PlantArchitecture.cpp.
void PlantArchitecture::setPlantLeafAzimuthAngleDistribution | ( | uint | plantID, |
float | eccentricity, | ||
float | ellipse_rotation_degrees | ||
) | const |
Sets the azimuth angle distribution for plant leaves.
This method modifies the azimuth angles of leaves in the plant such that they follow an ellipsoidal distribution. The methodology does not simply randomly sample angles from the ellipsoidal distribution, but it uses the Hungarian algorithm to minimize the total amount of rotation applied for the whole plant. This makes the transformed plant look as similar as possible to the original plant while still following the specified distribution. The more leaves in the plant the more accurate the distribution will be, and the more the plant will look like the original.
[in] | plantID | Identifier of the plant whose leaf azimuth angle distribution is being set. |
[in] | eccentricity | Eccentricity value for the ellipse defining the azimuth distribution. |
[in] | ellipse_rotation_degrees | Rotation angle of the ellipse in degrees. |
Definition at line 3180 of file PlantArchitecture.cpp.
void PlantArchitecture::setPlantLeafElevationAngleDistribution | ( | const std::vector< uint > & | plantIDs, |
float | Beta_mu_inclination, | ||
float | Beta_nu_inclination | ||
) | const |
Sets the leaf elevation angle distribution for a list of plants.
This method modifies the elevation angles of leaves in the plants such that they follow a Beta distribution. The methodology does not simply randomly sample angles from the Beta distribution, but it uses the Hungarian algorithm to minimize the total amount of rotation applied for the whole canopy. This makes the transformed plants look as similar as possible to the original plants while still following the specified distribution. The more leaves in the canopy the more accurate the distribution will be, and the more the plants will look like the originals.
[in] | plantIDs | List of plant IDs for which to set the elevation angle distribution. |
[in] | Beta_mu_inclination | Mean value parameter for the Beta distribution of inclination angles. |
[in] | Beta_nu_inclination | Shape parameter for the Beta distribution of inclination angles. |
Definition at line 3170 of file PlantArchitecture.cpp.
void PlantArchitecture::setPlantLeafElevationAngleDistribution | ( | uint | plantID, |
float | Beta_mu_inclination, | ||
float | Beta_nu_inclination | ||
) | const |
Sets the leaf elevation angle distribution for a specific plant.
This method modifies the elevation angles of leaves in the plant such that they follow a Beta distribution. The methodology does not simply randomly sample angles from the Beta distribution, but it uses the Hungarian algorithm to minimize the total amount of rotation applied for the whole plant. This makes the transformed plant look as similar as possible to the original plant while still following the specified distribution. The more leaves in the plant the more accurate the distribution will be, and the more the plant will look like the original.
[in] | plantID | Identifier for the plant. |
[in] | Beta_mu_inclination | Mean value parameter for the Beta distribution of inclination angles. |
[in] | Beta_nu_inclination | Shape parameter for the Beta distribution of inclination angles. |
Definition at line 3160 of file PlantArchitecture.cpp.
void PlantArchitecture::setPlantPhenologicalThresholds | ( | uint | plantID, |
float | time_to_dormancy_break, | ||
float | time_to_flower_initiation, | ||
float | time_to_flower_opening, | ||
float | time_to_fruit_set, | ||
float | time_to_fruit_maturity, | ||
float | time_to_dormancy, | ||
float | max_leaf_lifespan = 1e6 , |
||
bool | is_evergreen = false |
||
) |
Specify the threshold values for plant phenological stages. All time values have units of days.
[in] | plantID | ID of the plant. |
[in] | time_to_dormancy_break | Length of the dormancy period. |
[in] | time_to_flower_initiation | Time from emergence/dormancy required to reach flower creation (closed flowers). |
[in] | time_to_flower_opening | Time from flower initiation to flower opening. |
[in] | time_to_fruit_set | Time from flower opening required to reach fruit set (i.e., flower dies and fruit is created). |
[in] | time_to_fruit_maturity | Time from fruit set date required to reach fruit maturity. |
[in] | time_to_dormancy | Time from emergence/dormancy break required to enter the next dormancy period. |
[in] | max_leaf_lifespan | [optional] Maximum lifespan of a leaf in days. |
[in] | is_evergreen | [optional] True if the plant is evergreen (i.e., does not lose all leaves during senescence). |
Definition at line 4292 of file PlantArchitecture.cpp.
void PlantArchitecture::setSoftCollisionAvoidanceParameters | ( | float | view_half_angle_deg, |
float | look_ahead_distance, | ||
int | sample_count, | ||
float | inertia_weight | ||
) |
Set collision avoidance parameters.
[in] | view_half_angle_deg | Half-angle of the collision detection view cone in degrees (default = 80) |
[in] | look_ahead_distance | How far ahead collisions will be considered in meters (default = 0.1) |
[in] | sample_count | Number of directional samples within the cone (default = 256) |
[in] | inertia_weight | Weight factor for directional inertia vs collision avoidance (0.0 = use optimal direction, 1.0 = ignore collision avoidance) (default = 0.4) |
Definition at line 5333 of file PlantArchitecture.cpp.
void PlantArchitecture::setStaticObstacles | ( | const std::vector< uint > & | target_UUIDs | ) |
Mark specific geometry as static for collision detection efficiency.
[in] | target_UUIDs | Vector of primitive UUIDs representing static obstacles (buildings, fixed structures, etc.) |
Definition at line 5350 of file PlantArchitecture.cpp.
float PlantArchitecture::sumPlantLeafArea | ( | uint | plantID | ) | const |
Sum the one-sided leaf area of all leaves in the plant.
[in] | plantID | ID of the plant instance. |
Definition at line 3239 of file PlantArchitecture.cpp.
void PlantArchitecture::updateAttractionPoints | ( | const std::vector< helios::vec3 > & | attraction_points | ) |
Update attraction points positions (overwrites existing points)
[in] | attraction_points | Updated vector of 3D positions that plants should grow toward |
void PlantArchitecture::updateAttractionPoints | ( | uint | plantID, |
const std::vector< helios::vec3 > & | attraction_points | ||
) |
Update attraction points positions for a specific plant (overwrites existing points)
[in] | plantID | Identifier of the plant to update attraction points for |
[in] | attraction_points | Updated vector of 3D positions that the plant should grow toward |
void PlantArchitecture::updateCurrentShootParameters | ( | const std::map< std::string, ShootParameters > & | params | ) |
Update the parameters of all shoot types in the current plant model.
[in] | params | Updated parameters structure for the shoot type. |
Definition at line 158 of file PlantLibrary.cpp.
void PlantArchitecture::updateCurrentShootParameters | ( | const std::string & | shoot_type_label, |
const ShootParameters & | params | ||
) |
Update the parameters of a single shoot type in the current plant model.
[in] | shoot_type_label | User-defined label for the shoot type to be updated. |
[in] | params | Updated parameters structure for the shoot type. |
Definition at line 154 of file PlantLibrary.cpp.
void PlantArchitecture::writePlantMeshVertices | ( | uint | plantID, |
const std::string & | filename | ||
) | const |
Write all vertices in the plant to a file for external processing (e.g., bounding volume, convex hull)
[in] | plantID | ID of the plant instance. |
[in] | filename | Name/path of the output file. |
Definition at line 3465 of file PlantArchitecture.cpp.
void PlantArchitecture::writePlantStructureXML | ( | uint | plantID, |
const std::string & | filename | ||
) | const |
Writes the structure of a plant instance to an XML file.
[in] | plantID | The unique identifier for the plant instance. |
[in] | filename | Path to the XML file where the plant structure will be saved. |
Definition at line 433 of file InputOutput.cpp.
void PlantArchitecture::writeQSMCylinderFile | ( | uint | plantID, |
const std::string & | filename | ||
) | const |
Writes plant structure to TreeQSM cylinder format.
Writes the plant structure as a series of cylinders in the TreeQSM format. Each row represents one cylinder with columns for radius, length, start position, axis direction, parent ID, extension ID, branch ID, branch order, position in branch, mean absolute distance, surface coverage, added flag, and unmodified radius.
[in] | plantID | Identifier of the plant to export. |
[in] | filename | Path to the output file (typically .txt extension). |
helios::runtime_error | Throws an error if the plant ID does not exist or if the file cannot be opened. |
Definition at line 512 of file InputOutput.cpp.
|
friend |
Definition at line 2654 of file PlantArchitecture.h.
|
friend |
Definition at line 2655 of file PlantArchitecture.h.