Enable glyph block filtering and dependency tracker.
This commit is contained in:
parent
183b02d652
commit
0a74f44f0f
10 changed files with 75 additions and 42 deletions
|
@ -17,6 +17,9 @@ export class GeometryBase {
|
|||
asReferences() {
|
||||
throw new Error("Unimplemented");
|
||||
}
|
||||
getDependencies() {
|
||||
throw new Error("Unimplemented");
|
||||
}
|
||||
unlinkReferences() {
|
||||
return this;
|
||||
}
|
||||
|
@ -51,6 +54,9 @@ export class ContourGeometry extends GeometryBase {
|
|||
asReferences() {
|
||||
return null;
|
||||
}
|
||||
getDependencies() {
|
||||
return null;
|
||||
}
|
||||
filterTag(fn) {
|
||||
return this;
|
||||
}
|
||||
|
@ -89,6 +95,9 @@ export class SpiroGeometry extends GeometryBase {
|
|||
asReferences() {
|
||||
return null;
|
||||
}
|
||||
getDependencies() {
|
||||
return null;
|
||||
}
|
||||
filterTag(fn) {
|
||||
return this;
|
||||
}
|
||||
|
@ -161,6 +170,9 @@ export class DiSpiroGeometry extends GeometryBase {
|
|||
asReferences() {
|
||||
return null;
|
||||
}
|
||||
getDependencies() {
|
||||
return null;
|
||||
}
|
||||
filterTag(fn) {
|
||||
return this;
|
||||
}
|
||||
|
@ -206,6 +218,9 @@ export class ReferenceGeometry extends GeometryBase {
|
|||
if (this.isEmpty()) return [];
|
||||
return [{ glyph: this.m_glyph, x: this.m_x, y: this.m_y }];
|
||||
}
|
||||
getDependencies() {
|
||||
return [this.m_glyph];
|
||||
}
|
||||
filterTag(fn) {
|
||||
if (this.isEmpty()) return null;
|
||||
return this.unwrap().filterTag(fn);
|
||||
|
@ -239,6 +254,9 @@ export class TaggedGeometry extends GeometryBase {
|
|||
asReferences() {
|
||||
return this.m_geom.asReferences();
|
||||
}
|
||||
getDependencies() {
|
||||
return this.m_geom.getDependencies();
|
||||
}
|
||||
filterTag(fn) {
|
||||
if (!fn(this.m_tag)) return null;
|
||||
else return new TaggedGeometry(this.m_geom.filterTag(fn), this.m_tag);
|
||||
|
@ -281,6 +299,9 @@ export class TransformedGeometry extends GeometryBase {
|
|||
result.push({ glyph, x: x + this.m_transform.x, y: y + this.m_transform.y });
|
||||
return result;
|
||||
}
|
||||
getDependencies() {
|
||||
return this.m_geom.getDependencies();
|
||||
}
|
||||
filterTag(fn) {
|
||||
const e = this.m_geom.filterTag(fn);
|
||||
if (!e) return null;
|
||||
|
@ -330,6 +351,9 @@ export class RadicalGeometry extends GeometryBase {
|
|||
asReferences() {
|
||||
return null;
|
||||
}
|
||||
getDependencies() {
|
||||
return this.m_geom.getDependencies();
|
||||
}
|
||||
filterTag(fn) {
|
||||
const e = this.m_geom.filterTag(fn);
|
||||
if (!e) return null;
|
||||
|
@ -383,6 +407,15 @@ export class CombineGeometry extends GeometryBase {
|
|||
}
|
||||
return results;
|
||||
}
|
||||
getDependencies() {
|
||||
let results = [];
|
||||
for (const part of this.m_parts) {
|
||||
const rs = part.getDependencies();
|
||||
if (!rs) continue;
|
||||
for (const c of rs) results.push(c);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
filterTag(fn) {
|
||||
let filtered = [];
|
||||
for (const part of this.m_parts) {
|
||||
|
@ -454,6 +487,15 @@ export class BooleanGeometry extends GeometryBase {
|
|||
asReferences() {
|
||||
return null;
|
||||
}
|
||||
getDependencies() {
|
||||
let results = [];
|
||||
for (const part of this.m_operands) {
|
||||
const rs = part.getDependencies();
|
||||
if (!rs) continue;
|
||||
for (const c of rs) results.push(c);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
filterTag(fn) {
|
||||
let filtered = [];
|
||||
for (const operand of this.m_operands) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue