From 363709e7a930ba925df26964da5a50586e3de6b2 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 6 Feb 2014 14:45:33 +0100 Subject: [PATCH] Added TOOL_INTERACTIVE::Activate(). Removed an unnecessary header from class_board_item.h. --- common/tool/tool_interactive.cpp | 6 ++++++ include/class_board_item.h | 1 - include/tool/tool_interactive.h | 6 ++++++ pcbnew/ratsnest_data.cpp | 4 ++-- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/common/tool/tool_interactive.cpp b/common/tool/tool_interactive.cpp index 33756cf3d8..14ea61a86a 100644 --- a/common/tool/tool_interactive.cpp +++ b/common/tool/tool_interactive.cpp @@ -46,6 +46,12 @@ TOOL_INTERACTIVE::~TOOL_INTERACTIVE() } +void TOOL_INTERACTIVE::Activate() +{ + m_toolMgr->InvokeTool( m_toolId ); +} + + OPT_TOOL_EVENT TOOL_INTERACTIVE::Wait( const TOOL_EVENT_LIST& aEventList ) { return m_toolMgr->ScheduleWait( this, aEventList ); diff --git a/include/class_board_item.h b/include/class_board_item.h index 8a49d87b0c..d438483502 100644 --- a/include/class_board_item.h +++ b/include/class_board_item.h @@ -33,7 +33,6 @@ #include #include -#include #include /// Abbrevation for fomatting internal units to a string. diff --git a/include/tool/tool_interactive.h b/include/tool/tool_interactive.h index 7e816bd3a4..1888011b5f 100644 --- a/include/tool/tool_interactive.h +++ b/include/tool/tool_interactive.h @@ -48,6 +48,12 @@ public: TOOL_INTERACTIVE( const std::string& aName ); virtual ~TOOL_INTERACTIVE(); + /** + * Function Activate() + * Runs the tool. After activation, the tool starts receiving events until it is finished. + */ + void Activate(); + /** * Function SetContextMenu() * diff --git a/pcbnew/ratsnest_data.cpp b/pcbnew/ratsnest_data.cpp index 430674887c..80d082a9b3 100644 --- a/pcbnew/ratsnest_data.cpp +++ b/pcbnew/ratsnest_data.cpp @@ -968,11 +968,11 @@ void RN_DATA::Recalculate( int aNet ) { if( aNet < 0 ) // Recompute everything { - unsigned int tid, i, chunk, netCount; + unsigned int i, netCount; netCount = m_board->GetNetCount(); - chunk = 1; #ifdef USE_OPENMP + unsigned int chunk = 1, tid; #pragma omp parallel shared(chunk, netCount) private(i, tid) { tid = omp_get_thread_num();