mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 10:51:41 +00:00
Add more const specifiers
This commit is contained in:
parent
ec0af24f13
commit
ac94d72d2d
common
eeschema
class_libentry.cppclass_libentry.hgenerate_alias_info.cppsch_bitmap.hsch_bus_entry.hsch_component.cppsch_component.hsch_draw_panel.cppsch_draw_panel.hsch_item.hsch_line.cppsch_line.hsch_painter.cppsch_painter.hsch_rtree.hsch_sheet.cppsch_sheet.hsch_view.cppsch_view.h
include
libs/kimath/include/geometry
pcb_calculator
pcbnew
utils/idftools
@ -362,12 +362,12 @@ 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 );
|
||||
}
|
||||
|
||||
int OUTPUTFORMATTER::vprint( const char* fmt, va_list ap )
|
||||
int OUTPUTFORMATTER::vprint( const char* fmt, va_list ap )
|
||||
{
|
||||
// This function can call vsnprintf twice.
|
||||
// But internally, vsnprintf retrieves arguments from the va_list identified by arg as if
|
||||
@ -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;
|
||||
|
||||
@ -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.
|
||||
// The non-virutal function calls the virtual workhorse function, and if
|
||||
|
@ -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()
|
||||
&& 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 )
|
||||
|| 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()
|
||||
&& 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()
|
||||
&& m_commandStr.get().find( "InteractiveMove" ) != GetCommandStr()->npos );
|
||||
|
@ -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 )
|
||||
{
|
||||
|
@ -122,6 +122,7 @@ public:
|
||||
|
||||
void SetParent( LIB_PART* aParent = nullptr );
|
||||
PART_REF& GetParent() { return m_parent; }
|
||||
const PART_REF& GetParent() const { return m_parent; }
|
||||
|
||||
virtual wxString GetClass() const override
|
||||
{
|
||||
@ -353,7 +354,7 @@ public:
|
||||
* if TYPE_NOT_INIT search for all items types
|
||||
* @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 ); }
|
||||
|
||||
@ -468,6 +469,7 @@ public:
|
||||
* @return LIB_ITEMS_CONTAINER& - Reference to the draw item object container.
|
||||
*/
|
||||
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;
|
||||
|
||||
|
@ -99,7 +99,7 @@ public:
|
||||
/**
|
||||
* Return the generated HTML.
|
||||
*/
|
||||
wxString GetHtml()
|
||||
wxString GetHtml() const
|
||||
{
|
||||
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 text = aField.GetFullText( m_unit > 0 ? m_unit : 1 );
|
||||
|
@ -56,7 +56,7 @@ public:
|
||||
|
||||
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." );
|
||||
return m_image;
|
||||
@ -122,7 +122,7 @@ public:
|
||||
* and false for items moved with no reference to anchor
|
||||
* @return false for a bus entry
|
||||
*/
|
||||
bool IsMovableFromAnchorPoint() override { return false; }
|
||||
bool IsMovableFromAnchorPoint() const override { return false; }
|
||||
|
||||
void MirrorY( int aYaxis_position ) override;
|
||||
void MirrorX( int aXaxis_position ) override;
|
||||
|
@ -56,7 +56,7 @@ public:
|
||||
* and false for items moved with no reference to anchor
|
||||
* @return false for a bus entry
|
||||
*/
|
||||
bool IsMovableFromAnchorPoint() override { return false; }
|
||||
bool IsMovableFromAnchorPoint() const override { return false; }
|
||||
|
||||
wxPoint GetEnd() const;
|
||||
|
||||
|
@ -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 )
|
||||
{
|
||||
@ -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 )
|
||||
m_part->GetPins( aPinsList, m_unit, m_convert );
|
||||
|
@ -182,7 +182,7 @@ public:
|
||||
*
|
||||
* @return true for a component
|
||||
*/
|
||||
bool IsMovableFromAnchorPoint() override { return true; }
|
||||
bool IsMovableFromAnchorPoint() const override { return true; }
|
||||
|
||||
void SetLibId( const LIB_ID& aName );
|
||||
|
||||
@ -204,6 +204,7 @@ public:
|
||||
bool UseLibIdLookup() const { return m_schLibSymbolName.IsEmpty(); }
|
||||
|
||||
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
|
||||
@ -269,7 +270,8 @@ public:
|
||||
|
||||
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 );
|
||||
|
||||
@ -467,14 +469,14 @@ public:
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @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 );
|
||||
|
||||
|
@ -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()->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();
|
||||
|
||||
|
@ -44,8 +44,8 @@ public:
|
||||
|
||||
~SCH_DRAW_PANEL();
|
||||
|
||||
void DisplayComponent( const LIB_PART *aComponent );
|
||||
void DisplaySheet( const SCH_SCREEN *aScreen );
|
||||
void DisplayComponent( LIB_PART *aComponent );
|
||||
void DisplaySheet( SCH_SCREEN *aScreen );
|
||||
|
||||
bool SwitchBackend( GAL_TYPE aGalType ) override;
|
||||
|
||||
|
@ -244,7 +244,7 @@ public:
|
||||
* Usually return true for small items (labels, junctions) and false for
|
||||
* items which can be large (hierarchical sheets, symbols)
|
||||
*/
|
||||
virtual bool IsMovableFromAnchorPoint() { return true; }
|
||||
virtual bool IsMovableFromAnchorPoint() const { return true; }
|
||||
|
||||
wxPoint& GetStoredPos() { return m_storedPos; }
|
||||
void SetStoredPos( wxPoint aPos ) { m_storedPos = aPos; }
|
||||
|
@ -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 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,
|
||||
wxT( "Cannot test line segment for overlap." ) );
|
||||
|
@ -201,9 +201,9 @@ public:
|
||||
* @param aPosition - Point to reference against lines
|
||||
* @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;
|
||||
|
||||
|
@ -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
|
||||
&& 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();
|
||||
|
||||
@ -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 );
|
||||
|
||||
@ -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() );
|
||||
|
||||
@ -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 ) );
|
||||
|
||||
@ -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() );
|
||||
|
||||
@ -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() );
|
||||
|
||||
@ -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(),
|
||||
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(),
|
||||
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 )
|
||||
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;
|
||||
|
||||
std::unique_ptr< LIB_PART > tmpPart;
|
||||
LIB_PART* drawnPart = aPart;
|
||||
const LIB_PART* drawnPart = aPart;
|
||||
|
||||
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 ) )
|
||||
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 ) )
|
||||
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 ) )
|
||||
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 ) )
|
||||
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;
|
||||
|
||||
@ -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 ) )
|
||||
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 ) )
|
||||
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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -1461,12 +1461,12 @@ void SCH_PAINTER::draw( SCH_COMPONENT *aSymbol, int aLayer )
|
||||
draw( &tempPart, aLayer, false, aSymbol->GetUnit(), aSymbol->GetConvert() );
|
||||
|
||||
// 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 );
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
|
||||
@ -1640,10 +1640,11 @@ void SCH_PAINTER::draw( SCH_HIERLABEL *aLabel, int aLayer )
|
||||
m_gal->SetStrokeColor( color );
|
||||
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;
|
||||
|
||||
@ -1705,13 +1706,13 @@ void SCH_PAINTER::draw( SCH_SHEET *aSheet, int aLayer )
|
||||
if( drawingShadows && !eeconfig()->m_Selection.draw_selected_children && aSheet->IsSelected() )
|
||||
return;
|
||||
|
||||
for( SCH_FIELD& field : aSheet->GetFields() )
|
||||
for( const SCH_FIELD& field : aSheet->GetFields() )
|
||||
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;
|
||||
|
||||
@ -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;
|
||||
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->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;
|
||||
|
||||
|
@ -96,7 +96,7 @@ public:
|
||||
m_layerColors[ LAYER_SCHEMATIC_BACKGROUND ] = aColor;
|
||||
}
|
||||
|
||||
float GetDanglineSymbolThickness()
|
||||
float GetDanglineSymbolThickness() const
|
||||
{
|
||||
return (float) m_defaultPenWidth / 3.0F;
|
||||
}
|
||||
@ -156,27 +156,27 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void draw( LIB_RECTANGLE* aRect, int aLayer );
|
||||
void draw( LIB_PIN* aPin, int aLayer );
|
||||
void draw( LIB_CIRCLE* aCircle, int aLayer );
|
||||
void draw( LIB_PART* aPart, int, bool aDrawFields = true, int aUnit = 0, int aConvert = 0 );
|
||||
void draw( LIB_ARC* aArc, int aLayer );
|
||||
void draw( LIB_POLYLINE* aLine, int aLayer );
|
||||
void draw( LIB_FIELD* aField, int aLayer );
|
||||
void draw( LIB_TEXT* aText, int aLayer );
|
||||
void draw( LIB_BEZIER* aCurve, int aLayer );
|
||||
void draw( const LIB_RECTANGLE* aRect, int aLayer );
|
||||
void draw( LIB_PIN* aPin, int aLayer );
|
||||
void draw( const LIB_CIRCLE* aCircle, int aLayer );
|
||||
void draw( const LIB_PART* aPart, int, bool aDrawFields = true, int aUnit = 0, int aConvert = 0 );
|
||||
void draw( const LIB_ARC* aArc, int aLayer );
|
||||
void draw( const LIB_POLYLINE* aLine, int aLayer );
|
||||
void draw( const LIB_FIELD* aField, int aLayer );
|
||||
void draw( const LIB_TEXT* aText, int aLayer );
|
||||
void draw( const LIB_BEZIER* aCurve, int aLayer );
|
||||
void draw( SCH_COMPONENT* aSymbol, int aLayer );
|
||||
void draw( SCH_JUNCTION* aJct, int aLayer );
|
||||
void draw( SCH_FIELD* aField, int aLayer );
|
||||
void draw( SCH_TEXT* aText, int aLayer );
|
||||
void draw( const SCH_JUNCTION* aJct, int aLayer );
|
||||
void draw( const SCH_FIELD* aField, int aLayer );
|
||||
void draw( const SCH_TEXT* aText, int aLayer );
|
||||
void draw( SCH_HIERLABEL* aLabel, int aLayer );
|
||||
void draw( SCH_GLOBALLABEL* aLabel, int aLayer );
|
||||
void draw( SCH_SHEET* aSheet, int aLayer );
|
||||
void draw( SCH_NO_CONNECT* aNC, int aLayer );
|
||||
void draw( SCH_MARKER* aMarker, int aLayer );
|
||||
void draw( SCH_BITMAP* aBitmap, int aLayer );
|
||||
void draw( SCH_LINE* aLine, int aLayer );
|
||||
void draw( SCH_BUS_ENTRY_BASE* aEntry, int aLayer );
|
||||
void draw( const SCH_SHEET* aSheet, int aLayer );
|
||||
void draw( const SCH_NO_CONNECT* aNC, int aLayer );
|
||||
void draw( const SCH_MARKER* aMarker, int aLayer );
|
||||
void draw( const SCH_BITMAP* aBitmap, int aLayer );
|
||||
void draw( const SCH_LINE* aLine, int aLayer );
|
||||
void draw( const SCH_BUS_ENTRY_BASE* aEntry, int aLayer );
|
||||
|
||||
void drawPinDanglingSymbol( const VECTOR2I& aPos, bool aDrawingShadows );
|
||||
void drawDanglingSymbol( const wxPoint& aPos, int aWidth, bool aDrawingShadows );
|
||||
@ -184,16 +184,16 @@ private:
|
||||
int internalPinDecoSize( 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();
|
||||
COLOR4D getRenderColor( const EDA_ITEM* aItem, int aLayer, bool aDrawingShadows );
|
||||
float getLineWidth( const LIB_ITEM* aItem, bool aDrawingShadows );
|
||||
float getLineWidth( const SCH_ITEM* aItem, bool aDrawingShadows );
|
||||
float getTextThickness( const SCH_TEXT* aItem, bool aDrawingShadows );
|
||||
float getTextThickness( const SCH_FIELD* aItem, bool aDrawingShadows );
|
||||
float getTextThickness( const LIB_FIELD* aItem, bool aDrawingShadows );
|
||||
float getTextThickness( const LIB_TEXT* aItem, bool aDrawingShadows );
|
||||
float getShadowWidth() const;
|
||||
COLOR4D getRenderColor( const EDA_ITEM* aItem, int aLayer, bool aDrawingShadows ) const;
|
||||
float getLineWidth( const LIB_ITEM* aItem, bool aDrawingShadows ) const;
|
||||
float getLineWidth( const SCH_ITEM* aItem, bool aDrawingShadows ) const;
|
||||
float getTextThickness( const SCH_TEXT* aItem, bool aDrawingShadows ) const;
|
||||
float getTextThickness( const SCH_FIELD* aItem, bool aDrawingShadows ) const;
|
||||
float getTextThickness( const LIB_FIELD* aItem, bool aDrawingShadows ) const;
|
||||
float getTextThickness( const LIB_TEXT* aItem, bool aDrawingShadows ) const;
|
||||
|
||||
bool setDeviceColors( const LIB_ITEM* aItem, int aLayer );
|
||||
void fillIfSelection( int aLayer );
|
||||
|
@ -216,7 +216,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
EE_TYPE OfType( KICAD_T aType )
|
||||
EE_TYPE OfType( KICAD_T aType ) const
|
||||
{
|
||||
return EE_TYPE( m_tree, aType );
|
||||
}
|
||||
|
@ -288,12 +288,12 @@ 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->Type() == SCH_SHEET_PIN_T );
|
||||
|
||||
for( auto i = m_pins.begin(); i < m_pins.end(); ++i )
|
||||
for( auto i = m_pins.begin(); i < m_pins.end(); ++i )
|
||||
{
|
||||
if( *i == aSheetPin )
|
||||
{
|
||||
@ -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 )
|
||||
{
|
||||
@ -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 )
|
||||
{
|
||||
|
@ -119,7 +119,7 @@ public:
|
||||
*
|
||||
* @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;
|
||||
|
||||
@ -265,9 +265,10 @@ public:
|
||||
*
|
||||
* @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; }
|
||||
const std::vector<SCH_FIELD>& GetFields() const { return m_fields; }
|
||||
|
||||
/**
|
||||
* Set multiple schematic fields.
|
||||
@ -283,7 +284,7 @@ public:
|
||||
|
||||
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; }
|
||||
|
||||
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() const
|
||||
const std::vector<SCH_SHEET_PIN*>& GetPins() const
|
||||
{
|
||||
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.
|
||||
*/
|
||||
void RemovePin( SCH_SHEET_PIN* aSheetPin );
|
||||
void RemovePin( const SCH_SHEET_PIN* aSheetPin );
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @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.
|
||||
|
@ -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();
|
||||
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() )
|
||||
Add( item );
|
||||
|
@ -79,11 +79,11 @@ public:
|
||||
|
||||
void Cleanup();
|
||||
|
||||
void DisplaySheet( SCH_SCREEN* aScreen );
|
||||
void DisplaySheet( const SCH_SCREEN* aScreen );
|
||||
void DisplayComponent( LIB_PART* aPart );
|
||||
|
||||
// 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;
|
||||
|
||||
|
@ -229,6 +229,7 @@ public:
|
||||
bool LoadFromFile( const wxString& aDirectory = "" ) override;
|
||||
|
||||
BOARD_STACKUP& GetStackupDescriptor() { return m_stackup; }
|
||||
const BOARD_STACKUP& GetStackupDescriptor() const { return m_stackup; }
|
||||
|
||||
SEVERITY GetSeverity( int aDRCErrorCode );
|
||||
|
||||
|
@ -201,7 +201,7 @@ public:
|
||||
void SetFlags( STATUS_FLAGS aMask ) { m_flags |= aMask; }
|
||||
void ClearFlags( STATUS_FLAGS aMask = EDA_ITEM_ALL_FLAGS ) { m_flags &= ~aMask; }
|
||||
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
|
||||
{
|
||||
|
@ -65,6 +65,11 @@ public:
|
||||
wxString GetName() const { return m_name; }
|
||||
void SetName( wxString aName ) { m_name = aName; }
|
||||
|
||||
std::unordered_set<BOARD_ITEM*>& GetItems()
|
||||
{
|
||||
return m_items;
|
||||
}
|
||||
|
||||
const std::unordered_set<BOARD_ITEM*>& GetItems() const
|
||||
{
|
||||
return m_items;
|
||||
|
@ -254,7 +254,7 @@ public:
|
||||
void SetHighContrastFactor( float aFactor ) { m_hiContrastFactor = aFactor; }
|
||||
|
||||
// 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; }
|
||||
|
||||
protected:
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user