lob 0.8.0
 
Loading...
Searching...
No Matches
lob::Builder Class Reference

Builder class for constructing Input objects with a friendly interface. More...

#include <lob.hpp>

Public Member Functions

 Builder ()
 Default constructor.
 
 ~Builder ()
 Destructor.
 
 Builder (const Builder &other)
 
 Builder (Builder &&other) noexcept
 
Builderoperator= (const Builder &rhs)
 Copy assignment operator.
 
Builderoperator= (Builder &&rhs) noexcept
 Move assignment operator.
 
BuilderBallisticCoefficientPsi (double value)
 Sets the ballistic coefficient (Psi).
 
BuilderBCAtmosphere (AtmosphereReferenceT type)
 Sets the atmosphere reference associated with ballistic coefficient.
 
BuilderBCDragFunction (DragFunctionT type)
 Sets the drag function associated with ballistic coefficient.
 
BuilderDiameterInch (double value)
 Sets the projectile diameter (caliber) in inches.
 
BuilderMeplatDiameterInch (double value)
 Sets the projectile meplat diameter in inches.
 
BuilderBaseDiameterInch (double value)
 Sets the projectile base diameter in inches.
 
BuilderLengthInch (double value)
 Sets the projectile length in inches.
 
BuilderNoseLengthInch (double value)
 Sets the projectile nose length in inches.
 
BuilderTailLengthInch (double value)
 Sets the projectile tail length in inches.
 
BuilderOgiveRtR (double value)
 Sets the Rt/R ratio of the projectile ogive.
 
BuilderMachVsDragTable (const float *pmachs, const float *pdrags, size_t size)
 Loads a custom Mach vs Drag table for the projectile.
 
template<size_t N>
BuilderMachVsDragTable (const std::array< float, N > &machs, const std::array< float, N > &drags)
 Loads a custom Mach vs Drag table for the projectile.
 
BuilderMassGrains (double value)
 Sets the projectile mass in grains.
 
BuilderInitialVelocityFps (uint16_t value)
 Sets the initial velocity of the projectile in feet per second.
 
BuilderOpticHeightInches (double value)
 Sets the height of the optic above the bore in inches.
 
BuilderTwistInchesPerTurn (double value)
 Sets the twist rate of the barrel in inches per turn.
 
BuilderZeroAngleMOA (double value)
 Sets the angle between the sight and launch angle used to achieve zero.
 
BuilderZeroDistanceYds (double value)
 Sets the zero distance in yards.
 
BuilderZeroImpactHeightInches (double value)
 Sets the zero impact height in inches.
 
BuilderAltitudeOfFiringSiteFt (double value)
 Sets the altitude of the firing site in feet.
 
BuilderAirPressureInHg (double value)
 Sets the air pressure in inches of mercury (inHg).
 
BuilderAltitudeOfBarometerFt (double value)
 Sets the altitude of the location where air pressure was taken in feet.
 
BuilderTemperatureDegF (double value)
 Sets the temperature in degrees Fahrenheit.
 
BuilderAltitudeOfThermometerFt (double value)
 Sets the altitude of the location where temperature was taken in feet.
 
BuilderRelativeHumidityPercent (double value)
 Sets the relative humidity at the firing site in percent.
 
BuilderWindHeading (ClockAngleT value)
 Sets the wind heading using a clock angle.
 
BuilderWindHeadingDeg (double value)
 Sets the wind heading in degrees.
 
BuilderWindSpeedFps (double value)
 Sets the wind speed in feet per second.
 
BuilderWindSpeedMph (double value)
 Sets the wind speed in miles per hour.
 
BuilderAzimuthDeg (double value)
 Sets the azimuth (bearing) of the target in degrees.
 
BuilderLatitudeDeg (double value)
 Sets the latitude of the firing location in degrees.
 
BuilderRangeAngleDeg (double value)
 Sets the range angle (inclination) to the target in degrees.
 
BuilderMinimumSpeed (uint16_t value)
 Sets the minimum speed threshold for the solver.
 
BuilderMinimumEnergy (uint16_t value)
 Sets the minimum energy threshold for the solver.
 
BuilderMaximumTime (double value)
 Sets the maximum time of flight for the solver.
 
BuilderStepSize (uint16_t value)
 Sets the step size for the numerical solver.
 
BuilderReset () noexcept
 Resets the builder state by re-initializing.
 
Input Build ()
 Builds the Input object with the configured parameters.
 

Detailed Description

Builder class for constructing Input objects with a friendly interface.

Constructor & Destructor Documentation

◆ Builder() [1/3]

lob::Builder::Builder ( )
inline

Default constructor.

◆ ~Builder()

lob::Builder::~Builder ( )
inline

Destructor.

◆ Builder() [2/3]

lob::Builder::Builder ( const Builder & other)
inline

<Copy constructor

◆ Builder() [3/3]

lob::Builder::Builder ( Builder && other)
inlinenoexcept

<Move constructor

Member Function Documentation

◆ AirPressureInHg()

Builder & lob::Builder::AirPressureInHg ( double value)
inline

Sets the air pressure in inches of mercury (inHg).

Parameters
valueThe air pressure in inHg.
Returns
A reference to the Builder object.

◆ AltitudeOfBarometerFt()

Builder & lob::Builder::AltitudeOfBarometerFt ( double value)
inline

Sets the altitude of the location where air pressure was taken in feet.

Note
This only has an effect if the air pressure was taken from a site other than the firing site with a different altitude such as a nearby weather station.
Parameters
valueThe altitude in feet.
Returns
A reference to the Builder object.

◆ AltitudeOfFiringSiteFt()

Builder & lob::Builder::AltitudeOfFiringSiteFt ( double value)
inline

Sets the altitude of the firing site in feet.

Parameters
valueThe altitude in feet.
Returns
A reference to the Builder object.

◆ AltitudeOfThermometerFt()

Builder & lob::Builder::AltitudeOfThermometerFt ( double value)
inline

Sets the altitude of the location where temperature was taken in feet.

Note
This only has an effect if the temperature was taken from a site other than the firing site with a different altitude such as a nearby weather station.
Parameters
valueThe altitude in feet.
Returns
A reference to the Builder object.

◆ AzimuthDeg()

Builder & lob::Builder::AzimuthDeg ( double value)
inline

Sets the azimuth (bearing) of the target in degrees.

Note
Used for making coriolis effect corrections.
Parameters
valueThe azimuth in degrees.
Returns
A reference to the Builder object.

◆ BallisticCoefficientPsi()

Builder & lob::Builder::BallisticCoefficientPsi ( double value)
inline

Sets the ballistic coefficient (Psi).

Parameters
valueThe ballistic coefficient value.
Returns
A reference to the Builder object.

◆ BaseDiameterInch()

Builder & lob::Builder::BaseDiameterInch ( double value)
inline

Sets the projectile base diameter in inches.

Parameters
valueThe base diameter in inches.
Returns
A reference to the Builder object.

◆ BCAtmosphere()

Builder & lob::Builder::BCAtmosphere ( AtmosphereReferenceT type)
inline

Sets the atmosphere reference associated with ballistic coefficient.

Parameters
typeThe atmosphere reference type.
Returns
A reference to the Builder object.

◆ BCDragFunction()

Builder & lob::Builder::BCDragFunction ( DragFunctionT type)
inline

Sets the drag function associated with ballistic coefficient.

Parameters
typeThe drag function type.
Returns
A reference to the Builder object.

◆ Build()

Input lob::Builder::Build ( )
inline

Builds the Input object with the configured parameters.

Returns
The constructed Input object.

◆ DiameterInch()

Builder & lob::Builder::DiameterInch ( double value)
inline

Sets the projectile diameter (caliber) in inches.

Parameters
valueThe diameter in inches.
Returns
A reference to the Builder object.

◆ InitialVelocityFps()

Builder & lob::Builder::InitialVelocityFps ( uint16_t value)
inline

Sets the initial velocity of the projectile in feet per second.

Parameters
valueThe initial velocity in fps.
Returns
A reference to the Builder object.

◆ LatitudeDeg()

Builder & lob::Builder::LatitudeDeg ( double value)
inline

Sets the latitude of the firing location in degrees.

Note
Used for making coriolis effect corrections.
Parameters
valueThe latitude in degrees.
Returns
A reference to the Builder object.

◆ LengthInch()

Builder & lob::Builder::LengthInch ( double value)
inline

Sets the projectile length in inches.

Parameters
valueThe length in inches.
Returns
A reference to the Builder object.

◆ MachVsDragTable() [1/2]

Builder & lob::Builder::MachVsDragTable ( const float * pmachs,
const float * pdrags,
size_t size )
inline

Loads a custom Mach vs Drag table for the projectile.

Note
This is a direct alternative to using a ballistic coefficient and a reference drag function.
Parameters
pmachsPointer to an array of mach values.
pdragsPointer to an array of associated drag values.
sizeThe number of mach-drag pairs in the table.
Returns
A reference to the Builder object.

◆ MachVsDragTable() [2/2]

template<size_t N>
Builder & lob::Builder::MachVsDragTable ( const std::array< float, N > & machs,
const std::array< float, N > & drags )
inline

Loads a custom Mach vs Drag table for the projectile.

Note
This is a direct alternative to using a ballistic coefficient and a reference drag function.
Template Parameters
NThe number of mach-drag pairs in the table.
Parameters
machsReference to an array of mach values.
dragsReference to an array of associated drag values.
Returns
A reference to the Builder object.

◆ MassGrains()

Builder & lob::Builder::MassGrains ( double value)
inline

Sets the projectile mass in grains.

Parameters
valueThe mass in grains.
Returns
A reference to the Builder object.

◆ MaximumTime()

Builder & lob::Builder::MaximumTime ( double value)
inline

Sets the maximum time of flight for the solver.

Parameters
valueThe maximum time in seconds after which the solver will stop calculations.
Returns
A reference to the Builder object.

◆ MeplatDiameterInch()

Builder & lob::Builder::MeplatDiameterInch ( double value)
inline

Sets the projectile meplat diameter in inches.

Parameters
valueThe meplat in inches.
Returns
A reference to the Builder object.

◆ MinimumEnergy()

Builder & lob::Builder::MinimumEnergy ( uint16_t value)
inline

Sets the minimum energy threshold for the solver.

Parameters
valueThe minimum energy in foot-pounds (ft*lbf) at which the solver will stop calculations.
Returns
A reference to the Builder object.

◆ MinimumSpeed()

Builder & lob::Builder::MinimumSpeed ( uint16_t value)
inline

Sets the minimum speed threshold for the solver.

Parameters
valueThe minimum speed in feet per second (fps) at which the solver will stop calculations.
Returns
A reference to the Builder object.

◆ NoseLengthInch()

Builder & lob::Builder::NoseLengthInch ( double value)
inline

Sets the projectile nose length in inches.

Parameters
valueThe nose length in inches.
Returns
A reference to the Builder object.

◆ OgiveRtR()

Builder & lob::Builder::OgiveRtR ( double value)
inline

Sets the Rt/R ratio of the projectile ogive.

Parameters
valueThe Rt/R ratio.
Returns
A reference to the Builder object.

◆ operator=() [1/2]

Builder & lob::Builder::operator= ( Builder && rhs)
inlinenoexcept

Move assignment operator.

◆ operator=() [2/2]

Builder & lob::Builder::operator= ( const Builder & rhs)
inline

Copy assignment operator.

◆ OpticHeightInches()

Builder & lob::Builder::OpticHeightInches ( double value)
inline

Sets the height of the optic above the bore in inches.

Parameters
valueThe optic height in inches.
Returns
A reference to the Builder object.

◆ RangeAngleDeg()

Builder & lob::Builder::RangeAngleDeg ( double value)
inline

Sets the range angle (inclination) to the target in degrees.

Parameters
valueThe range angle in degrees.
Returns
A reference to the Builder object.

◆ RelativeHumidityPercent()

Builder & lob::Builder::RelativeHumidityPercent ( double value)
inline

Sets the relative humidity at the firing site in percent.

Parameters
valueThe relative humidity in percent.
Returns
A reference to the Builder object.

◆ Reset()

Builder & lob::Builder::Reset ( )
inlinenoexcept

Resets the builder state by re-initializing.

Returns
A reference to the Builder object.

◆ StepSize()

Builder & lob::Builder::StepSize ( uint16_t value)
inline

Sets the step size for the numerical solver.

Note
If set to zero the solver will use a variable step.
Parameters
valueThe time step size in microseconds used by the solver.
Returns
A reference to the Builder object.

◆ TailLengthInch()

Builder & lob::Builder::TailLengthInch ( double value)
inline

Sets the projectile tail length in inches.

Parameters
valueThe tail length in inches.
Returns
A reference to the Builder object.

◆ TemperatureDegF()

Builder & lob::Builder::TemperatureDegF ( double value)
inline

Sets the temperature in degrees Fahrenheit.

Parameters
valueThe temperature in degrees F.
Returns
A reference to the Builder object.

◆ TwistInchesPerTurn()

Builder & lob::Builder::TwistInchesPerTurn ( double value)
inline

Sets the twist rate of the barrel in inches per turn.

Note
Used to calculate adjustments for spin drift and aerodynamic jump.
Parameters
valueThe twist rate in inches per turn.
Returns
A reference to the Builder object.

◆ WindHeading()

Builder & lob::Builder::WindHeading ( ClockAngleT value)
inline

Sets the wind heading using a clock angle.

Note
Twelve O'Clock is pure tailwind, Six O'Clock is a pure headwind.
Parameters
valueThe wind heading as a clock angle.
Returns
A reference to the Builder object.

◆ WindHeadingDeg()

Builder & lob::Builder::WindHeadingDeg ( double value)
inline

Sets the wind heading in degrees.

Note
0 is pure tailwind, 180 is pure headwind.
Parameters
valueThe wind heading in degrees.
Returns
A reference to the Builder object.

◆ WindSpeedFps()

Builder & lob::Builder::WindSpeedFps ( double value)
inline

Sets the wind speed in feet per second.

Parameters
valueThe wind speed in fps.
Returns
A reference to the Builder object.

◆ WindSpeedMph()

Builder & lob::Builder::WindSpeedMph ( double value)
inline

Sets the wind speed in miles per hour.

Parameters
valueThe wind speed in mph.
Returns
A reference to the Builder object.

◆ ZeroAngleMOA()

Builder & lob::Builder::ZeroAngleMOA ( double value)
inline

Sets the angle between the sight and launch angle used to achieve zero.

Note
This is a portable zero value useful when firing conditions differ from zeroing conditions.
Parameters
valueThe zero angle in MOA.
Returns
A reference to the Builder object.

◆ ZeroDistanceYds()

Builder & lob::Builder::ZeroDistanceYds ( double value)
inline

Sets the zero distance in yards.

Parameters
valueThe zero distance in yards.
Returns
A reference to the Builder object.

◆ ZeroImpactHeightInches()

Builder & lob::Builder::ZeroImpactHeightInches ( double value)
inline

Sets the zero impact height in inches.

Note
This would be used if zeroing three inches high at 100 yards for example.
Parameters
valueThe zero impact height in inches.
Returns
A reference to the Builder object.

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