Browse Source

Cleanup VIEW class

Ununsed m_dynamic class variable
pcb_db
Seth Hillbrand 1 year ago
parent
commit
d7137c4a05
  1. 3
      common/view/view.cpp
  2. 2
      eeschema/sch_draw_panel.cpp
  3. 2
      eeschema/sch_preview_panel.cpp
  4. 4
      eeschema/sch_view.cpp
  5. 2
      eeschema/sch_view.h
  6. 2
      gerbview/gerbview_draw_panel_gal.cpp
  7. 19
      include/view/view.h
  8. 2
      pagelayout_editor/pl_draw_panel_gal.cpp
  9. 2
      pcbnew/pcb_draw_panel_gal.cpp
  10. 4
      pcbnew/pcb_view.cpp
  11. 2
      pcbnew/pcb_view.h

3
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 )

2
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 );

2
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 );

4
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;

2
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();

2
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 */ );

19
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];

2
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 */ );

2
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;

4
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.

2
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()

Loading…
Cancel
Save