# View Interfaces

# UnitMeasureFormatter

Parses and formats measurements.

Possible Units:

  • InchFeet
  • MM
  • CM
  • Inch
  • Feet

Possible Formats:

  • NoUnit: plain number
  • LongUnit: mm, cm or ft/inch
  • ShortUnit: mm, cm or ' / "

Possible Options:

  • showExactValue(bool) -> default: false
    • Defines if values should be represented in exaxt format or rounded
  • setMaxPrecision(int) -> default: 6
    • Sets the maximum precision for values
    • Only relevant if showExactValue is set to true
  • showFractionalValues(bool) -> default false
    • Defines if values should be output as fractional or decimal values
      • Only available for inch and feet values
      • If this is set to true and another unit-type (MM,CM or even InchFeet) is present this setting simply gets ignored and will always result in decimal value representation

With the init() function custom labels for the different units and formats may be provided. See more in the interface description documentation.

# Parsing

First ',' are converted to '.' . Then everything not number or '.' is replaced by whitespace.

For inchfeet when two (or more) blocks of numbers (seperated by whitespace) are found, the first is interpreted as feet, the second as inch.

For metric only the first block of numbers (until the first whitespace) is parse into a float.

When parsing fractional values it is necessary to provide the correct unit-type. If an inch value gets parsed with the unit-type set to feet it gets interpreted as feet and so leads to wrong conversion results.

# PlanModelViewHelper

Helper class for different aggregations and calculations which are not part of the core but convenient for the view.

# getPlanOverview

Assembles an overview of whats currently in the Plan containing:

  • area : total area of the plan
  • bounds: bounding box of the plan
  • objects: list of all objects in the plan
  • outsideWalls: Areas of outside walls combined by used material
  • rooms: list of all rooms in the plan

Each room containing

  • area
  • bounds
  • floorMaterial
  • walls : areas of inside walls combined by used material
  • objects: the objects in the room including doors and windows on the walls of the rooms

Each object provides the following data:

  • dimensions
  • center
  • customColor (if set)
  • customLabel (if set)
  • rotation in radiant
  • catalogItemId (if a static item)
  • configuration (if a configurable item)
  • configurationHash (if configurable)
  • parts : the partlist for this configuration (if configurable)