@itwin/core-frontend
Version:
iTwin.js frontend components
152 lines • 6.44 kB
TypeScript
/** @packageDocumentation
* @module ModelState
*/
import { Id64String } from "@itwin/core-bentley";
import { GeometricModel2dProps, GeometricModel3dProps, GeometricModelProps, ModelProps, RelatedElement } from "@itwin/core-common";
import { Point2d, Range3d } from "@itwin/core-geometry";
import { EntityState } from "./EntityState";
import { HitDetail } from "./HitDetail";
import { IModelConnection } from "./IModelConnection";
import { TileTreeReference } from "./tile/internal";
import { ViewState } from "./ViewState";
import { SpatialClassifiersState } from "./SpatialClassifiersState";
/** Represents the front-end state of a [Model]($backend).
* @public
* @extensions
*/
export declare class ModelState extends EntityState implements ModelProps {
static get className(): string;
readonly modeledElement: RelatedElement;
readonly name: string;
parentModel: Id64String;
readonly isPrivate: boolean;
readonly isTemplate: boolean;
constructor(props: ModelProps, iModel: IModelConnection, state?: ModelState);
/** Add all custom-handled properties of a Model to a json object. */
toJSON(): ModelProps;
/** Determine whether this is a GeometricModel */
get isGeometricModel(): boolean;
/** Attempts to cast this model to a geometric model. */
get asGeometricModel(): GeometricModelState | undefined;
/** Attempts to cast this model to a 3d geometric model. */
get asGeometricModel3d(): GeometricModel3dState | undefined;
/** Attempts to cast this model to a 2d geometric model. */
get asGeometricModel2d(): GeometricModel2dState | undefined;
/** Attempts to cast this model to a spatial model. */
get asSpatialModel(): SpatialModelState | undefined;
/**
* Return the tool tip for this model. This is called only if the hit does not return a tooltip.
* @internal
*/
getToolTip(_hit: HitDetail): HTMLElement | string | undefined;
}
/** Represents the front-end state of a [GeometricModel]($backend).
* The contents of a GeometricModelState can be rendered inside a [[Viewport]].
* @public
* @extensions
*/
export declare abstract class GeometricModelState extends ModelState implements GeometricModelProps {
static get className(): string;
/** @internal */
geometryGuid?: string;
private _modelRange?;
constructor(props: GeometricModelProps, iModel: IModelConnection, state?: GeometricModelState);
/** Returns true if this is a 3d model (a [[GeometricModel3dState]]). */
abstract get is3d(): boolean;
get asGeometricModel(): GeometricModelState;
/** Returns true if this is a 2d model (a [[GeometricModel2dState]]). */
get is2d(): boolean;
get isGeometricModel(): boolean;
/** @internal */
get treeModelId(): Id64String;
/** Query for the union of the ranges of all the elements in this GeometricModel.
* @note This value is cached after the first time it is called.
* @public
*/
queryModelRange(): Promise<Range3d>;
/** @internal */
createTileTreeReference(view: ViewState): TileTreeReference;
}
/** Represents the front-end state of a [GeometricModel2d]($backend).
* @public
* @extensions
*/
export declare class GeometricModel2dState extends GeometricModelState implements GeometricModel2dProps {
static get className(): string;
/** @internal */
readonly globalOrigin: Point2d;
constructor(props: GeometricModel2dProps, iModel: IModelConnection, state?: GeometricModel2dState);
get is3d(): boolean;
get asGeometricModel2d(): GeometricModel2dState;
toJSON(): GeometricModel2dProps;
}
/** Represents the front-end state of a [GeometricModel3d]($backend).
* @public
* @extensions
*/
export declare class GeometricModel3dState extends GeometricModelState {
static get className(): string;
constructor(props: GeometricModel3dProps, iModel: IModelConnection, state?: GeometricModel3dState);
toJSON(): GeometricModel3dProps;
get is3d(): boolean;
get asGeometricModel3d(): GeometricModel3dState;
/** If true, then the elements in this GeometricModel3dState are expected to be in an XY plane.
* @note The associated ECProperty was added to the BisCore schema in version 1.0.8
*/
readonly isPlanProjection: boolean;
/** If true, then the elements in this GeometricModel3dState are not in real-world coordinates and will not be in the spatial index.
* @note The associated ECProperty was added to the BisCore schema in version 1.0.8
*/
readonly isNotSpatiallyLocated: boolean;
/** If true, then the elements in this GeometricModel3dState are in real-world coordinates and will be in the spatial index. */
get isSpatiallyLocated(): boolean;
}
/** Represents the front-end state of a [SheetModel]($backend).
* @public
* @extensions
*/
export declare class SheetModelState extends GeometricModel2dState {
static get className(): string;
}
/** Represents the front-end state of a [SpatialModel]($backend).
* @public
* @extensions
*/
export declare class SpatialModelState extends GeometricModel3dState {
/** If this is a reality model, provides access to a list of available spatial classifiers that can be applied to it. */
readonly classifiers?: SpatialClassifiersState;
static get className(): string;
get asSpatialModel(): SpatialModelState;
constructor(props: ModelProps, iModel: IModelConnection, state?: SpatialModelState);
/** Return true if this is a reality model (represented by a 3d tile set). */
get isRealityModel(): boolean;
}
/** Represents the front-end state of a [PhysicalModel]($backend).
* @public
* @extensions
*/
export declare class PhysicalModelState extends SpatialModelState {
static get className(): string;
}
/** Represents the front-end state of a [SpatialLocationModel]($backend).
* @public
* @extensions
*/
export declare class SpatialLocationModelState extends SpatialModelState {
static get className(): string;
}
/** Represents the front-end state of a [DrawingModel]($backend).
* @public
* @extensions
*/
export declare class DrawingModelState extends GeometricModel2dState {
static get className(): string;
}
/** Represents the front-end state of a [SectionDrawingModel]($backend).
* @public
* @extensions
*/
export declare class SectionDrawingModelState extends DrawingModelState {
static get className(): string;
}
//# sourceMappingURL=ModelState.d.ts.map