|
@@ -1,9 +1,30 @@
|
|
|
|
+// iGeomJS
|
|
|
|
+// LInE
|
|
|
|
+// Identifier manages the number of objects
|
|
|
|
+
|
|
export class Identifier {
|
|
export class Identifier {
|
|
- constructor() {
|
|
|
|
|
|
+
|
|
|
|
+ // Start counter
|
|
|
|
+ constructor () {
|
|
this.number = 1;
|
|
this.number = 1;
|
|
- }
|
|
|
|
- next() {
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // @calledby app/core/models/objects/generic-object.js: constructor(id): if .. this.id = identifier.next();
|
|
|
|
+ next () {
|
|
return this.number++;
|
|
return this.number++;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Help in debug process
|
|
|
|
+ getIdentifierNumber () {
|
|
|
|
+ return this.number;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Necessary when reading GEO file
|
|
|
|
+ // @calledby app/core/models/objects/generic-object.js: constructor(id): else { this.id = id; identifier.setIdentifierNumber(id+1); }
|
|
|
|
+ setIdentifierNumber (id) {
|
|
|
|
+ this.number = id;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
-}
|
|
|
|
-export const identifier = new Identifier();
|
|
|
|
|
|
+
|
|
|
|
+export const identifier = new Identifier();
|