KiCad PCB EDA Suite
Loading...
Searching...
No Matches
shape_collisions.cpp File Reference
#include <cmath>
#include <limits>
#include <geometry/seg.h>
#include <geometry/shape.h>
#include <geometry/shape_arc.h>
#include <geometry/shape_line_chain.h>
#include <geometry/shape_circle.h>
#include <geometry/shape_rect.h>
#include <geometry/shape_segment.h>
#include <geometry/shape_compound.h>
#include <geometry/shape_poly_set.h>
#include <math/vector2d.h>

Go to the source code of this file.

Typedefs

typedef VECTOR2I::extended_type ecoord
 

Functions

static bool Collide (const SHAPE_CIRCLE &aA, const SHAPE_CIRCLE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
static bool Collide (const SHAPE_RECT &aA, const SHAPE_CIRCLE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
static VECTOR2I pushoutForce (const SHAPE_CIRCLE &aA, const SEG &aB, int aClearance)
 
static bool Collide (const SHAPE_CIRCLE &aA, const SHAPE_LINE_CHAIN_BASE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
static bool Collide (const SHAPE_CIRCLE &aA, const SHAPE_SEGMENT &aSeg, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
static bool Collide (const SHAPE_LINE_CHAIN_BASE &aA, const SHAPE_LINE_CHAIN_BASE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
static bool Collide (const SHAPE_RECT &aA, const SHAPE_LINE_CHAIN_BASE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
static bool Collide (const SHAPE_RECT &aA, const SHAPE_SEGMENT &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
static bool Collide (const SHAPE_SEGMENT &aA, const SHAPE_SEGMENT &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
static bool Collide (const SHAPE_LINE_CHAIN_BASE &aA, const SHAPE_SEGMENT &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
static bool Collide (const SHAPE_RECT &aA, const SHAPE_RECT &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
static bool Collide (const SHAPE_ARC &aA, const SHAPE_RECT &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
static bool Collide (const SHAPE_ARC &aA, const SHAPE_CIRCLE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
static bool Collide (const SHAPE_ARC &aA, const SHAPE_LINE_CHAIN &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
static bool Collide (const SHAPE_ARC &aA, const SHAPE_SEGMENT &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
static bool Collide (const SHAPE_ARC &aA, const SHAPE_LINE_CHAIN_BASE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
static bool Collide (const SHAPE_ARC &aA, const SHAPE_ARC &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
template<class T_a , class T_b >
bool CollCase (const SHAPE *aA, const SHAPE *aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
template<class T_a , class T_b >
bool CollCaseReversed (const SHAPE *aA, const SHAPE *aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
static bool collideSingleShapes (const SHAPE *aA, const SHAPE *aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 
static bool collideShapes (const SHAPE *aA, const SHAPE *aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
 

Typedef Documentation

◆ ecoord

Definition at line 40 of file shape_collisions.cpp.

Function Documentation

◆ CollCase()

template<class T_a , class T_b >
bool CollCase ( const SHAPE aA,
const SHAPE aB,
int  aClearance,
int *  aActual,
VECTOR2I aLocation,
VECTOR2I aMTV 
)
inline

Definition at line 809 of file shape_collisions.cpp.

References Collide().

◆ CollCaseReversed()

template<class T_a , class T_b >
bool CollCaseReversed ( const SHAPE aA,
const SHAPE aB,
int  aClearance,
int *  aActual,
VECTOR2I aLocation,
VECTOR2I aMTV 
)
inline

Definition at line 819 of file shape_collisions.cpp.

References Collide().

◆ Collide() [1/16]

static bool Collide ( const SHAPE_ARC aA,
const SHAPE_ARC aB,
int  aClearance,
int *  aActual,
VECTOR2I aLocation,
VECTOR2I aMTV 
)
inlinestatic

◆ Collide() [2/16]

static bool Collide ( const SHAPE_ARC aA,
const SHAPE_CIRCLE aB,
int  aClearance,
int *  aActual,
VECTOR2I aLocation,
VECTOR2I aMTV 
)
inlinestatic

Definition at line 548 of file shape_collisions.cpp.

References Collide(), and SHAPE_ARC::GetWidth().

◆ Collide() [3/16]

◆ Collide() [4/16]

static bool Collide ( const SHAPE_ARC aA,
const SHAPE_LINE_CHAIN_BASE aB,
int  aClearance,
int *  aActual,
VECTOR2I aLocation,
VECTOR2I aMTV 
)
inlinestatic

◆ Collide() [5/16]

static bool Collide ( const SHAPE_ARC aA,
const SHAPE_RECT aB,
int  aClearance,
int *  aActual,
VECTOR2I aLocation,
VECTOR2I aMTV 
)
inlinestatic

◆ Collide() [6/16]

static bool Collide ( const SHAPE_ARC aA,
const SHAPE_SEGMENT aB,
int  aClearance,
int *  aActual,
VECTOR2I aLocation,
VECTOR2I aMTV 
)
inlinestatic

◆ Collide() [7/16]

static bool Collide ( const SHAPE_CIRCLE aA,
const SHAPE_CIRCLE aB,
int  aClearance,
int *  aActual,
VECTOR2I aLocation,
VECTOR2I aMTV 
)
inlinestatic

◆ Collide() [8/16]

◆ Collide() [9/16]

static bool Collide ( const SHAPE_CIRCLE aA,
const SHAPE_SEGMENT aSeg,
int  aClearance,
int *  aActual,
VECTOR2I aLocation,
VECTOR2I aMTV 
)
inlinestatic

◆ Collide() [10/16]

◆ Collide() [11/16]

static bool Collide ( const SHAPE_LINE_CHAIN_BASE aA,
const SHAPE_SEGMENT aB,
int  aClearance,
int *  aActual,
VECTOR2I aLocation,
VECTOR2I aMTV 
)
inlinestatic

◆ Collide() [12/16]

static bool Collide ( const SHAPE_RECT aA,
const SHAPE_CIRCLE aB,
int  aClearance,
int *  aActual,
VECTOR2I aLocation,
VECTOR2I aMTV 
)
inlinestatic

◆ Collide() [13/16]

static bool Collide ( const SHAPE_RECT aA,
const SHAPE_LINE_CHAIN_BASE aB,
int  aClearance,
int *  aActual,
VECTOR2I aLocation,
VECTOR2I aMTV 
)
inlinestatic

◆ Collide() [14/16]

static bool Collide ( const SHAPE_RECT aA,
const SHAPE_RECT aB,
int  aClearance,
int *  aActual,
VECTOR2I aLocation,
VECTOR2I aMTV 
)
inlinestatic

◆ Collide() [15/16]

static bool Collide ( const SHAPE_RECT aA,
const SHAPE_SEGMENT aB,
int  aClearance,
int *  aActual,
VECTOR2I aLocation,
VECTOR2I aMTV 
)
inlinestatic

◆ Collide() [16/16]

static bool Collide ( const SHAPE_SEGMENT aA,
const SHAPE_SEGMENT aB,
int  aClearance,
int *  aActual,
VECTOR2I aLocation,
VECTOR2I aMTV 
)
inlinestatic

◆ collideShapes()

static bool collideShapes ( const SHAPE aA,
const SHAPE aB,
int  aClearance,
int *  aActual,
VECTOR2I aLocation,
VECTOR2I aMTV 
)
static

◆ collideSingleShapes()

static bool collideSingleShapes ( const SHAPE aA,
const SHAPE aB,
int  aClearance,
int *  aActual,
VECTOR2I aLocation,
VECTOR2I aMTV 
)
static

◆ pushoutForce()

static VECTOR2I pushoutForce ( const SHAPE_CIRCLE aA,
const SEG aB,
int  aClearance 
)
static