Loading 3d-viewer/3d_canvas.cpp +18 −28 Original line number Diff line number Diff line Loading @@ -491,17 +491,6 @@ void Pcb3D_GLCanvas::OnPaint( wxPaintEvent& event ) /*************************************************/ { wxPaintDC dc( this ); // Set the OpenGL viewport according to the client size of this canvas. // This is done here rather than in a wxSizeEvent handler because our // OpenGL rendering context (and thus viewport setting) is used with // multiple canvases: If we updated the viewport in the wxSizeEvent // handler, changing the size of one canvas causes a viewport setting that // is wrong when next another canvas is repainted. const wxSize ClientSize = GetClientSize(); glViewport( 0, 0, ClientSize.x, ClientSize.y ); Redraw(); event.Skip(); } Loading Loading @@ -529,6 +518,24 @@ void Pcb3D_GLCanvas::InitGL() m_init = TRUE; g_Parm_3D_Visu.m_Zoom = 1.0; ZBottom = 1.0; ZTop = 10.0; glDisable( GL_CULL_FACE ); // show back faces glEnable( GL_DEPTH_TEST ); // Enable z-buferring glEnable( GL_LINE_SMOOTH ); glEnable( GL_COLOR_MATERIAL ); glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE ); /* speedups */ glEnable( GL_DITHER ); glShadeModel( GL_SMOOTH ); glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST ); glHint( GL_POLYGON_SMOOTH_HINT, GL_FASTEST ); /* blend */ glEnable( GL_BLEND ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); } /* set viewing projection */ Loading Loading @@ -558,23 +565,6 @@ void Pcb3D_GLCanvas::InitGL() SetLights(); glDisable( GL_CULL_FACE ); // show back faces glEnable( GL_DEPTH_TEST ); // Enable z-buferring glEnable( GL_LINE_SMOOTH ); glEnable( GL_COLOR_MATERIAL ); glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE ); /* speedups */ glEnable( GL_DITHER ); glShadeModel( GL_SMOOTH ); glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST ); glHint( GL_POLYGON_SMOOTH_HINT, GL_FASTEST ); /* blend */ glEnable( GL_BLEND ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); } Loading 3d-viewer/3d_draw.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,17 @@ void Pcb3D_GLCanvas::Redraw( bool finish ) #else SetCurrent( ); #endif // Set the OpenGL viewport according to the client size of this canvas. // This is done here rather than in a wxSizeEvent handler because our // OpenGL rendering context (and thus viewport setting) is used with // multiple canvases: If we updated the viewport in the wxSizeEvent // handler, changing the size of one canvas causes a viewport setting that // is wrong when next another canvas is repainted. const wxSize ClientSize = GetClientSize(); // *MUST* be called after SetCurrent( ): glViewport( 0, 0, ClientSize.x, ClientSize.y ); InitGL(); glMatrixMode( GL_MODELVIEW ); /* position viewer */ Loading 3d-viewer/3d_frame.cpp +5 −9 Original line number Diff line number Diff line Loading @@ -77,11 +77,7 @@ WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent, ReCreateVToolbar(); // Make a Pcb3D_GLCanvas m_Canvas = new Pcb3D_GLCanvas( this ); /* init OpenGL once */ m_Canvas->InitGL(); } Loading Loading @@ -204,8 +200,8 @@ void WinEDA3D_DrawFrame::Process_Zoom( wxCommandEvent& event ) return; } m_Canvas->DisplayStatus(); m_Canvas->Refresh( FALSE ); m_Canvas->DisplayStatus(); } Loading Loading @@ -337,8 +333,8 @@ void WinEDA3D_DrawFrame::Process_Special_Functions( wxCommandEvent& event ) return; } m_Canvas->DisplayStatus(); m_Canvas->Refresh( true ); m_Canvas->DisplayStatus(); } Loading @@ -348,9 +344,9 @@ void WinEDA3D_DrawFrame::NewDisplay() { m_Canvas->ClearLists(); m_Canvas->CreateDrawGL_List(); m_Canvas->InitGL(); m_Canvas->DisplayStatus(); // m_Canvas->InitGL(); m_Canvas->Refresh( true ); m_Canvas->DisplayStatus(); } Loading eeschema/schematic_undo_redo.cpp +15 −3 Original line number Diff line number Diff line Loading @@ -208,11 +208,21 @@ void WinEDA_SchematicFrame::SaveCopyInUndoList( SCH_ITEM* aItem, * saved in Undo List (for Undo or Redo commands, saved wires will be exchanged with current wire list */ { /* Does not save a null item. * but if aCommandType == UR_WIRE_IMAGE, we must save null item. * It happens for the first wire entered in schematic: * To undo this first command, the previous state is a NULL item, * and we accept this */ if( aItem == NULL && (aCommandType != UR_WIRE_IMAGE) ) // Nothing to save return; SCH_ITEM* CopyOfItem; PICKED_ITEMS_LIST* commandToUndo = new PICKED_ITEMS_LIST(); commandToUndo->m_TransformPoint = aTransformPoint; ITEM_PICKER itemWrapper( aItem, aCommandType ); if( aItem ) itemWrapper.m_PickedItemType = aItem->Type(); switch( aCommandType ) Loading Loading @@ -270,6 +280,8 @@ void WinEDA_SchematicFrame::SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, for( unsigned ii = 0; ii < aItemsList.GetCount(); ii++ ) { SCH_ITEM* item = (SCH_ITEM*) aItemsList.GetPickedItem( ii ); if( item == NULL ) continue; UndoRedoOpType command = aItemsList.GetPickedItemStatus( ii ); if( command == UR_UNSPECIFIED ) { Loading Loading @@ -332,7 +344,7 @@ void WinEDA_SchematicFrame::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bo { ITEM_PICKER itemWrapper = aList->GetItemWrapper( ii ); item = (SCH_ITEM*) itemWrapper.m_PickedItem; wxASSERT( item ); if ( item ) item->m_Flags = 0; SCH_ITEM* image = (SCH_ITEM*) itemWrapper.m_Link; switch( itemWrapper.m_UndoRedoStatus ) Loading pcbnew/board_undo_redo.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -313,6 +313,9 @@ void WinEDA_PcbFrame::SaveCopyInUndoList( BOARD_ITEM* aItem, * */ { if( aItem == NULL ) // Nothing to save return; BOARD_ITEM* CopyOfItem; PICKED_ITEMS_LIST* commandToUndo = new PICKED_ITEMS_LIST(); Loading Loading
3d-viewer/3d_canvas.cpp +18 −28 Original line number Diff line number Diff line Loading @@ -491,17 +491,6 @@ void Pcb3D_GLCanvas::OnPaint( wxPaintEvent& event ) /*************************************************/ { wxPaintDC dc( this ); // Set the OpenGL viewport according to the client size of this canvas. // This is done here rather than in a wxSizeEvent handler because our // OpenGL rendering context (and thus viewport setting) is used with // multiple canvases: If we updated the viewport in the wxSizeEvent // handler, changing the size of one canvas causes a viewport setting that // is wrong when next another canvas is repainted. const wxSize ClientSize = GetClientSize(); glViewport( 0, 0, ClientSize.x, ClientSize.y ); Redraw(); event.Skip(); } Loading Loading @@ -529,6 +518,24 @@ void Pcb3D_GLCanvas::InitGL() m_init = TRUE; g_Parm_3D_Visu.m_Zoom = 1.0; ZBottom = 1.0; ZTop = 10.0; glDisable( GL_CULL_FACE ); // show back faces glEnable( GL_DEPTH_TEST ); // Enable z-buferring glEnable( GL_LINE_SMOOTH ); glEnable( GL_COLOR_MATERIAL ); glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE ); /* speedups */ glEnable( GL_DITHER ); glShadeModel( GL_SMOOTH ); glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST ); glHint( GL_POLYGON_SMOOTH_HINT, GL_FASTEST ); /* blend */ glEnable( GL_BLEND ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); } /* set viewing projection */ Loading Loading @@ -558,23 +565,6 @@ void Pcb3D_GLCanvas::InitGL() SetLights(); glDisable( GL_CULL_FACE ); // show back faces glEnable( GL_DEPTH_TEST ); // Enable z-buferring glEnable( GL_LINE_SMOOTH ); glEnable( GL_COLOR_MATERIAL ); glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE ); /* speedups */ glEnable( GL_DITHER ); glShadeModel( GL_SMOOTH ); glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST ); glHint( GL_POLYGON_SMOOTH_HINT, GL_FASTEST ); /* blend */ glEnable( GL_BLEND ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); } Loading
3d-viewer/3d_draw.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,17 @@ void Pcb3D_GLCanvas::Redraw( bool finish ) #else SetCurrent( ); #endif // Set the OpenGL viewport according to the client size of this canvas. // This is done here rather than in a wxSizeEvent handler because our // OpenGL rendering context (and thus viewport setting) is used with // multiple canvases: If we updated the viewport in the wxSizeEvent // handler, changing the size of one canvas causes a viewport setting that // is wrong when next another canvas is repainted. const wxSize ClientSize = GetClientSize(); // *MUST* be called after SetCurrent( ): glViewport( 0, 0, ClientSize.x, ClientSize.y ); InitGL(); glMatrixMode( GL_MODELVIEW ); /* position viewer */ Loading
3d-viewer/3d_frame.cpp +5 −9 Original line number Diff line number Diff line Loading @@ -77,11 +77,7 @@ WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent, ReCreateVToolbar(); // Make a Pcb3D_GLCanvas m_Canvas = new Pcb3D_GLCanvas( this ); /* init OpenGL once */ m_Canvas->InitGL(); } Loading Loading @@ -204,8 +200,8 @@ void WinEDA3D_DrawFrame::Process_Zoom( wxCommandEvent& event ) return; } m_Canvas->DisplayStatus(); m_Canvas->Refresh( FALSE ); m_Canvas->DisplayStatus(); } Loading Loading @@ -337,8 +333,8 @@ void WinEDA3D_DrawFrame::Process_Special_Functions( wxCommandEvent& event ) return; } m_Canvas->DisplayStatus(); m_Canvas->Refresh( true ); m_Canvas->DisplayStatus(); } Loading @@ -348,9 +344,9 @@ void WinEDA3D_DrawFrame::NewDisplay() { m_Canvas->ClearLists(); m_Canvas->CreateDrawGL_List(); m_Canvas->InitGL(); m_Canvas->DisplayStatus(); // m_Canvas->InitGL(); m_Canvas->Refresh( true ); m_Canvas->DisplayStatus(); } Loading
eeschema/schematic_undo_redo.cpp +15 −3 Original line number Diff line number Diff line Loading @@ -208,11 +208,21 @@ void WinEDA_SchematicFrame::SaveCopyInUndoList( SCH_ITEM* aItem, * saved in Undo List (for Undo or Redo commands, saved wires will be exchanged with current wire list */ { /* Does not save a null item. * but if aCommandType == UR_WIRE_IMAGE, we must save null item. * It happens for the first wire entered in schematic: * To undo this first command, the previous state is a NULL item, * and we accept this */ if( aItem == NULL && (aCommandType != UR_WIRE_IMAGE) ) // Nothing to save return; SCH_ITEM* CopyOfItem; PICKED_ITEMS_LIST* commandToUndo = new PICKED_ITEMS_LIST(); commandToUndo->m_TransformPoint = aTransformPoint; ITEM_PICKER itemWrapper( aItem, aCommandType ); if( aItem ) itemWrapper.m_PickedItemType = aItem->Type(); switch( aCommandType ) Loading Loading @@ -270,6 +280,8 @@ void WinEDA_SchematicFrame::SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, for( unsigned ii = 0; ii < aItemsList.GetCount(); ii++ ) { SCH_ITEM* item = (SCH_ITEM*) aItemsList.GetPickedItem( ii ); if( item == NULL ) continue; UndoRedoOpType command = aItemsList.GetPickedItemStatus( ii ); if( command == UR_UNSPECIFIED ) { Loading Loading @@ -332,7 +344,7 @@ void WinEDA_SchematicFrame::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bo { ITEM_PICKER itemWrapper = aList->GetItemWrapper( ii ); item = (SCH_ITEM*) itemWrapper.m_PickedItem; wxASSERT( item ); if ( item ) item->m_Flags = 0; SCH_ITEM* image = (SCH_ITEM*) itemWrapper.m_Link; switch( itemWrapper.m_UndoRedoStatus ) Loading
pcbnew/board_undo_redo.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -313,6 +313,9 @@ void WinEDA_PcbFrame::SaveCopyInUndoList( BOARD_ITEM* aItem, * */ { if( aItem == NULL ) // Nothing to save return; BOARD_ITEM* CopyOfItem; PICKED_ITEMS_LIST* commandToUndo = new PICKED_ITEMS_LIST(); Loading