lob 0.3.0
 
All Classes Namespaces Files Functions Variables Pages
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 ()
 
 ~Builder ()
 Default constructor.
 
 Builder (const Builder &other)
 Default destructor.
 
 Builder (Builder &&other) noexcept
 Copy constructor.
 
Builderoperator= (const Builder &rhs)
 Move constructor.
 
Builderoperator= (Builder &&rhs) noexcept
 Copy assignment constructor.
 
BuilderBallisticCoefficientPsi (float value)
 Move assignment constructor.
 
BuilderBCAtmosphere (AtmosphereReferenceT type)
 Sets the atmosphere reference associated with ballistic coefficient.
 
BuilderBCDragFunction (DragFunctionT type)
 Sets the drag function associated with ballistic coefficient.
 
BuilderDiameterInch (float value)
 Sets the projectile diameter (caliber) in inches.
 
BuilderMeplatDiameterInch (float value)
 Sets the projectile meplat diameter in inches.
 
BuilderBaseDiameterInch (float value)
 Sets the projectile base diameter in inches.
 
BuilderLengthInch (float value)
 Sets the projectile length in inches.
 
BuilderNoseLengthInch (float value)
 Sets the projectile nose length in inches.
 
BuilderTailLengthInch (float value)
 Sets the projectile tail length in inches.
 
BuilderOgiveRtR (float 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 (float value)
 Sets the projectile mass in grains.
 
BuilderInitialVelocityFps (uint16_t value)
 Sets the initial velocity of the projectile in feet per second.
 
BuilderOpticHeightInches (float value)
 Sets the height of the optic above the bore in inches.
 
BuilderTwistInchesPerTurn (float value)
 Sets the twist rate of the barrel in inches per turn.
 
BuilderZeroAngleMOA (float value)
 Sets the angle between the sight and launch angle used to achieve zero.
 
BuilderZeroDistanceYds (float value)
 Sets the zero distance in yards.
 
BuilderZeroImpactHeightInches (float value)
 Sets the zero impact height in inches.
 
BuilderAltitudeOfFiringSiteFt (float value)
 Sets the altitude of the firing site in feet.
 
BuilderAirPressureInHg (float value)
 Sets the air pressure in inches of mercury (inHg).
 
BuilderAltitudeOfBarometerFt (float value)
 Sets the altitude of the location where air pressure was taken in feet.
 
BuilderTemperatureDegF (float value)
 Sets the temperature in degrees Fahrenheit.
 
BuilderAltitudeOfThermometerFt (float value)
 Sets the altitude of the location where temperature was taken in feet.
 
BuilderRelativeHumidityPercent (float value)
 Sets the relative humidity at the firing site in percent.
 
BuilderWindHeading (ClockAngleT value)
 Sets the wind heading using a clock angle.
 
BuilderWindHeadingDeg (float value)
 Sets the wind heading in degrees.
 
BuilderWindSpeedFps (float value)
 Sets the wind speed in feet per second.
 
BuilderWindSpeedMph (float value)
 Sets the wind speed in miles per hour.
 
BuilderAzimuthDeg (float value)
 Sets the azimuth (bearing) of the target in degrees.
 
BuilderLatitudeDeg (float value)
 Sets the latitude of the firing location in degrees.
 
BuilderRangeAngleDeg (float value)
 Sets the range angle (inclination) to the target in degrees.
 
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 ( )

◆ ~Builder()

lob::Builder::~Builder ( )

Default constructor.

◆ Builder() [2/3]

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

Default destructor.

◆ Builder() [3/3]

lob::Builder::Builder ( Builder && other)
noexcept

Copy constructor.

Member Function Documentation

◆ AirPressureInHg()

Builder & lob::Builder::AirPressureInHg ( float value)

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 ( float value)

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

Note
This only has an effect if the airpressure 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 ( float value)

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 ( float value)

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 ( float value)

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 ( float value)

Move assignment constructor.

Sets the ballistic coefficient (Psi).

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

◆ BaseDiameterInch()

Builder & lob::Builder::BaseDiameterInch ( float value)

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)

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)

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

Builds the Input object with the configured parameters.

Returns
The constructed Input object.

◆ DiameterInch()

Builder & lob::Builder::DiameterInch ( float value)

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)

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 ( float value)

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 ( float value)

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 )

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
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 ( float value)

Sets the projectile mass in grains.

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

◆ MeplatDiameterInch()

Builder & lob::Builder::MeplatDiameterInch ( float value)

Sets the projectile meplat diameter in inches.

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

◆ NoseLengthInch()

Builder & lob::Builder::NoseLengthInch ( float value)

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 ( float value)

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

Copy assignment constructor.

◆ operator=() [2/2]

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

Move constructor.

◆ OpticHeightInches()

Builder & lob::Builder::OpticHeightInches ( float value)

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 ( float value)

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 ( float value)

Sets the relative humidity at the firing site in percent.

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

◆ TailLengthInch()

Builder & lob::Builder::TailLengthInch ( float value)

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 ( float value)

Sets the temperature in degrees Fahrenheit.

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

◆ TwistInchesPerTurn()

Builder & lob::Builder::TwistInchesPerTurn ( float value)

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)

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 ( float value)

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 ( float value)

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 ( float value)

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 ( float value)

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 ( float value)

Sets the zero distance in yards.

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

◆ ZeroImpactHeightInches()

Builder & lob::Builder::ZeroImpactHeightInches ( float value)

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: