7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-20 21:11:43 +00:00

All: GetBoundingBox returns now a const EDA_RECT.

Pcbnew: Code cleaning and bug fix in autoplace functions
Dialog exchange footprints has now a separate button to update the .cmp file, only on request.
This commit is contained in:
jean-pierre charras 2013-11-24 18:48:14 +01:00
parent 78670eebb0
commit 5f01f123de
67 changed files with 552 additions and 565 deletions

View File

@ -532,7 +532,7 @@ double EDA_RECT::GetArea() const
/* Calculate the bounding box of this, when rotated
*/
EDA_RECT EDA_RECT::GetBoundingBoxRotated( wxPoint aRotCenter, double aAngle )
const EDA_RECT EDA_RECT::GetBoundingBoxRotated( wxPoint aRotCenter, double aAngle )
{
wxPoint corners[4];

View File

@ -484,7 +484,7 @@ void LIB_ARC::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf
}
EDA_RECT LIB_ARC::GetBoundingBox() const
const EDA_RECT LIB_ARC::GetBoundingBox() const
{
int minX, minY, maxX, maxY, angleStart, angleEnd;
EDA_RECT rect;

View File

@ -104,7 +104,7 @@ public:
bool HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform );
EDA_RECT GetBoundingBox() const;
const EDA_RECT GetBoundingBox() const; // Virtual
void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList );

View File

@ -378,7 +378,7 @@ bool LIB_BEZIER::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTra
}
EDA_RECT LIB_BEZIER::GetBoundingBox() const
const EDA_RECT LIB_BEZIER::GetBoundingBox() const
{
EDA_RECT rect;
int xmin, xmax, ymin, ymax;

View File

@ -76,7 +76,7 @@ public:
bool HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform );
EDA_RECT GetBoundingBox() const;
const EDA_RECT GetBoundingBox() const; // Virtual
bool Inside( EDA_RECT& aRect ) const;

View File

@ -105,7 +105,7 @@ bool LIB_CIRCLE::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTra
if( aThreshold < 0 )
aThreshold = GetPenSize() / 2;
int dist = KiROUND( GetLineLength( aPosRef, aTransform.TransformCoordinate( m_Pos ) ) );
int dist = KiROUND( GetLineLength( aPosRef, aTransform.TransformCoordinate( m_Pos ) ) );
if( abs( dist - m_Radius ) <= aThreshold )
return true;
@ -251,7 +251,7 @@ void LIB_CIRCLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
}
EDA_RECT LIB_CIRCLE::GetBoundingBox() const
const EDA_RECT LIB_CIRCLE::GetBoundingBox() const
{
EDA_RECT rect;

View File

@ -67,7 +67,7 @@ public:
int GetPenSize( ) const;
EDA_RECT GetBoundingBox() const;
const EDA_RECT GetBoundingBox() const; // Virtual
void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList );

View File

@ -260,7 +260,7 @@ public:
/**
* @return the boundary box for this, in library coordinates
*/
virtual EDA_RECT GetBoundingBox() const { return EDA_ITEM::GetBoundingBox(); }
virtual const EDA_RECT GetBoundingBox() const { return EDA_ITEM::GetBoundingBox(); }
/**
* Function GetMsgPanelInfo

View File

@ -524,7 +524,7 @@ wxString LIB_FIELD::GetFullText( int unit )
}
EDA_RECT LIB_FIELD::GetBoundingBox() const
const EDA_RECT LIB_FIELD::GetBoundingBox() const
{
/* Y coordinates for LIB_ITEMS are bottom to top, so we must invert the Y position when
* calling GetTextBox() that works using top to bottom Y axis orientation.

View File

@ -165,7 +165,7 @@ public:
return (m_Attributs & TEXT_NO_VISIBLE) == 0 ? true : false;
}
EDA_RECT GetBoundingBox() const;
const EDA_RECT GetBoundingBox() const; // Virtual
void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList );

View File

@ -1869,7 +1869,7 @@ void LIB_PIN::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
}
EDA_RECT LIB_PIN::GetBoundingBox() const
const EDA_RECT LIB_PIN::GetBoundingBox() const
{
LIB_COMPONENT* entry = (LIB_COMPONENT*) m_Parent;
EDA_RECT bbox;

View File

@ -139,7 +139,7 @@ public:
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation );
EDA_RECT GetBoundingBox() const;
const EDA_RECT GetBoundingBox() const; // Virtual
/**
* Function ReturnPinEndPoint

View File

@ -353,7 +353,7 @@ bool LIB_POLYLINE::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM&
}
EDA_RECT LIB_POLYLINE::GetBoundingBox() const
const EDA_RECT LIB_POLYLINE::GetBoundingBox() const
{
EDA_RECT rect;
int xmin, xmax, ymin, ymax;

View File

@ -78,7 +78,7 @@ public:
bool HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform );
EDA_RECT GetBoundingBox() const;
const EDA_RECT GetBoundingBox() const; // Virtual
int GetPenSize( ) const;

View File

@ -256,7 +256,7 @@ void LIB_RECTANGLE::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
}
EDA_RECT LIB_RECTANGLE::GetBoundingBox() const
const EDA_RECT LIB_RECTANGLE::GetBoundingBox() const
{
EDA_RECT rect;

View File

@ -71,7 +71,7 @@ public:
int GetPenSize( ) const;
EDA_RECT GetBoundingBox() const;
const EDA_RECT GetBoundingBox() const; // Virtual
void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList );

View File

@ -430,7 +430,7 @@ void LIB_TEXT::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
}
EDA_RECT LIB_TEXT::GetBoundingBox() const
const EDA_RECT LIB_TEXT::GetBoundingBox() const
{
/* Y coordinates for LIB_ITEMS are bottom to top, so we must invert the Y position when
* calling GetTextBox() that works using top to bottom Y axis orientation.

View File

@ -96,7 +96,7 @@ public:
void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList );
EDA_RECT GetBoundingBox() const;
const EDA_RECT GetBoundingBox() const; // virtual
void Rotate();

View File

@ -176,7 +176,7 @@ bool SCH_BITMAP::Load( LINE_READER& aLine, wxString& aErrorMsg )
}
EDA_RECT SCH_BITMAP::GetBoundingBox() const
const EDA_RECT SCH_BITMAP::GetBoundingBox() const
{
EDA_RECT rect = m_Image->GetBoundingBox();

View File

@ -90,7 +90,7 @@ public:
*/
wxSize GetSize() const;
EDA_RECT GetBoundingBox() const;
const EDA_RECT GetBoundingBox() const; // Virtual
void SwapData( SCH_ITEM* aItem );

View File

@ -110,7 +110,7 @@ bool SCH_BUS_BUS_ENTRY::Save( FILE* aFile ) const
}
bool SCH_BUS_ENTRY_BASE::Load( LINE_READER& aLine, wxString& aErrorMsg,
bool SCH_BUS_ENTRY_BASE::Load( LINE_READER& aLine, wxString& aErrorMsg,
SCH_ITEM **out )
{
char Name1[256];
@ -136,7 +136,7 @@ bool SCH_BUS_ENTRY_BASE::Load( LINE_READER& aLine, wxString& aErrorMsg,
this_new = new SCH_BUS_WIRE_ENTRY;
*out = this_new;
if( !aLine.ReadLine() || sscanf( (char*) aLine, "%d %d %d %d ",
if( !aLine.ReadLine() || sscanf( (char*) aLine, "%d %d %d %d ",
&this_new->m_pos.x, &this_new->m_pos.y,
&this_new->m_size.x, &this_new->m_size.y ) != 4 )
{
@ -153,7 +153,7 @@ bool SCH_BUS_ENTRY_BASE::Load( LINE_READER& aLine, wxString& aErrorMsg,
}
EDA_RECT SCH_BUS_ENTRY_BASE::GetBoundingBox() const
const EDA_RECT SCH_BUS_ENTRY_BASE::GetBoundingBox() const
{
EDA_RECT box;

View File

@ -76,7 +76,7 @@ public:
static bool Load( LINE_READER& aLine, wxString& aErrorMsg, SCH_ITEM **out );
EDA_RECT GetBoundingBox() const;
const EDA_RECT GetBoundingBox() const; // Virtual
void Move( const wxPoint& aMoveVector )
{

View File

@ -1430,7 +1430,7 @@ EDA_RECT SCH_COMPONENT::GetBodyBoundingBox() const
}
EDA_RECT SCH_COMPONENT::GetBoundingBox() const
const EDA_RECT SCH_COMPONENT::GetBoundingBox() const
{
EDA_RECT bbox = GetBodyBoundingBox();
for( size_t i = 0; i < m_Fields.size(); i++ )

View File

@ -220,7 +220,7 @@ public:
*/
void SetTimeStamp( time_t aNewTimeStamp );
EDA_RECT GetBoundingBox() const;
const EDA_RECT GetBoundingBox() const; // Virtual
//-----<Fields>-----------------------------------------------------------

View File

@ -259,7 +259,7 @@ void SCH_FIELD::SwapData( SCH_ITEM* aItem )
}
EDA_RECT SCH_FIELD::GetBoundingBox() const
const EDA_RECT SCH_FIELD::GetBoundingBox() const
{
SCH_COMPONENT* parentComponent = (SCH_COMPONENT*) m_Parent;
int linewidth = ( m_Thickness == 0 ) ? GetDefaultLineThickness() : m_Thickness;

Some files were not shown because too many files have changed in this diff Show More