Commit b6508af0 authored by Dick Hollenbeck's avatar Dick Hollenbeck

KICAD_PLUGIN and nanometer intermediate checkin, work in progress...

parent 3a887850
......@@ -97,7 +97,7 @@ void EDA_GRAPHIC_TEXT_CTRL::SetValue( int textSize )
}
wxString EDA_GRAPHIC_TEXT_CTRL::GetText()
const wxString EDA_GRAPHIC_TEXT_CTRL::GetText() const
{
wxString text = m_FrameText->GetValue();
return text;
......
......@@ -87,7 +87,7 @@ EDA_ITEM* SCH_FIELD::doClone() const
}
wxString SCH_FIELD::GetText() const
const wxString SCH_FIELD::GetText() const
{
wxString text = m_Text;
......
......@@ -88,9 +88,9 @@ public:
* overrides the default implementation to allow for the part suffix to be added
* to the reference designator field if the component has multiple parts.
*
* @return a wxString object containing the field's string.
* @return a const wxString object containing the field's string.
*/
virtual wxString GetText() const;
virtual const wxString GetText() const;
void Place( SCH_EDIT_FRAME* frame, wxDC* DC );
......
......@@ -3,8 +3,8 @@
* @brief Basic classes for most KiCad items.
*/
#ifndef BASE_STRUCT_H
#define BASE_STRUCT_H
#ifndef BASE_STRUCT_H_
#define BASE_STRUCT_H_
#include "colors.h"
#include "bitmaps.h"
......@@ -725,8 +725,8 @@ enum FILL_T {
/**
* Class EDA_TEXT
* is a basic class to handle texts (labels, texts on components or footprints
* ..) not used directly.
* The text classes are derived from EDA_ITEM and EDA_TEXT
* ..) not used directly. The "used" text classes are derived from EDA_ITEM and
* EDA_TEXT using multiple inheritance.
*/
class EDA_TEXT
{
......@@ -772,24 +772,25 @@ public:
int GetOrientation() const { return m_Orient; }
void SetItalic( bool isItalic ) { m_Italic = isItalic; }
bool GetItalic() const { return m_Italic; }
bool IsItalic() const { return m_Italic; }
/**
* Function SetSize
* sets text size.
* @param aNewSize is the new text size.
*/
void SetSize( wxSize aNewSize ) { m_Size = aNewSize; };
void SetSize( const wxSize& aNewSize ) { m_Size = aNewSize; };
/**
* Function GetSize
* returns text size.
* @return wxSize - text size.
*/
wxSize GetSize() const { return m_Size; };
const wxSize GetSize() const { return m_Size; };
//void SetPosition( const wxPoint& aPoint ) { m_Pos = aPoint; }
//wxPoint GetPosition() const { return m_Pos; }
/// named differently than the ones using multiple inheritance and including this class
void SetPos( const wxPoint& aPoint ) { m_Pos = aPoint; }
const wxPoint GetPos() const { return m_Pos; }
int GetLength() const { return m_Text.Length(); };
......@@ -904,9 +905,9 @@ public:
* string to provide a way for modifying the base string by adding a suffix or
* prefix to the base string.
* </p>
* @return a wxString object containing the string of the item.
* @return a const wxString object containing the string of the item.
*/
virtual wxString GetText() const { return m_Text; }
virtual const wxString GetText() const { return m_Text; }
GRTextHorizJustifyType GetHorizJustify() const { return m_HJustify; };
GRTextVertJustifyType GetVertJustify() const { return m_VJustify; };
......@@ -914,4 +915,4 @@ public:
void SetVertJustify( GRTextVertJustifyType aType ) { m_VJustify = aType; };
};
#endif /* BASE_STRUCT_H */
#endif // BASE_STRUCT_H_
......@@ -81,7 +81,7 @@ public:
~EDA_GRAPHIC_TEXT_CTRL();
wxString GetText();
const wxString GetText() const;
int GetTextSize();
void Enable( bool state );
void SetTitle( const wxString& title );
......
......@@ -37,15 +37,22 @@ DIMENSION::~DIMENSION()
}
void DIMENSION::SetText( const wxString& NewText )
void DIMENSION::SetPosition( const wxPoint& aPos )
{
m_Text->m_Text = NewText;
m_Pos = aPos;
m_Text->SetPos( aPos );
}
wxString DIMENSION::GetText( void ) const
void DIMENSION::SetText( const wxString& aNewText )
{
return m_Text->m_Text;
m_Text->SetText( aNewText );
}
const wxString DIMENSION::GetText() const
{
return m_Text->GetText();
}
......
......@@ -37,13 +37,15 @@ public:
DIMENSION( BOARD_ITEM* aParent );
~DIMENSION();
const wxPoint GetPosition() const
const wxPoint GetPosition() const { return m_Pos; }
void SetPosition( const wxPoint& aPos ); // override, sets m_Text's position too
void SetTextSize( const wxSize& aTextSize )
{
return m_Pos;
m_Text->SetSize( aTextSize );
}
void SetPosition( const wxPoint& aPos ) { m_Pos = aPos; }
/**
* Function SetLayer
* sets the layer this item is on.
......@@ -69,7 +71,7 @@ public:
bool Save( FILE* aFile ) const;
void SetText( const wxString& NewText );
wxString GetText( void ) const;
const wxString GetText() const;
void Copy( DIMENSION* source );
......@@ -80,7 +82,7 @@ public:
* Function Move
* @param offset : moving vector
*/
void Move(const wxPoint& offset);
void Move( const wxPoint& offset );
/**
* Function Rotate
......@@ -132,7 +134,6 @@ public:
*/
bool HitTest( EDA_RECT& refArea );
/**
* Function GetClass
* returns the class name.
......
......@@ -288,7 +288,7 @@ bool NETCLASS::Save( FILE* aFile ) const
{
bool result = true;
fprintf( aFile, "$" BRD_NETCLASS "\n" );
fprintf( aFile, "$NCLASS\n" );
fprintf( aFile, "Name %s\n", EscapedUTF8( m_Name ).c_str() );
fprintf( aFile, "Desc %s\n", EscapedUTF8( GetDescription() ).c_str() );
......@@ -307,7 +307,7 @@ bool NETCLASS::Save( FILE* aFile ) const
for( const_iterator i = begin(); i!=end(); ++i )
fprintf( aFile, "AddNet %s\n", EscapedUTF8( *i ).c_str() );
fprintf( aFile, "$End" BRD_NETCLASS "\n" );
fprintf( aFile, "$EndNCLASS\n" );
return result;
}
......@@ -334,74 +334,72 @@ void NETCLASS::Show( int nestLevel, std::ostream& os )
#endif
bool NETCLASS::ReadDescr( LINE_READER* aReader )
{
bool result = false;
char* Line;
char Buffer[1024];
char* line;
char buf[1024];
wxString netname;
while( aReader->ReadLine() )
{
Line = aReader->Line();
if( strnicmp( Line, "AddNet", 6 ) == 0 )
line = aReader->Line();
if( strnicmp( line, "AddNet", 6 ) == 0 )
{
ReadDelimitedText( Buffer, Line + 6, sizeof(Buffer) );
netname = FROM_UTF8( Buffer );
ReadDelimitedText( buf, line + 6, sizeof(buf) );
netname = FROM_UTF8( buf );
Add( netname );
continue;
}
if( strnicmp( Line, "$end" BRD_NETCLASS, sizeof( "$end" BRD_NETCLASS)-1) == 0 )
if( strnicmp( line, "$endNCLASS", sizeof( "$endNCLASS" ) - 1 ) == 0 )
{
result = true;
break;
}
if( strnicmp( Line, "Clearance", 9 ) == 0 )
if( strnicmp( line, "Clearance", 9 ) == 0 )
{
SetClearance( atoi( Line + 9 ) );
SetClearance( atoi( line + 9 ) );
continue;
}
if( strnicmp( Line, "TrackWidth", 10 ) == 0 )
if( strnicmp( line, "TrackWidth", 10 ) == 0 )
{
SetTrackWidth( atoi( Line + 10 ) );
SetTrackWidth( atoi( line + 10 ) );
continue;
}
if( strnicmp( Line, "ViaDia", 6 ) == 0 )
if( strnicmp( line, "ViaDia", 6 ) == 0 )
{
SetViaDiameter( atoi( Line + 6 ) );
SetViaDiameter( atoi( line + 6 ) );
continue;
}
if( strnicmp( Line, "ViaDrill", 8 ) == 0 )
if( strnicmp( line, "ViaDrill", 8 ) == 0 )
{
SetViaDrill( atoi( Line + 8 ) );
SetViaDrill( atoi( line + 8 ) );
continue;
}
if( strnicmp( Line, "uViaDia", 7 ) == 0 )
if( strnicmp( line, "uViaDia", 7 ) == 0 )
{
SetuViaDiameter( atoi( Line + 7 ) );
SetuViaDiameter( atoi( line + 7 ) );
continue;
}
if( strnicmp( Line, "uViaDrill", 9 ) == 0 )
if( strnicmp( line, "uViaDrill", 9 ) == 0 )
{
SetuViaDrill( atoi( Line + 9 ) );
SetuViaDrill( atoi( line + 9 ) );
continue;
}
if( strnicmp( Line, "Name", 4 ) == 0 )
if( strnicmp( line, "Name", 4 ) == 0 )
{
ReadDelimitedText( Buffer, Line + 4, sizeof(Buffer) );
m_Name = FROM_UTF8( Buffer );
ReadDelimitedText( buf, line + 4, sizeof(buf) );
m_Name = FROM_UTF8( buf );
continue;
}
if( strnicmp( Line, "Desc", 4 ) == 0 )
if( strnicmp( line, "Desc", 4 ) == 0 )
{
ReadDelimitedText( Buffer, Line + 4, sizeof(Buffer) );
SetDescription( FROM_UTF8( Buffer ) );
ReadDelimitedText( buf, line + 4, sizeof(buf) );
SetDescription( FROM_UTF8( buf ) );
continue;
}
}
......
......@@ -80,16 +80,6 @@ public:
static const wxString Default; ///< the name of the default NETCLASS
/**
* Name of identifier within BOARD file.
* 08-Sept-2009: changed the name from "NETCLASS" to this so we can
* toss any previous NETCLASSes in migratory BOARD files which will not have
* the proper parameters in the default netclass
* (from m_Parent->m_designSettings) in them.
* Spare the user from having to enter those defaults manually.
*/
#define BRD_NETCLASS "NCLASS"
/**
* Constructor
* stuffs a NETCLASS instance with aParent, aName, and optionally the initialParameters
......
......@@ -196,8 +196,8 @@ bool ZONE_CONTAINER::Save( FILE* aFile ) const
m_FillMode,
m_ArcToSegmentsCount,
m_IsFilled ? 'S' : 'F',
m_ThermalReliefGapValue,
m_ThermalReliefCopperBridgeValue );
m_ThermalReliefGap,
m_ThermalReliefCopperBridge );
if( ret < 3 )
return false;
......@@ -398,7 +398,7 @@ int ZONE_CONTAINER::ReadDescr( LINE_READER* aReader )
char fillstate = 'F';
text = Line + 8;
ret = sscanf( text, "%d %d %c %d %d", &fillmode, &arcsegmentcount, &fillstate,
&m_ThermalReliefGapValue, &m_ThermalReliefCopperBridgeValue );
&m_ThermalReliefGap, &m_ThermalReliefCopperBridge );
if( ret < 1 ) // Must find 1 or more args.
return false;
......@@ -1213,8 +1213,8 @@ void ZONE_CONTAINER::Copy( ZONE_CONTAINER* src )
m_FillMode = src->m_FillMode; // Filling mode (segments/polygons)
m_ArcToSegmentsCount = src->m_ArcToSegmentsCount;
m_PadOption = src->m_PadOption;
m_ThermalReliefGapValue = src->m_ThermalReliefGapValue;
m_ThermalReliefCopperBridgeValue = src->m_ThermalReliefCopperBridgeValue;
m_ThermalReliefGap = src->m_ThermalReliefGap;
m_ThermalReliefCopperBridge = src->m_ThermalReliefCopperBridge;
m_Poly->m_HatchStyle = src->m_Poly->GetHatchStyle();
m_Poly->m_HatchLines = src->m_Poly->m_HatchLines; // Copy vector <CSegment>
m_FilledPolysList.clear();
......
......@@ -24,17 +24,18 @@ class BOARD;
class ZONE_CONTAINER;
/* a small class used when filling areas with segments */
class SEGMENT
/**
* Struct SEGMENT
* is a simple container used when filling areas with segments
*/
struct SEGMENT
{
public:
wxPoint m_Start; // starting point of a segment
wxPoint m_End; // ending point of a segment
public:
SEGMENT() {}
SEGMENT( const wxPoint& aStart, const wxPoint& aEnd)
SEGMENT( const wxPoint& aStart, const wxPoint& aEnd )
{
m_Start = aStart;
m_End = aEnd;
......@@ -69,10 +70,10 @@ public:
int m_PadOption;
// thickness of the gap in thermal reliefs.
int m_ThermalReliefGapValue;
int m_ThermalReliefGap;
// thickness of the copper bridge in thermal reliefs
int m_ThermalReliefCopperBridgeValue;
int m_ThermalReliefCopperBridge;
int utility, utility2; // flags used in polygon calculations
// true when a zone was filled, false after deleting the filled areas
......@@ -167,7 +168,6 @@ public:
*/
void DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode = GR_OR );
/* Function GetBoundingBox
* @return an EDA_RECT that is the bounding box of the zone outline
*/
......@@ -204,8 +204,8 @@ public:
}
/**
* Functio SetNet
* set the netcode and the netname.
* Function SetNet
* sets the netcode and the netname.
*
* @param aNetCode The net code of the zone container if greater than or equal to
* zero. Otherwise the current net code is kept and set the net
......@@ -226,6 +226,31 @@ public:
* @return wxString - The net name.
*/
wxString GetNetName() const { return m_Netname; };
void SetNetName( const wxString& aName ) { m_Netname = aName; }
void SetFillMode( int aFillMode ) { m_FillMode = aFillMode; }
int GetFillMode() const { return m_FillMode; }
void SetThermalReliefGap( int aThermalReliefGap ) { m_ThermalReliefGap = aThermalReliefGap; }
int GetThermalReliefGap() const { return m_ThermalReliefGap; }
void SetThermalReliefCopperBridge( int aThermalReliefCopperBridge ) { m_ThermalReliefCopperBridge = aThermalReliefCopperBridge; }
int GetThermalReliefCopperBridge() const { return m_ThermalReliefCopperBridge; }
void SetArcSegCount( int aArcSegCount ) { m_ArcToSegmentsCount = aArcSegCount; }
int GetArcSegCount() const { return m_ArcToSegmentsCount; }
bool IsFilled() const { return m_IsFilled; }
void SetIsFilled( bool isFilled ) { m_IsFilled = isFilled; }
int GetZoneClearance() const { return m_ZoneClearance; }
void SetZoneClearance( int aZoneClearance ) { m_ZoneClearance = aZoneClearance; }
int GetPadOption() const { return m_PadOption; }
void SetPadOption( int aPadOption ) { m_PadOption = aPadOption; }
int GetMinThickness() const { return m_ZoneMinThickness; }
void SetMinThickness( int aMinThickness ) { m_ZoneMinThickness = aMinThickness; }
/**
* Function HitTest
......@@ -403,32 +428,27 @@ public:
return m_Poly->GetNumCorners();
}
void RemoveAllContours( void )
{
m_Poly->RemoveAllContours();
}
wxPoint GetCornerPosition( int aCornerIndex ) const
{
return wxPoint( m_Poly->GetX( aCornerIndex ), m_Poly->GetY( aCornerIndex ) );
}
void SetCornerPosition( int aCornerIndex, wxPoint new_pos )
{
m_Poly->SetX( aCornerIndex, new_pos.x );
m_Poly->SetY( aCornerIndex, new_pos.y );
}
void AppendCorner( wxPoint position )
{
m_Poly->AppendCorner( position.x, position.y );
}
int GetHatchStyle() const
{
return m_Poly->GetHatchStyle();
......@@ -436,12 +456,12 @@ public:
/**
* Function IsSame
* test is 2 zones are equivalent:
* tests if 2 zones are equivalent:
* 2 zones are equivalent if they have same parameters and same outlines
* info relative to filling is not take in account
* info, filling is not taken into account
* @param aZoneToCompare = zone to compare with "this"
*/
bool IsSame( const ZONE_CONTAINER &aZoneToCompare);
bool IsSame( const ZONE_CONTAINER &aZoneToCompare );
/**
* Function GetSmoothedPoly
......
......@@ -33,8 +33,8 @@ ZONE_SETTING::ZONE_SETTING( void )
m_ArcToSegmentsCount = ARC_APPROX_SEGMENTS_COUNT_LOW_DEF; /* Option to select number of segments to approximate a circle
* ARC_APPROX_SEGMENTS_COUNT_LOW_DEF
* or ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF segments */
m_ThermalReliefGapValue = 200; // tickness of the gap in thermal reliefs
m_ThermalReliefCopperBridgeValue = 200; // tickness of the copper bridge in thermal reliefs
m_ThermalReliefGap = 200; // tickness of the gap in thermal reliefs
m_ThermalReliefCopperBridge = 200; // tickness of the copper bridge in thermal reliefs
m_Zone_Pad_Options = THERMAL_PAD; // How pads are covered by copper in zone
......@@ -57,8 +57,8 @@ void ZONE_SETTING::ImportSetting( const ZONE_CONTAINER& aSource )
m_CurrentZone_Layer = aSource.GetLayer();
m_Zone_HatchingStyle = aSource.GetHatchStyle();
m_ArcToSegmentsCount = aSource.m_ArcToSegmentsCount;
m_ThermalReliefGapValue = aSource.m_ThermalReliefGapValue;
m_ThermalReliefCopperBridgeValue = aSource.m_ThermalReliefCopperBridgeValue;
m_ThermalReliefGap = aSource.m_ThermalReliefGap;
m_ThermalReliefCopperBridge = aSource.m_ThermalReliefCopperBridge;
m_Zone_Pad_Options = aSource.m_PadOption;
cornerSmoothingType = aSource.GetCornerSmoothingType();
cornerRadius = aSource.GetCornerRadius();
......@@ -81,8 +81,8 @@ void ZONE_SETTING::ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport )
aTarget.m_ZoneMinThickness = m_ZoneMinThickness;
aTarget.m_Poly->SetHatch( m_Zone_HatchingStyle );
aTarget.m_ArcToSegmentsCount = m_ArcToSegmentsCount;
aTarget.m_ThermalReliefGapValue = m_ThermalReliefGapValue;
aTarget.m_ThermalReliefCopperBridgeValue = m_ThermalReliefCopperBridgeValue;
aTarget.m_ThermalReliefGap = m_ThermalReliefGap;
aTarget.m_ThermalReliefCopperBridge = m_ThermalReliefCopperBridge;
aTarget.m_PadOption = m_Zone_Pad_Options;
aTarget.SetCornerSmoothingType( cornerSmoothingType );
aTarget.SetCornerRadius( cornerRadius );
......
......@@ -41,8 +41,8 @@ public:
// Option to select number of segments to approximate a circle 16 or 32 segments.
int m_ArcToSegmentsCount;
long m_ThermalReliefGapValue; // thickness of the gap in thermal reliefs
long m_ThermalReliefCopperBridgeValue; // thickness of the copper bridge in thermal reliefs
long m_ThermalReliefGap; // thickness of the gap in thermal reliefs
long m_ThermalReliefCopperBridge; // thickness of the copper bridge in thermal reliefs
int m_Zone_Pad_Options; // How pads are covered by copper in zone
private:
......
......@@ -122,10 +122,10 @@ void DIALOG_COPPER_ZONE::initDialog()
AddUnitSymbol( *m_AntipadSizeText, g_UserUnit );
AddUnitSymbol( *m_CopperBridgeWidthText, g_UserUnit );
PutValueInLocalUnits( *m_AntipadSizeValue,
m_Zone_Setting->m_ThermalReliefGapValue,
m_Zone_Setting->m_ThermalReliefGap,
PCB_INTERNAL_UNIT );
PutValueInLocalUnits( *m_CopperWidthValue,
m_Zone_Setting->m_ThermalReliefCopperBridgeValue,
m_Zone_Setting->m_ThermalReliefCopperBridge,
PCB_INTERNAL_UNIT );
m_cornerSmoothingChoice->SetSelection( m_Zone_Setting->GetCornerSmoothingType() );
......@@ -328,19 +328,19 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportab
else
g_Zone_45_Only = TRUE;
m_Zone_Setting->m_ThermalReliefGapValue = ReturnValueFromTextCtrl( *m_AntipadSizeValue,
m_Zone_Setting->m_ThermalReliefGap = ReturnValueFromTextCtrl( *m_AntipadSizeValue,
PCB_INTERNAL_UNIT );
m_Zone_Setting->m_ThermalReliefCopperBridgeValue = ReturnValueFromTextCtrl(
m_Zone_Setting->m_ThermalReliefCopperBridge = ReturnValueFromTextCtrl(
*m_CopperWidthValue,
PCB_INTERNAL_UNIT );
m_Config->Write( ZONE_THERMAL_RELIEF_GAP_STRING_KEY,
(long) m_Zone_Setting->m_ThermalReliefGapValue );
(long) m_Zone_Setting->m_ThermalReliefGap );
m_Config->Write(
ZONE_THERMAL_RELIEF_COPPER_WIDTH_STRING_KEY,
(long) m_Zone_Setting->m_ThermalReliefCopperBridgeValue );
(long) m_Zone_Setting->m_ThermalReliefCopperBridge );
if( m_Zone_Setting->m_ThermalReliefCopperBridgeValue <= m_Zone_Setting->m_ZoneMinThickness )
if( m_Zone_Setting->m_ThermalReliefCopperBridge <= m_Zone_Setting->m_ZoneMinThickness )
{
DisplayError( this,
_( "Thermal relief spoke width is larger than the minimum width." ) );
......
......@@ -1030,7 +1030,7 @@ int PCB_EDIT_FRAME::ReadPcbFile( LINE_READER* aReader, bool Append )
continue;
}
if( TESTLINE( BRD_NETCLASS ) )
if( TESTLINE( "NCLASS" ) )
{
// create an empty NETCLASS without a name.
NETCLASS* netclass = new NETCLASS( board, wxEmptyString );
......
This diff is collapsed.
......@@ -112,17 +112,25 @@ protected:
/**
* Function loadTrackList
* reads a list of segments (Tracks and Vias)
* reads a list of segments (Tracks and Vias, or Segzones)
*
* @param aInsertBeforeMe may be either NULL indicating append, or it may
* be an insertion point before which all the segments are inserted.
*
* @param aStructType is either PCB_TRACE_T to indicate tracks and vias, or
* PCB_ZONE_T to indicate oldschool zone segments (before polygons came to be).
*/
void loadTrackList( TRACK* aInsertBeforeMe, int aStructType, int aSegCount );
void loadTrackList( TRACK* aInsertBeforeMe, int aStructType );
void loadZONE_CONTAINER(); // "$CZONE_OUTLINE"
void loadDIMENSION(); // "$COTATION"
/* @todo
void load( PCB_TARGET* me );
void load( NETINFO* me );
void load( TRACK* me );
void load( ZONE_CONTAINER* me );
void load( DIMENSION* me );
*/
// void load( SEGZONE* me );
......
......@@ -480,9 +480,9 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC )
}
wxGetApp().m_EDA_Config->Read( ZONE_THERMAL_RELIEF_GAP_STRING_KEY,
&g_Zone_Default_Setting.m_ThermalReliefGapValue );
&g_Zone_Default_Setting.m_ThermalReliefGap );
wxGetApp().m_EDA_Config->Read( ZONE_THERMAL_RELIEF_COPPER_WIDTH_STRING_KEY,
&g_Zone_Default_Setting.m_ThermalReliefCopperBridgeValue );
&g_Zone_Default_Setting.m_ThermalReliefCopperBridge );
g_Zone_Default_Setting.m_CurrentZone_Layer = zone->GetLayer();
DIALOG_COPPER_ZONE* frame = new DIALOG_COPPER_ZONE( this, &g_Zone_Default_Setting );
......
......@@ -342,13 +342,13 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
if( pad->GetNet() != GetNet() )
continue;
item_boundingbox = pad->GetBoundingBox();
item_boundingbox.Inflate( m_ThermalReliefGapValue, m_ThermalReliefGapValue );
item_boundingbox.Inflate( m_ThermalReliefGap, m_ThermalReliefGap );
if( item_boundingbox.Intersects( zone_boundingbox ) )
{
CreateThermalReliefPadPolygon( cornerBufferPolysToSubstract,
*pad, m_ThermalReliefGapValue,
m_ThermalReliefCopperBridgeValue,
*pad, m_ThermalReliefGap,
m_ThermalReliefCopperBridge,
m_ZoneMinThickness,
s_CircleToSegmentsCount,
s_Correction, s_thermalRot );
......
......@@ -49,7 +49,7 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector<CPolyPt>& aCornerBuffe
int pen_radius = aZone->m_ZoneMinThickness / 2;
// Calculate thermal bridge half width
int thermbridgeWidth = aZone->m_ThermalReliefCopperBridgeValue / 2;
int thermbridgeWidth = aZone->m_ThermalReliefCopperBridge / 2;
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
{
for( D_PAD* pad = module->m_Pads; pad != NULL; pad = pad->Next() )
......@@ -61,17 +61,17 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector<CPolyPt>& aCornerBuffe
continue;
item_boundingbox = pad->GetBoundingBox();
item_boundingbox.Inflate( aZone->m_ThermalReliefGapValue );
item_boundingbox.Inflate( aZone->m_ThermalReliefGap );
if( !( item_boundingbox.Intersects( zone_boundingbox ) ) )
continue;
// Thermal bridges are like a segment from a starting point inside the pad
// to an ending point outside the pad
wxPoint startpoint, endpoint;
endpoint.x = ( pad->m_Size.x / 2 ) + aZone->m_ThermalReliefGapValue;
endpoint.y = ( pad->m_Size.y / 2 ) + aZone->m_ThermalReliefGapValue;
endpoint.x = ( pad->m_Size.x / 2 ) + aZone->m_ThermalReliefGap;
endpoint.y = ( pad->m_Size.y / 2 ) + aZone->m_ThermalReliefGap;
int copperThickness = aZone->m_ThermalReliefCopperBridgeValue - aZone->m_ZoneMinThickness;
int copperThickness = aZone->m_ThermalReliefCopperBridge - aZone->m_ZoneMinThickness;
if( copperThickness < 0 )
copperThickness = 0;
......
......@@ -86,10 +86,10 @@ bool ZONE_CONTAINER::IsSame( const ZONE_CONTAINER& aZoneToCompare )
if( m_PadOption != aZoneToCompare.m_PadOption )
return false;
if( m_ThermalReliefGapValue != aZoneToCompare.m_ThermalReliefGapValue )
if( m_ThermalReliefGap != aZoneToCompare.m_ThermalReliefGap )
return false;
if( m_ThermalReliefCopperBridgeValue != aZoneToCompare.m_ThermalReliefCopperBridgeValue )
if( m_ThermalReliefCopperBridge != aZoneToCompare.m_ThermalReliefCopperBridge )
return false;
// Compare outlines
......
......@@ -97,8 +97,9 @@ public:
class CPolyPt
{
public:
CPolyPt( int qx = 0, int qy = 0, bool qf = false )
{ x = qx; y = qy; end_contour = qf; utility = 0; };
CPolyPt( int qx = 0, int qy = 0, bool qf = false, int aUtility = 0 )
{ x = qx; y = qy; end_contour = qf; utility = aUtility; };
int x;
int y;
bool end_contour;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment