Formatting.

This commit is contained in:
Jeff Young 2021-01-04 18:06:39 +00:00
parent 648c42f643
commit 2ea6bc5529
9 changed files with 40 additions and 83 deletions

View File

@ -65,8 +65,8 @@ public:
/**
* Function Start()
*
* Starts routing a single track at point aP, taking item aStartItem as anchor
* (unless NULL). Returns true if a dragging operation has started.
* Starts routing a single track at point aP, taking item aStartItem as anchor (unless NULL).
* Returns true if a dragging operation has started.
*/
virtual bool Start( const VECTOR2I& aP, ITEM_SET& aPrimitives ) = 0;
@ -90,8 +90,7 @@ public:
/**
* Function CurrentNode()
*
* Returns the most recent world state, including all
* items changed due to dragging operation.
* Returns the most recent world state, including all items changed by dragging operation.
*/
virtual NODE* CurrentNode() const = 0;

View File

@ -113,7 +113,6 @@ public:
void SetMode( int aDragMode ) override;
private:
const ITEM_SET findViaFanoutByHandle ( NODE *aNode, const VIA_HANDLE& handle );
bool dragMarkObstacles( const VECTOR2I& aP );
@ -126,7 +125,7 @@ private:
void dragViaWalkaround( const VIA_HANDLE& aHandle, NODE* aNode, const VECTOR2I& aP );
void optimizeAndUpdateDraggedLine( LINE& dragged, SEG& aDraggedSeg, const VECTOR2I& aP );
private:
VIA_HANDLE m_initialVia;
VIA_HANDLE m_draggedVia;

View File

@ -118,13 +118,13 @@ public:
ITEM_SET::iterator end() { return m_allItems.end(); }
private:
template <class Visitor>
int querySingle( std::size_t aIndex, const SHAPE* aShape, int aMinDistance, Visitor& aVisitor ) const;
std::deque<ITEM_SHAPE_INDEX> m_subIndices;
private:
std::deque<ITEM_SHAPE_INDEX> m_subIndices;
std::map<int, NET_ITEMS_LIST> m_netMap;
ITEM_SET m_allItems;
ITEM_SET m_allItems;
};

View File

@ -66,7 +66,7 @@ public:
ARC_T = 16,
VIA_T = 32,
DIFF_PAIR_T = 64,
ANY_T = 0xff
ANY_T = 0xff
};
ITEM( PnsKind aKind )
@ -111,12 +111,14 @@ public:
* @param aClearance defines how far from the body of the item the hull should be,
* @param aWalkaroundThickness is the width of the line that walks around this hull.
*/
virtual const SHAPE_LINE_CHAIN Hull( int aClearance = 0, int aWalkaroundThickness = 0, int aLayer = -1 ) const
virtual const SHAPE_LINE_CHAIN Hull( int aClearance = 0, int aWalkaroundThickness = 0,
int aLayer = -1 ) const
{
return SHAPE_LINE_CHAIN();
}
virtual const SHAPE_LINE_CHAIN HoleHull( int aClearance, int aWalkaroundThickness, int aLayer ) const
virtual const SHAPE_LINE_CHAIN HoleHull( int aClearance, int aWalkaroundThickness,
int aLayer ) const
{
return SHAPE_LINE_CHAIN();
}
@ -210,8 +212,7 @@ public:
/**
* Function Shape()
*
* Returns the geometrical shape of the item. Used
* for collision detection & spatial indexing.
* Returns the geometrical shape of the item. Used for collision detection & spatial indexing.
*/
virtual const SHAPE* Shape() const
{

View File

@ -56,9 +56,7 @@ ITEM_SET& ITEM_SET::FilterLayers( int aStart, int aEnd, bool aInvert )
for( const ENTRY& ent : m_items )
{
if( ent.item->Layers().Overlaps( l ) ^ aInvert )
{
newItems.push_back( ent );
}
}
m_items = newItems;
@ -74,9 +72,7 @@ ITEM_SET& ITEM_SET::FilterKinds( int aKindMask, bool aInvert )
for( const ENTRY& ent : m_items )
{
if( ent.item->OfKind( aKindMask ) ^ aInvert )
{
newItems.push_back( ent );
}
}
m_items = newItems;
@ -92,9 +88,7 @@ ITEM_SET& ITEM_SET::FilterMarker( int aMarker, bool aInvert )
for( const ENTRY& ent : m_items )
{
if( ent.item->Marker() & aMarker )
{
newItems.push_back( ent );
}
}
m_items = newItems;
@ -110,9 +104,7 @@ ITEM_SET& ITEM_SET::FilterNet( int aNet, bool aInvert )
for( const ENTRY& ent : m_items )
{
if( ( ent.item->Net() == aNet ) ^ aInvert )
{
newItems.push_back( ent );
}
}
m_items = newItems;
@ -128,8 +120,7 @@ ITEM_SET& ITEM_SET::ExcludeItem( const ITEM* aItem )
for( const ENTRY& ent : m_items )
{
if( ent.item != aItem )
newItems.push_back( ent );
newItems.push_back( ent );
}
m_items = newItems;

View File

@ -39,8 +39,8 @@ class LINE;
class ITEM_SET
{
public:
struct ENTRY {
struct ENTRY
{
ENTRY( ITEM* aItem, bool aOwned = false ) :
item( aItem ),
owned( aOwned )
@ -62,17 +62,17 @@ public:
delete item;
}
bool operator== ( const ENTRY& b ) const
bool operator==( const ENTRY& b ) const
{
return item == b.item;
}
bool operator< ( const ENTRY& b ) const
bool operator<( const ENTRY& b ) const
{
return item < b.item;
}
ENTRY& operator= ( const ENTRY& aOther )
ENTRY& operator=( const ENTRY& aOther )
{
owned = aOther.owned;
@ -98,9 +98,7 @@ public:
ITEM_SET( ITEM* aInitialItem = NULL, bool aBecomeOwner = false )
{
if( aInitialItem )
{
m_items.push_back( ENTRY( aInitialItem, aBecomeOwner ) );
}
}
ITEM_SET( const ITEM_SET& aOther )
@ -225,7 +223,6 @@ public:
}
private:
ENTRIES m_items;
};

View File

@ -71,7 +71,6 @@ ROUTER::ROUTER()
m_settings = nullptr;
m_showInterSteps = false;
m_snapshotIter = 0;
m_violation = false;
m_iface = nullptr;
}

View File

@ -139,8 +139,6 @@ public:
void ClearWorld();
void SyncWorld();
void SetView( KIGFX::VIEW* aView );
bool RoutingInProgress() const;
bool StartRouting( const VECTOR2I& aP, ITEM* aItem, int aLayer );
void Move( const VECTOR2I& aP, ITEM* aItem );
@ -152,10 +150,7 @@ public:
void StopRouting();
void ClearViewDecorations();
NODE* GetWorld() const
{
return m_world.get();
}
NODE* GetWorld() const { return m_world.get(); }
void FlipPosture();
@ -169,7 +164,6 @@ public:
int GetCurrentLayer() const;
const std::vector<int> GetCurrentNets() const;
void DumpLog();
LOGGER* Logger();
RULE_RESOLVER* GetRuleResolver() const
@ -179,8 +173,7 @@ public:
bool IsPlacingVia() const;
const ITEM_SET QueryHoverItems( const VECTOR2I& aP );
const VECTOR2I SnapToItem( ITEM* aItem, VECTOR2I aP, bool& aSplitsSegment );
const ITEM_SET QueryHoverItems( const VECTOR2I& aP );
bool StartDragging( const VECTOR2I& aP, ITEM* aItem, int aDragMode = DM_ANY );
bool StartDragging( const VECTOR2I& aP, ITEM_SET aItems, int aDragMode = DM_COMPONENT );
@ -216,12 +209,7 @@ public:
m_settings = aSettings;
}
SIZES_SETTINGS& Sizes()
{
return m_sizes;
}
ITEM* QueryItemByParent( const BOARD_ITEM* aItem ) const;
SIZES_SETTINGS& Sizes() { return m_sizes; }
void SetFailureReason( const wxString& aReason ) { m_failureReason = aReason; }
const wxString& FailureReason() const { return m_failureReason; }
@ -237,54 +225,37 @@ private:
void movePlacing( const VECTOR2I& aP, ITEM* aItem );
void moveDragging( const VECTOR2I& aP, ITEM* aItem );
void eraseView();
void updateView( NODE* aNode, ITEM_SET& aCurrent, bool aDragging = false );
void clearViewFlags();
// optHoverItem queryHoverItemEx(const VECTOR2I& aP);
ITEM* pickSingleItem( ITEM_SET& aItems ) const;
void splitAdjacentSegments( NODE* aNode, ITEM* aSeg, const VECTOR2I& aP );
ITEM* syncPad( PAD* aPad );
ITEM* syncTrack( TRACK* aTrack );
ITEM* syncVia( VIA* aVia );
void commitPad( SOLID* aPad );
void commitSegment( SEGMENT* aTrack );
void commitVia( VIA* aVia );
void highlightCurrent( bool enabled );
void markViolations( NODE* aNode, ITEM_SET& aCurrent, NODE::ITEM_VECTOR& aRemoved );
bool isStartingPointRoutable( const VECTOR2I& aWhere, ITEM* aItem, int aLayer );
VECTOR2I m_currentEnd;
RouterState m_state;
VECTOR2I m_currentEnd;
RouterState m_state;
std::unique_ptr< NODE > m_world;
NODE* m_lastNode;
std::unique_ptr<NODE> m_world;
NODE* m_lastNode;
std::unique_ptr< PLACEMENT_ALGO > m_placer;
std::unique_ptr< DRAG_ALGO > m_dragger;
std::unique_ptr< SHOVE > m_shove;
std::unique_ptr<PLACEMENT_ALGO> m_placer;
std::unique_ptr<DRAG_ALGO> m_dragger;
std::unique_ptr<SHOVE> m_shove;
ROUTER_IFACE* m_iface;
ROUTER_IFACE* m_iface;
int m_iterLimit;
bool m_showInterSteps;
int m_snapshotIter;
bool m_violation;
bool m_forceMarkObstaclesMode = false;
int m_iterLimit;
bool m_showInterSteps;
int m_snapshotIter;
bool m_forceMarkObstaclesMode = false;
ROUTING_SETTINGS* m_settings;
SIZES_SETTINGS m_sizes;
ROUTER_MODE m_mode;
LOGGER* m_logger;
SIZES_SETTINGS m_sizes;
ROUTER_MODE m_mode;
LOGGER* m_logger;
wxString m_toolStatusbarName;
wxString m_failureReason;
wxString m_toolStatusbarName;
wxString m_failureReason;
};
}

View File

@ -142,7 +142,7 @@ ITEM* SOLID::Clone() const
void SOLID::SetPos( const VECTOR2I& aCenter )
{
auto delta = aCenter - m_pos;
VECTOR2I delta = aCenter - m_pos;
if( m_shape )
m_shape->Move( delta );