BimCT SDK / WebGL2 Viewer
    Preparing search index...

    Class Measurement

    Represents a measurement with various settings and properties.

    Index

    Accessors

    Methods

    Accessors

    • get userObject(): any

      Returns any

    • set userObject(userObject: any): void

      Parameters

      • userObject: any

      Returns void

    • get groupId(): any

      Returns any

    • set groupId(groupId: any): void

      Parameters

      • groupId: any

      Returns void

    • get height(): number

      Returns number

    • set height(height: number): void

      Parameters

      • height: number

      Returns void

    • get thickness(): number

      Returns number

    • set thickness(thickness: number): void

      Parameters

      • thickness: number

      Returns void

    • get widgetVisible(): boolean

      Returns boolean

    • set widgetVisible(visible: boolean): void

      Parameters

      • visible: boolean

      Returns void

    • get extrusionVisible(): boolean

      Returns boolean

    • get id(): Int64

      Gets the unique identifier of the measurement.

      Returns Int64

      The unique identifier of the measurement.

    • get extrusionId(): Int64

      Returns Int64

    • get color(): RGB

      Gets the color of the measurement.

      Returns RGB

      The color of the measurement.

    • get pointColor(): RGB

      Gets the point color of the measurement.

      Returns RGB

      The point color of the measurement.

    • get pattern(): BIM_MEASUREMENT2D_FILL_PATTERN

      Gets the pattern of the measurement.

      Returns BIM_MEASUREMENT2D_FILL_PATTERN

      The pattern of the measurement.

    • get pointIds(): number[]

      Gets the point IDs of the measurement.

      Returns number[]

      The point IDs of the measurement.

    • get type(): MEASUREMENT_TYPE

      Gets the type of the measurement.

      Returns MEASUREMENT_TYPE

      The type of the measurement.

    • get highlighted(): boolean

      Gets whether the measurement is highlighted.

      Returns boolean

      Whether the measurement is highlighted.

    • get negative(): boolean

      Gets whether the measurement is negative.

      Returns boolean

      Whether the measurement is negative.

    • set negative(negative: boolean): void

      Sets whether the measurement is negative.

      Parameters

      • negative: boolean

        Whether the measurement is negative.

      Returns void

    • get elementId(): Int64

      Gets the element ID associated with the measurement.

      Returns Int64

      The element ID associated with the measurement.

    • set elementId(elementId: Int64): void

      Sets the element ID associated with the measurement.

      Parameters

      • elementId: Int64

        The element ID to set.

      Returns void

    Methods

    • Returns void

    • Sets the color of the measurement.

      Parameters

      • color: RGB

        The color to set.

      • OptionalpointColor: RGB

        Optional point color to set.

      Returns Promise<void>

    • Sets the draw order of the measurement.

      Parameters

      • order: number

        The draw order to set.

      Returns Promise<void>

    • Gets if the measurement is negative.

      Returns boolean

    • Gets the isometric lengths of the measurement.

      Returns number[]

      The isometric lengths of the measurement.

    • Gets the segment lengths of the measurement.

      Returns Promise<number[]>

      The segment lengths of the measurement.

    • Parameters

      Returns Promise<void>

    • Parameters

      • x: number
      • y: number

      Returns boolean

    • Parameters

      • visible: boolean

      Returns Promise<void>

    • Parameters

      • region: Rectangle
      • partial: boolean

      Returns boolean

    • Returns void

    • Returns boolean

    • Returns Promise<boolean>

    • Parameters

      • includeArcPoints: boolean = false

      Returns Promise<Vector3D[]>

    • Sets the isometric lengths of the measurement.

      Parameters

      • lengths: number[]

        The isometric lengths to set.

      Returns Promise<void>

    • Finds the element ID in faces.

      Returns Promise<Int64>

      A promise that resolves to the element ID in faces.

    • Checks if the measurement is closed.

      Returns boolean

      Whether the measurement is closed.

    • Sets whether the measurement is closed.

      Parameters

      • closed: boolean

        Whether the measurement is closed.

      Returns void

    • Closes the measurement.

      Parameters

      • closeIfLength: boolean

        Whether to close if length is present.

      Returns Promise<false | BR_FunctionOutput>

      A promise that resolves to a boolean indicating success or failure.

    • Clears the labels of the measurement.

      Returns void

    • Reconstructs the labels of the measurement.

      Returns Promise<void>

    • Updates the labels of the measurement.

      Returns Promise<boolean>

    • Gets the number of points in the measurement.

      Returns number

      The number of points in the measurement.

    • Gets the first point ID in the measurement.

      Returns number

      The first point ID in the measurement.

    • Gets the last point ID in the measurement.

      Returns number

      The last point ID in the measurement.

    • Gets the previous point ID of a given point ID.

      Parameters

      • point_id: number

        The point ID to find the previous point for.

      Returns Promise<number>

      A promise that resolves to the previous point ID.

    • Returns Promise<number>

    • Gets the last line points and their lenght

      Returns Promise<CustomScale>

      A promise that resolves to an object containing the last line.

    • Gets the 3D coordinates of the arc point.

      Returns Vector3D

      The 3D coordinates of the arc point.

    • Clears the 3D coordinates of the arc point.

      Returns void

    • Adds a 3D arc point to the measurement.

      Parameters

      • x: number

        The x-coordinate of the arc point.

      • y: number

        The y-coordinate of the arc point.

      • z: number

        The z-coordinate of the arc point.

      • useElevation: boolean

        Whether to use elevation for the arc point.

      • faceId: Int64 = null

        Optional face ID associated with the arc point.

      Returns Promise<boolean>

      A promise that resolves to a boolean indicating success or failure.

    • Terminates the 3D arc point.

      Returns Promise<void>

    • Adds a 3D point to the measurement.

      Parameters

      • x: number

        The x-coordinate of the point.

      • y: number

        The y-coordinate of the point.

      • z: number

        The z-coordinate of the point.

      • useElevation: boolean

        Whether to use elevation for the point.

      • faceId: Int64 = null

        Optional face ID associated with the point.

      • is_control: boolean = false

        Whether the point is a control point.

      • updateRender: boolean = true

      Returns Promise<number>

      A promise that resolves to the segment ID of the added point.

    • Adds a length override for the last point in the measurement.

      Parameters

      • length: number

        The length to override.

      Returns void

    • Sets the length of a segment point in the measurement.

      Parameters

      • pointId: number

        The point ID of the segment point.

      • length: number

        The length to set.

      Returns void

    • Isometric Lengtgs contain Lenght Overrides

      Returns boolean

      true if an isometric style measurement

    • Gets the dimensions of the last line image in the measurement.

      Returns Promise<{ x1: number; y1: number; x2: number; y2: number }>

      A promise that resolves to an object containing the dimensions of the last line image.

    • Gets the length of the closest segment point to the given coordinates.

      Parameters

      • x: number

        The x-coordinate.

      • y: number

        The y-coordinate.

      Returns Promise<{ pointId: number; length: number }>

      A promise that resolves to an object containing the point ID and length of the closest segment point.

    • Inserts a point into the measurement at the given coordinates.

      Parameters

      • x: number

        The x-coordinate of the point.

      • y: number

        The y-coordinate of the point.

      • faceId: Int64 = null

        Optional face ID associated with the point.

      • is_control: boolean = false

        Whether the point is a control point.

      Returns Promise<void>

    • Removes the last point from the measurement.

      Returns Promise<void>

    • Deletes the current point in the measurement.

      Returns Promise<boolean>

      A promise that resolves to a boolean indicating success or failure.

    • Deletes a point in the measurement at the given screen coordinates.

      Parameters

      • screenX: number

        The x-coordinate of the screen.

      • screenY: number

        The y-coordinate of the screen.

      Returns Promise<boolean>

      A promise that resolves to a boolean indicating success or failure.

    • Parameters

      • pointId: number

      Returns Promise<boolean>

    • Destroys the measurement.

      Returns Promise<void>

    • Moves the measurement to the specified offset.

      Parameters

      • offset: SceneOffset

        The offset to move the measurement to.

      Returns Promise<void>

    • Moves the current point in the measurement to the specified 3D coordinates.

      Parameters

      • x: number

        The x-coordinate to move the point to.

      • y: number

        The y-coordinate to move the point to.

      • z: number

        The z-coordinate to move the point to.

      Returns Promise<boolean>

      A promise that resolves to a boolean indicating success or failure.

    • Moves the current point in the measurement to the specified screen coordinates.

      Parameters

      • screenX: number

        The x-coordinate of the screen.

      • screenY: number

        The y-coordinate of the screen.

      • OptionaldegreeSnapping: boolean

        Optional degree snapping flag.

      Returns Promise<void>

    • Moves the current segment in the measurement to the specified coordinates.

      Parameters

      • x: number

        The x-coordinate to move the segment to.

      • y: number

        The y-coordinate to move the segment to.

      Returns Promise<boolean>

      A promise that resolves to a boolean indicating success or failure.

    • Sets the current point in the measurement to the point at the specified screen coordinates.

      Parameters

      • screenX: number

        The x-coordinate of the screen.

      • screenY: number

        The y-coordinate of the screen.

      Returns Promise<boolean>

      A promise that resolves to a boolean indicating success or failure.

    • Sets the current point in the measurement to the first point.

      Returns Promise<boolean>

      A promise that resolves to a boolean indicating success or failure.

    • Gets the current point ID in the measurement.

      Returns number

      The current point ID in the measurement.

    • Gets the point at the specified index.

      Parameters

      • index: number

        The index of the point to retrieve.

      Returns Promise<Vector3D>

      A promise that resolves to the point at the specified index, or null if not found.

    • Gets the current point in the measurement.

      Returns Promise<Vector3D>

      A promise that resolves to the current point in the measurement.

    • Gets the points of the current segment in the measurement.

      Returns Promise<Vector3D[]>

      A promise that resolves to an array of points in the current segment.

    • Checks if the specified screen coordinates are over a point in the measurement.

      Parameters

      • screenX: number

        The x-coordinate of the screen.

      • screenY: number

        The y-coordinate of the screen.

      Returns Promise<boolean>

      A promise that resolves to a boolean indicating whether the coordinates are over a point.

    • Checks if the specified screen coordinates are over a segment in the measurement.

      Parameters

      • screenX: number

        The x-coordinate of the screen.

      • screenY: number

        The y-coordinate of the screen.

      Returns Promise<boolean>

      A promise that resolves to a boolean indicating whether the coordinates are over a segment.

    • Moves the points of the current segment in the measurement to the specified coordinates.

      Parameters

      Returns Promise<boolean>

      A promise that resolves to a boolean indicating success or failure.

    • Computes the perpendicular points on a line, excluding a specified point.

      Parameters

      • lineData: number[]

        The line data.

      • pointToExclude: number

        The point to exclude.

      • skipCurrentPoint: boolean

        Whether to skip the current point.

      Returns Promise<Vector3D[]>

      A promise that resolves to an array of perpendicular points.

    • Computes the perpendicular points on a line.

      Parameters

      • lineData: number[]

        The line data.

      • skipCurrentPoint: boolean

        Whether to skip the current point.

      Returns Promise<Vector3D[]>

      A promise that resolves to an array of perpendicular points.

    • Sets whether the measurement is highlighted.

      Parameters

      • highlighted: boolean

        Whether the measurement is highlighted.

      • force: boolean = false

        Optional flag to force the update.

      Returns Promise<void>

    • Gets the total area of the measurement in square meters.

      Returns Promise<number>

      A promise that resolves to the total area in square meters.

    • Gets the total area of the measurement in square millimeters.

      Parameters

      • extraPoint: Vector3D = null

        Optional extra point to include in the calculation.

      Returns Promise<number>

      A promise that resolves to the total area in square millimeters.

    • Gets the total length of the measurement in meters.

      Returns Promise<number>

      A promise that resolves to the total length in meters.

    • Gets the total length of the measurement in millimeters.

      Parameters

      • extraPoint: Vector3D = null

        Optional extra point to include in the calculation.

      Returns Promise<number>

      A promise that resolves to the total length in millimeters.

    • Parameters

      • opacity: number

      Returns Promise<void>

    • Returns Promise<void>

    • Checks if the measurement contains a point with the specified coordinates.

      Parameters

      • xe: number

        The x-coordinate of the point.

      • ye: number

        The y-coordinate of the point.

      • ze: number

        The z-coordinate of the point.

      Returns Promise<number>

      A promise that resolves to the point ID if the point is found, or -1 if not found.

    • Checks if a point is accepted for addition to the measurement.

      Parameters

      • cur_point_id: number

        The current point ID.

      Returns Promise<boolean>

      A promise that resolves to a boolean indicating whether the point is accepted for addition.

    • Gets the pixel center of the measurement.

      Returns Promise<Point2D>

      A promise that resolves to the pixel center of the measurement.

    • Gets the face ID associated with a point in the measurement.

      Parameters

      • pointId: number

        The point ID.

      Returns Int64

      The face ID associated with the point.

    • Finds or updates the normal vector behind the measurement.

      Parameters

      • doUpdate: boolean = true

        Optional flag to force the update.

      Returns Promise<Vector3D>

      A promise that resolves to the normal vector.

    • Calculates the normal vector from the object behind the specified screen coordinates.

      Parameters

      • screenX: number

        The x-coordinate on the screen.

      • screenY: number

        The y-coordinate on the screen.

      Returns Promise<Vector3D>

      A promise that resolves to the normal vector, or null if not found.

    • Parameters

      Returns void

    • Returns Vector3D

    • Gets the bounding box of the measurement.

      Returns Promise<BoundingBox3D>

      A promise that resolves to the bounding box of the measurement.

    • Gets the rectangle of the measurement.

      Returns Promise<Rectangle>

      A promise that resolves to the rectangle of the measurement.

    • Gets the data of the measurement.

      Returns Promise<string>

      A promise that resolves to the data of the measurement.