new SeasonalVariation(config)
Creates a new seasonal variation data object.
Parameters:
| Name | Type | Description |
|---|---|---|
config |
object | An optional configuration object. |
Members
-
:number
colorFadeEnd
-
The number of days after the start of autumn that the foliage color has changed, defaults to 61.
Type
- number
-
:number
colorFadeStart
-
The number of days after the start of autumn that the foliage color starts to change, defaults to 14.
Type
- number
-
:boolean
isSeasonalVariation <readonly>
-
A flag identifying this object as a seasonal variation instance.
Type
- boolean
-
:number
leafDropEnd
-
The number of days after the start of autumn that there are no leaves left, defaults to 91.
Type
- number
-
:number
leafDropStart
-
The number of days after the start of autumn that leaves beginning to fall, defaults to 45.
Type
- number
-
:number
regrowthEnd
-
The number of days after the start of spring that the foliage is completely regrown, defaults to 75.
Type
- number
-
:number
regrowthStart
-
The number of days after the start of spring that foliage begins to regrow, defaults to 14.
Type
- number
-
:object
summer
-
Defines the state of the tree at the height of summer.
Type
- object
Properties:
Name Type Description shadingnumber The fractional shading offered by the canopy in summer (0 to 1), defaults to 1.
variegationnumber The fraction of variegation in foliage color in summer (0 to 1), defaults to 0.25.
foliageColornumber The base color of the canopy foliage in summer as a hexadecimal number, defaults to 0x008000.
variegeColornumber The variegation color of the foliage in summer as a hexadecimal number, defaults to 0xCCFF00.
trunkColornumber The color of the tree trunk in summer as a hexadecimal number, defaults to 0x663300.
-
:object
winter
-
Defines the state of the tree the height of winter.
Type
- object
Properties:
Name Type Description shadingnumber The fractional shading offered by the canopy in winter (0 to 1), defaults to 1.
variegationnumber The fraction of variegation in foliage color in winter (0 to 1), defaults to 0.25.
foliageColornumber The base color of the canopy foliage in winter as a hexadecimal number, defaults to 0x8C3304.
variegeColornumber The variegation color of the foliage in winter as a hexadecimal number, defaults to 0xFFA800.
trunkColornumber The color of the tree trunk in winter as a hexadecimal number, defaults to 0x663300.
Methods
-
fromJSON(data)
-
Safely copy properties from a source object.
See the
PD.Base#fromJSONmethod for more details.Parameters:
Name Type Description dataobject The source object containing data to copy.
Returns:
Returns this instance to support method chaining.
- Type
- BIM.Component
-
fromJSON_toSeason(source, recipient)
-
Safely copy properties from source to destination object.
Parameters:
Name Type Description sourceobject The source object containing data to copy.
recipientobject The destination object to copy the data to.
Returns:
Returns this instance to support method chaining.
- Type
- BIM.Component
-
interpolatePlantParams(plant [, datetime] [, location])
-
Interpolates between seasonal states and checks if the tree needs updating.
Parameters:
Name Type Argument Description plantBIM.Plant The plant/tree to interpolate parameters for.
datetimePD.DateTime <optional>
The date and time to compute data for, defaults to
PD.GlobalState.dateTime.locationPD.Location <optional>
The location to compute data for, defaults to
PD.GlobalState.location.Returns:
Returns true if the tree needs updating due to changing colors.
- Type
- boolean
-
toJSON( [data])
-
Converts the object instance to a simple POJO for JSON storage.
This method is used to copy, store and save the data for ths object, so the returned object must have all the properties required be able to rebuild this instance in its entirety when passed to the class constructor.
See the
PD.Base#toJSONmethod for more details.Parameters:
Name Type Argument Description dataobject <optional>
An optional parent object to append this data to.
Returns:
Returns a JSON object.
- Type
- object