setting entity type for mObjects

This commit is contained in:
Val Erastov 2018-12-03 21:08:39 -08:00
parent 0e802520be
commit 51d65fb603
7 changed files with 17 additions and 13 deletions

View file

@ -6,8 +6,7 @@ export class MDatum extends MObject {
static ID_COUNTER = 0; // TODO: reset the counter
constructor(csys) {
super();
this.id = 'D:' + (MDatum.ID_COUNTER++);
super(MDatum.TYPE, 'D:' + (MDatum.ID_COUNTER++));
this.csys = csys;
}
}

View file

@ -5,8 +5,7 @@ export class MEdge extends MObject {
static TYPE = 'edge';
constructor(id, shell, brepEdge) {
super();
this.id = id;
super(MEdge.TYPE, id);
this.shell = shell;
this.brepEdge = brepEdge;
}

View file

@ -3,7 +3,6 @@ import Vector from 'math/vector';
import {BasisForPlane} from '../../math/l3space';
import {MSketchObject} from './msketchObject';
import {EMPTY_ARRAY} from 'gems/iterables';
import {PointOnSurface} from '../../brep/geom/pointOnSurface';
import CSys from '../../math/csys';
export class MFace extends MObject {
@ -11,8 +10,7 @@ export class MFace extends MObject {
static TYPE = 'face';
constructor(id, shell, surface, csys) {
super(id);
this.id = id;
super(MFace.TYPE, id);
this.shell = shell;
this.surface = surface;
this.sketchObjects = [];

View file

@ -1,8 +1,15 @@
export class MObject {
TYPE;
id;
ext = {}
ext = {};
constructor(TYPE, id) {
this.TYPE = TYPE;
this.id = id;
}
}

View file

@ -10,7 +10,10 @@ export class MShell extends MObject {
static ID_COUNTER = 0;
id = 'S:' + (MShell.ID_COUNTER++);
constructor() {
super(MShell.TYPE, 'S:' + (MShell.ID_COUNTER++))
}
shell;
faces = [];
edges = [];

View file

@ -5,8 +5,7 @@ export class MSketchObject extends MObject {
static TYPE = 'sketchObject';
constructor(face, sketchPrimitive) {
super();
this.id = sketchPrimitive.id;
super(MSketchObject.TYPE, sketchPrimitive.id);
this.face = face;
this.sketchPrimitive = sketchPrimitive;
this.construction = false;

View file

@ -5,8 +5,7 @@ export class MVertex extends MObject {
static TYPE = 'vertex';
constructor(id, shell, brepVertex) {
super();
this.id = id;
super(MVertex.TYPE, id);
this.shell = shell;
this.brepVertex = brepVertex;
}