Code formatting.
This commit is contained in:
parent
506e8c4d89
commit
766da1e494
|
@ -50,42 +50,46 @@ EDA_ITEM* TOOL_BASE::getModelInt() const
|
|||
return m_toolMgr->GetModel();
|
||||
}
|
||||
|
||||
|
||||
void TOOL_BASE::attachManager( TOOL_MANAGER* aManager )
|
||||
{
|
||||
m_toolMgr = aManager;
|
||||
m_toolSettings = TOOL_SETTINGS ( this );
|
||||
m_toolSettings = TOOL_SETTINGS( this );
|
||||
}
|
||||
|
||||
TOOL_SETTINGS::TOOL_SETTINGS ( TOOL_BASE *aTool )
|
||||
|
||||
TOOL_SETTINGS::TOOL_SETTINGS( TOOL_BASE* aTool )
|
||||
{
|
||||
m_tool = aTool;
|
||||
|
||||
if(!aTool)
|
||||
if( !aTool )
|
||||
{
|
||||
m_config = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
// fixme: make independent of pcbnew (post-stable)
|
||||
PCB_EDIT_FRAME *frame = aTool->getEditFrame<PCB_EDIT_FRAME> ();
|
||||
// fixme: make independent of pcbnew (post-stable)
|
||||
PCB_EDIT_FRAME* frame = aTool->getEditFrame<PCB_EDIT_FRAME>();
|
||||
|
||||
m_config = frame->GetSettings();
|
||||
}
|
||||
|
||||
TOOL_SETTINGS::~TOOL_SETTINGS ()
|
||||
{
|
||||
|
||||
TOOL_SETTINGS::~TOOL_SETTINGS()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
TOOL_SETTINGS& TOOL_BASE::GetSettings()
|
||||
{
|
||||
return m_toolSettings;
|
||||
}
|
||||
|
||||
wxString TOOL_SETTINGS::getKeyName(const wxString& entryName) const
|
||||
|
||||
wxString TOOL_SETTINGS::getKeyName( const wxString& aEntryName ) const
|
||||
{
|
||||
wxString key ( m_tool->GetName() );
|
||||
key += wxT(".");
|
||||
key += entryName;
|
||||
wxString key( m_tool->GetName() );
|
||||
key += wxT( "." );
|
||||
key += aEntryName;
|
||||
return key;
|
||||
}
|
||||
|
|
|
@ -38,37 +38,36 @@ class TOOL_BASE;
|
|||
class TOOL_SETTINGS
|
||||
{
|
||||
public:
|
||||
TOOL_SETTINGS ( TOOL_BASE *aTool = NULL );
|
||||
TOOL_SETTINGS ( TOOL_BASE* aTool = NULL );
|
||||
~TOOL_SETTINGS ();
|
||||
|
||||
template <class T>
|
||||
T Get( const wxString& aName, T aDefaultValue ) const
|
||||
{
|
||||
if(!m_config)
|
||||
if( !m_config )
|
||||
return aDefaultValue;
|
||||
|
||||
T tmp = aDefaultValue;
|
||||
|
||||
m_config->Read ( getKeyName( aName ), &tmp );
|
||||
m_config->Read( getKeyName( aName ), &tmp );
|
||||
return tmp;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void Set( const wxString& aName, const T &aValue )
|
||||
{
|
||||
if(!m_config)
|
||||
if( !m_config )
|
||||
return;
|
||||
|
||||
m_config->Write ( getKeyName( aName ), aValue );
|
||||
m_config->Write( getKeyName( aName ), aValue );
|
||||
}
|
||||
|
||||
private:
|
||||
wxString getKeyName(const wxString& entryName) const;
|
||||
wxString getKeyName( const wxString& aEntryName ) const;
|
||||
|
||||
wxConfigBase *m_config;
|
||||
TOOL_BASE *m_tool;
|
||||
wxConfigBase* m_config;
|
||||
TOOL_BASE* m_tool;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
|
@ -395,7 +395,7 @@ public:
|
|||
|
||||
void SaveSettings( wxConfigBase* aCfg ); // override virtual
|
||||
|
||||
wxConfigBase *GetSettings() { return config(); };
|
||||
wxConfigBase* GetSettings() { return config(); };
|
||||
|
||||
/**
|
||||
* Get the last net list read with the net list dialog box.
|
||||
|
|
|
@ -99,7 +99,7 @@ bool PNS_DP_MEANDER_PLACER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem )
|
|||
}
|
||||
|
||||
if( m_originPair.Gap() < 0 )
|
||||
m_originPair.SetGap( Router()->Sizes().DiffPairGap() );
|
||||
m_originPair.SetGap( Router()->Sizes().DiffPairGap() );
|
||||
|
||||
if( !m_originPair.PLine().SegmentCount() ||
|
||||
!m_originPair.NLine().SegmentCount() )
|
||||
|
@ -224,28 +224,28 @@ bool PNS_DP_MEANDER_PLACER::Move( const VECTOR2I& aP, PNS_ITEM* aEndItem )
|
|||
{
|
||||
SEG base = baselineSegment( sp );
|
||||
|
||||
DrawDebugSeg ( base, 3 );
|
||||
DrawDebugSeg( base, 3 );
|
||||
|
||||
while(sp.indexP >= curIndexP)
|
||||
while( sp.indexP >= curIndexP )
|
||||
{
|
||||
m_result.AddCorner( tunedP.CPoint(curIndexP), tunedN.CPoint(curIndexN) );
|
||||
m_result.AddCorner( tunedP.CPoint( curIndexP ), tunedN.CPoint( curIndexN ) );
|
||||
curIndexP++;
|
||||
}
|
||||
|
||||
while(sp.indexN >= curIndexN)
|
||||
while( sp.indexN >= curIndexN )
|
||||
{
|
||||
m_result.AddCorner( tunedP.CPoint(sp.indexP), tunedN.CPoint(curIndexN) );
|
||||
m_result.AddCorner( tunedP.CPoint( sp.indexP ), tunedN.CPoint( curIndexN ) );
|
||||
curIndexN++;
|
||||
}
|
||||
|
||||
m_result.MeanderSegment( base );
|
||||
}
|
||||
|
||||
while(curIndexP < tunedP.PointCount() )
|
||||
m_result.AddCorner( tunedP.CPoint(curIndexP++), tunedN.CPoint(curIndexN) );
|
||||
while( curIndexP < tunedP.PointCount() )
|
||||
m_result.AddCorner( tunedP.CPoint( curIndexP++ ), tunedN.CPoint( curIndexN ) );
|
||||
|
||||
while(curIndexN < tunedN.PointCount() )
|
||||
m_result.AddCorner( tunedP.CPoint(-1), tunedN.CPoint(curIndexN++) );
|
||||
while( curIndexN < tunedN.PointCount() )
|
||||
m_result.AddCorner( tunedP.CPoint( -1 ), tunedN.CPoint( curIndexN++ ) );
|
||||
|
||||
int dpLen = origPathLength();
|
||||
|
||||
|
|
|
@ -366,7 +366,7 @@ bool PNS_LINE_PLACER::rhWalkOnly( const VECTOR2I& aP, PNS_LINE& aNewHead )
|
|||
int effort = 0;
|
||||
bool rv = true, viaOk;
|
||||
|
||||
viaOk = buildInitialLine ( aP, initTrack );
|
||||
viaOk = buildInitialLine( aP, initTrack );
|
||||
|
||||
PNS_WALKAROUND walkaround( m_currentNode, Router() );
|
||||
|
||||
|
@ -402,8 +402,8 @@ bool PNS_LINE_PLACER::rhWalkOnly( const VECTOR2I& aP, PNS_LINE& aNewHead )
|
|||
|
||||
PNS_OPTIMIZER::Optimize( &walkFull, effort, m_currentNode );
|
||||
|
||||
if ( m_currentNode->CheckColliding( &walkFull ) )
|
||||
return false;
|
||||
if( m_currentNode->CheckColliding( &walkFull ) )
|
||||
return false;
|
||||
|
||||
m_head = walkFull;
|
||||
aNewHead = walkFull;
|
||||
|
@ -927,7 +927,7 @@ void PNS_LINE_PLACER::removeLoops( PNS_NODE* aNode, PNS_LINE* aLatest )
|
|||
if( !aLatest->SegmentCount() )
|
||||
return;
|
||||
|
||||
if (aLatest->CLine().CPoint(0) == aLatest->CLine().CPoint(-1))
|
||||
if ( aLatest->CLine().CPoint( 0 ) == aLatest->CLine().CPoint( -1 ) )
|
||||
return;
|
||||
|
||||
aNode->Add( aLatest, true );
|
||||
|
@ -1025,14 +1025,18 @@ bool PNS_LINE_PLACER::buildInitialLine( const VECTOR2I& aP, PNS_LINE& aHead )
|
|||
{
|
||||
SHAPE_LINE_CHAIN l;
|
||||
|
||||
if(m_p_start == aP)
|
||||
if( m_p_start == aP )
|
||||
{
|
||||
l.Clear();
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
if( Settings().GetFreeAngleMode() && Settings().Mode() == RM_MarkObstacles )
|
||||
{
|
||||
l = SHAPE_LINE_CHAIN ( m_p_start, aP );
|
||||
} else {
|
||||
l = SHAPE_LINE_CHAIN( m_p_start, aP );
|
||||
}
|
||||
else
|
||||
{
|
||||
l = m_direction.BuildInitialTrace( m_p_start, aP );
|
||||
}
|
||||
|
||||
|
@ -1050,12 +1054,12 @@ bool PNS_LINE_PLACER::buildInitialLine( const VECTOR2I& aP, PNS_LINE& aHead )
|
|||
if( !m_placingVia )
|
||||
return true;
|
||||
|
||||
PNS_VIA v ( makeVia ( aP ) );
|
||||
v.SetNet ( aHead.Net() );
|
||||
PNS_VIA v( makeVia( aP ) );
|
||||
v.SetNet( aHead.Net() );
|
||||
|
||||
if ( m_currentMode == RM_MarkObstacles )
|
||||
if( m_currentMode == RM_MarkObstacles )
|
||||
{
|
||||
aHead.AppendVia ( v );
|
||||
aHead.AppendVia( v );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1066,9 +1070,7 @@ bool PNS_LINE_PLACER::buildInitialLine( const VECTOR2I& aP, PNS_LINE& aHead )
|
|||
|
||||
if( v.PushoutForce( m_currentNode, lead, force, solidsOnly, 40 ) )
|
||||
{
|
||||
SHAPE_LINE_CHAIN line = m_direction.BuildInitialTrace(
|
||||
m_p_start,
|
||||
aP + force );
|
||||
SHAPE_LINE_CHAIN line = m_direction.BuildInitialTrace( m_p_start, aP + force );
|
||||
aHead = PNS_LINE( aHead, line );
|
||||
|
||||
v.SetPos( v.Pos() + force );
|
||||
|
|
|
@ -79,14 +79,14 @@ bool PNS_MEANDER_SKEW_PLACER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem )
|
|||
}
|
||||
|
||||
if( m_originPair.Gap() < 0 )
|
||||
m_originPair.SetGap ( Router()->Sizes().DiffPairGap() );
|
||||
m_originPair.SetGap( Router()->Sizes().DiffPairGap() );
|
||||
|
||||
if( !m_originPair.PLine().SegmentCount() ||
|
||||
!m_originPair.NLine().SegmentCount() )
|
||||
return false;
|
||||
|
||||
m_tunedPathP = topo.AssembleTrivialPath ( m_originPair.PLine().GetLink( 0 ) );
|
||||
m_tunedPathN = topo.AssembleTrivialPath ( m_originPair.NLine().GetLink( 0 ) );
|
||||
m_tunedPathP = topo.AssembleTrivialPath( m_originPair.PLine().GetLink( 0 ) );
|
||||
m_tunedPathN = topo.AssembleTrivialPath( m_originPair.NLine().GetLink( 0 ) );
|
||||
|
||||
m_world->Remove( m_originLine );
|
||||
|
||||
|
@ -94,9 +94,9 @@ bool PNS_MEANDER_SKEW_PLACER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem )
|
|||
m_currentEnd = VECTOR2I( 0, 0 );
|
||||
|
||||
if ( m_originPair.PLine().Net () == m_originLine->Net() )
|
||||
m_coupledLength = itemsetLength ( m_tunedPathN );
|
||||
m_coupledLength = itemsetLength( m_tunedPathN );
|
||||
else
|
||||
m_coupledLength = itemsetLength ( m_tunedPathP );
|
||||
m_coupledLength = itemsetLength( m_tunedPathP );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1237,17 +1237,19 @@ PNS_SEGMENT* PNS_NODE::findRedundantSegment( PNS_SEGMENT* aSeg )
|
|||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void PNS_NODE::SetCollisionFilter( PNS_COLLISION_FILTER* aFilter )
|
||||
{
|
||||
m_collisionFilter = aFilter;
|
||||
}
|
||||
|
||||
PNS_ITEM *PNS_NODE::FindItemByParent ( const BOARD_CONNECTED_ITEM *aParent )
|
||||
|
||||
PNS_ITEM *PNS_NODE::FindItemByParent( const BOARD_CONNECTED_ITEM* aParent )
|
||||
{
|
||||
PNS_INDEX::NET_ITEMS_LIST* l_cur = m_index->GetItemsForNet( aParent->GetNetCode() );
|
||||
|
||||
BOOST_FOREACH( PNS_ITEM*item, *l_cur )
|
||||
if ( item->Parent() == aParent )
|
||||
if( item->Parent() == aParent )
|
||||
return item;
|
||||
|
||||
return NULL;
|
||||
|
|
|
@ -373,7 +373,7 @@ public:
|
|||
int RemoveByMarker( int aMarker );
|
||||
void SetCollisionFilter( PNS_COLLISION_FILTER* aFilter );
|
||||
|
||||
PNS_ITEM *FindItemByParent ( const BOARD_CONNECTED_ITEM *aParent );
|
||||
PNS_ITEM* FindItemByParent( const BOARD_CONNECTED_ITEM *aParent );
|
||||
|
||||
private:
|
||||
struct OBSTACLE_VISITOR;
|
||||
|
|
|
@ -210,8 +210,9 @@ PNS_ITEM* PNS_ROUTER::syncPad( D_PAD* aPad )
|
|||
if( aPad->GetShape() == PAD_CIRCLE )
|
||||
{
|
||||
solid->SetShape( new SHAPE_CIRCLE( c, sz.x / 2 ) );
|
||||
} else {
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if( orient == 0.0 || orient == 90.0 || orient == 180.0 || orient == 270.0 )
|
||||
{
|
||||
if( orient == 90.0 || orient == 270.0 )
|
||||
|
@ -262,7 +263,9 @@ PNS_ITEM* PNS_ROUTER::syncPad( D_PAD* aPad )
|
|||
delete solid;
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
switch( aPad->GetShape() )
|
||||
{
|
||||
// PAD_CIRCLE already handled above
|
||||
|
|
|
@ -43,9 +43,10 @@ PNS_ROUTING_SETTINGS::PNS_ROUTING_SETTINGS()
|
|||
m_inlineDragEnabled = false;
|
||||
}
|
||||
|
||||
void PNS_ROUTING_SETTINGS::Save ( TOOL_SETTINGS& aSettings ) const
|
||||
|
||||
void PNS_ROUTING_SETTINGS::Save( TOOL_SETTINGS& aSettings ) const
|
||||
{
|
||||
aSettings.Set( "Mode", (int)m_routingMode );
|
||||
aSettings.Set( "Mode", (int) m_routingMode );
|
||||
aSettings.Set( "OptimizerEffort", (int) m_optimizerEffort );
|
||||
aSettings.Set( "RemoveLoops", m_removeLoops );
|
||||
aSettings.Set( "SmartPads", m_smartPads );
|
||||
|
@ -62,7 +63,8 @@ void PNS_ROUTING_SETTINGS::Save ( TOOL_SETTINGS& aSettings ) const
|
|||
aSettings.Set( "InlineDragEnabled", m_inlineDragEnabled );
|
||||
}
|
||||
|
||||
void PNS_ROUTING_SETTINGS::Load ( const TOOL_SETTINGS& aSettings )
|
||||
|
||||
void PNS_ROUTING_SETTINGS::Load( const TOOL_SETTINGS& aSettings )
|
||||
{
|
||||
m_routingMode = (PNS_MODE) aSettings.Get( "Mode", (int) RM_Walkaround );
|
||||
m_optimizerEffort = (PNS_OPTIMIZATION_EFFORT) aSettings.Get( "OptimizerEffort", (int) OE_MEDIUM );
|
||||
|
@ -81,6 +83,7 @@ void PNS_ROUTING_SETTINGS::Load ( const TOOL_SETTINGS& aSettings )
|
|||
m_inlineDragEnabled = aSettings.Get( "InlineDragEnabled", false );
|
||||
}
|
||||
|
||||
|
||||
const DIRECTION_45 PNS_ROUTING_SETTINGS::InitialDirection() const
|
||||
{
|
||||
if( m_startDiagonal )
|
||||
|
|
|
@ -56,8 +56,8 @@ class PNS_ROUTING_SETTINGS
|
|||
public:
|
||||
PNS_ROUTING_SETTINGS();
|
||||
|
||||
void Load ( const TOOL_SETTINGS& where );
|
||||
void Save ( TOOL_SETTINGS& where ) const;
|
||||
void Load( const TOOL_SETTINGS& where );
|
||||
void Save( TOOL_SETTINGS& where ) const;
|
||||
|
||||
///> Returns the routing mode.
|
||||
PNS_MODE Mode() const { return m_routingMode; }
|
||||
|
@ -130,7 +130,6 @@ public:
|
|||
int WalkaroundIterationLimit() const { return m_walkaroundIterationLimit; };
|
||||
TIME_LIMIT WalkaroundTimeLimit() const;
|
||||
|
||||
|
||||
void SetInlineDragEnabled ( bool aEnable ) { m_inlineDragEnabled = aEnable; }
|
||||
bool InlineDragEnabled( ) const { return m_inlineDragEnabled; }
|
||||
|
||||
|
|
|
@ -337,7 +337,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingSegment( PNS_LINE* aCurrent, PNS_S
|
|||
int rank = aCurrent->Rank();
|
||||
shovedLine->SetRank( rank - 1 );
|
||||
|
||||
if (!pushLine( shovedLine ) )
|
||||
if( !pushLine( shovedLine ) )
|
||||
rv = SH_INCOMPLETE;
|
||||
}
|
||||
|
||||
|
@ -466,7 +466,8 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingSolid( PNS_LINE* aCurrent, PNS_SOL
|
|||
#endif
|
||||
|
||||
popLine();
|
||||
if ( !pushLine( walkaroundLine ) )
|
||||
|
||||
if( !pushLine( walkaroundLine ) )
|
||||
return SH_INCOMPLETE;
|
||||
|
||||
return SH_OK;
|
||||
|
@ -620,7 +621,8 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::pushVia( PNS_VIA* aVia, const VECTOR2I& aForc
|
|||
{
|
||||
replaceItems( lp.first, lp.second );
|
||||
lp.second->SetRank( aCurrentRank - 1 );
|
||||
if (! pushLine( lp.second ) )
|
||||
|
||||
if( !pushLine( lp.second ) )
|
||||
return SH_INCOMPLETE;
|
||||
}
|
||||
else
|
||||
|
@ -1120,7 +1122,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ShoveMultiLines( const PNS_ITEMSET& aHeadSet
|
|||
|
||||
st = shoveMainLoop();
|
||||
|
||||
if ( st == SH_OK )
|
||||
if( st == SH_OK )
|
||||
runOptimizer( m_currentNode, NULL );
|
||||
|
||||
m_currentNode->RemoveByMarker( MK_HEAD );
|
||||
|
@ -1169,7 +1171,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ShoveDraggingVia( PNS_VIA* aVia, const VECTOR
|
|||
st = pushVia( aVia, ( aWhere - aVia->Pos() ), 0 );
|
||||
st = shoveMainLoop();
|
||||
|
||||
if ( st == SH_OK )
|
||||
if( st == SH_OK )
|
||||
runOptimizer( m_currentNode, NULL );
|
||||
|
||||
if( st == SH_OK || st == SH_HEAD_MODIFIED )
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
const SHAPE_LINE_CHAIN PNS_SOLID::Hull( int aClearance, int aWalkaroundThickness ) const
|
||||
{
|
||||
int cl = aClearance + (aWalkaroundThickness + 1)/ 2;
|
||||
int cl = aClearance + ( aWalkaroundThickness + 1 )/ 2;
|
||||
|
||||
switch( m_shape->Type() )
|
||||
{
|
||||
|
@ -51,7 +51,7 @@ const SHAPE_LINE_CHAIN PNS_SOLID::Hull( int aClearance, int aWalkaroundThickness
|
|||
|
||||
case SH_SEGMENT:
|
||||
{
|
||||
SHAPE_SEGMENT* seg = static_cast<SHAPE_SEGMENT*> ( m_shape );
|
||||
SHAPE_SEGMENT* seg = static_cast<SHAPE_SEGMENT*>( m_shape );
|
||||
return SegmentHull( *seg, aClearance, aWalkaroundThickness );
|
||||
}
|
||||
|
||||
|
|
|
@ -129,6 +129,7 @@ bool PNS_TOPOLOGY::LeadingRatLine( const PNS_LINE* aTrack, SHAPE_LINE_CHAIN& aRa
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
PNS_ITEM* PNS_TOPOLOGY::NearestUnconnectedItem( PNS_JOINT* aStart, int* aAnchor, int aKindMask )
|
||||
{
|
||||
std::set<PNS_ITEM*> disconnected;
|
||||
|
@ -320,8 +321,10 @@ int PNS_TOPOLOGY::DpNetPolarity( int aNet )
|
|||
return MatchDpSuffix( refName, dummy1, dummy2 );
|
||||
}
|
||||
|
||||
|
||||
bool commonParallelProjection( SEG n, SEG p, SEG &pClip, SEG& nClip );
|
||||
|
||||
|
||||
bool PNS_TOPOLOGY::AssembleDiffPair( PNS_ITEM* aStart, PNS_DIFF_PAIR& aPair )
|
||||
{
|
||||
int refNet = aStart->Net();
|
||||
|
@ -334,7 +337,7 @@ bool PNS_TOPOLOGY::AssembleDiffPair( PNS_ITEM* aStart, PNS_DIFF_PAIR& aPair )
|
|||
|
||||
m_world->AllItemsInNet( coupledNet, coupledItems );
|
||||
|
||||
PNS_SEGMENT *coupledSeg = NULL, *refSeg;
|
||||
PNS_SEGMENT* coupledSeg = NULL, *refSeg;
|
||||
int minDist = std::numeric_limits<int>::max();
|
||||
|
||||
if( ( refSeg = dyn_cast<PNS_SEGMENT*>( aStart ) ) != NULL )
|
||||
|
@ -365,8 +368,8 @@ bool PNS_TOPOLOGY::AssembleDiffPair( PNS_ITEM* aStart, PNS_DIFF_PAIR& aPair )
|
|||
if( !coupledSeg )
|
||||
return false;
|
||||
|
||||
std::auto_ptr<PNS_LINE> lp ( m_world->AssembleLine( refSeg ) );
|
||||
std::auto_ptr<PNS_LINE> ln ( m_world->AssembleLine( coupledSeg ) );
|
||||
std::auto_ptr<PNS_LINE> lp( m_world->AssembleLine( refSeg ) );
|
||||
std::auto_ptr<PNS_LINE> ln( m_world->AssembleLine( coupledSeg ) );
|
||||
|
||||
if( DpNetPolarity( refNet ) < 0 )
|
||||
{
|
||||
|
@ -374,13 +377,12 @@ bool PNS_TOPOLOGY::AssembleDiffPair( PNS_ITEM* aStart, PNS_DIFF_PAIR& aPair )
|
|||
}
|
||||
|
||||
int gap = -1 ;
|
||||
if( refSeg->Seg().ApproxParallel( coupledSeg->Seg() ) ) {
|
||||
|
||||
// Segments are parallel -> compute pair gap
|
||||
const VECTOR2I refDir = refSeg->Anchor(1) - refSeg->Anchor(0);
|
||||
const VECTOR2I displacement = refSeg->Anchor(1) - coupledSeg->Anchor(1);
|
||||
gap = (int) abs( refDir.Cross( displacement ) / refDir.EuclideanNorm() ) - lp->Width();
|
||||
|
||||
if( refSeg->Seg().ApproxParallel( coupledSeg->Seg() ) )
|
||||
{
|
||||
// Segments are parallel -> compute pair gap
|
||||
const VECTOR2I refDir = refSeg->Anchor( 1 ) - refSeg->Anchor( 0 );
|
||||
const VECTOR2I displacement = refSeg->Anchor( 1 ) - coupledSeg->Anchor( 1 );
|
||||
gap = (int) abs( refDir.Cross( displacement ) / refDir.EuclideanNorm() ) - lp->Width();
|
||||
}
|
||||
|
||||
aPair = PNS_DIFF_PAIR( *lp, *ln );
|
||||
|
|
|
@ -81,22 +81,22 @@ const SHAPE_LINE_CHAIN SegmentHull ( const SHAPE_SEGMENT& aSeg, int aClearance,
|
|||
}
|
||||
|
||||
|
||||
static void MoveDiagonal( SEG& diagonal, const SHAPE_LINE_CHAIN& vertices, int clearance )
|
||||
static void MoveDiagonal( SEG& aDiagonal, const SHAPE_LINE_CHAIN& aVertices, int aClearance )
|
||||
{
|
||||
int dist;
|
||||
|
||||
vertices.NearestPoint( diagonal, dist );
|
||||
aVertices.NearestPoint( aDiagonal, dist );
|
||||
dist -= HULL_MARGIN;
|
||||
VECTOR2I moveBy = (diagonal.A - diagonal.B).Perpendicular().Resize( dist - clearance );
|
||||
diagonal.A += moveBy;
|
||||
diagonal.B += moveBy;
|
||||
VECTOR2I moveBy = ( aDiagonal.A - aDiagonal.B ).Perpendicular().Resize( dist - aClearance );
|
||||
aDiagonal.A += moveBy;
|
||||
aDiagonal.B += moveBy;
|
||||
}
|
||||
|
||||
|
||||
const SHAPE_LINE_CHAIN ConvexHull( const SHAPE_CONVEX& convex, int clearance )
|
||||
const SHAPE_LINE_CHAIN ConvexHull( const SHAPE_CONVEX& convex, int aClearance )
|
||||
{
|
||||
// this defines the horizontal and vertical lines in the hull octagon
|
||||
BOX2I box = convex.BBox( clearance + HULL_MARGIN );
|
||||
BOX2I box = convex.BBox( aClearance + HULL_MARGIN );
|
||||
box.Normalize();
|
||||
|
||||
SEG topline = SEG( VECTOR2I( box.GetX(), box.GetY() + box.GetHeight() ),
|
||||
|
@ -113,25 +113,25 @@ const SHAPE_LINE_CHAIN ConvexHull( const SHAPE_CONVEX& convex, int clearance )
|
|||
VECTOR2I corner = box.GetOrigin() + box.GetSize();
|
||||
SEG toprightline = SEG( corner,
|
||||
corner + VECTOR2I( box.GetHeight(), -box.GetHeight() ) );
|
||||
MoveDiagonal( toprightline, vertices, clearance );
|
||||
MoveDiagonal( toprightline, vertices, aClearance );
|
||||
|
||||
// bottom right diagonal
|
||||
corner = box.GetOrigin() + VECTOR2I( box.GetWidth(), 0 );
|
||||
SEG bottomrightline = SEG( corner + VECTOR2I( box.GetHeight(), box.GetHeight() ),
|
||||
corner );
|
||||
MoveDiagonal( bottomrightline, vertices, clearance );
|
||||
MoveDiagonal( bottomrightline, vertices, aClearance );
|
||||
|
||||
// bottom left diagonal
|
||||
corner = box.GetOrigin();
|
||||
SEG bottomleftline = SEG( corner,
|
||||
corner + VECTOR2I( -box.GetHeight(), box.GetHeight() ) );
|
||||
MoveDiagonal( bottomleftline, vertices, clearance );
|
||||
MoveDiagonal( bottomleftline, vertices, aClearance );
|
||||
|
||||
// top left diagonal
|
||||
corner = box.GetOrigin() + VECTOR2I( 0, box.GetHeight() );
|
||||
SEG topleftline = SEG( corner + VECTOR2I( -box.GetHeight(), -box.GetHeight() ),
|
||||
corner );
|
||||
MoveDiagonal( topleftline, vertices, clearance );
|
||||
MoveDiagonal( topleftline, vertices, aClearance );
|
||||
|
||||
SHAPE_LINE_CHAIN octagon;
|
||||
octagon.SetClosed( true );
|
||||
|
|
|
@ -37,8 +37,8 @@ class PNS_ITEM;
|
|||
const SHAPE_LINE_CHAIN OctagonalHull( const VECTOR2I& aP0, const VECTOR2I& aSize,
|
||||
int aClearance, int aChamfer );
|
||||
|
||||
const SHAPE_LINE_CHAIN SegmentHull ( const SHAPE_SEGMENT& aSeg, int aClearance,
|
||||
int aWalkaroundThickness );
|
||||
const SHAPE_LINE_CHAIN SegmentHull( const SHAPE_SEGMENT& aSeg, int aClearance,
|
||||
int aWalkaroundThickness );
|
||||
|
||||
/**
|
||||
* Function ConvexHull()
|
||||
|
@ -48,7 +48,7 @@ const SHAPE_LINE_CHAIN SegmentHull ( const SHAPE_SEGMENT& aSeg, int aClearance,
|
|||
* @param clearance The minimum distance between polygon and hull.
|
||||
* @return A closed line chain describing the octagon.
|
||||
*/
|
||||
const SHAPE_LINE_CHAIN ConvexHull( const SHAPE_CONVEX& convex, int clearance );
|
||||
const SHAPE_LINE_CHAIN ConvexHull( const SHAPE_CONVEX& convex, int aClearance );
|
||||
|
||||
SHAPE_RECT ApproximateSegmentAsRect( const SHAPE_SEGMENT& aSeg );
|
||||
|
||||
|
@ -59,5 +59,4 @@ void DrawDebugDirs( VECTOR2D aP, int aMask, int aColor );
|
|||
|
||||
OPT_BOX2I ChangedArea( const PNS_ITEM* aItemA, const PNS_ITEM* aItemB );
|
||||
|
||||
|
||||
#endif // __PNS_UTILS_H
|
||||
|
|
|
@ -816,7 +816,7 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
}
|
||||
|
||||
if(saveUndoBuffer)
|
||||
if( saveUndoBuffer )
|
||||
{
|
||||
frame->SaveCopyInUndoList( m_router->GetUndoBuffer(), UR_UNSPECIFIED );
|
||||
m_router->ClearUndoBuffer();
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
void Restart();
|
||||
|
||||
void Set( int aMilliseconds );
|
||||
int Get () const { return m_limitMs; }
|
||||
int Get() const { return m_limitMs; }
|
||||
|
||||
private:
|
||||
int m_limitMs;
|
||||
|
|
|
@ -110,7 +110,7 @@ bool EDIT_TOOL::invokeInlineRouter()
|
|||
if( track || via )
|
||||
{
|
||||
ROUTER_TOOL *theRouter = static_cast<ROUTER_TOOL*> ( m_toolMgr->FindTool( "pcbnew.InteractiveRouter" ) );
|
||||
assert ( theRouter );
|
||||
assert( theRouter );
|
||||
|
||||
if( !theRouter->PNSSettings().InlineDragEnabled() )
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue