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
30ad817d
Commit
30ad817d
authored
Aug 30, 2007
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
started class COLLECTORS_GUIDE
parent
077a570b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
132 additions
and
18 deletions
+132
-18
change_log.txt
change_log.txt
+10
-0
pcbstruct.h
include/pcbstruct.h
+8
-7
classtrc.cpp.notused
pcbnew/classtrc.cpp.notused
+8
-11
collectors.cpp
pcbnew/collectors.cpp
+32
-0
collectors.h
pcbnew/collectors.h
+74
-0
No files found.
change_log.txt
View file @
30ad817d
...
@@ -4,6 +4,16 @@ Started 2007-June-11
...
@@ -4,6 +4,16 @@ 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.
2007-Aug-29 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+ pcbnew
Started abstract class COLLECTORS_GUIDE.
Renamed classtrc.cpp to classtrc.cpp.notused
Changed some comments in class BOARD's header to english, starting clarify
linked list contents.
2007-aug-27 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2007-aug-27 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
================================================================================
+ all
+ all
...
...
include/pcbstruct.h
View file @
30ad817d
...
@@ -167,8 +167,9 @@ public:
...
@@ -167,8 +167,9 @@ public:
int
m_ModuleTextCUColor
;
// Text module color for modules on the COPPER layer
int
m_ModuleTextCUColor
;
// Text module color for modules on the COPPER layer
int
m_ModuleTextNOVColor
;
// Text module color for "invisible" texts (must be BLACK if really not displayed)
int
m_ModuleTextNOVColor
;
// Text module color for "invisible" texts (must be BLACK if really not displayed)
int
m_AnchorColor
;
// Anchor color for modules and texts
int
m_AnchorColor
;
// Anchor color for modules and texts
int
m_PadCUColor
;
// Pad color for the COMPONENT side of the pad
int
m_PadCMPColor
;
// Pad color for the COPPER side of the pad
int
m_PadCUColor
;
// Pad color for the COPPER side of the pad
int
m_PadCMPColor
;
// Pad color for the COMPONENT side of the pad
// Pad color for the pads of both sides is m_PadCUColor OR m_PadCMPColor (in terms of colors)
// Pad color for the pads of both sides is m_PadCUColor OR m_PadCMPColor (in terms of colors)
int
m_RatsnestColor
;
// Ratsnest color
int
m_RatsnestColor
;
// Ratsnest color
...
@@ -211,11 +212,11 @@ public:
...
@@ -211,11 +212,11 @@ public:
int
m_NbSegmTrack
;
// nombre d'elements de type segments de piste
int
m_NbSegmTrack
;
// nombre d'elements de type segments de piste
int
m_NbSegmZone
;
// nombre d'elements de type segments de zone
int
m_NbSegmZone
;
// nombre d'elements de type segments de zone
BOARD_ITEM
*
m_Drawings
;
//
pointeur sur liste drawing
s
BOARD_ITEM
*
m_Drawings
;
//
linked list of lines & text
s
MODULE
*
m_Modules
;
//
pointeur sur liste zone module
s
MODULE
*
m_Modules
;
//
linked list of MODULE
s
EQUIPOT
*
m_Equipots
;
//
pointeur liste zone equipot
EQUIPOT
*
m_Equipots
;
//
linked list of nets
TRACK
*
m_Track
;
//
pointeur relatif zone piste
TRACK
*
m_Track
;
//
linked list of TRACKs and SEGVIAs
TRACK
*
m_Zone
;
//
pointeur tableau zone zones de cuivre
TRACK
*
m_Zone
;
//
linked list of SEGZONEs
D_PAD
**
m_Pads
;
// pointeur liste d'acces aux pads
D_PAD
**
m_Pads
;
// pointeur liste d'acces aux pads
int
m_NbPads
;
// nombre total de pads
int
m_NbPads
;
// nombre total de pads
CHEVELU
*
m_Ratsnest
;
// pointeur liste des chevelus
CHEVELU
*
m_Ratsnest
;
// pointeur liste des chevelus
...
...
pcbnew/classtrc.cpp
→
pcbnew/classtrc.cpp
.notused
View file @
30ad817d
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
#endif
#endif
/**************************************/
/**************************************/
/* Classes pour Pistes, Vias et Zones */
/* Classes pour Pistes, Vias et Zones */
/**************************************/
/**************************************/
...
@@ -110,14 +111,6 @@ void SEGVIA::ReturnLayerPair( int* top_layer, int* bottom_layer )
...
@@ -110,14 +111,6 @@ void SEGVIA::ReturnLayerPair( int* top_layer, int* bottom_layer )
}
}
/************************/
TRACK
*
TRACK
::
Next
(
void
)
/************************/
{
return
(
TRACK
*
)
Pnext
;
}
/* supprime du chainage la structure Struct
/* supprime du chainage la structure Struct
* les structures arrieres et avant sont chainees directement
* les structures arrieres et avant sont chainees directement
*/
*/
...
@@ -170,7 +163,8 @@ void TRACK::Insert( BOARD* Pcb, EDA_BaseStruct* InsertPoint )
...
@@ -170,7 +163,8 @@ void TRACK::Insert( BOARD* Pcb, EDA_BaseStruct* InsertPoint )
* Si InsertPoint == NULL, insertion en tete de liste
* Si InsertPoint == NULL, insertion en tete de liste
*/
*/
{
{
TRACK
*
track
,
*
NextS
;
TRACK* track;
TRACK* NextS;
/* Insertion du debut de la chaine a greffer */
/* Insertion du debut de la chaine a greffer */
if( InsertPoint == NULL )
if( InsertPoint == NULL )
...
@@ -257,9 +251,11 @@ TRACK* TRACK::GetStartNetCode( int NetCode )
...
@@ -257,9 +251,11 @@ TRACK* TRACK::GetStartNetCode( int NetCode )
{
{
if( Track->m_NetCode > NetCode )
if( Track->m_NetCode > NetCode )
break;
break;
if( Track->m_NetCode == NetCode )
if( Track->m_NetCode == NetCode )
{
{
ii
++
;
break
;
ii++;
break;
}
}
Track = (TRACK*) Track->Pnext;
Track = (TRACK*) Track->Pnext;
}
}
...
@@ -276,7 +272,8 @@ TRACK* TRACK::GetStartNetCode( int NetCode )
...
@@ -276,7 +272,8 @@ TRACK* TRACK::GetStartNetCode( int NetCode )
*/
*/
TRACK* TRACK::GetEndNetCode( int NetCode )
TRACK* TRACK::GetEndNetCode( int NetCode )
{
{
TRACK
*
NextS
,
*
Track
=
this
;
TRACK* NextS;
TRACK* Track = this;
int ii = 0;
int ii = 0;
if( Track == NULL )
if( Track == NULL )
...
...
pcbnew/collectors.cpp
View file @
30ad817d
...
@@ -175,6 +175,38 @@ void GENERALCOLLECTOR::Scan( BOARD* board, const wxPoint& refPos,
...
@@ -175,6 +175,38 @@ void GENERALCOLLECTOR::Scan( BOARD* board, const wxPoint& refPos,
}
}
// see collectors.h
void
GENERALCOLLECTOR
::
Scan
(
BOARD
*
board
,
const
wxPoint
&
refPos
,
const
COLLECTORS_GUIDE
&
guide
)
{
Empty
();
// empty the collection, primary criteria list
Empty2nd
();
// empty the collection, secondary criteria list
// @todo: remember the guide here, pass it to Inspect()
/* remember where the snapshot was taken from and pass refPos to
the Inspect() function.
*/
SetRefPos
(
refPos
);
// visit the board with the INSPECTOR (me).
board
->
Visit
(
this
,
// INSPECTOR* inspector
NULL
,
// const void* testData, not used here
m_ScanTypes
);
SetTimeNow
();
// when snapshot was taken
// append 2nd list onto end of the first "list"
for
(
unsigned
i
=
0
;
i
<
list2nd
.
size
();
++
i
)
Append
(
list2nd
[
i
]
);
Empty2nd
();
}
#endif // DEBUG
#endif // DEBUG
//EOF
//EOF
pcbnew/collectors.h
View file @
30ad817d
...
@@ -33,6 +33,70 @@
...
@@ -33,6 +33,70 @@
#include "class_collector.h"
#include "class_collector.h"
/**
* Class COLLECTORS_GUIDE
* is an abstract base class that may be passed to a GENERALCOLLECTOR, telling
* it what should be collected (aside from HitTest()ing and KICAD_T scanTypes[],
* information which are provided to the GENERALCOLLECTOR through attributes or
* arguments separately).
* <p>
* This class introduces the notion of layer locking.
*/
class
COLLECTORS_GUIDE
{
public
:
virtual
~
COLLECTORS_GUIDE
()
{}
/**
* Function IsLayerLocked
* @return bool - true if the given layer is locked, else false.
*/
virtual
bool
IsLayerLocked
(
int
layer
)
const
=
0
;
/**
* Function IsCopperLayerVisible
* @return bool - true if the copper layer is visible.
*/
virtual
bool
IsCopperLayerVisible
()
const
=
0
;
/**
* Function IsComponentLayerVisible
* @return bool - true if the component layer is visible, else false.
*/
virtual
bool
IsComponentLayerVisible
()
const
=
0
;
/**
* Function IsLayerVisible
* @return bool - true if the given layer is visible, else false.
*/
virtual
bool
IsLayerVisible
(
int
layer
)
const
=
0
;
/**
* Function IgnoreLockedLayers
* @return bool - true if should ignored locked layers, else false.
*/
virtual
bool
IgnoreLockedLayers
()
const
=
0
;
/**
* Function IgnoredNonVisibleLayers
* @return bool - true if should ignore non-visible layers, else false.
*/
virtual
bool
IgnoreNonVisibleLayers
()
const
=
0
;
/**
* Function GetPreferredLayer
* @return int - the preferred layer for HitTest()ing.
*/
virtual
int
GetPreferredLayer
()
const
=
0
;
// more soon
};
/**
/**
* Class GENERALCOLLECTOR
* Class GENERALCOLLECTOR
* 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
...
@@ -144,6 +208,16 @@ public:
...
@@ -144,6 +208,16 @@ public:
* @param aLayerMask The layers, in bit-mapped form, meeting the secondary search criterion.
* @param aLayerMask The layers, in bit-mapped form, meeting the secondary search criterion.
*/
*/
void
Scan
(
BOARD
*
board
,
const
wxPoint
&
refPos
,
int
aPreferredLayer
,
int
aLayerMask
);
void
Scan
(
BOARD
*
board
,
const
wxPoint
&
refPos
,
int
aPreferredLayer
,
int
aLayerMask
);
/**
* Function Scan
* scans a BOARD using this class's Inspector method, which does the collection.
* @param board A BOARD to scan.
* @param refPos A wxPoint to use in hit-testing.
* @param guide The COLLECTORS_GUIDE to use in collecting items.
*/
void
Scan
(
BOARD
*
board
,
const
wxPoint
&
refPos
,
const
COLLECTORS_GUIDE
&
guide
);
};
};
...
...
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