From 22edfdbd48db24d6fb29f06c171bbf80009a8c7c Mon Sep 17 00:00:00 2001
From: Michael Kauzmann <michael.kauzmann@colorado.edu>
Date: Mon, 4 Mar 2024 16:26:11 -0700
Subject: [PATCH] MassTagView to use MassTag for data, and cleanup disposal,
 https://github.com/phetsims/buoyancy/issues/102

Signed-off-by: Michael Kauzmann <michael.kauzmann@colorado.edu>
---
 js/TextureQuad.ts | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/js/TextureQuad.ts b/js/TextureQuad.ts
index db42ce4..0af1a29 100644
--- a/js/TextureQuad.ts
+++ b/js/TextureQuad.ts
@@ -10,6 +10,8 @@
 import merge from '../../phet-core/js/merge.js';
 import mobius from './mobius.js';
 import Quad from './Quad.js';
+import Disposable from '../../axon/js/Disposable.js';
+import TEmitter from '../../axon/js/TEmitter.js';
 
 export default class TextureQuad extends THREE.Mesh {
 
@@ -18,6 +20,9 @@ export default class TextureQuad extends THREE.Mesh {
   private textureQuadWidth: number;
   private textureQuadHeight: number;
 
+  private disposable = new Disposable();
+  public disposeEmitter: TEmitter;
+
   public constructor( texture: THREE.Texture, width: number, height: number, materialOptions?: THREE.MaterialParameters ) {
 
     const quadGeometry = new Quad(
@@ -41,6 +46,7 @@ export default class TextureQuad extends THREE.Mesh {
     this.basicMaterial = basicMaterial;
     this.textureQuadWidth = width;
     this.textureQuadHeight = height;
+    this.disposeEmitter = this.disposable.disposeEmitter;
   }
 
   public updateTexture( texture: THREE.Texture, width: number = this.textureQuadWidth, height: number = this.textureQuadHeight ): void {
@@ -66,6 +72,7 @@ export default class TextureQuad extends THREE.Mesh {
   public dispose(): void {
     this.quadGeometry.dispose();
     this.basicMaterial.dispose();
+    this.disposable.dispose();
 
     // @ts-expect-error
     super.dispose && super.dispose();