KiCad PCB EDA Suite
Loading...
Searching...
No Matches
eda_shape.cpp File Reference
#include <eda_shape.h>
#include <base_units.h>
#include <bezier_curves.h>
#include <convert_basic_shapes_to_polygon.h>
#include <eda_draw_frame.h>
#include <geometry/shape_arc.h>
#include <geometry/shape_circle.h>
#include <geometry/shape_compound.h>
#include <geometry/shape_ellipse.h>
#include <geometry/shape_line_chain.h>
#include <geometry/shape_simple.h>
#include <geometry/shape_segment.h>
#include <geometry/shape_rect.h>
#include <geometry/shape_utils.h>
#include <geometry/roundrect.h>
#include <geometry/geometry_utils.h>
#include <macros.h>
#include <algorithm>
#include <iterator>
#include <properties/property_validators.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
#include <math/util.h>
#include <eda_item.h>
#include <plotters/plotter.h>
#include <api/api_enums.h>
#include <api/api_utils.h>
#include <api/common/types/base_types.pb.h>

Go to the source code of this file.

Classes

struct  EDA_SHAPE_DESC
 

Macros

#define sq(x)
 
#define SWAPITEM(x)
 
#define EPSILON   2
 
#define TEST(a, b)
 
#define TEST_E(a, b)
 
#define TEST_PT(a, b)
 

Functions

static bool hasLineEnding (const LINE_ENDING &aStartEnding, const LINE_ENDING &aEndEnding)
 
static SHAPE_LINE_CHAIN lineEndingClosedChain (const std::vector< VECTOR2I > &aPolygon)
 
static void addLineEndingEffectiveShapes (std::vector< SHAPE * > &aShapes, const LINE_ENDING &aEnding, const VECTOR2I &aPoint, const EDA_ANGLE &aTangent, int aLineWidth)
 
static void addLineEndingPolygon (SHAPE_POLY_SET &aBuffer, const LINE_ENDING &aEnding, const VECTOR2I &aPoint, const EDA_ANGLE &aTangent, int aClearance, int aError, ERROR_LOC aErrorLoc, int aLineWidth)
 
static double bezierLength (const BEZIER< double > &aBezier, double aT0, double aT1)
 
static double findBezierTAtLength (const BEZIER< double > &aBezier, double aTargetLength, double aTotalLength)
 
static double bezierSpeedAt (const BEZIER< double > &aBezier, double aT)
 

Variables

static struct EDA_SHAPE_DESC _EDA_SHAPE_DESC
 

Macro Definition Documentation

◆ EPSILON

◆ sq

#define sq ( x)
Value:
pow( x, 2 )

Referenced by EDA_SHAPE::calcEdit().

◆ SWAPITEM

#define SWAPITEM ( x)
Value:
std::swap( x, image->x )

Referenced by EDA_SHAPE::SwapShape().

◆ TEST

◆ TEST_E

#define TEST_E ( a,
b )
Value:
{ \
if( abs( a - b ) > EPSILON ) \
return a - b; \
}
#define EPSILON

Referenced by EDA_SHAPE::Compare().

◆ TEST_PT

#define TEST_PT ( a,
b )
Value:
{ \
TEST_E( a.x, b.x ); \
TEST_E( a.y, b.y ); \
}

Referenced by EDA_SHAPE::Compare(), and KI_TEST::kitest_cmp_drawings::operator()().

Function Documentation

◆ addLineEndingEffectiveShapes()

static void addLineEndingEffectiveShapes ( std::vector< SHAPE * > & aShapes,
const LINE_ENDING & aEnding,
const VECTOR2I & aPoint,
const EDA_ANGLE & aTangent,
int aLineWidth )
static

◆ addLineEndingPolygon()

◆ bezierLength()

static double bezierLength ( const BEZIER< double > & aBezier,
double aT0,
double aT1 )
static

◆ bezierSpeedAt()

static double bezierSpeedAt ( const BEZIER< double > & aBezier,
double aT )
static

◆ findBezierTAtLength()

static double findBezierTAtLength ( const BEZIER< double > & aBezier,
double aTargetLength,
double aTotalLength )
static

Definition at line 4323 of file eda_shape.cpp.

References bezierLength().

Referenced by EDA_SHAPE::GetEndingTangents(), and EDA_SHAPE::ShortenedBezierCurve().

◆ hasLineEnding()

◆ lineEndingClosedChain()

static SHAPE_LINE_CHAIN lineEndingClosedChain ( const std::vector< VECTOR2I > & aPolygon)
static

Definition at line 2509 of file eda_shape.cpp.

References chain.

Referenced by addLineEndingEffectiveShapes(), and addLineEndingPolygon().

Variable Documentation

◆ _EDA_SHAPE_DESC

struct EDA_SHAPE_DESC _EDA_SHAPE_DESC
static