1.3.64
 
Loading...
Searching...
No Matches
PlantArchitecture Class Reference

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, const std::map< std::string, float > &build_parameters={})
 Build a plant instance based on the model currently loaded from the library.
 
std::vector< uintbuildPlantCanopyFromLibrary (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, const std::map< std::string, float > &build_parameters={})
 Build a canopy of regularly spaced plants based on the model currently loaded from the library.
 
std::vector< uintbuildPlantCanopyFromLibrary (const helios::vec3 &canopy_center_position, const helios::vec2 &canopy_extent_xy, uint plant_count, float age, const std::map< std::string, float > &build_parameters={})
 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, ShootParametersgetCurrentShootParameters ()
 Get the shoot parameters structure for all shoot types in the current plant model.
 
std::map< std::string, PhytomerParametersgetCurrentPhytomerParameters ()
 Get the phytomer parameters structure for all shoot types in the current plant model.
 
std::vector< std::string > listShootTypeLabels () const
 Get the list of shoot type labels for the currently loaded plant model.
 
std::vector< std::string > listShootTypeLabels (const std::string &plant_model_name)
 Get the list of shoot type labels for a specific plant model without changing current state.
 
std::vector< std::string > listShootTypeLabels (uint plantID) const
 Get the list of shoot type labels for a specific plant instance.
 
void updateCurrentShootParameters (const std::string &shoot_type_label, const ShootParameters &params)
 Update the parameters of a single shoot type in the current plant model.
 
void updateCurrentShootParameters (const std::map< std::string, ShootParameters > &params)
 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.
 
CollisionDetectiongetCollisionDetection () 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=45.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 removeShootFloralBuds (uint plantID, uint shootID)
 Removes all floral 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::vec3getPlantBasePosition (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::vec3getPlantLeafBases (uint plantID) const
 Get the base positions of all leaves on the plant.
 
std::vector< helios::vec3getPlantLeafBases (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.
 
std::string determinePhenologyStage (uint plantID) const
 Determine the phenological stage of a plant.
 
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< uintgetAllPlantIDs () const
 Get IDs for all plant instances.
 
std::vector< uintgetAllPlantObjectIDs (uint plantID) const
 Get object IDs for all organs objects for a given plant.
 
std::vector< uintgetAllPlantUUIDs (uint plantID) const
 Get primitive UUIDs for all primitives in a given plant.
 
std::vector< uintgetPlantInternodeObjectIDs (uint plantID) const
 Get object IDs for all internode (Tube) objects for a given plant.
 
std::vector< uintgetPlantInternodeObjectIDs (uint plantID, const std::string &shoot_type_label) const
 Get object IDs for internode (Tube) objects matching a specified shoot type label.
 
std::vector< uintgetPlantPetioleObjectIDs (uint plantID) const
 Get object IDs for all petiole (Tube) objects for a given plant.
 
std::vector< uintgetPlantLeafObjectIDs (uint plantID) const
 Get object IDs for all leaf objects for a given plant.
 
std::vector< uintgetPlantLeafObjectIDs (const std::vector< uint > &plantIDs) const
 Get object IDs for all leaf objects for a list of plants.
 
std::vector< uintgetPlantPeduncleObjectIDs (uint plantID) const
 Get object IDs for all peduncle (Tube) objects for a given plant.
 
std::vector< uintgetPlantFlowerObjectIDs (uint plantID) const
 Get object IDs for all inflorescence objects for a given plant.
 
std::vector< uintgetPlantFruitObjectIDs (uint plantID) const
 Get object IDs for all fruit objects for a given plant.
 
void updateShootFruitCounts (uint plantID) const
 Assign a fruit count value for each shoot on a plant.
 
std::vector< uintgetShootInternodeObjectIDs (uint plantID) const
 Get internode object IDs for all shoots for a given plant.
 
std::vector< uintgetPlantCollisionRelevantObjectIDs (uint plantID) const
 Get collision-relevant object IDs for a specific plant.
 
std::vector< uintgetAllUUIDs () const
 Get UUIDs for all existing plant primitives.
 
std::vector< uintgetAllLeafUUIDs () const
 Get UUIDs for all existing leaf primitives.
 
std::vector< uintgetAllInternodeUUIDs () const
 Get UUIDs for all existing internode primitives.
 
std::vector< uintgetAllPetioleUUIDs () const
 Get UUIDs for all existing petiole primitives.
 
std::vector< uintgetAllPeduncleUUIDs () const
 Get UUIDs for all existing peduncle primitives.
 
std::vector< uintgetAllFlowerUUIDs () const
 Get UUIDs for all existing flower primitives.
 
std::vector< uintgetAllFruitUUIDs () const
 Get UUIDs for all existing fruit primitives.
 
std::vector< uintgetAllObjectIDs () 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.
 
void enableNitrogenModel ()
 Enable the nitrogen model for tracking plant nitrogen status and stress.
 
void disableNitrogenModel ()
 Disable the nitrogen model.
 
bool isNitrogenModelEnabled () const
 Check if the nitrogen model is enabled.
 
void setPlantNitrogenParameters (uint plantID, const NitrogenParameters &params)
 Set nitrogen model parameters for a single plant.
 
void setPlantNitrogenParameters (const std::vector< uint > &plantIDs, const NitrogenParameters &params)
 Set nitrogen model parameters for multiple plants.
 
void initializeNitrogenPools (float initial_leaf_N_concentration)
 Initialize nitrogen pools for all plants based on current leaf biomass.
 
void initializePlantNitrogenPools (uint plantID, float initial_leaf_N_concentration)
 Initialize nitrogen pools for a specific plant.
 
void addPlantNitrogen (uint plantID, float amount_gN)
 Add nitrogen to a single plant (immediate application to root and available pools)
 
void addPlantNitrogen (const std::vector< uint > &plantIDs, float amount_gN)
 Add nitrogen to multiple plants (immediate application)
 
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< uintreadPlantStructureXML (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.
 
static std::string resolveTextureFile (const std::string &texture_file)
 Resolve an asset file path for the plantarchitecture plugin.
 

Friends

struct Phytomer
 
struct Shoot
 

Detailed Description

Definition at line 1761 of file PlantArchitecture.h.

Constructor & Destructor Documentation

◆ PlantArchitecture()

PlantArchitecture::PlantArchitecture ( helios::Context context_ptr)
explicit

Main architectural model class constructor.

Parameters
[in]context_ptrPointer to the Helios context.

Definition at line 95 of file PlantArchitecture.cpp.

◆ ~PlantArchitecture()

PlantArchitecture::~PlantArchitecture ( )

Destructor - cleans up internal CollisionDetection instance if owned.

Definition at line 117 of file PlantArchitecture.cpp.

Member Function Documentation

◆ accumulateHourlyLeafPhotosynthesis()

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.

Note
This function performs area-based calculations and updates context-specific data for each leaf primitive.

Definition at line 105 of file CarbohydrateModel.cpp.

◆ addBaseStemShoot()

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.

Parameters
[in]plantIDID of the plant instance.
[in]current_node_numberNumber of nodes of the stem shoot.
[in]base_rotationAxisRotation object (pitch, yaw, roll) specifying the orientation of the base of the shoot.
[in]internode_radiusRadius of the internodes along the shoot.
[in]internode_length_maxMaximum length (i.e., fully elongated) of the internodes along the shoot.
[in]internode_length_scale_factor_fractionScaling 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_fractionScaling factor of the leaf/petiole to determine the actual initial leaf size at the time of creation (=1 applies no scaling).
[in]radius_taperTapering factor of the internode radius along the shoot (0=constant radius, 1=linear taper to zero radius).
[in]shoot_type_labelLabel 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.
Returns
ID of the new shoot to be used to reference it later.

Definition at line 3174 of file PlantArchitecture.cpp.

◆ addChildShoot()

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.

Parameters
[in]plantIDID of the plant instance.
[in]parent_shoot_IDID of the shoot to which the new shoot will be added.
[in]parent_node_indexNumber of the node of the parent shoot at which the new shoot will be added.
[in]current_node_numberNumber of nodes of the newly added shoot.
[in]shoot_base_rotationAxisRotation object (pitch, yaw, roll) specifying the orientation of the base of the shoot.
[in]internode_radiusInitial radius of the internodes along the shoot.
[in]internode_length_maxLength of the internode of the newly appended shoot.
[in]internode_length_scale_factor_fractionScaling 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_fractionScaling factor of the leaf/petiole to determine the actual initial leaf size at the time of creation (=1 applies no scaling).
[in]radius_taperTapering factor of the internode radius along the shoot (0=constant radius, 1=linear taper to zero radius).
[in]shoot_type_labelLabel 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)
Returns
ID of the newly generated shoot.

Definition at line 3246 of file PlantArchitecture.cpp.

◆ addEpicormicShoot()

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.

Parameters
[in]plantIDID of the plant instance.
[in]parent_shoot_IDID of the shoot to which the new shoot will be added.
[in]parent_position_fractionPosition along the parent shoot to add the epicormic shoot as a fraction of the parent shoot length.
[in]current_node_numberNumber of nodes of the newly added shoot.
[in]zenith_perturbation_degreesPitch angle of epicormic shoot base away from parent shoot axis (degrees).
[in]internode_radiusInitial radius of the internodes along the shoot.
[in]internode_length_maxLength of the internode of the newly appended shoot.
[in]internode_length_scale_factor_fractionScaling 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_fractionScaling factor of the leaf/petiole to determine the actual initial leaf size at the time of creation (=1 applies no scaling).
[in]radius_taperTapering factor of the internode radius along the shoot (0=constant radius, 1=linear taper to zero radius).
[in]shoot_type_labelLabel 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.
Returns
ID of the newly generated shoot.

Definition at line 3293 of file PlantArchitecture.cpp.

◆ addPlantInstance()

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.

Parameters
[in]base_positionCartesian coordinates of the base of the plant.
[in]current_ageAge of the plant in days.
Returns
ID of the plant instance.

Definition at line 4745 of file PlantArchitecture.cpp.

◆ addPlantNitrogen() [1/2]

void PlantArchitecture::addPlantNitrogen ( const std::vector< uint > &  plantIDs,
float  amount_gN 
)

Add nitrogen to multiple plants (immediate application)

Parameters
[in]plantIDsVector of plant IDs to receive nitrogen
[in]amount_gNAmount of nitrogen to add to each plant (g N)
Exceptions
helios_runtime_errorif any plant does not exist or amount is negative

Definition at line 125 of file NitrogenModel.cpp.

◆ addPlantNitrogen() [2/2]

void PlantArchitecture::addPlantNitrogen ( uint  plantID,
float  amount_gN 
)

Add nitrogen to a single plant (immediate application to root and available pools)

Parameters
[in]plantIDPlant ID to receive nitrogen
[in]amount_gNAmount of nitrogen to add (g N)
Exceptions
helios_runtime_errorif plant does not exist or amount is negative

Definition at line 105 of file NitrogenModel.cpp.

◆ adjustFruitForObstacleCollision()

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.

Note
This method should be called after all plant growth updates are complete.

Definition at line 5412 of file PlantArchitecture.cpp.

◆ advanceTime() [1/4]

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.

Parameters
[in]plantIDsIDs of the plant instances.
[in]time_step_daysTime interval in days.

Definition at line 4895 of file PlantArchitecture.cpp.

◆ advanceTime() [2/4]

void PlantArchitecture::advanceTime ( float  time_step_days)

Advance plant growth by a specified time interval for all plants.

Parameters
[in]time_step_daysTime interval in days.

Definition at line 4882 of file PlantArchitecture.cpp.

◆ advanceTime() [3/4]

void PlantArchitecture::advanceTime ( int  time_step_years,
float  time_step_days 
)

Advance plant growth by a specified time interval for all plants.

Parameters
[in]time_step_yearsNumber of years to advance.
[in]time_step_daysNumber of days to advance (added to number of years).

Definition at line 4886 of file PlantArchitecture.cpp.

◆ advanceTime() [4/4]

void PlantArchitecture::advanceTime ( uint  plantID,
float  time_step_days 
)

Advance plant growth by a specified time interval for a single plant.

Parameters
[in]plantIDID of the plant instance.
[in]time_step_daysTime interval in days.

Definition at line 4890 of file PlantArchitecture.cpp.

◆ appendAttractionPoints() [1/2]

void PlantArchitecture::appendAttractionPoints ( const std::vector< helios::vec3 > &  attraction_points)

Update attraction points positions by appending to any existing points.

Parameters
[in]attraction_pointsUpdated vector of 3D positions that plants should grow toward

◆ appendAttractionPoints() [2/2]

void PlantArchitecture::appendAttractionPoints ( uint  plantID,
const std::vector< helios::vec3 > &  attraction_points 
)

Append attraction points for a specific plant.

Parameters
[in]plantIDIdentifier of the plant to append attraction points for
[in]attraction_pointsVector of 3D positions to append to existing attraction points

◆ appendPhytomerToShoot()

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.

Parameters
[in]plantIDID of the plant instance.
[in]shootIDID of the shoot to which the phytomer will be added
[in]phytomer_parametersParameters of the phytomer to be added
[in]internode_radiusRadius of the phytomer internode at the time of creation
[in]internode_length_maxMaximum internode length at full elongation
[in]internode_length_scale_factor_fractionScaling 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_fractionScaling factor of the leaf/petiole to determine the actual initial leaf size at the time of creation (=1 applies no scaling).
Returns
ID of generated phytomer

Definition at line 3333 of file PlantArchitecture.cpp.

◆ appendShoot()

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).

Parameters
[in]plantIDID of the plant instance.
[in]parent_shoot_IDID of the shoot to which the new shoot will be appended.
[in]current_node_numberNumber of nodes/phytomers of the newly appended shoot.
[in]base_rotationAxisRotation object (pitch, yaw, roll) specifying the orientation of the base of the shoot relative to the parent shoot.
[in]internode_radiusInitial radius of the internodes along the shoot.
[in]internode_length_maxLength of the internode of the newly appended shoot.
[in]internode_length_scale_factor_fractionScaling 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_fractionScaling factor of the leaf/petiole to determine the actual initial leaf size at the time of creation (=1 applies no scaling).
[in]radius_taperTapering factor of the internode radius along the shoot (0=constant radius, 1=linear taper to zero radius).
[in]shoot_type_labelLabel 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.
Returns
ID of the new shoot to be used to reference it later.

Definition at line 3204 of file PlantArchitecture.cpp.

◆ breakPlantDormancy()

void PlantArchitecture::breakPlantDormancy ( uint  plantID)

Breaks the dormancy of all shoots in the specified plant.

Parameters
[in]plantIDIdentifier of the plant whose shoots' dormancy should be broken.

Definition at line 4049 of file PlantArchitecture.cpp.

◆ buildPlantCanopyFromLibrary() [1/2]

std::vector< uint > PlantArchitecture::buildPlantCanopyFromLibrary ( const helios::vec3 canopy_center_position,
const helios::vec2 canopy_extent_xy,
uint  plant_count,
float  age,
const std::map< std::string, float > &  build_parameters = {} 
)

Build a canopy of randomly scattered plants based on the model currently loaded from the library.

Parameters
[in]canopy_center_positionCartesian coordinates of the center of the canopy boundaries.
[in]canopy_extent_xySize/extent of the canopy boundaries in the x- and y-directions.
[in]plant_countNumber of plants to randomly generate inside canopy bounds.
[in]ageAge of the plants in the canopy in days.
[in]build_parameters[optional] Map of parameter names to values for overriding default training system parameters (e.g., trunk height, scaffold count, trellis dimensions). Parameter names are species-specific and documented in the plant library documentation.
Returns
Vector of plant instance IDs.

Definition at line 327 of file PlantArchitecture.cpp.

◆ buildPlantCanopyFromLibrary() [2/2]

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,
const std::map< std::string, float > &  build_parameters = {} 
)

Build a canopy of regularly spaced plants based on the model currently loaded from the library.

Parameters
[in]canopy_center_positionCartesian coordinates of the center of the canopy.
[in]plant_spacing_xySpacing between plants in the canopy in the x- and y-directions.
[in]plant_count_xyNumber of plants in the canopy in the x- and y-directions.
[in]ageAge 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.
[in]build_parameters[optional] Map of parameter names to values for overriding default training system parameters (e.g., trunk height, scaffold count, trellis dimensions). Parameter names are species-specific and documented in the plant library documentation.
Returns
Vector of plant instance IDs.

Definition at line 302 of file PlantArchitecture.cpp.

◆ buildPlantInstanceFromLibrary()

uint PlantArchitecture::buildPlantInstanceFromLibrary ( const helios::vec3 base_position,
float  age,
const std::map< std::string, float > &  build_parameters = {} 
)

Build a plant instance based on the model currently loaded from the library.

Parameters
[in]base_positionCartesian coordinates of the base of the plant.
[in]ageAge of the plant in days.
[in]build_parameters[optional] Map of parameter names to values for overriding default training system parameters (e.g., trunk height, scaffold count, trellis dimensions). Parameter names are species-specific and documented in the plant library documentation.
Returns
ID of the plant instance.

Definition at line 119 of file PlantLibrary.cpp.

◆ defineShootType()

void PlantArchitecture::defineShootType ( const std::string &  shoot_type_label,
const ShootParameters shoot_params 
)

Define a new shoot type based on a set of ShootParameters.

Parameters
[in]shoot_type_labelUser-defined label for the new shoot type. This string is used later to reference this type of shoot.
[in]shoot_paramsParameters structure for the new shoot type.

Definition at line 339 of file PlantArchitecture.cpp.

◆ deletePlantInstance() [1/2]

void PlantArchitecture::deletePlantInstance ( const std::vector< uint > &  plantIDs)

Delete multiple existing plant instances.

Parameters
[in]plantIDsIDs of the plant instances to be deleted.

Definition at line 4833 of file PlantArchitecture.cpp.

◆ deletePlantInstance() [2/2]

void PlantArchitecture::deletePlantInstance ( uint  plantID)

Delete an existing plant instance.

Parameters
[in]plantIDID of the plant instance to be deleted.

Definition at line 4823 of file PlantArchitecture.cpp.

◆ detectAttractionPointsInCone()

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.

Parameters
[in]vertexStarting position (apex of the viewing cone)
[in]look_directionDirection the cone is pointing (will be normalized)
[in]look_ahead_distanceMaximum distance to look for attraction points
[in]half_angle_degreesHalf-angle of the viewing cone in degrees (0-180)
[out]direction_to_closestUnit vector pointing to the closest attraction point (if found)
Returns
True if an attraction point was found within the cone, false otherwise

Definition at line 861 of file PlantArchitecture.cpp.

◆ determinePhenologyStage()

std::string PlantArchitecture::determinePhenologyStage ( uint  plantID) const

Determine the phenological stage of a plant.

Parameters
[in]plantIDThe ID of the plant to check.
Returns
Phenological stage: "dormant", "vegetative", "reproductive", or "senescent".

Definition at line 3866 of file PlantArchitecture.cpp.

◆ disableAttractionPoints() [1/2]

void PlantArchitecture::disableAttractionPoints ( )

Disable attraction points and revert to natural growth.

Definition at line 6227 of file PlantArchitecture.cpp.

◆ disableAttractionPoints() [2/2]

void PlantArchitecture::disableAttractionPoints ( uint  plantID)

Disable attraction points for a specific plant.

Parameters
[in]plantIDIdentifier of the plant to disable attraction points for

Definition at line 6345 of file PlantArchitecture.cpp.

◆ disableCarbohydrateModel()

void PlantArchitecture::disableCarbohydrateModel ( )

Disables the carbohydrate model.

Definition at line 4741 of file PlantArchitecture.cpp.

◆ disableCollisionDetection()

void PlantArchitecture::disableCollisionDetection ( )

Disable collision detection for plant growth and clean up internal CollisionDetection instance.

Definition at line 5953 of file PlantArchitecture.cpp.

◆ disableInternodeContextBuild()

void PlantArchitecture::disableInternodeContextBuild ( )

Do not build internode primitive geometry in the Context.

Definition at line 3410 of file PlantArchitecture.cpp.

◆ disableMessages()

void PlantArchitecture::disableMessages ( )

Disable standard output from this plug-in.

Definition at line 6445 of file PlantArchitecture.cpp.

◆ disableNitrogenModel()

void PlantArchitecture::disableNitrogenModel ( )

Disable the nitrogen model.

Definition at line 26 of file NitrogenModel.cpp.

◆ disablePeduncleContextBuild()

void PlantArchitecture::disablePeduncleContextBuild ( )

Do not build peduncle primitive geometry in the Context.

Definition at line 3418 of file PlantArchitecture.cpp.

◆ disablePetioleContextBuild()

void PlantArchitecture::disablePetioleContextBuild ( )

Do not build petiole primitive geometry in the Context.

Definition at line 3414 of file PlantArchitecture.cpp.

◆ disablePlantPhenology()

void PlantArchitecture::disablePlantPhenology ( uint  plantID)

Disables the phenological progression of a specified plant instance.

Parameters
[in]plantIDIdentifier of the plant whose phenology is to be disabled.

Definition at line 4873 of file PlantArchitecture.cpp.

◆ duplicatePlantInstance()

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.

Parameters
[in]plantIDID of the existing plant instance to be duplicated.
[in]base_positionCartesian coordinates of the base of the new plant copy.
[in]base_rotationRotation of the new plant copy.
[in]current_ageAge of the new plant copy in days.
Returns
ID of the new plant instance.

Definition at line 4762 of file PlantArchitecture.cpp.

◆ enableAttractionPoints() [1/2]

void PlantArchitecture::enableAttractionPoints ( const std::vector< helios::vec3 > &  attraction_points,
float  view_half_angle_deg = 45.0f,
float  look_ahead_distance = 0.1f,
float  attraction_weight = 0.6f 
)

Enable attraction points to guide plant growth toward specific targets.

Parameters
[in]attraction_pointsVector of 3D positions that plants should grow toward
[in]view_half_angle_degHalf-angle of the attraction detection view cone in degrees (default = 80)
[in]look_ahead_distanceHow far ahead attraction points will be considered in meters (default = 0.1)
[in]attraction_weightWeight factor for attraction vs natural growth (0.0 = ignore attraction, 1.0 = full attraction) (default = 0.6)

◆ enableAttractionPoints() [2/2]

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.

Parameters
[in]plantIDIdentifier of the plant to apply attraction points to
[in]attraction_pointsVector of 3D positions that the plant should grow toward
[in]view_half_angle_degHalf-angle of the attraction detection view cone in degrees (default = 80)
[in]look_ahead_distanceHow far ahead attraction points will be considered in meters (default = 0.1m)
[in]attraction_weightWeight factor for attraction vs natural growth (0.0 = ignore attraction, 1.0 = full attraction) (default = 0.6)

◆ enableCarbohydrateModel()

void PlantArchitecture::enableCarbohydrateModel ( )

Enables the carbohydrate model in the plant architecture development.

Definition at line 4737 of file PlantArchitecture.cpp.

◆ enableEpicormicChildShoots()

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)

Note
The probability that the shoot produces an epicormic shoot over period of dt is P = (epicormic_probability_perlength_perday * shoot_length * dt)*sin(shoot_inclinantion)
Parameters
[in]plantIDID of the plant instance.
[in]epicormic_shoot_type_labelLabel of the shoot type corresponding to epicormic shoots.
[in]epicormic_probability_perlength_perdayProbability of epicormic shoot formation per unit length of the parent shoot per day.

Definition at line 3398 of file PlantArchitecture.cpp.

◆ enableGroundClipping()

void PlantArchitecture::enableGroundClipping ( float  ground_height = 0.f)

Enable automatic removal of organs that are below the ground plane.

Parameters
[in]ground_height[optional] Height of the ground plane (default = 0).

Definition at line 3422 of file PlantArchitecture.cpp.

◆ enableMessages()

void PlantArchitecture::enableMessages ( )

Re-enable standard output from this plug-in.

Definition at line 6452 of file PlantArchitecture.cpp.

◆ enableNitrogenModel()

void PlantArchitecture::enableNitrogenModel ( )

Enable the nitrogen model for tracking plant nitrogen status and stress.

The nitrogen model simulates nitrogen uptake, allocation to leaves, remobilization from old to young leaves, and calculates a nitrogen stress factor (0-1) that other plugins can optionally use to modify photosynthesis and growth.

See also
disableNitrogenModel(), addPlantNitrogen(), setPlantNitrogenParameters()

Definition at line 22 of file NitrogenModel.cpp.

◆ enableSoftCollisionAvoidance()

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)

Parameters
[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 5894 of file PlantArchitecture.cpp.

◆ enableSolidObstacleAvoidance()

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.

Parameters
[in]obstacle_UUIDsVector of primitive UUIDs that represent solid obstacles
[in]avoidance_distanceDistance at which obstacle avoidance begins (meters)
[in]enable_fruit_adjustmentEnable automatic fruit rotation adjustment to avoid obstacles (default: false)
[in]enable_obstacle_pruningEnable solid obstacle collision pruning (default: true)

Definition at line 6021 of file PlantArchitecture.cpp.

◆ generatePlantFromString() [1/2]

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.

Parameters
[in]generation_stringInput string describing the plant generation rules and structure.
[in]phytomer_parametersParameters that define the characteristics of a single phytomer.
Returns
The total number of phytomers generated in the plant architecture.

Definition at line 404 of file InputOutput.cpp.

◆ generatePlantFromString() [2/2]

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.

Parameters
[in]generation_stringA string encoding of the plant structure.
[in]phytomer_parametersA map containing parameter configurations for each type of phytomer.
Returns
A unique identifier for the generated plant.
Note
The input string must begin with '{', and valid phytomer parameters must be provided.

Definition at line 410 of file InputOutput.cpp.

◆ getAllFlowerUUIDs()

std::vector< uint > PlantArchitecture::getAllFlowerUUIDs ( ) const

Get UUIDs for all existing flower primitives.

Returns
Vector of UUIDs for all flower primitives.

Definition at line 4708 of file PlantArchitecture.cpp.

◆ getAllFruitUUIDs()

std::vector< uint > PlantArchitecture::getAllFruitUUIDs ( ) const

Get UUIDs for all existing fruit primitives.

Returns
Vector of UUIDs for all fruit primitives.

Definition at line 4718 of file PlantArchitecture.cpp.

◆ getAllInternodeUUIDs()

std::vector< uint > PlantArchitecture::getAllInternodeUUIDs ( ) const

Get UUIDs for all existing internode primitives.

Returns
Vector of UUIDs for all internode primitives.

Definition at line 4678 of file PlantArchitecture.cpp.

◆ getAllLeafUUIDs()

std::vector< uint > PlantArchitecture::getAllLeafUUIDs ( ) const

Get UUIDs for all existing leaf primitives.

Returns
Vector of UUIDs for all leaf primitives.

Definition at line 4668 of file PlantArchitecture.cpp.

◆ getAllObjectIDs()

std::vector< uint > PlantArchitecture::getAllObjectIDs ( ) const

Get object IDs for all existing plant compound objects.

Returns
Vector of object IDs for all plant compound objects.

Definition at line 4728 of file PlantArchitecture.cpp.

◆ getAllPeduncleUUIDs()

std::vector< uint > PlantArchitecture::getAllPeduncleUUIDs ( ) const

Get UUIDs for all existing peduncle primitives.

Returns
Vector of UUIDs for all peduncle primitives.

Definition at line 4698 of file PlantArchitecture.cpp.

◆ getAllPetioleUUIDs()

std::vector< uint > PlantArchitecture::getAllPetioleUUIDs ( ) const

Get UUIDs for all existing petiole primitives.

Returns
Vector of UUIDs for all petiole primitives.

Definition at line 4688 of file PlantArchitecture.cpp.

◆ getAllPlantIDs()

std::vector< uint > PlantArchitecture::getAllPlantIDs ( ) const

Get IDs for all plant instances.

Returns
Vector of plant IDs for all plant instances

Definition at line 4360 of file PlantArchitecture.cpp.

◆ getAllPlantObjectIDs()

std::vector< uint > PlantArchitecture::getAllPlantObjectIDs ( uint  plantID) const

Get object IDs for all organs objects for a given plant.

Parameters
[in]plantIDID of the plant instance.
Returns
Vector of object IDs for all organs in the plant.

Definition at line 4371 of file PlantArchitecture.cpp.

◆ getAllPlantUUIDs()

std::vector< uint > PlantArchitecture::getAllPlantUUIDs ( uint  plantID) const

Get primitive UUIDs for all primitives in a given plant.

Parameters
[in]plantIDID of the plant instance.
Returns
Vector of primitive UUIDs for all primitives in the plant.

Definition at line 4401 of file PlantArchitecture.cpp.

◆ getAllUUIDs()

std::vector< uint > PlantArchitecture::getAllUUIDs ( ) const

Get UUIDs for all existing plant primitives.

Returns
Vector of UUIDs for all plant primitives.

Definition at line 4659 of file PlantArchitecture.cpp.

◆ getAvailablePlantModels()

std::vector< std::string > PlantArchitecture::getAvailablePlantModels ( ) const

Get list of all available plant models in the library.

Definition at line 110 of file PlantLibrary.cpp.

◆ getCollisionDetection()

CollisionDetection * PlantArchitecture::getCollisionDetection ( ) const

Get access to the internal CollisionDetection instance (for advanced usage)

Returns
Pointer to internal CollisionDetection instance, or nullptr if not enabled

Definition at line 6000 of file PlantArchitecture.cpp.

◆ getCurrentPhytomerParameters()

std::map< std::string, PhytomerParameters > PlantArchitecture::getCurrentPhytomerParameters ( )

Get the phytomer parameters structure for all shoot types in the current plant model.

Returns
Map of phytomer parameters for all type labels to ShootParameters structures for all shoot types in the current plant model. The key is the user-defined label string for the shoot type, and the value is the corresponding PhytomerParameters structure.

Definition at line 196 of file PlantLibrary.cpp.

◆ getCurrentShootParameters() [1/2]

std::map< std::string, ShootParameters > PlantArchitecture::getCurrentShootParameters ( )

Get the shoot parameters structure for all shoot types in the current plant model.

Returns
Map of shoot type labels to ShootParameters structures for all shoot types in the current plant model. The key is the user-defined label string for the shoot type, and the value is the corresponding ShootParameters structure.

Definition at line 187 of file PlantLibrary.cpp.

◆ getCurrentShootParameters() [2/2]

ShootParameters PlantArchitecture::getCurrentShootParameters ( const std::string &  shoot_type_label)

Get the shoot parameters structure for a specific shoot type in the current plant model.

Parameters
[in]shoot_type_labelUser-defined label for the shoot type.
Returns
ShootParameters structure for the specified shoot type.

Definition at line 178 of file PlantLibrary.cpp.

◆ getPlantAge()

float PlantArchitecture::getPlantAge ( uint  plantID) const

Retrieves the age of a specific plant.

Parameters
[in]plantIDUnique identifier of the plant.
Returns
The age of the plant in days associated with the given plantID.

Definition at line 3932 of file PlantArchitecture.cpp.

◆ getPlantBasePosition() [1/2]

std::vector< helios::vec3 > PlantArchitecture::getPlantBasePosition ( const std::vector< uint > &  plantIDs) const

Retrieves the base positions of multiple plants.

Parameters
[in]plantIDsA vector containing the IDs of the plants for which the base positions are required.
Returns
A vector of vec3 objects representing the base positions of the specified plants.

Definition at line 3631 of file PlantArchitecture.cpp.

◆ getPlantBasePosition() [2/2]

helios::vec3 PlantArchitecture::getPlantBasePosition ( uint  plantID) const

Retrieves the base position of the specified plant.

Parameters
[in]plantIDIdentifier of the plant whose base position is being queried.
Returns
Base position of the plant as a helios::vec3 object.

Definition at line 3622 of file PlantArchitecture.cpp.

◆ getPlantCollisionRelevantObjectIDs()

std::vector< uint > PlantArchitecture::getPlantCollisionRelevantObjectIDs ( uint  plantID) const

Get collision-relevant object IDs for a specific plant.

Parameters
[in]plantIDPlant ID for which to query collision-relevant object IDs
Returns
Vector of object IDs for collision-relevant organs belonging to specified plant

Returns object IDs for plant organs that are currently enabled for collision detection based on the settings from setCollisionRelevantOrgans().

Definition at line 4617 of file PlantArchitecture.cpp.

◆ getPlantFlowerObjectIDs()

std::vector< uint > PlantArchitecture::getPlantFlowerObjectIDs ( uint  plantID) const

Get object IDs for all inflorescence objects for a given plant.

Parameters
[in]plantIDID of the plant instance.
Returns
Vector of object IDs for all inflorescences in the plant.

Definition at line 4521 of file PlantArchitecture.cpp.

◆ getPlantFruitObjectIDs()

std::vector< uint > PlantArchitecture::getPlantFruitObjectIDs ( uint  plantID) const

Get object IDs for all fruit objects for a given plant.

Parameters
[in]plantIDID of the plant instance.
Returns
Vector of object IDs for all fruits in the plant.

Definition at line 4545 of file PlantArchitecture.cpp.

◆ getPlantHeight()

float PlantArchitecture::getPlantHeight ( uint  plantID) const

Calculate the height of the highest element in the plant.

Parameters
[in]plantIDID of the plant instance.
Returns
Height of the highest element in the plant.

Definition at line 3689 of file PlantArchitecture.cpp.

◆ getPlantInternodeObjectIDs() [1/2]

std::vector< uint > PlantArchitecture::getPlantInternodeObjectIDs ( uint  plantID) const

Get object IDs for all internode (Tube) objects for a given plant.

Parameters
[in]plantIDID of the plant instance.
Returns
Vector of object IDs for all internodes in the plant.

Definition at line 4405 of file PlantArchitecture.cpp.

◆ getPlantInternodeObjectIDs() [2/2]

std::vector< uint > PlantArchitecture::getPlantInternodeObjectIDs ( uint  plantID,
const std::string &  shoot_type_label 
) const

Get object IDs for internode (Tube) objects matching a specified shoot type label.

Parameters
[in]plantIDID of the plant instance.
[in]shoot_type_labelLabel of the shoot type to filter internodes by.
Returns
Vector of object IDs for all internodes matching the specified shoot type label.
Note
Throws a helios_runtime_error if the plant does not exist or if no shoots with the specified shoot type label are found.

Definition at line 4423 of file PlantArchitecture.cpp.

◆ getPlantLeafAzimuthAngleDistribution() [1/2]

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.

Parameters
[in]plantIDsVector of ID of the plant instances.
[in]NbinsNumber of bins for the histogram.
[in]normalize[optional] Normalize the histogram (default = true).
Returns
Histogram of leaf azimuth angles. Bins are evenly spaced between 0 and 360 degrees.

Definition at line 3789 of file PlantArchitecture.cpp.

◆ getPlantLeafAzimuthAngleDistribution() [2/2]

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.

Parameters
[in]plantIDID of the plant instance.
[in]NbinsNumber of bins for the histogram.
[in]normalize[optional] Normalize the histogram (default = true).
Returns
Histogram of leaf azimuth angles. Bins are evenly spaced between 0 and 360 degrees.

Definition at line 3754 of file PlantArchitecture.cpp.

◆ getPlantLeafBases() [1/2]

std::vector< helios::vec3 > PlantArchitecture::getPlantLeafBases ( const std::vector< uint > &  plantIDs) const

Get the base positions of all leaves for a list of plants.

Parameters
[in]plantIDsList of IDs of the plant instances.
Returns
Vector of base positions of all leaves on the plants.

Definition at line 3843 of file PlantArchitecture.cpp.

◆ getPlantLeafBases() [2/2]

std::vector< helios::vec3 > PlantArchitecture::getPlantLeafBases ( uint  plantID) const

Get the base positions of all leaves on the plant.

Parameters
[in]plantIDID of the plant instance.
Returns
Vector of base positions of all leaves on the plant.

Definition at line 3816 of file PlantArchitecture.cpp.

◆ getPlantLeafCount()

uint PlantArchitecture::getPlantLeafCount ( uint  plantID) const

Get the total number of leaves on the plant.

Parameters
[in]plantIDID of the plant instance.
Returns
Total number of leaves on the plant.

Definition at line 3808 of file PlantArchitecture.cpp.

◆ getPlantLeafInclinationAngleDistribution() [1/2]

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.

Parameters
[in]plantIDsVector of IDs of the plant instances.
[in]NbinsNumber of bins for the histogram.
[in]normalize[optional] Normalize the histogram (default = true).
Returns
Histogram of leaf inclination angles. Bins are evenly spaced between 0 and 90 degrees.

Definition at line 3736 of file PlantArchitecture.cpp.

◆ getPlantLeafInclinationAngleDistribution() [2/2]

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.

Parameters
[in]plantIDID of the plant instance.
[in]NbinsNumber of bins for the histogram.
[in]normalize[optional] Normalize the histogram (default = true).
Returns
Histogram of leaf inclination angles. Bins are evenly spaced between 0 and 90 degrees.

Definition at line 3701 of file PlantArchitecture.cpp.

◆ getPlantLeafObjectIDs() [1/2]

std::vector< uint > PlantArchitecture::getPlantLeafObjectIDs ( const std::vector< uint > &  plantIDs) const

Get object IDs for all leaf objects for a list of plants.

Parameters
[in]plantIDsList of IDs of the plant instances.
Returns
Vector of object IDs for all leaves in the plants.

Definition at line 4489 of file PlantArchitecture.cpp.

◆ getPlantLeafObjectIDs() [2/2]

std::vector< uint > PlantArchitecture::getPlantLeafObjectIDs ( uint  plantID) const

Get object IDs for all leaf objects for a given plant.

Parameters
[in]plantIDID of the plant instance.
Returns
Vector of object IDs for all leaves in the plant.

Definition at line 4469 of file PlantArchitecture.cpp.

◆ getPlantName()

std::string PlantArchitecture::getPlantName ( uint  plantID) const

Retrieves the name of the plant associated with a given plant ID.

Parameters
[in]plantIDThe unique identifier of the plant.
Returns
The name of the plant corresponding to the provided plant ID.

Definition at line 3925 of file PlantArchitecture.cpp.

◆ getPlantPeduncleObjectIDs()

std::vector< uint > PlantArchitecture::getPlantPeduncleObjectIDs ( uint  plantID) const

Get object IDs for all peduncle (Tube) objects for a given plant.

Parameters
[in]plantIDID of the plant instance.
Returns
Vector of object IDs for all peduncles in the plant.

Definition at line 4499 of file PlantArchitecture.cpp.

◆ getPlantPetioleObjectIDs()

std::vector< uint > PlantArchitecture::getPlantPetioleObjectIDs ( uint  plantID) const

Get object IDs for all petiole (Tube) objects for a given plant.

Parameters
[in]plantIDID of the plant instance.
Returns
Vector of object IDs for all petioles in the plant.

Definition at line 4449 of file PlantArchitecture.cpp.

◆ getPlantStemHeight()

float PlantArchitecture::getPlantStemHeight ( uint  plantID) const

Calculate the height of the last internode on the base stem/shoot.

Parameters
[in]plantIDID of the plant instance.
Returns
Height of the last internode on the base stem/shoot.

Definition at line 3655 of file PlantArchitecture.cpp.

◆ getPlantString()

std::string PlantArchitecture::getPlantString ( uint  plantID) const

Retrieves a string representation of a plant based on its ID.

Parameters
[in]plantIDThe unique identifier of the plant.
Returns
A string encoding of the plant structure.

Definition at line 75 of file InputOutput.cpp.

◆ getShootInternodeObjectIDs()

std::vector< uint > PlantArchitecture::getShootInternodeObjectIDs ( uint  plantID) const

Get internode object IDs for all shoots for a given plant.

Parameters
[in]plantIDID of the plant instance.
Returns
Vector of object IDs for all shoots in the plant.

Definition at line 4599 of file PlantArchitecture.cpp.

◆ getShootNodeCount()

uint PlantArchitecture::getShootNodeCount ( uint  plantID,
uint  shootID 
) const

Retrieves the number of nodes in a specific shoot of a specific plant.

Parameters
[in]plantIDThe unique identifier of the plant.
[in]shootIDThe index of the shoot within the plant.
Returns
The current number of nodes in the specified shoot.

Definition at line 4331 of file PlantArchitecture.cpp.

◆ getShootTaper()

float PlantArchitecture::getShootTaper ( uint  plantID,
uint  shootID 
) const

Retrieves the taper of a shoot based on its radius measurements.

Parameters
[in]plantIDThe unique identifier of the plant.
[in]shootIDThe unique identifier of the shoot within the specified plant.
Returns
The taper of the shoot as a float value, constrained between 0 and 1.

Definition at line 4340 of file PlantArchitecture.cpp.

◆ harvestPlant()

void PlantArchitecture::harvestPlant ( uint  plantID)

Harvests a plant by removing all leaves and fruit.

Parameters
[in]plantIDThe unique identifier of the plant to be harvested.

Definition at line 3960 of file PlantArchitecture.cpp.

◆ initializeCarbohydratePool()

void PlantArchitecture::initializeCarbohydratePool ( float  carbohydrate_concentration_molC_m3) const

Initializes the carbohydrate pool for all shoots of all plant instances.

Parameters
[in]carbohydrate_concentration_molC_m3Concentration of carbohydrates in molC per cubic meter

Definition at line 59 of file CarbohydrateModel.cpp.

◆ initializeNitrogenPools()

void PlantArchitecture::initializeNitrogenPools ( float  initial_leaf_N_concentration)

Initialize nitrogen pools for all plants based on current leaf biomass.

Parameters
[in]initial_leaf_N_concentrationInitial leaf nitrogen concentration (g N/g DW)

Definition at line 51 of file NitrogenModel.cpp.

◆ initializePlantCarbohydratePool()

void PlantArchitecture::initializePlantCarbohydratePool ( uint  plantID,
float  carbohydrate_concentration_molC_m3 
)

Initializes the carbohydrate pool for a specific plant.

Parameters
[in]plantIDUnique identifier of the plant.
[in]carbohydrate_concentration_molC_m3Initial carbohydrate concentration in moles of carbon per cubic meter.
Note
The plant with the specified ID must exist, and the carbohydrate concentration must be non-negative.

Definition at line 74 of file CarbohydrateModel.cpp.

◆ initializePlantNitrogenPools()

void PlantArchitecture::initializePlantNitrogenPools ( uint  plantID,
float  initial_leaf_N_concentration 
)

Initialize nitrogen pools for a specific plant.

Parameters
[in]plantIDPlant ID to initialize
[in]initial_leaf_N_concentrationInitial leaf nitrogen concentration (g N/g DW)
Exceptions
helios_runtime_errorif plant does not exist

Definition at line 57 of file NitrogenModel.cpp.

◆ initializeShootCarbohydratePool()

void PlantArchitecture::initializeShootCarbohydratePool ( uint  plantID,
uint  shootID,
float  carbohydrate_concentration_molC_m3 
)

Initializes the carbohydrate pool for a specific shoot of a plant.

Parameters
[in]plantIDIdentifier for the plant whose shoot's carbohydrate pool is being initialized.
[in]shootIDIdentifier for the shoot of the plant.
[in]carbohydrate_concentration_molC_m3Carbohydrate concentration in moles of carbon per cubic meter; must be non-negative.
Note
Throws an error if the plant or shoot ID does not exist, or if the carbohydrate concentration is negative.

Definition at line 89 of file CarbohydrateModel.cpp.

◆ isNitrogenModelEnabled()

bool PlantArchitecture::isNitrogenModelEnabled ( ) const

Check if the nitrogen model is enabled.

Returns
True if nitrogen model is enabled, false otherwise

Definition at line 30 of file NitrogenModel.cpp.

◆ isPlantDormant()

bool PlantArchitecture::isPlantDormant ( uint  plantID) const

Checks if the plant with the given ID is dormant.

Parameters
[in]plantIDThe ID of the plant to check.
Returns
True if all shoots on the plant are dormant, false otherwise.

Definition at line 3852 of file PlantArchitecture.cpp.

◆ listShootTypeLabels() [1/3]

std::vector< std::string > PlantArchitecture::listShootTypeLabels ( ) const

Get the list of shoot type labels for the currently loaded plant model.

Returns
Vector of shoot type label strings for the currently loaded plant model.
Note
This method only works if a plant model has been loaded via loadPlantModelFromLibrary(). Use the overload listShootTypeLabels(plant_model_name) to query a specific model without loading, or listShootTypeLabels(plantID) to query a plant instance.

Definition at line 209 of file PlantLibrary.cpp.

◆ listShootTypeLabels() [2/3]

std::vector< std::string > PlantArchitecture::listShootTypeLabels ( const std::string &  plant_model_name)

Get the list of shoot type labels for a specific plant model without changing current state.

Parameters
[in]plant_model_nameName of the plant model to query (e.g., "bean", "tomato", "almond"). Use getAvailablePlantModels() to see available plant model names.
Returns
Vector of shoot type label strings for the specified plant model.
Note
This method temporarily loads the plant model to extract shoot type information, then restores the original plant state. The current plant model remains unchanged after calling this method.

Definition at line 225 of file PlantLibrary.cpp.

◆ listShootTypeLabels() [3/3]

std::vector< std::string > PlantArchitecture::listShootTypeLabels ( uint  plantID) const

Get the list of shoot type labels for a specific plant instance.

Parameters
[in]plantIDUnique identifier for the plant instance.
Returns
Vector of shoot type label strings for the specified plant instance.
Note
This method returns the shoot types that were defined when the plant instance was created. The shoot types are captured from the plant model at creation time.

Definition at line 3941 of file PlantArchitecture.cpp.

◆ loadPlantModelFromLibrary()

void PlantArchitecture::loadPlantModelFromLibrary ( const std::string &  plant_label)

Load an existing plant model from the library.

Parameters
[in]plant_labelUser-defined label for the plant model to be loaded.

Definition at line 104 of file PlantLibrary.cpp.

◆ makePlantDormant()

void PlantArchitecture::makePlantDormant ( uint  plantID)

Makes the specified plant enter a dormant state.

Parameters
[in]plantIDID of the plant to be made dormant.

Definition at line 4038 of file PlantArchitecture.cpp.

◆ optionalOutputObjectData() [1/2]

void PlantArchitecture::optionalOutputObjectData ( const std::string &  object_data_label)

Add optional output object data values to the Context.

Parameters
[in]object_data_labelName of object data (e.g., "age", "rank")

Definition at line 5865 of file PlantArchitecture.cpp.

◆ optionalOutputObjectData() [2/2]

void PlantArchitecture::optionalOutputObjectData ( const std::vector< std::string > &  object_data_labels)

Add optional output object data values to the Context.

Parameters
[in]object_data_labelsVector of names of object data (e.g., {"age", "rank"})

Definition at line 5887 of file PlantArchitecture.cpp.

◆ pruneBranch()

void PlantArchitecture::pruneBranch ( uint  plantID,
uint  shootID,
uint  node_index 
)

Prunes a branch from a specific plant at a designated node index.

Parameters
[in]plantIDUnique identifier of the plant to prune.
[in]shootIDIdentifier of the shoot to prune from within the plant.
[in]node_indexIndex of the node on the shoot where the branch will be pruned.

Definition at line 4059 of file PlantArchitecture.cpp.

◆ readPlantStructureXML()

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.

Parameters
[in]filenameThe path to the XML file to load.
[in]quiet[optional] If true, suppresses console output of status messages.
Returns
A vector of unsigned integers representing the plant IDs parsed from the XML file.
Note
Throws an exception if the file cannot be parsed or is missing required tags.

Definition at line 851 of file InputOutput.cpp.

◆ removePlantLeaves()

void PlantArchitecture::removePlantLeaves ( uint  plantID)

Removes all leaves from the plant with the specified ID.

Parameters
[in]plantIDThe unique identifier of the plant whose leaves are to be removed.

Definition at line 4026 of file PlantArchitecture.cpp.

◆ removeShootFloralBuds()

void PlantArchitecture::removeShootFloralBuds ( uint  plantID,
uint  shootID 
)

Removes all floral buds from a specified shoot in a specified plant.

Parameters
[in]plantIDID of the plant from which floral buds are to be removed.
[in]shootIDID of the shoot within the plant whose floral buds are to be removed.

Definition at line 4010 of file PlantArchitecture.cpp.

◆ removeShootLeaves()

void PlantArchitecture::removeShootLeaves ( uint  plantID,
uint  shootID 
)

Removes all leaves from a specified shoot in a specified plant.

Parameters
[in]plantIDID of the plant from which leaves are to be removed.
[in]shootIDID of the shoot within the plant whose leaves are to be removed.

Definition at line 3978 of file PlantArchitecture.cpp.

◆ removeShootVegetativeBuds()

void PlantArchitecture::removeShootVegetativeBuds ( uint  plantID,
uint  shootID 
)

Removes all vegetative buds from a specified shoot in a specified plant.

Parameters
[in]plantIDID of the plant from which buds are to be removed.
[in]shootIDID of the shoot within the plant whose buds are to be removed.

Definition at line 3994 of file PlantArchitecture.cpp.

◆ resolveTextureFile()

std::string PlantArchitecture::resolveTextureFile ( const std::string &  texture_file)
static

Resolve an asset file path for the plantarchitecture plugin.

This method resolves asset file paths (textures and OBJ models) for the plantarchitecture plugin, allowing users to specify simple paths like "OliveBark.jpg" or "MyLeaf.obj" instead of using the verbose helios::resolvePluginAsset() wrapper.

Resolution order:

  1. Empty path returns empty string
  2. Absolute paths that exist are returned as-is
  3. Try resolving as a general file path (for already-resolved paths)
  4. Try resolving as a plugin asset path (e.g., "assets/textures/OliveBark.jpg")
  5. If path doesn't have "assets/" prefix, determine subdirectory from file extension:
    • .obj/.mtl files: try "assets/obj/" + filename
    • Other files: try "assets/textures/" + filename
Parameters
[in]texture_fileThe asset file path (can be simple filename, relative path, or absolute path)
Returns
Resolved absolute path to the asset file
Exceptions
helios_runtime_errorif the asset file cannot be found

Definition at line 126 of file PlantArchitecture.cpp.

◆ selfTest()

int PlantArchitecture::selfTest ( int  argc,
char **  argv 
)
static

Unit test routines.

Definition at line 2446 of file selfTest.cpp.

◆ setAttractionParameters() [1/2]

void PlantArchitecture::setAttractionParameters ( float  view_half_angle_deg,
float  look_ahead_distance,
float  attraction_weight,
float  obstacle_reduction_factor = 0.75f 
)

Set attraction parameters.

Parameters
[in]view_half_angle_degHalf-angle of the attraction detection view cone in degrees
[in]look_ahead_distanceHow far ahead attraction points will be considered in meters
[in]attraction_weightWeight factor for attraction vs natural growth (0.0 = ignore attraction, 1.0 = full attraction)
[in]obstacle_reduction_factorReduction factor for attraction when hard obstacles are present (default = 0.75)

Definition at line 6277 of file PlantArchitecture.cpp.

◆ setAttractionParameters() [2/2]

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.

Parameters
[in]plantIDIdentifier of the plant to set attraction parameters for
[in]view_half_angle_degHalf-angle of the attraction detection view cone in degrees
[in]look_ahead_distanceHow far ahead attraction points will be considered in meters
[in]attraction_weightWeight factor for attraction vs natural growth (0.0 = ignore attraction, 1.0 = full attraction)
[in]obstacle_reduction_factorReduction factor for attraction when hard obstacles are present (default = 0.75)

Definition at line 6391 of file PlantArchitecture.cpp.

◆ setCollisionRelevantOrgans()

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.

Parameters
[in]include_internodesInclude internode segments in collision detection (default: false)
[in]include_leavesInclude leaf surfaces in collision detection (default: true)
[in]include_petiolesInclude petiole segments in collision detection (default: false)
[in]include_flowersInclude flower geometry in collision detection (default: false)
[in]include_fruitInclude fruit geometry in collision detection (default: false)

Definition at line 6004 of file PlantArchitecture.cpp.

◆ setGeometryUpdateScheduling()

void PlantArchitecture::setGeometryUpdateScheduling ( int  update_frequency = 3,
bool  force_update_on_collision = true 
)

Configure Context geometry update scheduling for efficiency.

Parameters
[in]update_frequencyHow often to update Context geometry (1=every timestep, 2=every 2 timesteps, etc.)
[in]force_update_on_collisionForce Context update when collision avoidance is triggered

Definition at line 6188 of file PlantArchitecture.cpp.

◆ setPhytomerLeafScale()

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.

Parameters
[in]plantIDIdentifier of the plant.
[in]shootIDIdentifier of the shoot on the specified plant.
[in]node_numberNode number of the phytomer to adjust.
[in]leaf_scale_factor_fractionFractional scaling factor for the leaf, must be in the range [0, 1].

Definition at line 3530 of file PlantArchitecture.cpp.

◆ setPlantAge()

void PlantArchitecture::setPlantAge ( uint  plantID,
float  current_age 
)

Don't use this.

Definition at line 3920 of file PlantArchitecture.cpp.

◆ setPlantBasePosition()

void PlantArchitecture::setPlantBasePosition ( uint  plantID,
const helios::vec3 base_position 
)

Sets the base position of a plant with the specified ID.

Parameters
[in]plantIDUnique identifier of the plant
[in]base_positionCoordinates representing the new base position of the plant

Definition at line 3549 of file PlantArchitecture.cpp.

◆ setPlantCarbohydrateModelParameters() [1/2]

void PlantArchitecture::setPlantCarbohydrateModelParameters ( const std::vector< uint > &  plantIDs,
const CarbohydrateParameters carb_parameters 
)

Sets carbohydrate model parameters for specified plants.

Parameters
[in]plantIDsA vector of plant IDs for which the parameters will be set.
[in]carb_parametersThe carbohydrate model parameters to apply.

Definition at line 4867 of file PlantArchitecture.cpp.

◆ setPlantCarbohydrateModelParameters() [2/2]

void PlantArchitecture::setPlantCarbohydrateModelParameters ( uint  plantID,
const CarbohydrateParameters carb_parameters 
)

Sets the carbohydrate model parameters for a specific plant.

Parameters
[in]plantIDIdentifier for the plant whose parameters are being set.
[in]carb_parametersReference to the carbohydrate parameters to assign to the plant.

Definition at line 4859 of file PlantArchitecture.cpp.

◆ setPlantLeafAngleDistribution() [1/2]

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.

Parameters
[in]plantIDsVector of plant IDs to which the leaf angle distribution is to be applied.
[in]Beta_mu_inclinationMean parameter for the beta distribution of inclination angles.
[in]Beta_nu_inclinationShape parameter for the beta distribution of inclination angles.
[in]eccentricityEccentricity value for the ellipse defining the azimuth distribution.
[in]ellipse_rotation_degreesRotation angle of the ellipse in degrees.

Definition at line 3609 of file PlantArchitecture.cpp.

◆ setPlantLeafAngleDistribution() [2/2]

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.

Parameters
[in]plantIDThe unique identifier of the plant.
[in]Beta_mu_inclinationThe mean inclination angle parameter (Beta distribution).
[in]Beta_nu_inclinationThe shape parameter nu of the distribution (Beta distribution).
[in]eccentricityEccentricity value for the ellipse defining the azimuth distribution.
[in]ellipse_rotation_degreesRotation angle of the ellipse in degrees.

Definition at line 3597 of file PlantArchitecture.cpp.

◆ setPlantLeafAzimuthAngleDistribution() [1/2]

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.

Parameters
[in]plantIDsList of plant IDs to which the angle distribution will be applied.
[in]eccentricityEccentricity value for the ellipse defining the azimuth distribution.
[in]ellipse_rotation_degreesRotation angle of the ellipse in degrees.

Definition at line 3589 of file PlantArchitecture.cpp.

◆ setPlantLeafAzimuthAngleDistribution() [2/2]

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.

Parameters
[in]plantIDIdentifier of the plant whose leaf azimuth angle distribution is being set.
[in]eccentricityEccentricity value for the ellipse defining the azimuth distribution.
[in]ellipse_rotation_degreesRotation angle of the ellipse in degrees.

Definition at line 3581 of file PlantArchitecture.cpp.

◆ setPlantLeafElevationAngleDistribution() [1/2]

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.

Parameters
[in]plantIDsList of plant IDs for which to set the elevation angle distribution.
[in]Beta_mu_inclinationMean value parameter for the Beta distribution of inclination angles.
[in]Beta_nu_inclinationShape parameter for the Beta distribution of inclination angles.

Definition at line 3571 of file PlantArchitecture.cpp.

◆ setPlantLeafElevationAngleDistribution() [2/2]

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.

Parameters
[in]plantIDIdentifier for the plant.
[in]Beta_mu_inclinationMean value parameter for the Beta distribution of inclination angles.
[in]Beta_nu_inclinationShape parameter for the Beta distribution of inclination angles.

Definition at line 3561 of file PlantArchitecture.cpp.

◆ setPlantNitrogenParameters() [1/2]

void PlantArchitecture::setPlantNitrogenParameters ( const std::vector< uint > &  plantIDs,
const NitrogenParameters params 
)

Set nitrogen model parameters for multiple plants.

Parameters
[in]plantIDsVector of plant IDs
[in]paramsNitrogen parameters struct
Exceptions
helios_runtime_errorif any plant does not exist

Definition at line 43 of file NitrogenModel.cpp.

◆ setPlantNitrogenParameters() [2/2]

void PlantArchitecture::setPlantNitrogenParameters ( uint  plantID,
const NitrogenParameters params 
)

Set nitrogen model parameters for a single plant.

Parameters
[in]plantIDPlant ID to set parameters for
[in]paramsNitrogen parameters struct
Exceptions
helios_runtime_errorif plant does not exist

Definition at line 36 of file NitrogenModel.cpp.

◆ setPlantPhenologicalThresholds()

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.

Parameters
[in]plantIDID of the plant.
[in]time_to_dormancy_breakLength of the dormancy period.
[in]time_to_flower_initiationTime from emergence/dormancy required to reach flower creation (closed flowers).
[in]time_to_flower_openingTime from flower initiation to flower opening.
[in]time_to_fruit_setTime from flower opening required to reach fruit set (i.e., flower dies and fruit is created).
[in]time_to_fruit_maturityTime from fruit set date required to reach fruit maturity.
[in]time_to_dormancyTime 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).
Note
Any phenological stage can be skipped by specifying a negative threshold value. In this case, the stage will be skipped and the threshold for the next stage will be relative to the previous stage.

Definition at line 4839 of file PlantArchitecture.cpp.

◆ setSoftCollisionAvoidanceParameters()

void PlantArchitecture::setSoftCollisionAvoidanceParameters ( float  view_half_angle_deg,
float  look_ahead_distance,
int  sample_count,
float  inertia_weight 
)

Set collision avoidance parameters.

Parameters
[in]view_half_angle_degHalf-angle of the collision detection view cone in degrees (default = 80)
[in]look_ahead_distanceHow far ahead collisions will be considered in meters (default = 0.1)
[in]sample_countNumber of directional samples within the cone (default = 256)
[in]inertia_weightWeight factor for directional inertia vs collision avoidance (0.0 = use optimal direction, 1.0 = ignore collision avoidance) (default = 0.4)

Definition at line 5971 of file PlantArchitecture.cpp.

◆ setStaticObstacles()

void PlantArchitecture::setStaticObstacles ( const std::vector< uint > &  target_UUIDs)

Mark specific geometry as static for collision detection efficiency.

Parameters
[in]target_UUIDsVector of primitive UUIDs representing static obstacles (buildings, fixed structures, etc.)

Definition at line 5988 of file PlantArchitecture.cpp.

◆ sumPlantLeafArea()

float PlantArchitecture::sumPlantLeafArea ( uint  plantID) const

Sum the one-sided leaf area of all leaves in the plant.

Parameters
[in]plantIDID of the plant instance.
Returns
Total one-sided leaf area of all leaves in the plant.

Definition at line 3640 of file PlantArchitecture.cpp.

◆ updateAttractionPoints() [1/2]

void PlantArchitecture::updateAttractionPoints ( const std::vector< helios::vec3 > &  attraction_points)

Update attraction points positions (overwrites existing points)

Parameters
[in]attraction_pointsUpdated vector of 3D positions that plants should grow toward

◆ updateAttractionPoints() [2/2]

void PlantArchitecture::updateAttractionPoints ( uint  plantID,
const std::vector< helios::vec3 > &  attraction_points 
)

Update attraction points positions for a specific plant (overwrites existing points)

Parameters
[in]plantIDIdentifier of the plant to update attraction points for
[in]attraction_pointsUpdated vector of 3D positions that the plant should grow toward

◆ updateCurrentShootParameters() [1/2]

void PlantArchitecture::updateCurrentShootParameters ( const std::map< std::string, ShootParameters > &  params)

Update the parameters of all shoot types in the current plant model.

Parameters
[in]paramsUpdated parameters structure for the shoot type.
Note
This will overwrite any existing shoot parameter definitions.

Definition at line 264 of file PlantLibrary.cpp.

◆ updateCurrentShootParameters() [2/2]

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.

Parameters
[in]shoot_type_labelUser-defined label for the shoot type to be updated.
[in]paramsUpdated parameters structure for the shoot type.
Note
This will overwrite any existing shoot parameter definitions.

Definition at line 260 of file PlantLibrary.cpp.

◆ updateShootFruitCounts()

void PlantArchitecture::updateShootFruitCounts ( uint  plantID) const

Assign a fruit count value for each shoot on a plant.

Parameters
[in]plantIDID of the plant instance.

Definition at line 4570 of file PlantArchitecture.cpp.

◆ writePlantMeshVertices()

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)

Parameters
[in]plantIDID of the plant instance.
[in]filenameName/path of the output file.

Definition at line 3896 of file PlantArchitecture.cpp.

◆ writePlantStructureXML()

void PlantArchitecture::writePlantStructureXML ( uint  plantID,
const std::string &  filename 
) const

Writes the structure of a plant instance to an XML file.

Parameters
[in]plantIDThe unique identifier for the plant instance.
[in]filenamePath to the XML file where the plant structure will be saved.
Note
The function checks if the plant instance exists and if the output file path is valid and writable. Errors related to invalid plant ID or file issues will throw exceptions.

Definition at line 444 of file InputOutput.cpp.

◆ writeQSMCylinderFile()

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.

Parameters
[in]plantIDIdentifier of the plant to export.
[in]filenamePath to the output file (typically .txt extension).
Exceptions
helios::runtime_errorThrows an error if the plant ID does not exist or if the file cannot be opened.
Note
The output follows the TreeQSM format (Raumonen et al., 2013) with tab-separated values.

Definition at line 666 of file InputOutput.cpp.

Friends And Related Symbol Documentation

◆ Phytomer

friend struct Phytomer
friend

Definition at line 2959 of file PlantArchitecture.h.

◆ Shoot

friend struct Shoot
friend

Definition at line 2960 of file PlantArchitecture.h.


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