59 return wxColour( 0, 0, 0, 30 );
61 return wxColour( 238, 243, 243 );
68 return wxColour( 238, 243, 243, 60 );
70 return wxColour( 84, 84, 84, 40 );
87 m_gal->SetLineWidth( 0 );
88 m_gal->SetIsFill(
true );
89 m_gal->SetIsStroke(
false );
103 PCB_DRAW_PANEL_GAL( aParentWindow, wxID_ANY, wxDefaultPosition, wxDefaultSize, aOptions, aGalType ),
109 m_view->UseDrawPriority(
true );
124 ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER );
127 [
this]( wxSizeEvent& aEvent )
135 Bind( wxEVT_RIGHT_UP,
136 [
this]( wxMouseEvent& aEvent )
139 menu.Append( wxID_ANY,
_(
"Zoom to Fit" ) );
141 menu.Bind( wxEVT_COMMAND_MENU_SELECTED,
142 [
this]( wxCommandEvent& )
158 BOX2I area = aBoardEdgesOnly ?
m_pcb->GetBoardEdgesBoundingBox() :
m_pcb->GetBoundingBox();
164 area.
SetEnd( pageSize.x, pageSize.y );
193 const wxSize clientSize = GetSize();
200 double scale =
m_view->GetScale() / std::max( fabs( vsize.
x / screenSize.
x ), fabs( vsize.
y / screenSize.
y ) );
202 if( !std::isfinite(
scale ) )
218 m_view->SetScale( aScale );
219 m_view->SetCenter( aCenter );
BASE_SCREEN class implementation.
constexpr EDA_IU_SCALE pcbIUScale
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
Information pertinent to a Pcbnew printed circuit board.
constexpr void SetOrigin(const Vec &pos)
constexpr size_type GetWidth() const
constexpr Vec Centre() const
constexpr size_type GetHeight() const
constexpr const SizeVec & GetSize() const
constexpr void SetEnd(coord_type x, coord_type y)
std::unique_ptr< KIGFX::PAINTER > m_painter
Contains information about how to draw items using GAL.
KIGFX::GAL * m_gal
Interface for drawing objects on a 2D-surface.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
KIGFX::VIEW * m_view
Stores view settings (scale, center, etc.) and items to be drawn.
void RequestRefresh()
Make sure a refresh gets done on the next idle event if it hasn't already.
void StartDrawing()
Begin drawing if it was stopped previously.
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
Contains methods for drawing PCB-specific items.
PCB_PAINTER(GAL *aGal, FRAME_T aFrameType)
virtual bool Draw(const VIEW_ITEM *aItem, int aLayer) override
Takes an instance of VIEW_ITEM and passes it to a function that knows how to draw the item.
An abstract base class for deriving all objects that can be added to a VIEW.
void UpdateColors()
Update the color settings in the painter and GAL.
BOX2I GetDefaultViewBBox() const override
Return the bounding box of the view that should be used if model is not valid.
PCB_DRAW_PANEL_GAL(wxWindow *aParentWindow, wxWindowID aWindowId, const wxPoint &aPosition, const wxSize &aSize, KIGFX::GAL_DISPLAY_OPTIONS &aOptions, GAL_TYPE aGalType=GAL_TYPE_MODERN)
bool Draw(const KIGFX::VIEW_ITEM *aItem, int aLayer) override
Takes an instance of VIEW_ITEM and passes it to a function that knows how to draw the item.
const wxSize GetPageSizeIU() const
std::unique_ptr< ZONE > m_zone
ZONE_PREVIEW_CANVAS(BOARD *aPcb, std::unique_ptr< ZONE > aZone, PCB_LAYER_ID aLayer, wxWindow *aParentWindow, KIGFX::GAL_DISPLAY_OPTIONS &aOptions, GAL_TYPE aGalType)
std::unique_ptr< BOARD_EDGES_BOUNDING_ITEM > m_pcb_bounding_box
void LockZoom(double aScale, const VECTOR2D &aCenter)
BOX2I GetBoardBoundingBox(bool aBoardEdgesOnly) const
const BOX2I GetDocumentExtents(bool aIncludeAllVisible=true) const
@ FRAME_FOOTPRINT_PREVIEW
PCB_LAYER_ID
A quick note on layer IDs:
VECTOR2< double > VECTOR2D
@ DRAW_ORDER_BOARD_BOUNDING
wxColour getBoundBoundingFillColor()
wxColour getCanvasBackgroundColor()