Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private constructor(iModel: IModelProps, openMode: OpenMode) {
super(iModel.iModelToken ? IModelToken.fromJSON(iModel.iModelToken) : undefined);
super.initialize(iModel.name!, iModel);
this.isBlank = undefined === iModel.iModelToken; // to differentiate between previously-open-but-now-closed vs. blank
this.openMode = openMode;
this.models = new IModelConnection.Models(this);
this.elements = new IModelConnection.Elements(this);
this.codeSpecs = new IModelConnection.CodeSpecs(this);
this.views = new IModelConnection.Views(this);
this.selectionSet = new SelectionSet(this);
this.hilited = new HiliteSet(this);
this.tiles = new IModelConnection.Tiles(this);
this.subcategories = new SubCategoriesCache(this);
this.geoServices = new GeoServices(this);
this.displayedExtents = Range3d.fromJSON(this.projectExtents);
}
public async extractChangeSummaries(tokenProps: IModelTokenProps, options: any): Promise {
const requestContext = ClientRequestContext.current as AuthorizedClientRequestContext;
const iModelToken = IModelToken.fromJSON(tokenProps);
await ChangeSummaryManager.extractChangeSummaries(requestContext, IModelDb.find(iModelToken), options as ChangeSummaryExtractOptions);
}
public async queryObstaclesHitByRobot(tokenProps: IModelTokenProps, rid: Id64String): Promise {
const iModelDb: IModelDb = IModelDb.find(IModelToken.fromJSON(tokenProps));
return RobotWorldEngine.queryObstaclesHitByRobot(iModelDb, rid);
}
}
public async moveRobot(tokenProps: IModelTokenProps, id: Id64String, location: XYZProps): Promise {
RobotWorldEngine.moveRobot(IModelDb.find(IModelToken.fromJSON(tokenProps)), id, Point3d.fromJSON(location));
}
public async saveChanges(tokenProps: IModelTokenProps, description?: string): Promise {
const iModelToken = IModelToken.fromJSON(tokenProps);
IModelDb.find(iModelToken).saveChanges(description);
}
public async updateProjectExtents(tokenProps: IModelTokenProps, newExtents: AxisAlignedBox3dProps): Promise {
public async detachChangeCache(tokenProps: IModelTokenProps): Promise {
const iModelToken = IModelToken.fromJSON(tokenProps);
const iModel: IModelDb = IModelDb.find(iModelToken);
if (ChangeSummaryManager.isChangeCacheAttached(iModel))
ChangeSummaryManager.detachChangeCache(iModel);
}
public async isChangesetProcessed(tokenProps: IModelTokenProps, changesetId: string): Promise {
const iModelToken = IModelToken.fromJSON(tokenProps);
return ChangedElementsManager.isProcessed(iModelToken.iModelId!, changesetId);
}
}
public async getGeoCoordinatesFromIModelCoordinates(tokenProps: IModelTokenProps, props: string): Promise {
const iModelToken = IModelToken.fromJSON(tokenProps);
const iModelDb = IModelDb.find(iModelToken);
const requestContext = ClientRequestContext.current;
return iModelDb.getGeoCoordinatesFromIModelCoordinates(requestContext, props);
}
}
public async attachChangeCache(tokenProps: IModelTokenProps): Promise {
const iModelToken = IModelToken.fromJSON(tokenProps);
ChangeSummaryManager.attachChangeCache(IModelDb.find(iModelToken));
}
public async getChangedElements(tokenProps: IModelTokenProps, startChangesetId: string, endChangesetId: string): Promise {
const iModelToken = IModelToken.fromJSON(tokenProps);
return ChangedElementsManager.getChangedElements(iModelToken.iModelId!, startChangesetId, endChangesetId);
}