KiCad PCB EDA Suite
Loading...
Searching...
No Matches
CreepageGraph Class Reference

A graph with nodes and connections for creepage calculation. More...

#include <drc_creepage_utils.h>

Public Member Functions

 CreepageGraph (BOARD &aBoard)
 
 ~CreepageGraph ()
 
void TransformEdgeToCreepShapes ()
 
void TransformCreepShapesToNodes (std::vector< CREEP_SHAPE * > &aShapes)
 
void RemoveDuplicatedShapes ()
 
std::shared_ptr< GraphNodeAddNode (GraphNode::TYPE aType, CREEP_SHAPE *aParent=nullptr, VECTOR2I aPos=VECTOR2I())
 
std::shared_ptr< GraphNodeAddNodeVirtual ()
 
std::shared_ptr< GraphConnectionAddConnection (std::shared_ptr< GraphNode > &aN1, std::shared_ptr< GraphNode > &aN2, const PATH_CONNECTION &aPc)
 
std::shared_ptr< GraphConnectionAddConnection (std::shared_ptr< GraphNode > &aN1, std::shared_ptr< GraphNode > &aN2)
 
std::shared_ptr< GraphNodeFindNode (GraphNode::TYPE aType, CREEP_SHAPE *aParent, VECTOR2I aPos)
 
void RemoveConnection (std::shared_ptr< GraphConnection >, bool aDelete=false)
 
void Trim (double aWeightLimit)
 
void Addshape (const SHAPE &aShape, std::shared_ptr< GraphNode > &aConnectTo, BOARD_ITEM *aParent=nullptr)
 
double Solve (std::shared_ptr< GraphNode > &aFrom, std::shared_ptr< GraphNode > &aTo, std::vector< std::shared_ptr< GraphConnection > > &aResult)
 
void GeneratePaths (double aMaxWeight, PCB_LAYER_ID aLayer, bool aGenerateBoardEdges=true)
 
std::shared_ptr< GraphNodeAddNetElements (int aNetCode, PCB_LAYER_ID aLayer, int aMaxCreepage)
 
void SetTarget (double aTarget)
 
double GetTarget ()
 

Public Attributes

BOARDm_board
 
std::vector< BOARD_ITEM * > m_boardEdge
 
SHAPE_POLY_SETm_boardOutline
 
std::vector< std::shared_ptr< GraphNode > > m_nodes
 
std::vector< std::shared_ptr< GraphConnection > > m_connections
 
int m_minGrooveWidth = 0
 
std::vector< CREEP_SHAPE * > m_shapeCollection
 

Private Attributes

double m_creepageTarget
 
double m_creepageTargetSquared
 

Detailed Description

A graph with nodes and connections for creepage calculation.

Definition at line 657 of file drc_creepage_utils.h.

Constructor & Destructor Documentation

◆ CreepageGraph()

CreepageGraph::CreepageGraph ( BOARD aBoard)
inline

Definition at line 660 of file drc_creepage_utils.h.

References m_boardOutline, m_creepageTarget, and m_creepageTargetSquared.

◆ ~CreepageGraph()

CreepageGraph::~CreepageGraph ( )
inline

Definition at line 666 of file drc_creepage_utils.h.

References m_shapeCollection.

Member Function Documentation

◆ AddConnection() [1/2]

std::shared_ptr< GraphConnection > CreepageGraph::AddConnection ( std::shared_ptr< GraphNode > &  aN1,
std::shared_ptr< GraphNode > &  aN2 
)

◆ AddConnection() [2/2]

std::shared_ptr< GraphConnection > CreepageGraph::AddConnection ( std::shared_ptr< GraphNode > &  aN1,
std::shared_ptr< GraphNode > &  aN2,
const PATH_CONNECTION aPc 
)

◆ AddNetElements()

std::shared_ptr< GraphNode > CreepageGraph::AddNetElements ( int  aNetCode,
PCB_LAYER_ID  aLayer,
int  aMaxCreepage 
)

◆ AddNode()

std::shared_ptr< GraphNode > CreepageGraph::AddNode ( GraphNode::TYPE  aType,
CREEP_SHAPE aParent = nullptr,
VECTOR2I  aPos = VECTOR2I() 
)

◆ AddNodeVirtual()

std::shared_ptr< GraphNode > CreepageGraph::AddNodeVirtual ( )

◆ Addshape()

◆ FindNode()

std::shared_ptr< GraphNode > CreepageGraph::FindNode ( GraphNode::TYPE  aType,
CREEP_SHAPE aParent,
VECTOR2I  aPos 
)

Definition at line 2479 of file drc_creepage_utils.cpp.

References m_nodes, and CREEP_SHAPE::m_parent.

Referenced by AddNode().

◆ GeneratePaths()

void CreepageGraph::GeneratePaths ( double  aMaxWeight,
PCB_LAYER_ID  aLayer,
bool  aGenerateBoardEdges = true 
)

◆ GetTarget()

double CreepageGraph::GetTarget ( )
inline

◆ RemoveConnection()

void CreepageGraph::RemoveConnection ( std::shared_ptr< GraphConnection aGc,
bool  aDelete = false 
)

Definition at line 2390 of file drc_creepage_utils.cpp.

References m_connections, and m_nodes.

Referenced by Trim().

◆ RemoveDuplicatedShapes()

void CreepageGraph::RemoveDuplicatedShapes ( )

◆ SetTarget()

void CreepageGraph::SetTarget ( double  aTarget)

◆ Solve()

double CreepageGraph::Solve ( std::shared_ptr< GraphNode > &  aFrom,
std::shared_ptr< GraphNode > &  aTo,
std::vector< std::shared_ptr< GraphConnection > > &  aResult 
)

◆ TransformCreepShapesToNodes()

void CreepageGraph::TransformCreepShapesToNodes ( std::vector< CREEP_SHAPE * > &  aShapes)

Definition at line 470 of file drc_creepage_utils.cpp.

References AddNode().

Referenced by DRC_TEST_PROVIDER_CREEPAGE::testCreepage().

◆ TransformEdgeToCreepShapes()

◆ Trim()

void CreepageGraph::Trim ( double  aWeightLimit)

Definition at line 2370 of file drc_creepage_utils.cpp.

References m_connections, and RemoveConnection().

Member Data Documentation

◆ m_board

BOARD& CreepageGraph::m_board

Definition at line 676 of file drc_creepage_utils.h.

Referenced by AddNetElements(), and GeneratePaths().

◆ m_boardEdge

std::vector<BOARD_ITEM*> CreepageGraph::m_boardEdge

◆ m_boardOutline

SHAPE_POLY_SET* CreepageGraph::m_boardOutline

◆ m_connections

std::vector<std::shared_ptr<GraphConnection> > CreepageGraph::m_connections

◆ m_creepageTarget

double CreepageGraph::m_creepageTarget
private

Definition at line 718 of file drc_creepage_utils.h.

Referenced by CreepageGraph(), GetTarget(), and SetTarget().

◆ m_creepageTargetSquared

double CreepageGraph::m_creepageTargetSquared
private

Definition at line 719 of file drc_creepage_utils.h.

Referenced by CreepageGraph(), and SetTarget().

◆ m_minGrooveWidth

◆ m_nodes

std::vector<std::shared_ptr<GraphNode> > CreepageGraph::m_nodes

◆ m_shapeCollection

std::vector<CREEP_SHAPE*> CreepageGraph::m_shapeCollection

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