Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
505b3841
Commit
505b3841
authored
Mar 03, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed a few memory leaks.
parent
75026d87
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
59 additions
and
21 deletions
+59
-21
CMakeLists.txt
common/CMakeLists.txt
+1
-0
worksheet_viewitem.cpp
common/worksheet_viewitem.cpp
+1
-3
vector2d.h
include/math/vector2d.h
+1
-0
worksheet_viewitem.h
include/worksheet_viewitem.h
+1
-2
class_board.cpp
pcbnew/class_board.cpp
+10
-1
class_board.h
pcbnew/class_board.h
+26
-0
pcbframe.cpp
pcbnew/pcbframe.cpp
+9
-13
pns_router.cpp
pcbnew/router/pns_router.cpp
+4
-0
pns_solid.h
pcbnew/router/pns_solid.h
+6
-2
No files found.
common/CMakeLists.txt
View file @
505b3841
...
...
@@ -220,6 +220,7 @@ set( PCB_COMMON_SRCS
../pcbnew/class_zone_settings.cpp
../pcbnew/classpcb.cpp
../pcbnew/ratsnest_data.cpp
../pcbnew/ratsnest_viewitem.cpp
../pcbnew/collectors.cpp
../pcbnew/netlist_reader.cpp
../pcbnew/legacy_netlist_reader.cpp
...
...
common/worksheet_viewitem.cpp
View file @
505b3841
...
...
@@ -36,10 +36,8 @@
using
namespace
KIGFX
;
WORKSHEET_VIEWITEM
::
WORKSHEET_VIEWITEM
(
const
std
::
string
&
aFileName
,
const
std
::
string
&
aSheetName
,
const
PAGE_INFO
*
aPageInfo
,
const
TITLE_BLOCK
*
aTitleBlock
)
:
WORKSHEET_VIEWITEM
::
WORKSHEET_VIEWITEM
(
const
PAGE_INFO
*
aPageInfo
,
const
TITLE_BLOCK
*
aTitleBlock
)
:
EDA_ITEM
(
NOT_USED
),
// this item is never added to a BOARD so it needs no type
m_fileName
(
aFileName
),
m_sheetName
(
aSheetName
),
m_titleBlock
(
aTitleBlock
),
m_pageInfo
(
aPageInfo
),
m_sheetNumber
(
1
),
m_sheetCount
(
1
)
{}
...
...
include/math/vector2d.h
View file @
505b3841
...
...
@@ -31,6 +31,7 @@
#include <climits>
#include <iostream>
#include <sstream>
#include <cmath>
#include <math/math_util.h>
...
...
include/worksheet_viewitem.h
View file @
505b3841
...
...
@@ -47,8 +47,7 @@ class GAL;
class
WORKSHEET_VIEWITEM
:
public
EDA_ITEM
{
public
:
WORKSHEET_VIEWITEM
(
const
std
::
string
&
aFileName
,
const
std
::
string
&
aSheetName
,
const
PAGE_INFO
*
aPageInfo
,
const
TITLE_BLOCK
*
aTitleBlock
);
WORKSHEET_VIEWITEM
(
const
PAGE_INFO
*
aPageInfo
,
const
TITLE_BLOCK
*
aTitleBlock
);
/**
* Function SetFileName()
...
...
pcbnew/class_board.cpp
View file @
505b3841
...
...
@@ -43,6 +43,8 @@
#include <reporter.h>
#include <base_units.h>
#include <ratsnest_data.h>
#include <ratsnest_viewitem.h>
#include <worksheet_viewitem.h>
#include <pcbnew.h>
#include <colors_selection.h>
...
...
@@ -104,7 +106,13 @@ BOARD::BOARD() :
SetCurrentNetClass
(
m_NetClasses
.
GetDefault
()
->
GetName
()
);
// Initialize ratsnest
m_ratsnest
=
new
RN_DATA
(
this
);
m_ratsnestViewItem
=
new
KIGFX
::
RATSNEST_VIEWITEM
(
m_ratsnest
);
// Initialize view item for displaying worksheet frame
m_worksheetViewItem
=
new
KIGFX
::
WORKSHEET_VIEWITEM
(
&
m_paper
,
&
m_titles
);
m_worksheetViewItem
->
SetFileName
(
std
::
string
(
m_fileName
.
mb_str
()
)
);
}
...
...
@@ -116,10 +124,11 @@ BOARD::~BOARD()
Delete
(
area_to_remove
);
}
delete
m_worksheetViewItem
;
delete
m_ratsnestViewItem
;
delete
m_ratsnest
;
m_FullRatsnest
.
clear
();
m_LocalRatsnest
.
clear
();
DeleteMARKERs
();
...
...
pcbnew/class_board.h
View file @
505b3841
...
...
@@ -58,6 +58,12 @@ class NETLIST;
class
REPORTER
;
class
RN_DATA
;
namespace
KIGFX
{
class
RATSNEST_VIEWITEM
;
class
WORKSHEET_VIEWITEM
;
}
// non-owning container of item candidates when searching for items on the same track.
typedef
std
::
vector
<
TRACK
*
>
TRACK_PTRS
;
...
...
@@ -227,6 +233,8 @@ private:
EDA_RECT
m_BoundingBox
;
NETINFO_LIST
m_NetInfo
;
///< net info list (name, design constraints ..
RN_DATA
*
m_ratsnest
;
KIGFX
::
RATSNEST_VIEWITEM
*
m_ratsnestViewItem
;
///< VIEW_ITEM that draws ratsnest
KIGFX
::
WORKSHEET_VIEWITEM
*
m_worksheetViewItem
;
///< VIEW_ITEM that draws worksheet frame
BOARD_DESIGN_SETTINGS
m_designSettings
;
ZONE_SETTINGS
m_zoneSettings
;
...
...
@@ -367,6 +375,24 @@ public:
return
m_ratsnest
;
}
/**
* Function GetRatsnestViewItem()
* returns VIEW_ITEM responsible for drawing the ratsnest for the board.
*/
KIGFX
::
RATSNEST_VIEWITEM
*
GetRatsnestViewItem
()
const
{
return
m_ratsnestViewItem
;
}
/**
* Function GetWorksheetViewItem()
* returns VIEW_ITEM responsible for drawing the worksheet frame.
*/
KIGFX
::
WORKSHEET_VIEWITEM
*
GetWorksheetViewItem
()
const
{
return
m_worksheetViewItem
;
}
/**
* Function DeleteMARKERs
* deletes ALL MARKERS from the board.
...
...
pcbnew/pcbframe.cpp
View file @
505b3841
...
...
@@ -596,26 +596,22 @@ void PCB_EDIT_FRAME::ViewReloadBoard( const BOARD* aBoard ) const
view
->
Add
(
zone
);
}
// Add an entry for the worksheet layout
KIGFX
::
WORKSHEET_VIEWITEM
*
worksheet
=
new
KIGFX
::
WORKSHEET_VIEWITEM
(
std
::
string
(
aBoard
->
GetFileName
().
mb_str
()
),
std
::
string
(
GetScreenDesc
().
mb_str
()
),
&
GetPageSettings
(),
&
GetTitleBlock
()
);
KIGFX
::
WORKSHEET_VIEWITEM
*
worksheet
=
aBoard
->
GetWorksheetViewItem
();
worksheet
->
SetSheetName
(
std
::
string
(
GetScreenDesc
().
mb_str
()
)
);
BASE_SCREEN
*
screen
=
GetScreen
();
if
(
screen
!=
NULL
)
{
worksheet
->
SetSheetNumber
(
GetScreen
()
->
m_ScreenNumber
);
worksheet
->
SetSheetCount
(
GetScreen
()
->
m_NumberOfScreens
);
worksheet
->
SetSheetNumber
(
screen
->
m_ScreenNumber
);
worksheet
->
SetSheetCount
(
screen
->
m_NumberOfScreens
);
}
view
->
Add
(
worksheet
);
view
->
Add
(
aBoard
->
GetRatsnestViewItem
()
);
// Add an entry for the ratsnest
RN_DATA
*
ratsnest
=
aBoard
->
GetRatsnest
();
ratsnest
->
Recalculate
();
view
->
Add
(
new
KIGFX
::
RATSNEST_VIEWITEM
(
ratsnest
)
);
view
->
SetPanBoundary
(
worksheet
->
ViewBBox
()
);
// Limit panning to the size of worksheet frame
view
->
SetPanBoundary
(
aBoard
->
GetWorksheetViewItem
()
->
ViewBBox
()
);
view
->
RecacheAllItems
(
true
);
if
(
IsGalCanvasActive
()
)
...
...
pcbnew/router/pns_router.cpp
View file @
505b3841
...
...
@@ -338,9 +338,13 @@ void PNS_ROUTER::ClearWorld()
if
(
m_placer
)
delete
m_placer
;
if
(
m_previewItems
)
delete
m_previewItems
;
m_clearanceFunc
=
NULL
;
m_world
=
NULL
;
m_placer
=
NULL
;
m_previewItems
=
NULL
;
}
...
...
pcbnew/router/pns_solid.h
View file @
505b3841
...
...
@@ -32,10 +32,14 @@
class
PNS_SOLID
:
public
PNS_ITEM
{
public
:
PNS_SOLID
()
:
PNS_ITEM
(
SOLID
)
PNS_SOLID
()
:
PNS_ITEM
(
SOLID
)
,
m_shape
(
NULL
)
{
m_movable
=
false
;
m_shape
=
NULL
;
}
~
PNS_SOLID
()
{
delete
m_shape
;
}
PNS_ITEM
*
Clone
()
const
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment