Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c061ed67a | |||
| 9bfbe3acd8 | |||
| 40bdd26e39 | |||
| b0f8055377 | |||
| 33f4fc9873 | |||
| c90842dd08 | |||
| 310b4cdf75 | |||
| 2208e0db16 | |||
| cf4c403094 | |||
| dd55ffb75c | |||
| d34faf30cc | |||
| 3720a52ecb | |||
| 47de9f8f04 | |||
| 14378812be | |||
| 0070a4686e | |||
| 5c63df28e4 | |||
| e5ea37507c | |||
| 53bd87d792 | |||
| 02252be29d | |||
| 9e9598af5f |
@@ -29,6 +29,7 @@
|
||||
#include <kiface_base.h>
|
||||
#include <tools/eda_3d_controller.h>
|
||||
#include "eda_3d_actions.h"
|
||||
#include "dialogs/panel_preview_3d_model.h"
|
||||
#include <3d_rendering/opengl/render_3d_opengl.h>
|
||||
|
||||
|
||||
@@ -113,10 +114,36 @@ int EDA_3D_CONTROLLER::Main( const TOOL_EVENT& aEvent )
|
||||
// Main loop: keep receiving events
|
||||
while( TOOL_EVENT* evt = Wait() )
|
||||
{
|
||||
if( evt->IsClick( BUT_RIGHT ) )
|
||||
if( evt->IsCancelInteractive() )
|
||||
{
|
||||
wxWindow* canvas = m_toolMgr->GetToolHolder()->GetToolCanvas();
|
||||
wxWindow* topLevelParent = canvas->GetParent();
|
||||
|
||||
while( topLevelParent && !topLevelParent->IsTopLevel() )
|
||||
topLevelParent = topLevelParent->GetParent();
|
||||
|
||||
if( topLevelParent && dynamic_cast<DIALOG_SHIM*>( topLevelParent ) )
|
||||
{
|
||||
DIALOG_SHIM* dialog = static_cast<DIALOG_SHIM*>( topLevelParent );
|
||||
|
||||
if( dialog->IsQuasiModal() )
|
||||
dialog->EndQuasiModal( wxID_CANCEL );
|
||||
else
|
||||
dialog->EndModal( wxID_CANCEL );
|
||||
}
|
||||
else
|
||||
{
|
||||
evt->SetPassEvent();
|
||||
}
|
||||
}
|
||||
else if( evt->IsClick( BUT_RIGHT ) )
|
||||
{
|
||||
m_menu.ShowContextMenu();
|
||||
}
|
||||
else
|
||||
{
|
||||
evt->SetPassEvent();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 2015 Cirilo Bernardo <cirilo.bernardo@gmail.com>
|
||||
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2015-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2015-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -124,8 +124,10 @@ PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAM
|
||||
m_SizerPanelView->Add( m_previewPane, 1, wxEXPAND, 5 );
|
||||
|
||||
for( wxEventType eventType : { wxEVT_MENU_OPEN, wxEVT_MENU_CLOSE, wxEVT_MENU_HIGHLIGHT } )
|
||||
{
|
||||
Connect( eventType, wxMenuEventHandler( PANEL_PREVIEW_3D_MODEL::OnMenuEvent ), nullptr,
|
||||
this );
|
||||
}
|
||||
|
||||
#ifdef __WXOSX__
|
||||
// Call layout once to get the proper button sizes after the bitmaps have been set
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
# KiCad.
|
||||
#
|
||||
# Note: This version string should follow the semantic versioning system
|
||||
set( KICAD_SEMANTIC_VERSION "6.0.3" )
|
||||
set( KICAD_SEMANTIC_VERSION "6.0.4" )
|
||||
|
||||
# Default the version to the semantic version.
|
||||
# This is overridden by the git repository tag though (if using git)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
@@ -842,18 +842,6 @@ void GERBER_PLOTTER::plotArc( const SHAPE_ARC& aArc, bool aPlotInRegion )
|
||||
wxPoint start( aArc.GetP0() );
|
||||
wxPoint end( aArc.GetP1() );
|
||||
wxPoint center( aArc.GetCenter() );
|
||||
double startAngle = aArc.GetStartAngle();
|
||||
double endAngle = aArc.GetEndAngle();
|
||||
|
||||
if( startAngle > endAngle )
|
||||
{
|
||||
if( endAngle < 0.0 )
|
||||
endAngle = NormalizeAnglePos( endAngle ) ;
|
||||
else
|
||||
{
|
||||
startAngle = NormalizeAnglePos( startAngle ) - 3600.0;
|
||||
}
|
||||
}
|
||||
|
||||
if( !aPlotInRegion )
|
||||
MoveTo( start);
|
||||
@@ -861,14 +849,20 @@ void GERBER_PLOTTER::plotArc( const SHAPE_ARC& aArc, bool aPlotInRegion )
|
||||
LineTo( start );
|
||||
|
||||
DPOINT devEnd = userToDeviceCoordinates( end );
|
||||
DPOINT devCenter = userToDeviceCoordinates( center ) - userToDeviceCoordinates( start );
|
||||
DPOINT devCenter = userToDeviceCoordinates( center - start );
|
||||
VECTOR2I arcMidPoint = aArc.GetArcMid();
|
||||
|
||||
// We need to know if the arc is CW or CCW in device coordinates, so build this arc.
|
||||
SHAPE_ARC deviceArc( userToDeviceCoordinates( start ),
|
||||
userToDeviceCoordinates( wxPoint( arcMidPoint.x, arcMidPoint.y ) ),
|
||||
devEnd, 0 );
|
||||
|
||||
fprintf( m_outputFile, "G75*\n" ); // Multiquadrant (360 degrees) mode
|
||||
|
||||
if( startAngle > endAngle )
|
||||
fprintf( m_outputFile, "G03*\n" ); // Active circular interpolation, CCW
|
||||
else
|
||||
if( deviceArc.IsClockwise() )
|
||||
fprintf( m_outputFile, "G02*\n" ); // Active circular interpolation, CW
|
||||
else
|
||||
fprintf( m_outputFile, "G03*\n" ); // Active circular interpolation, CCW
|
||||
|
||||
fprintf( m_outputFile, "X%dY%dI%dJ%dD01*\n",
|
||||
KiROUND( devEnd.x ), KiROUND( devEnd.y ),
|
||||
|
||||
@@ -730,7 +730,8 @@ void CONNECTION_GRAPH::buildItemSubGraphs()
|
||||
SCH_CONNECTION* conn = aItem->GetOrInitConnection( sheet, this );
|
||||
bool unique = !( aItem->GetFlags() & CANDIDATE );
|
||||
|
||||
aItem->SetFlags( CANDIDATE );
|
||||
if( conn && !conn->SubgraphCode() )
|
||||
aItem->SetFlags( CANDIDATE );
|
||||
|
||||
return ( unique && conn && ( conn->SubgraphCode() == 0 ) );
|
||||
};
|
||||
|
||||
@@ -192,6 +192,8 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( evt->IsCancelInteractive() )
|
||||
{
|
||||
m_frame->GetInfoBar()->Dismiss();
|
||||
|
||||
if( symbol )
|
||||
{
|
||||
cleanup();
|
||||
@@ -430,6 +432,8 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( evt->IsCancelInteractive() )
|
||||
{
|
||||
m_frame->GetInfoBar()->Dismiss();
|
||||
|
||||
if( image )
|
||||
{
|
||||
cleanup();
|
||||
@@ -1063,6 +1067,8 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( evt->IsCancelInteractive() )
|
||||
{
|
||||
m_frame->GetInfoBar()->Dismiss();
|
||||
|
||||
if( item )
|
||||
{
|
||||
cleanup();
|
||||
@@ -1290,6 +1296,8 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( evt->IsCancelInteractive() )
|
||||
{
|
||||
m_frame->GetInfoBar()->Dismiss();
|
||||
|
||||
if( sheet )
|
||||
{
|
||||
cleanup();
|
||||
|
||||
@@ -1534,19 +1534,16 @@ void SCH_EDITOR_CONTROL::updatePastedSymbol( SCH_SYMBOL* aSymbol, SCH_SCREEN* aP
|
||||
}
|
||||
|
||||
if( aForceKeepAnnotations && !reference.IsEmpty() )
|
||||
{
|
||||
aSymbol->SetRef( &aPastePath, reference );
|
||||
aSymbol->SetValue( &aPastePath, value );
|
||||
aSymbol->SetFootprint( &aPastePath, footprint );
|
||||
}
|
||||
else
|
||||
{
|
||||
aSymbol->ClearAnnotation( &aPastePath );
|
||||
}
|
||||
|
||||
// We might clear annotations but always leave the original unit number from the paste
|
||||
// We might clear annotations but always leave the original unit number, value and footprint
|
||||
// from the paste
|
||||
aSymbol->SetUnitSelection( &aPastePath, unit );
|
||||
aSymbol->SetUnit( unit );
|
||||
aSymbol->SetValue( &aPastePath, value );
|
||||
aSymbol->SetFootprint( &aPastePath, footprint );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -164,7 +164,8 @@ private:
|
||||
|
||||
|
||||
SCH_LINE_WIRE_BUS_TOOL::SCH_LINE_WIRE_BUS_TOOL() :
|
||||
EE_TOOL_BASE<SCH_EDIT_FRAME>( "eeschema.InteractiveDrawingLineWireBus" )
|
||||
EE_TOOL_BASE<SCH_EDIT_FRAME>( "eeschema.InteractiveDrawingLineWireBus" ),
|
||||
m_inDrawingTool( false )
|
||||
{
|
||||
m_busUnfold = {};
|
||||
m_wires.reserve( 16 );
|
||||
@@ -278,6 +279,11 @@ bool SCH_LINE_WIRE_BUS_TOOL::IsDrawingLineWireOrBus( const SELECTION& aSelection
|
||||
|
||||
int SCH_LINE_WIRE_BUS_TOOL::DrawSegments( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
if( m_inDrawingTool )
|
||||
return 0;
|
||||
|
||||
REENTRANCY_GUARD guard( &m_inDrawingTool );
|
||||
|
||||
DRAW_SEGMENT_EVENT_PARAMS* params = aEvent.Parameter<DRAW_SEGMENT_EVENT_PARAMS*>();
|
||||
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
@@ -300,6 +306,11 @@ int SCH_LINE_WIRE_BUS_TOOL::DrawSegments( const TOOL_EVENT& aEvent )
|
||||
|
||||
int SCH_LINE_WIRE_BUS_TOOL::UnfoldBus( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
if( m_inDrawingTool )
|
||||
return 0;
|
||||
|
||||
REENTRANCY_GUARD guard( &m_inDrawingTool );
|
||||
|
||||
wxString* netPtr = aEvent.Parameter<wxString*>();
|
||||
wxString net;
|
||||
SCH_LINE* segment = nullptr;
|
||||
@@ -591,6 +602,8 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType,
|
||||
//
|
||||
if( evt->IsCancelInteractive() )
|
||||
{
|
||||
m_frame->GetInfoBar()->Dismiss();
|
||||
|
||||
if( segment || m_busUnfold.in_progress )
|
||||
{
|
||||
cleanup();
|
||||
|
||||
@@ -133,11 +133,10 @@ private:
|
||||
void computeBreakPoint( const std::pair<SCH_LINE*, SCH_LINE*>& aSegments, wxPoint& aPosition );
|
||||
|
||||
private:
|
||||
/// Data related to bus unfolding tool.
|
||||
BUS_UNFOLDING_T m_busUnfold;
|
||||
bool m_inDrawingTool; // Reentrancy guard
|
||||
|
||||
/// Storage for the line segments while drawing
|
||||
std::vector<SCH_LINE*> m_wires;
|
||||
BUS_UNFOLDING_T m_busUnfold;
|
||||
std::vector<SCH_LINE*> m_wires; // Lines being drawn
|
||||
};
|
||||
|
||||
#endif /* SCH_LINE_WIRE_BUS_TOOL_H */
|
||||
|
||||
@@ -384,6 +384,9 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
//
|
||||
else if( evt->IsCancelInteractive() || evt->IsActivate() )
|
||||
{
|
||||
if( evt->IsCancelInteractive() )
|
||||
m_frame->GetInfoBar()->Dismiss();
|
||||
|
||||
if( m_moveInProgress )
|
||||
{
|
||||
if( evt->IsActivate() )
|
||||
|
||||
@@ -118,6 +118,8 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( evt->IsCancelInteractive() )
|
||||
{
|
||||
m_frame->GetInfoBar()->Dismiss();
|
||||
|
||||
if( item )
|
||||
{
|
||||
cleanup();
|
||||
|
||||
@@ -536,6 +536,17 @@ void TransformArcToPolygon( SHAPE_POLY_SET& aCornerBuffer, const wxPoint& aStart
|
||||
const wxPoint& aMid, const wxPoint& aEnd, int aWidth,
|
||||
int aError, ERROR_LOC aErrorLoc )
|
||||
{
|
||||
SEG startToEnd( aStart, aEnd );
|
||||
int distanceToMid = startToEnd.Distance( aMid );
|
||||
|
||||
if( distanceToMid <= 1 )
|
||||
{
|
||||
// Not an arc but essentially a straight line with a small error
|
||||
TransformOvalToPolygon( aCornerBuffer, aStart, aEnd, aWidth + distanceToMid, aError,
|
||||
aErrorLoc );
|
||||
return;
|
||||
}
|
||||
|
||||
SHAPE_ARC arc( aStart, aMid, aEnd, aWidth );
|
||||
// Currentlye have currently 2 algos:
|
||||
// the first approximates the thick arc from its outlines
|
||||
|
||||
@@ -1518,7 +1518,7 @@ bool SHAPE_POLY_SET::Collide( const SHAPE* aShape, int aClearance, int* aActual,
|
||||
return false;
|
||||
}
|
||||
|
||||
const_cast<SHAPE_POLY_SET*>( this )->CacheTriangulation( true );
|
||||
const_cast<SHAPE_POLY_SET*>( this )->CacheTriangulation( false );
|
||||
|
||||
int actual = INT_MAX;
|
||||
VECTOR2I location;
|
||||
|
||||
@@ -204,6 +204,9 @@ int PL_EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
//
|
||||
else if( evt->IsCancelInteractive() || evt->IsActivate() )
|
||||
{
|
||||
if( evt->IsCancelInteractive() )
|
||||
m_frame->GetInfoBar()->Dismiss();
|
||||
|
||||
if( m_moveInProgress )
|
||||
{
|
||||
if( evt->IsActivate() )
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -160,6 +160,7 @@ void DIALOG_FOOTPRINT_CHECKER::runChecks()
|
||||
|
||||
void DIALOG_FOOTPRINT_CHECKER::SetMarkersProvider( RC_ITEMS_PROVIDER* aProvider )
|
||||
{
|
||||
m_markersProvider = aProvider;
|
||||
m_markersTreeModel->SetProvider( aProvider );
|
||||
updateDisplayedCounts();
|
||||
}
|
||||
|
||||
+31
-2
@@ -310,11 +310,37 @@ public:
|
||||
*/
|
||||
bool QueryColliding( EDA_RECT aBox, SHAPE* aRefShape, PCB_LAYER_ID aLayer ) const
|
||||
{
|
||||
SHAPE_POLY_SET* poly = dynamic_cast<SHAPE_POLY_SET*>( aRefShape );
|
||||
|
||||
int min[2] = { aBox.GetX(), aBox.GetY() };
|
||||
int max[2] = { aBox.GetRight(), aBox.GetBottom() };
|
||||
bool collision = false;
|
||||
|
||||
auto visit =
|
||||
// Special case the polygon case. Otherwise we'll call its Collide() method which will
|
||||
// triangulate it as well and then do triangle/triangle collisions. This ends up being
|
||||
// slower than 4 calls to PointInside().
|
||||
auto polyVisitor =
|
||||
[&]( ITEM_WITH_SHAPE* aItem ) -> bool
|
||||
{
|
||||
SHAPE* shape = aItem->shape;
|
||||
wxASSERT( dynamic_cast<SHAPE_POLY_SET::TRIANGULATED_POLYGON::TRI*>( shape ) );
|
||||
auto tri = static_cast<SHAPE_POLY_SET::TRIANGULATED_POLYGON::TRI*>( shape );
|
||||
|
||||
const SHAPE_LINE_CHAIN& outline = poly->Outline( 0 );
|
||||
|
||||
if( outline.PointInside( tri->GetPoint( 0 ) )
|
||||
|| outline.PointInside( tri->GetPoint( 1 ) )
|
||||
|| outline.PointInside( tri->GetPoint( 2 ) )
|
||||
|| tri->PointInside( outline.CPoint( 0 ) ) )
|
||||
{
|
||||
collision = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
auto visitor =
|
||||
[&]( ITEM_WITH_SHAPE* aItem ) -> bool
|
||||
{
|
||||
if( aRefShape->Collide( aItem->shape, 0 ) )
|
||||
@@ -326,7 +352,10 @@ public:
|
||||
return true;
|
||||
};
|
||||
|
||||
this->m_tree[aLayer]->Search( min, max, visit );
|
||||
if( poly && poly->OutlineCount() == 1 )
|
||||
this->m_tree[aLayer]->Search( min, max, polyVisitor );
|
||||
else
|
||||
this->m_tree[aLayer]->Search( min, max, visitor );
|
||||
|
||||
return collision;
|
||||
}
|
||||
|
||||
@@ -440,9 +440,10 @@ bool calcIsInsideArea( BOARD_ITEM* aItem, const EDA_RECT& aItemBBox, PCB_EXPR_CO
|
||||
ZONE* aArea )
|
||||
{
|
||||
BOARD* board = aArea->GetBoard();
|
||||
EDA_RECT areaBBox = aArea->GetBoundingBox();
|
||||
std::shared_ptr<SHAPE> shape;
|
||||
|
||||
if( !aArea->GetBoundingBox().Intersects( aItemBBox ) )
|
||||
if( !areaBBox.Intersects( aItemBBox ) )
|
||||
return false;
|
||||
|
||||
// Collisions include touching, so we need to deflate outline by enough to exclude it.
|
||||
@@ -546,7 +547,7 @@ bool calcIsInsideArea( BOARD_ITEM* aItem, const EDA_RECT& aItemBBox, PCB_EXPR_CO
|
||||
{
|
||||
if( aCtx->GetLayer() == layer || aCtx->GetLayer() == UNDEFINED_LAYER )
|
||||
{
|
||||
if( zoneRTree->QueryColliding( aItemBBox, &areaOutline, layer ) )
|
||||
if( zoneRTree->QueryColliding( areaBBox, &areaOutline, layer ) )
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2087,6 +2087,7 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili
|
||||
const ZONE* zone = nullptr;
|
||||
const PCB_VIA* via = nullptr;
|
||||
const PAD* pad = nullptr;
|
||||
const FP_TEXT* text = nullptr;
|
||||
|
||||
switch( aItem->Type() )
|
||||
{
|
||||
@@ -2145,6 +2146,11 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili
|
||||
case PCB_FP_TEXT_T:
|
||||
if( m_isFootprintEditor )
|
||||
{
|
||||
text = static_cast<const FP_TEXT*>( aItem );
|
||||
|
||||
if( !text->IsVisible() && !view()->IsLayerVisible( LAYER_MOD_TEXT_INVISIBLE ) )
|
||||
return false;
|
||||
|
||||
if( !view()->IsLayerVisible( aItem->GetLayer() ) )
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1090,6 +1090,8 @@ void ZONE::CacheTriangulation( PCB_LAYER_ID aLayer )
|
||||
{
|
||||
for( std::pair<const PCB_LAYER_ID, SHAPE_POLY_SET>& pair : m_FilledPolysList )
|
||||
pair.second.CacheTriangulation();
|
||||
|
||||
m_Poly->CacheTriangulation( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user