Skip to content

Commit

Permalink
Update PointCloudFilterCommand.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
nilscognite committed Aug 6, 2024
1 parent 448d21e commit 6822096
Showing 1 changed file with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class FilterItemCommand extends BaseFilterItemCommand {
// ==================================================

public override get tooltip(): TranslateKey {
return { fallback: this.displayName };
return { fallback: this._pointClass.displayName };
}

public override get isChecked(): boolean {
Expand Down Expand Up @@ -136,21 +136,6 @@ class FilterItemCommand extends BaseFilterItemCommand {
pointCloud.setClassVisible(this._pointClass.code, value);
CommandsUpdater.update(this._renderTarget);
}

// ==================================================
// INSTANCE METHODS
// ==================================================

private get displayName(): string {
const name = this._pointClass.name;
const changedName = name.charAt(0).toUpperCase() + name.slice(1).replace(/_/g, ' ');

if (!name.startsWith('ReservedOr')) {
return changedName;
}
const betterKey = changedName.slice('ReservedOr'.length);
return `${betterKey} (legacy)`;
}
}

class PointClass {
Expand All @@ -163,6 +148,17 @@ class PointClass {
this.code = code;
this.color = color;
}

public get displayName(): string {
const name = this.name;
const changedName = name.charAt(0).toUpperCase() + name.slice(1).replace(/_/g, ' ');

if (!name.startsWith('ReservedOr')) {
return changedName;
}
const betterKey = changedName.slice('ReservedOr'.length);
return `${betterKey} (legacy)`;
}
}

function getFirstPointCloudWithClasses(
Expand Down

0 comments on commit 6822096

Please sign in to comment.