Remove dead code.

This commit is contained in:
Jeff Young 2022-01-18 01:40:03 +00:00
parent 8c246a761d
commit e37ca2f757
5 changed files with 2 additions and 129 deletions

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@ -621,91 +621,6 @@ void GRFilledArc1( EDA_RECT* ClipBox, wxDC* DC, const VECTOR2I& aStart, const VE
}
void GRArc( EDA_RECT* ClipBox, wxDC* DC, int xc, int yc, double StAngle, double EndAngle, int r,
const COLOR4D& Color )
{
int x1, y1, x2, y2;
/* Clip arcs off screen */
if( ClipBox )
{
int radius = r + 1;
int x0, y0, xm, ym, x, y;
x0 = ClipBox->GetX();
y0 = ClipBox->GetY();
xm = ClipBox->GetRight();
ym = ClipBox->GetBottom();
x = xc;
y = yc;
if( x < ( x0 - radius ) )
return;
if( y < ( y0 - radius ) )
return;
if( x > ( xm + radius ) )
return;
if( y > ( ym + radius ) )
return;
}
x1 = r;
y1 = 0;
RotatePoint( &x1, &y1, EndAngle );
x2 = r;
y2 = 0;
RotatePoint( &x2, &y2, StAngle );
GRSetBrush( DC, Color, NOT_FILLED );
GRSetColorPen( DC, Color );
DC->DrawArc( xc + x1, yc - y1, xc + x2, yc - y2, xc, yc );
}
void GRArc( EDA_RECT* ClipBox, wxDC* DC, int x, int y, double StAngle, double EndAngle, int r,
int width, const COLOR4D& Color )
{
int x1, y1, x2, y2;
/* Clip arcs off screen. */
if( ClipBox )
{
int x0, y0, xm, ym;
x0 = ClipBox->GetX();
y0 = ClipBox->GetY();
xm = ClipBox->GetRight();
ym = ClipBox->GetBottom();
if( x < ( x0 - r - width ) )
return;
if( y < ( y0 - r - width ) )
return;
if( x > ( r + xm + width ) )
return;
if( y > ( r + ym + width ) )
return;
}
x1 = r;
y1 = 0;
RotatePoint( &x1, &y1, EndAngle );
x2 = r;
y2 = 0;
RotatePoint( &x2, &y2, StAngle );
GRSetBrush( DC, Color );
GRSetColorPen( DC, Color, width );
DC->DrawArc( x + x1, y - y1, x + x2, y - y2, x, y );
}
void GRRect( EDA_RECT* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2, int width,
const COLOR4D& Color )
{

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@ -19,10 +19,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file gr_basic.h
*/
#ifndef GR_BASIC
#define GR_BASIC
@ -153,10 +149,6 @@ void GRFilledCircle( EDA_RECT* aClipBox, wxDC* aDC, const VECTOR2I& aPos, int aR
void GRCircle( EDA_RECT* aClipBox, wxDC* aDC, const VECTOR2I& aPos, int aRadius, int aWidth,
const COLOR4D& aColor );
void GRArc( EDA_RECT* ClipBox, wxDC* DC, int x, int y, double StAngle,
double EndAngle, int r, const COLOR4D& Color );
void GRArc( EDA_RECT* ClipBox, wxDC* DC, int x, int y, double StAngle,
double EndAngle, int r, int width, const COLOR4D& Color );
void GRArc1( EDA_RECT* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
int xc, int yc, int width, const COLOR4D& Color );
void GRArc1( EDA_RECT* aClipBox, wxDC* aDC, const VECTOR2I& aStart, const VECTOR2I& aEnd,

View File

@ -141,11 +141,6 @@ const VECTOR2D CalcArcCenter( const VECTOR2D& aStart, const VECTOR2D& aMid, cons
const VECTOR2I CalcArcCenter( const VECTOR2I& aStart, const VECTOR2I& aEnd,
const EDA_ANGLE& aAngle );
/**
* Return the subtended angle for a given arc.
*/
double CalcArcAngle( const VECTOR2I& aStart, const VECTOR2I& aMid, const VECTOR2I& aEnd );
/**
* Return the middle point of an arc, half-way between aStart and aEnd. There are two possible
* solutions which can be found by toggling aMinArcAngle. The behaviour is undefined for

View File

@ -33,12 +33,10 @@
#include <clipper.hpp>
#include <core/kicad_algo.h> // for alg::run_on_pair
#include <geometry/seg.h> // for SEG, OPT_VECTOR2I
#include <geometry/circle.h> // for CIRCLE
#include <geometry/shape_line_chain.h>
#include <math/box2.h> // for BOX2I
#include <math/util.h> // for rescale
#include <math/vector2d.h> // for VECTOR2, VECTOR2I
#include <trigo.h> // for RAD2DECIDEG, CalcArcAngle
class SHAPE;

View File

@ -475,30 +475,3 @@ const VECTOR2I CalcArcCenter( const VECTOR2I& aStart, const VECTOR2I& aMid, cons
}
double CalcArcAngle( const VECTOR2I& aStart, const VECTOR2I& aMid, const VECTOR2I& aEnd )
{
VECTOR2I center = CalcArcCenter( aStart, aMid, aEnd );
// Check if the new arc is CW or CCW
VECTOR2D startLine = aStart - center;
VECTOR2D endLine = aEnd - center;
double angle = RAD2DECIDEG( endLine.Angle() - startLine.Angle() );
VECTOR2D v1, v2;
v1 = aStart - aMid;
v2 = aEnd - aMid;
double theta = RAD2DECIDEG( v1.Angle() );
RotatePoint( &( v1.x ), &( v1.y ), theta );
RotatePoint( &( v2.x ), &( v2.y ), theta );
bool clockwise = ( ( v1.Angle() - v2.Angle() ) > 0 );
// Normalize the angle
if( clockwise && angle < 0.0 )
angle += 3600.0;
else if( !clockwise && angle > 0.0 )
angle -= 3600.0;
return angle;
}