KiCad PCB EDA Suite
|
Calculate the cost of a given line, taking corner angles and total length into account. More...
#include <pns_optimizer.h>
Public Member Functions | |
COST_ESTIMATOR () | |
COST_ESTIMATOR (const COST_ESTIMATOR &aB) | |
~COST_ESTIMATOR () | |
void | Add (const LINE &aLine) |
void | Remove (const LINE &aLine) |
void | Replace (const LINE &aOldLine, const LINE &aNewLine) |
bool | IsBetter (const COST_ESTIMATOR &aOther, double aLengthTolerance, double aCornerTollerace) const |
double | GetLengthCost () const |
double | GetCornerCost () const |
Static Public Member Functions | |
static int | CornerCost (const SEG &aA, const SEG &aB) |
static int | CornerCost (const SHAPE_LINE_CHAIN &aLine) |
static int | CornerCost (const LINE &aLine) |
Private Attributes | |
double | m_lengthCost |
int | m_cornerCost |
Calculate the cost of a given line, taking corner angles and total length into account.
Definition at line 48 of file pns_optimizer.h.
|
inline |
Definition at line 51 of file pns_optimizer.h.
|
inline |
Definition at line 56 of file pns_optimizer.h.
|
inline |
Definition at line 61 of file pns_optimizer.h.
void PNS::COST_ESTIMATOR::Add | ( | const LINE & | aLine | ) |
Definition at line 76 of file pns_optimizer.cpp.
References PNS::LINE::CLine(), CornerCost(), SHAPE_LINE_CHAIN::Length(), m_cornerCost, and m_lengthCost.
|
static |
Definition at line 70 of file pns_optimizer.cpp.
References PNS::LINE::CLine(), and CornerCost().
Definition at line 43 of file pns_optimizer.cpp.
References DIRECTION_45::ANG_ACUTE, DIRECTION_45::ANG_HALF_FULL, DIRECTION_45::ANG_OBTUSE, DIRECTION_45::ANG_RIGHT, and DIRECTION_45::ANG_STRAIGHT.
Referenced by Add(), CornerCost(), PNS::OPTIMIZER::mergeStep(), Remove(), Replace(), and PNS::OPTIMIZER::smartPadsSingle().
|
static |
Definition at line 59 of file pns_optimizer.cpp.
References CornerCost(), SHAPE_LINE_CHAIN::CSegment(), and SHAPE_LINE_CHAIN::SegmentCount().
Referenced by CornerCost().
|
inline |
Definition at line 75 of file pns_optimizer.h.
References m_cornerCost.
|
inline |
Definition at line 74 of file pns_optimizer.h.
References m_lengthCost.
bool PNS::COST_ESTIMATOR::IsBetter | ( | const COST_ESTIMATOR & | aOther, |
double | aLengthTolerance, | ||
double | aCornerTollerace | ||
) | const |
Definition at line 99 of file pns_optimizer.cpp.
References m_cornerCost, and m_lengthCost.
void PNS::COST_ESTIMATOR::Remove | ( | const LINE & | aLine | ) |
Definition at line 83 of file pns_optimizer.cpp.
References PNS::LINE::CLine(), CornerCost(), SHAPE_LINE_CHAIN::Length(), m_cornerCost, and m_lengthCost.
Definition at line 90 of file pns_optimizer.cpp.
References PNS::LINE::CLine(), CornerCost(), SHAPE_LINE_CHAIN::Length(), m_cornerCost, and m_lengthCost.
|
private |
Definition at line 79 of file pns_optimizer.h.
Referenced by Add(), GetCornerCost(), IsBetter(), Remove(), and Replace().
|
private |
Definition at line 78 of file pns_optimizer.h.
Referenced by Add(), GetLengthCost(), IsBetter(), Remove(), and Replace().