Add more const specifiers

This commit is contained in:
Dominik Wernberger 2020-12-20 19:44:13 +01:00 committed by Seth Hillbrand
parent ec0af24f13
commit ac94d72d2d
43 changed files with 225 additions and 206 deletions

View File

@ -362,7 +362,7 @@ const char* OUTPUTFORMATTER::GetQuoteChar( const char* wrapee, const char* quote
} }
const char* OUTPUTFORMATTER::GetQuoteChar( const char* wrapee ) const char* OUTPUTFORMATTER::GetQuoteChar( const char* wrapee ) const
{ {
return GetQuoteChar( wrapee, quoteChar ); return GetQuoteChar( wrapee, quoteChar );
} }
@ -434,7 +434,7 @@ int OUTPUTFORMATTER::Print( int nestLevel, const char* fmt, ... )
} }
std::string OUTPUTFORMATTER::Quotes( const std::string& aWrapee ) std::string OUTPUTFORMATTER::Quotes( const std::string& aWrapee ) const
{ {
std::string ret; std::string ret;
@ -473,7 +473,7 @@ std::string OUTPUTFORMATTER::Quotes( const std::string& aWrapee )
} }
std::string OUTPUTFORMATTER::Quotew( const wxString& aWrapee ) std::string OUTPUTFORMATTER::Quotew( const wxString& aWrapee ) const
{ {
// wxStrings are always encoded as UTF-8 as we convert to a byte sequence. // wxStrings are always encoded as UTF-8 as we convert to a byte sequence.
// The non-virutal function calls the virtual workhorse function, and if // The non-virutal function calls the virtual workhorse function, and if

View File

@ -187,7 +187,7 @@ bool TOOL_EVENT::IsDblClick( int aButtonMask ) const
} }
bool TOOL_EVENT::IsCancelInteractive() bool TOOL_EVENT::IsCancelInteractive() const
{ {
return( ( m_commandStr.is_initialized() return( ( m_commandStr.is_initialized()
&& m_commandStr.get() == ACTIONS::cancelInteractive.GetName() ) && m_commandStr.get() == ACTIONS::cancelInteractive.GetName() )
@ -197,7 +197,7 @@ bool TOOL_EVENT::IsCancelInteractive()
} }
bool TOOL_EVENT::IsSelectionEvent() bool TOOL_EVENT::IsSelectionEvent() const
{ {
return Matches( EVENTS::ClearedEvent ) return Matches( EVENTS::ClearedEvent )
|| Matches( EVENTS::UnselectedEvent ) || Matches( EVENTS::UnselectedEvent )
@ -205,7 +205,7 @@ bool TOOL_EVENT::IsSelectionEvent()
} }
bool TOOL_EVENT::IsPointEditor() bool TOOL_EVENT::IsPointEditor() const
{ {
return( ( m_commandStr.is_initialized() return( ( m_commandStr.is_initialized()
&& m_commandStr.get().find( "PointEditor" ) != GetCommandStr()->npos ) && m_commandStr.get().find( "PointEditor" ) != GetCommandStr()->npos )
@ -214,7 +214,7 @@ bool TOOL_EVENT::IsPointEditor()
} }
bool TOOL_EVENT::IsMoveTool() bool TOOL_EVENT::IsMoveTool() const
{ {
return( m_commandStr.is_initialized() return( m_commandStr.is_initialized()
&& m_commandStr.get().find( "InteractiveMove" ) != GetCommandStr()->npos ); && m_commandStr.get().find( "InteractiveMove" ) != GetCommandStr()->npos );

View File

@ -621,7 +621,7 @@ void LIB_PART::AddDrawItem( LIB_ITEM* aItem )
} }
LIB_ITEM* LIB_PART::GetNextDrawItem( LIB_ITEM* aItem, KICAD_T aType ) LIB_ITEM* LIB_PART::GetNextDrawItem( const LIB_ITEM* aItem, KICAD_T aType )
{ {
if( aItem == NULL ) if( aItem == NULL )
{ {

View File

@ -122,6 +122,7 @@ public:
void SetParent( LIB_PART* aParent = nullptr ); void SetParent( LIB_PART* aParent = nullptr );
PART_REF& GetParent() { return m_parent; } PART_REF& GetParent() { return m_parent; }
const PART_REF& GetParent() const { return m_parent; }
virtual wxString GetClass() const override virtual wxString GetClass() const override
{ {
@ -353,7 +354,7 @@ public:
* if TYPE_NOT_INIT search for all items types * if TYPE_NOT_INIT search for all items types
* @return - The next drawing object in the list if found, otherwise NULL. * @return - The next drawing object in the list if found, otherwise NULL.
*/ */
LIB_ITEM* GetNextDrawItem( LIB_ITEM* aItem = NULL, KICAD_T aType = TYPE_NOT_INIT ); LIB_ITEM* GetNextDrawItem( const LIB_ITEM* aItem = NULL, KICAD_T aType = TYPE_NOT_INIT );
size_t GetPinCount() const { return m_drawings.size( LIB_PIN_T ); } size_t GetPinCount() const { return m_drawings.size( LIB_PIN_T ); }
@ -468,6 +469,7 @@ public:
* @return LIB_ITEMS_CONTAINER& - Reference to the draw item object container. * @return LIB_ITEMS_CONTAINER& - Reference to the draw item object container.
*/ */
LIB_ITEMS_CONTAINER& GetDrawItems() { return m_drawings; } LIB_ITEMS_CONTAINER& GetDrawItems() { return m_drawings; }
const LIB_ITEMS_CONTAINER& GetDrawItems() const { return m_drawings; }
SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;

View File

@ -99,7 +99,7 @@ public:
/** /**
* Return the generated HTML. * Return the generated HTML.
*/ */
wxString GetHtml() wxString GetHtml() const
{ {
return m_html; return m_html;
} }
@ -156,7 +156,7 @@ protected:
} }
wxString GetHtmlFieldRow( LIB_FIELD const & aField ) wxString GetHtmlFieldRow( const LIB_FIELD& aField ) const
{ {
wxString name = aField.GetCanonicalName(); wxString name = aField.GetCanonicalName();
wxString text = aField.GetFullText( m_unit > 0 ? m_unit : 1 ); wxString text = aField.GetFullText( m_unit > 0 ? m_unit : 1 );

View File

@ -56,7 +56,7 @@ public:
SCH_BITMAP& operator=( const SCH_ITEM& aItem ); SCH_BITMAP& operator=( const SCH_ITEM& aItem );
BITMAP_BASE* GetImage() BITMAP_BASE* GetImage() const
{ {
wxCHECK_MSG( m_image != NULL, NULL, "Invalid SCH_BITMAP init, m_image is NULL." ); wxCHECK_MSG( m_image != NULL, NULL, "Invalid SCH_BITMAP init, m_image is NULL." );
return m_image; return m_image;
@ -122,7 +122,7 @@ public:
* and false for items moved with no reference to anchor * and false for items moved with no reference to anchor
* @return false for a bus entry * @return false for a bus entry
*/ */
bool IsMovableFromAnchorPoint() override { return false; } bool IsMovableFromAnchorPoint() const override { return false; }
void MirrorY( int aYaxis_position ) override; void MirrorY( int aYaxis_position ) override;
void MirrorX( int aXaxis_position ) override; void MirrorX( int aXaxis_position ) override;

View File

@ -56,7 +56,7 @@ public:
* and false for items moved with no reference to anchor * and false for items moved with no reference to anchor
* @return false for a bus entry * @return false for a bus entry
*/ */
bool IsMovableFromAnchorPoint() override { return false; } bool IsMovableFromAnchorPoint() const override { return false; }
wxPoint GetEnd() const; wxPoint GetEnd() const;

View File

@ -811,7 +811,7 @@ void SCH_COMPONENT::RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunc
} }
SCH_PIN* SCH_COMPONENT::GetPin( const wxString& aNumber ) SCH_PIN* SCH_COMPONENT::GetPin( const wxString& aNumber ) const
{ {
for( const std::unique_ptr<SCH_PIN>& pin : m_pins ) for( const std::unique_ptr<SCH_PIN>& pin : m_pins )
{ {
@ -823,7 +823,7 @@ SCH_PIN* SCH_COMPONENT::GetPin( const wxString& aNumber )
} }
void SCH_COMPONENT::GetLibPins( std::vector<LIB_PIN*>& aPinsList ) void SCH_COMPONENT::GetLibPins( std::vector<LIB_PIN*>& aPinsList ) const
{ {
if( m_part ) if( m_part )
m_part->GetPins( aPinsList, m_unit, m_convert ); m_part->GetPins( aPinsList, m_unit, m_convert );

View File

@ -182,7 +182,7 @@ public:
* *
* @return true for a component * @return true for a component
*/ */
bool IsMovableFromAnchorPoint() override { return true; } bool IsMovableFromAnchorPoint() const override { return true; }
void SetLibId( const LIB_ID& aName ); void SetLibId( const LIB_ID& aName );
@ -204,6 +204,7 @@ public:
bool UseLibIdLookup() const { return m_schLibSymbolName.IsEmpty(); } bool UseLibIdLookup() const { return m_schLibSymbolName.IsEmpty(); }
std::unique_ptr< LIB_PART >& GetPartRef() { return m_part; } std::unique_ptr< LIB_PART >& GetPartRef() { return m_part; }
const std::unique_ptr< LIB_PART >& GetPartRef() const { return m_part; }
/** /**
* Set this schematic symbol library symbol reference to \a aLibSymbol * Set this schematic symbol library symbol reference to \a aLibSymbol
@ -269,7 +270,8 @@ public:
void SetPrefix( const wxString& aPrefix ) { m_prefix = aPrefix; } void SetPrefix( const wxString& aPrefix ) { m_prefix = aPrefix; }
TRANSFORM& GetTransform() const { return const_cast< TRANSFORM& >( m_transform ); } TRANSFORM& GetTransform() { return m_transform; }
const TRANSFORM& GetTransform() const { return m_transform; }
void SetTransform( const TRANSFORM& aTransform ); void SetTransform( const TRANSFORM& aTransform );
@ -467,14 +469,14 @@ public:
* *
* @return Pin object if found, otherwise NULL. * @return Pin object if found, otherwise NULL.
*/ */
SCH_PIN* GetPin( const wxString& number ); SCH_PIN* GetPin( const wxString& number ) const;
/** /**
* Populate a vector with all the pins from the library object. * Populate a vector with all the pins from the library object.
* *
* @param aPinsList is the list to populate with all of the pins. * @param aPinsList is the list to populate with all of the pins.
*/ */
void GetLibPins( std::vector<LIB_PIN*>& aPinsList ); void GetLibPins( std::vector<LIB_PIN*>& aPinsList ) const;
SCH_PIN* GetPin( LIB_PIN* aLibPin ); SCH_PIN* GetPin( LIB_PIN* aLibPin );

View File

@ -106,7 +106,7 @@ SCH_DRAW_PANEL::~SCH_DRAW_PANEL()
} }
void SCH_DRAW_PANEL::DisplayComponent( const LIB_PART* aComponent ) void SCH_DRAW_PANEL::DisplayComponent( LIB_PART* aComponent )
{ {
GetView()->Clear(); GetView()->Clear();
GetView()->DisplayComponent( const_cast<LIB_PART*>(aComponent) ); GetView()->DisplayComponent( const_cast<LIB_PART*>(aComponent) );
@ -114,7 +114,7 @@ void SCH_DRAW_PANEL::DisplayComponent( const LIB_PART* aComponent )
} }
void SCH_DRAW_PANEL::DisplaySheet( const SCH_SCREEN *aScreen ) void SCH_DRAW_PANEL::DisplaySheet( SCH_SCREEN *aScreen )
{ {
GetView()->Clear(); GetView()->Clear();

View File

@ -44,8 +44,8 @@ public:
~SCH_DRAW_PANEL(); ~SCH_DRAW_PANEL();
void DisplayComponent( const LIB_PART *aComponent ); void DisplayComponent( LIB_PART *aComponent );
void DisplaySheet( const SCH_SCREEN *aScreen ); void DisplaySheet( SCH_SCREEN *aScreen );
bool SwitchBackend( GAL_TYPE aGalType ) override; bool SwitchBackend( GAL_TYPE aGalType ) override;

View File

@ -244,7 +244,7 @@ public:
* Usually return true for small items (labels, junctions) and false for * Usually return true for small items (labels, junctions) and false for
* items which can be large (hierarchical sheets, symbols) * items which can be large (hierarchical sheets, symbols)
*/ */
virtual bool IsMovableFromAnchorPoint() { return true; } virtual bool IsMovableFromAnchorPoint() const { return true; }
wxPoint& GetStoredPos() { return m_storedPos; } wxPoint& GetStoredPos() { return m_storedPos; }
void SetStoredPos( wxPoint aPos ) { m_storedPos = aPos; } void SetStoredPos( wxPoint aPos ) { m_storedPos = aPos; }

View File

@ -365,7 +365,7 @@ void SCH_LINE::RotateEnd( wxPoint aPosition )
} }
bool SCH_LINE::IsSameQuadrant( SCH_LINE* aLine, const wxPoint& aPosition ) bool SCH_LINE::IsSameQuadrant( const SCH_LINE* aLine, const wxPoint& aPosition ) const
{ {
wxPoint first; wxPoint first;
wxPoint second; wxPoint second;
@ -388,7 +388,7 @@ bool SCH_LINE::IsSameQuadrant( SCH_LINE* aLine, const wxPoint& aPosition )
} }
bool SCH_LINE::IsParallel( SCH_LINE* aLine ) bool SCH_LINE::IsParallel( const SCH_LINE* aLine ) const
{ {
wxCHECK_MSG( aLine != NULL && aLine->Type() == SCH_LINE_T, false, wxCHECK_MSG( aLine != NULL && aLine->Type() == SCH_LINE_T, false,
wxT( "Cannot test line segment for overlap." ) ); wxT( "Cannot test line segment for overlap." ) );

View File

@ -201,9 +201,9 @@ public:
* @param aPosition - Point to reference against lines * @param aPosition - Point to reference against lines
* @return true if lines are mostly in different quadrants of aPosition, false otherwise * @return true if lines are mostly in different quadrants of aPosition, false otherwise
*/ */
bool IsSameQuadrant( SCH_LINE* aLine, const wxPoint& aPosition ); bool IsSameQuadrant( const SCH_LINE* aLine, const wxPoint& aPosition ) const;
bool IsParallel( SCH_LINE* aLine ); bool IsParallel( const SCH_LINE* aLine ) const;
void GetEndPoints( std::vector<DANGLING_END_ITEM>& aItemList ) override; void GetEndPoints( std::vector<DANGLING_END_ITEM>& aItemList ) override;

View File

@ -228,7 +228,7 @@ bool SCH_PAINTER::Draw( const VIEW_ITEM *aItem, int aLayer )
} }
bool SCH_PAINTER::isUnitAndConversionShown( const LIB_ITEM* aItem ) bool SCH_PAINTER::isUnitAndConversionShown( const LIB_ITEM* aItem ) const
{ {
if( m_schSettings.m_ShowUnit // showing a specific unit if( m_schSettings.m_ShowUnit // showing a specific unit
&& aItem->GetUnit() // item is unit-specific && aItem->GetUnit() // item is unit-specific
@ -248,7 +248,7 @@ bool SCH_PAINTER::isUnitAndConversionShown( const LIB_ITEM* aItem )
} }
float SCH_PAINTER::getShadowWidth() float SCH_PAINTER::getShadowWidth() const
{ {
const MATRIX3x3D& matrix = m_gal->GetScreenWorldMatrix(); const MATRIX3x3D& matrix = m_gal->GetScreenWorldMatrix();
@ -258,7 +258,7 @@ float SCH_PAINTER::getShadowWidth()
} }
COLOR4D SCH_PAINTER::getRenderColor( const EDA_ITEM* aItem, int aLayer, bool aDrawingShadows ) COLOR4D SCH_PAINTER::getRenderColor( const EDA_ITEM* aItem, int aLayer, bool aDrawingShadows ) const
{ {
COLOR4D color = m_schSettings.GetLayerColor( aLayer ); COLOR4D color = m_schSettings.GetLayerColor( aLayer );
@ -318,7 +318,7 @@ COLOR4D SCH_PAINTER::getRenderColor( const EDA_ITEM* aItem, int aLayer, bool aDr
} }
float SCH_PAINTER::getLineWidth( const LIB_ITEM* aItem, bool aDrawingShadows ) float SCH_PAINTER::getLineWidth( const LIB_ITEM* aItem, bool aDrawingShadows ) const
{ {
float width = (float) std::max( aItem->GetPenWidth(), m_schSettings.GetDefaultPenWidth() ); float width = (float) std::max( aItem->GetPenWidth(), m_schSettings.GetDefaultPenWidth() );
@ -329,7 +329,7 @@ float SCH_PAINTER::getLineWidth( const LIB_ITEM* aItem, bool aDrawingShadows )
} }
float SCH_PAINTER::getLineWidth( const SCH_ITEM* aItem, bool aDrawingShadows ) float SCH_PAINTER::getLineWidth( const SCH_ITEM* aItem, bool aDrawingShadows ) const
{ {
wxCHECK( aItem, static_cast<float>( m_schSettings.m_DefaultWireThickness ) ); wxCHECK( aItem, static_cast<float>( m_schSettings.m_DefaultWireThickness ) );
@ -342,7 +342,7 @@ float SCH_PAINTER::getLineWidth( const SCH_ITEM* aItem, bool aDrawingShadows )
} }
float SCH_PAINTER::getTextThickness( const SCH_TEXT* aItem, bool aDrawingShadows ) float SCH_PAINTER::getTextThickness( const SCH_TEXT* aItem, bool aDrawingShadows ) const
{ {
float width = (float) aItem->GetEffectiveTextPenWidth( m_schSettings.GetDefaultPenWidth() ); float width = (float) aItem->GetEffectiveTextPenWidth( m_schSettings.GetDefaultPenWidth() );
@ -353,7 +353,7 @@ float SCH_PAINTER::getTextThickness( const SCH_TEXT* aItem, bool aDrawingShadows
} }
float SCH_PAINTER::getTextThickness( const SCH_FIELD* aItem, bool aDrawingShadows ) float SCH_PAINTER::getTextThickness( const SCH_FIELD* aItem, bool aDrawingShadows ) const
{ {
float width = (float) aItem->GetEffectiveTextPenWidth( m_schSettings.GetDefaultPenWidth() ); float width = (float) aItem->GetEffectiveTextPenWidth( m_schSettings.GetDefaultPenWidth() );
@ -364,7 +364,7 @@ float SCH_PAINTER::getTextThickness( const SCH_FIELD* aItem, bool aDrawingShadow
} }
float SCH_PAINTER::getTextThickness( const LIB_FIELD* aItem, bool aDrawingShadows ) float SCH_PAINTER::getTextThickness( const LIB_FIELD* aItem, bool aDrawingShadows ) const
{ {
float width = (float) std::max( aItem->GetEffectiveTextPenWidth(), float width = (float) std::max( aItem->GetEffectiveTextPenWidth(),
m_schSettings.GetDefaultPenWidth() ); m_schSettings.GetDefaultPenWidth() );
@ -376,7 +376,7 @@ float SCH_PAINTER::getTextThickness( const LIB_FIELD* aItem, bool aDrawingShadow
} }
float SCH_PAINTER::getTextThickness( const LIB_TEXT* aItem, bool aDrawingShadows ) float SCH_PAINTER::getTextThickness( const LIB_TEXT* aItem, bool aDrawingShadows ) const
{ {
float width = (float) std::max( aItem->GetEffectiveTextPenWidth(), float width = (float) std::max( aItem->GetEffectiveTextPenWidth(),
m_schSettings.GetDefaultPenWidth() ); m_schSettings.GetDefaultPenWidth() );
@ -394,7 +394,7 @@ void SCH_PAINTER::strokeText( const wxString& aText, const VECTOR2D& aPosition,
} }
void SCH_PAINTER::draw( LIB_PART *aPart, int aLayer, bool aDrawFields, int aUnit, int aConvert ) void SCH_PAINTER::draw( const LIB_PART *aPart, int aLayer, bool aDrawFields, int aUnit, int aConvert )
{ {
if( !aUnit ) if( !aUnit )
aUnit = m_schSettings.m_ShowUnit; aUnit = m_schSettings.m_ShowUnit;
@ -403,7 +403,7 @@ void SCH_PAINTER::draw( LIB_PART *aPart, int aLayer, bool aDrawFields, int aUnit
aConvert = m_schSettings.m_ShowConvert; aConvert = m_schSettings.m_ShowConvert;
std::unique_ptr< LIB_PART > tmpPart; std::unique_ptr< LIB_PART > tmpPart;
LIB_PART* drawnPart = aPart; const LIB_PART* drawnPart = aPart;
if( aPart->IsAlias() ) if( aPart->IsAlias() )
{ {
@ -504,7 +504,7 @@ void SCH_PAINTER::fillIfSelection( int aLayer )
} }
void SCH_PAINTER::draw( LIB_RECTANGLE *aRect, int aLayer ) void SCH_PAINTER::draw( const LIB_RECTANGLE *aRect, int aLayer )
{ {
if( !isUnitAndConversionShown( aRect ) ) if( !isUnitAndConversionShown( aRect ) )
return; return;
@ -517,7 +517,7 @@ void SCH_PAINTER::draw( LIB_RECTANGLE *aRect, int aLayer )
} }
void SCH_PAINTER::draw( LIB_CIRCLE *aCircle, int aLayer ) void SCH_PAINTER::draw( const LIB_CIRCLE *aCircle, int aLayer )
{ {
if( !isUnitAndConversionShown( aCircle ) ) if( !isUnitAndConversionShown( aCircle ) )
return; return;
@ -530,7 +530,7 @@ void SCH_PAINTER::draw( LIB_CIRCLE *aCircle, int aLayer )
} }
void SCH_PAINTER::draw( LIB_ARC *aArc, int aLayer ) void SCH_PAINTER::draw( const LIB_ARC *aArc, int aLayer )
{ {
if( !isUnitAndConversionShown( aArc ) ) if( !isUnitAndConversionShown( aArc ) )
return; return;
@ -572,7 +572,7 @@ void SCH_PAINTER::draw( LIB_ARC *aArc, int aLayer )
} }
void SCH_PAINTER::draw( LIB_POLYLINE *aLine, int aLayer ) void SCH_PAINTER::draw( const LIB_POLYLINE *aLine, int aLayer )
{ {
if( !isUnitAndConversionShown( aLine ) ) if( !isUnitAndConversionShown( aLine ) )
return; return;
@ -591,7 +591,7 @@ void SCH_PAINTER::draw( LIB_POLYLINE *aLine, int aLayer )
} }
void SCH_PAINTER::draw( LIB_FIELD *aField, int aLayer ) void SCH_PAINTER::draw( const LIB_FIELD *aField, int aLayer )
{ {
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS; bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
@ -670,7 +670,7 @@ void SCH_PAINTER::draw( LIB_FIELD *aField, int aLayer )
} }
void SCH_PAINTER::draw( LIB_TEXT *aText, int aLayer ) void SCH_PAINTER::draw( const LIB_TEXT *aText, int aLayer )
{ {
if( !isUnitAndConversionShown( aText ) ) if( !isUnitAndConversionShown( aText ) )
return; return;
@ -1146,7 +1146,7 @@ void SCH_PAINTER::draw( LIB_PIN *aPin, int aLayer )
} }
void SCH_PAINTER::draw( LIB_BEZIER *aCurve, int aLayer ) void SCH_PAINTER::draw( const LIB_BEZIER *aCurve, int aLayer )
{ {
if( !isUnitAndConversionShown( aCurve ) ) if( !isUnitAndConversionShown( aCurve ) )
return; return;
@ -1182,7 +1182,7 @@ void SCH_PAINTER::drawDanglingSymbol( const wxPoint& aPos, int aWidth, bool aDra
} }
void SCH_PAINTER::draw( SCH_JUNCTION *aJct, int aLayer ) void SCH_PAINTER::draw( const SCH_JUNCTION *aJct, int aLayer )
{ {
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS; bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
@ -1205,7 +1205,7 @@ void SCH_PAINTER::draw( SCH_JUNCTION *aJct, int aLayer )
} }
void SCH_PAINTER::draw( SCH_LINE *aLine, int aLayer ) void SCH_PAINTER::draw( const SCH_LINE *aLine, int aLayer )
{ {
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS; bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
@ -1284,7 +1284,7 @@ void SCH_PAINTER::draw( SCH_LINE *aLine, int aLayer )
} }
void SCH_PAINTER::draw( SCH_TEXT *aText, int aLayer ) void SCH_PAINTER::draw( const SCH_TEXT *aText, int aLayer )
{ {
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS; bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
@ -1461,12 +1461,12 @@ void SCH_PAINTER::draw( SCH_COMPONENT *aSymbol, int aLayer )
draw( &tempPart, aLayer, false, aSymbol->GetUnit(), aSymbol->GetConvert() ); draw( &tempPart, aLayer, false, aSymbol->GetUnit(), aSymbol->GetConvert() );
// The fields are SCH_COMPONENT-specific so don't need to be copied/oriented/translated // The fields are SCH_COMPONENT-specific so don't need to be copied/oriented/translated
for( SCH_FIELD& field : aSymbol->GetFields() ) for( const SCH_FIELD& field : aSymbol->GetFields() )
draw( &field, aLayer ); draw( &field, aLayer );
} }
void SCH_PAINTER::draw( SCH_FIELD *aField, int aLayer ) void SCH_PAINTER::draw( const SCH_FIELD *aField, int aLayer )
{ {
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS; bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
@ -1640,10 +1640,11 @@ void SCH_PAINTER::draw( SCH_HIERLABEL *aLabel, int aLayer )
m_gal->SetStrokeColor( color ); m_gal->SetStrokeColor( color );
m_gal->DrawPolyline( pts2 ); m_gal->DrawPolyline( pts2 );
draw( static_cast<SCH_TEXT*>( aLabel ), aLayer ); draw( static_cast<const SCH_TEXT*>( aLabel ), aLayer );
} }
void SCH_PAINTER::draw( SCH_SHEET *aSheet, int aLayer )
void SCH_PAINTER::draw( const SCH_SHEET *aSheet, int aLayer )
{ {
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS; bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
@ -1705,13 +1706,13 @@ void SCH_PAINTER::draw( SCH_SHEET *aSheet, int aLayer )
if( drawingShadows && !eeconfig()->m_Selection.draw_selected_children && aSheet->IsSelected() ) if( drawingShadows && !eeconfig()->m_Selection.draw_selected_children && aSheet->IsSelected() )
return; return;
for( SCH_FIELD& field : aSheet->GetFields() ) for( const SCH_FIELD& field : aSheet->GetFields() )
draw( &field, aLayer ); draw( &field, aLayer );
} }
} }
void SCH_PAINTER::draw( SCH_NO_CONNECT *aNC, int aLayer ) void SCH_PAINTER::draw( const SCH_NO_CONNECT *aNC, int aLayer )
{ {
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS; bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
@ -1731,7 +1732,7 @@ void SCH_PAINTER::draw( SCH_NO_CONNECT *aNC, int aLayer )
} }
void SCH_PAINTER::draw( SCH_BUS_ENTRY_BASE *aEntry, int aLayer ) void SCH_PAINTER::draw( const SCH_BUS_ENTRY_BASE *aEntry, int aLayer )
{ {
SCH_LINE line; SCH_LINE line;
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS; bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
@ -1774,7 +1775,7 @@ void SCH_PAINTER::draw( SCH_BUS_ENTRY_BASE *aEntry, int aLayer )
} }
void SCH_PAINTER::draw( SCH_BITMAP *aBitmap, int aLayer ) void SCH_PAINTER::draw( const SCH_BITMAP *aBitmap, int aLayer )
{ {
m_gal->Save(); m_gal->Save();
m_gal->Translate( aBitmap->GetPosition() ); m_gal->Translate( aBitmap->GetPosition() );
@ -1819,7 +1820,7 @@ void SCH_PAINTER::draw( SCH_BITMAP *aBitmap, int aLayer )
} }
void SCH_PAINTER::draw( SCH_MARKER *aMarker, int aLayer ) void SCH_PAINTER::draw( const SCH_MARKER *aMarker, int aLayer )
{ {
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS; bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;

View File

@ -96,7 +96,7 @@ public:
m_layerColors[ LAYER_SCHEMATIC_BACKGROUND ] = aColor; m_layerColors[ LAYER_SCHEMATIC_BACKGROUND ] = aColor;
} }
float GetDanglineSymbolThickness() float GetDanglineSymbolThickness() const
{ {
return (float) m_defaultPenWidth / 3.0F; return (float) m_defaultPenWidth / 3.0F;
} }
@ -156,27 +156,27 @@ public:
} }
private: private:
void draw( LIB_RECTANGLE* aRect, int aLayer ); void draw( const LIB_RECTANGLE* aRect, int aLayer );
void draw( LIB_PIN* aPin, int aLayer ); void draw( LIB_PIN* aPin, int aLayer );
void draw( LIB_CIRCLE* aCircle, int aLayer ); void draw( const LIB_CIRCLE* aCircle, int aLayer );
void draw( LIB_PART* aPart, int, bool aDrawFields = true, int aUnit = 0, int aConvert = 0 ); void draw( const LIB_PART* aPart, int, bool aDrawFields = true, int aUnit = 0, int aConvert = 0 );
void draw( LIB_ARC* aArc, int aLayer ); void draw( const LIB_ARC* aArc, int aLayer );
void draw( LIB_POLYLINE* aLine, int aLayer ); void draw( const LIB_POLYLINE* aLine, int aLayer );
void draw( LIB_FIELD* aField, int aLayer ); void draw( const LIB_FIELD* aField, int aLayer );
void draw( LIB_TEXT* aText, int aLayer ); void draw( const LIB_TEXT* aText, int aLayer );
void draw( LIB_BEZIER* aCurve, int aLayer ); void draw( const LIB_BEZIER* aCurve, int aLayer );
void draw( SCH_COMPONENT* aSymbol, int aLayer ); void draw( SCH_COMPONENT* aSymbol, int aLayer );
void draw( SCH_JUNCTION* aJct, int aLayer ); void draw( const SCH_JUNCTION* aJct, int aLayer );
void draw( SCH_FIELD* aField, int aLayer ); void draw( const SCH_FIELD* aField, int aLayer );
void draw( SCH_TEXT* aText, int aLayer ); void draw( const SCH_TEXT* aText, int aLayer );
void draw( SCH_HIERLABEL* aLabel, int aLayer ); void draw( SCH_HIERLABEL* aLabel, int aLayer );
void draw( SCH_GLOBALLABEL* aLabel, int aLayer ); void draw( SCH_GLOBALLABEL* aLabel, int aLayer );
void draw( SCH_SHEET* aSheet, int aLayer ); void draw( const SCH_SHEET* aSheet, int aLayer );
void draw( SCH_NO_CONNECT* aNC, int aLayer ); void draw( const SCH_NO_CONNECT* aNC, int aLayer );
void draw( SCH_MARKER* aMarker, int aLayer ); void draw( const SCH_MARKER* aMarker, int aLayer );
void draw( SCH_BITMAP* aBitmap, int aLayer ); void draw( const SCH_BITMAP* aBitmap, int aLayer );
void draw( SCH_LINE* aLine, int aLayer ); void draw( const SCH_LINE* aLine, int aLayer );
void draw( SCH_BUS_ENTRY_BASE* aEntry, int aLayer ); void draw( const SCH_BUS_ENTRY_BASE* aEntry, int aLayer );
void drawPinDanglingSymbol( const VECTOR2I& aPos, bool aDrawingShadows ); void drawPinDanglingSymbol( const VECTOR2I& aPos, bool aDrawingShadows );
void drawDanglingSymbol( const wxPoint& aPos, int aWidth, bool aDrawingShadows ); void drawDanglingSymbol( const wxPoint& aPos, int aWidth, bool aDrawingShadows );
@ -184,16 +184,16 @@ private:
int internalPinDecoSize( const LIB_PIN &aPin ); int internalPinDecoSize( const LIB_PIN &aPin );
int externalPinDecoSize( const LIB_PIN &aPin ); int externalPinDecoSize( const LIB_PIN &aPin );
bool isUnitAndConversionShown( const LIB_ITEM* aItem ); bool isUnitAndConversionShown( const LIB_ITEM* aItem ) const;
float getShadowWidth(); float getShadowWidth() const;
COLOR4D getRenderColor( const EDA_ITEM* aItem, int aLayer, bool aDrawingShadows ); COLOR4D getRenderColor( const EDA_ITEM* aItem, int aLayer, bool aDrawingShadows ) const;
float getLineWidth( const LIB_ITEM* aItem, bool aDrawingShadows ); float getLineWidth( const LIB_ITEM* aItem, bool aDrawingShadows ) const;
float getLineWidth( const SCH_ITEM* aItem, bool aDrawingShadows ); float getLineWidth( const SCH_ITEM* aItem, bool aDrawingShadows ) const;
float getTextThickness( const SCH_TEXT* aItem, bool aDrawingShadows ); float getTextThickness( const SCH_TEXT* aItem, bool aDrawingShadows ) const;
float getTextThickness( const SCH_FIELD* aItem, bool aDrawingShadows ); float getTextThickness( const SCH_FIELD* aItem, bool aDrawingShadows ) const;
float getTextThickness( const LIB_FIELD* aItem, bool aDrawingShadows ); float getTextThickness( const LIB_FIELD* aItem, bool aDrawingShadows ) const;
float getTextThickness( const LIB_TEXT* aItem, bool aDrawingShadows ); float getTextThickness( const LIB_TEXT* aItem, bool aDrawingShadows ) const;
bool setDeviceColors( const LIB_ITEM* aItem, int aLayer ); bool setDeviceColors( const LIB_ITEM* aItem, int aLayer );
void fillIfSelection( int aLayer ); void fillIfSelection( int aLayer );

View File

@ -216,7 +216,7 @@ public:
} }
}; };
EE_TYPE OfType( KICAD_T aType ) EE_TYPE OfType( KICAD_T aType ) const
{ {
return EE_TYPE( m_tree, aType ); return EE_TYPE( m_tree, aType );
} }

View File

@ -288,7 +288,7 @@ void SCH_SHEET::AddPin( SCH_SHEET_PIN* aSheetPin )
} }
void SCH_SHEET::RemovePin( SCH_SHEET_PIN* aSheetPin ) void SCH_SHEET::RemovePin( const SCH_SHEET_PIN* aSheetPin )
{ {
wxASSERT( aSheetPin != NULL ); wxASSERT( aSheetPin != NULL );
wxASSERT( aSheetPin->Type() == SCH_SHEET_PIN_T ); wxASSERT( aSheetPin->Type() == SCH_SHEET_PIN_T );
@ -305,7 +305,7 @@ void SCH_SHEET::RemovePin( SCH_SHEET_PIN* aSheetPin )
} }
bool SCH_SHEET::HasPin( const wxString& aName ) bool SCH_SHEET::HasPin( const wxString& aName ) const
{ {
for( SCH_SHEET_PIN* pin : m_pins ) for( SCH_SHEET_PIN* pin : m_pins )
{ {
@ -350,7 +350,7 @@ bool SCH_SHEET::IsVerticalOrientation() const
} }
bool SCH_SHEET::HasUndefinedPins() bool SCH_SHEET::HasUndefinedPins() const
{ {
for( SCH_SHEET_PIN* pin : m_pins ) for( SCH_SHEET_PIN* pin : m_pins )
{ {

View File

@ -119,7 +119,7 @@ public:
* *
* @return true for a hierarchical sheet pin * @return true for a hierarchical sheet pin
*/ */
bool IsMovableFromAnchorPoint() override { return true; } bool IsMovableFromAnchorPoint() const override { return true; }
void Print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override; void Print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
@ -265,9 +265,10 @@ public:
* *
* @return false for a hierarchical sheet * @return false for a hierarchical sheet
*/ */
bool IsMovableFromAnchorPoint() override { return false; } bool IsMovableFromAnchorPoint() const override { return false; }
std::vector<SCH_FIELD>& GetFields() { return m_fields; } std::vector<SCH_FIELD>& GetFields() { return m_fields; }
const std::vector<SCH_FIELD>& GetFields() const { return m_fields; }
/** /**
* Set multiple schematic fields. * Set multiple schematic fields.
@ -283,7 +284,7 @@ public:
SCH_SCREEN* GetScreen() const { return m_screen; } SCH_SCREEN* GetScreen() const { return m_screen; }
wxSize GetSize() { return m_size; } wxSize GetSize() const { return m_size; }
void SetSize( const wxSize& aSize ) { m_size = aSize; } void SetSize( const wxSize& aSize ) { m_size = aSize; }
int GetBorderWidth() const { return m_borderWidth; } int GetBorderWidth() const { return m_borderWidth; }
@ -363,7 +364,7 @@ public:
std::vector<SCH_SHEET_PIN*>& GetPins() { return m_pins; } std::vector<SCH_SHEET_PIN*>& GetPins() { return m_pins; }
std::vector<SCH_SHEET_PIN*>& GetPins() const const std::vector<SCH_SHEET_PIN*>& GetPins() const
{ {
return const_cast< std::vector<SCH_SHEET_PIN*>& >( m_pins ); return const_cast< std::vector<SCH_SHEET_PIN*>& >( m_pins );
} }
@ -373,7 +374,7 @@ public:
* *
* @param aSheetPin The sheet pin item to remove from the sheet. * @param aSheetPin The sheet pin item to remove from the sheet.
*/ */
void RemovePin( SCH_SHEET_PIN* aSheetPin ); void RemovePin( const SCH_SHEET_PIN* aSheetPin );
/** /**
* Delete sheet label which do not have a corresponding hierarchical label. * Delete sheet label which do not have a corresponding hierarchical label.
@ -399,16 +400,16 @@ public:
* *
* @return True if sheet pin with \a aName is found, otherwise false. * @return True if sheet pin with \a aName is found, otherwise false.
*/ */
bool HasPin( const wxString& aName ); bool HasPin( const wxString& aName ) const;
bool HasPins() { return !m_pins.empty(); } bool HasPins() const { return !m_pins.empty(); }
/** /**
* Check all sheet labels against schematic for undefined hierarchical labels. * Check all sheet labels against schematic for undefined hierarchical labels.
* *
* @return True if there are any undefined labels. * @return True if there are any undefined labels.
*/ */
bool HasUndefinedPins(); bool HasUndefinedPins() const;
/** /**
* Return the minimum width of the sheet based on the widths of the sheet pin text. * Return the minimum width of the sheet based on the widths of the sheet pin text.

View File

@ -82,7 +82,7 @@ void SCH_VIEW::SetScale( double aScale, VECTOR2D aAnchor )
} }
void SCH_VIEW::ResizeSheetWorkingArea( SCH_SCREEN* aScreen ) void SCH_VIEW::ResizeSheetWorkingArea( const SCH_SCREEN* aScreen )
{ {
const PAGE_INFO& page_info = aScreen->GetPageSettings(); const PAGE_INFO& page_info = aScreen->GetPageSettings();
double max_size_x = page_info.GetWidthIU() * 3.0; double max_size_x = page_info.GetWidthIU() * 3.0;
@ -92,7 +92,7 @@ void SCH_VIEW::ResizeSheetWorkingArea( SCH_SCREEN* aScreen )
} }
void SCH_VIEW::DisplaySheet( SCH_SCREEN *aScreen ) void SCH_VIEW::DisplaySheet( const SCH_SCREEN *aScreen )
{ {
for( SCH_ITEM* item : aScreen->Items() ) for( SCH_ITEM* item : aScreen->Items() )
Add( item ); Add( item );

View File

@ -79,11 +79,11 @@ public:
void Cleanup(); void Cleanup();
void DisplaySheet( SCH_SCREEN* aScreen ); void DisplaySheet( const SCH_SCREEN* aScreen );
void DisplayComponent( LIB_PART* aPart ); void DisplayComponent( LIB_PART* aPart );
// Call it to set new draw area limits (max working and draw area size) // Call it to set new draw area limits (max working and draw area size)
void ResizeSheetWorkingArea( SCH_SCREEN *aScreen ); void ResizeSheetWorkingArea( const SCH_SCREEN *aScreen );
void SetScale( double aScale, VECTOR2D aAnchor = { 0, 0 } ) override; void SetScale( double aScale, VECTOR2D aAnchor = { 0, 0 } ) override;

View File

@ -229,6 +229,7 @@ public:
bool LoadFromFile( const wxString& aDirectory = "" ) override; bool LoadFromFile( const wxString& aDirectory = "" ) override;
BOARD_STACKUP& GetStackupDescriptor() { return m_stackup; } BOARD_STACKUP& GetStackupDescriptor() { return m_stackup; }
const BOARD_STACKUP& GetStackupDescriptor() const { return m_stackup; }
SEVERITY GetSeverity( int aDRCErrorCode ); SEVERITY GetSeverity( int aDRCErrorCode );

View File

@ -201,7 +201,7 @@ public:
void SetFlags( STATUS_FLAGS aMask ) { m_flags |= aMask; } void SetFlags( STATUS_FLAGS aMask ) { m_flags |= aMask; }
void ClearFlags( STATUS_FLAGS aMask = EDA_ITEM_ALL_FLAGS ) { m_flags &= ~aMask; } void ClearFlags( STATUS_FLAGS aMask = EDA_ITEM_ALL_FLAGS ) { m_flags &= ~aMask; }
STATUS_FLAGS GetFlags() const { return m_flags; } STATUS_FLAGS GetFlags() const { return m_flags; }
bool HasFlag( STATUS_FLAGS aFlag ) { return ( m_flags & aFlag ) == aFlag; } bool HasFlag( STATUS_FLAGS aFlag ) const { return ( m_flags & aFlag ) == aFlag; }
STATUS_FLAGS GetEditFlags() const STATUS_FLAGS GetEditFlags() const
{ {

View File

@ -65,6 +65,11 @@ public:
wxString GetName() const { return m_name; } wxString GetName() const { return m_name; }
void SetName( wxString aName ) { m_name = aName; } void SetName( wxString aName ) { m_name = aName; }
std::unordered_set<BOARD_ITEM*>& GetItems()
{
return m_items;
}
const std::unordered_set<BOARD_ITEM*>& GetItems() const const std::unordered_set<BOARD_ITEM*>& GetItems() const
{ {
return m_items; return m_items;

View File

@ -254,7 +254,7 @@ public:
void SetHighContrastFactor( float aFactor ) { m_hiContrastFactor = aFactor; } void SetHighContrastFactor( float aFactor ) { m_hiContrastFactor = aFactor; }
// TODO: these can go away once the worksheet is moved to Cairo-based printing // TODO: these can go away once the worksheet is moved to Cairo-based printing
wxDC* GetPrintDC() { return m_printDC; } wxDC* GetPrintDC() const { return m_printDC; }
void SetPrintDC( wxDC* aDC ) { m_printDC = aDC; } void SetPrintDC( wxDC* aDC ) { m_printDC = aDC; }
protected: protected:

View File

@ -375,7 +375,7 @@ public:
* @return the quote_char as a single character string, or "" if the wrapee does not need * @return the quote_char as a single character string, or "" if the wrapee does not need
* to be wrapped. * to be wrapped.
*/ */
virtual const char* GetQuoteChar( const char* wrapee ); virtual const char* GetQuoteChar( const char* wrapee ) const;
/** /**
* Check \a aWrapee input string for a need to be quoted (e.g. contains a ')' character * Check \a aWrapee input string for a need to be quoted (e.g. contains a ')' character
@ -389,9 +389,9 @@ public:
* *
* @throw IO_ERROR, if there is any kind of problem with the input string. * @throw IO_ERROR, if there is any kind of problem with the input string.
*/ */
virtual std::string Quotes( const std::string& aWrapee ); virtual std::string Quotes( const std::string& aWrapee ) const;
std::string Quotew( const wxString& aWrapee ); std::string Quotew( const wxString& aWrapee ) const;
private: private:
std::vector<char> m_buffer; std::vector<char> m_buffer;

View File

@ -396,12 +396,12 @@ public:
* Indicate the event should restart/end an ongoing interactive tool's event loop (eg esc * Indicate the event should restart/end an ongoing interactive tool's event loop (eg esc
* key, click cancel, start different tool). * key, click cancel, start different tool).
*/ */
bool IsCancelInteractive(); bool IsCancelInteractive() const;
/** /**
* Indicate an selection-changed notification event. * Indicate an selection-changed notification event.
*/ */
bool IsSelectionEvent(); bool IsSelectionEvent() const;
/** /**
* Indicate if the event is from one of the point editors. * Indicate if the event is from one of the point editors.
@ -409,14 +409,14 @@ public:
* Usually used to allow the point editor to activate itself without de-activating the * Usually used to allow the point editor to activate itself without de-activating the
* current drawing tool. * current drawing tool.
*/ */
bool IsPointEditor(); bool IsPointEditor() const;
/** /**
* Indicate if the event is from one of the move tools. * Indicate if the event is from one of the move tools.
* *
* Usually used to allow move to be done without de-activating the current drawing tool. * Usually used to allow move to be done without de-activating the current drawing tool.
*/ */
bool IsMoveTool(); bool IsMoveTool() const;
/** /**
* Return a non-standard parameter assigned to the event. Its meaning depends on the * Return a non-standard parameter assigned to the event. Its meaning depends on the

View File

@ -656,6 +656,11 @@ public:
return m_polys[aIndex][0]; return m_polys[aIndex][0];
} }
const SHAPE_LINE_CHAIN& Outline( int aIndex ) const
{
return m_polys[aIndex][0];
}
/** /**
* Function Subset * Function Subset
* returns a subset of the polygons in this set, the ones between aFirstPolygon and * returns a subset of the polygons in this set, the ones between aFirstPolygon and

View File

@ -134,7 +134,7 @@ public:
} }
} }
wxArrayString GetRegList() wxArrayString GetRegList() const
{ {
wxArrayString list; wxArrayString list;
for( unsigned ii = 0; ii < m_List.size(); ii++ ) for( unsigned ii = 0; ii < m_List.size(); ii++ )

View File

@ -34,7 +34,7 @@ extern double DoubleFromString( const wxString& TextValue );
// A helper function to find the choice in a list of values // A helper function to find the choice in a list of values
// return true if a index in aList that matches aValue is found. // return true if a index in aList that matches aValue is found.
static bool findMatch(wxArrayString& aList, wxString& aValue, int& aIdx ) static bool findMatch(wxArrayString& aList, const wxString& aValue, int& aIdx )
{ {
bool success = false; bool success = false;
// Find the previous choice index: // Find the previous choice index:

View File

@ -264,14 +264,14 @@ public:
* *
* @return what the board is being used for * @return what the board is being used for
*/ */
BOARD_USE GetBoardUse() { return m_boardUse; } BOARD_USE GetBoardUse() const { return m_boardUse; }
/** /**
* Find out if the board is being used to hold a single footprint for editing/viewing. * Find out if the board is being used to hold a single footprint for editing/viewing.
* *
* @return if the board is just holding a footprint * @return if the board is just holding a footprint
*/ */
bool IsFootprintHolder() bool IsFootprintHolder() const
{ {
return m_boardUse == BOARD_USE::FPHOLDER; return m_boardUse == BOARD_USE::FPHOLDER;
} }
@ -293,6 +293,7 @@ public:
const ZONES& Zones() const { return m_zones; } const ZONES& Zones() const { return m_zones; }
MARKERS& Markers() { return m_markers; } MARKERS& Markers() { return m_markers; }
const MARKERS& Markers() const { return m_markers; }
/** /**
* The groups must maintain the following invariants. These are checked by * The groups must maintain the following invariants. These are checked by
@ -303,6 +304,7 @@ public:
* - The graph of groups containing subgroups must be acyclic. * - The graph of groups containing subgroups must be acyclic.
*/ */
GROUPS& Groups() { return m_groups; } GROUPS& Groups() { return m_groups; }
const GROUPS& Groups() const { return m_groups; }
const std::vector<BOARD_CONNECTED_ITEM*> AllConnectedItems(); const std::vector<BOARD_CONNECTED_ITEM*> AllConnectedItems();
@ -591,6 +593,7 @@ public:
void SetPlotOptions( const PCB_PLOT_PARAMS& aOptions ) { m_plotOptions = aOptions; } void SetPlotOptions( const PCB_PLOT_PARAMS& aOptions ) { m_plotOptions = aOptions; }
TITLE_BLOCK& GetTitleBlock() { return m_titles; } TITLE_BLOCK& GetTitleBlock() { return m_titles; }
const TITLE_BLOCK& GetTitleBlock() const { return m_titles; }
void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) { m_titles = aTitleBlock; } void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) { m_titles = aTitleBlock; }
wxString GetSelectMenuText( EDA_UNITS aUnits ) const override; wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;

View File

@ -442,7 +442,7 @@ bool BOARD_STACKUP::SynchronizeWithBoard( BOARD_DESIGN_SETTINGS* aSettings )
{ {
bool found = false; bool found = false;
// Search for initial settings: // Search for initial settings:
for( BOARD_STACKUP_ITEM* initial_item: m_list ) for( const BOARD_STACKUP_ITEM* initial_item : m_list )
{ {
if( item->GetBrdLayerId() != UNDEFINED_LAYER ) if( item->GetBrdLayerId() != UNDEFINED_LAYER )
{ {
@ -488,7 +488,7 @@ bool BOARD_STACKUP::SynchronizeWithBoard( BOARD_DESIGN_SETTINGS* aSettings )
} }
void BOARD_STACKUP::BuildDefaultStackupList( BOARD_DESIGN_SETTINGS* aSettings, void BOARD_STACKUP::BuildDefaultStackupList( const BOARD_DESIGN_SETTINGS* aSettings,
int aActiveCopperLayersCount ) int aActiveCopperLayersCount )
{ {
// Creates a default stackup, according to the current BOARD_DESIGN_SETTINGS settings. // Creates a default stackup, according to the current BOARD_DESIGN_SETTINGS settings.
@ -605,8 +605,7 @@ void BOARD_STACKUP::BuildDefaultStackupList( BOARD_DESIGN_SETTINGS* aSettings,
// Transfer other stackup settings from aSettings // Transfer other stackup settings from aSettings
if( aSettings ) if( aSettings )
{ {
BOARD_STACKUP& source_stackup = aSettings->GetStackupDescriptor(); const BOARD_STACKUP& source_stackup = aSettings->GetStackupDescriptor();
m_HasDielectricConstrains = source_stackup.m_HasDielectricConstrains;
m_EdgeConnectorConstraints = source_stackup.m_EdgeConnectorConstraints; m_EdgeConnectorConstraints = source_stackup.m_EdgeConnectorConstraints;
m_CastellatedPads = source_stackup.m_CastellatedPads; m_CastellatedPads = source_stackup.m_CastellatedPads;
m_EdgePlating = source_stackup.m_EdgePlating; m_EdgePlating = source_stackup.m_EdgePlating;
@ -616,7 +615,7 @@ void BOARD_STACKUP::BuildDefaultStackupList( BOARD_DESIGN_SETTINGS* aSettings,
void BOARD_STACKUP::FormatBoardStackup( OUTPUTFORMATTER* aFormatter, void BOARD_STACKUP::FormatBoardStackup( OUTPUTFORMATTER* aFormatter,
BOARD* aBoard, int aNestLevel ) const const BOARD* aBoard, int aNestLevel ) const
{ {
// Board stackup is the ordered list from top to bottom of // Board stackup is the ordered list from top to bottom of
// physical layers and substrate used to build the board. // physical layers and substrate used to build the board.

View File

@ -292,7 +292,7 @@ public:
* of copper layers to use to calculate a default dielectric thickness. * of copper layers to use to calculate a default dielectric thickness.
* ((<= 0 to use all copper layers) * ((<= 0 to use all copper layers)
*/ */
void BuildDefaultStackupList( BOARD_DESIGN_SETTINGS* aSettings, void BuildDefaultStackupList( const BOARD_DESIGN_SETTINGS* aSettings,
int aActiveCopperLayersCount = 0 ); int aActiveCopperLayersCount = 0 );
/** /**
@ -302,7 +302,7 @@ public:
* @param aNestLevel is the index to nest level to indent the lines in file * @param aNestLevel is the index to nest level to indent the lines in file
*/ */
void FormatBoardStackup( OUTPUTFORMATTER* aFormatter, void FormatBoardStackup( OUTPUTFORMATTER* aFormatter,
BOARD* aBoard, int aNestLevel ) const; const BOARD* aBoard, int aNestLevel ) const;
}; };

View File

@ -335,7 +335,7 @@ int PANEL_SETUP_BOARD_STACKUP::GetPcbThickness()
void PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard( bool aFullSync ) void PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard( bool aFullSync )
{ {
BOARD_STACKUP& brd_stackup = m_brdSettings->GetStackupDescriptor(); const BOARD_STACKUP& brd_stackup = m_brdSettings->GetStackupDescriptor();
if( aFullSync ) if( aFullSync )
{ {
@ -813,7 +813,7 @@ void PANEL_SETUP_BOARD_STACKUP::buildLayerStackPanel( bool aCreatedInitialStacku
// but if the number of layer is changed in the dialog, the corresponding // but if the number of layer is changed in the dialog, the corresponding
// widgets will be available with their previous values. // widgets will be available with their previous values.
m_stackup.BuildDefaultStackupList( nullptr, m_brdSettings->GetCopperLayerCount() ); m_stackup.BuildDefaultStackupList( nullptr, m_brdSettings->GetCopperLayerCount() );
BOARD_STACKUP& brd_stackup = m_brdSettings->GetStackupDescriptor(); const BOARD_STACKUP& brd_stackup = m_brdSettings->GetStackupDescriptor();
// Now initialize all stackup items to the board values, when exist // Now initialize all stackup items to the board values, when exist
for( BOARD_STACKUP_ITEM* item: m_stackup.GetList() ) for( BOARD_STACKUP_ITEM* item: m_stackup.GetList() )

View File

@ -167,7 +167,7 @@ private:
return m_padStacks.back(); return m_padStacks.back();
} }
const std::string formatPadShape( HYPERLYNX_PAD_STACK& aStack ) const std::string formatPadShape( const HYPERLYNX_PAD_STACK& aStack )
{ {
int shapeId = 0; int shapeId = 0;
char buf[1024]; char buf[1024];
@ -334,7 +334,7 @@ bool HYPERLYNX_EXPORTER::writeStackupInfo()
LSEQ layers = m_board->GetDesignSettings().GetEnabledLayers().CuStack(); LSEQ layers = m_board->GetDesignSettings().GetEnabledLayers().CuStack();
// Get the board physical stackup structure // Get the board physical stackup structure
BOARD_STACKUP& stackup = m_board->GetDesignSettings().GetStackupDescriptor(); const BOARD_STACKUP& stackup = m_board->GetDesignSettings().GetStackupDescriptor();
m_out->Print( 0, "{STACKUP\n" ); m_out->Print( 0, "{STACKUP\n" );

View File

@ -280,7 +280,7 @@ void GERBER_JOBFILE_WRITER::addJSONGeneralSpecs()
mapValue( m_pcb->GetDesignSettings().GetBoardThickness() ); mapValue( m_pcb->GetDesignSettings().GetBoardThickness() );
// Copper finish // Copper finish
BOARD_STACKUP brd_stackup = m_pcb->GetDesignSettings().GetStackupDescriptor(); const BOARD_STACKUP brd_stackup = m_pcb->GetDesignSettings().GetStackupDescriptor();
if( !brd_stackup.m_FinishType.IsEmpty() ) if( !brd_stackup.m_FinishType.IsEmpty() )
m_json["GeneralSpecs"]["Finish"] = brd_stackup.m_FinishType; m_json["GeneralSpecs"]["Finish"] = brd_stackup.m_FinishType;

View File

@ -105,7 +105,7 @@ public:
* @return force the text rotation to be always between -90 .. 90 deg. Otherwise the text is not easy to read * @return force the text rotation to be always between -90 .. 90 deg. Otherwise the text is not easy to read
* if false, the text rotation is free. * if false, the text rotation is free.
*/ */
bool IsKeepUpright() bool IsKeepUpright() const
{ {
return m_keepUpright; return m_keepUpright;
} }

View File

@ -384,64 +384,64 @@ BOARD_ITEM* PCB_IO::Parse( const wxString& aClipboardSourceInput )
} }
void PCB_IO::Format( BOARD_ITEM* aItem, int aNestLevel ) const void PCB_IO::Format( const BOARD_ITEM* aItem, int aNestLevel ) const
{ {
LOCALE_IO toggle; // public API function, perform anything convenient for caller LOCALE_IO toggle; // public API function, perform anything convenient for caller
switch( aItem->Type() ) switch( aItem->Type() )
{ {
case PCB_T: case PCB_T:
format( static_cast<BOARD*>( aItem ), aNestLevel ); format( static_cast<const BOARD*>( aItem ), aNestLevel );
break; break;
case PCB_DIM_ALIGNED_T: case PCB_DIM_ALIGNED_T:
case PCB_DIM_CENTER_T: case PCB_DIM_CENTER_T:
case PCB_DIM_ORTHOGONAL_T: case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T: case PCB_DIM_LEADER_T:
format( static_cast<DIMENSION_BASE*>( aItem ), aNestLevel ); format( static_cast<const DIMENSION_BASE*>( aItem ), aNestLevel );
break; break;
case PCB_SHAPE_T: case PCB_SHAPE_T:
format( static_cast<PCB_SHAPE*>( aItem ), aNestLevel ); format( static_cast<const PCB_SHAPE*>( aItem ), aNestLevel );
break; break;
case PCB_FP_SHAPE_T: case PCB_FP_SHAPE_T:
format( static_cast<FP_SHAPE*>( aItem ), aNestLevel ); format( static_cast<const FP_SHAPE*>( aItem ), aNestLevel );
break; break;
case PCB_TARGET_T: case PCB_TARGET_T:
format( static_cast<PCB_TARGET*>( aItem ), aNestLevel ); format( static_cast<const PCB_TARGET*>( aItem ), aNestLevel );
break; break;
case PCB_FOOTPRINT_T: case PCB_FOOTPRINT_T:
format( static_cast<FOOTPRINT*>( aItem ), aNestLevel ); format( static_cast<const FOOTPRINT*>( aItem ), aNestLevel );
break; break;
case PCB_PAD_T: case PCB_PAD_T:
format( static_cast<PAD*>( aItem ), aNestLevel ); format( static_cast<const PAD*>( aItem ), aNestLevel );
break; break;
case PCB_TEXT_T: case PCB_TEXT_T:
format( static_cast<PCB_TEXT*>( aItem ), aNestLevel ); format( static_cast<const PCB_TEXT*>( aItem ), aNestLevel );
break; break;
case PCB_FP_TEXT_T: case PCB_FP_TEXT_T:
format( static_cast<FP_TEXT*>( aItem ), aNestLevel ); format( static_cast<const FP_TEXT*>( aItem ), aNestLevel );
break; break;
case PCB_GROUP_T: case PCB_GROUP_T:
format( static_cast<PCB_GROUP*>( aItem ), aNestLevel ); format( static_cast<const PCB_GROUP*>( aItem ), aNestLevel );
break; break;
case PCB_TRACE_T: case PCB_TRACE_T:
case PCB_ARC_T: case PCB_ARC_T:
case PCB_VIA_T: case PCB_VIA_T:
format( static_cast<TRACK*>( aItem ), aNestLevel ); format( static_cast<const TRACK*>( aItem ), aNestLevel );
break; break;
case PCB_FP_ZONE_T: case PCB_FP_ZONE_T:
case PCB_ZONE_T: case PCB_ZONE_T:
format( static_cast<ZONE*>( aItem ), aNestLevel ); format( static_cast<const ZONE*>( aItem ), aNestLevel );
break; break;
default: default:
@ -458,13 +458,13 @@ void PCB_IO::formatLayer( const BOARD_ITEM* aItem ) const
} }
void PCB_IO::formatSetup( BOARD* aBoard, int aNestLevel ) const void PCB_IO::formatSetup( const BOARD* aBoard, int aNestLevel ) const
{ {
// Setup // Setup
m_out->Print( aNestLevel, "(setup\n" ); m_out->Print( aNestLevel, "(setup\n" );
// Save the board physical stackup structure // Save the board physical stackup structure
BOARD_STACKUP& stackup = aBoard->GetDesignSettings().GetStackupDescriptor(); const BOARD_STACKUP& stackup = aBoard->GetDesignSettings().GetStackupDescriptor();
if( aBoard->GetDesignSettings().m_HasStackup ) if( aBoard->GetDesignSettings().m_HasStackup )
stackup.FormatBoardStackup( m_out, aBoard, aNestLevel+1 ); stackup.FormatBoardStackup( m_out, aBoard, aNestLevel+1 );
@ -487,7 +487,7 @@ void PCB_IO::formatSetup( BOARD* aBoard, int aNestLevel ) const
} }
void PCB_IO::formatGeneral( BOARD* aBoard, int aNestLevel ) const void PCB_IO::formatGeneral( const BOARD* aBoard, int aNestLevel ) const
{ {
const BOARD_DESIGN_SETTINGS& dsnSettings = aBoard->GetDesignSettings(); const BOARD_DESIGN_SETTINGS& dsnSettings = aBoard->GetDesignSettings();
@ -503,7 +503,7 @@ void PCB_IO::formatGeneral( BOARD* aBoard, int aNestLevel ) const
} }
void PCB_IO::formatBoardLayers( BOARD* aBoard, int aNestLevel ) const void PCB_IO::formatBoardLayers( const BOARD* aBoard, int aNestLevel ) const
{ {
m_out->Print( aNestLevel, "(layers\n" ); m_out->Print( aNestLevel, "(layers\n" );
@ -573,7 +573,7 @@ void PCB_IO::formatBoardLayers( BOARD* aBoard, int aNestLevel ) const
} }
void PCB_IO::formatNetInformation( BOARD* aBoard, int aNestLevel ) const void PCB_IO::formatNetInformation( const BOARD* aBoard, int aNestLevel ) const
{ {
for( NETINFO_ITEM* net : *m_mapping ) for( NETINFO_ITEM* net : *m_mapping )
{ {
@ -589,7 +589,7 @@ void PCB_IO::formatNetInformation( BOARD* aBoard, int aNestLevel ) const
} }
void PCB_IO::formatProperties( BOARD* aBoard, int aNestLevel ) const void PCB_IO::formatProperties( const BOARD* aBoard, int aNestLevel ) const
{ {
for( const std::pair<const wxString, wxString>& prop : aBoard->GetProperties() ) for( const std::pair<const wxString, wxString>& prop : aBoard->GetProperties() )
{ {
@ -602,7 +602,7 @@ void PCB_IO::formatProperties( BOARD* aBoard, int aNestLevel ) const
} }
void PCB_IO::formatHeader( BOARD* aBoard, int aNestLevel ) const void PCB_IO::formatHeader( const BOARD* aBoard, int aNestLevel ) const
{ {
formatGeneral( aBoard, aNestLevel ); formatGeneral( aBoard, aNestLevel );
// Layers list. // Layers list.
@ -619,7 +619,7 @@ void PCB_IO::formatHeader( BOARD* aBoard, int aNestLevel ) const
} }
void PCB_IO::format( BOARD* aBoard, int aNestLevel ) const void PCB_IO::format( const BOARD* aBoard, int aNestLevel ) const
{ {
std::set<BOARD_ITEM*, BOARD_ITEM::ptr_cmp> sorted_footprints( aBoard->Footprints().begin(), std::set<BOARD_ITEM*, BOARD_ITEM::ptr_cmp> sorted_footprints( aBoard->Footprints().begin(),
aBoard->Footprints().end() ); aBoard->Footprints().end() );
@ -667,12 +667,12 @@ void PCB_IO::format( BOARD* aBoard, int aNestLevel ) const
} }
void PCB_IO::format( DIMENSION_BASE* aDimension, int aNestLevel ) const void PCB_IO::format( const DIMENSION_BASE* aDimension, int aNestLevel ) const
{ {
ALIGNED_DIMENSION* aligned = dynamic_cast<ALIGNED_DIMENSION*>( aDimension ); const ALIGNED_DIMENSION* aligned = dynamic_cast<const ALIGNED_DIMENSION*>( aDimension );
ORTHOGONAL_DIMENSION* ortho = dynamic_cast<ORTHOGONAL_DIMENSION*>( aDimension ); const ORTHOGONAL_DIMENSION* ortho = dynamic_cast<const ORTHOGONAL_DIMENSION*>( aDimension );
CENTER_DIMENSION* center = dynamic_cast<CENTER_DIMENSION*>( aDimension ); const CENTER_DIMENSION* center = dynamic_cast<const CENTER_DIMENSION*>( aDimension );
LEADER* leader = dynamic_cast<LEADER*>( aDimension ); const LEADER* leader = dynamic_cast<const LEADER*>( aDimension );
m_out->Print( aNestLevel, "(dimension" ); m_out->Print( aNestLevel, "(dimension" );
@ -759,7 +759,7 @@ void PCB_IO::format( DIMENSION_BASE* aDimension, int aNestLevel ) const
} }
void PCB_IO::format( PCB_SHAPE* aShape, int aNestLevel ) const void PCB_IO::format( const PCB_SHAPE* aShape, int aNestLevel ) const
{ {
switch( aShape->GetShape() ) switch( aShape->GetShape() )
{ {
@ -795,9 +795,9 @@ void PCB_IO::format( PCB_SHAPE* aShape, int aNestLevel ) const
case S_POLYGON: // Polygon case S_POLYGON: // Polygon
if( aShape->IsPolyShapeValid() ) if( aShape->IsPolyShapeValid() )
{ {
SHAPE_POLY_SET& poly = aShape->GetPolyShape(); const SHAPE_POLY_SET& poly = aShape->GetPolyShape();
SHAPE_LINE_CHAIN& outline = poly.Outline( 0 ); const SHAPE_LINE_CHAIN& outline = poly.Outline( 0 );
int pointsCount = outline.PointCount(); const int pointsCount = outline.PointCount();
m_out->Print( aNestLevel, "(gr_poly (pts\n" ); m_out->Print( aNestLevel, "(gr_poly (pts\n" );
@ -862,7 +862,7 @@ void PCB_IO::format( PCB_SHAPE* aShape, int aNestLevel ) const
} }
void PCB_IO::format( FP_SHAPE* aFPShape, int aNestLevel ) const void PCB_IO::format( const FP_SHAPE* aFPShape, int aNestLevel ) const
{ {
switch( aFPShape->GetShape() ) switch( aFPShape->GetShape() )
{ {
@ -894,8 +894,8 @@ void PCB_IO::format( FP_SHAPE* aFPShape, int aNestLevel ) const
case S_POLYGON: // Polygonal segment case S_POLYGON: // Polygonal segment
if( aFPShape->IsPolyShapeValid() ) if( aFPShape->IsPolyShapeValid() )
{ {
SHAPE_POLY_SET& poly = aFPShape->GetPolyShape(); const SHAPE_POLY_SET& poly = aFPShape->GetPolyShape();
SHAPE_LINE_CHAIN& outline = poly.Outline( 0 ); const SHAPE_LINE_CHAIN& outline = poly.Outline( 0 );
int pointsCount = outline.PointCount(); int pointsCount = outline.PointCount();
m_out->Print( aNestLevel, "(fp_poly (pts" ); m_out->Print( aNestLevel, "(fp_poly (pts" );
@ -960,7 +960,7 @@ void PCB_IO::format( FP_SHAPE* aFPShape, int aNestLevel ) const
} }
void PCB_IO::format( PCB_TARGET* aTarget, int aNestLevel ) const void PCB_IO::format( const PCB_TARGET* aTarget, int aNestLevel ) const
{ {
m_out->Print( aNestLevel, "(target %s (at %s) (size %s)", m_out->Print( aNestLevel, "(target %s (at %s) (size %s)",
( aTarget->GetShape() ) ? "x" : "plus", ( aTarget->GetShape() ) ? "x" : "plus",
@ -978,7 +978,7 @@ void PCB_IO::format( PCB_TARGET* aTarget, int aNestLevel ) const
} }
void PCB_IO::format( FOOTPRINT* aFootprint, int aNestLevel ) const void PCB_IO::format( const FOOTPRINT* aFootprint, int aNestLevel ) const
{ {
if( !( m_ctl & CTL_OMIT_INITIAL_COMMENTS ) ) if( !( m_ctl & CTL_OMIT_INITIAL_COMMENTS ) )
{ {
@ -1262,7 +1262,7 @@ void PCB_IO::formatLayers( LSET aLayerMask, int aNestLevel ) const
} }
void PCB_IO::format( PAD* aPad, int aNestLevel ) const void PCB_IO::format( const PAD* aPad, int aNestLevel ) const
{ {
const char* shape; const char* shape;
@ -1572,7 +1572,7 @@ void PCB_IO::format( PAD* aPad, int aNestLevel ) const
} }
void PCB_IO::format( PCB_TEXT* aText, int aNestLevel ) const void PCB_IO::format( const PCB_TEXT* aText, int aNestLevel ) const
{ {
m_out->Print( aNestLevel, "(gr_text %s (at %s", m_out->Print( aNestLevel, "(gr_text %s (at %s",
m_out->Quotew( aText->GetText() ).c_str(), m_out->Quotew( aText->GetText() ).c_str(),
@ -1595,7 +1595,7 @@ void PCB_IO::format( PCB_TEXT* aText, int aNestLevel ) const
} }
void PCB_IO::format( PCB_GROUP* aGroup, int aNestLevel ) const void PCB_IO::format( const PCB_GROUP* aGroup, int aNestLevel ) const
{ {
// Don't write empty groups // Don't write empty groups
if( aGroup->GetItems().empty() ) if( aGroup->GetItems().empty() )
@ -1622,7 +1622,7 @@ void PCB_IO::format( PCB_GROUP* aGroup, int aNestLevel ) const
} }
void PCB_IO::format( FP_TEXT* aText, int aNestLevel ) const void PCB_IO::format( const FP_TEXT* aText, int aNestLevel ) const
{ {
std::string type; std::string type;
@ -1684,7 +1684,7 @@ void PCB_IO::format( FP_TEXT* aText, int aNestLevel ) const
} }
void PCB_IO::format( TRACK* aTrack, int aNestLevel ) const void PCB_IO::format( const TRACK* aTrack, int aNestLevel ) const
{ {
if( aTrack->Type() == PCB_VIA_T ) if( aTrack->Type() == PCB_VIA_T )
{ {
@ -1772,7 +1772,7 @@ void PCB_IO::format( TRACK* aTrack, int aNestLevel ) const
} }
void PCB_IO::format( ZONE* aZone, int aNestLevel ) const void PCB_IO::format( const ZONE* aZone, int aNestLevel ) const
{ {
// Save the NET info; For keepout zones, net code and net name are irrelevant // Save the NET info; For keepout zones, net code and net name are irrelevant
// so be sure a dummy value is stored, just for ZONE compatibility // so be sure a dummy value is stored, just for ZONE compatibility
@ -1934,7 +1934,7 @@ void PCB_IO::format( ZONE* aZone, int aNestLevel ) const
bool new_polygon = true; bool new_polygon = true;
bool is_closed = false; bool is_closed = false;
for( auto iterator = aZone->IterateWithHoles(); iterator; iterator++ ) for( auto iterator = aZone->CIterateWithHoles(); iterator; ++iterator )
{ {
if( new_polygon ) if( new_polygon )
{ {

View File

@ -193,7 +193,7 @@ public:
* @param aNestLevel The indentation nest level. * @param aNestLevel The indentation nest level.
* @throw IO_ERROR on write error. * @throw IO_ERROR on write error.
*/ */
void Format( BOARD_ITEM* aItem, int aNestLevel = 0 ) const; void Format( const BOARD_ITEM* aItem, int aNestLevel = 0 ) const;
std::string GetStringOutput( bool doClear ) std::string GetStringOutput( bool doClear )
{ {
@ -218,47 +218,47 @@ protected:
void init( const PROPERTIES* aProperties ); void init( const PROPERTIES* aProperties );
/// formats the board setup information /// formats the board setup information
void formatSetup( BOARD* aBoard, int aNestLevel = 0 ) const; void formatSetup( const BOARD* aBoard, int aNestLevel = 0 ) const;
/// formats the General section of the file /// formats the General section of the file
void formatGeneral( BOARD* aBoard, int aNestLevel = 0 ) const; void formatGeneral( const BOARD* aBoard, int aNestLevel = 0 ) const;
/// formats the board layer information /// formats the board layer information
void formatBoardLayers( BOARD* aBoard, int aNestLevel = 0 ) const; void formatBoardLayers( const BOARD* aBoard, int aNestLevel = 0 ) const;
/// formats the Nets and Netclasses /// formats the Nets and Netclasses
void formatNetInformation( BOARD* aBoard, int aNestLevel = 0 ) const; void formatNetInformation( const BOARD* aBoard, int aNestLevel = 0 ) const;
/// formats the Nets and Netclasses /// formats the Nets and Netclasses
void formatProperties( BOARD* aBoard, int aNestLevel = 0 ) const; void formatProperties( const BOARD* aBoard, int aNestLevel = 0 ) const;
/// writes everything that comes before the board_items, like settings and layers etc /// writes everything that comes before the board_items, like settings and layers etc
void formatHeader( BOARD* aBoard, int aNestLevel = 0 ) const; void formatHeader( const BOARD* aBoard, int aNestLevel = 0 ) const;
private: private:
void format( BOARD* aBoard, int aNestLevel = 0 ) const; void format( const BOARD* aBoard, int aNestLevel = 0 ) const;
void format( DIMENSION_BASE* aDimension, int aNestLevel = 0 ) const; void format( const DIMENSION_BASE* aDimension, int aNestLevel = 0 ) const;
void format( FP_SHAPE* aFPShape, int aNestLevel = 0 ) const; void format( const FP_SHAPE* aFPShape, int aNestLevel = 0 ) const;
void format( PCB_GROUP* aGroup, int aNestLevel = 0 ) const; void format( const PCB_GROUP* aGroup, int aNestLevel = 0 ) const;
void format( PCB_SHAPE* aSegment, int aNestLevel = 0 ) const; void format( const PCB_SHAPE* aSegment, int aNestLevel = 0 ) const;
void format( PCB_TARGET* aTarget, int aNestLevel = 0 ) const; void format( const PCB_TARGET* aTarget, int aNestLevel = 0 ) const;
void format( FOOTPRINT* aFootprint, int aNestLevel = 0 ) const; void format( const FOOTPRINT* aFootprint, int aNestLevel = 0 ) const;
void format( PAD* aPad, int aNestLevel = 0 ) const; void format( const PAD* aPad, int aNestLevel = 0 ) const;
void format( PCB_TEXT* aText, int aNestLevel = 0 ) const; void format( const PCB_TEXT* aText, int aNestLevel = 0 ) const;
void format( FP_TEXT* aText, int aNestLevel = 0 ) const; void format( const FP_TEXT* aText, int aNestLevel = 0 ) const;
void format( TRACK* aTrack, int aNestLevel = 0 ) const; void format( const TRACK* aTrack, int aNestLevel = 0 ) const;
void format( ZONE* aZone, int aNestLevel = 0 ) const; void format( const ZONE* aZone, int aNestLevel = 0 ) const;
void formatLayer( const BOARD_ITEM* aItem ) const; void formatLayer( const BOARD_ITEM* aItem ) const;

View File

@ -1122,7 +1122,7 @@ void ZONE::CacheTriangulation( PCB_LAYER_ID aLayer )
} }
bool ZONE::IsIsland( PCB_LAYER_ID aLayer, int aPolyIdx ) bool ZONE::IsIsland( PCB_LAYER_ID aLayer, int aPolyIdx ) const
{ {
if( GetNetCode() < 1 ) if( GetNetCode() < 1 )
return true; return true;

View File

@ -321,7 +321,7 @@ public:
} }
SHAPE_POLY_SET* Outline() { return m_Poly; } SHAPE_POLY_SET* Outline() { return m_Poly; }
const SHAPE_POLY_SET* Outline() const { return const_cast< SHAPE_POLY_SET* >( m_Poly ); } const SHAPE_POLY_SET* Outline() const { return m_Poly; }
void SetOutline( SHAPE_POLY_SET* aOutline ) { m_Poly = aOutline; } void SetOutline( SHAPE_POLY_SET* aOutline ) { m_Poly = aOutline; }
@ -687,7 +687,7 @@ public:
* @param aPolyIdx is an inndex into m_FilledPolysList[aLayer] * @param aPolyIdx is an inndex into m_FilledPolysList[aLayer]
* @return true if the given polygon is insulated (i.e. has no net connection) * @return true if the given polygon is insulated (i.e. has no net connection)
*/ */
bool IsIsland( PCB_LAYER_ID aLayer, int aPolyIdx ); bool IsIsland( PCB_LAYER_ID aLayer, int aPolyIdx ) const;
void SetIsIsland( PCB_LAYER_ID aLayer, int aPolyIdx ) void SetIsIsland( PCB_LAYER_ID aLayer, int aPolyIdx )
{ {

View File

@ -376,7 +376,7 @@ IDF_DRILL_DATA::IDF_DRILL_DATA( double aDrillDia, double aPosX, double aPosY,
owner = aOwner; owner = aOwner;
} // IDF_DRILL_DATA::IDF_DRILL_DATA( ... ) } // IDF_DRILL_DATA::IDF_DRILL_DATA( ... )
bool IDF_DRILL_DATA::Matches( double aDrillDia, double aPosX, double aPosY ) bool IDF_DRILL_DATA::Matches( double aDrillDia, double aPosX, double aPosY ) const
{ {
double ddia = aDrillDia - dia; double ddia = aDrillDia - dia;
IDF_POINT p1, p2; IDF_POINT p1, p2;
@ -717,17 +717,17 @@ void IDF_DRILL_DATA::write( std::ostream& aBoardFile, IDF3::IDF_UNIT aBoardUnit
} // IDF_DRILL_DATA::Write( aBoardFile, unitMM ) } // IDF_DRILL_DATA::Write( aBoardFile, unitMM )
double IDF_DRILL_DATA::GetDrillDia() double IDF_DRILL_DATA::GetDrillDia() const
{ {
return dia; return dia;
} }
double IDF_DRILL_DATA::GetDrillXPos() double IDF_DRILL_DATA::GetDrillXPos() const
{ {
return x; return x;
} }
double IDF_DRILL_DATA::GetDrillYPos() double IDF_DRILL_DATA::GetDrillYPos() const
{ {
return y; return y;
} }
@ -793,7 +793,7 @@ void IDF3::PrintSeg( IDF_SEGMENT* aSegment )
#endif #endif
bool IDF_POINT::Matches( const IDF_POINT& aPoint, double aRadius ) bool IDF_POINT::Matches( const IDF_POINT& aPoint, double aRadius ) const
{ {
double dx = x - aPoint.x; double dx = x - aPoint.x;
double dy = y - aPoint.y; double dy = y - aPoint.y;

View File

@ -414,25 +414,25 @@ public:
* *
* @return bool: true if the diameter and position match this object * @return bool: true if the diameter and position match this object
*/ */
bool Matches( double aDrillDia, double aPosX, double aPosY ); bool Matches( double aDrillDia, double aPosX, double aPosY ) const;
/** /**
* Function GettDrillDia * Function GettDrillDia
* returns the drill diameter in mm * returns the drill diameter in mm
*/ */
double GetDrillDia(); double GetDrillDia() const;
/** /**
* Function GettDrillXPos * Function GettDrillXPos
* returns the drill's X position in mm * returns the drill's X position in mm
*/ */
double GetDrillXPos(); double GetDrillXPos() const;
/** /**
* Function GettDrillYPos * Function GettDrillYPos
* returns the drill's Y position in mm * returns the drill's Y position in mm
*/ */
double GetDrillYPos(); double GetDrillYPos() const;
/** /**
* Function GetDrillPlating * Function GetDrillPlating
@ -455,7 +455,7 @@ public:
*/ */
const std::string& GetDrillHoleType(); const std::string& GetDrillHoleType();
IDF3::KEY_OWNER GetDrillOwner() IDF3::KEY_OWNER GetDrillOwner() const
{ {
return owner; return owner;
} }
@ -494,7 +494,7 @@ public:
* *
* @return bool: true if this point matches the given point * @return bool: true if this point matches the given point
*/ */
bool Matches( const IDF_POINT& aPoint, double aRadius = 1e-5 ); bool Matches( const IDF_POINT& aPoint, double aRadius = 1e-5 ) const;
/** /**
* Function CalcDistance() * Function CalcDistance()