BIM.works SDKs - v3.0.0-b.115
    Preparing search index...

    viewer3d.viewpoints of both 3D viewers: a view as a ViewpointValue and back

    Index

    Constructors

    Methods

    • The view now as a value: a new plain object, JSON as it is.

      Parameters

      • Optionaloptions: { parts?: Iterable<ViewpointPart, any, any> }

        parts: what to store, VIEWER_VIEWPOINT_PARTS by default; the application's parts given here are listed in bimworks.parts for the application to fill in. The loaded models are recorded whatever the parts

      Returns ViewpointValue

      Error when no model is loaded

    • The finished measurements as capture stores them, in the version frame of vid

      Parameters

      • vid: string

      Returns ViewpointMeasurement[]

    • The loaded version a value's coordinates are read in: its own frame version; else a loaded version of the same model; else a loaded version it recorded, or any. Null with nothing loaded

      Parameters

      • bimworks: {
            camera?: {
                pivot: [number, number, number] | null;
                target_distance: number;
            };
            measurements?: ViewpointMeasurement[];
            model_set?: { models: ViewpointModel[]; placement: "LOCAL"
            | "GEO" };
            models?: string[];
            parts?: ViewpointPart[];
            planes?: { name: string | null; standard: string | null }[];
            schema: "bimworks.viewpoint/1";
            sets?: {
                coloring?: (
                    | { color: string; qids: ViewpointQids }
                    | { alter: number; qids: ViewpointQids }
                )[];
                exceptions?: ViewpointQids;
                selection?: ViewpointQids;
                xray?: ViewpointQids;
            };
            version_uuid: string;
            visibility?: { default_visibility: boolean };
            [member: string]: unknown;
        }
        • [member: string]: unknown

          The application's parts (display settings, sun ...)

        • Optionalcamera?: { pivot: [number, number, number] | null; target_distance: number }

          target_distance in metres; pivot: the point the camera orbits around

        • Optionalmeasurements?: ViewpointMeasurement[]

          The finished measurements

        • Optionalmodel_set?: { models: ViewpointModel[]; placement: "LOCAL" | "GEO" }

          The loaded models and the placement mode (Viewer3d.getMode), whatever the parts: the objects and the frame refer to them

        • Optionalmodels?: string[]

          The loaded versions

        • Optionalparts?: ViewpointPart[]

          The parts stored; without it, every part the value has members for

        • Optionalplanes?: { name: string | null; standard: string | null }[]

          Per clipping plane, in the same order: the name it is listed by and the standard plane it is

        • schema: "bimworks.viewpoint/1"
        • Optionalsets?: {
              coloring?: (
                  | { color: string; qids: ViewpointQids }
                  | { alter: number; qids: ViewpointQids }
              )[];
              exceptions?: ViewpointQids;
              selection?: ViewpointQids;
              xray?: ViewpointQids;
          }
          • Optionalcoloring?: (
                | { color: string; qids: ViewpointQids }
                | { alter: number; qids: ViewpointQids }
            )[]

            The colours as they were: a colour "#rrggbbaa", or an alteration of the object's own colour (ColorChangeMap.alterQid)

          • Optionalexceptions?: ViewpointQids
          • Optionalselection?: ViewpointQids
          • Optionalxray?: ViewpointQids
        • version_uuid: string

          The version whose frame the coordinates are in

        • Optionalvisibility?: { default_visibility: boolean }

          BCF's default visibility: true when sets.exceptions are the hidden objects, false when they are the shown ones

      Returns { match: "exact" | "same-model" | "other-model"; vid: string } | null

    • Brings a value back. A stored part replaces that part of the view for the models it recorded; models it did not record keep theirs. The object state first, then the section planes, the measurements, options.beforeCamera, and the camera last (not awaited: it may animate).

      Parameters

      • value: ViewpointValue
      • Optionaloptions: {
            animate?: number;
            beforeCamera?:
                | ((report: ViewpointRestoreReport) => void | Promise<void>)
                | null;
            measurements?: "replace" | "add" | null;
            parts?: Iterable<ViewpointPart, any, any> | null;
        }

        parts: which of the stored parts, all of them by default; animate: the camera's flight in ms, 0 (the default) jumps; measurements: "replace" takes the measurements on screen away, "add" keeps them, by default a full restore (no parts) replaces and a chosen one adds; beforeCamera: awaited once everything but the camera is back, for the parts the application restores itself, which it can add to the report

      Returns Promise<ViewpointRestoreReport>

      Error when the value is not a VIEWPOINT_SCHEMA value

    • A value's set of objects back as a QidSet; throws on a run that is not "n" or "from-to"

      Parameters

      Returns QidSet