BimCT SDK / WebGL2 Viewer
    Preparing search index...

    Class SceneState

    Represents the state of a scene.

    Index

    Constructors

    Properties

    DEFAULT_LATITUDE: number = 38.009476
    DEFAULT_LONGITUDE: 23.794963
    DEFAULT_TIMEZONE: number = ...

    Accessors

    • get alignment(): WGS84Alignment

      Gets the alignment of the bounding box in WGS84 coordinates.

      Returns WGS84Alignment

    • get sceneOffset(): SceneOffset

      Gets the scene offset.

      Returns SceneOffset

      The scene offset.

    • get sceneDateTime(): Date

      Gets the scene date and time.

      Returns Date

      The scene date and time.

    • set sceneDateTime(d: Date): void

      Sets the scene date and time.

      Parameters

      • d: Date

        The scene date and time.

      Returns void

    • get defaultModelLocation(): ModelLocation

      Gets the default model location.

      Returns ModelLocation

      The default model location.

    • set defaultModelLocation(location: ModelLocation): void

      Sets the default model location.

      Parameters

      Returns void

    • get latitude(): number

      Gets the latitude.

      Returns number

      The latitude.

    • set latitude(lat: number): void

      Sets the latitude.

      Parameters

      • lat: number

        The latitude.

      Returns void

    • get longitude(): number

      Gets the longitude.

      Returns number

      The longitude.

    • set longitude(lon: number): void

      Sets the longitude.

      Parameters

      • lon: number

        The longitude.

      Returns void

    • get wgs84(): WGS84

      Gets the WGS84 coordinates ( latitude, longitude, elevation ).

      Returns WGS84

      The WGS84 coordinates.

    • get timezone(): number

      Gets the timezone.

      Returns number

      The timezone.

    • set timezone(timezone: number): void

      Sets the timezone.

      Parameters

      • timezone: number

        The timezone.

      Returns void

    • get elevation(): number

      Gets the elevation in meters.

      Returns number

      The elevation.

    • set elevation(elevation: number): void

      Sets the elevation.

      Parameters

      • elevation: number

        The elevation in meters.

      Returns void

    • get altitude(): number

      Gets the elevation in meters.

      Returns number

    • set altitude(heightAboveGround: number): void

      Sets the height above ground (the building height above ground). used for extruding the building from the ground or for calculating the height of the building and syncing with the ground terrain.

      Parameters

      • heightAboveGround: number

        The height above ground in meters

      Returns void

    • get angleToTrueNorth(): number

      Gets the angle to true north.

      Returns number

      The angle to true north.

    • set angleToTrueNorth(angleToTrueNorth: number): void

      Sets the angle to true north.

      Parameters

      • angleToTrueNorth: number

        The angle to true north.

      Returns void

    • get cloudsDegrees(): number

      Gets the clouds degrees.

      Returns number

      The clouds degrees.

    • set cloudsDegrees(cloudsDegrees: number): void

      Sets the clouds degrees.

      Parameters

      • cloudsDegrees: number

        The clouds degrees.

      Returns void

    • get models(): ModelInfo[]

      Gets the loaded models.

      Returns ModelInfo[]

      The loaded models.

    • get has2DModels(): boolean

      Checks if the scene contains any 2D models.

      Returns boolean

    • get elements(): ElementInfo[]

      Gets the elements of a model.

      Returns ElementInfo[]

    Methods

    • Registers a pattern texture.

      Parameters

      • renderer: BaseRenderer

        The renderer instance.

      • patternKey: string

        The pattern key.

      • color: string

        The color of the pattern.

      • fillPattern: FillPattern

        The fill pattern.

      Returns Promise<number>

      The texture ID.

    • Unregisters a pattern texture.

      Parameters

      • renderer: BaseRenderer

        The renderer instance.

      • _textureId: number

        The texture ID.

      • _textureName: string

        The texture name.

      Returns Promise<void>

    • Gets the shape associated with the given ID.

      Parameters

      • id: string

        The shape ID.

      Returns { shape: ShapeText; color: RGBA; elementId: Int64 }

      The shape associated with the ID, or undefined if not found.

    • Gets the extrusion associated with the given ID.

      Parameters

      • id: Int64

        The extrusion ID.

      Returns Measurement

      The extrusion associated with the ID, or undefined if not found.

    • Checks if there are any extrusions in the scene.

      Returns boolean

      Whether there are any extrusions in the scene.

    • Gets all extrusion IDs in the scene.

      Returns Int64[]

      All extrusion IDs in the scene.

    • Gets the measurement associated with the given extrusion ID.

      Parameters

      • id: Int64

        The extrusion ID.

      Returns Measurement

      The measurement associated with the extrusion ID, or undefined if not found.

    • Calculates the alignment of the bounding box in WGS84 coordinates.

      Parameters

      • OptionalbBox: BoundingBox3D

        The bounding box to align.

      • OptionalfirstPointCenter: boolean

        Whether to use the first point as the center.

      • OptionalrotateWGS84ToNorth: boolean

        Whether to rotate the WGS84 coordinates to true north.

      Returns WGS84Alignment

      The calculated alignment.

    • Checks if the scene contains point clouds.

      Returns boolean

      True if the scene contains point clouds, false otherwise.

    • Moves the scene time by the given seconds.

      Parameters

      • seconds: number

        Seconds to move the scene time by.

      Returns void

    • Moves the scene time by the given minutes.

      Parameters

      • minutes: number

        Minutes to move the scene time by.

      Returns void

    • Moves the clouds position by the given degrees.

      Parameters

      • degrees: number

        Degrees to move the clouds position by.

      Returns Promise<void>

    • Synchronizes the scene time with the current time.

      Parameters

      • withTimeZone: boolean = false

        If true, also sets the timezone to the current timezone.

      Returns void

    • Checks if the given element is a 2D element.

      Parameters

      Returns boolean

      True if the element is a 2D element, false otherwise.

    • Checks if the given element is a point cloud element.

      Parameters

      Returns boolean

      True if the element is a point cloud element, false otherwise.

    • Checks if the given paper ID is a 2D paper ID.

      Parameters

      • id: Int64

        The paper ID to check.

      Returns boolean

      True if the paper ID is a 2D paper ID, false otherwise.

    • Sets the paper ID for a given model ID.

      Parameters

      • modelId: Int64

        The model ID.

      • paperId: Int64

        The paper ID.

      Returns void

    • Gets the paper ID for a given model ID.

      Parameters

      • modelId: Int64

        The model ID.

      Returns Int64

      The paper ID for the model, or null if not found.

    • Gets all paper element IDs from all 2D models.

      Returns Int64[]

      All paper element IDs from all 2D models.

    • Excludes paper elements from selection.

      Parameters

      • IDS: number[] | Int64[]

        Array of Int64 or number IDs

      Returns void

    • Gets the model with the specified ID.

      Parameters

      • id: Int64

        The ID of the model to find.

      Returns ModelInfo

      The model with the specified ID, or null if not found.

    • Gets the model with the specified URL.

      Parameters

      • url: string

        The URL of the model to find.

      Returns ModelInfo

      The model with the specified URL, or null if not found.

    • Parameters

      Returns boolean

    • Gets the elements of a model.

      Returns boolean

      The elements of the model, or an empty array if none found.

    • Checks if the given internal ID belongs to a splitted element.

      Parameters

      • internalId: Int64

        The internal ID of the element to check.

      Returns boolean

      True if the element is splitted, false otherwise.

    • Checks if the given internal ID belongs to a splitted element part.

      Parameters

      • internalId: Int64

        The internal ID of the element to check.

      Returns boolean

      True if the element is a part of a splitted element, false otherwise.

    • Returns the model ID of the splitted element part with the given internal ID.

      Parameters

      • internalId: Int64

        The internal ID of the element to get.

      Returns Int64

      The model ID of the splitted element part with the given internal ID, or null if not found.

    • Returns the original model ID of the splitted element part with the given internal ID.

      Parameters

      • internalId: Int64

        The internal ID of the element to get.

      Returns Int64

      The original model ID of the splitted element part with the given internal ID, or null if not found.

    • Returns the splitted element part with the given internal ID.

      Parameters

      • internalId: Int64

        The internal ID of the element to get.

      Returns SplitPartInfo

      The splitted element part with the given internal ID, or null if not found.

    • Returns the splitted element part with the given split ID.

      Parameters

      • splitId: string

        The split ID of the element to get.

      Returns SplitPartInfo

      The splitted element part with the given split ID, or null if not found.

    • Returns the splitted element parts with the given split IDs.

      Parameters

      • splitIds: string[]

        The split IDs of the elements to get.

      Returns SplitPartInfo[]

      An array of splitted element parts with the given split IDs.

    • Returs all the bottom line parts of a splitted element.

      Parameters

      Returns SplitPartInfo[]

    • Returns all the bottom line splitted elements part internal ids of a splitted element. Additionally returns the top split internal ids that must be hidden.

      Parameters

      Returns { bottomSplitIds: Int64[]; topSplitIds: Int64[] }

    • Returns the element with the given internal ID. If the internal ID belongs to a part of a splitted element, it returns the parent element.

      Parameters

      • id: Int64

        The internal ID of the element to get.

      • checkIntoSplittedModels: boolean = true

      Returns ElementInfo

    • Returns the internal IDs of the elements with the given element IDs.

      Parameters

      • elementIds: (number | Int64)[]

      Returns Int64[]

    • Returns the element with the given element ID.

      Parameters

      • id: string | number | Int64

        The element ID of the element to get.

      Returns ElementInfo

    • Returns all elements that belong to the given model ID.

      Parameters

      Returns ElementInfo[]

      An array of elements that belong to the given model ID.

    • Returns the element with the given global ID.

      Parameters

      • id: string

        The global ID of the element to get.

      Returns ElementInfo

      The element with the given global ID.

    • Returns the elements with the given global IDs.

      Parameters

      • ids: string[]

        The global IDs of the elements to get.

      Returns ElementInfo[]

      An array of elements with the given global IDs.

    • Returns the elements with the given element IDs.

      Parameters

      • ids: (number | Int64)[]

        The element IDs of the elements to get.

      Returns ElementInfo[]

      An array of elements with the given element IDs.

    • Returns the elements with the given internal IDs.

      Parameters

      • ids: Int64[]

        The internal IDs of the elements to get.

      • unique: boolean = false

        If true, only unique elements are returned.

      Returns ElementInfo[]

      An array of elements with the given internal IDs.

    • Returns the parts of a given element (it must be a splitted element).

      Parameters

      Returns SplitPartInfo[]

      The parts of the element.

    • Returns the missing parts for a given element with parts. You can pass an elemnent eith no parts to get all its parts.

      Parameters

      • elementWithParts: ElementInfoWithParts

        The element with its parts.

      Returns SplitPartInfo[]

      The missing parts.

    • Returns the elements with their splitted parts (if any). If the model has no splitted elements, it returns the elements without parts. Usually call this method after getting the internal IDs using getHighlightedInternalIds to get IDs of parts as well.

      Parameters

      • internalIds: Int64[]

        the internal IDs of the elements or the parts to get.

      • skipElementsWithoutParts: boolean = false

        if true, it skips elements that have no parts default is false.

      Returns ElementInfoWithParts[]

    • Parameters

      Returns void

    • Parameters

      Returns void

    • Parameters

      • ids: string[]

      Returns void

    • Parameters

      • include3D: boolean
      • include2D: boolean

      Returns ElementInfo[]

    • Parameters

      • include3D: boolean
      • include2D: boolean

      Returns Int64[]

    • Parameters

      Returns number[]