37#define MAGIC_TEARDROP_PADVIA_NAME "$teardrop_padvia$"
38#define MAGIC_TEARDROP_TRACK_NAME "$teardrop_track$"
54 std::vector<PCB_TRACK*>*
GetTrackList(
int aLayer,
int aNetcode )
const
66 *aLayer = aIdx & 0xFF;
67 *aNetcode = aIdx >> 8;
74 return ( aNetcode << 8 ) + ( aLayer & 0xFF );
116 const std::set<PCB_TRACK*>* dirtyTracks );
121 const std::set<PCB_TRACK*>* dirtyTracks,
bool aForceFullUpdate =
false );
127 bool aForceFullUpdate =
false );
150 const VECTOR2I& aOtherPos, std::vector<VECTOR2I>& aPts )
const;
159 std::vector<VECTOR2I>& aPoly,
int aTdWidth,
160 int aTrackHalfWidth, std::vector<VECTOR2I>& aPts,
161 const VECTOR2I& aIntersection )
const;
169 std::vector<VECTOR2I>& aCorners,
PCB_TRACK* aTrack,
187 std::vector<VECTOR2I>& aPts )
const;
208 std::vector<VECTOR2I>& aPoints,
PCB_TRACK* aTrack )
const;
233 int* aEffectiveTeardropLen )
const;
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Information pertinent to a Pcbnew printed circuit board.
Implement an R-tree for fast spatial and layer indexing of connectable items.
TEARDROP_MANAGER manage and build teardrop areas A teardrop area is a polygonal area (a copper ZONE) ...
static bool IsRound(BOARD_ITEM *aItem, PCB_LAYER_ID aLayer)
bool computeAnchorPoints(const TEARDROP_PARAMETERS &aParams, PCB_LAYER_ID aLayer, BOARD_ITEM *aItem, const VECTOR2I &aPos, std::vector< VECTOR2I > &aPts) const
Compute the 2 points on pad/via of the teardrop shape.
static int GetWidth(BOARD_ITEM *aItem, PCB_LAYER_ID aLayer)
bool computeTeardropPolygon(const TEARDROP_PARAMETERS &aParams, std::vector< VECTOR2I > &aCorners, PCB_TRACK *aTrack, BOARD_ITEM *aOther, const VECTOR2I &aOtherPos) const
Compute all teardrop points of the polygon shape.
void computeCurvedForRectShape(const TEARDROP_PARAMETERS &aParams, std::vector< VECTOR2I > &aPoly, int aTdWidth, int aTrackHalfWidth, std::vector< VECTOR2I > &aPts, const VECTOR2I &aIntersection) const
Compute the curve part points for teardrops connected to a rectangular/polygonal shape The Bezier cur...
void UpdateTeardrops(BOARD_COMMIT &aCommit, const std::vector< BOARD_ITEM * > *dirtyPadsAndVias, const std::set< PCB_TRACK * > *dirtyTracks, bool aForceFullUpdate=false)
Update teardrops on a list of items.
void computeCurvedForRoundShape(const TEARDROP_PARAMETERS &aParams, std::vector< VECTOR2I > &aPoly, PCB_LAYER_ID aLayer, int aTrackHalfWidth, const VECTOR2D &aTrackDir, BOARD_ITEM *aOther, const VECTOR2I &aOtherPos, std::vector< VECTOR2I > &aPts) const
Compute the curve part points for teardrops connected to a round shape The Bezier curve control point...
PCB_TRACK * findTouchingTrack(EDA_ITEM_FLAGS &aMatchType, PCB_TRACK *aTrackRef, const VECTOR2I &aEndPoint) const
Find a track connected to the end of another track.
void setTeardropPriorities()
Set priority of created teardrops.
void AddTeardropsOnTracks(BOARD_COMMIT &aCommit, const std::set< PCB_TRACK * > *aTracks, bool aForceFullUpdate=false)
Add teardrop on tracks of different sizes connected by their end.
TRACK_BUFFER m_trackLookupList
TEARDROP_PARAMETERS_LIST * m_prmsList
std::vector< ZONE * > m_createdTdList
ZONE * createTeardrop(TEARDROP_VARIANT aTeardropVariant, std::vector< VECTOR2I > &aPoints, PCB_TRACK *aTrack) const
Creates a teardrop (a ZONE item) from its polygonal shape, track netcode and layer.
void DeleteTrackToTrackTeardrops(BOARD_COMMIT &aCommit)
bool areItemsInSameZone(BOARD_ITEM *aPadOrVia, PCB_TRACK *aTrack) const
void RemoveTeardrops(BOARD_COMMIT &aCommit, const std::vector< BOARD_ITEM * > *dirtyPadsAndVias, const std::set< PCB_TRACK * > *dirtyTracks)
Remove teardrops connected to any dirty pads, vias or tracks.
TOOL_MANAGER * m_toolManager
bool findAnchorPointsOnTrack(const TEARDROP_PARAMETERS &aParams, VECTOR2I &aStartPoint, VECTOR2I &aEndPoint, VECTOR2I &aIntersection, PCB_TRACK *&aTrack, BOARD_ITEM *aOther, const VECTOR2I &aOtherPos, int *aEffectiveTeardropLen) const
TEARDROP_PARAMETERS_LIST is a helper class to handle the list of TEARDROP_PARAMETERS needed to build ...
TEARDROP_PARAMETARS is a helper class to handle parameters needed to build teardrops for a board thes...
int idxFromLayNet(int aLayer, int aNetcode) const
void AddTrack(PCB_TRACK *aTrack, int aLayer, int aNetcode)
Add a track in buffer, in space grouping tracks having the same netcode and the same layer.
std::vector< PCB_TRACK * > * GetTrackList(int aLayer, int aNetcode) const
const std::map< int, std::vector< PCB_TRACK * > * > & GetBuffer() const
std::map< int, std::vector< PCB_TRACK * > * > m_map_tracks
static void GetNetcodeAndLayerFromIndex(int aIdx, int *aLayer, int *aNetcode)
Handle a list of polygons defining a copper zone.
std::uint32_t EDA_ITEM_FLAGS
PCB_LAYER_ID
A quick note on layer IDs: