From d7137c4a0557e5d0ef6b75a4ff897b3723e2a496 Mon Sep 17 00:00:00 2001
From: Seth Hillbrand <seth@kipro-pcb.com>
Date: Thu, 21 Nov 2024 18:59:26 -0800
Subject: [PATCH] Cleanup VIEW class

Ununsed m_dynamic class variable
---
 common/view/view.cpp                    |  3 +--
 eeschema/sch_draw_panel.cpp             |  2 +-
 eeschema/sch_preview_panel.cpp          |  2 +-
 eeschema/sch_view.cpp                   |  4 ++--
 eeschema/sch_view.h                     |  2 +-
 gerbview/gerbview_draw_panel_gal.cpp    |  2 +-
 include/view/view.h                     | 19 +------------------
 pagelayout_editor/pl_draw_panel_gal.cpp |  2 +-
 pcbnew/pcb_draw_panel_gal.cpp           |  2 +-
 pcbnew/pcb_view.cpp                     |  4 ++--
 pcbnew/pcb_view.h                       |  2 +-
 11 files changed, 13 insertions(+), 31 deletions(-)

diff --git a/common/view/view.cpp b/common/view/view.cpp
index 0ae5b9ca29..d60947cf1d 100644
--- a/common/view/view.cpp
+++ b/common/view/view.cpp
@@ -237,14 +237,13 @@ void VIEW::OnDestroy( VIEW_ITEM* aItem )
 }
 
 
-VIEW::VIEW( bool aIsDynamic ) :
+VIEW::VIEW() :
     m_enableOrderModifier( true ),
     m_scale( 4.0 ),
     m_minScale( 0.2 ), m_maxScale( 50000.0 ),
     m_mirrorX( false ), m_mirrorY( false ),
     m_painter( nullptr ),
     m_gal( nullptr ),
-    m_dynamic( aIsDynamic ),
     m_useDrawPriority( false ),
     m_nextDrawPriority( 0 ),
     m_reverseDrawOrder( false )
diff --git a/eeschema/sch_draw_panel.cpp b/eeschema/sch_draw_panel.cpp
index d2412ecfad..9e704c5835 100644
--- a/eeschema/sch_draw_panel.cpp
+++ b/eeschema/sch_draw_panel.cpp
@@ -56,7 +56,7 @@ SCH_DRAW_PANEL::SCH_DRAW_PANEL( wxWindow* aParentWindow, wxWindowID aWindowId,
                                 KIGFX::GAL_DISPLAY_OPTIONS& aOptions, GAL_TYPE aGalType )
         : EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, aGalType )
 {
-    m_view = new KIGFX::SCH_VIEW( true, dynamic_cast<SCH_BASE_FRAME*>( GetParentEDAFrame() ) );
+    m_view = new KIGFX::SCH_VIEW( dynamic_cast<SCH_BASE_FRAME*>( GetParentEDAFrame() ) );
     m_view->SetGAL( m_gal );
 
     m_gal->SetWorldUnitLength( SCH_WORLD_UNIT );
diff --git a/eeschema/sch_preview_panel.cpp b/eeschema/sch_preview_panel.cpp
index 66937949b1..0da8b9d224 100644
--- a/eeschema/sch_preview_panel.cpp
+++ b/eeschema/sch_preview_panel.cpp
@@ -47,7 +47,7 @@ SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL( wxWindow* aParentWindow, wxWindowID aWindo
                                       KIGFX::GAL_DISPLAY_OPTIONS& aOptions, GAL_TYPE aGalType ) :
     EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, aGalType )
 {
-    m_view = new KIGFX::SCH_VIEW( true, nullptr );
+    m_view = new KIGFX::SCH_VIEW( nullptr );
     m_view->SetGAL( m_gal );
 
     m_gal->SetWorldUnitLength( SCH_WORLD_UNIT );
diff --git a/eeschema/sch_view.cpp b/eeschema/sch_view.cpp
index a767948c0b..a678a2de9b 100644
--- a/eeschema/sch_view.cpp
+++ b/eeschema/sch_view.cpp
@@ -45,8 +45,8 @@
 namespace KIGFX {
 
 
-SCH_VIEW::SCH_VIEW( bool aIsDynamic, SCH_BASE_FRAME* aFrame ) :
-    VIEW( aIsDynamic )
+SCH_VIEW::SCH_VIEW( SCH_BASE_FRAME* aFrame ) :
+    VIEW()
 {
     m_frame = aFrame;
 
diff --git a/eeschema/sch_view.h b/eeschema/sch_view.h
index ddf78b2bab..76d9fc50cf 100644
--- a/eeschema/sch_view.h
+++ b/eeschema/sch_view.h
@@ -80,7 +80,7 @@ class SCH_VIEW : public KIGFX::VIEW
 public:
     // Note: aFrame is used to know the sheet path name when drawing the drawing sheet.
     // It can be null.
-    SCH_VIEW( bool aIsDynamic, SCH_BASE_FRAME* aFrame );
+    SCH_VIEW( SCH_BASE_FRAME* aFrame );
     ~SCH_VIEW();
 
     void Cleanup();
diff --git a/gerbview/gerbview_draw_panel_gal.cpp b/gerbview/gerbview_draw_panel_gal.cpp
index 98fda15f63..67e34becee 100644
--- a/gerbview/gerbview_draw_panel_gal.cpp
+++ b/gerbview/gerbview_draw_panel_gal.cpp
@@ -44,7 +44,7 @@ GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWin
                                                   GAL_TYPE aGalType ) :
 EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, aGalType )
 {
-    m_view = new KIGFX::VIEW( true );
+    m_view = new KIGFX::VIEW();
     m_view->SetGAL( m_gal );
     GetGAL()->SetWorldUnitLength( 1.0/gerbIUScale.IU_PER_MM /* 10 nm */ / 25.4 /* 1 inch in mm */ );
 
diff --git a/include/view/view.h b/include/view/view.h
index 932d9fcd95..33b75dd395 100644
--- a/include/view/view.h
+++ b/include/view/view.h
@@ -71,11 +71,7 @@ public:
 
     typedef std::pair<VIEW_ITEM*, int> LAYER_ITEM_PAIR;
 
-    /**
-     * @param aIsDynamic decides whether we are creating a static or a dynamic VIEW.
-     */
-    VIEW( bool aIsDynamic = true );
-
+    VIEW();
     virtual ~VIEW();
 
     /**
@@ -604,15 +600,6 @@ public:
      */
     void RecacheAllItems();
 
-    /**
-     * Tell if the VIEW is dynamic (ie. can be changed, for example displaying PCBs in a window)
-     * or static (that cannot be modified, eg. displaying image/PDF).
-     */
-    bool IsDynamic() const
-    {
-        return m_dynamic;
-    }
-
     /**
      * Return true if any of the VIEW layers needs to be refreshened.
      *
@@ -899,10 +886,6 @@ protected:
     ///< Interface to #PAINTER that is used to draw items.
     GAL* m_gal;
 
-    ///< Dynamic VIEW (eg. display PCB in window) allows changes once it is built,
-    ///< static (eg. image/PDF) - does not.
-    bool m_dynamic;
-
     ///< Flag to mark targets as dirty so they have to be redrawn on the next refresh event.
     bool m_dirtyTargets[TARGETS_NUMBER];
 
diff --git a/pagelayout_editor/pl_draw_panel_gal.cpp b/pagelayout_editor/pl_draw_panel_gal.cpp
index e8cbe033ac..f93afcea94 100644
--- a/pagelayout_editor/pl_draw_panel_gal.cpp
+++ b/pagelayout_editor/pl_draw_panel_gal.cpp
@@ -47,7 +47,7 @@ PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWindo
                                       KIGFX::GAL_DISPLAY_OPTIONS& aOptions, GAL_TYPE aGalType ) :
         EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, aGalType )
 {
-    m_view = new KIGFX::VIEW( true );
+    m_view = new KIGFX::VIEW();
     m_view->SetGAL( m_gal );
 
     GetGAL()->SetWorldUnitLength( 1.0/drawSheetIUScale.IU_PER_MM /* 10 nm */ / 25.4 /* 1 inch in mm */ );
diff --git a/pcbnew/pcb_draw_panel_gal.cpp b/pcbnew/pcb_draw_panel_gal.cpp
index 4da3a559fa..42f256dd86 100644
--- a/pcbnew/pcb_draw_panel_gal.cpp
+++ b/pcbnew/pcb_draw_panel_gal.cpp
@@ -222,7 +222,7 @@ PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
                                         KIGFX::GAL_DISPLAY_OPTIONS& aOptions, GAL_TYPE aGalType ) :
         EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, aGalType )
 {
-    m_view = new KIGFX::PCB_VIEW( true );
+    m_view = new KIGFX::PCB_VIEW();
     m_view->SetGAL( m_gal );
 
     FRAME_T frameType = FRAME_FOOTPRINT_PREVIEW;
diff --git a/pcbnew/pcb_view.cpp b/pcbnew/pcb_view.cpp
index 4bf5c56e05..381e906094 100644
--- a/pcbnew/pcb_view.cpp
+++ b/pcbnew/pcb_view.cpp
@@ -33,8 +33,8 @@ using namespace std::placeholders;
 #include <footprint.h>
 
 namespace KIGFX {
-PCB_VIEW::PCB_VIEW( bool aIsDynamic ) :
-    VIEW( aIsDynamic )
+PCB_VIEW::PCB_VIEW() :
+    VIEW()
 {
     // Set m_boundary to define the max area size. The default value is acceptable for Pcbnew
     // and Gerbview.
diff --git a/pcbnew/pcb_view.h b/pcbnew/pcb_view.h
index 56410a1c4d..5922238c41 100644
--- a/pcbnew/pcb_view.h
+++ b/pcbnew/pcb_view.h
@@ -36,7 +36,7 @@ namespace KIGFX {
 class PCB_VIEW : public VIEW
 {
 public:
-    PCB_VIEW( bool aIsDynamic = true );
+    PCB_VIEW();
     virtual ~PCB_VIEW();
 
     /// @copydoc VIEW::Add()