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

#include <drc_creepage_utils.h>

Classes

struct  GraphNodeEqual
 
struct  GraphNodeHash
 

Public Member Functions

 CREEPAGE_GRAPH (BOARD &aBoard)
 
 ~CREEPAGE_GRAPH ()
 
void TransformEdgeToCreepShapes ()
 
void TransformCreepShapesToNodes (std::vector< CREEP_SHAPE * > &aShapes)
 
void RemoveDuplicatedShapes ()
 
std::shared_ptr< GRAPH_NODEAddNode (GRAPH_NODE::TYPE aType, CREEP_SHAPE *aParent=nullptr, VECTOR2I aPos=VECTOR2I())
 
std::shared_ptr< GRAPH_NODEAddNodeVirtual ()
 
std::shared_ptr< GRAPH_CONNECTIONAddConnection (std::shared_ptr< GRAPH_NODE > &aN1, std::shared_ptr< GRAPH_NODE > &aN2, const PATH_CONNECTION &aPc)
 
std::shared_ptr< GRAPH_CONNECTIONAddConnection (std::shared_ptr< GRAPH_NODE > &aN1, std::shared_ptr< GRAPH_NODE > &aN2)
 
std::shared_ptr< GRAPH_NODEFindNode (GRAPH_NODE::TYPE aType, CREEP_SHAPE *aParent, VECTOR2I aPos)
 
void RemoveConnection (std::shared_ptr< GRAPH_CONNECTION >, bool aDelete=false)
 
void Trim (double aWeightLimit)
 
void Addshape (const SHAPE &aShape, std::shared_ptr< GRAPH_NODE > &aConnectTo, BOARD_ITEM *aParent=nullptr)
 
double Solve (std::shared_ptr< GRAPH_NODE > &aFrom, std::shared_ptr< GRAPH_NODE > &aTo, std::vector< std::shared_ptr< GRAPH_CONNECTION > > &aResult)
 
void GeneratePaths (double aMaxWeight, PCB_LAYER_ID aLayer, bool aClearance)
 
std::shared_ptr< GRAPH_NODEAddNetElements (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< GRAPH_NODE > > m_nodes
 
std::vector< std::shared_ptr< GRAPH_CONNECTION > > m_connections
 
std::vector< CREEP_SHAPE * > m_shapeCollection
 
std::unordered_set< std::shared_ptr< GRAPH_NODE >, GraphNodeHash, GraphNodeEqualm_nodeset
 
int m_minGrooveWidth
 

Private Attributes

double m_creepageTarget
 
double m_creepageTargetSquared
 

Detailed Description

Definition at line 686 of file drc_creepage_utils.h.

Constructor & Destructor Documentation

◆ CREEPAGE_GRAPH()

CREEPAGE_GRAPH::CREEPAGE_GRAPH ( BOARD aBoard)
inline

◆ ~CREEPAGE_GRAPH()

CREEPAGE_GRAPH::~CREEPAGE_GRAPH ( )
inline

Definition at line 697 of file drc_creepage_utils.h.

References m_shapeCollection.

Member Function Documentation

◆ AddConnection() [1/2]

std::shared_ptr< GRAPH_CONNECTION > CREEPAGE_GRAPH::AddConnection ( std::shared_ptr< GRAPH_NODE > &  aN1,
std::shared_ptr< GRAPH_NODE > &  aN2 
)

◆ AddConnection() [2/2]

std::shared_ptr< GRAPH_CONNECTION > CREEPAGE_GRAPH::AddConnection ( std::shared_ptr< GRAPH_NODE > &  aN1,
std::shared_ptr< GRAPH_NODE > &  aN2,
const PATH_CONNECTION aPc 
)

◆ AddNetElements()

std::shared_ptr< GRAPH_NODE > CREEPAGE_GRAPH::AddNetElements ( int  aNetCode,
PCB_LAYER_ID  aLayer,
int  aMaxCreepage 
)

◆ AddNode()

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

◆ AddNodeVirtual()

std::shared_ptr< GRAPH_NODE > CREEPAGE_GRAPH::AddNodeVirtual ( )

◆ Addshape()

◆ FindNode()

std::shared_ptr< GRAPH_NODE > CREEPAGE_GRAPH::FindNode ( GRAPH_NODE::TYPE  aType,
CREEP_SHAPE aParent,
VECTOR2I  aPos 
)

Definition at line 2491 of file drc_creepage_utils.cpp.

References m_nodeset.

Referenced by AddNode().

◆ GeneratePaths()

void CREEPAGE_GRAPH::GeneratePaths ( double  aMaxWeight,
PCB_LAYER_ID  aLayer,
bool  aClearance 
)

◆ GetTarget()

double CREEPAGE_GRAPH::GetTarget ( )
inline

◆ RemoveConnection()

void CREEPAGE_GRAPH::RemoveConnection ( std::shared_ptr< GRAPH_CONNECTION aGc,
bool  aDelete = false 
)

Definition at line 2400 of file drc_creepage_utils.cpp.

References m_connections, m_nodes, and m_nodeset.

Referenced by Trim().

◆ RemoveDuplicatedShapes()

void CREEPAGE_GRAPH::RemoveDuplicatedShapes ( )

◆ SetTarget()

void CREEPAGE_GRAPH::SetTarget ( double  aTarget)

◆ Solve()

double CREEPAGE_GRAPH::Solve ( std::shared_ptr< GRAPH_NODE > &  aFrom,
std::shared_ptr< GRAPH_NODE > &  aTo,
std::vector< std::shared_ptr< GRAPH_CONNECTION > > &  aResult 
)

◆ TransformCreepShapesToNodes()

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

Definition at line 471 of file drc_creepage_utils.cpp.

References AddNode().

Referenced by DRC_TEST_PROVIDER_CREEPAGE::testCreepage().

◆ TransformEdgeToCreepShapes()

◆ Trim()

void CREEPAGE_GRAPH::Trim ( double  aWeightLimit)

Definition at line 2380 of file drc_creepage_utils.cpp.

References m_connections, and RemoveConnection().

Member Data Documentation

◆ m_board

BOARD& CREEPAGE_GRAPH::m_board

Definition at line 763 of file drc_creepage_utils.h.

Referenced by AddNetElements(), and GeneratePaths().

◆ m_boardEdge

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

◆ m_boardOutline

SHAPE_POLY_SET* CREEPAGE_GRAPH::m_boardOutline

◆ m_connections

std::vector<std::shared_ptr<GRAPH_CONNECTION> > CREEPAGE_GRAPH::m_connections

◆ m_creepageTarget

double CREEPAGE_GRAPH::m_creepageTarget
private

Definition at line 776 of file drc_creepage_utils.h.

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

◆ m_creepageTargetSquared

double CREEPAGE_GRAPH::m_creepageTargetSquared
private

Definition at line 777 of file drc_creepage_utils.h.

Referenced by CREEPAGE_GRAPH(), and SetTarget().

◆ m_minGrooveWidth

◆ m_nodes

std::vector<std::shared_ptr<GRAPH_NODE> > CREEPAGE_GRAPH::m_nodes

◆ m_nodeset

std::unordered_set<std::shared_ptr<GRAPH_NODE>, GraphNodeHash, GraphNodeEqual> CREEPAGE_GRAPH::m_nodeset

Definition at line 771 of file drc_creepage_utils.h.

Referenced by AddNode(), AddNodeVirtual(), FindNode(), and RemoveConnection().

◆ m_shapeCollection

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

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