mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 21:23:25 +00:00
Add const specifiers
This commit is contained in:
parent
f005335743
commit
0e44f5128c
common
eeschema
dialogs
tools
gerbview
include
libs/kimath
pcbnew
utils/kicad2step/pcb
@ -162,14 +162,14 @@ void DIALOG_SHIM::setSizeInDU( int x, int y )
|
||||
}
|
||||
|
||||
|
||||
int DIALOG_SHIM::horizPixelsFromDU( int x )
|
||||
int DIALOG_SHIM::horizPixelsFromDU( int x ) const
|
||||
{
|
||||
wxSize sz( x, 0 );
|
||||
return ConvertDialogToPixels( sz ).x;
|
||||
}
|
||||
|
||||
|
||||
int DIALOG_SHIM::vertPixelsFromDU( int y )
|
||||
int DIALOG_SHIM::vertPixelsFromDU( int y ) const
|
||||
{
|
||||
wxSize sz( 0, y );
|
||||
return ConvertDialogToPixels( sz ).y;
|
||||
|
@ -379,13 +379,13 @@ void WX_HTML_REPORT_PANEL::SetVisibleSeverities( int aSeverities )
|
||||
}
|
||||
|
||||
|
||||
int WX_HTML_REPORT_PANEL::GetVisibleSeverities()
|
||||
int WX_HTML_REPORT_PANEL::GetVisibleSeverities() const
|
||||
{
|
||||
return m_severities;
|
||||
}
|
||||
|
||||
|
||||
void WX_HTML_REPORT_PANEL::SetFileName( wxString& aReportFileName )
|
||||
void WX_HTML_REPORT_PANEL::SetFileName( const wxString& aReportFileName )
|
||||
{
|
||||
m_reportFileName = aReportFileName;
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
|
||||
///> @return the visible severity filter.
|
||||
///> If the m_showAll option is set, the mask is < 0
|
||||
int GetVisibleSeverities();
|
||||
int GetVisibleSeverities() const;
|
||||
|
||||
///> If true prints Info: at the beginning of each Info severity line (Default)
|
||||
void SetPrintInfo( bool aPrintInfo );
|
||||
@ -95,7 +95,7 @@ public:
|
||||
void SetShowSeverity( SEVERITY aSeverity, bool aValue );
|
||||
|
||||
///> Set the report full file name to the string
|
||||
void SetFileName( wxString& aReportFileName );
|
||||
void SetFileName( const wxString& aReportFileName );
|
||||
|
||||
///> @return reference to the current report fill file name string.
|
||||
wxString& GetFileName( void );
|
||||
|
@ -225,7 +225,7 @@ LINE_READER* DSNLEXER::PopReader()
|
||||
}
|
||||
|
||||
|
||||
int DSNLEXER::findToken( const std::string& tok )
|
||||
int DSNLEXER::findToken( const std::string& tok ) const
|
||||
{
|
||||
KEYWORD_MAP::const_iterator it = keyword_hash.find( tok.c_str() );
|
||||
|
||||
@ -280,7 +280,7 @@ const char* DSNLEXER::Syntax( int aTok )
|
||||
}
|
||||
|
||||
|
||||
const char* DSNLEXER::GetTokenText( int aTok )
|
||||
const char* DSNLEXER::GetTokenText( int aTok ) const
|
||||
{
|
||||
const char* ret;
|
||||
|
||||
@ -299,9 +299,9 @@ const char* DSNLEXER::GetTokenText( int aTok )
|
||||
}
|
||||
|
||||
|
||||
wxString DSNLEXER::GetTokenString( int aTok )
|
||||
wxString DSNLEXER::GetTokenString( int aTok ) const
|
||||
{
|
||||
wxString ret;
|
||||
wxString ret;
|
||||
|
||||
ret << wxT("'") << wxString::FromUTF8( GetTokenText(aTok) ) << wxT("'");
|
||||
|
||||
@ -314,11 +314,11 @@ bool DSNLEXER::IsSymbol( int aTok )
|
||||
// This is static and not inline to reduce code space.
|
||||
|
||||
// if aTok is >= 0, then it is a coincidental match to a keyword.
|
||||
return aTok==DSN_SYMBOL || aTok==DSN_STRING || aTok>=0;
|
||||
return aTok == DSN_SYMBOL || aTok == DSN_STRING || aTok >= 0;
|
||||
}
|
||||
|
||||
|
||||
void DSNLEXER::Expecting( int aTok )
|
||||
void DSNLEXER::Expecting( int aTok ) const
|
||||
{
|
||||
wxString errText = wxString::Format(
|
||||
_( "Expecting %s" ), GetTokenString( aTok ) );
|
||||
@ -326,7 +326,7 @@ void DSNLEXER::Expecting( int aTok )
|
||||
}
|
||||
|
||||
|
||||
void DSNLEXER::Expecting( const char* text )
|
||||
void DSNLEXER::Expecting( const char* text ) const
|
||||
{
|
||||
wxString errText = wxString::Format(
|
||||
_( "Expecting '%s'" ), wxString::FromUTF8( text ) );
|
||||
@ -334,7 +334,7 @@ void DSNLEXER::Expecting( const char* text )
|
||||
}
|
||||
|
||||
|
||||
void DSNLEXER::Unexpected( int aTok )
|
||||
void DSNLEXER::Unexpected( int aTok ) const
|
||||
{
|
||||
wxString errText = wxString::Format(
|
||||
_( "Unexpected %s" ), GetTokenString( aTok ) );
|
||||
@ -350,7 +350,7 @@ void DSNLEXER::Duplicate( int aTok )
|
||||
}
|
||||
|
||||
|
||||
void DSNLEXER::Unexpected( const char* text )
|
||||
void DSNLEXER::Unexpected( const char* text ) const
|
||||
{
|
||||
wxString errText = wxString::Format(
|
||||
_( "Unexpected '%s'" ), wxString::FromUTF8( text ) );
|
||||
|
@ -75,7 +75,7 @@ wxString GbrMakeCreationDateAttributeString( GBR_NC_STRING_FORMAT aFormat )
|
||||
}
|
||||
|
||||
|
||||
wxString GbrMakeProjectGUIDfromString( wxString& aText )
|
||||
wxString GbrMakeProjectGUIDfromString( const wxString& aText )
|
||||
{
|
||||
/* Gerber GUID format should be RFC4122 Version 1 or 4.
|
||||
* See en.wikipedia.org/wiki/Universally_unique_identifier
|
||||
@ -482,14 +482,14 @@ wxString ConvertNotAllowedCharsInGerber( const wxString& aString, bool aAllowUtf
|
||||
}
|
||||
|
||||
|
||||
std::string GBR_DATA_FIELD::GetGerberString()
|
||||
std::string GBR_DATA_FIELD::GetGerberString() const
|
||||
{
|
||||
wxString converted;
|
||||
|
||||
if( !m_field.IsEmpty() )
|
||||
converted = ConvertNotAllowedCharsInGerber( m_field, m_useUTF8, m_escapeString );
|
||||
|
||||
// Convert the char string to std::string. Be carefull when converting awxString to
|
||||
// Convert the char string to std::string. Be carefull when converting a wxString to
|
||||
// a std::string: using static_cast<const char*> is mandatory
|
||||
std::string txt = static_cast<const char*>( converted.utf8_str() );
|
||||
|
||||
@ -525,7 +525,7 @@ std::string FormatStringToGerber( const wxString& aString )
|
||||
#define NO_PAD_NAME wxT( "" ) // pad name of pads without pad name/number (not normalized)
|
||||
|
||||
bool FormatNetAttribute( std::string& aPrintedText, std::string& aLastNetAttributes,
|
||||
GBR_NETLIST_METADATA* aData, bool& aClearPreviousAttributes,
|
||||
const GBR_NETLIST_METADATA* aData, bool& aClearPreviousAttributes,
|
||||
bool aUseX1StructuredComment )
|
||||
{
|
||||
aClearPreviousAttributes = false;
|
||||
|
@ -32,7 +32,7 @@ namespace UTIL {
|
||||
struct equals {
|
||||
equals( const T& val ) : val_( val ) {}
|
||||
|
||||
bool operator()( const T& val )
|
||||
bool operator()( const T& val ) const
|
||||
{
|
||||
return val == val_;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ inline void scanList( PTREE* aTree, DSNLEXER* aLexer )
|
||||
}
|
||||
|
||||
|
||||
inline void scanAtom( PTREE* aTree, DSNLEXER* aLexer )
|
||||
inline void scanAtom( PTREE* aTree, const DSNLEXER* aLexer )
|
||||
{
|
||||
const char* key = aLexer->CurText();
|
||||
|
||||
@ -109,13 +109,13 @@ void Scan( PTREE* aTree, DSNLEXER* aLexer )
|
||||
|
||||
//-----<Format>------------------------------------------------------------------
|
||||
|
||||
inline bool isAtom( CPTREE& aTree )
|
||||
inline bool isAtom( const CPTREE& aTree )
|
||||
{
|
||||
return aTree.size()==0 && aTree.data().size()==0;
|
||||
return aTree.size() == 0 && aTree.data().size() == 0;
|
||||
}
|
||||
|
||||
|
||||
inline bool isLast( CPTREE& aTree, CITER it )
|
||||
inline bool isLast( const CPTREE& aTree, CITER it )
|
||||
{
|
||||
CITER next = it;
|
||||
++next;
|
||||
@ -131,13 +131,12 @@ inline CITER next( CITER it )
|
||||
|
||||
|
||||
static void formatNode( OUTPUTFORMATTER* out, int aNestLevel, int aCtl,
|
||||
const std::string& aKey, CPTREE& aTree );
|
||||
const std::string& aKey, const CPTREE& aTree );
|
||||
|
||||
|
||||
static void formatList( OUTPUTFORMATTER* out, int aNestLevel, int aCtl, CPTREE& aTree )
|
||||
|
||||
static void formatList( OUTPUTFORMATTER* out, int aNestLevel, int aCtl, const CPTREE& aTree )
|
||||
{
|
||||
for( CITER it = aTree.begin(); it != aTree.end(); ++it )
|
||||
for( CITER it = aTree.begin(); it != aTree.end(); ++it )
|
||||
{
|
||||
// Processing a tree which was read in with xml_parser?
|
||||
if( it->first == "<xmlattr>" )
|
||||
@ -165,7 +164,7 @@ static void formatList( OUTPUTFORMATTER* out, int aNestLevel, int aCtl, CPTREE&
|
||||
|
||||
|
||||
static void formatNode( OUTPUTFORMATTER* out, int aNestLevel, int aCtl,
|
||||
const std::string& aKey, CPTREE& aTree )
|
||||
const std::string& aKey, const CPTREE& aTree )
|
||||
|
||||
{
|
||||
if( !isAtom( aTree ) ) // is a list, not an atom
|
||||
@ -198,7 +197,7 @@ static void formatNode( OUTPUTFORMATTER* out, int aNestLevel, int aCtl,
|
||||
}
|
||||
|
||||
|
||||
void Format( OUTPUTFORMATTER* out, int aNestLevel, int aCtl, CPTREE& aTree )
|
||||
void Format( OUTPUTFORMATTER* out, int aNestLevel, int aCtl, const CPTREE& aTree )
|
||||
{
|
||||
if( aTree.size() == 1 && !aTree.data().size() )
|
||||
{
|
||||
|
@ -278,7 +278,7 @@ public:
|
||||
return res;
|
||||
}
|
||||
|
||||
void RebuildRows( LIB_PINS& aPins, bool groupByName )
|
||||
void RebuildRows( const LIB_PINS& aPins, bool groupByName )
|
||||
{
|
||||
if ( GetView() )
|
||||
{
|
||||
|
@ -358,8 +358,8 @@ void DIALOG_PLOT_SCHEMATIC::PlotSchematic( bool aPlotAll )
|
||||
}
|
||||
|
||||
|
||||
wxFileName DIALOG_PLOT_SCHEMATIC::createPlotFileName( wxString& aPlotFileName,
|
||||
wxString& aExtension,
|
||||
wxFileName DIALOG_PLOT_SCHEMATIC::createPlotFileName( const wxString& aPlotFileName,
|
||||
const wxString& aExtension,
|
||||
REPORTER* aReporter )
|
||||
{
|
||||
wxString path = ExpandEnvVarSubstitutions( m_outputDirectoryName->GetValue(), &Prj() );
|
||||
|
@ -148,6 +148,7 @@ private:
|
||||
* @return the created file name
|
||||
* @throw IO_ERROR on file I/O errors
|
||||
*/
|
||||
wxFileName createPlotFileName( wxString& aPlotFileName, wxString& aExtension,
|
||||
wxFileName createPlotFileName( const wxString& aPlotFileName,
|
||||
const wxString& aExtension,
|
||||
REPORTER* aReporter = NULL );
|
||||
};
|
||||
|
@ -174,7 +174,7 @@ VECTOR2I EE_GRID_HELPER::AlignToWire( const VECTOR2I& aPoint, const SEG& aSeg )
|
||||
return nearest;
|
||||
}
|
||||
|
||||
VECTOR2I EE_GRID_HELPER::BestDragOrigin( const VECTOR2I &aMousePos, std::vector<SCH_ITEM*>& aItems )
|
||||
VECTOR2I EE_GRID_HELPER::BestDragOrigin( const VECTOR2I &aMousePos, const std::vector<SCH_ITEM*>& aItems )
|
||||
{
|
||||
clearAnchors();
|
||||
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
|
||||
VECTOR2I AlignToWire( const VECTOR2I& aPoint, const SEG& aSeg );
|
||||
|
||||
VECTOR2I BestDragOrigin( const VECTOR2I& aMousePos, std::vector<SCH_ITEM*>& aItem );
|
||||
VECTOR2I BestDragOrigin( const VECTOR2I& aMousePos, const std::vector<SCH_ITEM*>& aItem );
|
||||
|
||||
VECTOR2I BestSnapAnchor( const VECTOR2I& aOrigin, SCH_ITEM* aDraggedItem );
|
||||
VECTOR2I BestSnapAnchor( const VECTOR2I& aOrigin, const LSET& aLayers,
|
||||
|
@ -55,7 +55,7 @@ GBR_TO_PCB_EXPORTER::~GBR_TO_PCB_EXPORTER()
|
||||
}
|
||||
|
||||
|
||||
bool GBR_TO_PCB_EXPORTER::ExportPcb( LAYER_NUM* aLayerLookUpTable, int aCopperLayers )
|
||||
bool GBR_TO_PCB_EXPORTER::ExportPcb( const LAYER_NUM* aLayerLookUpTable, int aCopperLayers )
|
||||
{
|
||||
LOCALE_IO toggle; // toggles on, then off, the C locale.
|
||||
|
||||
@ -138,7 +138,7 @@ bool GBR_TO_PCB_EXPORTER::ExportPcb( LAYER_NUM* aLayerLookUpTable, int aCopperLa
|
||||
}
|
||||
|
||||
|
||||
void GBR_TO_PCB_EXPORTER::export_non_copper_item( GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer )
|
||||
void GBR_TO_PCB_EXPORTER::export_non_copper_item( const GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer )
|
||||
{
|
||||
// used when a D_CODE is not found. default D_CODE to draw a flashed item
|
||||
static D_CODE dummyD_CODE( 0 );
|
||||
@ -252,7 +252,7 @@ void GBR_TO_PCB_EXPORTER::export_non_copper_item( GERBER_DRAW_ITEM* aGbrItem, LA
|
||||
* the pad gets drawn as a copper polygon, or increase it to the proper size if it has a
|
||||
* circular, concentric copper flashing.
|
||||
*/
|
||||
void GBR_TO_PCB_EXPORTER::collect_hole( GERBER_DRAW_ITEM* aGbrItem )
|
||||
void GBR_TO_PCB_EXPORTER::collect_hole( const GERBER_DRAW_ITEM* aGbrItem )
|
||||
{
|
||||
int size = std::min( aGbrItem->m_Size.x, aGbrItem->m_Size.y );
|
||||
m_vias.emplace_back( aGbrItem->m_Start, size + 1, size );
|
||||
@ -279,7 +279,7 @@ void GBR_TO_PCB_EXPORTER::export_via( const EXPORT_VIA& aVia )
|
||||
}
|
||||
|
||||
|
||||
void GBR_TO_PCB_EXPORTER::export_copper_item( GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer )
|
||||
void GBR_TO_PCB_EXPORTER::export_copper_item( const GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer )
|
||||
{
|
||||
switch( aGbrItem->m_Shape )
|
||||
{
|
||||
@ -313,7 +313,7 @@ void GBR_TO_PCB_EXPORTER::export_copper_item( GERBER_DRAW_ITEM* aGbrItem, LAYER_
|
||||
}
|
||||
|
||||
|
||||
void GBR_TO_PCB_EXPORTER::export_segline_copper_item( GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer )
|
||||
void GBR_TO_PCB_EXPORTER::export_segline_copper_item( const GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer )
|
||||
{
|
||||
wxPoint seg_start, seg_end;
|
||||
|
||||
@ -328,7 +328,8 @@ void GBR_TO_PCB_EXPORTER::export_segline_copper_item( GERBER_DRAW_ITEM* aGbrItem
|
||||
}
|
||||
|
||||
|
||||
void GBR_TO_PCB_EXPORTER::writeCopperLineItem( wxPoint& aStart, wxPoint& aEnd,
|
||||
void GBR_TO_PCB_EXPORTER::writeCopperLineItem( const wxPoint& aStart,
|
||||
const wxPoint& aEnd,
|
||||
int aWidth, LAYER_NUM aLayer )
|
||||
{
|
||||
fprintf( m_fp, "(segment (start %s %s) (end %s %s) (width %s) (layer %s) (net 0))\n",
|
||||
@ -341,7 +342,7 @@ void GBR_TO_PCB_EXPORTER::writeCopperLineItem( wxPoint& aStart, wxPoint& aEnd,
|
||||
}
|
||||
|
||||
|
||||
void GBR_TO_PCB_EXPORTER::export_segarc_copper_item( GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer )
|
||||
void GBR_TO_PCB_EXPORTER::export_segarc_copper_item( const GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer )
|
||||
{
|
||||
double a = atan2( (double) ( aGbrItem->m_Start.y - aGbrItem->m_ArcCentre.y ),
|
||||
(double) ( aGbrItem->m_Start.x - aGbrItem->m_ArcCentre.x ) );
|
||||
@ -402,7 +403,7 @@ void GBR_TO_PCB_EXPORTER::export_segarc_copper_item( GERBER_DRAW_ITEM* aGbrItem,
|
||||
* then we'll enlarge the via to the proper size. Otherwise we create a copper polygon to
|
||||
* represent the flashed item (which is presumably a pad).
|
||||
*/
|
||||
void GBR_TO_PCB_EXPORTER::export_flashed_copper_item( GERBER_DRAW_ITEM* aGbrItem,
|
||||
void GBR_TO_PCB_EXPORTER::export_flashed_copper_item( const GERBER_DRAW_ITEM* aGbrItem,
|
||||
LAYER_NUM aLayer )
|
||||
{
|
||||
static D_CODE flashed_item_D_CODE( 0 );
|
||||
@ -433,7 +434,7 @@ void GBR_TO_PCB_EXPORTER::export_flashed_copper_item( GERBER_DRAW_ITEM* aGbrItem
|
||||
}
|
||||
|
||||
|
||||
void GBR_TO_PCB_EXPORTER::writePcbHeader( LAYER_NUM* aLayerLookUpTable )
|
||||
void GBR_TO_PCB_EXPORTER::writePcbHeader( const LAYER_NUM* aLayerLookUpTable )
|
||||
{
|
||||
fprintf( m_fp, "(kicad_pcb (version 4) (host Gerbview \"%s\")\n\n",
|
||||
TO_UTF8( GetBuildVersion() ) );
|
||||
@ -512,7 +513,7 @@ void GBR_TO_PCB_EXPORTER::writePcbPolygon( const SHAPE_POLY_SET& aPolys, LAYER_N
|
||||
}
|
||||
|
||||
|
||||
void GBR_TO_PCB_EXPORTER::writePcbZoneItem( GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer )
|
||||
void GBR_TO_PCB_EXPORTER::writePcbZoneItem( const GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer )
|
||||
{
|
||||
SHAPE_POLY_SET polys = aGbrItem->m_Polygon;
|
||||
polys.Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
|
@ -64,7 +64,7 @@ public:
|
||||
* Function ExportPcb
|
||||
* saves a board from a set of Gerber images.
|
||||
*/
|
||||
bool ExportPcb( LAYER_NUM* aLayerLookUpTable, int aCopperLayers );
|
||||
bool ExportPcb( const LAYER_NUM* aLayerLookUpTable, int aCopperLayers );
|
||||
|
||||
private:
|
||||
/**
|
||||
@ -72,7 +72,7 @@ private:
|
||||
* We'll use these later when writing pads & vias.
|
||||
* @param aGbrItem
|
||||
*/
|
||||
void collect_hole( GERBER_DRAW_ITEM* aGbrItem );
|
||||
void collect_hole( const GERBER_DRAW_ITEM* aGbrItem );
|
||||
|
||||
/**
|
||||
* write a via to the board file.
|
||||
@ -88,7 +88,7 @@ private:
|
||||
* @param aGbrItem = the Gerber item (line, arc) to export
|
||||
* @param aLayer = the technical layer to use
|
||||
*/
|
||||
void export_non_copper_item( GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer );
|
||||
void export_non_copper_item( const GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer );
|
||||
|
||||
/**
|
||||
* write a non-copper polygon to the board file.
|
||||
@ -103,14 +103,14 @@ private:
|
||||
* @param aGbrItem = the Gerber item (line, arc) to export
|
||||
* @param aLayer = the technical layer to use
|
||||
*/
|
||||
void writePcbZoneItem( GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer );
|
||||
void writePcbZoneItem( const GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer );
|
||||
|
||||
/**
|
||||
* write a track (or via) to the board file.
|
||||
* @param aGbrItem = the Gerber item (line, arc, flashed) to export
|
||||
* @param aLayer = the copper layer to use
|
||||
*/
|
||||
void export_copper_item( GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer );
|
||||
void export_copper_item( const GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer );
|
||||
|
||||
/**
|
||||
* Function export_flashed_copper_item
|
||||
@ -120,7 +120,7 @@ private:
|
||||
* the pad.
|
||||
* @param aGbrItem = the flashed Gerber item to export
|
||||
*/
|
||||
void export_flashed_copper_item( GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer );
|
||||
void export_flashed_copper_item( const GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer );
|
||||
|
||||
/**
|
||||
* Function export_segline_copper_item
|
||||
@ -128,7 +128,7 @@ private:
|
||||
* @param aGbrItem = the Gerber item (line only) to export
|
||||
* @param aLayer = the copper layer to use
|
||||
*/
|
||||
void export_segline_copper_item( GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer );
|
||||
void export_segline_copper_item( const GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer );
|
||||
|
||||
/**
|
||||
* Function export_segarc_copper_item
|
||||
@ -137,27 +137,28 @@ private:
|
||||
* @param aGbrItem = the Gerber item (arc only) to export
|
||||
* @param aLayer = the copper layer to use
|
||||
*/
|
||||
void export_segarc_copper_item( GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer );
|
||||
void export_segarc_copper_item( const GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer );
|
||||
|
||||
/**
|
||||
* function writeCopperLineItem
|
||||
* basic write function to write a a TRACK item
|
||||
* to the board file, from a non flashed item
|
||||
*/
|
||||
void writeCopperLineItem( wxPoint& aStart, wxPoint& aEnd,
|
||||
void writeCopperLineItem( const wxPoint& aStart,
|
||||
const wxPoint& aEnd,
|
||||
int aWidth, LAYER_NUM aLayer );
|
||||
|
||||
/**
|
||||
* function writePcbHeader
|
||||
* Write a very basic header to the board file
|
||||
*/
|
||||
void writePcbHeader( LAYER_NUM* aLayerLookUpTable );
|
||||
void writePcbHeader( const LAYER_NUM* aLayerLookUpTable );
|
||||
|
||||
/** In Pcbnew files units are mm for coordinates.
|
||||
* So MapToPcbUnits converts internal gerbview to mm any pcbnew value
|
||||
* @param aValue is a coordinate value to convert in mm
|
||||
*/
|
||||
double MapToPcbUnits( int aValue )
|
||||
double MapToPcbUnits( int aValue ) const
|
||||
{
|
||||
return aValue / IU_PER_MM;
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ public:
|
||||
|
||||
void EndQuasiModal( int retCode ); // End quasi-modal mode
|
||||
|
||||
bool IsQuasiModal() { return m_qmodal_showing; }
|
||||
bool IsQuasiModal() const { return m_qmodal_showing; }
|
||||
|
||||
bool Show( bool show ) override;
|
||||
|
||||
@ -170,13 +170,13 @@ protected:
|
||||
* Convert an integer number of dialog units to pixels, horizontally. See SetSizeInDU or
|
||||
* wxDialog documentation for more information.
|
||||
*/
|
||||
int horizPixelsFromDU( int x );
|
||||
int horizPixelsFromDU( int x ) const;
|
||||
|
||||
/**
|
||||
* Convert an integer number of dialog units to pixels, vertically. See SetSizeInDU or
|
||||
* wxDialog documentation for more information.
|
||||
*/
|
||||
int vertPixelsFromDU( int y );
|
||||
int vertPixelsFromDU( int y ) const;
|
||||
|
||||
/**
|
||||
* Clear the existing dialog size and position.
|
||||
|
@ -42,7 +42,7 @@ struct KEYWORD
|
||||
const char* name; ///< unique keyword.
|
||||
int token; ///< a zero based index into an array of KEYWORDs
|
||||
};
|
||||
#endif
|
||||
#endif // SWIG
|
||||
|
||||
// something like this macro can be used to help initialize a KEYWORD table.
|
||||
// see SPECCTRA_DB::keywords[] as an example.
|
||||
@ -55,18 +55,19 @@ struct KEYWORD
|
||||
* lists all the DSN lexer's tokens that are supported in lexing. It is up
|
||||
* to the parser if it wants also to support them.
|
||||
*/
|
||||
enum DSN_SYNTAX_T {
|
||||
DSN_NONE = -11,
|
||||
DSN_COMMENT = -10,
|
||||
enum DSN_SYNTAX_T
|
||||
{
|
||||
DSN_NONE = -11,
|
||||
DSN_COMMENT = -10,
|
||||
DSN_STRING_QUOTE = -9,
|
||||
DSN_QUOTE_DEF = -8,
|
||||
DSN_DASH = -7,
|
||||
DSN_SYMBOL = -6,
|
||||
DSN_NUMBER = -5,
|
||||
DSN_RIGHT = -4, // right bracket, ')'
|
||||
DSN_LEFT = -3, // left bracket, '('
|
||||
DSN_STRING = -2, // a quoted string, stripped of the quotes
|
||||
DSN_EOF = -1 // special case for end of file
|
||||
DSN_QUOTE_DEF = -8,
|
||||
DSN_DASH = -7,
|
||||
DSN_SYMBOL = -6,
|
||||
DSN_NUMBER = -5,
|
||||
DSN_RIGHT = -4, // right bracket, ')'
|
||||
DSN_LEFT = -3, // left bracket, '('
|
||||
DSN_STRING = -2, // a quoted string, stripped of the quotes
|
||||
DSN_EOF = -1 // special case for end of file
|
||||
};
|
||||
|
||||
|
||||
@ -142,11 +143,11 @@ protected:
|
||||
* @return int - with a value from the enum DSN_T matching the keyword text,
|
||||
* or DSN_SYMBOL if @a aToken is not in the kewords table.
|
||||
*/
|
||||
int findToken( const std::string& aToken );
|
||||
int findToken( const std::string& aToken ) const;
|
||||
|
||||
bool isStringTerminator( char cc )
|
||||
bool isStringTerminator( char cc ) const
|
||||
{
|
||||
if( !space_in_quoted_tokens && cc==' ' )
|
||||
if( !space_in_quoted_tokens && cc == ' ' )
|
||||
return true;
|
||||
|
||||
if( cc == stringDelimiter )
|
||||
@ -155,7 +156,7 @@ protected:
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // SWIG
|
||||
|
||||
public:
|
||||
|
||||
@ -317,7 +318,7 @@ public:
|
||||
* Function CurTok
|
||||
* returns whatever NextTok() returned the last time it was called.
|
||||
*/
|
||||
int CurTok()
|
||||
int CurTok() const
|
||||
{
|
||||
return curTok;
|
||||
}
|
||||
@ -326,7 +327,7 @@ public:
|
||||
* Function PrevTok
|
||||
* returns whatever NextTok() returned the 2nd to last time it was called.
|
||||
*/
|
||||
int PrevTok()
|
||||
int PrevTok() const
|
||||
{
|
||||
return prevTok;
|
||||
}
|
||||
@ -335,7 +336,7 @@ public:
|
||||
* Function GetCurStrAsToken
|
||||
* Used to support "loose" matches (quoted tokens)
|
||||
*/
|
||||
int GetCurStrAsToken()
|
||||
int GetCurStrAsToken() const
|
||||
{
|
||||
return findToken( curText );
|
||||
}
|
||||
@ -412,7 +413,7 @@ public:
|
||||
* @param aTok is the token/keyword type which was expected at the current input location.
|
||||
* @throw IO_ERROR with the location within the input file of the problem.
|
||||
*/
|
||||
void Expecting( int aTok );
|
||||
void Expecting( int aTok ) const;
|
||||
|
||||
/**
|
||||
* Function Expecting
|
||||
@ -421,7 +422,7 @@ public:
|
||||
* current input location, e.g. "pin|graphic|property"
|
||||
* @throw IO_ERROR with the location within the input file of the problem.
|
||||
*/
|
||||
void Expecting( const char* aTokenList );
|
||||
void Expecting( const char* aTokenList ) const;
|
||||
|
||||
/**
|
||||
* Function Unexpected
|
||||
@ -430,7 +431,7 @@ public:
|
||||
* current input location.
|
||||
* @throw IO_ERROR with the location within the input file of the problem.
|
||||
*/
|
||||
void Unexpected( int aTok );
|
||||
void Unexpected( int aTok ) const;
|
||||
|
||||
/**
|
||||
* Function Unexpected
|
||||
@ -439,7 +440,7 @@ public:
|
||||
* current input location.
|
||||
* @throw IO_ERROR with the location within the input file of the problem.
|
||||
*/
|
||||
void Unexpected( const char* aToken );
|
||||
void Unexpected( const char* aToken ) const;
|
||||
|
||||
/**
|
||||
* Function Duplicate
|
||||
@ -471,13 +472,13 @@ public:
|
||||
* Function GetTokenText
|
||||
* returns the C string representation of a DSN_T value.
|
||||
*/
|
||||
const char* GetTokenText( int aTok );
|
||||
const char* GetTokenText( int aTok ) const;
|
||||
|
||||
/**
|
||||
* Function GetTokenString
|
||||
* returns a quote wrapped wxString representation of a token value.
|
||||
*/
|
||||
wxString GetTokenString( int aTok );
|
||||
wxString GetTokenString( int aTok ) const;
|
||||
|
||||
static const char* Syntax( int aTok );
|
||||
|
||||
@ -485,7 +486,7 @@ public:
|
||||
* Function CurText
|
||||
* returns a pointer to the current token's text.
|
||||
*/
|
||||
const char* CurText()
|
||||
const char* CurText() const
|
||||
{
|
||||
return curText.c_str();
|
||||
}
|
||||
@ -494,7 +495,7 @@ public:
|
||||
* Function CurStr
|
||||
* returns a reference to current token in std::string form.
|
||||
*/
|
||||
const std::string& CurStr()
|
||||
const std::string& CurStr() const
|
||||
{
|
||||
return curText;
|
||||
}
|
||||
@ -504,7 +505,7 @@ public:
|
||||
* returns the current token text as a wxString, assuming that the input
|
||||
* byte stream is UTF8 encoded.
|
||||
*/
|
||||
wxString FromUTF8()
|
||||
wxString FromUTF8() const
|
||||
{
|
||||
return wxString::FromUTF8( curText.c_str() );
|
||||
}
|
||||
@ -513,7 +514,7 @@ public:
|
||||
* Function CurLineNumber
|
||||
* returns the current line number within my LINE_READER
|
||||
*/
|
||||
int CurLineNumber()
|
||||
int CurLineNumber() const
|
||||
{
|
||||
return reader->LineNumber();
|
||||
}
|
||||
@ -523,7 +524,7 @@ public:
|
||||
* returns the current line of text, from which the CurText() would return
|
||||
* its token.
|
||||
*/
|
||||
const char* CurLine()
|
||||
const char* CurLine() const
|
||||
{
|
||||
return (const char*)(*reader);
|
||||
}
|
||||
@ -534,7 +535,7 @@ public:
|
||||
* @return const wxString& - the source of the lines of text,
|
||||
* e.g. a filename or "clipboard".
|
||||
*/
|
||||
const wxString& CurSource()
|
||||
const wxString& CurSource() const
|
||||
{
|
||||
return reader->GetSource();
|
||||
}
|
||||
@ -544,7 +545,7 @@ public:
|
||||
* returns the byte offset within the current line, using a 1 based index.
|
||||
* @return int - a one based index into the current line.
|
||||
*/
|
||||
int CurOffset()
|
||||
int CurOffset() const
|
||||
{
|
||||
return curOffset + 1;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ wxString GbrMakeCreationDateAttributeString( GBR_NC_STRING_FORMAT aFormat );
|
||||
*
|
||||
* See en.wikipedia.org/wiki/Universally_unique_identifier
|
||||
*/
|
||||
wxString GbrMakeProjectGUIDfromString( wxString& aText );
|
||||
wxString GbrMakeProjectGUIDfromString( const wxString& aText );
|
||||
|
||||
|
||||
// this class handle info which can be added in a gerber file as attribute
|
||||
@ -272,7 +272,7 @@ wxString FormatStringFromGerber( const wxString& aString );
|
||||
* will be empty
|
||||
*/
|
||||
bool FormatNetAttribute( std::string& aPrintedText, std::string& aLastNetAttributes,
|
||||
GBR_NETLIST_METADATA* aData, bool& aClearPreviousAttributes,
|
||||
const GBR_NETLIST_METADATA* aData, bool& aClearPreviousAttributes,
|
||||
bool aUseX1StructuredComment );
|
||||
|
||||
#endif // GBR_METADATA_H
|
||||
|
@ -118,7 +118,7 @@ public:
|
||||
|
||||
bool IsEmpty() const { return m_field.IsEmpty(); }
|
||||
|
||||
std::string GetGerberString();
|
||||
std::string GetGerberString() const;
|
||||
|
||||
|
||||
private:
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
m_type( aType )
|
||||
{}
|
||||
|
||||
HOLDER_TYPE GetType() { return m_type; }
|
||||
HOLDER_TYPE GetType() const { return m_type; }
|
||||
|
||||
/**
|
||||
* Function Kiway
|
||||
|
@ -90,6 +90,6 @@ void Scan( PTREE* aTree, DSNLEXER* aLexer );
|
||||
* Function Format
|
||||
* outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
|
||||
*/
|
||||
void Format( OUTPUTFORMATTER* out, int aNestLevel, int aCtl, CPTREE& aTree );
|
||||
void Format( OUTPUTFORMATTER* out, int aNestLevel, int aCtl, const CPTREE& aTree );
|
||||
|
||||
#endif // PTREE_H_
|
||||
|
@ -57,7 +57,7 @@ class SHAPE_FILE_IO
|
||||
|
||||
void Write( const SHAPE* aShape, const std::string& aName = "<noname>" );
|
||||
|
||||
void Write( const SHAPE& aShape, const std::string aName = "<noname>" )
|
||||
void Write( const SHAPE& aShape, const std::string& aName = "<noname>" )
|
||||
{
|
||||
Write( &aShape, aName );
|
||||
}
|
||||
@ -68,4 +68,4 @@ class SHAPE_FILE_IO
|
||||
IO_MODE m_mode;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // __SHAPE_FILE_IO_H
|
||||
|
@ -534,11 +534,11 @@ void SHAPE_LINE_CHAIN::Insert( size_t aVertex, const SHAPE_ARC& aArc )
|
||||
|
||||
struct compareOriginDistance
|
||||
{
|
||||
compareOriginDistance( VECTOR2I& aOrigin ) :
|
||||
compareOriginDistance( const VECTOR2I& aOrigin ) :
|
||||
m_origin( aOrigin ) {};
|
||||
|
||||
bool operator()( const SHAPE_LINE_CHAIN::INTERSECTION& aA,
|
||||
const SHAPE_LINE_CHAIN::INTERSECTION& aB )
|
||||
const SHAPE_LINE_CHAIN::INTERSECTION& aB ) const
|
||||
{
|
||||
return ( m_origin - aA.p ).EuclideanNorm() < ( m_origin - aB.p ).EuclideanNorm();
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ BOARD_STACKUP_ITEM::BOARD_STACKUP_ITEM( BOARD_STACKUP_ITEM_TYPE aType )
|
||||
}
|
||||
|
||||
|
||||
BOARD_STACKUP_ITEM::BOARD_STACKUP_ITEM( BOARD_STACKUP_ITEM& aOther )
|
||||
BOARD_STACKUP_ITEM::BOARD_STACKUP_ITEM( const BOARD_STACKUP_ITEM& aOther )
|
||||
{
|
||||
m_LayerId = aOther.m_LayerId;
|
||||
m_DielectricLayerId = aOther.m_DielectricLayerId;
|
||||
@ -320,7 +320,7 @@ BOARD_STACKUP::BOARD_STACKUP()
|
||||
}
|
||||
|
||||
|
||||
BOARD_STACKUP::BOARD_STACKUP( BOARD_STACKUP& aOther )
|
||||
BOARD_STACKUP::BOARD_STACKUP( const BOARD_STACKUP& aOther )
|
||||
{
|
||||
m_HasDielectricConstrains = aOther.m_HasDielectricConstrains;
|
||||
m_HasThicknessConstrains = aOther.m_HasThicknessConstrains;
|
||||
|
@ -89,7 +89,7 @@ class BOARD_STACKUP_ITEM
|
||||
{
|
||||
public:
|
||||
BOARD_STACKUP_ITEM( BOARD_STACKUP_ITEM_TYPE aType );
|
||||
BOARD_STACKUP_ITEM( BOARD_STACKUP_ITEM& aOther );
|
||||
BOARD_STACKUP_ITEM( const BOARD_STACKUP_ITEM& aOther );
|
||||
|
||||
|
||||
private:
|
||||
@ -243,7 +243,7 @@ public:
|
||||
|
||||
public:
|
||||
BOARD_STACKUP();
|
||||
BOARD_STACKUP( BOARD_STACKUP& aOther );
|
||||
BOARD_STACKUP( const BOARD_STACKUP& aOther );
|
||||
BOARD_STACKUP& operator=( const BOARD_STACKUP& aOther );
|
||||
|
||||
~BOARD_STACKUP() { RemoveAll(); }
|
||||
@ -267,7 +267,7 @@ public:
|
||||
void RemoveAll();
|
||||
|
||||
/// @return the number of layers in the stackup
|
||||
int GetCount() { return (int) m_list.size(); }
|
||||
int GetCount() const { return (int) m_list.size(); }
|
||||
|
||||
/// @return the board thickness ( in UI) from the thickness of BOARD_STACKUP_ITEM list
|
||||
int BuildBoardTicknessFromStackup() const;
|
||||
@ -306,4 +306,4 @@ public:
|
||||
};
|
||||
|
||||
|
||||
#endif // #ifndef CLASS_BOARD_STACKUP_H
|
||||
#endif // CLASS_BOARD_STACKUP_H
|
||||
|
@ -556,8 +556,8 @@ void DIALOG_BOARD_REANNOTATE::LogChangePlan()
|
||||
|
||||
//
|
||||
/// Create a list of the footprints and their coordinates
|
||||
void DIALOG_BOARD_REANNOTATE::LogFootprints( wxString& aMessage,
|
||||
std::vector<RefDesInfo>& aFootprints )
|
||||
void DIALOG_BOARD_REANNOTATE::LogFootprints( const wxString& aMessage,
|
||||
const std::vector<RefDesInfo>& aFootprints )
|
||||
{
|
||||
wxString message = aMessage;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user