17 info.hasBusEntry =
false;
18 info.hasExplicitJunctionDot =
false;
19 info.isJunction =
false;
20 info.hasBusEntryToMultipleWires =
false;
22 bool breakLines[2] = {
false };
23 std::unordered_set<int> exitAngles[2];
24 std::vector<const SCH_LINE*> midPointLines[2];
27 int uniqueAngle = 10000;
34 switch( item->Type() )
37 if( item->HitTest( aPosition, -1 ) )
38 info.hasExplicitJunctionDot =
true;
58 breakLines[layer] =
true;
59 exitAngles[layer].insert( line->
GetAngleFrom( aPosition ) );
61 else if( line->
HitTest( aPosition, -1 ) )
64 breakLines[layer] =
true;
67 midPointLines[layer].push_back( line );
73 if( item->IsConnected( aPosition ) )
75 breakLines[BUSES] =
true;
76 exitAngles[BUSES].insert( uniqueAngle++ );
77 breakLines[WIRES] =
true;
78 exitAngles[WIRES].insert( uniqueAngle++ );
79 info.hasBusEntry =
true;
86 if( item->IsConnected( aPosition ) )
88 breakLines[WIRES] =
true;
89 exitAngles[WIRES].insert( uniqueAngle++ );
98 for(
int layer : { WIRES, BUSES } )
100 if( breakLines[layer] )
102 for(
const SCH_LINE* line : midPointLines[layer] )
104 exitAngles[layer].insert( line->GetAngleFrom( aPosition ) );
105 exitAngles[layer].insert( line->GetReverseAngleFrom( aPosition ) );
110 if(
info.hasBusEntry )
115 info.hasBusEntryToMultipleWires =
116 exitAngles[WIRES].size() > 2 && exitAngles[BUSES].size() == 1;
120 info.isJunction = exitAngles[WIRES].size() >= 3 || exitAngles[BUSES].size() >= 3;
Implements an R-tree for fast spatial and type indexing of schematic items.
EE_TYPE Overlapping(const BOX2I &aRect) const
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
bool IsConnected(const VECTOR2I &aPoint) const
Test the item to see if it is connected to aPoint.
Segment description base class to describe items which have 2 end points (track, wire,...
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
int GetAngleFrom(const VECTOR2I &aPoint) const
VECTOR2I GetEndPoint() const
VECTOR2I GetStartPoint() const
#define STRUCT_DELETED
flag indication structures to be erased
POINT_INFO AnalyzePoint(const EE_RTREE &aItem, const VECTOR2I &aPosition, bool aBreakCrossings)
Check a tree of items for a confluence at a given point and work out what kind of junction it is,...
A selection of information about a point in the schematic that might be eligible for turning into a j...