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
1b39dfc7
Commit
1b39dfc7
authored
Feb 19, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
highlight zone containers
parent
7750cf6d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
135 additions
and
113 deletions
+135
-113
change_log.txt
change_log.txt
+7
-0
class_pad.cpp
pcbnew/class_pad.cpp
+1
-1
collectors.cpp
pcbnew/collectors.cpp
+6
-5
collectors.h
pcbnew/collectors.h
+89
-89
surbrill.cpp
pcbnew/surbrill.cpp
+32
-18
No files found.
change_log.txt
View file @
1b39dfc7
...
@@ -5,6 +5,13 @@ Started 2007-June-11
...
@@ -5,6 +5,13 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.
2008-Feb-19 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew
Add ZONE_CONTAINER support to the ID_PCB_HIGHLIGHT_BUTT tool and
WinEDA_PcbFrame::DrawHightLight()
2008-Feb-18 UPDATE Dick Hollenbeck <dick@softplc.com>
2008-Feb-18 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
+pcbnew
+pcbnew
...
...
pcbnew/class_pad.cpp
View file @
1b39dfc7
...
@@ -331,7 +331,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
...
@@ -331,7 +331,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
// if PAD_SMD pad and high contrast mode
// if PAD_SMD pad and high contrast mode
if
(
m_Attribut
==
PAD_SMD
&&
DisplayOpt
.
ContrastModeDisplay
)
if
(
(
m_Attribut
==
PAD_SMD
||
m_Attribut
==
PAD_CONN
)
&&
DisplayOpt
.
ContrastModeDisplay
)
{
{
// when routing tracks
// when routing tracks
if
(
frame
&&
frame
->
m_ID_current_state
==
ID_TRACK_BUTT
)
if
(
frame
&&
frame
->
m_ID_current_state
==
ID_TRACK_BUTT
)
...
...
pcbnew/collectors.cpp
View file @
1b39dfc7
...
@@ -93,11 +93,12 @@ const KICAD_T GENERAL_COLLECTOR::PadsOrModules[] = {
...
@@ -93,11 +93,12 @@ const KICAD_T GENERAL_COLLECTOR::PadsOrModules[] = {
};
};
const
KICAD_T
GENERAL_COLLECTOR
::
Pads
OrTrack
s
[]
=
{
const
KICAD_T
GENERAL_COLLECTOR
::
Pads
TracksOrZone
s
[]
=
{
TYPEPAD
,
TYPEPAD
,
TYPEVIA
,
TYPEVIA
,
TYPETRACK
,
TYPETRACK
,
TYPEZONE
,
TYPEZONE
,
TYPEZONE_CONTAINER
,
EOT
EOT
};
};
...
@@ -368,20 +369,20 @@ void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[],
...
@@ -368,20 +369,20 @@ void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[],
// see collectors.h
// see collectors.h
SEARCH_RESULT
TYPE_COLLECTOR
::
Inspect
(
EDA_BaseStruct
*
testItem
,
const
void
*
testData
)
SEARCH_RESULT
TYPE_COLLECTOR
::
Inspect
(
EDA_BaseStruct
*
testItem
,
const
void
*
testData
)
{
{
// The Vist() function only visits the testItem if its type was in the
// The Vist() function only visits the testItem if its type was in the
// the scanList, so therefore we can collect anything given to us here.
// the scanList, so therefore we can collect anything given to us here.
Append
(
testItem
);
Append
(
testItem
);
return
SEARCH_CONTINUE
;
// always when collecting
return
SEARCH_CONTINUE
;
// always when collecting
}
}
void
TYPE_COLLECTOR
::
Collect
(
BOARD_ITEM
*
aBoard
,
const
KICAD_T
aScanList
[]
)
void
TYPE_COLLECTOR
::
Collect
(
BOARD_ITEM
*
aBoard
,
const
KICAD_T
aScanList
[]
)
{
{
Empty
();
// empty any existing collection
Empty
();
// empty any existing collection
// visit the board with the INSPECTOR (me).
// visit the board with the INSPECTOR (me).
aBoard
->
Visit
(
this
,
// INSPECTOR* inspector
aBoard
->
Visit
(
this
,
// INSPECTOR* inspector
NULL
,
// const void* testData,
NULL
,
// const void* testData,
aScanList
);
aScanList
);
}
}
...
...
pcbnew/collectors.h
View file @
1b39dfc7
...
@@ -3,22 +3,22 @@
...
@@ -3,22 +3,22 @@
*
*
* Copyright (C) 2007-2008 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2007-2008 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2004-2007 Kicad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-2007 Kicad Developers, see change_log.txt for contributors.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* of the License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
*/
...
@@ -37,26 +37,26 @@
...
@@ -37,26 +37,26 @@
/**
/**
* Class COLLECTORS_GUIDE
* Class COLLECTORS_GUIDE
* is an abstract base class whose derivatives may be passed to a GENERAL_COLLECTOR,
* is an abstract base class whose derivatives may be passed to a GENERAL_COLLECTOR,
* telling GENERAL_COLLECTOR what should be collected (aside from HitTest()ing
* telling GENERAL_COLLECTOR what should be collected (aside from HitTest()ing
* and KICAD_T scanTypes[], information which are provided to the GENERAL_COLLECTOR
* and KICAD_T scanTypes[], information which are provided to the GENERAL_COLLECTOR
* through attributes or arguments separately).
* through attributes or arguments separately).
* <p>
* <p>
* A justification for this class is to keep the structural storage details of
* A justification for this class is to keep the structural storage details of
* the program's "global preferences" or "configuration options" out of
* the program's "global preferences" or "configuration options" out of
* GENERAL_COLLECTOR::Inspect(). This class carries all the necessary details
* GENERAL_COLLECTOR::Inspect(). This class carries all the necessary details
* in with it to the Inspect() call. The constructors or other functions of
* in with it to the Inspect() call. The constructors or other functions of
* this class's derivatives are then the only place where knowledge of the
* this class's derivatives are then the only place where knowledge of the
* specific structure of the global preference storage is needed. Thus,
* specific structure of the global preference storage is needed. Thus,
* GENERAL_COLLECTOR::Inspect() can be kept as simple as possible, and insulated
* GENERAL_COLLECTOR::Inspect() can be kept as simple as possible, and insulated
* from changes in global preference storage (and even then it is
* from changes in global preference storage (and even then it is
* not simple enough).
* not simple enough).
* <p>
* <p>
* This class introduces the notion of layer locking.
* This class introduces the notion of layer locking.
*/
*/
class
COLLECTORS_GUIDE
class
COLLECTORS_GUIDE
{
{
public
:
public
:
virtual
~
COLLECTORS_GUIDE
()
{}
virtual
~
COLLECTORS_GUIDE
()
{}
...
@@ -65,25 +65,25 @@ public:
...
@@ -65,25 +65,25 @@ public:
* @return bool - true if the given layer is locked, else false.
* @return bool - true if the given layer is locked, else false.
*/
*/
virtual
bool
IsLayerLocked
(
int
layer
)
const
=
0
;
virtual
bool
IsLayerLocked
(
int
layer
)
const
=
0
;
/**
/**
* Function IsLayerVisible
* Function IsLayerVisible
* @return bool - true if the given layer is visible, else false.
* @return bool - true if the given layer is visible, else false.
*/
*/
virtual
bool
IsLayerVisible
(
int
layer
)
const
=
0
;
virtual
bool
IsLayerVisible
(
int
layer
)
const
=
0
;
/**
/**
* Function IgnoreLockedLayers
* Function IgnoreLockedLayers
* @return bool - true if should ignore locked layers, else false.
* @return bool - true if should ignore locked layers, else false.
*/
*/
virtual
bool
IgnoreLockedLayers
()
const
=
0
;
virtual
bool
IgnoreLockedLayers
()
const
=
0
;
/**
/**
* Function IgnoredNonVisibleLayers
* Function IgnoredNonVisibleLayers
* @return bool - true if should ignore non-visible layers, else false.
* @return bool - true if should ignore non-visible layers, else false.
*/
*/
virtual
bool
IgnoreNonVisibleLayers
()
const
=
0
;
virtual
bool
IgnoreNonVisibleLayers
()
const
=
0
;
/**
/**
* Function GetPreferredLayer
* Function GetPreferredLayer
* @return int - the preferred layer for HitTest()ing.
* @return int - the preferred layer for HitTest()ing.
...
@@ -116,7 +116,7 @@ public:
...
@@ -116,7 +116,7 @@ public:
* @return bool - true if MTexts marked as "no show" should be ignored.
* @return bool - true if MTexts marked as "no show" should be ignored.
*/
*/
virtual
bool
IgnoreMTextsMarkedNoShow
()
const
=
0
;
virtual
bool
IgnoreMTextsMarkedNoShow
()
const
=
0
;
/**
/**
* Function IgnoreZones
* Function IgnoreZones
* @return bool - true if should ignore zones.
* @return bool - true if should ignore zones.
...
@@ -134,7 +134,7 @@ public:
...
@@ -134,7 +134,7 @@ public:
* @return bool - true if should ignore MTexts on component layer.
* @return bool - true if should ignore MTexts on component layer.
*/
*/
virtual
bool
IgnoreMTextsOnCmp
()
const
=
0
;
virtual
bool
IgnoreMTextsOnCmp
()
const
=
0
;
/**
/**
* Function IgnoreModulesOnCu
* Function IgnoreModulesOnCu
* @return bool - true if should ignore MODULEs on copper layer.
* @return bool - true if should ignore MODULEs on copper layer.
...
@@ -147,7 +147,7 @@ public:
...
@@ -147,7 +147,7 @@ public:
*/
*/
virtual
bool
IgnoreModulesOnCmp
()
const
=
0
;
virtual
bool
IgnoreModulesOnCmp
()
const
=
0
;
/**
/**
* Function UseHitTesting
* Function UseHitTesting
* @return bool - true if Inspect() should use BOARD_ITEM::HitTest()
* @return bool - true if Inspect() should use BOARD_ITEM::HitTest()
...
@@ -160,40 +160,40 @@ public:
...
@@ -160,40 +160,40 @@ public:
/**
/**
* Class GENERAL_COLLECTOR
* Class GENERAL_COLLECTOR
* is intended for use when the right click button is pressed, or when the
* is intended for use when the right click button is pressed, or when the
* plain "arrow" tool is in effect. This class can be used by window classes
* plain "arrow" tool is in effect. This class can be used by window classes
* such as WinEDA_PcbFrame.
* such as WinEDA_PcbFrame.
*
*
* Philosophy: this class knows nothing of the context in which a BOARD is used
* Philosophy: this class knows nothing of the context in which a BOARD is used
* and that means it knows nothing about which layers are visible or current,
* and that means it knows nothing about which layers are visible or current,
* but can handle those concerns by the SetPreferredLayer() function and the
* but can handle those concerns by the SetPreferredLayer() function and the
* SetLayerMask() fuction.
* SetLayerMask() fuction.
*/
*/
class
GENERAL_COLLECTOR
:
public
COLLECTOR
class
GENERAL_COLLECTOR
:
public
COLLECTOR
{
{
protected
:
protected
:
/**
/**
* A place to hold collected objects which don't match precisely the search
* A place to hold collected objects which don't match precisely the search
* criteria, but would be acceptable if nothing else is found.
* criteria, but would be acceptable if nothing else is found.
* "2nd" choice, which will be appended to the end of COLLECTOR's prime
* "2nd" choice, which will be appended to the end of COLLECTOR's prime
* "list" at the end of the search.
* "list" at the end of the search.
*/
*/
std
::
vector
<
BOARD_ITEM
*>
m_List2nd
;
std
::
vector
<
BOARD_ITEM
*>
m_List2nd
;
/**
/**
* Determines which items are to be collected by Inspect()
* Determines which items are to be collected by Inspect()
*/
*/
const
COLLECTORS_GUIDE
*
m_Guide
;
const
COLLECTORS_GUIDE
*
m_Guide
;
/**
/**
* The number of items that were originally in the primary list before the
* The number of items that were originally in the primary list before the
* m_List2nd was concatonated onto the end of it.
* m_List2nd was concatonated onto the end of it.
*/
*/
int
m_PrimaryLength
;
int
m_PrimaryLength
;
public
:
public
:
/**
/**
...
@@ -206,9 +206,9 @@ public:
...
@@ -206,9 +206,9 @@ public:
* A scan list for all editable board items, except zones
* A scan list for all editable board items, except zones
*/
*/
static
const
KICAD_T
AllButZones
[];
static
const
KICAD_T
AllButZones
[];
/**
/**
* A scan list for all primary board items, omitting items which are subordinate to
* A scan list for all primary board items, omitting items which are subordinate to
* a MODULE, such as D_PAD and TEXTEMODULE.
* a MODULE, such as D_PAD and TEXTEMODULE.
static const KICAD_T PrimaryItems[];
static const KICAD_T PrimaryItems[];
...
@@ -229,9 +229,9 @@ public:
...
@@ -229,9 +229,9 @@ public:
/**
/**
* A scan list for PADs, TRACKs, VIAs, or ZONEs
* A scan list for PADs, TRACKs, VIAs, or ZONEs
*/
*/
static
const
KICAD_T
PadsOrTracks
[];
static
const
KICAD_T
PadsTracksOrZones
[];
/**
/**
* A scan list for MODULEs and their items (for Modedit)
* A scan list for MODULEs and their items (for Modedit)
*/
*/
...
@@ -242,11 +242,11 @@ public:
...
@@ -242,11 +242,11 @@ public:
* A scan list for only TRACKS
* A scan list for only TRACKS
*/
*/
static
const
KICAD_T
Tracks
[];
static
const
KICAD_T
Tracks
[];
/**
/**
* Constructor GENERALCOLLECTOR
* Constructor GENERALCOLLECTOR
*/
*/
GENERAL_COLLECTOR
()
GENERAL_COLLECTOR
()
{
{
SetScanTypes
(
AllBoardItems
);
SetScanTypes
(
AllBoardItems
);
...
@@ -269,8 +269,8 @@ public:
...
@@ -269,8 +269,8 @@ public:
* @param aGuide Which guide to use in the collection.
* @param aGuide Which guide to use in the collection.
*/
*/
void
SetGuide
(
const
COLLECTORS_GUIDE
*
aGuide
)
{
m_Guide
=
aGuide
;
}
void
SetGuide
(
const
COLLECTORS_GUIDE
*
aGuide
)
{
m_Guide
=
aGuide
;
}
/**
/**
* Function operator[int]
* Function operator[int]
* overloads COLLECTOR::operator[](int) to return a BOARD_ITEM* instead of
* overloads COLLECTOR::operator[](int) to return a BOARD_ITEM* instead of
...
@@ -285,39 +285,39 @@ public:
...
@@ -285,39 +285,39 @@ public:
return
NULL
;
return
NULL
;
}
}
/**
/**
* Function GetPrimaryCount
* Function GetPrimaryCount
* @return int - The number if items which met the primary search criteria
* @return int - The number if items which met the primary search criteria
*/
*/
int
GetPrimaryCount
()
{
return
m_PrimaryLength
;
}
int
GetPrimaryCount
()
{
return
m_PrimaryLength
;
}
/**
/**
* Function Inspect
* Function Inspect
* is the examining function within the INSPECTOR which is passed to the
* is the examining function within the INSPECTOR which is passed to the
* Iterate function.
* Iterate function.
*
*
* @param testItem An EDA_BaseStruct to examine.
* @param testItem An EDA_BaseStruct to examine.
* @param testData is not used in this class.
* @param testData is not used in this class.
* @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan,
* @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan,
* else SCAN_CONTINUE;
* else SCAN_CONTINUE;
*/
*/
SEARCH_RESULT
Inspect
(
EDA_BaseStruct
*
testItem
,
const
void
*
testData
);
SEARCH_RESULT
Inspect
(
EDA_BaseStruct
*
testItem
,
const
void
*
testData
);
/**
/**
* Function Collect
* Function Collect
* scans a BOARD_ITEM using this class's Inspector method, which does the collection.
* scans a BOARD_ITEM using this class's Inspector method, which does the collection.
* @param aItem A BOARD_ITEM to scan, may be a BOARD or MODULE, or whatever.
* @param aItem A BOARD_ITEM to scan, may be a BOARD or MODULE, or whatever.
* @param aScanList A list of KICAD_Ts with a terminating EOT, that specs
* @param aScanList A list of KICAD_Ts with a terminating EOT, that specs
* what is to be collected and the priority order of the resultant
* what is to be collected and the priority order of the resultant
* collection in "m_List".
* collection in "m_List".
* @param aRefPos A wxPoint to use in hit-testing.
* @param aRefPos A wxPoint to use in hit-testing.
* @param aGuide The COLLECTORS_GUIDE to use in collecting items.
* @param aGuide The COLLECTORS_GUIDE to use in collecting items.
*/
*/
void
Collect
(
BOARD_ITEM
*
aItem
,
const
KICAD_T
aScanList
[],
void
Collect
(
BOARD_ITEM
*
aItem
,
const
KICAD_T
aScanList
[],
const
wxPoint
&
aRefPos
,
const
COLLECTORS_GUIDE
&
aGuide
);
const
wxPoint
&
aRefPos
,
const
COLLECTORS_GUIDE
&
aGuide
);
};
};
...
@@ -325,31 +325,31 @@ public:
...
@@ -325,31 +325,31 @@ public:
* Class GENERAL_COLLECTORS_GUIDE
* Class GENERAL_COLLECTORS_GUIDE
* is a general implementation of a COLLECTORS_GUIDE. One of its constructors is
* is a general implementation of a COLLECTORS_GUIDE. One of its constructors is
* entitled to grab information from the program's global preferences.
* entitled to grab information from the program's global preferences.
*/
*/
class
GENERAL_COLLECTORS_GUIDE
:
public
COLLECTORS_GUIDE
class
GENERAL_COLLECTORS_GUIDE
:
public
COLLECTORS_GUIDE
{
{
private
:
private
:
// the storage architecture here is not important, since this is only
// the storage architecture here is not important, since this is only
// a carrier object and its functions are what is used, and data only indirectly.
// a carrier object and its functions are what is used, and data only indirectly.
int
m_PreferredLayer
;
int
m_PreferredLayer
;
bool
m_IgnorePreferredLayer
;
bool
m_IgnorePreferredLayer
;
int
m_LayerLocked
;
///< bit-mapped layer locked bits
int
m_LayerLocked
;
///< bit-mapped layer locked bits
bool
m_IgnoreLockedLayers
;
bool
m_IgnoreLockedLayers
;
int
m_LayerVisible
;
///< bit-mapped layer visible bits
int
m_LayerVisible
;
///< bit-mapped layer visible bits
bool
m_IgnoreNonVisibleLayers
;
bool
m_IgnoreNonVisibleLayers
;
bool
m_IgnoreLockedItems
;
bool
m_IgnoreLockedItems
;
bool
m_IncludeSecondary
;
bool
m_IncludeSecondary
;
bool
m_IgnoreMTextsMarkedNoShow
;
bool
m_IgnoreMTextsMarkedNoShow
;
bool
m_IgnoreMTextsOnCopper
;
bool
m_IgnoreMTextsOnCopper
;
bool
m_IgnoreMTextsOnCmp
;
bool
m_IgnoreMTextsOnCmp
;
bool
m_IgnoreModulesOnCu
;
bool
m_IgnoreModulesOnCu
;
bool
m_IgnoreModulesOnCmp
;
bool
m_IgnoreModulesOnCmp
;
public
:
public
:
/**
/**
...
@@ -363,16 +363,16 @@ public:
...
@@ -363,16 +363,16 @@ public:
m_PreferredLayer
=
LAYER_CMP_N
;
m_PreferredLayer
=
LAYER_CMP_N
;
m_IgnorePreferredLayer
=
false
;
m_IgnorePreferredLayer
=
false
;
m_LayerLocked
=
0
;
m_LayerLocked
=
0
;
m_LayerVisible
=
aVisibleLayerMask
;
m_LayerVisible
=
aVisibleLayerMask
;
m_IgnoreLockedLayers
=
true
;
m_IgnoreLockedLayers
=
true
;
m_IgnoreNonVisibleLayers
=
true
;
m_IgnoreNonVisibleLayers
=
true
;
m_IgnoreLockedItems
=
false
;
m_IgnoreLockedItems
=
false
;
#if defined(USE_MATCH_LAYER)
#if defined(USE_MATCH_LAYER)
m_IncludeSecondary
=
false
;
m_IncludeSecondary
=
false
;
#else
#else
m_IncludeSecondary
=
true
;
m_IncludeSecondary
=
true
;
#endif
#endif
m_PreferredLayer
=
aPreferredLayer
;
m_PreferredLayer
=
aPreferredLayer
;
...
@@ -382,14 +382,14 @@ public:
...
@@ -382,14 +382,14 @@ public:
m_IgnoreModulesOnCu
=
true
;
// !Show_Modules_Cmp;
m_IgnoreModulesOnCu
=
true
;
// !Show_Modules_Cmp;
m_IgnoreModulesOnCmp
=
false
;
m_IgnoreModulesOnCmp
=
false
;
}
}
/**
/**
* Function IsLayerLocked
* Function IsLayerLocked
* @return bool - true if the given layer is locked, else false.
* @return bool - true if the given layer is locked, else false.
*/
*/
bool
IsLayerLocked
(
int
aLayer
)
const
{
return
(
1
<<
aLayer
)
&
m_LayerLocked
;
}
bool
IsLayerLocked
(
int
aLayer
)
const
{
return
(
1
<<
aLayer
)
&
m_LayerLocked
;
}
void
SetLayerLocked
(
int
aLayer
,
bool
isLocked
)
void
SetLayerLocked
(
int
aLayer
,
bool
isLocked
)
{
{
if
(
isLocked
)
if
(
isLocked
)
m_LayerLocked
|=
1
<<
aLayer
;
m_LayerLocked
|=
1
<<
aLayer
;
...
@@ -397,7 +397,7 @@ public:
...
@@ -397,7 +397,7 @@ public:
m_LayerLocked
&=
~
(
1
<<
aLayer
);
m_LayerLocked
&=
~
(
1
<<
aLayer
);
}
}
/**
/**
* Function IsLayerVisible
* Function IsLayerVisible
* @return bool - true if the given layer is visible, else false.
* @return bool - true if the given layer is visible, else false.
...
@@ -412,15 +412,15 @@ public:
...
@@ -412,15 +412,15 @@ public:
}
}
void
SetLayerVisibleBits
(
int
aLayerBits
)
{
m_LayerVisible
=
aLayerBits
;
}
void
SetLayerVisibleBits
(
int
aLayerBits
)
{
m_LayerVisible
=
aLayerBits
;
}
/**
/**
* Function IgnoreLockedLayers
* Function IgnoreLockedLayers
* @return bool - true if should ignore locked layers, else false.
* @return bool - true if should ignore locked layers, else false.
*/
*/
bool
IgnoreLockedLayers
()
const
{
return
m_IgnoreLockedLayers
;
}
bool
IgnoreLockedLayers
()
const
{
return
m_IgnoreLockedLayers
;
}
void
SetIgnoreLockedLayers
(
bool
ignore
)
{
m_IgnoreLockedLayers
=
ignore
;
}
void
SetIgnoreLockedLayers
(
bool
ignore
)
{
m_IgnoreLockedLayers
=
ignore
;
}
/**
/**
* Function IgnoredNonVisibleLayers
* Function IgnoredNonVisibleLayers
* @return bool - true if should ignore non-visible layers, else false.
* @return bool - true if should ignore non-visible layers, else false.
...
@@ -428,7 +428,7 @@ public:
...
@@ -428,7 +428,7 @@ public:
bool
IgnoreNonVisibleLayers
()
const
{
return
m_IgnoreNonVisibleLayers
;
}
bool
IgnoreNonVisibleLayers
()
const
{
return
m_IgnoreNonVisibleLayers
;
}
void
SetIgnoreNonVisibleLayers
(
bool
ignore
)
{
m_IgnoreLockedLayers
=
ignore
;
}
void
SetIgnoreNonVisibleLayers
(
bool
ignore
)
{
m_IgnoreLockedLayers
=
ignore
;
}
/**
/**
* Function GetPreferredLayer
* Function GetPreferredLayer
* @return int - the preferred layer for HitTest()ing.
* @return int - the preferred layer for HitTest()ing.
...
@@ -436,7 +436,7 @@ public:
...
@@ -436,7 +436,7 @@ public:
int
GetPreferredLayer
()
const
{
return
m_PreferredLayer
;
}
int
GetPreferredLayer
()
const
{
return
m_PreferredLayer
;
}
void
SetPreferredLayer
(
int
aLayer
)
{
m_PreferredLayer
=
aLayer
;
}
void
SetPreferredLayer
(
int
aLayer
)
{
m_PreferredLayer
=
aLayer
;
}
/**
/**
* Function IgnorePreferredLayer
* Function IgnorePreferredLayer
* provides wildcard behavior regarding the preferred layer.
* provides wildcard behavior regarding the preferred layer.
...
@@ -444,7 +444,7 @@ public:
...
@@ -444,7 +444,7 @@ public:
*/
*/
bool
IgnorePreferredLayer
()
const
{
return
m_IgnorePreferredLayer
;
}
bool
IgnorePreferredLayer
()
const
{
return
m_IgnorePreferredLayer
;
}
void
SetIgnorePreferredLayer
(
bool
ignore
)
{
m_IgnorePreferredLayer
=
ignore
;
}
void
SetIgnorePreferredLayer
(
bool
ignore
)
{
m_IgnorePreferredLayer
=
ignore
;
}
/**
/**
* Function IgnoreLockedItems
* Function IgnoreLockedItems
...
@@ -463,14 +463,14 @@ public:
...
@@ -463,14 +463,14 @@ public:
bool
IncludeSecondary
()
const
{
return
m_IncludeSecondary
;
}
bool
IncludeSecondary
()
const
{
return
m_IncludeSecondary
;
}
void
SetIncludeSecondary
(
bool
include
)
{
m_IncludeSecondary
=
include
;
}
void
SetIncludeSecondary
(
bool
include
)
{
m_IncludeSecondary
=
include
;
}
/**
/**
* Function IgnoreMTextsMarkedNoShow
* Function IgnoreMTextsMarkedNoShow
* @return bool - true if MTexts marked as "no show" should be ignored.
* @return bool - true if MTexts marked as "no show" should be ignored.
*/
*/
bool
IgnoreMTextsMarkedNoShow
()
const
{
return
m_IgnoreMTextsMarkedNoShow
;
}
bool
IgnoreMTextsMarkedNoShow
()
const
{
return
m_IgnoreMTextsMarkedNoShow
;
}
void
SetIgnoreMTextsMarkedNoShow
(
bool
ignore
)
{
m_IgnoreMTextsMarkedNoShow
=
ignore
;
}
void
SetIgnoreMTextsMarkedNoShow
(
bool
ignore
)
{
m_IgnoreMTextsMarkedNoShow
=
ignore
;
}
/**
/**
* Function IgnoreMTextsOnCu
* Function IgnoreMTextsOnCu
* @return bool - true if should ignore MTexts on copper layer.
* @return bool - true if should ignore MTexts on copper layer.
...
@@ -483,8 +483,8 @@ public:
...
@@ -483,8 +483,8 @@ public:
* @return bool - true if should ignore MTexts on component layer.
* @return bool - true if should ignore MTexts on component layer.
*/
*/
bool
IgnoreMTextsOnCmp
()
const
{
return
m_IgnoreMTextsOnCmp
;
}
bool
IgnoreMTextsOnCmp
()
const
{
return
m_IgnoreMTextsOnCmp
;
}
void
SetIgnoreMTextsOnCmp
(
bool
ignore
)
{
m_IgnoreMTextsOnCmp
=
ignore
;
}
void
SetIgnoreMTextsOnCmp
(
bool
ignore
)
{
m_IgnoreMTextsOnCmp
=
ignore
;
}
/**
/**
* Function IgnoreModulesOnCu
* Function IgnoreModulesOnCu
* @return bool - true if should ignore MODULEs on copper layer.
* @return bool - true if should ignore MODULEs on copper layer.
...
@@ -508,7 +508,7 @@ public:
...
@@ -508,7 +508,7 @@ public:
*/
*/
class
TYPE_COLLECTOR
:
public
COLLECTOR
class
TYPE_COLLECTOR
:
public
COLLECTOR
{
{
public
:
public
:
/**
/**
...
@@ -524,24 +524,24 @@ public:
...
@@ -524,24 +524,24 @@ public:
return
(
BOARD_ITEM
*
)
m_List
[
ndx
];
return
(
BOARD_ITEM
*
)
m_List
[
ndx
];
return
NULL
;
return
NULL
;
}
}
/**
/**
* Function Inspect
* Function Inspect
* is the examining function within the INSPECTOR which is passed to the
* is the examining function within the INSPECTOR which is passed to the
* Iterate function.
* Iterate function.
*
*
* @param testItem An EDA_BaseStruct to examine.
* @param testItem An EDA_BaseStruct to examine.
* @param testData is not used in this class.
* @param testData is not used in this class.
* @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan,
* @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan,
* else SCAN_CONTINUE;
* else SCAN_CONTINUE;
*/
*/
SEARCH_RESULT
Inspect
(
EDA_BaseStruct
*
testItem
,
const
void
*
testData
);
SEARCH_RESULT
Inspect
(
EDA_BaseStruct
*
testItem
,
const
void
*
testData
);
/**
/**
* Function Collect
* Function Collect
* scans a BOARD_ITEM using this class's Inspector method, which does
* scans a BOARD_ITEM using this class's Inspector method, which does
* the collection.
* the collection.
* @param aBoard The BOARD_ITEM to scan.
* @param aBoard The BOARD_ITEM to scan.
* @param aScanList The KICAD_Ts to gather up.
* @param aScanList The KICAD_Ts to gather up.
...
...
pcbnew/surbrill.cpp
View file @
1b39dfc7
...
@@ -92,22 +92,22 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
...
@@ -92,22 +92,22 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
{
{
if
(
g_HightLigt_Status
)
if
(
g_HightLigt_Status
)
Hight_Light
(
DC
);
Hight_Light
(
DC
);
// use this scheme because of pad is higher priority than tracks in the
// use this scheme because of pad is higher priority than tracks in the
// search, and finding a pad, instead of a track on a pad,
// search, and finding a pad, instead of a track on a pad,
// allows us to fire a message to eescema.
// allows us to fire a message to eescema.
GENERAL_COLLECTORS_GUIDE
guide
=
GetCollectorsGuide
();
GENERAL_COLLECTORS_GUIDE
guide
=
GetCollectorsGuide
();
// optionally, modify the "guide" here as needed using its member functions
// optionally, modify the "guide" here as needed using its member functions
m_Collector
->
Collect
(
m_Pcb
,
GENERAL_COLLECTOR
::
Pads
OrTracks
,
m_Collector
->
Collect
(
m_Pcb
,
GENERAL_COLLECTOR
::
Pads
TracksOrZones
,
GetScreen
()
->
RefPos
(
true
),
guide
);
GetScreen
()
->
RefPos
(
true
),
guide
);
BOARD_ITEM
*
item
=
(
*
m_Collector
)[
0
];
BOARD_ITEM
*
item
=
(
*
m_Collector
)[
0
];
if
(
item
)
if
(
item
)
{
{
switch
(
item
->
Type
()
)
switch
(
item
->
Type
()
)
...
@@ -117,7 +117,7 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
...
@@ -117,7 +117,7 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
Hight_Light
(
DC
);
Hight_Light
(
DC
);
SendMessageToEESCHEMA
(
item
);
SendMessageToEESCHEMA
(
item
);
return
g_HightLigth_NetCode
;
return
g_HightLigth_NetCode
;
case
TYPETRACK
:
case
TYPETRACK
:
case
TYPEVIA
:
case
TYPEVIA
:
case
TYPEZONE
:
case
TYPEZONE
:
...
@@ -126,13 +126,18 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
...
@@ -126,13 +126,18 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
g_HightLigth_NetCode
=
((
TRACK
*
)
item
)
->
GetNet
();
g_HightLigth_NetCode
=
((
TRACK
*
)
item
)
->
GetNet
();
Hight_Light
(
DC
);
Hight_Light
(
DC
);
return
g_HightLigth_NetCode
;
return
g_HightLigth_NetCode
;
case
TYPEZONE_CONTAINER
:
g_HightLigth_NetCode
=
((
ZONE_CONTAINER
*
)
item
)
->
GetNet
();
Hight_Light
(
DC
);
return
g_HightLigth_NetCode
;
default
:
default
:
;
// until somebody changes GENERAL_COLLECTOR::PadsOrTracks,
;
// until somebody changes GENERAL_COLLECTOR::PadsOrTracks,
// this should not happen.
// this should not happen.
}
}
}
}
return
-
1
;
// HitTest() failed.
return
-
1
;
// HitTest() failed.
}
}
...
@@ -158,30 +163,37 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode )
...
@@ -158,30 +163,37 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode )
/* Turn On or OFF the HightLight for trcak and pads with the netcode "NetCode'
/* Turn On or OFF the HightLight for trcak and pads with the netcode "NetCode'
*/
*/
{
{
TRACK
*
pts
;
MODULE
*
Module
;
if
(
g_HightLigt_Status
)
if
(
g_HightLigt_Status
)
draw_mode
=
GR_SURBRILL
|
GR_OR
;
draw_mode
=
GR_SURBRILL
|
GR_OR
;
else
else
draw_mode
=
GR_AND
|
GR_SURBRILL
;
draw_mode
=
GR_AND
|
GR_SURBRILL
;
Module
=
m_Pcb
->
m_Modules
;
/* Redraw pads */
/* Redraw pads */
for
(
;
Module
!=
NULL
;
Module
=
(
MODULE
*
)
Module
->
Pnext
)
for
(
MODULE
*
module
=
m_Pcb
->
m_Modules
;
module
;
module
=
module
->
Next
()
)
{
{
Pad_Surbrillance
(
DrawPanel
,
DC
,
M
odule
,
NetCode
);
Pad_Surbrillance
(
DrawPanel
,
DC
,
m
odule
,
NetCode
);
}
}
/* Redraw track and vias: */
/* Redraw track and vias: */
for
(
pts
=
m_Pcb
->
m_Track
;
pts
!=
NULL
;
pts
=
(
TRACK
*
)
pts
->
Pnext
)
for
(
TRACK
*
pts
=
m_Pcb
->
m_Track
;
pts
;
pts
=
pts
->
Next
()
)
{
{
if
(
pts
->
GetNet
()
==
NetCode
)
if
(
pts
->
GetNet
()
==
NetCode
)
{
{
pts
->
Draw
(
DrawPanel
,
DC
,
draw_mode
);
pts
->
Draw
(
DrawPanel
,
DC
,
draw_mode
);
}
}
}
}
wxPoint
zero
(
0
,
0
);
// construct outside loop for speed
// Redraw ZONE_CONTAINERS
BOARD
::
ZONE_CONTAINERS
&
zones
=
m_Pcb
->
m_ZoneDescriptorList
;
for
(
BOARD
::
ZONE_CONTAINERS
::
iterator
zc
=
zones
.
begin
();
zc
!=
zones
.
end
();
++
zc
)
{
if
(
(
*
zc
)
->
GetNet
()
==
NetCode
)
{
(
*
zc
)
->
Draw
(
DrawPanel
,
DC
,
zero
,
draw_mode
);
}
}
}
}
...
@@ -193,12 +205,14 @@ static void Pad_Surbrillance( WinEDA_DrawPanel* panel,
...
@@ -193,12 +205,14 @@ static void Pad_Surbrillance( WinEDA_DrawPanel* panel,
{
{
D_PAD
*
pt_pad
;
D_PAD
*
pt_pad
;
wxPoint
zero
(
0
,
0
);
// construct outside loop for speed
/* trace des pastilles */
/* trace des pastilles */
for
(
pt_pad
=
Module
->
m_Pads
;
pt_pad
!=
NULL
;
pt_pad
=
(
D_PAD
*
)
pt_pad
->
Pnext
)
for
(
pt_pad
=
Module
->
m_Pads
;
pt_pad
!=
NULL
;
pt_pad
=
(
D_PAD
*
)
pt_pad
->
Pnext
)
{
{
if
(
pt_pad
->
GetNet
()
==
NetCode
)
if
(
pt_pad
->
GetNet
()
==
NetCode
)
{
{
pt_pad
->
Draw
(
panel
,
DC
,
wxPoint
(
0
,
0
)
,
draw_mode
);
pt_pad
->
Draw
(
panel
,
DC
,
zero
,
draw_mode
);
}
}
}
}
}
}
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