use data of topo-object for half edges

This commit is contained in:
Val Erastov 2017-01-29 23:48:33 -08:00
parent a52c57ea4b
commit 1654fa8e9c
2 changed files with 9 additions and 8 deletions

View file

@ -902,25 +902,25 @@ function EdgeSolveData() {
EdgeSolveData.EMPTY = new EdgeSolveData();
EdgeSolveData.get = function(edge) {
if (!edge.__edgeSolveData) {
if (!edge.data[MY]) {
return EdgeSolveData.EMPTY;
}
return edge.__edgeSolveData;
return edge.data[MY];
};
EdgeSolveData.createIfEmpty = function(edge) {
if (!edge.__edgeSolveData) {
edge.__edgeSolveData = new EdgeSolveData();
if (!edge.data[MY]) {
edge.data[MY] = new EdgeSolveData();
}
return edge.__edgeSolveData;
return edge.data[MY];
};
EdgeSolveData.clear = function(edge) {
delete edge.__edgeSolveData;
delete edge.data[MY];
};
EdgeSolveData.transfer = function(from, to) {
to.__edgeSolveData = from.__edgeSolveData;
to.data[MY] = from.data[MY];
};
function Node(vertex, normal, splitsEdge, splittingFace) {

View file

@ -10,9 +10,10 @@ export class Edge extends TopoObject {
}
}
export class HalfEdge {
export class HalfEdge extends TopoObject {
constructor() {
super();
this.edge = null;
this.vertexA = null;
this.vertexB = null;