|
KiCad PCB EDA Suite
|
Keeps wires of one net from touching pins, junctions and wire ends of other nets on import. More...
#include <sch_io_wire_detour.h>
Classes | |
| struct | CONTACT |
| struct | RESULT |
| struct | WIRE |
Public Member Functions | |
| int | AnonymousNet () |
| void | AddWire (const SEG &aWire, int aNet) |
| Register a wire as an obstacle for the wires of other nets. | |
| void | AddContact (const VECTOR2I &aPos, int aNet) |
| Register a pin or junction. | |
| RESULT | Route (const SEG &aWire, int aNet) |
| Detour a wire around foreign items lying on it and register the result as the wire's geometry. | |
| bool | TouchesOtherNet (const VECTOR2I &aPos, int aNet) const |
Private Member Functions | |
| std::vector< CONTACT > | contacts () const |
| bool | joinsOtherNet (const SEG &aPiece, const SEG &aWire, int aNet, const std::vector< CONTACT > &aContacts) const |
| True if a detour piece would join another net. | |
| std::vector< SEG > | detour (const SEG &aWire, const VECTOR2I &aEnter, const VECTOR2I &aLeave, int aNet, const std::vector< CONTACT > &aContacts) const |
| Detour the stretch of a wire between two points, or an empty vector if there is no safe place for it. | |
Private Attributes | |
| std::vector< WIRE > | m_wires |
| std::vector< CONTACT > | m_contacts |
| int | m_anonymousNets = 0 |
Keeps wires of one net from touching pins, junctions and wire ends of other nets on import.
Other EDA tools join a pin or wire end to a wire only where the file says so, whereas a pin or wire end lying on a wire always joins it here. The importer describes one sheet with plain geometry and an opaque net identity per item, then asks for each wire to be replaced by a detour around the foreign items lying on it.
Definition at line 34 of file sch_io_wire_detour.h.
| void SCH_IO_WIRE_DETOUR::AddContact | ( | const VECTOR2I & | aPos, |
| int | aNet ) |
Register a pin or junction.
Definition at line 41 of file sch_io_wire_detour.cpp.
References m_contacts.
Referenced by SCH_IO_EAGLE::collectSheetWiring().
| void SCH_IO_WIRE_DETOUR::AddWire | ( | const SEG & | aWire, |
| int | aNet ) |
Register a wire as an obstacle for the wires of other nets.
Definition at line 35 of file sch_io_wire_detour.cpp.
References m_wires.
Referenced by SCH_IO_EAGLE::collectSheetWiring(), and Route().
|
inline |
Definition at line 49 of file sch_io_wire_detour.h.
References m_anonymousNets.
Referenced by SCH_IO_EAGLE::collectSheetWiring().
|
private |
Definition at line 47 of file sch_io_wire_detour.cpp.
References m_contacts, and m_wires.
Referenced by Route(), and TouchesOtherNet().
|
private |
Detour the stretch of a wire between two points, or an empty vector if there is no safe place for it.
Definition at line 104 of file sch_io_wire_detour.cpp.
References SEG::A, SEG::B, joinsOtherNet(), m_wires, normal, and schIUScale.
Referenced by Route().
|
private |
True if a detour piece would join another net.
Definition at line 73 of file sch_io_wire_detour.cpp.
References SEG::A, SEG::B, SEG::Contains(), and m_wires.
Referenced by detour().
| SCH_IO_WIRE_DETOUR::RESULT SCH_IO_WIRE_DETOUR::Route | ( | const SEG & | aWire, |
| int | aNet ) |
Detour a wire around foreign items lying on it and register the result as the wire's geometry.
Wire ends count as items. A detour never lands on another net's item or wire, and is not made where a branch of the same net joins the replaced stretch.
Definition at line 162 of file sch_io_wire_detour.cpp.
References SEG::A, AddWire(), SEG::B, contacts(), detour(), m_wires, SCH_IO_WIRE_DETOUR::WIRE::Net, path, VECTOR2< T >::Resize(), result, schIUScale, SCH_IO_WIRE_DETOUR::WIRE::Seg, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), and SCH_IO_EAGLE::loadSegments().
| bool SCH_IO_WIRE_DETOUR::TouchesOtherNet | ( | const VECTOR2I & | aPos, |
| int | aNet ) const |
Definition at line 61 of file sch_io_wire_detour.cpp.
References contacts().
Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadNets().
|
private |
Definition at line 98 of file sch_io_wire_detour.h.
Referenced by AnonymousNet().
|
private |
Definition at line 97 of file sch_io_wire_detour.h.
Referenced by AddContact(), and contacts().
|
private |
Definition at line 96 of file sch_io_wire_detour.h.
Referenced by AddWire(), contacts(), detour(), joinsOtherNet(), and Route().