From 55f4abb6be3b16b2834fd28c5a2e2277d6427c6a Mon Sep 17 00:00:00 2001
From: Alexander Rose <alexander.rose@weirdbyte.de>
Date: Sun, 8 Jan 2023 20:49:23 -0800
Subject: [PATCH] add repr/theme registry .clear method

---
 src/mol-repr/representation.ts     | 8 +++++++-
 src/mol-repr/structure/registry.ts | 2 +-
 src/mol-theme/theme.ts             | 8 +++++++-
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/mol-repr/representation.ts b/src/mol-repr/representation.ts
index ef534488d..4718fc666 100644
--- a/src/mol-repr/representation.ts
+++ b/src/mol-repr/representation.ts
@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
+ * Copyright (c) 2018-2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
  *
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
  */
@@ -135,6 +135,12 @@ export class RepresentationRegistry<D, S extends Representation.State> {
     getApplicableTypes(data: D) {
         return getTypes(this.getApplicableList(data));
     }
+
+    clear() {
+        this._list.length = 0;
+        this._map.clear();
+        this._name.clear();
+    }
 }
 
 //
diff --git a/src/mol-repr/structure/registry.ts b/src/mol-repr/structure/registry.ts
index 8b5c5a5b5..348b19b5a 100644
--- a/src/mol-repr/structure/registry.ts
+++ b/src/mol-repr/structure/registry.ts
@@ -41,7 +41,7 @@ export namespace StructureRepresentationRegistry {
         'carbohydrate': CarbohydrateRepresentationProvider,
         'ellipsoid': EllipsoidRepresentationProvider,
         'gaussian-surface': GaussianSurfaceRepresentationProvider,
-        'gaussian-volume': GaussianVolumeRepresentationProvider, // TODO disabled for now, needs more work
+        'gaussian-volume': GaussianVolumeRepresentationProvider,
         'label': LabelRepresentationProvider,
         'line': LineRepresentationProvider,
         'molecular-surface': MolecularSurfaceRepresentationProvider,
diff --git a/src/mol-theme/theme.ts b/src/mol-theme/theme.ts
index 1ba9a7e3f..84aac3d8f 100644
--- a/src/mol-theme/theme.ts
+++ b/src/mol-theme/theme.ts
@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
+ * Copyright (c) 2018-2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
  *
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
  */
@@ -156,4 +156,10 @@ export class ThemeRegistry<T extends ColorTheme<any, any> | SizeTheme<any>> {
     getApplicableTypes(ctx: ThemeDataContext) {
         return getTypes(this.getApplicableList(ctx));
     }
+
+    clear() {
+        this._list.length = 0;
+        this._map.clear();
+        this._name.clear();
+    }
 }
\ No newline at end of file
-- 
GitLab