PTMeasurementScale

@interface PTMeasurementScale : NSObject <NSCoding>

A PTMeasurementScale is used to describe a measurement’s conversion factors.

  • Initializes a new instance of the class.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithBaseValue:(CGFloat)baseValue
                                     baseUnit:(nonnull NSString *)baseUnit
                               translateValue:(CGFloat)translateValue
                                translateUnit:(nonnull NSString *)translateUnit
                                    precision:(int)precision;

    Swift

    init(baseValue: CGFloat, baseUnit: String, translateValue: CGFloat, translateUnit: String, precision: Int32)

    Parameters

    baseValue

    The base conversion value in document space.

  • The base value of the conversion. This is in document space.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CGFloat baseValue;

    Swift

    var baseValue: CGFloat { get set }
  • The units of the base value.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull baseUnit;

    Swift

    var baseUnit: String { get set }
  • The translation value of the conversion. This is in world space.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CGFloat translateValue;

    Swift

    var translateValue: CGFloat { get set }
  • The units of the translation value.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull translateUnit;

    Swift

    var translateUnit: String { get set }
  • The precision with which to display the measurement.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) int precision;

    Swift

    var precision: Int32 { get set }