KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PNS::COST_ESTIMATOR Class Reference

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
 

Detailed Description

Calculate the cost of a given line, taking corner angles and total length into account.

Definition at line 48 of file pns_optimizer.h.

Constructor & Destructor Documentation

◆ COST_ESTIMATOR() [1/2]

PNS::COST_ESTIMATOR::COST_ESTIMATOR ( )
inline

Definition at line 51 of file pns_optimizer.h.

◆ COST_ESTIMATOR() [2/2]

PNS::COST_ESTIMATOR::COST_ESTIMATOR ( const COST_ESTIMATOR aB)
inline

Definition at line 56 of file pns_optimizer.h.

◆ ~COST_ESTIMATOR()

PNS::COST_ESTIMATOR::~COST_ESTIMATOR ( )
inline

Definition at line 61 of file pns_optimizer.h.

Member Function Documentation

◆ Add()

void PNS::COST_ESTIMATOR::Add ( const LINE aLine)

◆ CornerCost() [1/3]

int PNS::COST_ESTIMATOR::CornerCost ( const LINE aLine)
static

Definition at line 70 of file pns_optimizer.cpp.

References PNS::LINE::CLine(), and CornerCost().

◆ CornerCost() [2/3]

int PNS::COST_ESTIMATOR::CornerCost ( const SEG aA,
const SEG aB 
)
static

◆ CornerCost() [3/3]

int PNS::COST_ESTIMATOR::CornerCost ( const SHAPE_LINE_CHAIN aLine)
static

◆ GetCornerCost()

double PNS::COST_ESTIMATOR::GetCornerCost ( ) const
inline

Definition at line 75 of file pns_optimizer.h.

References m_cornerCost.

◆ GetLengthCost()

double PNS::COST_ESTIMATOR::GetLengthCost ( ) const
inline

Definition at line 74 of file pns_optimizer.h.

References m_lengthCost.

◆ IsBetter()

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.

◆ Remove()

void PNS::COST_ESTIMATOR::Remove ( const LINE aLine)

◆ Replace()

void PNS::COST_ESTIMATOR::Replace ( const LINE aOldLine,
const LINE aNewLine 
)

Member Data Documentation

◆ m_cornerCost

int PNS::COST_ESTIMATOR::m_cornerCost
private

Definition at line 79 of file pns_optimizer.h.

Referenced by Add(), GetCornerCost(), IsBetter(), Remove(), and Replace().

◆ m_lengthCost

double PNS::COST_ESTIMATOR::m_lengthCost
private

Definition at line 78 of file pns_optimizer.h.

Referenced by Add(), GetLengthCost(), IsBetter(), Remove(), and Replace().


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