Commit 8d90da0a authored by CHARRAS's avatar CHARRAS

reorder GENERAL_COLLECTOR lists in collectors.cpp due to markers change

parent 82a268a6
......@@ -215,7 +215,6 @@ bool MIREPCB::HitTest( const wxPoint& refPos )
int dX = refPos.x - m_Pos.x;
int dY = refPos.y - m_Pos.y;
int rayon = m_Size / 2;
return abs(dX)<=rayon && abs(dY)<=rayon;
}
......
......@@ -27,49 +27,48 @@
/* This module contains out of line member functions for classes given in
collectors.h. Those classes augment the functionality of class WinEDA_PcbFrame.
*/
* collectors.h. Those classes augment the functionality of class WinEDA_PcbFrame.
*/
// see collectors.h
const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
// there are some restrictions on the order of items in the general case.
// all items in m_Drawings for instance should be contiguous.
TYPETEXTE,
TYPEDRAWSEGMENT,
TYPEMARKER,
TYPECOTATION,
TYPEMIRE,
TYPEVIA,
TYPETRACK,
TYPEPAD,
TYPETEXTEMODULE,
TYPEMODULE,
TYPEZONE,
TYPEZONE_CONTAINER,
// *** all items in a same list (shown here) must be contigous ****
TYPEMARKER, // in m_markers
TYPETEXTE, // in m_Drawings
TYPEDRAWSEGMENT, // in m_Drawings
TYPECOTATION, // in m_Drawings
TYPEMIRE, // in m_Drawings
TYPEVIA, // in m_Tracks
TYPETRACK, // in m_Tracks
TYPEPAD, // in modules
TYPETEXTEMODULE, // in modules
TYPEMODULE, // in m_Modules
TYPEZONE, // in m_Zones
TYPEZONE_CONTAINER, // in m_ZoneDescriptorList
EOT
};
/*
const KICAD_T GENERAL_COLLECTOR::PrimaryItems[] = {
TYPETEXTE,
TYPEDRAWSEGMENT,
TYPEMARKER,
TYPECOTATION,
TYPEVIA,
TYPETRACK,
TYPEMODULE,
EOT
};
*/
* const KICAD_T GENERAL_COLLECTOR::PrimaryItems[] = {
* TYPETEXTE,
* TYPEDRAWSEGMENT,
* TYPECOTATION,
* TYPEVIA,
* TYPETRACK,
* TYPEMODULE,
* EOT
* };
*/
const KICAD_T GENERAL_COLLECTOR::AllButZones[] = {
TYPEMARKER,
TYPETEXTE,
TYPEDRAWSEGMENT,
TYPEMARKER,
TYPECOTATION,
TYPEMIRE,
TYPEVIA,
......@@ -138,48 +137,57 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
#if 0 // debugging
static int breakhere = 0;
switch( item->Type() )
{
case TYPEPAD:
{
MODULE* m = (MODULE*) item->GetParent();
if( m->GetReference() == wxT("Y2") )
if( m->GetReference() == wxT( "Y2" ) )
{
breakhere++;
}
}
break;
case TYPEVIA:
breakhere++;
break;
case TYPETRACK:
breakhere++;
break;
case TYPEZONE:
breakhere++;
break;
case TYPETEXTE:
breakhere++;
break;
case TYPEDRAWSEGMENT:
breakhere++;
break;
case TYPECOTATION:
breakhere++;
break;
case TYPETEXTEMODULE:
{
TEXTE_MODULE* tm = (TEXTE_MODULE*) item;
if( tm->m_Text == wxT("10uH") )
if( tm->m_Text == wxT( "10uH" ) )
{
breakhere++;
}
}
break;
case TYPEMODULE:
{
MODULE* m = (MODULE*) item;
if( m->GetReference() == wxT("C98") )
if( m->GetReference() == wxT( "C98" ) )
{
breakhere++;
}
......@@ -190,14 +198,16 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
breakhere++;
break;
}
#endif
switch( item->Type() )
{
case TYPEPAD:
// if pad is a thru hole, then it can be visible when its parent module is not.
if( ((D_PAD*)item)->m_Attribut != PAD_SMD ) // a hole is present, so multiple layers
if( ( (D_PAD*) item )->m_Attribut != PAD_SMD ) // a hole is present, so multiple layers
{
// there are no pad specific visibility controls at this time.
// proceed to the common tests below, but without the parent module test,
......@@ -209,23 +219,32 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
case TYPEVIA:
break;
case TYPETRACK:
break;
case TYPEZONE:
break;
case TYPEZONE_CONTAINER:
break;
case TYPETEXTE:
break;
case TYPEDRAWSEGMENT:
break;
case TYPECOTATION:
break;
case TYPEMIRE:
break;
case TYPETEXTEMODULE:
module = (MODULE*) item->GetParent();
if( m_Guide->IgnoreMTextsMarkedNoShow() && ((TEXTE_MODULE*)item)->m_NoShow )
if( m_Guide->IgnoreMTextsMarkedNoShow() && ( (TEXTE_MODULE*) item )->m_NoShow )
goto exit;
if( module )
......@@ -266,7 +285,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
// visibility controls. They all have their own separate visibility controls
if( module || m_Guide->IsLayerVisible( layer ) || !m_Guide->IgnoreNonVisibleLayers() )
{
if( !m_Guide->IsLayerLocked(layer) || !m_Guide->IgnoreLockedLayers() )
if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
{
if( !item->IsLocked() || !m_Guide->IgnoreLockedItems() )
{
......@@ -293,7 +312,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
// visibility controls. They all have their own separate visibility controls
if( module || m_Guide->IsLayerVisible( layer ) || !m_Guide->IgnoreNonVisibleLayers() )
{
if( !m_Guide->IsLayerLocked(layer) || !m_Guide->IgnoreLockedLayers() )
if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
{
if( !item->IsLocked() || !m_Guide->IgnoreLockedItems() )
{
......@@ -331,7 +350,7 @@ void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[],
// visit the board or module with the INSPECTOR (me).
aItem->Visit( this, // INSPECTOR* inspector
NULL, // const void* testData, not used here
m_ScanTypes);
m_ScanTypes );
SetTimeNow(); // when snapshot was taken
......@@ -339,7 +358,7 @@ void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[],
m_PrimaryLength = m_List.size();
// append 2nd list onto end of the first list
for( unsigned i=0; i<m_List2nd.size(); ++i )
for( unsigned i = 0; i<m_List2nd.size(); ++i )
Append( m_List2nd[i] );
Empty2nd();
......
......@@ -459,12 +459,15 @@ EDGE_ZONE* WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
if( diag == ZONE_ABORT )
return NULL;
GetScreen()->m_Active_Layer = s_Zone_Layer; // Set by the dialog frame
}
else /* Start a new contour: init zone params (net and layer) from an existing zone */
{
GetScreen()->m_Active_Layer = s_Zone_Layer = s_CurrentZone->GetLayer();
s_Zone_Hatching = s_CurrentZone->m_Poly->GetHatchStyle();
}
/* Show the Net */
if( g_HightLigt_Status && (g_HightLigth_NetCode != s_NetcodeSelection) )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment