20#ifndef PADS_UNIT_CONVERTER_H
21#define PADS_UNIT_CONVERTER_H
125 static std::optional<PADS_UNIT_TYPE>
ParseUnitCode(
const std::string& aUnitCode );
static constexpr double MILS_TO_NM
double GetBasicUnitsScale() const
Get the current BASIC units scale.
static constexpr double INCHES_TO_NM
std::vector< PADS_UNIT_TYPE > m_unitOverrideStack
bool IsBasicUnitsMode() const
Check if BASIC units mode is enabled.
size_t GetOverrideDepth() const
Get the current override depth.
void SetBaseUnits(PADS_UNIT_TYPE aUnitType)
Set the base units for conversion.
bool PushUnitOverride(const std::string &aUnitCode)
Push a unit override onto the stack.
static constexpr double BASIC_TO_NM
PADS_UNIT_TYPE m_unitType
void SetBasicUnitsMode(bool aEnabled)
Enable or disable BASIC units mode.
int64_t ToNanometersSize(double aValue) const
Convert a size value to nanometers.
bool ParseFileHeader(const std::string &aHeader)
Parse a PADS file header string and configure units accordingly.
static std::optional< PADS_UNIT_TYPE > ParseUnitCode(const std::string &aUnitCode)
Parse a PADS unit code and return the corresponding unit type.
PADS_UNIT_TYPE GetUnitType() const
Get the current unit type.
static constexpr double MM_TO_NM
void SetBasicUnitsScale(double aScale)
Set a custom scale for BASIC units.
void PopUnitOverride()
Pop the most recent unit override from the stack.
int64_t ToNanometers(double aValue) const
Convert a coordinate value to nanometers.
bool HasUnitOverride() const
Check if any unit overrides are currently active.
PADS_UNIT_TYPE
Unit types supported by PADS file formats.