From d85161c95533761f3645b32745bd384bce43765f Mon Sep 17 00:00:00 2001
From: Sean McBride <sean@rogue-research.com>
Date: Mon, 24 Feb 2025 12:34:17 -0500
Subject: [PATCH] Fixed compile error with VTK_FUTURE_CONST

Marked some getters as VTK_FUTURE_CONST.

Changed use of [] to .a() since the latter can mutate (inserts the key if it doesn't exist).
---
 .../HyperTree/vtkHyperTreeGridGenerateFields.cxx |  4 ++--
 .../HyperTree/vtkHyperTreeGridGenerateFields.h   | 16 ++++++++--------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/Filters/HyperTree/vtkHyperTreeGridGenerateFields.cxx b/Filters/HyperTree/vtkHyperTreeGridGenerateFields.cxx
index a87b68d8eaf..b183767aa0f 100644
--- a/Filters/HyperTree/vtkHyperTreeGridGenerateFields.cxx
+++ b/Filters/HyperTree/vtkHyperTreeGridGenerateFields.cxx
@@ -12,7 +12,7 @@
 #define fieldMacros(Name)                                                                          \
   std::string vtkHyperTreeGridGenerateFields::Get##Name##ArrayName() VTK_FUTURE_CONST              \
   {                                                                                                \
-    return this->Fields[#Name].strategy->GetArrayName();                                           \
+    return this->Fields.at(#Name).strategy->GetArrayName();                                        \
   }                                                                                                \
   void vtkHyperTreeGridGenerateFields::Set##Name##ArrayName(std::string _arg)                      \
   {                                                                                                \
@@ -25,7 +25,7 @@
   }                                                                                                \
   bool vtkHyperTreeGridGenerateFields::GetCompute##Name##Array() VTK_FUTURE_CONST                  \
   {                                                                                                \
-    return this->Fields[#Name].enabled;                                                            \
+    return this->Fields.at(#Name).enabled;                                                         \
   }                                                                                                \
   void vtkHyperTreeGridGenerateFields::SetCompute##Name##Array(bool _arg)                          \
   {                                                                                                \
diff --git a/Filters/HyperTree/vtkHyperTreeGridGenerateFields.h b/Filters/HyperTree/vtkHyperTreeGridGenerateFields.h
index ab7f036b9c4..8f9925f691c 100644
--- a/Filters/HyperTree/vtkHyperTreeGridGenerateFields.h
+++ b/Filters/HyperTree/vtkHyperTreeGridGenerateFields.h
@@ -45,7 +45,7 @@ public:
    * Enable/disable the computation of the CellSize array.
    * Default is true.
    */
-  virtual bool GetComputeCellSizeArray();
+  virtual bool GetComputeCellSizeArray() VTK_FUTURE_CONST;
   virtual void SetComputeCellSizeArray(bool enable);
   vtkBooleanMacro(ComputeCellSizeArray, bool);
   ///@}
@@ -55,7 +55,7 @@ public:
    * Get/Set the name used for the cell size array.
    * Defaults to 'CellSize'
    */
-  virtual std::string GetCellSizeArrayName();
+  virtual std::string GetCellSizeArrayName() VTK_FUTURE_CONST;
   virtual void SetCellSizeArrayName(std::string name);
   ///@}
 
@@ -64,7 +64,7 @@ public:
    * Enable/disable the computation of the ValidCell array.
    * Default is true.
    */
-  virtual bool GetComputeValidCellArray();
+  virtual bool GetComputeValidCellArray() VTK_FUTURE_CONST;
   virtual void SetComputeValidCellArray(bool enable);
   vtkBooleanMacro(ComputeValidCellArray, bool);
   ///@}
@@ -74,7 +74,7 @@ public:
    * Get/Set the name used for the cell validity array.
    * Defaults to 'ValidCell'
    */
-  virtual std::string GetValidCellArrayName();
+  virtual std::string GetValidCellArrayName() VTK_FUTURE_CONST;
   virtual void SetValidCellArrayName(std::string name);
   ///@}
 
@@ -83,7 +83,7 @@ public:
    * Enable/disable the computation of the CellCenter array.
    * Default is true.
    */
-  virtual bool GetComputeCellCenterArray();
+  virtual bool GetComputeCellCenterArray() VTK_FUTURE_CONST;
   virtual void SetComputeCellCenterArray(bool enable);
   vtkBooleanMacro(ComputeCellCenterArray, bool);
   ///@}
@@ -93,7 +93,7 @@ public:
    * Get/Set the name used for the cell center array.
    * Defaults to 'CellCenter'
    */
-  virtual std::string GetCellCenterArrayName();
+  virtual std::string GetCellCenterArrayName() VTK_FUTURE_CONST;
   virtual void SetCellCenterArrayName(std::string name);
   ///@}
 
@@ -102,7 +102,7 @@ public:
    * Enable/disable the computation of the TotalVisibleVolume array.
    * Default is true.
    */
-  virtual bool GetComputeTotalVisibleVolumeArray();
+  virtual bool GetComputeTotalVisibleVolumeArray() VTK_FUTURE_CONST;
   virtual void SetComputeTotalVisibleVolumeArray(bool enable);
   vtkBooleanMacro(ComputeTotalVisibleVolumeArray, bool);
   ///@}
@@ -112,7 +112,7 @@ public:
    * Get/Set the name used for the total visible volume array.
    * Defaults to 'TotalVisibleVolume'
    */
-  virtual std::string GetTotalVisibleVolumeArrayName();
+  virtual std::string GetTotalVisibleVolumeArrayName() VTK_FUTURE_CONST;
   virtual void SetTotalVisibleVolumeArrayName(std::string name);
   ///@}
 
-- 
GitLab