43 wxASSERT( aParent !=
nullptr );
52 *minPage = *selPageFrom = 1;
65 if( !wxPrintout::OnBeginDocument( startPage, endPage ) )
77 wxCHECK_MSG( page >= 1 && page <= (
int)sheetList.size(),
false,
78 wxT(
"Cannot print invalid page number." ) );
80 wxCHECK_MSG( sheetList[ page - 1].LastScreen() !=
nullptr,
false,
81 wxT(
"Cannot print page with NULL screen." ) );
84 msg.Printf(
_(
"Print page %d" ), page );
151 FitThisSizeToPaper( pageSizeIU );
153 fitRect = GetLogicalPaperRect();
158 int xoffset = ( fitRect.width - pageSizeIU.x ) / 2;
159 int yoffset = ( fitRect.height - pageSizeIU.y ) / 2;
163 if( dc->CanUseTransformMatrix() )
165 wxAffineMatrix2D matrix;
168 if( ( fitRect.width > fitRect.height ) != ( pageSizeIU.x > pageSizeIU.y ) )
172 matrix.Translate( 0, -pageSizeIU.y );
175 std::swap( pageSizeIU.x, pageSizeIU.y );
176 FitThisSizeToPaper( pageSizeIU );
177 fitRect = GetLogicalPaperRect();
179 xoffset = ( fitRect.width - pageSizeIU.x ) / 2;
180 yoffset = ( fitRect.height - pageSizeIU.y ) / 2;
184 std::swap( xoffset, yoffset );
185 std::swap( fitRect.width, fitRect.height );
189 matrix.Translate( xoffset, yoffset );
190 dc->SetTransformMatrix( matrix );
192 fitRect.x -= xoffset;
193 fitRect.y -= yoffset;
197 SetLogicalOrigin( 0, 0 );
199 OffsetLogicalOrigin( xoffset, yoffset );
202 dc->SetLogicalFunction( wxCOPY );
215 bgColor = COLOR4D::WHITE;
220 GRSFilledRect( dc, fitRect.GetX(), fitRect.GetY(), fitRect.GetRight(), fitRect.GetBottom(), 0,
241 if( printDrawingSheet )
249 aScreen->
Print( &renderSettings );
267 std::unique_ptr<KIGFX::SCH_PAINTER> painter = std::make_unique<KIGFX::SCH_PAINTER>( gal );
278 wxRect pageSizePx = GetLogicalPageRect();
279 const VECTOR2D pageSizeIn( (
double) pageSizePx.width / dc->GetPPI().x,
280 (
double) pageSizePx.height / dc->GetPPI().y );
283 galPrint->SetSheetSize( pageSizeIn );
286 view->SetPainter( painter.get() );
288 view->SetScale( 1.0 );
313 bgColor = COLOR4D::WHITE;
358 view->SetLayerVisible( i,
true );
378 double scaleX = (double) pageSizeIU.
x / drawingAreaBBox.
GetWidth();
379 double scaleY = (double) pageSizeIU.
y / drawingAreaBBox.
GetHeight();
381 double print_scale = std::min( scaleX, scaleY );
390 view->UseDrawPriority(
true );
constexpr EDA_IU_SCALE schIUScale
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
VECTOR2I m_DrawOrg
offsets for drawing the circuit on the screen
VECTOR2I m_StartVisu
Coordinates in drawing units of the current view position (upper left corner of device)
const wxString & GetPageNumber() const
constexpr size_type GetWidth() const
constexpr Vec Centre() const
constexpr size_type GetHeight() const
Color settings are a bit different than most of the settings objects in that there can be more than o...
COLOR4D GetColor(int aLayer) const
void SetPageNumber(const std::string &aPageNumber)
Changes the page number displayed in the title block.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
virtual void SetDrawBgColor(const COLOR4D &aColor)
void PrintDrawingSheet(const RENDER_SETTINGS *aSettings, BASE_SCREEN *aScreen, const std::map< wxString, wxString > *aProperties, double aMils2Iu, const wxString &aFilename, const wxString &aSheetLayer=wxEmptyString)
Prints the drawing-sheet (frame and title block).
A base class for most all the KiCad significant classes used in schematics and boards.
A color representation with 4 components: red, green, blue, alpha.
COLOR4D WithAlpha(double aAlpha) const
Return a color with the same color, but the given alpha.
CAIRO_ANTIALIASING_MODE cairo_antialiasing_mode
The grid style to draw the grid in.
static std::unique_ptr< GAL_PRINT > Create(GAL_DISPLAY_OPTIONS &aOptions, wxDC *aDC)
Abstract interface for drawing on a 2D-surface.
void SetZoomFactor(double aZoomFactor)
void SetLookAtPoint(const VECTOR2D &aPoint)
Get/set the Point in world space to look at.
virtual void ClearScreen()
Clear the screen.
void SetWorldUnitLength(double aWorldUnitLength)
Set the unit length.
void SetClearColor(const COLOR4D &aColor)
virtual bool HasNativeLandscapeRotation() const =0
void SetLayerColor(int aLayer, const COLOR4D &aColor)
Change the color used to draw a layer.
void SetDefaultFont(const wxString &aFont)
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
void SetPrintBlackAndWhite(bool aPrintBlackAndWhite)
void SetPrintDC(wxDC *aDC)
void SetIsPrinting(bool isPrinting)
DS_PROXY_VIEW_ITEM * GetDrawingSheet() const
static constexpr int VIEW_MAX_LAYERS
Rendering order modifier for layers that are marked as top layers.
std::unique_ptr< VIEW > DataReference() const
Return a new VIEW object that shares the same set of VIEW_ITEMs and LAYERs.
const VECTOR2D GetSizeIU(double aIUScale) const
Gets the page size in internal units.
virtual SETTINGS_MANAGER & GetSettingsManager() const
SCH_SHEET_LIST Hierarchy() const override
Return the full schematic flattened hierarchical sheet list.
const std::map< wxString, wxString > * GetProperties()
SCH_RENDER_SETTINGS * GetRenderSettings()
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
EESCHEMA_SETTINGS * eeconfig() const
COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Returns a pointer to the active color theme settings.
COLOR4D GetDrawBgColor() const override
KIGFX::SCH_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
Schematic editor (Eeschema) main window.
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
SCH_SHEET_PATH & GetCurrentSheet() const
SCHEMATIC & Schematic() const
void RecomputeIntersheetRefs()
Update the schematic's page reference map for all global labels, and refresh the labels so that they ...
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
Base class for any item which can be embedded within the SCHEMATIC container class,...
bool HasPage(int page) override
bool OnPrintPage(int page) override
void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo) override
const KIGFX::SCH_VIEW * m_view
SCH_PRINTOUT(SCH_EDIT_FRAME *aParent, const wxString &aTitle, bool aUseCairo)
SCH_EDIT_FRAME * m_parent
Source VIEW object (note that actual printing only refers to this object)
void PrintPage(SCH_SCREEN *aScreen)
bool OnBeginDocument(int startPage, int endPage) override
bool m_OverrideItemColors
void SetBackgroundColor(const COLOR4D &aColor) override
Set the background color.
const KIGFX::COLOR4D & GetBackgroundColor() const override
Return current background color settings.
bool m_ShowPinsElectricalType
void LoadColors(const COLOR_SETTINGS *aSettings) override
const PAGE_INFO & GetPageSettings() const
const wxString & GetFileName() const
void Print(const SCH_RENDER_SETTINGS *aSettings)
Print all the items in the screen to aDC.
SCHEMATIC * Schematic() const
bool CheckIfOnDrawList(const SCH_ITEM *aItem) const
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void SortByPageNumbers(bool aUpdateVirtualPageNums=true)
Sort the list of sheets by page number.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void UpdateAllScreenReferences() const
Update all the symbol references for this sheet path.
SCH_SCREEN * LastScreen()
int CountSheets() const
Count the number of sheets found in "this" sheet including all of the subsheets.
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
void GRForceBlackPen(bool flagforce)
void GRResetPenAndBrush(wxDC *DC)
void GRSFilledRect(wxDC *aDC, int x1, int y1, int x2, int y2, int aWidth, const COLOR4D &aColor, const COLOR4D &aBgColor)
#define LAYER_ID_COUNT
Must update this if you add any enums after GerbView!
@ LAYER_DRAWINGSHEET
drawingsheet frame and titleblock
@ LAYER_SELECT_OVERLAY
currently selected items overlay
@ LAYER_SCHEMATIC_DRAWINGSHEET
@ LAYER_SCHEMATIC_BACKGROUND
@ TARGET_NONCACHED
Auxiliary rendering target (noncached)
PGM_BASE & Pgm()
The global Program "get" accessor.
constexpr double SCH_WORLD_UNIT(1e-7/0.0254)
std::vector< FAB_LAYER_COLOR > dummy
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
bool monochrome
Whether or not to print in monochrome.
bool background
Whether or not to print background color.
wxString color_theme
Color theme to use for printing.
bool title_block
Whether or not to print title block.
bool use_theme
If false, display color theme will be used.
VECTOR2< int32_t > VECTOR2I
wxSize ToWxSize(const VECTOR2I &aSize)
#define ZOOM_MIN_LIMIT_EESCHEMA
#define ZOOM_MAX_LIMIT_EESCHEMA