Pcbnew encapsulation and code cleaning.

* Encapsulate most of the MODULE class.
* Start encapsulating the DIMENSION class.
* Lay some groundwork for EDA_TEXT encapsulation.
* Move cleverly hidden MODULE functions into class_module.cpp.
* Use std::swap to exchange TEXTE_PCB values for undo/redo.
* Remove unused members from MODULE class.
* The usual coding policy and documentation fixes.
This commit is contained in:
Wayne Stambaugh
2013-03-13 14:53:58 -04:00
parent 8287775bac
commit 42d7bf6c8e
54 changed files with 872 additions and 817 deletions
+6 -6
View File
@@ -408,10 +408,10 @@ void FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard( wxUpdateUIEvent& aEvent
PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) GetParent();
MODULE* module_in_edit = GetBoard()->m_Modules;
bool canInsert = ( module_in_edit && !module_in_edit->m_Link );
bool canInsert = ( module_in_edit && !module_in_edit->GetLink() );
// If the source was deleted, the module can inserted but not updated in the board.
if( module_in_edit && module_in_edit->m_Link ) // this is not a new module
if( module_in_edit && module_in_edit->GetLink() ) // this is not a new module
{
BOARD* mainpcb = frame->GetBoard();
MODULE* source_module = mainpcb->m_Modules;
@@ -419,7 +419,7 @@ void FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard( wxUpdateUIEvent& aEvent
// search if the source module was not deleted:
for( ; source_module != NULL; source_module = source_module->Next() )
{
if( module_in_edit->m_Link == source_module->GetTimeStamp() )
if( module_in_edit->GetLink() == source_module->GetTimeStamp() )
break;
}
@@ -435,9 +435,9 @@ void FOOTPRINT_EDIT_FRAME::OnUpdateReplaceModuleInBoard( wxUpdateUIEvent& aEvent
PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) GetParent();
MODULE* module_in_edit = GetBoard()->m_Modules;
bool canReplace = ( module_in_edit && module_in_edit->m_Link );
bool canReplace = ( module_in_edit && module_in_edit->GetLink() );
if( module_in_edit && module_in_edit->m_Link ) // this is not a new module
if( module_in_edit && module_in_edit->GetLink() ) // this is not a new module
{
BOARD* mainpcb = frame->GetBoard();
MODULE* source_module = mainpcb->m_Modules;
@@ -445,7 +445,7 @@ void FOOTPRINT_EDIT_FRAME::OnUpdateReplaceModuleInBoard( wxUpdateUIEvent& aEvent
// search if the source module was not deleted:
for( ; source_module != NULL; source_module = source_module->Next() )
{
if( module_in_edit->m_Link == source_module->GetTimeStamp() )
if( module_in_edit->GetLink() == source_module->GetTimeStamp() )
break;
}