Formatting.

This commit is contained in:
Jeff Young 2020-11-29 20:00:16 +00:00
parent 3da0ab1a9a
commit 3ca06700fc
4 changed files with 29 additions and 32 deletions

View File

@ -366,7 +366,6 @@ void EDA_3D_CANVAS::DoRePaint()
if( m_is_currently_painting.test_and_set() ) if( m_is_currently_painting.test_and_set() )
return; return;
// SwapBuffer requires the window to be shown before calling // SwapBuffer requires the window to be shown before calling
if( !IsShownOnScreen() ) if( !IsShownOnScreen() )
{ {
@ -389,8 +388,8 @@ void EDA_3D_CANVAS::DoRePaint()
// !TODO: implement error reporter // !TODO: implement error reporter
//WX_STRING_REPORTER errorReporter( &err_messages ); //WX_STRING_REPORTER errorReporter( &err_messages );
INFOBAR_REPORTER warningReporter( m_parentInfoBar ); INFOBAR_REPORTER warningReporter( m_parentInfoBar );
STATUSBAR_REPORTER activityReporter( STATUSBAR_REPORTER activityReporter( m_parentStatusBar,
m_parentStatusBar, static_cast<int>( EDA_3D_VIEWER_STATUSBAR::STATUS_TEXT ) ); (int) EDA_3D_VIEWER_STATUSBAR::STATUS_TEXT );
unsigned strtime = GetRunningMicroSecs(); unsigned strtime = GetRunningMicroSecs();
@ -463,11 +462,11 @@ void EDA_3D_CANVAS::DoRePaint()
// It reverts back to OpenGL mode if it was requested a raytracing // It reverts back to OpenGL mode if it was requested a raytracing
// render of the current scene. AND the mouse / camera is moving // render of the current scene. AND the mouse / camera is moving
if( ( m_mouse_is_moving || if( ( m_mouse_is_moving
m_camera_is_moving || || m_camera_is_moving
was_camera_changed || || was_camera_changed
windows_size_changed ) && || windows_size_changed )
m_render_raytracing_was_requested ) && m_render_raytracing_was_requested )
{ {
m_render_raytracing_was_requested = false; m_render_raytracing_was_requested = false;
m_3d_render = m_3d_render_ogl_legacy; m_3d_render = m_3d_render_ogl_legacy;
@ -510,10 +509,12 @@ void EDA_3D_CANVAS::DoRePaint()
if( ( m_boardAdapter.RenderEngineGet() == RENDER_ENGINE::OPENGL_LEGACY ) if( ( m_boardAdapter.RenderEngineGet() == RENDER_ENGINE::OPENGL_LEGACY )
&& m_3d_render_ogl_legacy->IsReloadRequestPending() ) && m_3d_render_ogl_legacy->IsReloadRequestPending() )
{
reloadRaytracingForIntersectionCalculations = true; reloadRaytracingForIntersectionCalculations = true;
}
requested_redraw = m_3d_render->Redraw( requested_redraw = m_3d_render->Redraw( m_mouse_was_moved || m_camera_is_moving,
m_mouse_was_moved || m_camera_is_moving, &activityReporter, &warningReporter ); &activityReporter, &warningReporter );
if( reloadRaytracingForIntersectionCalculations ) if( reloadRaytracingForIntersectionCalculations )
m_3d_render_raytracing->Reload( nullptr, nullptr, true ); m_3d_render_raytracing->Reload( nullptr, nullptr, true );

View File

@ -69,7 +69,10 @@ public:
int GetWaitForEditingTimeOut() override; int GetWaitForEditingTimeOut() override;
void SetCurrentIntersectedBoardItem( BOARD_ITEM* aCurrentIntersectedBoardItem ) { m_currentIntersectedBoardItem = aCurrentIntersectedBoardItem; } void SetCurrentIntersectedBoardItem( BOARD_ITEM* aCurrentIntersectedBoardItem )
{
m_currentIntersectedBoardItem = aCurrentIntersectedBoardItem;
}
private: private:
bool initializeOpenGL(); bool initializeOpenGL();

View File

@ -36,7 +36,6 @@
#include <functional> #include <functional>
using namespace std::placeholders; using namespace std::placeholders;
#include "pcb_draw_panel_gal.h"
BOARD_COMMIT::BOARD_COMMIT( PCB_TOOL_BASE* aTool ) BOARD_COMMIT::BOARD_COMMIT( PCB_TOOL_BASE* aTool )
{ {
@ -56,6 +55,7 @@ BOARD_COMMIT::~BOARD_COMMIT()
{ {
} }
COMMIT& BOARD_COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType ) COMMIT& BOARD_COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType )
{ {
// if aItem belongs a footprint, the full footprint will be saved // if aItem belongs a footprint, the full footprint will be saved
@ -71,16 +71,19 @@ COMMIT& BOARD_COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType )
return COMMIT::Stage( aItem, aChangeType ); return COMMIT::Stage( aItem, aChangeType );
} }
COMMIT& BOARD_COMMIT::Stage( std::vector<EDA_ITEM*>& container, CHANGE_TYPE aChangeType ) COMMIT& BOARD_COMMIT::Stage( std::vector<EDA_ITEM*>& container, CHANGE_TYPE aChangeType )
{ {
return COMMIT::Stage( container, aChangeType ); return COMMIT::Stage( container, aChangeType );
} }
COMMIT& BOARD_COMMIT::Stage( const PICKED_ITEMS_LIST& aItems, UNDO_REDO aModFlag ) COMMIT& BOARD_COMMIT::Stage( const PICKED_ITEMS_LIST& aItems, UNDO_REDO aModFlag )
{ {
return COMMIT::Stage( aItems, aModFlag ); return COMMIT::Stage( aItems, aModFlag );
} }
void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool aSetDirtyBit ) void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool aSetDirtyBit )
{ {
// Objects potentially interested in changes: // Objects potentially interested in changes:
@ -212,17 +215,17 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
break; break;
// Board items // Board items
case PCB_SHAPE_T: // a shape (normally not on copper layers) case PCB_SHAPE_T: // a shape (normally not on copper layers)
case PCB_TEXT_T: // a text on a layer case PCB_TEXT_T: // a text on a layer
case PCB_TRACE_T: // a track segment (segment on a copper layer) case PCB_TRACE_T: // a track segment (segment on a copper layer)
case PCB_ARC_T: // an arced track segment (segment on a copper layer) case PCB_ARC_T: // an arced track segment (segment on a copper layer)
case PCB_VIA_T: // a via (like track segment on a copper layer) case PCB_VIA_T: // a via (like track segment on a copper layer)
case PCB_DIM_ALIGNED_T: // a dimension (graphic item) case PCB_DIM_ALIGNED_T: // a dimension (graphic item)
case PCB_DIM_CENTER_T: case PCB_DIM_CENTER_T:
case PCB_DIM_ORTHOGONAL_T: case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T: // a leader dimension case PCB_DIM_LEADER_T: // a leader dimension
case PCB_TARGET_T: // a target (graphic item) case PCB_TARGET_T: // a target (graphic item)
case PCB_MARKER_T: // a marker used to show something case PCB_MARKER_T: // a marker used to show something
case PCB_ZONE_T: case PCB_ZONE_T:
view->Remove( boardItem ); view->Remove( boardItem );
@ -310,7 +313,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
} }
} }
if ( !m_isFootprintEditor ) if( !m_isFootprintEditor )
{ {
size_t num_changes = m_changes.size(); size_t num_changes = m_changes.size();
@ -451,8 +454,3 @@ void BOARD_COMMIT::Revert()
clear(); clear();
} }
bool BOARD_COMMIT::HasRemoveEntry( EDA_ITEM* aItem )
{
COMMIT::COMMIT_LINE* line = findEntry( aItem );
return line != nullptr && line->m_type == CHT_REMOVE;
}

View File

@ -51,11 +51,6 @@ public:
COMMIT& Stage( COMMIT& Stage(
const PICKED_ITEMS_LIST& aItems, UNDO_REDO aModFlag = UNDO_REDO::UNSPECIFIED ) override; const PICKED_ITEMS_LIST& aItems, UNDO_REDO aModFlag = UNDO_REDO::UNSPECIFIED ) override;
/*
* @return true iff the commit has an entry to remove aItem.
*/
bool HasRemoveEntry( EDA_ITEM* aItem );
private: private:
virtual EDA_ITEM* parentObject( EDA_ITEM* aItem ) const override; virtual EDA_ITEM* parentObject( EDA_ITEM* aItem ) const override;