fix pads when parent module is not visible

This commit is contained in:
dickelbeck 2007-09-05 14:52:28 +00:00
parent 74a635c127
commit cbdecfdd42
1 changed files with 17 additions and 14 deletions

View File

@ -62,6 +62,7 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void* notUsed ) SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void* notUsed )
{ {
BOARD_ITEM* item = (BOARD_ITEM*) testItem; BOARD_ITEM* item = (BOARD_ITEM*) testItem;
MODULE* module = NULL;
#if 1 // debugging #if 1 // debugging
static int breakhere = 0; static int breakhere = 0;
@ -114,7 +115,9 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
switch( item->Type() ) switch( item->Type() )
{ {
case TYPEPAD: case TYPEPAD:
module = (MODULE*) item->GetParent();
break; break;
case TYPEVIA: case TYPEVIA:
break; break;
case TYPETRACK: case TYPETRACK:
@ -125,29 +128,19 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
break; break;
case TYPECOTATION: case TYPECOTATION:
break; break;
case TYPETEXTEMODULE: case TYPETEXTEMODULE:
{ {
module = (MODULE*) item->GetParent();
TEXTE_MODULE* tm = (TEXTE_MODULE*) item; TEXTE_MODULE* tm = (TEXTE_MODULE*) item;
MODULE* parent = (MODULE*)tm->GetParent();
if( m_Guide->IgnoreMTextsMarkedNoShow() && tm->m_NoShow ) if( m_Guide->IgnoreMTextsMarkedNoShow() && tm->m_NoShow )
goto exit; goto exit;
if( parent )
{
if( m_Guide->IgnoreMTextsOnCopper() && parent->GetLayer()==LAYER_CUIVRE_N )
goto exit;
if( m_Guide->IgnoreMTextsOnCmp() && parent->GetLayer()==LAYER_CMP_N )
goto exit;
}
} }
break; break;
case TYPEMODULE: case TYPEMODULE:
if( m_Guide->IgnoreModulesOnCu() && item->GetLayer()==LAYER_CUIVRE_N ) module = (MODULE*) item;
goto exit;
if( m_Guide->IgnoreModulesOnCmp() && item->GetLayer()==LAYER_CMP_N )
goto exit;
break; break;
default: default:
@ -157,6 +150,16 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
// common tests: // common tests:
if( module )
{
if( m_Guide->IgnoreMTextsOnCopper() && module->GetLayer()==LAYER_CUIVRE_N )
goto exit;
if( m_Guide->IgnoreMTextsOnCmp() && module->GetLayer()==LAYER_CMP_N )
goto exit;
}
if( item->IsOnLayer( m_Guide->GetPreferredLayer() ) || m_Guide->IgnorePreferredLayer() ) if( item->IsOnLayer( m_Guide->GetPreferredLayer() ) || m_Guide->IgnorePreferredLayer() )
{ {
int layer = item->GetLayer(); int layer = item->GetLayer();