PCB Environment: Connection Class Reference

PCB Environment 2

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions
Connection Class Reference

## Public Member Functions
Connection * | clone (CloneEnv &) const
| Connection (Net *, const Point_25 &source, Pin *sourcePin, const Point_25 &target, Pin *targetPin)
| Connection (const Connection &, const Point_25 &source, const Point_25 &target)
void | setId (int id)
int | id () const
std::string | name () const
bool | hasNet () const
Net * | net () const
const Point_25 & | source () const
const Point_25 & | target () const
Pin * | sourcePin () const
Pin * | targetPin () const
Pin * | otherPin (const Pin *) const
Component * | sourceComponent () const
Component * | targetComponent () const
Vector_2 | vector2 () const
Segment_2 | segment2 () const
void | detachSourcePin ()
void | detachTargetPin ()
void | forceEndpointsToGrid (const UniformGrid25 &)
bool | hasTracks () const
uint | numTracks () const
const std::vector< Track * > & | getTracks () const
Track & | getTrack (uint i) const
Track * | getTrackAt (const Point_25 &) const
Track * | newTrack (const Point_25 &start)
Track * | popTrack (uint index)
void | clearTracks ()
bool | isRouted () const
bool | _isRouted () const
void | setRouted (bool b)
bool | checkRouted ()
void | forceRouted ()
bool | isLocked () const
void | setLocked (bool b)
void | setTrack (Track *)
void | setTrack (Track &&)
void | setTrack (const Track &)
void | appendTrack (Track *T)
void | appendTrack (const Track &T)
void | reverse ()
void | makeDirectTrack45 (Real minSquaredLen, uint viaLocation, float bendLocation)
void | makeDirectTrack (Real minSquaredLen, uint viaLocation)
bool | updateForRemovedLayers (uint removedZMin, uint removedZMax)
std::vector< std::pair< Point_25, Point_25 > > | getRatsNest () const
bool | arePinsOnNet (const Net *) const
Real | clearance () const
Real | defaultWidth () const
Real | defaultViaDiameter () const
Real | defaultViaRadius () const
void | setClearance (Real c)
void | setDefaultWidth (float w)
void | setDefaultViaDiameter (Real d)
bool | canRouteOnLayer (uint n) const
uint32_t | getLayerMask () const
void | setLayerMask (uint32_t)
void | setParametersFrom (const Connection &)
float | referenceLen () const
void | setReferenceLen (float v)
Bbox_2 | tracksBbox () const
Bbox_2 | bbox () const
Bbox_2 | bboxAroundComps () const
Real | squared_distance () const
Real | distance () const
Real | distance45 () const
bool | isOrderedXMajor () const
uint | numNecessaryVias () const
bool | intersects (const Connection &) const
bool | isRasterized_allOrNone () const
bool | checkRasterization (const NavGrid &) const
void | setColor (Color c)
Color | getColor () const
std::string | str () const
PyObject * | getEndsPy () const
PyObject * | getTracksPy (bool asNumpy) const
PyObject * | getPy (uint depth, bool asNumpy) const

## Static Public Member Functions
template<class Container>
static void | sort_name (Container &)

## Member Function Documentation

## ◆ appendTrack()

void Connection::appendTrack | ( | Track * | T | ) |

Append the track to this connection. WARNING: The pointer may no longer be valid after this call!

## ◆ arePinsOnNet()

bool Connection::arePinsOnNet | ( | const Net * |  | ) | const

sanity

## ◆ checkRasterization()

bool Connection::checkRasterization | ( | const NavGrid & |  | ) | const

Check whether the endpoints' grid points are marked as having tracks.

## ◆ forceRouted()

void Connection::forceRouted | ( |  | ) |

Force the connection's track's endpoints to the connection endpoints.

## ◆ getEndsPy()

PyObject * Connection::getEndsPy | ( |  | ) | const

A tuple (source, target) where source and target are pin names or, if there is no pin, coordinates (x,y,z).

## ◆ getPy()

PyObject * Connection::getPy | ( | uint | depth,
|  | bool | asNumpy ) const

see pcb.schema.json

## ◆ getRatsNest()

std::vector< std::pair< Point_25, Point_25 > > Connection::getRatsNest | ( |  | ) | const

Returns a set of pairs of disconnected track endpoints such that each point occurs exactly once. Points are paired in order from lowest to highest pair distance over all possible pairings.

## ◆ getTracksPy()

PyObject * Connection::getTracksPy | ( | bool | asNumpy | ) | const

A list of tracks as per Track::getPy(asNumpy).

## ◆ intersects()

bool Connection::intersects | ( | const Connection & |  | ) | const

Returns whether this connection's tracks come within the maximum of the default clearances of each other. If a connection has no tracks, the rat's nest line (this->segment2()) is used instead.

## ◆ isOrderedXMajor()

bool Connection::isOrderedXMajor | ( |  | ) | const

source.x <= target.x etc.

## ◆ isRasterized_allOrNone()

bool Connection::isRasterized_allOrNone | ( |  | ) | const

Check whether the connection's tracks are marked as rasterized.

Exceptions

  std::runtime_error | If the tracks' status is inconsistent.

## ◆ makeDirectTrack45()

void Connection::makeDirectTrack45 | ( | Real | minSquaredLen,
|  | uint | viaLocation,
|  | float | bendLocation )

Create the most direct track for this connection without considering obstacles. The connection will have up to 2 intermediate points (source –, / start, / end, – target).

Parameters

  minSquaredLen | Don't create segments shorter than this.
  viaLocation | The index of the point where to put the via.
  bendLocation | 0 to start with the 45° segment, 1 to start with the 0°/90° one, values in between for 3 segments.

## ◆ numNecessaryVias()

uint Connection::numNecessaryVias | ( |  | ) | const

0 if the layers of the endpoints or pins overlap, 1 otherwise

## ◆ reverse()

void Connection::reverse | ( |  | ) |

Reverse the endpoints and the tracks.

## ◆ setColor()

void Connection::setColor | ( | Color | c | ) |
| inline

use Color::TRANSPARENT to use net's color

## ◆ setTrack()

void Connection::setTrack | ( | Track * |  | ) |

Replace all tracks with the one provided. The track is either added by reference, moved, or copied.

## ◆ updateForRemovedLayers()

bool Connection::updateForRemovedLayers | ( | uint | removedZMin,
|  | uint | removedZMax )

Adjust the connection after removing a range of layers. Pins must be adjusted first! If and endpoint's layer is removed and there is no pin, this will return false and the connection will become invalid. Tracks with segments on the removed layers will be deleted entirely.

The documentation for this class was generated from the following file:

- /home/chr/devel/PhD/Environment/pub/PCBEnv/pcbenv/cxx/Connection.hpp