igniteui-react-core
Version:
Ignite UI React Core.
98 lines (97 loc) • 2.92 kB
JavaScript
import { delegateCombine, delegateRemove } from './type';
import { ItfConverter as ItfConverter_internal } from "./ItfConverter";
import { IgrAsyncCompletedEventArgs } from './igr-async-completed-event-args';
import { Uri } from './Uri';
/**
* Class for converting Itf files into enumerable triangulations.
*/
export class IgrTriangulationDataSource {
createImplementation() {
return new ItfConverter_internal();
}
get i() {
return this._implementation;
}
onImplementationCreated() {
}
constructor() {
//@@ZoneRunner
this._importCompleted = null;
this._importCompleted_wrapped = null;
this._implementation = this.createImplementation();
this._implementation.externalObject = this;
this.onImplementationCreated();
}
_provideImplementation(i) {
this._implementation = i;
this._implementation.externalObject = this;
this.onImplementationCreated();
}
/**
* Gets the string path specifying the location of the Itf file.
*/
get source() {
if (this.i.source == null)
return null;
return this.i.source.value;
}
/**
* Sets the string path specifying the location of the Itf file.
*/
set source(v) {
if (v == null) {
this.i.source = null;
}
else {
this.i.source = new Uri(0, v);
}
}
/**
* Gets the point data.
*/
getPointData() {
let iv = this.i.getPointData();
return iv._inner;
}
/**
* Gets the triangle data.
*/
getTriangleData() {
let iv = this.i.getTriangleData();
return iv._inner;
}
findByName(name) {
if (this.findEphemera) {
if (name && name.indexOf("@@e:") == 0) {
return this.findEphemera(name);
}
}
return null;
}
/**
* Event raised when the import operation has completed
*/
get importCompleted() {
return this._importCompleted;
}
set importCompleted(ev) {
if (this._importCompleted_wrapped !== null) {
this.i.importCompleted = delegateRemove(this.i.importCompleted, this._importCompleted_wrapped);
this._importCompleted_wrapped = null;
this._importCompleted = null;
}
this._importCompleted = ev;
this._importCompleted_wrapped = (o, e) => {
let outerArgs = new IgrAsyncCompletedEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeImportCompleted) {
this.beforeImportCompleted(this, outerArgs);
}
if (this._importCompleted) {
this._importCompleted(this, outerArgs);
}
};
this.i.importCompleted = delegateCombine(this.i.importCompleted, this._importCompleted_wrapped);
;
}
}