Harmonize print/plot APIs.
This commit is contained in:
parent
5dd8747ecb
commit
1028a76e4a
|
@ -376,7 +376,7 @@ void SCH_EDIT_FRAME::AnnotateSymbols( SCH_COMMIT* aCommit, ANNOTATE_SCOPE_T aAn
|
|||
if( symbol->GetUnitCount() > 1 )
|
||||
{
|
||||
msg.Printf( _( "Updated %s (unit %s) from %s to %s." ),
|
||||
symbol->GetValueFieldText( true, sheet, false ),
|
||||
symbol->GetValue( true, sheet, false ),
|
||||
symbol->SubReference( symbol->GetUnit(), false ),
|
||||
prevRef,
|
||||
newRef );
|
||||
|
@ -384,7 +384,7 @@ void SCH_EDIT_FRAME::AnnotateSymbols( SCH_COMMIT* aCommit, ANNOTATE_SCOPE_T aAn
|
|||
else
|
||||
{
|
||||
msg.Printf( _( "Updated %s from %s to %s." ),
|
||||
symbol->GetValueFieldText( true, sheet, false ),
|
||||
symbol->GetValue( true, sheet, false ),
|
||||
prevRef,
|
||||
newRef );
|
||||
}
|
||||
|
@ -394,14 +394,14 @@ void SCH_EDIT_FRAME::AnnotateSymbols( SCH_COMMIT* aCommit, ANNOTATE_SCOPE_T aAn
|
|||
if( symbol->GetUnitCount() > 1 )
|
||||
{
|
||||
msg.Printf( _( "Annotated %s (unit %s) as %s." ),
|
||||
symbol->GetValueFieldText( true, sheet, false ),
|
||||
symbol->GetValue( true, sheet, false ),
|
||||
symbol->SubReference( symbol->GetUnit(), false ),
|
||||
newRef );
|
||||
}
|
||||
else
|
||||
{
|
||||
msg.Printf( _( "Annotated %s as %s." ),
|
||||
symbol->GetValueFieldText( true, sheet, false ),
|
||||
symbol->GetValue( true, sheet, false ),
|
||||
newRef );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,9 +146,13 @@ bool CONNECTION_SUBGRAPH::ResolveDrivers( bool aCheckMultipleDrivers )
|
|||
{
|
||||
PRIORITY item_priority = GetDriverPriority( item );
|
||||
|
||||
if( item_priority == PRIORITY::PIN
|
||||
&& !static_cast<SCH_PIN*>( item )->GetParentSymbol()->IsInNetlist() )
|
||||
continue;
|
||||
if( item_priority == PRIORITY::PIN )
|
||||
{
|
||||
SCH_PIN* pin = static_cast<SCH_PIN*>( item );
|
||||
|
||||
if( !static_cast<SCH_SYMBOL*>( pin->GetParentSymbol() )->IsInNetlist() )
|
||||
continue;
|
||||
}
|
||||
|
||||
if( item_priority >= PRIORITY::HIER_LABEL )
|
||||
strong_drivers.insert( item );
|
||||
|
@ -500,7 +504,7 @@ CONNECTION_SUBGRAPH::PRIORITY CONNECTION_SUBGRAPH::GetDriverPriority( SCH_ITEM*
|
|||
case SCH_PIN_T:
|
||||
{
|
||||
SCH_PIN* sch_pin = static_cast<SCH_PIN*>( aDriver );
|
||||
SCH_SYMBOL* sym = sch_pin->GetParentSymbol();
|
||||
const SCH_SYMBOL* sym = static_cast<SCH_SYMBOL*>( sch_pin->GetParentSymbol() );
|
||||
|
||||
if( sch_pin->IsGlobalPower() )
|
||||
return PRIORITY::POWER_PIN;
|
||||
|
@ -1460,7 +1464,7 @@ void CONNECTION_GRAPH::generateGlobalPowerPinSubGraphs()
|
|||
// in the symbol, but we support legacy non-power symbols with global
|
||||
// power connections based on invisible, power-in, pin's names.
|
||||
if( pin->GetLibPin()->GetParentSymbol()->IsPower() )
|
||||
connection->SetName( pin->GetParentSymbol()->GetValueFieldText( true, &sheet, false ) );
|
||||
connection->SetName( pin->GetParentSymbol()->GetValue( true, &sheet, false ) );
|
||||
else
|
||||
connection->SetName( pin->GetShownName() );
|
||||
|
||||
|
|
|
@ -317,9 +317,9 @@ void SCH_EDIT_FRAME::SendSelectItemsToPcb( const std::vector<EDA_ITEM*>& aItems,
|
|||
|
||||
case SCH_PIN_T:
|
||||
{
|
||||
SCH_PIN* pin = static_cast<SCH_PIN*>( item );
|
||||
SCH_SYMBOL* symbol = pin->GetParentSymbol();
|
||||
wxString ref = symbol->GetField( REFERENCE_FIELD )->GetText();
|
||||
SCH_PIN* pin = static_cast<SCH_PIN*>( item );
|
||||
SYMBOL* symbol = pin->GetParentSymbol();
|
||||
wxString ref = symbol->GetRef( &GetCurrentSheet(), false );
|
||||
|
||||
parts.push_back( wxT( "P" ) + EscapeString( ref, CTX_IPC ) + wxT( "/" )
|
||||
+ EscapeString( pin->GetShownNumber(), CTX_IPC ) );
|
||||
|
|
|
@ -407,7 +407,7 @@ void DIALOG_PIN_PROPERTIES::OnPaintShowPanel( wxPaintEvent& event )
|
|||
renderSettings.m_Transform = DefaultTransform;
|
||||
renderSettings.SetPrintDC( &dc );
|
||||
|
||||
m_dummyPin->Print( &renderSettings, -bBox.Centre(), false, false );
|
||||
m_dummyPin->Print( &renderSettings, 0, 0, -bBox.Centre(), false, false );
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
|
|
@ -378,24 +378,22 @@ void DIALOG_PLOT_SCHEMATIC::plotSchematic( bool aPlotAll )
|
|||
|
||||
COLOR_SETTINGS* colors = getColorSettings();
|
||||
|
||||
SCH_PLOT_SETTINGS plotSettings;
|
||||
plotSettings.m_plotDrawingSheet = getPlotDrawingSheet();
|
||||
plotSettings.m_plotAll = aPlotAll;
|
||||
plotSettings.m_blackAndWhite = !getModeColor();
|
||||
plotSettings.m_useBackgroundColor = m_plotBackgroundColor->GetValue();
|
||||
plotSettings.m_theme = colors->GetFilename();
|
||||
plotSettings.m_PDFPropertyPopups = m_plotPDFPropertyPopups->GetValue();
|
||||
plotSettings.m_PDFMetadata = m_plotPDFMetadata->GetValue();
|
||||
plotSettings.m_HPGLPaperSizeSelect = static_cast<HPGL_PAGE_SIZE>( m_HPGLPaperSizeSelect );
|
||||
plotSettings.m_HPGLPlotOrigin =
|
||||
SCH_PLOT_OPTS plotOpts;
|
||||
plotOpts.m_plotDrawingSheet = getPlotDrawingSheet();
|
||||
plotOpts.m_plotAll = aPlotAll;
|
||||
plotOpts.m_blackAndWhite = !getModeColor();
|
||||
plotOpts.m_useBackgroundColor = m_plotBackgroundColor->GetValue();
|
||||
plotOpts.m_theme = colors->GetFilename();
|
||||
plotOpts.m_PDFPropertyPopups = m_plotPDFPropertyPopups->GetValue();
|
||||
plotOpts.m_PDFMetadata = m_plotPDFMetadata->GetValue();
|
||||
plotOpts.m_HPGLPaperSizeSelect = static_cast<HPGL_PAGE_SIZE>( m_HPGLPaperSizeSelect );
|
||||
plotOpts.m_HPGLPlotOrigin =
|
||||
static_cast<HPGL_PLOT_ORIGIN_AND_UNITS>( m_plotOriginOpt->GetSelection() );
|
||||
plotSettings.m_HPGLPenSize = m_HPGLPenSize;
|
||||
plotSettings.m_outputDirectory = getOutputPath();
|
||||
plotSettings.m_pageSizeSelect = m_pageSizeSelect;
|
||||
plotOpts.m_HPGLPenSize = m_HPGLPenSize;
|
||||
plotOpts.m_outputDirectory = getOutputPath();
|
||||
plotOpts.m_pageSizeSelect = m_pageSizeSelect;
|
||||
|
||||
|
||||
schPlotter->Plot( GetPlotFileFormat(), plotSettings, &renderSettings,
|
||||
&m_MessagesBox->Reporter() );
|
||||
schPlotter->Plot( GetPlotFileFormat(), plotOpts, &renderSettings, &m_MessagesBox->Reporter() );
|
||||
|
||||
if( GetPlotFileFormat() == PLOT_FORMAT::PDF && getOpenFileAfterPlot() )
|
||||
wxLaunchDefaultApplication( schPlotter->GetLastOutputFilePath() );
|
||||
|
|
|
@ -208,23 +208,23 @@ int EESCHEMA_JOBS_HANDLER::JobExportPlot( JOB* aJob )
|
|||
case JOB_PAGE_SIZE::PAGE_SIZE_AUTO: pageSizeSelect = PageFormatReq::PAGE_SIZE_AUTO; break;
|
||||
}
|
||||
|
||||
SCH_PLOT_SETTINGS settings;
|
||||
settings.m_blackAndWhite = aPlotJob->m_blackAndWhite;
|
||||
settings.m_HPGLPaperSizeSelect = hpglPageSize;
|
||||
settings.m_HPGLPenSize = aPlotJob->m_HPGLPenSize;
|
||||
settings.m_HPGLPlotOrigin = hpglOrigin;
|
||||
settings.m_PDFPropertyPopups = aPlotJob->m_PDFPropertyPopups;
|
||||
settings.m_PDFMetadata = aPlotJob->m_PDFMetadata;
|
||||
settings.m_outputDirectory = aPlotJob->m_outputDirectory;
|
||||
settings.m_outputFile = aPlotJob->m_outputFile;
|
||||
settings.m_pageSizeSelect = pageSizeSelect;
|
||||
settings.m_plotAll = aPlotJob->m_plotAll;
|
||||
settings.m_plotDrawingSheet = aPlotJob->m_plotDrawingSheet;
|
||||
settings.m_plotPages = aPlotJob->m_plotPages;
|
||||
settings.m_theme = aPlotJob->m_theme;
|
||||
settings.m_useBackgroundColor = aPlotJob->m_useBackgroundColor;
|
||||
SCH_PLOT_OPTS plotOpts;
|
||||
plotOpts.m_blackAndWhite = aPlotJob->m_blackAndWhite;
|
||||
plotOpts.m_HPGLPaperSizeSelect = hpglPageSize;
|
||||
plotOpts.m_HPGLPenSize = aPlotJob->m_HPGLPenSize;
|
||||
plotOpts.m_HPGLPlotOrigin = hpglOrigin;
|
||||
plotOpts.m_PDFPropertyPopups = aPlotJob->m_PDFPropertyPopups;
|
||||
plotOpts.m_PDFMetadata = aPlotJob->m_PDFMetadata;
|
||||
plotOpts.m_outputDirectory = aPlotJob->m_outputDirectory;
|
||||
plotOpts.m_outputFile = aPlotJob->m_outputFile;
|
||||
plotOpts.m_pageSizeSelect = pageSizeSelect;
|
||||
plotOpts.m_plotAll = aPlotJob->m_plotAll;
|
||||
plotOpts.m_plotDrawingSheet = aPlotJob->m_plotDrawingSheet;
|
||||
plotOpts.m_plotPages = aPlotJob->m_plotPages;
|
||||
plotOpts.m_theme = aPlotJob->m_theme;
|
||||
plotOpts.m_useBackgroundColor = aPlotJob->m_useBackgroundColor;
|
||||
|
||||
schPlotter->Plot( format, settings, renderSettings.get(), m_reporter );
|
||||
schPlotter->Plot( format, plotOpts, renderSettings.get(), m_reporter );
|
||||
|
||||
return CLI::EXIT_CODES::OK;
|
||||
}
|
||||
|
@ -772,25 +772,23 @@ int EESCHEMA_JOBS_HANDLER::doSymExportSvg( JOB_SYM_EXPORT_SVG* aSvgJob,
|
|||
return CLI::EXIT_CODES::ERR_INVALID_INPUT_FILE;
|
||||
}
|
||||
|
||||
LOCALE_IO toggle;
|
||||
LOCALE_IO toggle;
|
||||
SCH_PLOT_OPTS plotOpts;
|
||||
|
||||
plotter->StartPlot( wxT( "1" ) );
|
||||
|
||||
bool background = true;
|
||||
TRANSFORM temp; // Uses default transform
|
||||
VECTOR2I plotPos;
|
||||
|
||||
plotPos.x = pageInfo.GetWidthIU( schIUScale.IU_PER_MILS ) / 2;
|
||||
plotPos.y = pageInfo.GetHeightIU( schIUScale.IU_PER_MILS ) / 2;
|
||||
bool background = true;
|
||||
VECTOR2I offset( pageInfo.GetWidthIU( schIUScale.IU_PER_MILS ) / 2,
|
||||
pageInfo.GetHeightIU( schIUScale.IU_PER_MILS ) / 2 );
|
||||
|
||||
// note, we want the fields from the original symbol pointer (in case of non-alias)
|
||||
symbolToPlot->Plot( plotter, unit, bodyStyle, background, plotPos, temp, false );
|
||||
symbol->PlotLibFields( plotter, unit, bodyStyle, background, plotPos, temp, false,
|
||||
aSvgJob->m_includeHiddenFields );
|
||||
symbolToPlot->Plot( plotter, background, plotOpts, unit, bodyStyle, offset, false );
|
||||
symbol->PlotFields( plotter, background, plotOpts, unit, bodyStyle, offset, false,
|
||||
aSvgJob->m_includeHiddenFields );
|
||||
|
||||
symbolToPlot->Plot( plotter, unit, bodyStyle, !background, plotPos, temp, false );
|
||||
symbol->PlotLibFields( plotter, unit, bodyStyle, !background, plotPos, temp, false,
|
||||
aSvgJob->m_includeHiddenFields );
|
||||
symbolToPlot->Plot( plotter, !background, plotOpts, unit, bodyStyle, offset, false );
|
||||
symbol->PlotFields( plotter, !background, plotOpts, unit, bodyStyle, offset, false,
|
||||
aSvgJob->m_includeHiddenFields );
|
||||
|
||||
plotter->EndPlot();
|
||||
delete plotter;
|
||||
|
|
|
@ -127,15 +127,15 @@ KIFONT::FONT* LIB_FIELD::getDrawFont() const
|
|||
}
|
||||
|
||||
|
||||
void LIB_FIELD::print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset,
|
||||
bool aForceNoFill, bool aDimmed )
|
||||
void LIB_FIELD::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
wxDC* DC = aSettings->GetPrintDC();
|
||||
COLOR4D color = aSettings->GetLayerColor( IsVisible() ? GetDefaultLayer() : LAYER_HIDDEN );
|
||||
COLOR4D bg = aSettings->GetBackgroundColor();
|
||||
bool blackAndWhiteMode = GetGRForceBlackPenState();
|
||||
int penWidth = GetEffectivePenWidth( aSettings );
|
||||
VECTOR2I text_pos = aSettings->m_Transform.TransformCoordinate( GetTextPos() ) + aOffset;
|
||||
VECTOR2I text_pos = aSettings->TransformCoordinate( GetTextPos() ) + aOffset;
|
||||
|
||||
if( blackAndWhiteMode || bg == COLOR4D::UNSPECIFIED )
|
||||
bg = COLOR4D::WHITE;
|
||||
|
@ -332,18 +332,18 @@ void LIB_FIELD::Rotate( const VECTOR2I& center, bool aRotateCCW )
|
|||
}
|
||||
|
||||
|
||||
void LIB_FIELD::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffset,
|
||||
const TRANSFORM& aTransform, bool aDimmed ) const
|
||||
void LIB_FIELD::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
if( GetText().IsEmpty() || aBackground )
|
||||
return;
|
||||
|
||||
RENDER_SETTINGS* renderSettings = aPlotter->RenderSettings();
|
||||
SCH_RENDER_SETTINGS* renderSettings = getRenderSettings( aPlotter );
|
||||
|
||||
// Calculate the text orientation, according to the symbol orientation/mirror.
|
||||
EDA_ANGLE orient = GetTextAngle();
|
||||
|
||||
if( aTransform.y1 ) // Rotate symbol 90 deg.
|
||||
if( renderSettings->m_Transform.y1 ) // Rotate symbol 90 deg.
|
||||
{
|
||||
if( orient.IsHorizontal() )
|
||||
orient = ANGLE_VERTICAL;
|
||||
|
@ -356,7 +356,7 @@ void LIB_FIELD::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffs
|
|||
|
||||
GR_TEXT_H_ALIGN_T hjustify = GR_TEXT_H_ALIGN_CENTER;
|
||||
GR_TEXT_V_ALIGN_T vjustify = GR_TEXT_V_ALIGN_CENTER;
|
||||
VECTOR2I textpos = aTransform.TransformCoordinate( bbox.Centre() ) + aOffset;
|
||||
VECTOR2I textpos = renderSettings->TransformCoordinate( bbox.Centre() ) + aOffset;
|
||||
|
||||
COLOR4D color;
|
||||
COLOR4D bg;
|
||||
|
|
|
@ -175,8 +175,11 @@ public:
|
|||
void MirrorVertically( int aCenter ) override;
|
||||
void Rotate( const VECTOR2I& aCenter, bool aRotateCCW = true ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffset,
|
||||
const TRANSFORM& aTransform, bool aDimmed ) const override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
|
||||
|
||||
|
@ -218,15 +221,6 @@ private:
|
|||
*/
|
||||
int compare( const LIB_ITEM& aOther, int aCompareFlags = 0 ) const override;
|
||||
|
||||
/**
|
||||
* Print the field.
|
||||
*
|
||||
* If \a aData not NULL, \a aData must point a wxString which is used instead of
|
||||
* the m_Text
|
||||
*/
|
||||
void print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset, bool aForceNoFill,
|
||||
bool aDimmed ) override;
|
||||
|
||||
/**
|
||||
* Calculate the new circle at \a aPosition when editing.
|
||||
*
|
||||
|
|
|
@ -169,13 +169,6 @@ const KIFONT::METRICS& LIB_ITEM::GetFontMetrics() const
|
|||
}
|
||||
|
||||
|
||||
void LIB_ITEM::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset,
|
||||
bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
print( aSettings, aOffset, aForceNoFill, aDimmed );
|
||||
}
|
||||
|
||||
|
||||
void LIB_ITEM::ViewGetLayers( int aLayers[], int& aCount ) const
|
||||
{
|
||||
// Basic fallback
|
||||
|
|
|
@ -173,22 +173,13 @@ public:
|
|||
*/
|
||||
virtual void CalcEdit( const VECTOR2I& aPosition ) {}
|
||||
|
||||
/**
|
||||
* Draw an item
|
||||
*
|
||||
* @param aOffset Offset to draw
|
||||
* @param aDimmed Dim the color on the printout
|
||||
*/
|
||||
virtual void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset,
|
||||
bool aForceNoFill, bool aDimmed );
|
||||
|
||||
virtual int GetPenWidth() const = 0;
|
||||
|
||||
const wxString& GetDefaultFont() const;
|
||||
|
||||
const KIFONT::METRICS& GetFontMetrics() const;
|
||||
|
||||
virtual int GetEffectivePenWidth( const RENDER_SETTINGS* aSettings ) const
|
||||
virtual int GetEffectivePenWidth( const SCH_RENDER_SETTINGS* aSettings ) const
|
||||
{
|
||||
// For historical reasons, a stored value of 0 means "default width" and negative
|
||||
// numbers meant "don't stroke".
|
||||
|
@ -328,18 +319,29 @@ public:
|
|||
virtual void Rotate( const VECTOR2I& aCenter, bool aRotateCCW = true ) = 0;
|
||||
|
||||
/**
|
||||
* Plot the draw item using the plot object.
|
||||
* Print an item.
|
||||
*
|
||||
* @param aUnit - which unit to print.
|
||||
* @param aBodyStyle - which body style to print.
|
||||
* @param aOffset - relative offset.
|
||||
* @param aForceNoFill - disable printing of fills.
|
||||
* @param aDimmed - reduce brightness of item.
|
||||
*/
|
||||
virtual void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) = 0;
|
||||
|
||||
/**
|
||||
* Plot the item to \a aPlotter.
|
||||
*
|
||||
* @param aPlotter The plot object to plot to.
|
||||
* @param aBackground a poor-man's Z-order. The routine will get called twice, first with
|
||||
* aBackground true and then with aBackground false.
|
||||
* @param aOffset Plot offset position.
|
||||
* @param aFill Flag to indicate whether or not the object is filled.
|
||||
* @param aTransform The plot transform.
|
||||
* @param aDimmed if true, reduce color to background
|
||||
* @param aUnit - which unit to print.
|
||||
* @param aBodyStyle - which body style to print.
|
||||
* @param aOffset relative offset.
|
||||
* @param aDimmed reduce brightness of item.
|
||||
*/
|
||||
virtual void Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffset,
|
||||
const TRANSFORM& aTransform, bool aDimmed ) const = 0;
|
||||
virtual void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) = 0;
|
||||
|
||||
void SetUnit( int aUnit ) { m_unit = aUnit; }
|
||||
int GetUnit() const { return m_unit; }
|
||||
|
@ -360,6 +362,11 @@ public:
|
|||
#endif
|
||||
|
||||
protected:
|
||||
SCH_RENDER_SETTINGS* getRenderSettings( PLOTTER* aPlotter ) const
|
||||
{
|
||||
return static_cast<SCH_RENDER_SETTINGS*>( aPlotter->RenderSettings() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide the draw object specific comparison called by the == and < operators.
|
||||
*
|
||||
|
@ -382,13 +389,6 @@ protected:
|
|||
*/
|
||||
virtual int compare( const LIB_ITEM& aOther, int aCompareFlags = 0 ) const;
|
||||
|
||||
/**
|
||||
* @param aOffset A reference to a wxPoint object containing the offset where to draw
|
||||
* from the object's current position.
|
||||
*/
|
||||
virtual void print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset,
|
||||
bool aForceNoFill, bool aDimmed ) = 0;
|
||||
|
||||
private:
|
||||
friend class LIB_SYMBOL;
|
||||
|
||||
|
|
|
@ -195,8 +195,8 @@ VECTOR2I LIB_PIN::GetPinRoot() const
|
|||
}
|
||||
|
||||
|
||||
void LIB_PIN::print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset,
|
||||
bool aForceNoFill, bool aDimmed )
|
||||
void LIB_PIN::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
LIB_SYMBOL* part = dynamic_cast<LIB_SYMBOL*>( GetParentSymbol() );
|
||||
|
||||
|
@ -206,7 +206,7 @@ void LIB_PIN::print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffs
|
|||
PIN_ORIENTATION orient = PinDrawOrient( aSettings->m_Transform );
|
||||
|
||||
/* Calculate the pin position */
|
||||
VECTOR2I pos1 = aSettings->m_Transform.TransformCoordinate( m_position ) + aOffset;
|
||||
VECTOR2I pos1 = aSettings->TransformCoordinate( m_position ) + aOffset;
|
||||
|
||||
if( IsVisible() || aSettings->m_ShowHiddenLibFields )
|
||||
{
|
||||
|
@ -244,7 +244,7 @@ void LIB_PIN::print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffs
|
|||
}
|
||||
|
||||
|
||||
void LIB_PIN::printPinSymbol( const RENDER_SETTINGS* aSettings, const VECTOR2I& aPos,
|
||||
void LIB_PIN::printPinSymbol( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aPos,
|
||||
PIN_ORIENTATION aOrient, bool aDimmed )
|
||||
{
|
||||
wxDC* DC = aSettings->GetPrintDC();
|
||||
|
@ -616,13 +616,14 @@ void LIB_PIN::printPinElectricalTypeName( const RENDER_SETTINGS* aSettings, VECT
|
|||
}
|
||||
|
||||
|
||||
void LIB_PIN::PlotSymbol( PLOTTER *aPlotter, const VECTOR2I &aPosition,
|
||||
PIN_ORIENTATION aOrientation, bool aDimmed ) const
|
||||
void LIB_PIN::PlotPinType( PLOTTER *aPlotter, const VECTOR2I &aPosition,
|
||||
PIN_ORIENTATION aOrientation, bool aDimmed ) const
|
||||
{
|
||||
int MapX1, MapY1, x1, y1;
|
||||
COLOR4D color = aPlotter->RenderSettings()->GetLayerColor( LAYER_PIN );
|
||||
COLOR4D bg = aPlotter->RenderSettings()->GetBackgroundColor();
|
||||
int penWidth = GetEffectivePenWidth( aPlotter->RenderSettings() );
|
||||
int MapX1, MapY1, x1, y1;
|
||||
SCH_RENDER_SETTINGS* renderSettings = getRenderSettings( aPlotter );
|
||||
COLOR4D color = renderSettings->GetLayerColor( LAYER_PIN );
|
||||
COLOR4D bg = renderSettings->GetBackgroundColor();
|
||||
int penWidth = GetEffectivePenWidth( renderSettings );
|
||||
|
||||
if( bg == COLOR4D::UNSPECIFIED || !aPlotter->GetColorMode() )
|
||||
bg = COLOR4D::WHITE;
|
||||
|
@ -1163,18 +1164,19 @@ void LIB_PIN::Rotate( const VECTOR2I& aCenter, bool aRotateCCW )
|
|||
}
|
||||
|
||||
|
||||
void LIB_PIN::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffset,
|
||||
const TRANSFORM& aTransform, bool aDimmed ) const
|
||||
void LIB_PIN::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
if( !IsVisible() || aBackground )
|
||||
return;
|
||||
|
||||
const SYMBOL* part = GetParentSymbol();
|
||||
SCH_RENDER_SETTINGS* renderSettings = getRenderSettings( aPlotter );
|
||||
const SYMBOL* part = GetParentSymbol();
|
||||
PIN_ORIENTATION orient = PinDrawOrient( renderSettings->m_Transform );
|
||||
|
||||
PIN_ORIENTATION orient = PinDrawOrient( aTransform );
|
||||
VECTOR2I pos = aTransform.TransformCoordinate( m_position ) + aOffset;
|
||||
VECTOR2I pos = renderSettings->TransformCoordinate( m_position ) + aOffset;
|
||||
|
||||
PlotSymbol( aPlotter, pos, orient, aDimmed );
|
||||
PlotPinType( aPlotter, pos, orient, aDimmed );
|
||||
PlotPinTexts( aPlotter, pos, orient, part->GetPinNameOffset(), part->GetShowPinNumbers(),
|
||||
part->GetShowPinNames(), aDimmed );
|
||||
}
|
||||
|
|
|
@ -143,13 +143,8 @@ public:
|
|||
|
||||
ALT GetAlt( const wxString& aAlt ) { return m_alternates[ aAlt ]; }
|
||||
|
||||
/**
|
||||
* Print a pin, with or without the pin texts
|
||||
*
|
||||
* @param aOffset Offset to draw
|
||||
*/
|
||||
void print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset, bool aForceNoFill,
|
||||
bool aDimmed ) override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
/**
|
||||
* Return the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT),
|
||||
|
@ -209,19 +204,6 @@ public:
|
|||
|
||||
int GetPenWidth() const override;
|
||||
|
||||
/**
|
||||
* Plot the pin number and pin text info, given the pin line coordinates.
|
||||
* Same as DrawPinTexts((), but output is the plotter
|
||||
* The line must be vertical or horizontal.
|
||||
* If TextInside then the text is been put inside (moving from x1, y1 in
|
||||
* the opposite direction to x2,y2), otherwise all is drawn outside.
|
||||
*/
|
||||
void PlotPinTexts( PLOTTER *aPlotter, const VECTOR2I &aPinPos, PIN_ORIENTATION aPinOrient,
|
||||
int aTextInside, bool aDrawPinNum, bool aDrawPinName, bool aDimmed ) const;
|
||||
|
||||
void PlotSymbol( PLOTTER *aPlotter, const VECTOR2I &aPosition, PIN_ORIENTATION aOrientation,
|
||||
bool aDimmed ) const;
|
||||
|
||||
void Offset( const VECTOR2I& aOffset ) override;
|
||||
|
||||
void MoveTo( const VECTOR2I& aNewPosition ) override;
|
||||
|
@ -241,8 +223,21 @@ public:
|
|||
void MirrorVertically( int aCenter ) override;
|
||||
void Rotate( const VECTOR2I& aCenter, bool aRotateCCW = true ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffset,
|
||||
const TRANSFORM& aTransform, bool aDimmed ) const override;
|
||||
/**
|
||||
* Plot the pin number and pin text info, given the pin line coordinates.
|
||||
* Same as DrawPinTexts((), but output is the plotter
|
||||
* The line must be vertical or horizontal.
|
||||
* If TextInside then the text is been put inside (moving from x1, y1 in
|
||||
* the opposite direction to x2,y2), otherwise all is drawn outside.
|
||||
*/
|
||||
void PlotPinTexts( PLOTTER *aPlotter, const VECTOR2I &aPinPos, PIN_ORIENTATION aPinOrient,
|
||||
int aTextInside, bool aDrawPinNum, bool aDrawPinName, bool aDimmed ) const;
|
||||
|
||||
void PlotPinType( PLOTTER *aPlotter, const VECTOR2I &aPosition, PIN_ORIENTATION aOrientation,
|
||||
bool aDimmed ) const;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
BITMAPS GetMenuImage() const override;
|
||||
|
||||
|
@ -287,7 +282,7 @@ protected:
|
|||
* Print the pin symbol without text.
|
||||
* If \a aColor != 0, draw with \a aColor, else with the normal pin color.
|
||||
*/
|
||||
void printPinSymbol( const RENDER_SETTINGS *aSettings, const VECTOR2I &aPos,
|
||||
void printPinSymbol( const SCH_RENDER_SETTINGS *aSettings, const VECTOR2I &aPos,
|
||||
PIN_ORIENTATION aOrientation, bool aDimmed );
|
||||
|
||||
/**
|
||||
|
|
|
@ -131,14 +131,16 @@ void LIB_SHAPE::Rotate( const VECTOR2I& aCenter, bool aRotateCCW )
|
|||
}
|
||||
|
||||
|
||||
void LIB_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffset,
|
||||
const TRANSFORM& aTransform, bool aDimmed ) const
|
||||
void LIB_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
if( IsPrivate() )
|
||||
return;
|
||||
|
||||
VECTOR2I start = aTransform.TransformCoordinate( m_start ) + aOffset;
|
||||
VECTOR2I end = aTransform.TransformCoordinate( m_end ) + aOffset;
|
||||
SCH_RENDER_SETTINGS* renderSettings = getRenderSettings( aPlotter );
|
||||
|
||||
VECTOR2I start = renderSettings->TransformCoordinate( m_start ) + aOffset;
|
||||
VECTOR2I end = renderSettings->TransformCoordinate( m_end ) + aOffset;
|
||||
|
||||
static std::vector<VECTOR2I> cornerList;
|
||||
|
||||
|
@ -148,14 +150,14 @@ void LIB_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffs
|
|||
cornerList.clear();
|
||||
|
||||
for( const VECTOR2I& pt : poly.CPoints() )
|
||||
cornerList.push_back( aTransform.TransformCoordinate( pt ) + aOffset );
|
||||
cornerList.push_back( renderSettings->TransformCoordinate( pt ) + aOffset );
|
||||
}
|
||||
else if( GetShape() == SHAPE_T::BEZIER )
|
||||
{
|
||||
cornerList.clear();
|
||||
|
||||
for( const VECTOR2I& pt : m_bezierPoints )
|
||||
cornerList.push_back( aTransform.TransformCoordinate( pt ) + aOffset );
|
||||
cornerList.push_back( renderSettings->TransformCoordinate( pt ) + aOffset );
|
||||
}
|
||||
|
||||
int penWidth;
|
||||
|
@ -178,7 +180,7 @@ void LIB_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffs
|
|||
break;
|
||||
|
||||
case FILL_T::FILLED_WITH_BG_BODYCOLOR:
|
||||
color = aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND );
|
||||
color = renderSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -191,7 +193,7 @@ void LIB_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffs
|
|||
else
|
||||
{
|
||||
if( !aPlotter->GetColorMode() || color == COLOR4D::UNSPECIFIED )
|
||||
color = aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE );
|
||||
color = renderSettings->GetLayerColor( LAYER_DEVICE );
|
||||
|
||||
if( lineStyle == LINE_STYLE::DEFAULT )
|
||||
lineStyle = LINE_STYLE::SOLID;
|
||||
|
@ -201,10 +203,10 @@ void LIB_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffs
|
|||
else
|
||||
fill = FILL_T::NO_FILL;
|
||||
|
||||
penWidth = GetEffectivePenWidth( aPlotter->RenderSettings() );
|
||||
penWidth = GetEffectivePenWidth( renderSettings );
|
||||
}
|
||||
|
||||
COLOR4D bg = aPlotter->RenderSettings()->GetBackgroundColor();
|
||||
COLOR4D bg = renderSettings->GetBackgroundColor();
|
||||
|
||||
if( bg == COLOR4D::UNSPECIFIED || !aPlotter->GetColorMode() )
|
||||
bg = COLOR4D::WHITE;
|
||||
|
@ -222,7 +224,7 @@ void LIB_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffs
|
|||
{
|
||||
case SHAPE_T::ARC:
|
||||
{
|
||||
VECTOR2I mid = aTransform.TransformCoordinate( GetArcMid() ) + aOffset;
|
||||
VECTOR2I mid = renderSettings->TransformCoordinate( GetArcMid() ) + aOffset;
|
||||
|
||||
aPlotter->Arc( start, mid, end, fill, penWidth );
|
||||
break;
|
||||
|
@ -230,7 +232,7 @@ void LIB_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffs
|
|||
|
||||
case SHAPE_T::CIRCLE:
|
||||
{
|
||||
VECTOR2I center = aTransform.TransformCoordinate( getCenter() ) + aOffset;
|
||||
VECTOR2I center = renderSettings->TransformCoordinate( getCenter() ) + aOffset;
|
||||
|
||||
aPlotter->Circle( center, GetRadius() * 2, fill, penWidth );
|
||||
break;
|
||||
|
@ -259,8 +261,8 @@ int LIB_SHAPE::GetPenWidth() const
|
|||
}
|
||||
|
||||
|
||||
void LIB_SHAPE::print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset,
|
||||
bool aForceNoFill, bool aDimmed )
|
||||
void LIB_SHAPE::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
if( IsPrivate() )
|
||||
return;
|
||||
|
|
|
@ -109,8 +109,11 @@ public:
|
|||
void MirrorVertically( int aCenter ) override;
|
||||
void Rotate( const VECTOR2I& aCenter, bool aRotateCCW = true ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffset,
|
||||
const TRANSFORM& aTransform, bool aDimmed ) const override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
|
||||
|
||||
|
@ -134,9 +137,6 @@ private:
|
|||
* - Circle radius.
|
||||
*/
|
||||
int compare( const LIB_ITEM& aOther, int aCompareFlags = 0 ) const override;
|
||||
|
||||
void print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset, bool aForceNoFill,
|
||||
bool aDimmed ) override;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -377,13 +377,9 @@ int LIB_SYMBOL::Compare( const LIB_SYMBOL& aRhs, int aCompareFlags, REPORTER* aR
|
|||
bField = aRhs.FindField( aField->GetName() );
|
||||
|
||||
if( !bField )
|
||||
{
|
||||
tmp = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp = aFieldItem->compare( *bField, aCompareFlags );
|
||||
}
|
||||
|
||||
if( tmp )
|
||||
{
|
||||
|
@ -738,42 +734,8 @@ wxString LIB_SYMBOL::LetterSubReference( int aUnit, int aFirstId )
|
|||
}
|
||||
|
||||
|
||||
void LIB_SYMBOL::PrintBackground( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset,
|
||||
int aUnit, int aBodyStyle, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
/* draw background for filled items using background option
|
||||
* Solid lines will be drawn after the background
|
||||
* Note also, background is not drawn when printing in black and white
|
||||
*/
|
||||
if( !GetGRForceBlackPenState() )
|
||||
{
|
||||
for( LIB_ITEM& item : m_drawings )
|
||||
{
|
||||
// Do not print private items
|
||||
if( item.IsPrivate() )
|
||||
continue;
|
||||
|
||||
if( item.Type() == LIB_SHAPE_T )
|
||||
{
|
||||
LIB_SHAPE& shape = static_cast<LIB_SHAPE&>( item );
|
||||
|
||||
// Do not draw items not attached to the current part
|
||||
if( aUnit && shape.m_unit && ( shape.m_unit != aUnit ) )
|
||||
continue;
|
||||
|
||||
if( aBodyStyle && shape.m_bodyStyle && ( shape.m_bodyStyle != aBodyStyle ) )
|
||||
continue;
|
||||
|
||||
if( shape.GetFillMode() == FILL_T::FILLED_WITH_BG_BODYCOLOR )
|
||||
shape.Print( aSettings, aOffset, false, aDimmed );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LIB_SYMBOL::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset,
|
||||
int aUnit, int aBodyStyle, bool aForceNoFill, bool aDimmed )
|
||||
void LIB_SYMBOL::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
for( LIB_ITEM& item : m_drawings )
|
||||
{
|
||||
|
@ -801,11 +763,11 @@ void LIB_SYMBOL::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aO
|
|||
|
||||
if( item.Type() == LIB_PIN_T )
|
||||
{
|
||||
item.Print( aSettings, aOffset, aForceNoFill, aDimmed );
|
||||
item.Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
|
||||
}
|
||||
else if( item.Type() == LIB_FIELD_T )
|
||||
{
|
||||
item.Print( aSettings, aOffset, aForceNoFill, aDimmed );
|
||||
item.Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
|
||||
}
|
||||
else if( item.Type() == LIB_SHAPE_T )
|
||||
{
|
||||
|
@ -814,23 +776,58 @@ void LIB_SYMBOL::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aO
|
|||
if( shape.GetFillMode() == FILL_T::FILLED_WITH_BG_BODYCOLOR )
|
||||
aForceNoFill = true;
|
||||
|
||||
shape.Print( aSettings, aOffset, aForceNoFill, aDimmed );
|
||||
shape.Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
|
||||
}
|
||||
else
|
||||
{
|
||||
item.Print( aSettings, aOffset, aForceNoFill, aDimmed );
|
||||
item.Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LIB_SYMBOL::Plot( PLOTTER *aPlotter, int aUnit, int aBodyStyle, bool aBackground,
|
||||
const VECTOR2I &aOffset, const TRANSFORM &aTransform, bool aDimmed ) const
|
||||
void LIB_SYMBOL::PrintBackground( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
/* draw background for filled items using background option
|
||||
* Solid lines will be drawn after the background
|
||||
* Note also, background is not drawn when printing in black and white
|
||||
*/
|
||||
if( !GetGRForceBlackPenState() )
|
||||
{
|
||||
for( LIB_ITEM& item : m_drawings )
|
||||
{
|
||||
// Do not print private items
|
||||
if( item.IsPrivate() )
|
||||
continue;
|
||||
|
||||
if( item.Type() == LIB_SHAPE_T )
|
||||
{
|
||||
LIB_SHAPE& shape = static_cast<LIB_SHAPE&>( item );
|
||||
|
||||
// Do not draw items not attached to the current part
|
||||
if( aUnit && shape.m_unit && ( shape.m_unit != aUnit ) )
|
||||
continue;
|
||||
|
||||
if( aBodyStyle && shape.m_bodyStyle && ( shape.m_bodyStyle != aBodyStyle ) )
|
||||
continue;
|
||||
|
||||
if( shape.GetFillMode() == FILL_T::FILLED_WITH_BG_BODYCOLOR )
|
||||
shape.Print( aSettings, aUnit, aBodyStyle, aOffset, false, aDimmed );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LIB_SYMBOL::Plot( PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed )
|
||||
{
|
||||
wxASSERT( aPlotter != nullptr );
|
||||
|
||||
COLOR4D color = aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE );
|
||||
COLOR4D bg = aPlotter->RenderSettings()->GetBackgroundColor();
|
||||
SCH_RENDER_SETTINGS* renderSettings = getRenderSettings( aPlotter );
|
||||
COLOR4D color = renderSettings->GetLayerColor( LAYER_DEVICE );
|
||||
COLOR4D bg = renderSettings->GetBackgroundColor();
|
||||
|
||||
if( bg == COLOR4D::UNSPECIFIED || !aPlotter->GetColorMode() )
|
||||
bg = COLOR4D::WHITE;
|
||||
|
@ -843,7 +840,7 @@ void LIB_SYMBOL::Plot( PLOTTER *aPlotter, int aUnit, int aBodyStyle, bool aBackg
|
|||
|
||||
aPlotter->SetColor( color );
|
||||
|
||||
for( const LIB_ITEM& item : m_drawings )
|
||||
for( LIB_ITEM& item : m_drawings )
|
||||
{
|
||||
// Do not plot private items
|
||||
if( item.IsPrivate() )
|
||||
|
@ -860,19 +857,20 @@ void LIB_SYMBOL::Plot( PLOTTER *aPlotter, int aUnit, int aBodyStyle, bool aBackg
|
|||
if( aBodyStyle && item.m_bodyStyle && ( item.m_bodyStyle != aBodyStyle ) )
|
||||
continue;
|
||||
|
||||
item.Plot( aPlotter, aBackground, aOffset, aTransform, aDimmed );
|
||||
item.Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LIB_SYMBOL::PlotLibFields( PLOTTER* aPlotter, int aUnit, int aBodyStyle, bool aBackground,
|
||||
const VECTOR2I& aOffset, const TRANSFORM& aTransform, bool aDimmed,
|
||||
bool aPlotHidden )
|
||||
void LIB_SYMBOL::PlotFields( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed,
|
||||
bool aPlotHidden )
|
||||
{
|
||||
wxASSERT( aPlotter != nullptr );
|
||||
|
||||
COLOR4D color = aPlotter->RenderSettings()->GetLayerColor( LAYER_FIELDS );
|
||||
COLOR4D bg = aPlotter->RenderSettings()->GetBackgroundColor();
|
||||
SCH_RENDER_SETTINGS* renderSettings = getRenderSettings( aPlotter );
|
||||
COLOR4D color = renderSettings->GetLayerColor( LAYER_FIELDS );
|
||||
COLOR4D bg = renderSettings->GetBackgroundColor();
|
||||
|
||||
if( bg == COLOR4D::UNSPECIFIED || !aPlotter->GetColorMode() )
|
||||
bg = COLOR4D::WHITE;
|
||||
|
@ -890,17 +888,11 @@ void LIB_SYMBOL::PlotLibFields( PLOTTER* aPlotter, int aUnit, int aBodyStyle, bo
|
|||
if( item.Type() != LIB_FIELD_T )
|
||||
continue;
|
||||
|
||||
if( !aPlotHidden && !( (LIB_FIELD&) item ).IsVisible() )
|
||||
continue;
|
||||
LIB_FIELD& field = static_cast<LIB_FIELD&>( item );
|
||||
|
||||
if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
|
||||
if( !aPlotHidden && !field.IsVisible() )
|
||||
continue;
|
||||
|
||||
if( aBodyStyle && item.m_bodyStyle && ( item.m_bodyStyle != aBodyStyle ) )
|
||||
continue;
|
||||
|
||||
LIB_FIELD& field = (LIB_FIELD&) item;
|
||||
|
||||
// The reference is a special case: we should change the basic text
|
||||
// to add '?' and the part id
|
||||
wxString tmp = field.GetShownText( true );
|
||||
|
@ -911,7 +903,7 @@ void LIB_SYMBOL::PlotLibFields( PLOTTER* aPlotter, int aUnit, int aBodyStyle, bo
|
|||
field.SetText( text );
|
||||
}
|
||||
|
||||
item.Plot( aPlotter, aBackground, aOffset, aTransform, aDimmed );
|
||||
item.Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
|
||||
field.SetText( tmp );
|
||||
}
|
||||
}
|
||||
|
@ -1133,20 +1125,17 @@ const BOX2I LIB_SYMBOL::GetUnitBoundingBox( int aUnit, int aBodyStyle,
|
|||
|
||||
for( const LIB_ITEM& item : m_drawings )
|
||||
{
|
||||
if( item.m_unit > 0
|
||||
&& m_unitCount > 1
|
||||
&& aUnit > 0
|
||||
&& aUnit != item.m_unit )
|
||||
{
|
||||
if( item.m_unit > 0 && m_unitCount > 1 && aUnit > 0 && aUnit != item.m_unit )
|
||||
continue;
|
||||
}
|
||||
|
||||
if( item.m_bodyStyle > 0 && aBodyStyle > 0 && aBodyStyle != item.m_bodyStyle )
|
||||
continue;
|
||||
|
||||
if( aIgnoreHiddenFields && ( item.Type() == LIB_FIELD_T )
|
||||
&& !( (LIB_FIELD&) item ).IsVisible() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
bBox.Merge( item.GetBoundingBox() );
|
||||
}
|
||||
|
|
|
@ -323,6 +323,20 @@ public:
|
|||
|
||||
wxString GetPrefix();
|
||||
|
||||
const wxString GetRef( const SCH_SHEET_PATH* aSheet, bool aIncludeUnit = false ) const override
|
||||
{
|
||||
return GetReferenceField().GetText();
|
||||
}
|
||||
|
||||
const wxString GetValue( bool aResolve, const SCH_SHEET_PATH* aPath,
|
||||
bool aAllowExtraText ) const override
|
||||
{
|
||||
return GetValueField().GetText();
|
||||
}
|
||||
|
||||
int GetUnit() const override { return 0; }
|
||||
int GetBodyStyle() const override { return 0; }
|
||||
|
||||
// JEY TODO: reconcile with RunOnChildren when LIB_ITEM collapses to SCH_ITEM
|
||||
void RunOnLibChildren( const std::function<void( LIB_ITEM* )>& aFunction );
|
||||
|
||||
|
@ -337,59 +351,21 @@ public:
|
|||
|
||||
int GetNextAvailableFieldId() const;
|
||||
|
||||
/**
|
||||
* Print symbol.
|
||||
*
|
||||
* @param aOffset - Position of symbol.
|
||||
* @param aMulti - unit if multiple units per symbol.
|
||||
* @param aBodyStyle - Symbol alternate body style (DeMorgan) if available.
|
||||
* @param aDimmed - Reduce brightness of symbol
|
||||
*/
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset, int aMulti,
|
||||
int aBodyStyle, bool aForceNoFill, bool aDimmed ) override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void PrintBackground( const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
/**
|
||||
* Print just the background fills of a symbol
|
||||
*
|
||||
* @param aOffset - Position of symbol.
|
||||
* @param aMulti - unit if multiple units per symbol.
|
||||
* @param aBodyStyle - Symbol alternate body style (DeMorgan) if available.
|
||||
* @param aDimmed - Reduce brightness of symbol
|
||||
* Plot symbol fields.
|
||||
*/
|
||||
void PrintBackground( const SCH_RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset,
|
||||
int aMulti, int aBodyStyle, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
/**
|
||||
* Plot lib symbol to plotter.
|
||||
* Lib Fields not are plotted here, because this plot function
|
||||
* is used to plot schematic items, which have they own fields
|
||||
*
|
||||
* @param aPlotter - Plotter object to plot to.
|
||||
* @param aUnit - Symbol symbol to plot.
|
||||
* @param aBodyStyle - Symbol alternate body style to plot.
|
||||
* @param aBackground - A poor-man's Z-order.
|
||||
* @param aOffset - Distance to shift the plot coordinates.
|
||||
* @param aTransform - Symbol plot transform matrix.
|
||||
* @param aDimmed - Reduce brightness of symbol
|
||||
*/
|
||||
void Plot( PLOTTER* aPlotter, int aUnit, int aBodyStyle, bool aBackground,
|
||||
const VECTOR2I& aOffset, const TRANSFORM& aTransform, bool aDimmed ) const override;
|
||||
|
||||
/**
|
||||
* Plot Lib Fields only of the symbol to plotter.
|
||||
* is used to plot the full lib symbol, outside the schematic
|
||||
*
|
||||
* @param aPlotter - Plotter object to plot to.
|
||||
* @param aUnit - Symbol to plot.
|
||||
* @param aBodyStyle - Symbol alternate body style to plot.
|
||||
* @param aBackground - A poor-man's Z-order.
|
||||
* @param aOffset - Distance to shift the plot coordinates.
|
||||
* @param aTransform - Symbol plot transform matrix.
|
||||
* @param aDimmed - reduce brightness of fields
|
||||
*/
|
||||
void PlotLibFields( PLOTTER* aPlotter, int aUnit, int aBodyStyle, bool aBackground,
|
||||
const VECTOR2I& aOffset, const TRANSFORM& aTransform, bool aDimmed,
|
||||
bool aPlotHidden = true );
|
||||
void PlotFields( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed,
|
||||
bool aPlotHidden );
|
||||
|
||||
/**
|
||||
* Add a new draw \a aItem to the draw object list and sort according to \a aSort.
|
||||
|
|
|
@ -253,8 +253,8 @@ void LIB_TEXT::Rotate( const VECTOR2I& center, bool aRotateCCW )
|
|||
}
|
||||
|
||||
|
||||
void LIB_TEXT::Plot( PLOTTER* plotter, bool aBackground, const VECTOR2I& offset,
|
||||
const TRANSFORM& aTransform, bool aDimmed ) const
|
||||
void LIB_TEXT::Plot( PLOTTER* plotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& offset, bool aDimmed )
|
||||
{
|
||||
wxASSERT( plotter != nullptr );
|
||||
|
||||
|
@ -264,7 +264,7 @@ void LIB_TEXT::Plot( PLOTTER* plotter, bool aBackground, const VECTOR2I& offset,
|
|||
if( aBackground )
|
||||
return;
|
||||
|
||||
RENDER_SETTINGS* settings = plotter->RenderSettings();
|
||||
SCH_RENDER_SETTINGS* renderSettings = getRenderSettings( plotter );
|
||||
|
||||
BOX2I bBox = GetBoundingBox();
|
||||
// convert coordinates from draw Y axis to symbol_editor Y axis
|
||||
|
@ -288,16 +288,16 @@ void LIB_TEXT::Plot( PLOTTER* plotter, bool aBackground, const VECTOR2I& offset,
|
|||
|
||||
// The text orientation may need to be flipped if the transformation matrix causes xy
|
||||
// axes to be flipped.
|
||||
int t1 = ( aTransform.x1 != 0 ) ^ ( GetTextAngle() != ANGLE_HORIZONTAL );
|
||||
VECTOR2I pos = aTransform.TransformCoordinate( txtpos ) + offset;
|
||||
int t1 = ( renderSettings->m_Transform.x1 != 0 ) ^ ( GetTextAngle() != ANGLE_HORIZONTAL );
|
||||
VECTOR2I pos = renderSettings->TransformCoordinate( txtpos ) + offset;
|
||||
COLOR4D color = GetTextColor();
|
||||
COLOR4D bg = settings->GetBackgroundColor();
|
||||
COLOR4D bg = renderSettings->GetBackgroundColor();
|
||||
|
||||
if( !plotter->GetColorMode() || color == COLOR4D::UNSPECIFIED )
|
||||
color = settings->GetLayerColor( LAYER_DEVICE );
|
||||
color = renderSettings->GetLayerColor( LAYER_DEVICE );
|
||||
|
||||
if( !IsVisible() )
|
||||
bg = settings->GetLayerColor( LAYER_HIDDEN );
|
||||
bg = renderSettings->GetLayerColor( LAYER_HIDDEN );
|
||||
else if( bg == COLOR4D::UNSPECIFIED || !plotter->GetColorMode() )
|
||||
bg = COLOR4D::WHITE;
|
||||
|
||||
|
@ -307,12 +307,12 @@ void LIB_TEXT::Plot( PLOTTER* plotter, bool aBackground, const VECTOR2I& offset,
|
|||
color = color.Mix( bg, 0.5f );
|
||||
}
|
||||
|
||||
int penWidth = std::max( GetEffectiveTextPenWidth(), settings->GetMinPenWidth() );
|
||||
int penWidth = std::max( GetEffectiveTextPenWidth(), renderSettings->GetMinPenWidth() );
|
||||
|
||||
KIFONT::FONT* font = GetFont();
|
||||
|
||||
if( !font )
|
||||
font = KIFONT::FONT::GetFont( settings->GetDefaultFont(), IsBold(), IsItalic() );
|
||||
font = KIFONT::FONT::GetFont( renderSettings->GetDefaultFont(), IsBold(), IsItalic() );
|
||||
|
||||
attrs.m_StrokeWidth = penWidth;
|
||||
attrs.m_Angle = t1 ? ANGLE_HORIZONTAL : ANGLE_VERTICAL;
|
||||
|
@ -338,8 +338,8 @@ KIFONT::FONT* LIB_TEXT::getDrawFont() const
|
|||
}
|
||||
|
||||
|
||||
void LIB_TEXT::print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset,
|
||||
bool aForceNoFill, bool aDimmed )
|
||||
void LIB_TEXT::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
wxDC* DC = aSettings->GetPrintDC();
|
||||
COLOR4D color = GetTextColor();
|
||||
|
|
|
@ -103,8 +103,11 @@ public:
|
|||
|
||||
void NormalizeJustification( bool inverse );
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffset,
|
||||
const TRANSFORM& aTransform, bool aDimmed ) const override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
@ -129,9 +132,6 @@ private:
|
|||
* - Text height.
|
||||
*/
|
||||
int compare( const LIB_ITEM& aOther, int aCompareFlags = 0 ) const override;
|
||||
|
||||
void print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset, bool aForceNoFill,
|
||||
bool aDimmed ) override;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -249,8 +249,8 @@ KIFONT::FONT* LIB_TEXTBOX::getDrawFont() const
|
|||
}
|
||||
|
||||
|
||||
void LIB_TEXTBOX::print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset,
|
||||
bool aForceNoFill, bool aDimmed )
|
||||
void LIB_TEXTBOX::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
if( IsPrivate() )
|
||||
return;
|
||||
|
@ -413,8 +413,8 @@ BITMAPS LIB_TEXTBOX::GetMenuImage() const
|
|||
}
|
||||
|
||||
|
||||
void LIB_TEXTBOX::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffset,
|
||||
const TRANSFORM& aTransform, bool aDimmed ) const
|
||||
void LIB_TEXTBOX::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
wxASSERT( aPlotter != nullptr );
|
||||
|
||||
|
@ -423,14 +423,14 @@ void LIB_TEXTBOX::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOf
|
|||
|
||||
if( aBackground )
|
||||
{
|
||||
LIB_SHAPE::Plot( aPlotter, aBackground, aOffset, aTransform, aDimmed );
|
||||
LIB_SHAPE::Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
|
||||
return;
|
||||
}
|
||||
|
||||
RENDER_SETTINGS* renderSettings = aPlotter->RenderSettings();
|
||||
VECTOR2I start = aTransform.TransformCoordinate( m_start ) + aOffset;
|
||||
VECTOR2I end = aTransform.TransformCoordinate( m_end ) + aOffset;
|
||||
COLOR4D bg = renderSettings->GetBackgroundColor();
|
||||
SCH_RENDER_SETTINGS* renderSettings = getRenderSettings( aPlotter );
|
||||
VECTOR2I start = renderSettings->TransformCoordinate( m_start ) + aOffset;
|
||||
VECTOR2I end = renderSettings->TransformCoordinate( m_end ) + aOffset;
|
||||
COLOR4D bg = renderSettings->GetBackgroundColor();
|
||||
|
||||
if( bg == COLOR4D::UNSPECIFIED || !aPlotter->GetColorMode() )
|
||||
bg = COLOR4D::WHITE;
|
||||
|
@ -479,7 +479,7 @@ void LIB_TEXTBOX::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOf
|
|||
|
||||
penWidth = std::max( GetEffectiveTextPenWidth(), aPlotter->RenderSettings()->GetMinPenWidth() );
|
||||
|
||||
if( aTransform.y1 )
|
||||
if( renderSettings->m_Transform.y1 )
|
||||
{
|
||||
text.SetTextAngle( text.GetTextAngle() == ANGLE_HORIZONTAL ? ANGLE_VERTICAL
|
||||
: ANGLE_HORIZONTAL );
|
||||
|
|
|
@ -94,8 +94,11 @@ public:
|
|||
|
||||
BITMAPS GetMenuImage() const override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& offset,
|
||||
const TRANSFORM& aTransform, bool aDimmed ) const override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
EDA_ITEM* Clone() const override
|
||||
{
|
||||
|
@ -116,9 +119,6 @@ protected:
|
|||
private:
|
||||
int compare( const LIB_ITEM& aOther, int aCompareFlags = 0 ) const override;
|
||||
|
||||
void print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset, bool aForceNoFill,
|
||||
bool aDimmed ) override;
|
||||
|
||||
private:
|
||||
int m_marginLeft;
|
||||
int m_marginTop;
|
||||
|
|
|
@ -79,7 +79,7 @@ static wxString GetNetNavigatorItemText( const SCH_ITEM* aItem,
|
|||
const SCH_PIN* pin = static_cast<const SCH_PIN*>( aItem );
|
||||
wxCHECK( pin, retv );
|
||||
|
||||
SCH_SYMBOL* symbol = pin->GetParentSymbol();
|
||||
const SYMBOL* symbol = pin->GetParentSymbol();
|
||||
wxCHECK( symbol, retv );
|
||||
|
||||
retv.Printf( _( "Symbol '%s' pin '%s'" ), symbol->GetRef( &aSheetPath, true ),
|
||||
|
|
|
@ -236,13 +236,11 @@ void NETLIST_EXPORTER_ALLEGRO::extractComponentsInfo()
|
|||
{
|
||||
if( item->Type() == SCH_PIN_T )
|
||||
{
|
||||
SCH_PIN* pin = static_cast<SCH_PIN*>( item );
|
||||
SCH_SYMBOL* symbol = pin->GetParentSymbol();
|
||||
SCH_PIN* pin = static_cast<SCH_PIN*>( item );
|
||||
SYMBOL* symbol = pin->GetParentSymbol();
|
||||
|
||||
if( !symbol || symbol->GetExcludedFromBoard() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
net_record->m_Nodes.emplace_back( pin, sheet, nc );
|
||||
}
|
||||
|
@ -320,8 +318,8 @@ void NETLIST_EXPORTER_ALLEGRO::toAllegroPackages()
|
|||
for( auto it = m_orderedSymbolsSheetpath.begin(); it != m_orderedSymbolsSheetpath.end();
|
||||
++it )
|
||||
{
|
||||
if( it->first->GetValueFieldText( false, &it->second, false )
|
||||
!= first_ele.first->GetValueFieldText( false, &first_ele.second, false ) )
|
||||
if( it->first->GetValue( false, &it->second, false )
|
||||
!= first_ele.first->GetValue( false, &first_ele.second, false ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -369,7 +367,7 @@ void NETLIST_EXPORTER_ALLEGRO::toAllegroPackages()
|
|||
SCH_SYMBOL* sym = ( beginIter->second ).first;
|
||||
SCH_SHEET_PATH sheetPath = ( beginIter->second ).second;
|
||||
|
||||
wxString valueText = sym->GetValueFieldText( false, &sheetPath, false );
|
||||
wxString valueText = sym->GetValue( false, &sheetPath, false );
|
||||
wxString footprintText = sym->GetFootprintFieldText( false, &sheetPath, false);
|
||||
wxString deviceType = valueText + wxString("_") + footprintText;
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ bool NETLIST_EXPORTER_CADSTAR::WriteNetlist( const wxString& aOutFileName,
|
|||
ret |= fprintf( f, "%s ", TO_UTF8( StartCmpDesc ) );
|
||||
ret |= fprintf( f, "%s", TO_UTF8( msg ) );
|
||||
|
||||
msg = symbol->GetValueFieldText( true, &sheetList[ i ], false );
|
||||
msg = symbol->GetValue( true, &sheetList[ i ], false );
|
||||
msg.Replace( wxT( " " ), wxT( "_" ) );
|
||||
ret |= fprintf( f, " \"%s\"", TO_UTF8( msg ) );
|
||||
ret |= fprintf( f, " \"%s\"", TO_UTF8( footprint ) );
|
||||
|
|
|
@ -102,7 +102,7 @@ bool NETLIST_EXPORTER_ORCADPCB2::WriteNetlist( const wxString& aOutFileName,
|
|||
|
||||
ret |= fprintf( f, " %s", TO_UTF8( field ) );
|
||||
|
||||
field = symbol->GetValueFieldText( true, &sheet, false );
|
||||
field = symbol->GetValue( true, &sheet, false );
|
||||
field.Replace( wxT( " " ), wxT( "_" ) );
|
||||
|
||||
ret |= fprintf( f, " %s", TO_UTF8( field ) );
|
||||
|
|
|
@ -78,7 +78,7 @@ bool NETLIST_EXPORTER_PADS::WriteNetlist( const wxString& aOutFileName,
|
|||
if( footprint.IsEmpty() )
|
||||
{
|
||||
// fall back to value field
|
||||
footprint = symbol->GetValueFieldText( true, &sheetList[i], false );
|
||||
footprint = symbol->GetValue( true, &sheetList[i], false );
|
||||
footprint.Replace( wxT( " " ), wxT( "_" ) );
|
||||
footprint = footprint.Trim( true );
|
||||
footprint = footprint.Trim( false );
|
||||
|
|
|
@ -120,7 +120,7 @@ void NETLIST_EXPORTER_XML::addSymbolFields( XNODE* aNode, SCH_SYMBOL* aSymbol,
|
|||
{
|
||||
for( SCH_ITEM* item : sheetList[i].LastScreen()->Items().OfType( SCH_SYMBOL_T ) )
|
||||
{
|
||||
SCH_SYMBOL* symbol2 = (SCH_SYMBOL*) item;
|
||||
SCH_SYMBOL* symbol2 = static_cast<SCH_SYMBOL*>( item );
|
||||
|
||||
wxString ref2 = symbol2->GetRef( &sheetList[i] );
|
||||
|
||||
|
@ -132,7 +132,7 @@ void NETLIST_EXPORTER_XML::addSymbolFields( XNODE* aNode, SCH_SYMBOL* aSymbol,
|
|||
// The lowest unit number wins. User should only set fields in any one unit.
|
||||
|
||||
// Value
|
||||
candidate = symbol2->GetValueFieldText( m_resolveTextVars, &sheetList[i], false );
|
||||
candidate = symbol2->GetValue( m_resolveTextVars, &sheetList[i], false );
|
||||
|
||||
if( !candidate.IsEmpty() && ( unit < minUnit || value.IsEmpty() ) )
|
||||
value = candidate;
|
||||
|
@ -179,7 +179,7 @@ void NETLIST_EXPORTER_XML::addSymbolFields( XNODE* aNode, SCH_SYMBOL* aSymbol,
|
|||
}
|
||||
else
|
||||
{
|
||||
value = aSymbol->GetValueFieldText( m_resolveTextVars, aSheet, false );
|
||||
value = aSymbol->GetValue( m_resolveTextVars, aSheet, false );
|
||||
footprint = aSymbol->GetFootprintFieldText( m_resolveTextVars, aSheet, false );
|
||||
|
||||
SCH_FIELD* datasheetField = aSymbol->GetField( DATASHEET_FIELD );
|
||||
|
@ -724,8 +724,8 @@ XNODE* NETLIST_EXPORTER_XML::makeListOfNets( unsigned aCtl )
|
|||
{
|
||||
if( item->Type() == SCH_PIN_T )
|
||||
{
|
||||
SCH_PIN* pin = static_cast<SCH_PIN*>( item );
|
||||
SCH_SYMBOL* symbol = pin->GetParentSymbol();
|
||||
SCH_PIN* pin = static_cast<SCH_PIN*>( item );
|
||||
SYMBOL* symbol = pin->GetParentSymbol();
|
||||
|
||||
if( !symbol
|
||||
|| ( ( aCtl & GNL_OPT_BOM ) && symbol->GetExcludedFromBOM() )
|
||||
|
|
|
@ -134,7 +134,8 @@ const BOX2I SCH_BITMAP::GetBoundingBox() const
|
|||
}
|
||||
|
||||
|
||||
void SCH_BITMAP::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
void SCH_BITMAP::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
VECTOR2I pos = m_pos + aOffset;
|
||||
|
||||
|
@ -203,8 +204,8 @@ bool SCH_BITMAP::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) c
|
|||
}
|
||||
|
||||
|
||||
void SCH_BITMAP::Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const
|
||||
void SCH_BITMAP::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
if( aBackground )
|
||||
{
|
||||
|
|
|
@ -93,8 +93,6 @@ public:
|
|||
|
||||
void SwapData( SCH_ITEM* aItem ) override;
|
||||
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
|
||||
|
||||
/// @copydoc VIEW_ITEM::ViewGetLayers()
|
||||
virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
|
||||
|
||||
|
@ -150,8 +148,11 @@ public:
|
|||
bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
|
||||
bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
EDA_ITEM* Clone() const override;
|
||||
|
||||
|
|
|
@ -265,7 +265,8 @@ void SCH_BUS_BUS_ENTRY::GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemLis
|
|||
}
|
||||
|
||||
|
||||
void SCH_BUS_ENTRY_BASE::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
void SCH_BUS_ENTRY_BASE::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
wxDC* DC = aSettings->GetPrintDC();
|
||||
COLOR4D color = ( GetBusEntryColor() == COLOR4D::UNSPECIFIED ) ?
|
||||
|
@ -490,20 +491,20 @@ bool SCH_BUS_ENTRY_BASE::HitTest( const BOX2I& aRect, bool aContained, int aAccu
|
|||
}
|
||||
|
||||
|
||||
void SCH_BUS_ENTRY_BASE::Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const
|
||||
void SCH_BUS_ENTRY_BASE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
if( aBackground )
|
||||
return;
|
||||
|
||||
SCH_RENDER_SETTINGS* cfg = static_cast<SCH_RENDER_SETTINGS*>( aPlotter->RenderSettings() );
|
||||
SCH_RENDER_SETTINGS* renderSettings = getRenderSettings( aPlotter );
|
||||
|
||||
COLOR4D color = ( GetBusEntryColor() == COLOR4D::UNSPECIFIED ) ? cfg->GetLayerColor( m_layer )
|
||||
: GetBusEntryColor();
|
||||
COLOR4D color = ( GetBusEntryColor() == COLOR4D::UNSPECIFIED )
|
||||
? renderSettings->GetLayerColor( m_layer ) : GetBusEntryColor();
|
||||
|
||||
int penWidth = ( GetPenWidth() == 0 ) ? cfg->GetDefaultPenWidth() : GetPenWidth();
|
||||
int penWidth = ( GetPenWidth() == 0 ) ? renderSettings->GetDefaultPenWidth() : GetPenWidth();
|
||||
|
||||
penWidth = std::max( penWidth, cfg->GetMinPenWidth() );
|
||||
penWidth = std::max( penWidth, renderSettings->GetMinPenWidth() );
|
||||
|
||||
aPlotter->SetCurrentLineWidth( penWidth );
|
||||
aPlotter->SetColor( color );
|
||||
|
|
|
@ -91,8 +91,6 @@ public:
|
|||
|
||||
void ViewGetLayers( int aLayers[], int& aCount ) const override;
|
||||
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
|
||||
|
||||
const BOX2I GetBoundingBox() const override;
|
||||
|
||||
void Move( const VECTOR2I& aMoveVector ) override
|
||||
|
@ -125,8 +123,11 @@ public:
|
|||
|
||||
bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
|
|
|
@ -326,10 +326,11 @@ bool SCH_CONNECTION::IsDriver() const
|
|||
|
||||
case SCH_PIN_T:
|
||||
{
|
||||
SCH_PIN* pin = static_cast<SCH_PIN*>( Parent() );
|
||||
const SCH_PIN* pin = static_cast<const SCH_PIN*>( Parent() );
|
||||
const SCH_SYMBOL* symbol = static_cast<const SCH_SYMBOL*>( pin->GetParentSymbol() );
|
||||
|
||||
// Only annotated symbols should drive nets.
|
||||
return pin->IsGlobalPower() || pin->GetParentSymbol()->IsAnnotated( &m_sheet );
|
||||
return pin->IsGlobalPower() || symbol->IsAnnotated( &m_sheet );
|
||||
}
|
||||
|
||||
default:
|
||||
|
|
|
@ -349,7 +349,8 @@ SCH_FIELD::GetRenderCache( const wxString& forResolvedText, const VECTOR2I& forP
|
|||
}
|
||||
|
||||
|
||||
void SCH_FIELD::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
void SCH_FIELD::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
SCH_SHEET_PATH* sheet = &Schematic()->CurrentSheet();
|
||||
wxDC* DC = aSettings->GetPrintDC();
|
||||
|
@ -1148,8 +1149,8 @@ bool SCH_FIELD::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) co
|
|||
}
|
||||
|
||||
|
||||
void SCH_FIELD::Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const
|
||||
void SCH_FIELD::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
SCH_SHEET_PATH* sheet = &Schematic()->CurrentSheet();
|
||||
|
||||
|
|
|
@ -219,8 +219,6 @@ public:
|
|||
GetRenderCache( const wxString& forResolvedText, const VECTOR2I& forPosition,
|
||||
TEXT_ATTRIBUTES& aAttrs ) const;
|
||||
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
|
||||
|
||||
void Move( const VECTOR2I& aMoveVector ) override
|
||||
{
|
||||
Offset( aMoveVector );
|
||||
|
@ -273,8 +271,11 @@ public:
|
|||
bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
|
||||
bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
EDA_ITEM* Clone() const override;
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <sch_draw_panel.h>
|
||||
#include <sch_edit_frame.h>
|
||||
#include <schematic.h>
|
||||
#include <symbol.h>
|
||||
#include <trace_helpers.h>
|
||||
#include <general.h>
|
||||
#include <netclass.h>
|
||||
|
@ -126,6 +127,22 @@ SCHEMATIC* SCH_ITEM::Schematic() const
|
|||
}
|
||||
|
||||
|
||||
const SYMBOL* SCH_ITEM::GetParentSymbol() const
|
||||
{
|
||||
wxCHECK( m_parent->Type() == SCH_SYMBOL_T, nullptr );
|
||||
|
||||
return static_cast<const SCH_SYMBOL*>( m_parent );
|
||||
}
|
||||
|
||||
|
||||
SYMBOL* SCH_ITEM::GetParentSymbol()
|
||||
{
|
||||
wxCHECK( m_parent->Type() == SCH_SYMBOL_T, nullptr );
|
||||
|
||||
return static_cast<SCH_SYMBOL*>( m_parent );
|
||||
}
|
||||
|
||||
|
||||
void SCH_ITEM::ViewGetLayers( int aLayers[], int& aCount ) const
|
||||
{
|
||||
// Basic fallback
|
||||
|
|
|
@ -35,15 +35,16 @@
|
|||
#include <stroke_params.h>
|
||||
#include <layer_ids.h>
|
||||
#include <sch_render_settings.h>
|
||||
#include <plotters/plotter.h>
|
||||
|
||||
class CONNECTION_GRAPH;
|
||||
class SCH_CONNECTION;
|
||||
class SCH_SHEET_PATH;
|
||||
class SCHEMATIC;
|
||||
class SYMBOL;
|
||||
class LINE_READER;
|
||||
class SCH_EDIT_FRAME;
|
||||
class PLOTTER;
|
||||
struct SCH_PLOT_SETTINGS;
|
||||
struct SCH_PLOT_OPTS;
|
||||
|
||||
namespace KIFONT
|
||||
{
|
||||
|
@ -245,6 +246,9 @@ public:
|
|||
*/
|
||||
SCHEMATIC* Schematic() const;
|
||||
|
||||
const SYMBOL* GetParentSymbol() const;
|
||||
SYMBOL* GetParentSymbol();
|
||||
|
||||
virtual bool IsLocked() const { return false; }
|
||||
virtual void SetLocked( bool aLocked ) {}
|
||||
|
||||
|
@ -291,50 +295,6 @@ public:
|
|||
wxCHECK_MSG( false, false, wxT( "operator== not implemented in " ) + GetClass() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Print a schematic item.
|
||||
*
|
||||
* Each schematic item should have its own method
|
||||
*
|
||||
* @param aOffset is the drawing offset (usually {0,0} but can be different when moving an
|
||||
* object).
|
||||
*/
|
||||
virtual void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
{
|
||||
wxCHECK_MSG( false, /*void*/, wxT( "Print not implemented in " ) + GetClass() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Print just the background fills.
|
||||
*/
|
||||
virtual void PrintBackground( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
{
|
||||
wxCHECK_MSG( false, /*void*/, wxT( "PrintBackground not implemented in " ) + GetClass() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Print item.
|
||||
*
|
||||
* @param aOffset - Position of the item.
|
||||
* @param aMulti - unit if multiple units per symbol.
|
||||
* @param aBodyStyle - Symbol alternate body style (DeMorgan) if available.
|
||||
* @param aDimmed - Reduce brightness
|
||||
*/
|
||||
virtual void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset,
|
||||
int aMulti, int aBodyStyle, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
wxCHECK_MSG( false, /*void*/, wxT( "Print not implemented in " ) + GetClass() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Print just the background fills.
|
||||
*/
|
||||
virtual void PrintBackground( const SCH_RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset,
|
||||
int aMulti, int aBodyStyle, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
wxCHECK_MSG( false, /*void*/, wxT( "PrintBackground not implemented in " ) + GetClass() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Move the item by \a aMoveVector to a new position.
|
||||
*/
|
||||
|
@ -551,26 +511,53 @@ public:
|
|||
virtual void SetStroke( const STROKE_PARAMS& aStroke ) { wxCHECK( false, /* void */ ); }
|
||||
|
||||
/**
|
||||
* Plot the schematic item to \a aPlotter.
|
||||
* Print an item.
|
||||
*
|
||||
* @param aPlotter is the #PLOTTER object to plot to.
|
||||
* @param aBackground a poor-man's Z-order. The routine will get called twice, first with
|
||||
* aBackground true and then with aBackground false.
|
||||
* @param aUnit - Which unit to print.
|
||||
* @param aBodyStyle - Which body style to print.
|
||||
* @param aOffset - Relative offset.
|
||||
* @param aForceNoFill - Disable printing of fills.
|
||||
* @param aDimmed - Reduce brightness of item.
|
||||
*/
|
||||
virtual void Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const
|
||||
virtual void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
wxCHECK_MSG( false, /*void*/, wxT( "Plot not implemented in " ) + GetClass() );
|
||||
wxCHECK_MSG( false, /*void*/, wxT( "Print not implemented in " ) + GetClass() );
|
||||
}
|
||||
|
||||
virtual void Plot( PLOTTER* aPlotter, int aUnit, int aBodyStyle, bool aBackground,
|
||||
const VECTOR2I& aOffset, const TRANSFORM& aTransform, bool aDimmed ) const
|
||||
/**
|
||||
* Print just the background fills.
|
||||
*/
|
||||
virtual void PrintBackground( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
wxCHECK_MSG( false, /*void*/, wxT( "PrintBackground not implemented in " ) + GetClass() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Plot the item to \a aPlotter.
|
||||
*
|
||||
* @param aBackground a poor-man's Z-order. The routine will get called twice, first with
|
||||
* aBackground true and then with aBackground false.
|
||||
* @param aUnit - which unit to print.
|
||||
* @param aBodyStyle - which body style to print.
|
||||
* @param aOffset relative offset.
|
||||
* @param aDimmed reduce brightness of item.
|
||||
*/
|
||||
virtual void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed)
|
||||
{
|
||||
wxCHECK_MSG( false, /*void*/, wxT( "Plot not implemented in " ) + GetClass() );
|
||||
}
|
||||
|
||||
virtual bool operator <( const SCH_ITEM& aItem ) const;
|
||||
|
||||
protected:
|
||||
SCH_RENDER_SETTINGS* getRenderSettings( PLOTTER* aPlotter ) const
|
||||
{
|
||||
return static_cast<SCH_RENDER_SETTINGS*>( aPlotter->RenderSettings() );
|
||||
}
|
||||
|
||||
private:
|
||||
friend class CONNECTION_GRAPH;
|
||||
|
||||
|
|
|
@ -113,7 +113,8 @@ const BOX2I SCH_JUNCTION::GetBoundingBox() const
|
|||
}
|
||||
|
||||
|
||||
void SCH_JUNCTION::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
void SCH_JUNCTION::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
wxDC* DC = aSettings->GetPrintDC();
|
||||
COLOR4D color = GetJunctionColor();
|
||||
|
@ -253,8 +254,8 @@ bool SCH_JUNCTION::doIsConnected( const VECTOR2I& aPosition ) const
|
|||
}
|
||||
|
||||
|
||||
void SCH_JUNCTION::Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const
|
||||
void SCH_JUNCTION::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
if( aBackground )
|
||||
return;
|
||||
|
|
|
@ -69,8 +69,6 @@ public:
|
|||
|
||||
const BOX2I GetBoundingBox() const override;
|
||||
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
|
||||
|
||||
void Move( const VECTOR2I& aMoveVector ) override
|
||||
{
|
||||
m_pos += aMoveVector;
|
||||
|
@ -124,8 +122,11 @@ public:
|
|||
bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
|
||||
bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
EDA_ITEM* Clone() const override;
|
||||
|
||||
|
|
|
@ -1306,8 +1306,8 @@ void SCH_LABEL_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PA
|
|||
}
|
||||
|
||||
|
||||
void SCH_LABEL_BASE::Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const
|
||||
void SCH_LABEL_BASE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
static std::vector<VECTOR2I> s_poly;
|
||||
|
||||
|
@ -1370,7 +1370,7 @@ void SCH_LABEL_BASE::Plot( PLOTTER* aPlotter, bool aBackground,
|
|||
}
|
||||
|
||||
// Plot attributes to a hypertext menu
|
||||
if( aPlotSettings.m_PDFPropertyPopups )
|
||||
if( aPlotOpts.m_PDFPropertyPopups )
|
||||
{
|
||||
std::vector<wxString> properties;
|
||||
|
||||
|
@ -1401,12 +1401,13 @@ void SCH_LABEL_BASE::Plot( PLOTTER* aPlotter, bool aBackground,
|
|||
}
|
||||
}
|
||||
|
||||
for( const SCH_FIELD& field : m_fields )
|
||||
field.Plot( aPlotter, aBackground, aPlotSettings );
|
||||
for( SCH_FIELD& field : m_fields )
|
||||
field.Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
|
||||
}
|
||||
|
||||
|
||||
void SCH_LABEL_BASE::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
void SCH_LABEL_BASE::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
static std::vector<VECTOR2I> s_poly;
|
||||
|
||||
|
@ -1446,7 +1447,7 @@ void SCH_LABEL_BASE::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I
|
|||
}
|
||||
|
||||
for( SCH_FIELD& field : m_fields )
|
||||
field.Print( aSettings, aOffset );
|
||||
field.Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -321,10 +321,11 @@ public:
|
|||
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& offset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& offset ) override;
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
/**
|
||||
* @brief autoRotateOnPlacement
|
||||
|
|
|
@ -359,7 +359,8 @@ int SCH_LINE::GetPenWidth() const
|
|||
}
|
||||
|
||||
|
||||
void SCH_LINE::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& offset )
|
||||
void SCH_LINE::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& offset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
wxDC* DC = aSettings->GetPrintDC();
|
||||
COLOR4D color = GetLineColor();
|
||||
|
@ -897,18 +898,18 @@ bool SCH_LINE::doIsConnected( const VECTOR2I& aPosition ) const
|
|||
}
|
||||
|
||||
|
||||
void SCH_LINE::Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const
|
||||
void SCH_LINE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
if( aBackground )
|
||||
return;
|
||||
|
||||
auto* settings = static_cast<SCH_RENDER_SETTINGS*>( aPlotter->RenderSettings() );
|
||||
int penWidth = std::max( GetPenWidth(), settings->GetMinPenWidth() );
|
||||
COLOR4D color = GetLineColor();
|
||||
SCH_RENDER_SETTINGS* renderSettings = getRenderSettings( aPlotter );
|
||||
int penWidth = std::max( GetPenWidth(), renderSettings->GetMinPenWidth() );
|
||||
COLOR4D color = GetLineColor();
|
||||
|
||||
if( color == COLOR4D::UNSPECIFIED )
|
||||
color = settings->GetLayerColor( GetLayer() );
|
||||
color = renderSettings->GetLayerColor( GetLayer() );
|
||||
|
||||
aPlotter->SetColor( color );
|
||||
|
||||
|
@ -925,7 +926,7 @@ void SCH_LINE::Plot( PLOTTER* aPlotter, bool aBackground,
|
|||
BOX2I bbox = GetBoundingBox();
|
||||
bbox.Inflate( GetPenWidth() * 3 );
|
||||
|
||||
if( aPlotSettings.m_PDFPropertyPopups )
|
||||
if( aPlotOpts.m_PDFPropertyPopups )
|
||||
{
|
||||
if( GetLayer() == LAYER_WIRE )
|
||||
{
|
||||
|
|
|
@ -202,8 +202,6 @@ public:
|
|||
*/
|
||||
double GetLength() const;
|
||||
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
|
||||
|
||||
int GetPenWidth() const override;
|
||||
|
||||
void Move( const VECTOR2I& aMoveVector ) override;
|
||||
|
@ -289,8 +287,11 @@ public:
|
|||
bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
|
||||
bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
EDA_ITEM* Clone() const override;
|
||||
|
||||
|
|
|
@ -253,7 +253,8 @@ SEVERITY SCH_MARKER::GetSeverity() const
|
|||
}
|
||||
|
||||
|
||||
void SCH_MARKER::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
void SCH_MARKER::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
PrintMarker( aSettings, aOffset );
|
||||
}
|
||||
|
|
|
@ -62,10 +62,11 @@ public:
|
|||
|
||||
SEVERITY GetSeverity() const override;
|
||||
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* /* aPlotter */, bool /* aBackground */,
|
||||
const SCH_PLOT_SETTINGS& /* aPlotSettings */ ) const override
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override
|
||||
{
|
||||
// SCH_MARKERs should not be plotted. However, SCH_ITEM will fail an assertion if we
|
||||
// do not confirm this by locally implementing a no-op Plot().
|
||||
|
|
|
@ -102,7 +102,8 @@ int SCH_NO_CONNECT::GetPenWidth() const
|
|||
}
|
||||
|
||||
|
||||
void SCH_NO_CONNECT::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
void SCH_NO_CONNECT::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
wxDC* DC = aSettings->GetPrintDC();
|
||||
int half = GetSize() / 2;
|
||||
|
@ -188,8 +189,8 @@ bool SCH_NO_CONNECT::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy
|
|||
}
|
||||
|
||||
|
||||
void SCH_NO_CONNECT::Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const
|
||||
void SCH_NO_CONNECT::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
if( aBackground )
|
||||
return;
|
||||
|
|
|
@ -65,8 +65,6 @@ public:
|
|||
|
||||
void ViewGetLayers( int aLayers[], int& aCount ) const override;
|
||||
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
|
||||
|
||||
void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) override;
|
||||
|
||||
const BOX2I GetBoundingBox() const override;
|
||||
|
@ -108,8 +106,11 @@ public:
|
|||
bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
|
||||
bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
EDA_ITEM* Clone() const override;
|
||||
|
||||
|
|
|
@ -204,12 +204,6 @@ bool SCH_PIN::Replace( const EDA_SEARCH_DATA& aSearchData, void* aAuxData )
|
|||
}
|
||||
|
||||
|
||||
SCH_SYMBOL* SCH_PIN::GetParentSymbol() const
|
||||
{
|
||||
return static_cast<SCH_SYMBOL*>( GetParent() );
|
||||
}
|
||||
|
||||
|
||||
wxString SCH_PIN::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
|
||||
{
|
||||
LIB_PIN::ALT localStorage;
|
||||
|
@ -223,8 +217,11 @@ wxString SCH_PIN::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
|
|||
|
||||
wxString itemDesc = m_libPin ? m_libPin->GetItemDescription( aUnitsProvider, alt ) :
|
||||
wxString( wxS( "Undefined library pin." ) );
|
||||
|
||||
const SCH_SYMBOL* symbol = static_cast<const SCH_SYMBOL*>( GetParentSymbol() );
|
||||
|
||||
return wxString::Format( "Symbol %s %s",
|
||||
UnescapeString( GetParentSymbol()->GetField( REFERENCE_FIELD )->GetText() ),
|
||||
UnescapeString( symbol->GetField( REFERENCE_FIELD )->GetText() ),
|
||||
itemDesc );
|
||||
}
|
||||
|
||||
|
@ -232,25 +229,22 @@ wxString SCH_PIN::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
|
|||
void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxString msg;
|
||||
SCH_SYMBOL* symbol = GetParentSymbol();
|
||||
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( GetParentSymbol() );
|
||||
|
||||
aList.emplace_back( _( "Type" ), _( "Pin" ) );
|
||||
|
||||
if( LIB_SYMBOL* libSymbol = symbol->GetLibSymbolRef().get() )
|
||||
if( symbol->GetUnitCount() )
|
||||
{
|
||||
if( libSymbol->GetUnitCount() )
|
||||
{
|
||||
msg = m_libPin ? LIB_ITEM::GetUnitDescription( m_libPin->GetUnit() ) :
|
||||
wxString( "Undefined library pin." );
|
||||
aList.emplace_back( _( "Unit" ), msg );
|
||||
}
|
||||
msg = m_libPin ? LIB_ITEM::GetUnitDescription( m_libPin->GetUnit() ) :
|
||||
wxString( "Undefined library pin." );
|
||||
aList.emplace_back( _( "Unit" ), msg );
|
||||
}
|
||||
|
||||
if( libSymbol->HasAlternateBodyStyle() )
|
||||
{
|
||||
msg = m_libPin ? LIB_ITEM::GetBodyStyleDescription( m_libPin->GetBodyStyle() ) :
|
||||
wxString( "Undefined library pin." );
|
||||
aList.emplace_back( _( "Body Style" ), msg );
|
||||
}
|
||||
if( symbol->HasAlternateBodyStyle() )
|
||||
{
|
||||
msg = m_libPin ? LIB_ITEM::GetBodyStyleDescription( m_libPin->GetBodyStyle() ) :
|
||||
wxString( "Undefined library pin." );
|
||||
aList.emplace_back( _( "Body Style" ), msg );
|
||||
}
|
||||
|
||||
aList.emplace_back( _( "Name" ), GetShownName() );
|
||||
|
@ -280,7 +274,6 @@ void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITE
|
|||
conn->AppendInfoToMsgPanel( aList );
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -314,14 +307,15 @@ void SCH_PIN::ClearDefaultNetName( const SCH_SHEET_PATH* aPath )
|
|||
|
||||
wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH& aPath, bool aForceNoConnect )
|
||||
{
|
||||
const SCH_SYMBOL* symbol = static_cast<const SCH_SYMBOL*>( GetParentSymbol() );
|
||||
|
||||
// Need to check for parent as power symbol to make sure we aren't dealing
|
||||
// with legacy global power pins on non-power symbols
|
||||
if( IsGlobalPower() )
|
||||
{
|
||||
if( GetLibPin()->GetParentSymbol()->IsPower() )
|
||||
{
|
||||
return EscapeString( GetParentSymbol()->GetValueFieldText( true, &aPath, false ),
|
||||
CTX_NETNAME );
|
||||
return EscapeString( symbol->GetValue( true, &aPath, false ), CTX_NETNAME );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -352,7 +346,7 @@ wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH& aPath, bool aForceNoC
|
|||
|
||||
bool annotated = true;
|
||||
|
||||
std::vector<SCH_PIN*> pins = GetParentSymbol()->GetPins( &aPath );
|
||||
std::vector<SCH_PIN*> pins = symbol->GetPins( &aPath );
|
||||
bool has_multiple = false;
|
||||
|
||||
for( SCH_PIN* pin : pins )
|
||||
|
@ -370,7 +364,7 @@ wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH& aPath, bool aForceNoC
|
|||
wxString libPinShownNumber = m_libPin ? m_libPin->GetShownNumber() : wxString( "??" );
|
||||
|
||||
// Use timestamp for unannotated symbols
|
||||
if( GetParentSymbol()->GetRef( &aPath, false ).Last() == '?' )
|
||||
if( symbol->GetRef( &aPath, false ).Last() == '?' )
|
||||
{
|
||||
name << GetParentSymbol()->m_Uuid.AsString();
|
||||
|
||||
|
@ -382,7 +376,7 @@ wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH& aPath, bool aForceNoC
|
|||
{
|
||||
// Pin names might not be unique between different units so we must have the
|
||||
// unit token in the reference designator
|
||||
name << GetParentSymbol()->GetRef( &aPath, true );
|
||||
name << symbol->GetRef( &aPath, true );
|
||||
name << "-" << EscapeString( libPinShownName, CTX_NETNAME );
|
||||
|
||||
if( unconnected || has_multiple )
|
||||
|
@ -393,7 +387,7 @@ wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH& aPath, bool aForceNoC
|
|||
else
|
||||
{
|
||||
// Pin numbers are unique, so we skip the unit token
|
||||
name << GetParentSymbol()->GetRef( &aPath, false );
|
||||
name << symbol->GetRef( &aPath, false );
|
||||
name << "-Pad" << EscapeString( libPinShownNumber, CTX_NETNAME ) << ")";
|
||||
}
|
||||
|
||||
|
@ -406,7 +400,7 @@ wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH& aPath, bool aForceNoC
|
|||
|
||||
VECTOR2I SCH_PIN::GetTransformedPosition() const
|
||||
{
|
||||
TRANSFORM t = GetParentSymbol()->GetTransform();
|
||||
TRANSFORM t = static_cast<const SCH_SYMBOL*>( GetParentSymbol() )->GetTransform();
|
||||
return t.TransformCoordinate( GetLocalPosition() ) + GetParentSymbol()->GetPosition();
|
||||
}
|
||||
|
||||
|
@ -414,14 +408,11 @@ VECTOR2I SCH_PIN::GetTransformedPosition() const
|
|||
const BOX2I SCH_PIN::GetBoundingBox( bool aIncludeInvisiblePins, bool aIncludeNameAndNumber,
|
||||
bool aIncludeElectricalType ) const
|
||||
{
|
||||
TRANSFORM t = GetParentSymbol()->GetTransform();
|
||||
BOX2I r;
|
||||
wxCHECK( m_libPin, BOX2I() );
|
||||
|
||||
if( m_libPin )
|
||||
r = m_libPin->GetBoundingBox( aIncludeInvisiblePins, aIncludeNameAndNumber,
|
||||
aIncludeElectricalType );
|
||||
else
|
||||
wxFAIL;
|
||||
TRANSFORM t = static_cast<const SCH_SYMBOL*>( GetParentSymbol() )->GetTransform();
|
||||
BOX2I r = m_libPin->GetBoundingBox( aIncludeInvisiblePins, aIncludeNameAndNumber,
|
||||
aIncludeElectricalType );
|
||||
|
||||
r.RevertYAxis();
|
||||
|
||||
|
|
|
@ -54,8 +54,6 @@ public:
|
|||
return wxT( "SCH_PIN" );
|
||||
}
|
||||
|
||||
SCH_SYMBOL* GetParentSymbol() const;
|
||||
|
||||
LIB_PIN* GetLibPin() const { return m_libPin; }
|
||||
|
||||
void ClearDefaultNetName( const SCH_SHEET_PATH* aPath );
|
||||
|
@ -71,7 +69,8 @@ public:
|
|||
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override {}
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override {}
|
||||
|
||||
void Move( const VECTOR2I& aMoveVector ) override {}
|
||||
|
||||
|
|
|
@ -84,11 +84,13 @@ SCH_PLOTTER::SCH_PLOTTER( SCH_EDIT_FRAME* aFrame ) :
|
|||
}
|
||||
|
||||
|
||||
wxFileName SCH_PLOTTER::getOutputFilenameSingle( const SCH_PLOT_SETTINGS& aPlotSettings,
|
||||
REPORTER* aReporter, const wxString& aExt )
|
||||
wxFileName SCH_PLOTTER::getOutputFilenameSingle( const SCH_PLOT_OPTS& aPlotOpts,
|
||||
REPORTER* aReporter, const wxString& aExt )
|
||||
{
|
||||
if( !aPlotSettings.m_outputFile.empty() )
|
||||
return aPlotSettings.m_outputFile;
|
||||
if( !aPlotOpts.m_outputFile.empty() )
|
||||
{
|
||||
return aPlotOpts.m_outputFile;
|
||||
}
|
||||
else
|
||||
{
|
||||
wxString fname = m_schematic->GetUniqueFilenameForCurrentSheet();
|
||||
|
@ -99,14 +101,14 @@ wxFileName SCH_PLOTTER::getOutputFilenameSingle( const SCH_PLOT_SETTINGS& aPlotS
|
|||
fname.Replace( "/", "_" );
|
||||
fname.Replace( "\\", "_" );
|
||||
|
||||
return createPlotFileName( aPlotSettings, fname, aExt, aReporter );
|
||||
return createPlotFileName( aPlotOpts, fname, aExt, aReporter );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void SCH_PLOTTER::createPDFFile( const SCH_PLOT_SETTINGS& aPlotSettings,
|
||||
RENDER_SETTINGS* aRenderSettings, REPORTER* aReporter )
|
||||
void SCH_PLOTTER::createPDFFile( const SCH_PLOT_OPTS& aPlotOpts,
|
||||
SCH_RENDER_SETTINGS* aRenderSettings, REPORTER* aReporter )
|
||||
{
|
||||
SCH_SHEET_PATH oldsheetpath = m_schematic->CurrentSheet(); // sheetpath is saved here
|
||||
|
||||
|
@ -117,14 +119,14 @@ void SCH_PLOTTER::createPDFFile( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
*/
|
||||
SCH_SHEET_LIST sheetList;
|
||||
|
||||
if( aPlotSettings.m_plotAll || aPlotSettings.m_plotPages.size() > 0 )
|
||||
if( aPlotOpts.m_plotAll || aPlotOpts.m_plotPages.size() > 0 )
|
||||
{
|
||||
sheetList.BuildSheetList( &m_schematic->Root(), true );
|
||||
sheetList.SortByPageNumbers();
|
||||
|
||||
// remove the non-selected pages if we are in plot pages mode
|
||||
if( aPlotSettings.m_plotPages.size() > 0 )
|
||||
sheetList.TrimToPageNumbers( aPlotSettings.m_plotPages );
|
||||
if( aPlotOpts.m_plotPages.size() > 0 )
|
||||
sheetList.TrimToPageNumbers( aPlotOpts.m_plotPages );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -135,7 +137,7 @@ void SCH_PLOTTER::createPDFFile( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
// Allocate the plotter and set the job level parameter
|
||||
PDF_PLOTTER* plotter = new PDF_PLOTTER();
|
||||
plotter->SetRenderSettings( aRenderSettings );
|
||||
plotter->SetColorMode( !aPlotSettings.m_blackAndWhite );
|
||||
plotter->SetColorMode( !aPlotOpts.m_blackAndWhite );
|
||||
plotter->SetCreator( wxT( "Eeschema-PDF" ) );
|
||||
plotter->SetTitle( ExpandTextVars( m_schematic->RootScreen()->GetTitleBlock().GetTitle(),
|
||||
&m_schematic->Prj() ) );
|
||||
|
@ -153,7 +155,7 @@ void SCH_PLOTTER::createPDFFile( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
SCH_SCREEN* screen = m_schematic->CurrentSheet().LastScreen();
|
||||
wxString sheetName = sheetList[i].Last()->GetFields()[SHEETNAME].GetShownText( false );
|
||||
|
||||
if( aPlotSettings.m_PDFMetadata )
|
||||
if( aPlotOpts.m_PDFMetadata )
|
||||
{
|
||||
msg = wxS( "AUTHOR" );
|
||||
|
||||
|
@ -171,7 +173,7 @@ void SCH_PLOTTER::createPDFFile( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
try
|
||||
{
|
||||
wxString ext = PDF_PLOTTER::GetDefaultFileExtension();
|
||||
plotFileName = getOutputFilenameSingle( aPlotSettings, aReporter, ext );
|
||||
plotFileName = getOutputFilenameSingle( aPlotOpts, aReporter, ext );
|
||||
|
||||
m_lastOutputFilePath = plotFileName.GetFullPath();
|
||||
|
||||
|
@ -191,7 +193,7 @@ void SCH_PLOTTER::createPDFFile( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
}
|
||||
|
||||
// Open the plotter and do the first page
|
||||
setupPlotPagePDF( plotter, screen, aPlotSettings );
|
||||
setupPlotPagePDF( plotter, screen, aPlotOpts );
|
||||
|
||||
plotter->StartPlot( sheetList[i].GetPageNumber(), sheetName );
|
||||
}
|
||||
|
@ -213,11 +215,11 @@ void SCH_PLOTTER::createPDFFile( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
/* For the following pages you need to close the (finished) page,
|
||||
* reconfigure, and then start a new one */
|
||||
plotter->ClosePage();
|
||||
setupPlotPagePDF( plotter, screen, aPlotSettings );
|
||||
setupPlotPagePDF( plotter, screen, aPlotOpts );
|
||||
plotter->StartPage( sheetList[i].GetPageNumber(), sheetName );
|
||||
}
|
||||
|
||||
plotOneSheetPDF( plotter, screen, aPlotSettings );
|
||||
plotOneSheetPDF( plotter, screen, aPlotOpts );
|
||||
}
|
||||
|
||||
// Everything done, close the plot and restore the environment
|
||||
|
@ -233,9 +235,9 @@ void SCH_PLOTTER::createPDFFile( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
|
||||
|
||||
void SCH_PLOTTER::plotOneSheetPDF( PLOTTER* aPlotter, SCH_SCREEN* aScreen,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings )
|
||||
const SCH_PLOT_OPTS& aPlotOpts )
|
||||
{
|
||||
if( aPlotSettings.m_useBackgroundColor && aPlotter->GetColorMode() )
|
||||
if( aPlotOpts.m_useBackgroundColor && aPlotter->GetColorMode() )
|
||||
{
|
||||
aPlotter->SetColor( aPlotter->RenderSettings()->GetBackgroundColor() );
|
||||
VECTOR2I end( aPlotter->PageSettings().GetWidthIU( schIUScale.IU_PER_MILS ),
|
||||
|
@ -243,7 +245,7 @@ void SCH_PLOTTER::plotOneSheetPDF( PLOTTER* aPlotter, SCH_SCREEN* aScreen,
|
|||
aPlotter->Rect( VECTOR2I( 0, 0 ), end, FILL_T::FILLED_SHAPE, 1.0 );
|
||||
}
|
||||
|
||||
if( aPlotSettings.m_plotDrawingSheet )
|
||||
if( aPlotOpts.m_plotDrawingSheet )
|
||||
{
|
||||
COLOR4D color = COLOR4D::BLACK;
|
||||
|
||||
|
@ -262,19 +264,19 @@ void SCH_PLOTTER::plotOneSheetPDF( PLOTTER* aPlotter, SCH_SCREEN* aScreen,
|
|||
aScreen->GetFileName(), color, aScreen->GetVirtualPageNumber() == 1 );
|
||||
}
|
||||
|
||||
aScreen->Plot( aPlotter, aPlotSettings );
|
||||
aScreen->Plot( aPlotter, aPlotOpts );
|
||||
}
|
||||
|
||||
|
||||
void SCH_PLOTTER::setupPlotPagePDF( PLOTTER* aPlotter, SCH_SCREEN* aScreen,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings )
|
||||
const SCH_PLOT_OPTS& aPlotOpts )
|
||||
{
|
||||
PAGE_INFO plotPage; // page size selected to plot
|
||||
|
||||
// Considerations on page size and scaling requests
|
||||
const PAGE_INFO& actualPage = aScreen->GetPageSettings(); // page size selected in schematic
|
||||
|
||||
switch( aPlotSettings.m_pageSizeSelect )
|
||||
switch( aPlotOpts.m_pageSizeSelect )
|
||||
{
|
||||
case PAGE_SIZE_A:
|
||||
plotPage.SetType( wxT( "A" ) );
|
||||
|
@ -302,8 +304,8 @@ void SCH_PLOTTER::setupPlotPagePDF( PLOTTER* aPlotter, SCH_SCREEN* aScreen,
|
|||
}
|
||||
|
||||
|
||||
void SCH_PLOTTER::createPSFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
||||
RENDER_SETTINGS* aRenderSettings, REPORTER* aReporter )
|
||||
void SCH_PLOTTER::createPSFiles( const SCH_PLOT_OPTS& aPlotOpts,
|
||||
SCH_RENDER_SETTINGS* aRenderSettings, REPORTER* aReporter )
|
||||
{
|
||||
SCH_SHEET_PATH oldsheetpath = m_schematic->CurrentSheet(); // sheetpath is saved here
|
||||
PAGE_INFO plotPage; // page size selected to plot
|
||||
|
@ -317,15 +319,15 @@ void SCH_PLOTTER::createPSFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
*/
|
||||
SCH_SHEET_LIST sheetList;
|
||||
|
||||
if( aPlotSettings.m_plotAll )
|
||||
if( aPlotOpts.m_plotAll )
|
||||
{
|
||||
sheetList.BuildSheetList( &m_schematic->Root(), true );
|
||||
sheetList.SortByPageNumbers();
|
||||
|
||||
// remove the non-selected pages if we are in plot pages mode
|
||||
if( aPlotSettings.m_plotPages.size() > 0 )
|
||||
if( aPlotOpts.m_plotPages.size() > 0 )
|
||||
{
|
||||
sheetList.TrimToPageNumbers( aPlotSettings.m_plotPages );
|
||||
sheetList.TrimToPageNumbers( aPlotOpts.m_plotPages );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -342,7 +344,7 @@ void SCH_PLOTTER::createPSFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
SCH_SCREEN* screen = m_schematic->CurrentSheet().LastScreen();
|
||||
PAGE_INFO actualPage = screen->GetPageSettings();
|
||||
|
||||
switch( aPlotSettings.m_pageSizeSelect )
|
||||
switch( aPlotOpts.m_pageSizeSelect )
|
||||
{
|
||||
case PAGE_SIZE_A:
|
||||
plotPage.SetType( wxT( "A" ) );
|
||||
|
@ -373,7 +375,7 @@ void SCH_PLOTTER::createPSFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
fname.Replace( "/", "_" );
|
||||
fname.Replace( "\\", "_" );
|
||||
wxString ext = PS_PLOTTER::GetDefaultFileExtension();
|
||||
wxFileName plotFileName = createPlotFileName( aPlotSettings, fname, ext, aReporter );
|
||||
wxFileName plotFileName = createPlotFileName( aPlotOpts, fname, ext, aReporter );
|
||||
|
||||
m_lastOutputFilePath = plotFileName.GetFullPath();
|
||||
|
||||
|
@ -381,7 +383,7 @@ void SCH_PLOTTER::createPSFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
return;
|
||||
|
||||
if( plotOneSheetPS( plotFileName.GetFullPath(), screen, aRenderSettings, actualPage,
|
||||
plot_offset, scale, aPlotSettings ) )
|
||||
plot_offset, scale, aPlotOpts ) )
|
||||
{
|
||||
if( aReporter )
|
||||
{
|
||||
|
@ -419,14 +421,14 @@ void SCH_PLOTTER::createPSFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
|
||||
|
||||
bool SCH_PLOTTER::plotOneSheetPS( const wxString& aFileName, SCH_SCREEN* aScreen,
|
||||
RENDER_SETTINGS* aRenderSettings,
|
||||
const PAGE_INFO& aPageInfo, const VECTOR2I& aPlot0ffset,
|
||||
double aScale, const SCH_PLOT_SETTINGS& aPlotSettings )
|
||||
RENDER_SETTINGS* aRenderSettings, const PAGE_INFO& aPageInfo,
|
||||
const VECTOR2I& aPlot0ffset, double aScale,
|
||||
const SCH_PLOT_OPTS& aPlotOpts )
|
||||
{
|
||||
PS_PLOTTER* plotter = new PS_PLOTTER();
|
||||
plotter->SetRenderSettings( aRenderSettings );
|
||||
plotter->SetPageSettings( aPageInfo );
|
||||
plotter->SetColorMode( !aPlotSettings.m_blackAndWhite );
|
||||
plotter->SetColorMode( !aPlotOpts.m_blackAndWhite );
|
||||
|
||||
// Currently, plot units are in decimil
|
||||
plotter->SetViewport( aPlot0ffset, schIUScale.IU_PER_MILS / 10, aScale, false );
|
||||
|
@ -444,7 +446,7 @@ bool SCH_PLOTTER::plotOneSheetPS( const wxString& aFileName, SCH_SCREEN* aScreen
|
|||
|
||||
plotter->StartPlot( m_schematic->CurrentSheet().GetPageNumber() );
|
||||
|
||||
if( aPlotSettings.m_useBackgroundColor && plotter->GetColorMode() )
|
||||
if( aPlotOpts.m_useBackgroundColor && plotter->GetColorMode() )
|
||||
{
|
||||
plotter->SetColor( plotter->RenderSettings()->GetLayerColor( LAYER_SCHEMATIC_BACKGROUND ) );
|
||||
|
||||
|
@ -453,7 +455,7 @@ bool SCH_PLOTTER::plotOneSheetPS( const wxString& aFileName, SCH_SCREEN* aScreen
|
|||
plotter->Rect( VECTOR2I( 0, 0 ), end, FILL_T::FILLED_SHAPE, 1.0 );
|
||||
}
|
||||
|
||||
if( aPlotSettings.m_plotDrawingSheet )
|
||||
if( aPlotOpts.m_plotDrawingSheet )
|
||||
{
|
||||
wxString sheetName = m_schematic->CurrentSheet().Last()->GetName();
|
||||
wxString sheetPath = m_schematic->CurrentSheet().PathHumanReadable();
|
||||
|
@ -467,7 +469,7 @@ bool SCH_PLOTTER::plotOneSheetPS( const wxString& aFileName, SCH_SCREEN* aScreen
|
|||
aScreen->GetVirtualPageNumber() == 1 );
|
||||
}
|
||||
|
||||
aScreen->Plot( plotter, aPlotSettings );
|
||||
aScreen->Plot( plotter, aPlotOpts );
|
||||
|
||||
plotter->EndPlot();
|
||||
delete plotter;
|
||||
|
@ -476,22 +478,22 @@ bool SCH_PLOTTER::plotOneSheetPS( const wxString& aFileName, SCH_SCREEN* aScreen
|
|||
}
|
||||
|
||||
|
||||
void SCH_PLOTTER::createSVGFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
||||
RENDER_SETTINGS* aRenderSettings, REPORTER* aReporter )
|
||||
void SCH_PLOTTER::createSVGFiles( const SCH_PLOT_OPTS& aPlotOpts,
|
||||
SCH_RENDER_SETTINGS* aRenderSettings, REPORTER* aReporter )
|
||||
{
|
||||
wxString msg;
|
||||
SCH_SHEET_PATH oldsheetpath = m_schematic->CurrentSheet();
|
||||
SCH_SHEET_LIST sheetList;
|
||||
|
||||
if( aPlotSettings.m_plotAll )
|
||||
if( aPlotOpts.m_plotAll )
|
||||
{
|
||||
sheetList.BuildSheetList( &m_schematic->Root(), true );
|
||||
sheetList.SortByPageNumbers();
|
||||
|
||||
// remove the non-selected pages if we are in plot pages mode
|
||||
if( aPlotSettings.m_plotPages.size() > 0 )
|
||||
if( aPlotOpts.m_plotPages.size() > 0 )
|
||||
{
|
||||
sheetList.TrimToPageNumbers( aPlotSettings.m_plotPages );
|
||||
sheetList.TrimToPageNumbers( aPlotOpts.m_plotPages );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -520,7 +522,7 @@ void SCH_PLOTTER::createSVGFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
fname.Replace( "/", "_" );
|
||||
fname.Replace( "\\", "_" );
|
||||
wxString ext = SVG_PLOTTER::GetDefaultFileExtension();
|
||||
wxFileName plotFileName = createPlotFileName( aPlotSettings, fname, ext, aReporter );
|
||||
wxFileName plotFileName = createPlotFileName( aPlotOpts, fname, ext, aReporter );
|
||||
|
||||
m_lastOutputFilePath = plotFileName.GetFullPath();
|
||||
|
||||
|
@ -528,7 +530,7 @@ void SCH_PLOTTER::createSVGFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
return;
|
||||
|
||||
bool success = plotOneSheetSVG( plotFileName.GetFullPath(), screen, aRenderSettings,
|
||||
aPlotSettings );
|
||||
aPlotOpts );
|
||||
|
||||
if( !success )
|
||||
{
|
||||
|
@ -569,14 +571,14 @@ void SCH_PLOTTER::createSVGFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
|
||||
|
||||
bool SCH_PLOTTER::plotOneSheetSVG( const wxString& aFileName, SCH_SCREEN* aScreen,
|
||||
RENDER_SETTINGS* aRenderSettings,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings )
|
||||
RENDER_SETTINGS* aRenderSettings,
|
||||
const SCH_PLOT_OPTS& aPlotOpts )
|
||||
{
|
||||
PAGE_INFO plotPage;
|
||||
// Adjust page size and scaling requests
|
||||
const PAGE_INFO& actualPage = aScreen->GetPageSettings(); // page size selected in schematic
|
||||
|
||||
switch( aPlotSettings.m_pageSizeSelect )
|
||||
switch( aPlotOpts.m_pageSizeSelect )
|
||||
{
|
||||
case PAGE_SIZE_A:
|
||||
plotPage.SetType( wxT( "A" ) );
|
||||
|
@ -597,7 +599,7 @@ bool SCH_PLOTTER::plotOneSheetSVG( const wxString& aFileName, SCH_SCREEN* aScree
|
|||
SVG_PLOTTER* plotter = new SVG_PLOTTER();
|
||||
plotter->SetRenderSettings( aRenderSettings );
|
||||
plotter->SetPageSettings( plotPage );
|
||||
plotter->SetColorMode( aPlotSettings.m_blackAndWhite ? false : true );
|
||||
plotter->SetColorMode( aPlotOpts.m_blackAndWhite ? false : true );
|
||||
VECTOR2I plot_offset;
|
||||
|
||||
double scalex = (double) plotPage.GetWidthMils() / actualPage.GetWidthMils();
|
||||
|
@ -620,7 +622,7 @@ bool SCH_PLOTTER::plotOneSheetSVG( const wxString& aFileName, SCH_SCREEN* aScree
|
|||
|
||||
plotter->StartPlot( m_schematic->CurrentSheet().GetPageNumber() );
|
||||
|
||||
if( aPlotSettings.m_useBackgroundColor && plotter->GetColorMode() )
|
||||
if( aPlotOpts.m_useBackgroundColor && plotter->GetColorMode() )
|
||||
{
|
||||
plotter->SetColor( plotter->RenderSettings()->GetLayerColor( LAYER_SCHEMATIC_BACKGROUND ) );
|
||||
VECTOR2I end( plotter->PageSettings().GetWidthIU( schIUScale.IU_PER_MILS ),
|
||||
|
@ -628,7 +630,7 @@ bool SCH_PLOTTER::plotOneSheetSVG( const wxString& aFileName, SCH_SCREEN* aScree
|
|||
plotter->Rect( VECTOR2I( 0, 0 ), end, FILL_T::FILLED_SHAPE, 1.0 );
|
||||
}
|
||||
|
||||
if( aPlotSettings.m_plotDrawingSheet )
|
||||
if( aPlotOpts.m_plotDrawingSheet )
|
||||
{
|
||||
wxString sheetName = m_schematic->CurrentSheet().Last()->GetName();
|
||||
wxString sheetPath = m_schematic->CurrentSheet().PathHumanReadable();
|
||||
|
@ -642,7 +644,7 @@ bool SCH_PLOTTER::plotOneSheetSVG( const wxString& aFileName, SCH_SCREEN* aScree
|
|||
aScreen->GetVirtualPageNumber() == 1 );
|
||||
}
|
||||
|
||||
aScreen->Plot( plotter, aPlotSettings );
|
||||
aScreen->Plot( plotter, aPlotOpts );
|
||||
|
||||
plotter->EndPlot();
|
||||
delete plotter;
|
||||
|
@ -651,8 +653,8 @@ bool SCH_PLOTTER::plotOneSheetSVG( const wxString& aFileName, SCH_SCREEN* aScree
|
|||
}
|
||||
|
||||
|
||||
void SCH_PLOTTER::createHPGLFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
||||
RENDER_SETTINGS* aRenderSettings, REPORTER* aReporter )
|
||||
void SCH_PLOTTER::createHPGLFiles( const SCH_PLOT_OPTS& aPlotOpts,
|
||||
SCH_RENDER_SETTINGS* aRenderSettings, REPORTER* aReporter )
|
||||
{
|
||||
SCH_SCREEN* screen = m_schematic->RootScreen();
|
||||
SCH_SHEET_PATH oldsheetpath = m_schematic->CurrentSheet();
|
||||
|
@ -664,15 +666,15 @@ void SCH_PLOTTER::createHPGLFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
*/
|
||||
SCH_SHEET_LIST sheetList;
|
||||
|
||||
if( aPlotSettings.m_plotAll )
|
||||
if( aPlotOpts.m_plotAll )
|
||||
{
|
||||
sheetList.BuildSheetList( &m_schematic->Root(), true );
|
||||
sheetList.SortByPageNumbers();
|
||||
|
||||
// remove the non-selected pages if we are in plot pages mode
|
||||
if( aPlotSettings.m_plotPages.size() > 0 )
|
||||
if( aPlotOpts.m_plotPages.size() > 0 )
|
||||
{
|
||||
sheetList.TrimToPageNumbers( aPlotSettings.m_plotPages );
|
||||
sheetList.TrimToPageNumbers( aPlotOpts.m_plotPages );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -697,7 +699,7 @@ void SCH_PLOTTER::createHPGLFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
PAGE_INFO plotPage = curPage;
|
||||
|
||||
// if plotting on a page size other than curPage
|
||||
plotPage.SetType( plot_sheet_list( aPlotSettings.m_HPGLPaperSizeSelect ) );
|
||||
plotPage.SetType( plot_sheet_list( aPlotOpts.m_HPGLPaperSizeSelect ) );
|
||||
|
||||
// Calculation of conversion scales.
|
||||
double plot_scale = (double) plotPage.GetWidthMils() / curPage.GetWidthMils();
|
||||
|
@ -706,7 +708,7 @@ void SCH_PLOTTER::createHPGLFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
VECTOR2I plotOffset;
|
||||
wxString msg;
|
||||
|
||||
if( aPlotSettings.m_HPGLPlotOrigin == HPGL_PLOT_ORIGIN_AND_UNITS::PLOTTER_CENTER )
|
||||
if( aPlotOpts.m_HPGLPlotOrigin == HPGL_PLOT_ORIGIN_AND_UNITS::PLOTTER_CENTER )
|
||||
{
|
||||
plotOffset.x = plotPage.GetWidthIU( schIUScale.IU_PER_MILS ) / 2;
|
||||
plotOffset.y = -plotPage.GetHeightIU( schIUScale.IU_PER_MILS ) / 2;
|
||||
|
@ -721,7 +723,7 @@ void SCH_PLOTTER::createHPGLFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
fname.Replace( "/", "_" );
|
||||
fname.Replace( "\\", "_" );
|
||||
wxString ext = HPGL_PLOTTER::GetDefaultFileExtension();
|
||||
wxFileName plotFileName = createPlotFileName( aPlotSettings, fname, ext, aReporter );
|
||||
wxFileName plotFileName = createPlotFileName( aPlotOpts, fname, ext, aReporter );
|
||||
|
||||
if( !plotFileName.IsOk() )
|
||||
return;
|
||||
|
@ -729,7 +731,7 @@ void SCH_PLOTTER::createHPGLFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
LOCALE_IO toggle;
|
||||
|
||||
if( plotOneSheetHpgl( plotFileName.GetFullPath(), screen, curPage, aRenderSettings,
|
||||
plotOffset, plot_scale, aPlotSettings ) )
|
||||
plotOffset, plot_scale, aPlotOpts ) )
|
||||
{
|
||||
if( aReporter )
|
||||
{
|
||||
|
@ -765,13 +767,10 @@ void SCH_PLOTTER::createHPGLFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
}
|
||||
|
||||
|
||||
bool SCH_PLOTTER::plotOneSheetHpgl( const wxString& aFileName,
|
||||
SCH_SCREEN* aScreen,
|
||||
const PAGE_INFO& aPageInfo,
|
||||
RENDER_SETTINGS* aRenderSettings,
|
||||
const VECTOR2I& aPlot0ffset,
|
||||
double aScale,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings )
|
||||
bool SCH_PLOTTER::plotOneSheetHpgl( const wxString& aFileName, SCH_SCREEN* aScreen,
|
||||
const PAGE_INFO& aPageInfo, RENDER_SETTINGS* aRenderSettings,
|
||||
const VECTOR2I& aPlot0ffset, double aScale,
|
||||
const SCH_PLOT_OPTS& aPlotOpts )
|
||||
{
|
||||
HPGL_PLOTTER* plotter = new HPGL_PLOTTER();
|
||||
// Currently, plot units are in decimil
|
||||
|
@ -784,7 +783,7 @@ bool SCH_PLOTTER::plotOneSheetHpgl( const wxString& aFileName,
|
|||
// TODO this could be configurable
|
||||
plotter->SetTargetChordLength( schIUScale.mmToIU( 0.6 ) );
|
||||
|
||||
switch( aPlotSettings.m_HPGLPlotOrigin )
|
||||
switch( aPlotOpts.m_HPGLPlotOrigin )
|
||||
{
|
||||
case HPGL_PLOT_ORIGIN_AND_UNITS::PLOTTER_BOT_LEFT:
|
||||
case HPGL_PLOT_ORIGIN_AND_UNITS::PLOTTER_CENTER:
|
||||
|
@ -814,10 +813,10 @@ bool SCH_PLOTTER::plotOneSheetHpgl( const wxString& aFileName,
|
|||
|
||||
// Pen num and pen speed are not initialized here.
|
||||
// Default HPGL driver values are used
|
||||
plotter->SetPenDiameter( aPlotSettings.m_HPGLPenSize );
|
||||
plotter->SetPenDiameter( aPlotOpts.m_HPGLPenSize );
|
||||
plotter->StartPlot( m_schematic->CurrentSheet().GetPageNumber() );
|
||||
|
||||
if( aPlotSettings.m_plotDrawingSheet )
|
||||
if( aPlotOpts.m_plotDrawingSheet )
|
||||
{
|
||||
wxString sheetName = m_schematic->CurrentSheet().Last()->GetName();
|
||||
wxString sheetPath = m_schematic->CurrentSheet().PathHumanReadable();
|
||||
|
@ -830,7 +829,7 @@ bool SCH_PLOTTER::plotOneSheetHpgl( const wxString& aFileName,
|
|||
COLOR4D::BLACK, aScreen->GetVirtualPageNumber() == 1 );
|
||||
}
|
||||
|
||||
aScreen->Plot( plotter, aPlotSettings );
|
||||
aScreen->Plot( plotter, aPlotOpts );
|
||||
|
||||
plotter->EndPlot();
|
||||
|
||||
|
@ -840,8 +839,8 @@ bool SCH_PLOTTER::plotOneSheetHpgl( const wxString& aFileName,
|
|||
}
|
||||
|
||||
|
||||
void SCH_PLOTTER::createDXFFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
||||
RENDER_SETTINGS* aRenderSettings, REPORTER* aReporter )
|
||||
void SCH_PLOTTER::createDXFFiles( const SCH_PLOT_OPTS& aPlotOpts,
|
||||
SCH_RENDER_SETTINGS* aRenderSettings, REPORTER* aReporter )
|
||||
{
|
||||
SCH_SHEET_PATH oldsheetpath = m_schematic->CurrentSheet();
|
||||
|
||||
|
@ -852,16 +851,14 @@ void SCH_PLOTTER::createDXFFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
*/
|
||||
SCH_SHEET_LIST sheetList;
|
||||
|
||||
if( aPlotSettings.m_plotAll )
|
||||
if( aPlotOpts.m_plotAll )
|
||||
{
|
||||
sheetList.BuildSheetList( &m_schematic->Root(), true );
|
||||
sheetList.SortByPageNumbers();
|
||||
|
||||
// remove the non-selected pages if we are in plot pages mode
|
||||
if( aPlotSettings.m_plotPages.size() > 0 )
|
||||
{
|
||||
sheetList.TrimToPageNumbers( aPlotSettings.m_plotPages );
|
||||
}
|
||||
if( aPlotOpts.m_plotPages.size() > 0 )
|
||||
sheetList.TrimToPageNumbers( aPlotOpts.m_plotPages );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -889,7 +886,7 @@ void SCH_PLOTTER::createDXFFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
fname.Replace( "/", "_" );
|
||||
fname.Replace( "\\", "_" );
|
||||
wxString ext = DXF_PLOTTER::GetDefaultFileExtension();
|
||||
wxFileName plotFileName = createPlotFileName( aPlotSettings, fname, ext, aReporter );
|
||||
wxFileName plotFileName = createPlotFileName( aPlotOpts, fname, ext, aReporter );
|
||||
|
||||
m_lastOutputFilePath = plotFileName.GetFullPath();
|
||||
|
||||
|
@ -897,7 +894,7 @@ void SCH_PLOTTER::createDXFFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
return;
|
||||
|
||||
if( plotOneSheetDXF( plotFileName.GetFullPath(), screen, aRenderSettings, plot_offset,
|
||||
1.0, aPlotSettings ) )
|
||||
1.0, aPlotOpts ) )
|
||||
{
|
||||
if( aReporter )
|
||||
{
|
||||
|
@ -938,7 +935,7 @@ void SCH_PLOTTER::createDXFFiles( const SCH_PLOT_SETTINGS& aPlotSettings,
|
|||
|
||||
bool SCH_PLOTTER::plotOneSheetDXF( const wxString& aFileName, SCH_SCREEN* aScreen,
|
||||
RENDER_SETTINGS* aRenderSettings, const VECTOR2I& aPlotOffset,
|
||||
double aScale, const SCH_PLOT_SETTINGS& aPlotSettings )
|
||||
double aScale, const SCH_PLOT_OPTS& aPlotOpts )
|
||||
{
|
||||
aRenderSettings->LoadColors( m_colorSettings );
|
||||
aRenderSettings->SetDefaultPenWidth( 0 );
|
||||
|
@ -948,7 +945,7 @@ bool SCH_PLOTTER::plotOneSheetDXF( const wxString& aFileName, SCH_SCREEN* aScree
|
|||
|
||||
plotter->SetRenderSettings( aRenderSettings );
|
||||
plotter->SetPageSettings( pageInfo );
|
||||
plotter->SetColorMode( !aPlotSettings.m_blackAndWhite );
|
||||
plotter->SetColorMode( !aPlotOpts.m_blackAndWhite );
|
||||
|
||||
// Currently, plot units are in decimil
|
||||
plotter->SetViewport( aPlotOffset, schIUScale.IU_PER_MILS / 10, aScale, false );
|
||||
|
@ -966,7 +963,7 @@ bool SCH_PLOTTER::plotOneSheetDXF( const wxString& aFileName, SCH_SCREEN* aScree
|
|||
|
||||
plotter->StartPlot( m_schematic->CurrentSheet().GetPageNumber() );
|
||||
|
||||
if( aPlotSettings.m_plotDrawingSheet )
|
||||
if( aPlotOpts.m_plotDrawingSheet )
|
||||
{
|
||||
wxString sheetName = m_schematic->CurrentSheet().Last()->GetName();
|
||||
wxString sheetPath = m_schematic->CurrentSheet().PathHumanReadable();
|
||||
|
@ -981,7 +978,7 @@ bool SCH_PLOTTER::plotOneSheetDXF( const wxString& aFileName, SCH_SCREEN* aScree
|
|||
aScreen->GetVirtualPageNumber() == 1 );
|
||||
}
|
||||
|
||||
aScreen->Plot( plotter, aPlotSettings );
|
||||
aScreen->Plot( plotter, aPlotOpts );
|
||||
|
||||
// finish
|
||||
plotter->EndPlot();
|
||||
|
@ -1006,14 +1003,14 @@ void SCH_PLOTTER::restoreEnvironment( PDF_PLOTTER* aPlotter, SCH_SHEET_PATH& aOl
|
|||
}
|
||||
|
||||
|
||||
wxFileName SCH_PLOTTER::createPlotFileName( const SCH_PLOT_SETTINGS& aPlotSettings,
|
||||
const wxString& aPlotFileName,
|
||||
wxFileName SCH_PLOTTER::createPlotFileName( const SCH_PLOT_OPTS& aPlotOpts,
|
||||
const wxString& aPlotFileName,
|
||||
const wxString& aExtension, REPORTER* aReporter )
|
||||
{
|
||||
wxFileName retv;
|
||||
wxFileName tmp;
|
||||
|
||||
tmp.SetPath( aPlotSettings.m_outputDirectory );
|
||||
tmp.SetPath( aPlotOpts.m_outputDirectory );
|
||||
retv.SetPath( tmp.GetPath() );
|
||||
|
||||
if( !aPlotFileName.IsEmpty() )
|
||||
|
@ -1047,20 +1044,20 @@ wxFileName SCH_PLOTTER::createPlotFileName( const SCH_PLOT_SETTINGS& aPlotSettin
|
|||
}
|
||||
|
||||
|
||||
void SCH_PLOTTER::Plot( PLOT_FORMAT aPlotFormat, const SCH_PLOT_SETTINGS& aPlotSettings,
|
||||
RENDER_SETTINGS* aRenderSettings, REPORTER* aReporter )
|
||||
void SCH_PLOTTER::Plot( PLOT_FORMAT aPlotFormat, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
SCH_RENDER_SETTINGS* aRenderSettings, REPORTER* aReporter )
|
||||
{
|
||||
SETTINGS_MANAGER& settingsMgr = Pgm().GetSettingsManager();
|
||||
|
||||
m_colorSettings = settingsMgr.GetColorSettings( aPlotSettings.m_theme );
|
||||
m_colorSettings = settingsMgr.GetColorSettings( aPlotOpts.m_theme );
|
||||
|
||||
switch( aPlotFormat )
|
||||
{
|
||||
default:
|
||||
case PLOT_FORMAT::POST: createPSFiles( aPlotSettings, aRenderSettings, aReporter ); break;
|
||||
case PLOT_FORMAT::DXF: createDXFFiles( aPlotSettings, aRenderSettings, aReporter ); break;
|
||||
case PLOT_FORMAT::PDF: createPDFFile( aPlotSettings, aRenderSettings, aReporter ); break;
|
||||
case PLOT_FORMAT::SVG: createSVGFiles( aPlotSettings, aRenderSettings, aReporter ); break;
|
||||
case PLOT_FORMAT::HPGL: createHPGLFiles( aPlotSettings, aRenderSettings, aReporter ); break;
|
||||
case PLOT_FORMAT::POST: createPSFiles( aPlotOpts, aRenderSettings, aReporter ); break;
|
||||
case PLOT_FORMAT::DXF: createDXFFiles( aPlotOpts, aRenderSettings, aReporter ); break;
|
||||
case PLOT_FORMAT::PDF: createPDFFile( aPlotOpts, aRenderSettings, aReporter ); break;
|
||||
case PLOT_FORMAT::SVG: createSVGFiles( aPlotOpts, aRenderSettings, aReporter ); break;
|
||||
case PLOT_FORMAT::HPGL: createHPGLFiles( aPlotOpts, aRenderSettings, aReporter ); break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <wx/string.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <page_info.h>
|
||||
#include <render_settings.h>
|
||||
#include <sch_render_settings.h>
|
||||
#include <sch_sheet_path.h>
|
||||
#include <plotters/plotter.h>
|
||||
|
||||
|
@ -76,7 +76,7 @@ enum class HPGL_PAGE_SIZE
|
|||
};
|
||||
|
||||
|
||||
struct SCH_PLOT_SETTINGS
|
||||
struct SCH_PLOT_OPTS
|
||||
{
|
||||
bool m_plotAll;
|
||||
bool m_plotDrawingSheet;
|
||||
|
@ -96,7 +96,7 @@ struct SCH_PLOT_SETTINGS
|
|||
|
||||
HPGL_PLOT_ORIGIN_AND_UNITS m_HPGLPlotOrigin;
|
||||
|
||||
SCH_PLOT_SETTINGS() :
|
||||
SCH_PLOT_OPTS() :
|
||||
m_plotAll( true ),
|
||||
m_plotDrawingSheet( true ),
|
||||
m_blackAndWhite( false ),
|
||||
|
@ -140,8 +140,8 @@ public:
|
|||
* @param aRenderSettings Mandatory object containing render settings for lower level classes
|
||||
* @param aReporter Optional reporter to print messages to
|
||||
*/
|
||||
void Plot( PLOT_FORMAT aPlotFormat, const SCH_PLOT_SETTINGS& aPlotSettings,
|
||||
RENDER_SETTINGS* aRenderSettings, REPORTER* aReporter = nullptr );
|
||||
void Plot( PLOT_FORMAT aPlotFormat, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
SCH_RENDER_SETTINGS* aRenderSettings, REPORTER* aReporter = nullptr );
|
||||
|
||||
/**
|
||||
* Get the last output file path, this is mainly intended for PDFs with the open after plot GUI option
|
||||
|
@ -152,47 +152,44 @@ protected:
|
|||
/**
|
||||
* Returns the output filename for formats where the output is a single file
|
||||
*/
|
||||
wxFileName getOutputFilenameSingle( const SCH_PLOT_SETTINGS& aPlotSettings, REPORTER* aReporter,
|
||||
wxFileName getOutputFilenameSingle( const SCH_PLOT_OPTS& aPlotOpts, REPORTER* aReporter,
|
||||
const wxString& ext );
|
||||
|
||||
// PDF
|
||||
void createPDFFile( const SCH_PLOT_SETTINGS& aPlotSettings, RENDER_SETTINGS* aRenderSettings,
|
||||
void createPDFFile( const SCH_PLOT_OPTS& aPlotOpts, SCH_RENDER_SETTINGS* aRenderSettings,
|
||||
REPORTER* aReporter );
|
||||
void plotOneSheetPDF( PLOTTER* aPlotter, SCH_SCREEN* aScreen,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings );
|
||||
void setupPlotPagePDF( PLOTTER* aPlotter, SCH_SCREEN* aScreen,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings );
|
||||
void plotOneSheetPDF( PLOTTER* aPlotter, SCH_SCREEN* aScreen, const SCH_PLOT_OPTS& aPlotOpts );
|
||||
void setupPlotPagePDF( PLOTTER* aPlotter, SCH_SCREEN* aScreen, const SCH_PLOT_OPTS& aPlotOpts );
|
||||
|
||||
// DXF
|
||||
void createDXFFiles( const SCH_PLOT_SETTINGS& aPlotSettings, RENDER_SETTINGS* aRenderSettings,
|
||||
void createDXFFiles( const SCH_PLOT_OPTS& aPlotOpts, SCH_RENDER_SETTINGS* aRenderSettings,
|
||||
REPORTER* aReporter );
|
||||
bool plotOneSheetDXF( const wxString& aFileName, SCH_SCREEN* aScreen,
|
||||
RENDER_SETTINGS* aRenderSettings, const VECTOR2I& aPlotOffset,
|
||||
double aScale, const SCH_PLOT_SETTINGS& aPlotSettings );
|
||||
double aScale, const SCH_PLOT_OPTS& aPlotOpts );
|
||||
|
||||
|
||||
// HPGL
|
||||
void createHPGLFiles( const SCH_PLOT_SETTINGS& aPlotSettings, RENDER_SETTINGS* aRenderSettings,
|
||||
void createHPGLFiles( const SCH_PLOT_OPTS& aPlotOpts, SCH_RENDER_SETTINGS* aRenderSettings,
|
||||
REPORTER* aReporter );
|
||||
bool plotOneSheetHpgl( const wxString& aFileName, SCH_SCREEN* aScreen,
|
||||
const PAGE_INFO& aPageInfo, RENDER_SETTINGS* aRenderSettings,
|
||||
const VECTOR2I& aPlot0ffset, double aScale,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings );
|
||||
const SCH_PLOT_OPTS& aPlotOpts );
|
||||
|
||||
// PS
|
||||
void createPSFiles( const SCH_PLOT_SETTINGS& aPlotSettings, RENDER_SETTINGS* aRenderSettings,
|
||||
void createPSFiles( const SCH_PLOT_OPTS& aPlotOpts, SCH_RENDER_SETTINGS* aRenderSettings,
|
||||
REPORTER* aReporter );
|
||||
bool plotOneSheetPS( const wxString& aFileName, SCH_SCREEN* aScreen,
|
||||
RENDER_SETTINGS* aRenderSettings, const PAGE_INFO& aPageInfo,
|
||||
const VECTOR2I& aPlot0ffset, double aScale,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings );
|
||||
const SCH_PLOT_OPTS& aPlotOpts );
|
||||
|
||||
// SVG
|
||||
void createSVGFiles( const SCH_PLOT_SETTINGS& aPlotSettings, RENDER_SETTINGS* aRenderSettings,
|
||||
void createSVGFiles( const SCH_PLOT_OPTS& aPlotOpts, SCH_RENDER_SETTINGS* aRenderSettings,
|
||||
REPORTER* aReporter );
|
||||
bool plotOneSheetSVG( const wxString& aFileName, SCH_SCREEN* aScreen,
|
||||
RENDER_SETTINGS* aRenderSettings,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings );
|
||||
RENDER_SETTINGS* aRenderSettings, const SCH_PLOT_OPTS& aPlotOpts );
|
||||
|
||||
/**
|
||||
* Everything done, close the plot and restore the environment.
|
||||
|
@ -212,9 +209,8 @@ protected:
|
|||
* @return the created file name.
|
||||
* @throw IO_ERROR on file I/O errors.
|
||||
*/
|
||||
wxFileName createPlotFileName( const SCH_PLOT_SETTINGS& aPlotSettings,
|
||||
const wxString& aPlotFileName, const wxString& aExtension,
|
||||
REPORTER* aReporter = nullptr );
|
||||
wxFileName createPlotFileName( const SCH_PLOT_OPTS& aPlotOpts, const wxString& aPlotFileName,
|
||||
const wxString& aExtension, REPORTER* aReporter = nullptr );
|
||||
|
||||
private:
|
||||
SCHEMATIC* m_schematic;
|
||||
|
|
|
@ -820,10 +820,10 @@ SCH_REFERENCE::SCH_REFERENCE( SCH_SYMBOL* aSymbol, LIB_SYMBOL* aLibSymbol,
|
|||
|
||||
m_numRef = -1;
|
||||
|
||||
if( aSymbol->GetValueFieldText( false, &aSheetPath, false ).IsEmpty() )
|
||||
if( aSymbol->GetValue( false, &aSheetPath, false ).IsEmpty() )
|
||||
aSymbol->SetValueFieldText( wxT( "~" ) );
|
||||
|
||||
m_value = aSymbol->GetValueFieldText( false, &aSheetPath, false );
|
||||
m_value = aSymbol->GetValue( false, &aSheetPath, false );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -69,6 +69,11 @@ public:
|
|||
|
||||
bool GetShowPageLimits() const override;
|
||||
|
||||
VECTOR2I TransformCoordinate( const VECTOR2I& aPoint ) const
|
||||
{
|
||||
return m_Transform.TransformCoordinate( aPoint );
|
||||
}
|
||||
|
||||
public:
|
||||
bool m_IsSymbolEditor;
|
||||
|
||||
|
|
|
@ -1096,20 +1096,20 @@ void SCH_SCREEN::Print( const SCH_RENDER_SETTINGS* aSettings )
|
|||
} );
|
||||
|
||||
for( SCH_ITEM* item : bitmaps )
|
||||
item->Print( aSettings, VECTOR2I( 0, 0 ) );
|
||||
item->Print( aSettings, 0, 0, VECTOR2I( 0, 0 ), false, false );
|
||||
|
||||
for( SCH_ITEM* item : other )
|
||||
item->PrintBackground( aSettings, VECTOR2I( 0, 0 ) );
|
||||
item->PrintBackground( aSettings, 0, 0, VECTOR2I( 0, 0 ), false );
|
||||
|
||||
for( SCH_ITEM* item : other )
|
||||
item->Print( aSettings, VECTOR2I( 0, 0 ) );
|
||||
item->Print( aSettings, 0, 0, VECTOR2I( 0, 0 ), false, false );
|
||||
|
||||
for( SCH_ITEM* item : junctions )
|
||||
item->Print( aSettings, VECTOR2I( 0, 0 ) );
|
||||
item->Print( aSettings, 0, 0, VECTOR2I( 0, 0 ), false, false );
|
||||
}
|
||||
|
||||
|
||||
void SCH_SCREEN::Plot( PLOTTER* aPlotter, const SCH_PLOT_SETTINGS& aPlotSettings ) const
|
||||
void SCH_SCREEN::Plot( PLOTTER* aPlotter, const SCH_PLOT_OPTS& aPlotOpts ) const
|
||||
{
|
||||
// Ensure links are up to date, even if a library was reloaded for some reason:
|
||||
std::vector<SCH_ITEM*> junctions;
|
||||
|
@ -1161,24 +1161,24 @@ void SCH_SCREEN::Plot( PLOTTER* aPlotter, const SCH_PLOT_SETTINGS& aPlotSettings
|
|||
// Bitmaps are drawn first to ensure they are in the background
|
||||
// This is particularly important for the wxPostscriptDC (used in *nix printers) as
|
||||
// the bitmap PS command clears the screen
|
||||
for( const SCH_ITEM* item : bitmaps )
|
||||
for( SCH_ITEM* item : bitmaps )
|
||||
{
|
||||
aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
|
||||
item->Plot( aPlotter, background, aPlotSettings );
|
||||
item->Plot( aPlotter, background, aPlotOpts, 0, 0, { 0, 0 }, false );
|
||||
}
|
||||
|
||||
// Plot the background items
|
||||
for( const SCH_ITEM* item : other )
|
||||
for( SCH_ITEM* item : other )
|
||||
{
|
||||
aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
|
||||
item->Plot( aPlotter, background, aPlotSettings );
|
||||
item->Plot( aPlotter, background, aPlotOpts, 0, 0, { 0, 0 }, false );
|
||||
}
|
||||
|
||||
// Plot the foreground items
|
||||
for( const SCH_ITEM* item : other )
|
||||
for( SCH_ITEM* item : other )
|
||||
{
|
||||
aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
|
||||
item->Plot( aPlotter, !background, aPlotSettings );
|
||||
item->Plot( aPlotter, !background, aPlotOpts, 0, 0, { 0, 0 }, false );
|
||||
}
|
||||
|
||||
// After plotting the symbols as a group above (in `other`), we need to overplot the pins
|
||||
|
@ -1190,7 +1190,8 @@ void SCH_SCREEN::Plot( PLOTTER* aPlotter, const SCH_PLOT_SETTINGS& aPlotSettings
|
|||
for( SCH_FIELD field : sym->GetFields() )
|
||||
{
|
||||
field.ClearRenderCache();
|
||||
field.Plot( aPlotter, false, aPlotSettings );
|
||||
field.Plot( aPlotter, false, aPlotOpts, sym->GetUnit(), sym->GetBodyStyle(), { 0, 0 },
|
||||
sym->GetDNP() );
|
||||
}
|
||||
|
||||
sym->PlotPins( aPlotter );
|
||||
|
@ -1199,10 +1200,10 @@ void SCH_SCREEN::Plot( PLOTTER* aPlotter, const SCH_PLOT_SETTINGS& aPlotSettings
|
|||
sym->PlotDNP( aPlotter );
|
||||
}
|
||||
|
||||
for( const SCH_ITEM* item : junctions )
|
||||
for( SCH_ITEM* item : junctions )
|
||||
{
|
||||
aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
|
||||
item->Plot( aPlotter, !background, aPlotSettings );
|
||||
item->Plot( aPlotter, !background, aPlotOpts, 0, 0, { 0, 0 }, false );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -256,7 +256,7 @@ public:
|
|||
*
|
||||
* @param[in] aPlotter The plotter object to plot to.
|
||||
*/
|
||||
void Plot( PLOTTER* aPlotter, const SCH_PLOT_SETTINGS& aPlotSettings ) const;
|
||||
void Plot( PLOTTER* aPlotter, const SCH_PLOT_OPTS& aPlotOpts ) const;
|
||||
|
||||
/**
|
||||
* Remove \a aItem from the schematic associated with this screen.
|
||||
|
|
|
@ -111,8 +111,8 @@ void SCH_SHAPE::Rotate( const VECTOR2I& aCenter, bool aRotateCCW )
|
|||
}
|
||||
|
||||
|
||||
void SCH_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const
|
||||
void SCH_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
int pen_size = GetPenWidth();
|
||||
|
||||
|
@ -227,7 +227,8 @@ int SCH_SHAPE::GetPenWidth() const
|
|||
}
|
||||
|
||||
|
||||
void SCH_SHAPE::PrintBackground( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
void SCH_SHAPE::PrintBackground( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
wxDC* DC = aSettings->GetPrintDC();
|
||||
COLOR4D color;
|
||||
|
@ -289,11 +290,11 @@ void SCH_SHAPE::PrintBackground( const SCH_RENDER_SETTINGS* aSettings, const VEC
|
|||
}
|
||||
|
||||
delete[] buffer;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void SCH_SHAPE::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
void SCH_SHAPE::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
int penWidth = GetPenWidth();
|
||||
wxDC* DC = aSettings->GetPrintDC();
|
||||
|
@ -336,7 +337,7 @@ void SCH_SHAPE::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOf
|
|||
else if( GetFillMode() == FILL_T::FILLED_WITH_COLOR )
|
||||
fillColor = GetFillColor();
|
||||
|
||||
if( fillColor != COLOR4D::UNSPECIFIED )
|
||||
if( fillColor != COLOR4D::UNSPECIFIED && !aForceNoFill )
|
||||
{
|
||||
switch( GetShape() )
|
||||
{
|
||||
|
|
|
@ -96,8 +96,14 @@ public:
|
|||
|
||||
void AddPoint( const VECTOR2I& aPosition );
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void PrintBackground( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
|
@ -122,11 +128,6 @@ protected:
|
|||
{
|
||||
m_fill = aFlag ? FILL_T::FILLED_WITH_COLOR : FILL_T::NO_FILL;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
|
||||
void PrintBackground( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1141,20 +1141,20 @@ bool SCH_SHEET::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) co
|
|||
}
|
||||
|
||||
|
||||
void SCH_SHEET::Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const
|
||||
void SCH_SHEET::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
if( aBackground && !aPlotter->GetColorMode() )
|
||||
return;
|
||||
|
||||
SCH_RENDER_SETTINGS* cfg = static_cast<SCH_RENDER_SETTINGS*>( aPlotter->RenderSettings() );
|
||||
SCH_RENDER_SETTINGS* renderSettings = getRenderSettings( aPlotter );
|
||||
COLOR4D borderColor = GetBorderColor();
|
||||
COLOR4D backgroundColor = GetBackgroundColor();
|
||||
|
||||
if( cfg->m_OverrideItemColors || borderColor == COLOR4D::UNSPECIFIED )
|
||||
if( renderSettings->m_OverrideItemColors || borderColor == COLOR4D::UNSPECIFIED )
|
||||
borderColor = aPlotter->RenderSettings()->GetLayerColor( LAYER_SHEET );
|
||||
|
||||
if( cfg->m_OverrideItemColors || backgroundColor == COLOR4D::UNSPECIFIED )
|
||||
if( renderSettings->m_OverrideItemColors || backgroundColor == COLOR4D::UNSPECIFIED )
|
||||
backgroundColor = aPlotter->RenderSettings()->GetLayerColor( LAYER_SHEET_BACKGROUND );
|
||||
|
||||
if( aBackground && backgroundColor.a > 0.0 )
|
||||
|
@ -1186,15 +1186,16 @@ void SCH_SHEET::Plot( PLOTTER* aPlotter, bool aBackground,
|
|||
|
||||
// Plot sheet pins
|
||||
for( SCH_SHEET_PIN* sheetPin : m_pins )
|
||||
sheetPin->Plot( aPlotter, aBackground, aPlotSettings );
|
||||
sheetPin->Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
|
||||
|
||||
// Plot the fields
|
||||
for( const SCH_FIELD& field : m_fields )
|
||||
field.Plot( aPlotter, aBackground, aPlotSettings );
|
||||
for( SCH_FIELD& field : m_fields )
|
||||
field.Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
|
||||
}
|
||||
|
||||
|
||||
void SCH_SHEET::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
void SCH_SHEET::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
wxDC* DC = aSettings->GetPrintDC();
|
||||
VECTOR2I pos = m_pos + aOffset;
|
||||
|
@ -1217,10 +1218,10 @@ void SCH_SHEET::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOf
|
|||
GRRect( DC, pos, pos + m_size, lineWidth, border );
|
||||
|
||||
for( SCH_FIELD& field : m_fields )
|
||||
field.Print( aSettings, aOffset );
|
||||
field.Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
|
||||
|
||||
for( SCH_SHEET_PIN* sheetPin : m_pins )
|
||||
sheetPin->Print( aSettings, aOffset );
|
||||
sheetPin->Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -249,8 +249,6 @@ public:
|
|||
|
||||
int GetPenWidth() const override;
|
||||
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
|
||||
|
||||
/**
|
||||
* Return a bounding box for the sheet body but not the fields.
|
||||
*/
|
||||
|
@ -381,8 +379,11 @@ public:
|
|||
bool HitTest( const VECTOR2I& aPosition, int aAccuracy ) const override;
|
||||
bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
EDA_ITEM* Clone() const override;
|
||||
|
||||
|
|
|
@ -74,7 +74,6 @@ public:
|
|||
|
||||
// pure virtuals:
|
||||
void SetPosition( const VECTOR2I& ) override {}
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override {}
|
||||
void Move( const VECTOR2I& aMoveVector ) override {}
|
||||
void MirrorHorizontally( int aCenter ) override {}
|
||||
void MirrorVertically( int aCenter ) override {}
|
||||
|
|
|
@ -65,10 +65,11 @@ EDA_ITEM* SCH_SHEET_PIN::Clone() const
|
|||
}
|
||||
|
||||
|
||||
void SCH_SHEET_PIN::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
void SCH_SHEET_PIN::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
// The icon selection is handle by the virtual method CreateGraphicShape called by ::Print
|
||||
SCH_HIERLABEL::Print( aSettings, aOffset );
|
||||
SCH_HIERLABEL::Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -105,7 +105,8 @@ public:
|
|||
*/
|
||||
bool IsMovableFromAnchorPoint() const override { return true; }
|
||||
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
/**
|
||||
* Calculate the graphic shape (a polygon) associated to the text.
|
||||
|
|
|
@ -487,25 +487,33 @@ bool SCH_SYMBOL::HasUnitDisplayName( int aUnit )
|
|||
}
|
||||
|
||||
|
||||
void SCH_SYMBOL::PrintBackground( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
void SCH_SYMBOL::PrintBackground( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
SCH_RENDER_SETTINGS cfg( *aSettings );
|
||||
cfg.m_Transform = m_transform;
|
||||
cfg.m_ShowVisibleLibFields = false;
|
||||
cfg.m_ShowHiddenLibFields = false;
|
||||
|
||||
if( GetDNP() )
|
||||
aDimmed = true;
|
||||
|
||||
if( m_part )
|
||||
m_part->PrintBackground( &cfg, m_pos + aOffset, m_unit, m_bodyStyle, false, GetDNP() );
|
||||
m_part->PrintBackground( &cfg, m_unit, m_bodyStyle, m_pos + aOffset, aDimmed );
|
||||
}
|
||||
|
||||
|
||||
void SCH_SYMBOL::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
void SCH_SYMBOL::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
SCH_RENDER_SETTINGS cfg( *aSettings );
|
||||
cfg.m_Transform = m_transform;
|
||||
cfg.m_ShowVisibleLibFields = false;
|
||||
cfg.m_ShowHiddenLibFields = false;
|
||||
|
||||
if( m_DNP )
|
||||
aDimmed = true;
|
||||
|
||||
if( m_part )
|
||||
{
|
||||
LIB_PINS libPins;
|
||||
|
@ -537,15 +545,15 @@ void SCH_SYMBOL::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aO
|
|||
}
|
||||
}
|
||||
|
||||
tempSymbol.Print( &cfg, m_pos + aOffset, m_unit, m_bodyStyle, false, GetDNP() );
|
||||
tempSymbol.Print( &cfg, m_unit, m_bodyStyle, m_pos + aOffset, false, aDimmed );
|
||||
}
|
||||
else // Use dummy() part if the actual cannot be found.
|
||||
{
|
||||
dummy()->Print( &cfg, m_pos + aOffset, 0, 0, false, GetDNP() );
|
||||
dummy()->Print( &cfg, 0, 0, m_pos + aOffset, aForceNoFill, aDimmed );
|
||||
}
|
||||
|
||||
for( SCH_FIELD& field : m_fields )
|
||||
field.Print( &cfg, aOffset );
|
||||
field.Print( &cfg, m_unit, m_bodyStyle, aOffset, aForceNoFill, aDimmed );
|
||||
|
||||
if( m_DNP )
|
||||
{
|
||||
|
@ -805,7 +813,7 @@ void SCH_SYMBOL::SetRef( const SCH_SHEET_PATH* sheet, const wxString& ref )
|
|||
}
|
||||
|
||||
|
||||
bool SCH_SYMBOL::IsAnnotated( const SCH_SHEET_PATH* aSheet )
|
||||
bool SCH_SYMBOL::IsAnnotated( const SCH_SHEET_PATH* aSheet ) const
|
||||
{
|
||||
KIID_PATH path = aSheet->Path();
|
||||
|
||||
|
@ -897,7 +905,7 @@ void SCH_SYMBOL::SetUnitSelection( int aUnitSelection )
|
|||
}
|
||||
|
||||
|
||||
const wxString SCH_SYMBOL::GetValueFieldText( bool aResolve, const SCH_SHEET_PATH* aPath,
|
||||
const wxString SCH_SYMBOL::GetValue( bool aResolve, const SCH_SHEET_PATH* aPath,
|
||||
bool aAllowExtraText ) const
|
||||
{
|
||||
if( aResolve )
|
||||
|
@ -2165,7 +2173,7 @@ bool SCH_SYMBOL::HasConnectivityChanges( const SCH_ITEM* aItem,
|
|||
|
||||
// Power symbol value field changes are connectivity changes.
|
||||
if( IsPower()
|
||||
&& ( GetValueFieldText( true, aInstance, false ) != symbol->GetValueFieldText( true, aInstance, false ) ) )
|
||||
&& ( GetValue( true, aInstance, false ) != symbol->GetValue( true, aInstance, false ) ) )
|
||||
return true;
|
||||
|
||||
if( m_pins.size() != symbol->m_pins.size() )
|
||||
|
@ -2447,8 +2455,8 @@ bool SCH_SYMBOL::IsInNetlist() const
|
|||
}
|
||||
|
||||
|
||||
void SCH_SYMBOL::Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const
|
||||
void SCH_SYMBOL::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
if( aBackground )
|
||||
return;
|
||||
|
@ -2488,18 +2496,19 @@ void SCH_SYMBOL::Plot( PLOTTER* aPlotter, bool aBackground,
|
|||
}
|
||||
}
|
||||
|
||||
TRANSFORM temp = GetTransform();
|
||||
getRenderSettings( aPlotter )->m_Transform = GetTransform();
|
||||
aPlotter->StartBlock( nullptr );
|
||||
|
||||
for( bool local_background : { true, false } )
|
||||
{
|
||||
tempSymbol.Plot( aPlotter, GetUnit(), GetBodyStyle(), local_background, m_pos, temp,
|
||||
GetDNP() );
|
||||
tempSymbol.Plot( aPlotter, local_background, aPlotOpts, GetUnit(), GetBodyStyle(),
|
||||
m_pos, GetDNP() );
|
||||
|
||||
for( SCH_FIELD field : m_fields )
|
||||
{
|
||||
field.ClearRenderCache();
|
||||
field.Plot( aPlotter, local_background, aPlotSettings );
|
||||
field.Plot( aPlotter, local_background, aPlotOpts, GetUnit(), GetBodyStyle(),
|
||||
m_pos, GetDNP() );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2509,7 +2518,7 @@ void SCH_SYMBOL::Plot( PLOTTER* aPlotter, bool aBackground,
|
|||
SCH_SHEET_PATH* sheet = &Schematic()->CurrentSheet();
|
||||
|
||||
// Plot attributes to a hypertext menu
|
||||
if( aPlotSettings.m_PDFPropertyPopups )
|
||||
if( aPlotOpts.m_PDFPropertyPopups )
|
||||
{
|
||||
std::vector<wxString> properties;
|
||||
|
||||
|
@ -2535,6 +2544,7 @@ void SCH_SYMBOL::Plot( PLOTTER* aPlotter, bool aBackground,
|
|||
}
|
||||
|
||||
aPlotter->EndBlock( nullptr );
|
||||
getRenderSettings( aPlotter )->m_Transform = TRANSFORM();
|
||||
|
||||
if( !m_part->IsPower() )
|
||||
aPlotter->Bookmark( GetBoundingBox(), GetRef( sheet ), _( "Symbols" ) );
|
||||
|
@ -2573,7 +2583,7 @@ void SCH_SYMBOL::PlotPins( PLOTTER* aPlotter ) const
|
|||
LIB_PINS tempPins;
|
||||
tempSymbol.GetPins( tempPins, GetUnit(), GetBodyStyle() );
|
||||
|
||||
TRANSFORM transform = GetTransform();
|
||||
SCH_PLOT_OPTS plotOpts;
|
||||
|
||||
// Copy the pin info from the symbol to the temp pins
|
||||
for( unsigned i = 0; i < tempPins.size(); ++ i )
|
||||
|
@ -2584,7 +2594,7 @@ void SCH_SYMBOL::PlotPins( PLOTTER* aPlotter ) const
|
|||
tempPin->SetName( symbolPin->GetShownName() );
|
||||
tempPin->SetType( symbolPin->GetType() );
|
||||
tempPin->SetShape( symbolPin->GetShape() );
|
||||
tempPin->Plot( aPlotter, false, m_pos, transform, GetDNP() );
|
||||
tempPin->Plot( aPlotter, false, plotOpts, GetUnit(), GetBodyStyle(), m_pos, GetDNP() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -253,7 +253,7 @@ public:
|
|||
*/
|
||||
wxString GetDatasheet() const;
|
||||
|
||||
int GetUnit() const { return m_unit; }
|
||||
int GetUnit() const override { return m_unit; }
|
||||
void SetUnit( int aUnit ) { m_unit = aUnit; }
|
||||
|
||||
/**
|
||||
|
@ -275,7 +275,7 @@ public:
|
|||
*/
|
||||
wxString GetUnitDisplayName( int aUnit );
|
||||
|
||||
int GetBodyStyle() const { return m_bodyStyle; }
|
||||
int GetBodyStyle() const override { return m_bodyStyle; }
|
||||
void SetBodyStyle( int aBodyStyle );
|
||||
|
||||
bool HasAlternateBodyStyle() const override;
|
||||
|
@ -522,8 +522,18 @@ public:
|
|||
SCH_FIELD* FindField( const wxString& aFieldName, bool aIncludeDefaultFields = true,
|
||||
bool aCaseInsensitive = false );
|
||||
|
||||
const wxString GetValueFieldText( bool aResolve, const SCH_SHEET_PATH* aPath,
|
||||
bool aAllowExtraText ) const;
|
||||
/**
|
||||
* @return the reference for the instance on the given sheet.
|
||||
*/
|
||||
const wxString GetRef( const SCH_SHEET_PATH* aSheet,
|
||||
bool aIncludeUnit = false ) const override;
|
||||
|
||||
/**
|
||||
* @return the value for the instance on the given sheet.
|
||||
*/
|
||||
const wxString GetValue( bool aResolve, const SCH_SHEET_PATH* aPath,
|
||||
bool aAllowExtraText ) const override;
|
||||
|
||||
void SetValueFieldText( const wxString& aValue );
|
||||
|
||||
const wxString GetFootprintFieldText( bool aResolve, const SCH_SHEET_PATH* aPath,
|
||||
|
@ -543,7 +553,7 @@ public:
|
|||
}
|
||||
wxString GetValueProp() const
|
||||
{
|
||||
return GetValueFieldText( false, &Schematic()->CurrentSheet(), false );
|
||||
return GetValue( false, &Schematic()->CurrentSheet(), false );
|
||||
}
|
||||
void SetValueProp( const wxString& aRef )
|
||||
{
|
||||
|
@ -629,24 +639,6 @@ public:
|
|||
|
||||
std::vector<std::unique_ptr<SCH_PIN>>& GetRawPins() { return m_pins; }
|
||||
|
||||
/**
|
||||
* Print a symbol.
|
||||
*
|
||||
* @param aSettings Render settings controlling output
|
||||
* @param aOffset is the drawing offset (usually VECTOR2I(0,0), but can be different when
|
||||
* moving an object)
|
||||
*/
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
|
||||
|
||||
/**
|
||||
* Print only the background parts of a symbol (if any)
|
||||
*
|
||||
* @param aSettings Render settings controlling output
|
||||
* @param aOffset is the drawing offset (usually VECTOR2I(0,0), but can be different when
|
||||
* moving an object)
|
||||
*/
|
||||
void PrintBackground( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
|
||||
|
||||
void SwapData( SCH_ITEM* aItem ) override;
|
||||
|
||||
/**
|
||||
|
@ -659,13 +651,6 @@ public:
|
|||
*/
|
||||
static bool IsReferenceStringValid( const wxString& aReferenceString );
|
||||
|
||||
/**
|
||||
* Return the reference for the given sheet path.
|
||||
*
|
||||
* @return the reference for the sheet.
|
||||
*/
|
||||
const wxString GetRef( const SCH_SHEET_PATH* aSheet, bool aIncludeUnit = false ) const;
|
||||
|
||||
/**
|
||||
* Set the reference for the given sheet path for this symbol.
|
||||
*
|
||||
|
@ -680,7 +665,7 @@ public:
|
|||
* @param aSheet is the sheet path to test.
|
||||
* @return true if the symbol exists on that sheet and has a valid reference.
|
||||
*/
|
||||
bool IsAnnotated( const SCH_SHEET_PATH* aSheet );
|
||||
bool IsAnnotated( const SCH_SHEET_PATH* aSheet ) const;
|
||||
|
||||
/**
|
||||
* Add a full hierarchical reference to this symbol.
|
||||
|
@ -804,8 +789,28 @@ public:
|
|||
bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
|
||||
bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const override;
|
||||
/**
|
||||
* Print a symbol.
|
||||
*
|
||||
* @param aSettings Render settings controlling output
|
||||
* @param aOffset is the drawing offset (usually VECTOR2I(0,0), but can be different when
|
||||
* moving an object)
|
||||
*/
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
/**
|
||||
* Print only the background parts of a symbol (if any)
|
||||
*
|
||||
* @param aSettings Render settings controlling output
|
||||
* @param aOffset is the drawing offset (usually VECTOR2I(0,0), but can be different when
|
||||
* moving an object)
|
||||
*/
|
||||
void PrintBackground( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
/**
|
||||
* Plot just the symbol pins. This is separated to match the GAL display order. The pins
|
||||
|
|
|
@ -236,10 +236,11 @@ void SCH_TABLE::RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction
|
|||
}
|
||||
|
||||
|
||||
void SCH_TABLE::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
void SCH_TABLE::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
for( SCH_TABLECELL* cell : m_cells )
|
||||
cell->Print( aSettings, aOffset );
|
||||
cell->Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
|
||||
|
||||
wxDC* DC = aSettings->GetPrintDC();
|
||||
VECTOR2I pos = GetPosition();
|
||||
|
@ -438,11 +439,11 @@ bool SCH_TABLE::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) co
|
|||
}
|
||||
|
||||
|
||||
void SCH_TABLE::Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const
|
||||
void SCH_TABLE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
for( SCH_TABLECELL* cell : m_cells )
|
||||
cell->Plot( aPlotter, aBackground, aPlotSettings );
|
||||
cell->Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
|
||||
|
||||
if( aBackground )
|
||||
return;
|
||||
|
|
|
@ -88,8 +88,6 @@ public:
|
|||
|
||||
void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction ) override;
|
||||
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& offset ) override;
|
||||
|
||||
bool operator<( const SCH_ITEM& aItem ) const override;
|
||||
|
||||
void SetPosition( const VECTOR2I& aPos ) override;
|
||||
|
@ -203,8 +201,11 @@ public:
|
|||
|
||||
bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& offset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
EDA_ITEM* Clone() const override
|
||||
{
|
||||
|
|
|
@ -96,18 +96,19 @@ wxString SCH_TABLECELL::GetAddr() const
|
|||
}
|
||||
|
||||
|
||||
void SCH_TABLECELL::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
void SCH_TABLECELL::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
if( m_colSpan >= 1 && m_rowSpan >= 1 )
|
||||
SCH_TEXTBOX::Print( aSettings, aOffset );
|
||||
SCH_TEXTBOX::Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
|
||||
}
|
||||
|
||||
|
||||
void SCH_TABLECELL::Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const
|
||||
void SCH_TABLECELL::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
if( m_colSpan >= 1 && m_rowSpan >= 1 )
|
||||
SCH_TEXTBOX::Plot( aPlotter, aBackground, aPlotSettings );
|
||||
SCH_TEXTBOX::Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -64,10 +64,11 @@ public:
|
|||
int GetRowSpan() const { return m_rowSpan; }
|
||||
void SetRowSpan( int aSpan ) { m_rowSpan = aSpan; }
|
||||
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& offset ) override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& offset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const override;
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
|
|
|
@ -194,7 +194,8 @@ KIFONT::FONT* SCH_TEXT::getDrawFont() const
|
|||
}
|
||||
|
||||
|
||||
void SCH_TEXT::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
void SCH_TEXT::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
COLOR4D color = GetTextColor();
|
||||
bool blackAndWhiteMode = GetGRForceBlackPenState();
|
||||
|
@ -334,8 +335,8 @@ void SCH_TEXT::ViewGetLayers( int aLayers[], int& aCount ) const
|
|||
}
|
||||
|
||||
|
||||
void SCH_TEXT::Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const
|
||||
void SCH_TEXT::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
if( aBackground )
|
||||
return;
|
||||
|
|
|
@ -89,8 +89,6 @@ public:
|
|||
*/
|
||||
virtual VECTOR2I GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const;
|
||||
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& offset ) override;
|
||||
|
||||
void SwapData( SCH_ITEM* aItem ) override;
|
||||
|
||||
const BOX2I GetBoundingBox() const override;
|
||||
|
@ -137,8 +135,11 @@ public:
|
|||
bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
|
||||
bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& offset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
EDA_ITEM* Clone() const override
|
||||
{
|
||||
|
|
|
@ -262,7 +262,8 @@ KIFONT::FONT* SCH_TEXTBOX::getDrawFont() const
|
|||
}
|
||||
|
||||
|
||||
void SCH_TEXTBOX::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
|
||||
void SCH_TEXTBOX::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
|
||||
{
|
||||
wxDC* DC = aSettings->GetPrintDC();
|
||||
int penWidth = GetPenWidth();
|
||||
|
@ -272,7 +273,7 @@ void SCH_TEXTBOX::Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& a
|
|||
COLOR4D color = GetStroke().GetColor();
|
||||
LINE_STYLE lineStyle = GetStroke().GetLineStyle();
|
||||
|
||||
if( GetFillMode() == FILL_T::FILLED_WITH_COLOR && !blackAndWhiteMode )
|
||||
if( GetFillMode() == FILL_T::FILLED_WITH_COLOR && !blackAndWhiteMode && !aForceNoFill )
|
||||
GRFilledRect( DC, pt1, pt2, 0, GetFillColor(), GetFillColor() );
|
||||
|
||||
if( penWidth > 0 )
|
||||
|
@ -408,12 +409,12 @@ BITMAPS SCH_TEXTBOX::GetMenuImage() const
|
|||
}
|
||||
|
||||
|
||||
void SCH_TEXTBOX::Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const
|
||||
void SCH_TEXTBOX::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
|
||||
{
|
||||
if( aBackground )
|
||||
{
|
||||
SCH_SHAPE::Plot( aPlotter, aBackground, aPlotSettings );
|
||||
SCH_SHAPE::Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -92,8 +92,6 @@ public:
|
|||
void SetExcludedFromSim( bool aExclude ) override { m_excludedFromSim = aExclude; }
|
||||
bool GetExcludedFromSim() const override { return m_excludedFromSim; }
|
||||
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, const VECTOR2I& offset ) override;
|
||||
|
||||
void SwapData( SCH_ITEM* aItem ) override;
|
||||
|
||||
bool operator<( const SCH_ITEM& aItem ) const override;
|
||||
|
@ -130,8 +128,11 @@ public:
|
|||
|
||||
BITMAPS GetMenuImage() const override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
const SCH_PLOT_SETTINGS& aPlotSettings ) const override;
|
||||
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
|
||||
const VECTOR2I& offset, bool aForceNoFill, bool aDimmed ) override;
|
||||
|
||||
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
|
||||
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
|
||||
|
||||
EDA_ITEM* Clone() const override
|
||||
{
|
||||
|
|
|
@ -91,6 +91,15 @@ public:
|
|||
*/
|
||||
virtual int GetUnitCount() const = 0;
|
||||
|
||||
virtual const wxString GetRef( const SCH_SHEET_PATH* aSheet,
|
||||
bool aIncludeUnit = false ) const = 0;
|
||||
|
||||
virtual const wxString GetValue( bool aResolve, const SCH_SHEET_PATH* aPath,
|
||||
bool aAllowExtraText ) const = 0;
|
||||
|
||||
virtual int GetUnit() const = 0;
|
||||
virtual int GetBodyStyle() const = 0;
|
||||
|
||||
/**
|
||||
* Set the offset in mils of the pin name text from the pin symbol.
|
||||
*
|
||||
|
|
|
@ -327,7 +327,7 @@ public:
|
|||
* @param aFullFileName is the full filename
|
||||
* @param aOffset is a plot offset, in iu
|
||||
*/
|
||||
void SVGPlotSymbol( const wxString& aFullFileName, VECTOR2I aOffset );
|
||||
void SVGPlotSymbol( const wxString& aFullFileName, const VECTOR2I& aOffset );
|
||||
|
||||
/**
|
||||
* Synchronize the library manager to the symbol library table, and then the symbol tree
|
||||
|
|
|
@ -26,8 +26,9 @@
|
|||
#include <symbol_edit_frame.h>
|
||||
#include <locale_io.h>
|
||||
#include <plotters/plotters_pslike.h>
|
||||
#include <sch_plotter.h>
|
||||
|
||||
void SYMBOL_EDIT_FRAME::SVGPlotSymbol( const wxString& aFullFileName, VECTOR2I aOffset )
|
||||
void SYMBOL_EDIT_FRAME::SVGPlotSymbol( const wxString& aFullFileName, const VECTOR2I& aOffset )
|
||||
{
|
||||
SCH_RENDER_SETTINGS renderSettings;
|
||||
renderSettings.LoadColors( GetColorSettings() );
|
||||
|
@ -49,36 +50,25 @@ void SYMBOL_EDIT_FRAME::SVGPlotSymbol( const wxString& aFullFileName, VECTOR2I a
|
|||
// Init :
|
||||
plotter->SetCreator( wxT( "Eeschema-SVG" ) );
|
||||
|
||||
if( ! plotter->OpenFile( aFullFileName ) )
|
||||
if( !plotter->OpenFile( aFullFileName ) )
|
||||
{
|
||||
delete plotter;
|
||||
return;
|
||||
}
|
||||
|
||||
LOCALE_IO toggle;
|
||||
LOCALE_IO toggle;
|
||||
SCH_PLOT_OPTS plotOpts;
|
||||
|
||||
plotter->StartPlot( wxT( "1" ) );
|
||||
|
||||
if( m_symbol )
|
||||
{
|
||||
constexpr bool background = true;
|
||||
TRANSFORM temp; // Uses default transform
|
||||
VECTOR2I plotPos;
|
||||
|
||||
plotPos.x = aOffset.x;
|
||||
plotPos.y = aOffset.y;
|
||||
|
||||
m_symbol->Plot( plotter, GetUnit(), GetBodyStyle(), background, plotPos, temp, false );
|
||||
|
||||
// Plot lib fields, not plotted by m_symbol->Plot():
|
||||
m_symbol->PlotLibFields( plotter, GetUnit(), GetBodyStyle(), background, plotPos, temp,
|
||||
false );
|
||||
|
||||
m_symbol->Plot( plotter, GetUnit(), GetBodyStyle(), !background, plotPos, temp, false );
|
||||
|
||||
// Plot lib fields, not plotted by m_symbol->Plot():
|
||||
m_symbol->PlotLibFields( plotter, GetUnit(), GetBodyStyle(), !background, plotPos, temp,
|
||||
false );
|
||||
m_symbol->Plot( plotter, background, plotOpts, GetUnit(), GetBodyStyle(), aOffset, false );
|
||||
m_symbol->Plot( plotter, !background, plotOpts, GetUnit(), GetBodyStyle(), aOffset, false );
|
||||
m_symbol->PlotFields( plotter, !background, plotOpts, GetUnit(), GetBodyStyle(), aOffset,
|
||||
false, GetShowInvisibleFields() );
|
||||
}
|
||||
|
||||
plotter->EndPlot();
|
||||
|
@ -94,14 +84,7 @@ void SYMBOL_EDIT_FRAME::PrintPage( const RENDER_SETTINGS* aSettings )
|
|||
const SCH_RENDER_SETTINGS* cfg = static_cast<const SCH_RENDER_SETTINGS*>( aSettings );
|
||||
VECTOR2I pagesize = GetScreen()->GetPageSettings().GetSizeIU( schIUScale.IU_PER_MILS );
|
||||
|
||||
/* Plot item centered to the page
|
||||
* In symbol_editor, the symbol is centered at 0,0 coordinates.
|
||||
* So we must plot it with an offset = pagesize/2.
|
||||
*/
|
||||
VECTOR2I plot_offset;
|
||||
plot_offset.x = pagesize.x / 2;
|
||||
plot_offset.y = pagesize.y / 2;
|
||||
|
||||
m_symbol->PrintBackground( cfg, plot_offset, m_unit, m_bodyStyle, false, false );
|
||||
m_symbol->Print( cfg, plot_offset, m_unit, m_bodyStyle, false, false );
|
||||
// Print item centered to the page.
|
||||
m_symbol->PrintBackground( cfg, m_unit, m_bodyStyle, pagesize / 2, false );
|
||||
m_symbol->Print( cfg, m_unit, m_bodyStyle, pagesize / 2, false, false );
|
||||
}
|
||||
|
|
|
@ -625,14 +625,14 @@ static SPIN_STYLE orientLabel( SCH_PIN* aPin )
|
|||
|
||||
ORIENT o = orientations[ 0 ];
|
||||
|
||||
SCH_SYMBOL* parentSymbol = aPin->GetParentSymbol();
|
||||
const SCH_SYMBOL* parentSymbol = static_cast<const SCH_SYMBOL*>( aPin->GetParentSymbol() );
|
||||
|
||||
if( !parentSymbol )
|
||||
return spin;
|
||||
|
||||
int symbolOrientation = parentSymbol->GetOrientation();
|
||||
|
||||
for( auto& i : orientations )
|
||||
for( const ORIENT& i : orientations )
|
||||
{
|
||||
if( i.flag == symbolOrientation )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue