27 bool aBreakCrossings )
36 info.hasBusEntry =
false;
37 info.hasExplicitJunctionDot =
false;
38 info.isJunction =
false;
39 info.hasBusEntryToMultipleWires =
false;
41 bool breakLines[2] = {
false };
42 std::unordered_set<int> exitAngles[2];
43 std::vector<const SCH_LINE*> midPointLines[2];
46 int uniqueAngle = 10000;
53 switch( item->Type() )
56 if( item->HitTest( aPosition, -1 ) )
57 info.hasExplicitJunctionDot =
true;
77 breakLines[layer] =
true;
78 exitAngles[layer].insert( line->
GetAngleFrom( aPosition ) );
80 else if( line->
HitTest( aPosition, -1 ) )
83 breakLines[layer] =
true;
86 midPointLines[layer].push_back( line );
92 if( item->IsConnected( aPosition ) )
94 breakLines[BUSES] =
true;
95 exitAngles[BUSES].insert( uniqueAngle++ );
96 breakLines[WIRES] =
true;
97 exitAngles[WIRES].insert( uniqueAngle++ );
98 info.hasBusEntry =
true;
105 if( item->IsConnected( aPosition ) )
107 breakLines[WIRES] =
true;
108 exitAngles[WIRES].insert( uniqueAngle++ );
117 for(
int layer : { WIRES, BUSES } )
119 if( breakLines[layer] )
121 for(
const SCH_LINE* line : midPointLines[layer] )
123 exitAngles[layer].insert( line->GetAngleFrom( aPosition ) );
124 exitAngles[layer].insert( line->GetReverseAngleFrom( aPosition ) );
129 if(
info.hasBusEntry )
134 info.hasBusEntryToMultipleWires =
135 exitAngles[WIRES].size() > 2 && exitAngles[BUSES].size() == 1;
139 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...