Removed Show code from BOARD_ITEM derived classes (as requested by Dick)

This commit is contained in:
Lorenzo Marcantonio 2013-05-05 12:23:18 +02:00
parent e5dae4b149
commit af5a9a8de9
18 changed files with 11 additions and 277 deletions

View File

@ -2588,55 +2588,3 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter )
} }
} }
#if defined(DEBUG)
void BOARD::Show( int nestLevel, std::ostream& os ) const
{
BOARD_ITEM* p;
// for now, make it look like XML:
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << ">\n";
// specialization of the output:
NestedSpace( nestLevel + 1, os ) << "<modules>\n";
p = m_Modules;
for( ; p; p = p->Next() )
p->Show( nestLevel + 2, os );
NestedSpace( nestLevel + 1, os ) << "</modules>\n";
NestedSpace( nestLevel + 1, os ) << "<pdrawings>\n";
p = m_Drawings;
for( ; p; p = p->Next() )
p->Show( nestLevel + 2, os );
NestedSpace( nestLevel + 1, os ) << "</pdrawings>\n";
NestedSpace( nestLevel + 1, os ) << "<tracks>\n";
p = m_Track;
for( ; p; p = p->Next() )
p->Show( nestLevel + 2, os );
NestedSpace( nestLevel + 1, os ) << "</tracks>\n";
NestedSpace( nestLevel + 1, os ) << "<zones>\n";
p = m_Zone;
for( ; p; p = p->Next() )
p->Show( nestLevel + 2, os );
NestedSpace( nestLevel + 1, os ) << "</zones>\n";
NestedSpace( nestLevel+1, os ) << "<zone_containers>\n";
for( ZONE_CONTAINERS::const_iterator it = m_ZoneDescriptorList.begin();
it != m_ZoneDescriptorList.end(); ++it )
(*it)->Show( nestLevel+2, os );
NestedSpace( nestLevel+1, os ) << "</zone_containers>\n";
p = (BOARD_ITEM*) m_Son;
for( ; p; p = p->Next() )
{
p->Show( nestLevel + 1, os );
}
NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
}
#endif

View File

@ -1051,7 +1051,7 @@ public:
} }
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // overload void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif

View File

@ -145,7 +145,7 @@ public:
EDA_ITEM* Clone() const; EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif
}; };

View File

@ -543,25 +543,3 @@ EDA_ITEM* DRAWSEGMENT::Clone() const
return new DRAWSEGMENT( *this ); return new DRAWSEGMENT( *this );
} }
#if defined(DEBUG)
void DRAWSEGMENT::Show( int nestLevel, std::ostream& os ) const
{
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
" shape=\"" << m_Shape << '"' <<
/*
" layer=\"" << GetLayer() << '"' <<
" width=\"" << m_Width << '"' <<
" angle=\"" << m_Angle << '"' << // Used only for Arcs: Arc angle in 1/10 deg
*/
'>' <<
"<start" << m_Start << "/>" <<
"<end" << m_End << "/>"
"<GetStart" << GetStart() << "/>" <<
"<GetEnd" << GetEnd() << "/>"
;
os << "</" << GetClass().Lower().mb_str() << ">\n";
}
#endif

View File

@ -223,7 +223,7 @@ public:
virtual EDA_ITEM* Clone() const; virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // overload void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif
}; };

View File

@ -278,22 +278,3 @@ EDA_ITEM* EDGE_MODULE::Clone() const
return new EDGE_MODULE( *this ); return new EDGE_MODULE( *this );
} }
#if defined(DEBUG)
void EDGE_MODULE::Show( int nestLevel, std::ostream& os ) const
{
wxString shape = ShowShape( (STROKE_T) m_Shape );
// for now, make it look like XML:
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
" type=\"" << TO_UTF8( shape ) << "\">";
os << " <start" << m_Start0 << "/>";
os << " <end" << m_End0 << "/>";
os << " </" << GetClass().Lower().mb_str() << ">\n";
}
#endif

View File

@ -80,7 +80,7 @@ public:
EDA_ITEM* Clone() const; EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // overload void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif
//protected: @todo: is it just me? //protected: @todo: is it just me?

View File

@ -1000,51 +1000,3 @@ void MODULE::SetOrientation( double newangle )
CalculateBoundingBox(); CalculateBoundingBox();
} }
#if defined(DEBUG)
void MODULE::Show( int nestLevel, std::ostream& os ) const
{
// for now, make it look like XML, expand on this later.
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
" ref=\"" << m_Reference->GetText().mb_str() << '"' <<
" value=\"" << m_Value->GetText().mb_str() << '"' <<
" layer=\"" << GetLayerName().mb_str() << '"' <<
">\n";
NestedSpace( nestLevel + 1, os ) << "<boundingBox" << m_BoundaryBox.GetPosition()
<< m_BoundaryBox.GetSize() << "/>\n";
NestedSpace( nestLevel + 1, os ) << "<orientation tenths=\"" << m_Orient
<< "\"/>\n";
EDA_ITEM* p;
NestedSpace( nestLevel + 1, os ) << "<mpads>\n";
p = m_Pads;
for( ; p; p = p->Next() )
p->Show( nestLevel + 2, os );
NestedSpace( nestLevel + 1, os ) << "</mpads>\n";
NestedSpace( nestLevel + 1, os ) << "<mdrawings>\n";
p = m_Drawings;
for( ; p; p = p->Next() )
p->Show( nestLevel + 2, os );
NestedSpace( nestLevel + 1, os ) << "</mdrawings>\n";
p = m_Son;
for( ; p; p = p->Next() )
{
p->Show( nestLevel + 1, os );
}
NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str()
<< ">\n";
}
#endif

View File

@ -464,7 +464,7 @@ public:
static const wxChar* ReturnStringLibNameInvalidChars( bool aUserReadable ); static const wxChar* ReturnStringLibNameInvalidChars( bool aUserReadable );
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // overload virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif
private: private:

View File

@ -743,31 +743,3 @@ EDA_ITEM* D_PAD::Clone() const
return new D_PAD( *this ); return new D_PAD( *this );
} }
#if defined(DEBUG)
void D_PAD::Show( int nestLevel, std::ostream& os ) const
{
char padname[5] = { m_Padname[0], m_Padname[1], m_Padname[2], m_Padname[3], 0 };
char layerMask[16];
sprintf( layerMask, "0x%08X", m_layerMask );
// for now, make it look like XML:
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
" shape=\"" << ShowPadShape() << '"' <<
" attr=\"" << ShowPadAttr( ) << '"' <<
" num=\"" << padname << '"' <<
" net=\"" << m_Netname.mb_str() << '"' <<
" netcode=\"" << GetNet() << '"' <<
" layerMask=\"" << layerMask << '"' << m_Pos << "/>\n";
// NestedSpace( nestLevel+1, os ) << m_Text.mb_str() << '\n';
// NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str()
// << ">\n";
}
#endif

View File

@ -443,7 +443,7 @@ public:
void CopyNetlistSettings( D_PAD* aPad ); void CopyNetlistSettings( D_PAD* aPad );
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // overload virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif

View File

@ -187,18 +187,3 @@ EDA_ITEM* TEXTE_PCB::Clone() const
return new TEXTE_PCB( *this ); return new TEXTE_PCB( *this );
} }
#if defined(DEBUG)
void TEXTE_PCB::Show( int nestLevel, std::ostream& os ) const
{
// for now, make it look like XML:
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
" string=\"" << m_Text.mb_str() << "\"/>\n";
// NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str()
// << ">\n";
}
#endif

View File

@ -122,7 +122,7 @@ public:
EDA_ITEM* Clone() const; EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif
}; };

View File

@ -428,17 +428,3 @@ EDA_ITEM* TEXTE_MODULE::Clone() const
return new TEXTE_MODULE( *this ); return new TEXTE_MODULE( *this );
} }
#if defined(DEBUG)
void TEXTE_MODULE::Show( int nestLevel, std::ostream& os ) const
{
// for now, make it look like XML:
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
" string=\"" << m_Text.mb_str() << "\"/>\n";
// NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str()
// << ">\n";
}
#endif

View File

@ -150,7 +150,7 @@ public:
EDA_ITEM* Clone() const; EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // overload virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif
}; };

View File

@ -1543,73 +1543,6 @@ wxString TRACK::GetSelectMenuText() const
#if defined(DEBUG) #if defined(DEBUG)
void TRACK::Show( int nestLevel, std::ostream& os ) const
{
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
// " shape=\"" << m_Shape << '"' <<
" addr=\"" << std::hex << this << std::dec << '"' <<
" layer=\"" << m_Layer << '"' <<
" width=\"" << m_Width << '"' <<
" flags=\"" << m_Flags << '"' <<
" status=\"" << GetStatus( ) << '"' <<
// " drill=\"" << GetDrillValue() << '"' <<
" netcode=\"" << GetNet() << "\">" <<
"<start" << m_Start << "/>" <<
"<end" << m_End << "/>";
os << "</" << GetClass().Lower().mb_str() << ">\n";
}
void SEGVIA::Show( int nestLevel, std::ostream& os ) const
{
const char* cp;
switch( GetShape() )
{
case VIA_THROUGH:
cp = "through";
break;
case VIA_BLIND_BURIED:
cp = "blind/buried";
break;
case VIA_MICROVIA:
cp = "micro via";
break;
default:
case VIA_NOT_DEFINED:
cp = "undefined";
break;
}
LAYER_NUM topLayer;
LAYER_NUM botLayer;
BOARD* board = (BOARD*) m_Parent;
ReturnLayerPair( &topLayer, &botLayer );
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
" type=\"" << cp << '"';
if( board )
os << " layers=\"" << board->GetLayerName( topLayer ).mb_str() << ","
<< board->GetLayerName( botLayer ).mb_str() << '"';
os << " width=\"" << m_Width << '"'
<< " drill=\"" << GetDrillValue() << '"'
<< " netcode=\"" << GetNet() << "\">"
<< "<pos" << m_Start << "/>";
os << "</" << GetClass().Lower().mb_str() << ">\n";
}
wxString TRACK::ShowState( int stateBits ) wxString TRACK::ShowState( int stateBits )
{ {
wxString ret; wxString ret;

View File

@ -329,8 +329,7 @@ public:
virtual EDA_ITEM* Clone() const; virtual EDA_ITEM* Clone() const;
#if defined (DEBUG) #if defined (DEBUG)
virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
void Show( int nestLevel, std::ostream& os ) const; // overload
/** /**
* Function ShowState * Function ShowState
@ -414,7 +413,7 @@ public:
EDA_ITEM* Clone() const; EDA_ITEM* Clone() const;
#if defined (DEBUG) #if defined (DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // overload virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif
}; };

View File

@ -580,7 +580,7 @@ public:
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif