KiCad PCB EDA Suite
KIGFX::SCH_VIEW Class Reference

#include <sch_view.h>

Inheritance diagram for KIGFX::SCH_VIEW:
KIGFX::VIEW

Public Types

typedef std::pair< VIEW_ITEM *, int > LAYER_ITEM_PAIR
 

Public Member Functions

 SCH_VIEW (bool aIsDynamic, SCH_BASE_FRAME *aFrame)
 
 ~SCH_VIEW ()
 
void Cleanup ()
 
void DisplaySheet (const SCH_SCREEN *aScreen)
 
void DisplayComponent (LIB_PART *aPart)
 
void ResizeSheetWorkingArea (const SCH_SCREEN *aScreen)
 
void SetScale (double aScale, VECTOR2D aAnchor={ 0, 0 }) override
 Set the scaling factor, zooming around a given anchor point. More...
 
void ClearHiddenFlags ()
 Clear the hide flag of all items in the view. More...
 
void HideDrawingSheet ()
 
DS_PROXY_VIEW_ITEMGetDrawingSheet () const
 
virtual void Add (VIEW_ITEM *aItem, int aDrawPriority=-1)
 Add a VIEW_ITEM to the view. More...
 
virtual void Remove (VIEW_ITEM *aItem)
 Remove a VIEW_ITEM from the view. More...
 
virtual int Query (const BOX2I &aRect, std::vector< LAYER_ITEM_PAIR > &aResult) const
 Find all visible items that touch or are within the rectangle aRect. More...
 
void SetVisible (VIEW_ITEM *aItem, bool aIsVisible=true)
 Set the item visibility. More...
 
void Hide (VIEW_ITEM *aItem, bool aHide=true)
 Temporarily hide the item in the view (e.g. More...
 
bool IsVisible (const VIEW_ITEM *aItem) const
 Return information if the item is visible (or not). More...
 
virtual void Update (const VIEW_ITEM *aItem, int aUpdateFlags) const
 For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has changed. More...
 
virtual void Update (const VIEW_ITEM *aItem) const
 
void SetRequired (int aLayerId, int aRequiredId, bool aRequired=true)
 Mark the aRequiredId layer as required for the aLayerId layer. More...
 
void CopySettings (const VIEW *aOtherView)
 Copy layers and visibility settings from another view. More...
 
void SetGAL (GAL *aGal)
 Assign a rendering device for the VIEW. More...
 
GALGetGAL () const
 Return the #GAL this view is using to draw graphical primitives. More...
 
void SetPainter (PAINTER *aPainter)
 Set the painter object used by the view for drawing #VIEW_ITEMS. More...
 
PAINTERGetPainter () const
 Return the painter object used by the view for drawing #VIEW_ITEMS. More...
 
void SetViewport (const BOX2D &aViewport)
 Set the visible area of the VIEW. More...
 
BOX2D GetViewport () const
 Return the current viewport visible area rectangle. More...
 
void SetMirror (bool aMirrorX, bool aMirrorY)
 Control the mirroring of the VIEW. More...
 
bool IsMirroredX () const
 Return true if view is flipped across the X axis. More...
 
bool IsMirroredY () const
 Return true if view is flipped across the Y axis. More...
 
double GetScale () const
 
void SetBoundary (const BOX2D &aBoundary)
 Set limits for view area. More...
 
void SetBoundary (const BOX2I &aBoundary)
 Set limits for view area. More...
 
const BOX2DGetBoundary () const
 
void SetScaleLimits (double aMaximum, double aMinimum)
 Set minimum and maximum values for scale. More...
 
void SetCenter (const VECTOR2D &aCenter)
 Set the center point of the VIEW (i.e. More...
 
void SetCenter (VECTOR2D aCenter, const BOX2D &occultingScreenRect)
 Set the center point of the VIEW, attempting to avoid occultingScreenRect (for instance, the screen rect of a modeless dialog in front of the VIEW). More...
 
const VECTOR2DGetCenter () const
 Return the center point of this VIEW (in world space coordinates). More...
 
VECTOR2D ToWorld (const VECTOR2D &aCoord, bool aAbsolute=true) const
 Converts a screen space point/vector to a point/vector in world space coordinates. More...
 
double ToWorld (double aSize) const
 Converts a screen space one dimensional size to a one dimensional size in world space coordinates. More...
 
VECTOR2D ToScreen (const VECTOR2D &aCoord, bool aAbsolute=true) const
 Convert a world space point/vector to a point/vector in screen space coordinates. More...
 
double ToScreen (double aSize) const
 Convert a world space one dimensional size to a one dimensional size in screen space. More...
 
const VECTOR2IGetScreenPixelSize () const
 Return the size of the our rendering area in pixels. More...
 
void Clear ()
 Remove all items from the view. More...
 
void SetLayerVisible (int aLayer, bool aVisible=true)
 Control the visibility of a particular layer. More...
 
bool IsLayerVisible (int aLayer) const
 Return information about visibility of a particular layer. More...
 
void SetLayerDisplayOnly (int aLayer, bool aDisplayOnly=true)
 
void SetLayerTarget (int aLayer, RENDER_TARGET aTarget)
 Change the rendering target for a particular layer. More...
 
void SetLayerOrder (int aLayer, int aRenderingOrder)
 Set rendering order of a particular layer. More...
 
int GetLayerOrder (int aLayer) const
 Return rendering order of a particular layer. More...
 
void SortLayers (int aLayers[], int &aCount) const
 Change the order of given layer ids, so after sorting the order corresponds to layers rendering order (descending, ie. More...
 
void ReorderLayerData (std::unordered_map< int, int > aReorderMap)
 Remap the data between layer ids without invalidating that data. More...
 
void UpdateLayerColor (int aLayer)
 Apply the new coloring scheme held by RENDER_SETTINGS in case that it has changed. More...
 
void UpdateAllLayersColor ()
 Apply the new coloring scheme to all layers. More...
 
virtual void SetTopLayer (int aLayer, bool aEnabled=true)
 Set given layer to be displayed on the top or sets back the default order of layers. More...
 
virtual void EnableTopLayer (bool aEnable)
 Enable or disable display of the top layer. More...
 
virtual int GetTopLayer () const
 
void ClearTopLayers ()
 Remove all layers from the on-the-top set (they are no longer displayed over the rest of layers). More...
 
void UpdateAllLayersOrder ()
 Do everything that is needed to apply the rendering order of layers. More...
 
void ClearTargets ()
 Clear targets that are marked as dirty. More...
 
virtual void Redraw ()
 Immediately redraws the whole view. More...
 
void RecacheAllItems ()
 Rebuild GAL display lists. More...
 
bool IsDynamic () const
 Tell if the VIEW is dynamic (ie. More...
 
bool IsDirty () const
 Return true if any of the VIEW layers needs to be refreshened. More...
 
bool IsTargetDirty (int aTarget) const
 Return true if any of layers belonging to the target or the target itself should be redrawn. More...
 
void MarkTargetDirty (int aTarget)
 Set or clear target 'dirty' flag. More...
 
bool IsCached (int aLayer) const
 Return true if the layer is cached. More...
 
void MarkDirty ()
 Force redraw of view on the next rendering. More...
 
void MarkForUpdate (VIEW_ITEM *aItem)
 Add an item to a list of items that are going to be refreshed upon the next frame rendering. More...
 
void UpdateItems ()
 Iterate through the list of items that asked for updating and updates them. More...
 
void UpdateAllItems (int aUpdateFlags)
 Update all items in the view according to the given flags. More...
 
void UpdateAllItemsConditionally (int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
 Update items in the view according to the given flags and condition. More...
 
bool IsUsingDrawPriority () const
 
void UseDrawPriority (bool aFlag)
 
bool IsDrawOrderReversed () const
 
void ReverseDrawOrder (bool aFlag)
 Only takes effect if UseDrawPriority is true. More...
 
std::shared_ptr< VIEW_OVERLAYMakeOverlay ()
 
void InitPreview ()
 
void ClearPreview ()
 
void AddToPreview (EDA_ITEM *aItem, bool aTakeOwnership=true)
 
void ShowPreview (bool aShow=true)
 
std::unique_ptr< VIEWDataReference () const
 Return a new VIEW object that shares the same set of VIEW_ITEMs and LAYERs. More...
 
int GetPrintMode () const
 Get the current print mode. More...
 
void SetPrintMode (int aPrintMode)
 Set the printing mode. More...
 

Static Public Member Functions

static void OnDestroy (VIEW_ITEM *aItem)
 Nasty hack, invoked by the destructor of VIEW_ITEM to auto-remove the item from the owning VIEW if there is any. More...
 

Static Public Attributes

static constexpr int VIEW_MAX_LAYERS = 512
 maximum number of layers that may be shown More...
 

Protected Member Functions

void redrawRect (const BOX2I &aRect)
 
void markTargetClean (int aTarget)
 
void draw (VIEW_ITEM *aItem, int aLayer, bool aImmediate=false)
 Draw an item, but on a specified layers. More...
 
void draw (VIEW_ITEM *aItem, bool aImmediate=false)
 Draw an item on all layers that the item uses. More...
 
void draw (VIEW_GROUP *aGroup, bool aImmediate=false)
 Draw a group of items on all layers that those items use. More...
 
void sortLayers ()
 Clear cached GAL group numbers (ONLY numbers stored in VIEW_ITEMs, not group objects used by GAL) More...
 
void clearGroupCache ()
 
void invalidateItem (VIEW_ITEM *aItem, int aUpdateFlags)
 Manage dirty flags & redraw queuing when updating an item. More...
 
void updateItemColor (VIEW_ITEM *aItem, int aLayer)
 Update all information needed to draw an item. More...
 
void updateItemGeometry (VIEW_ITEM *aItem, int aLayer)
 Update bounding box of an item. More...
 
void updateBbox (VIEW_ITEM *aItem)
 Update set of layers that an item occupies. More...
 
void updateLayers (VIEW_ITEM *aItem)
 Determine rendering order of layers. Used in display order sorting function. More...
 
bool areRequiredLayersEnabled (int aLayerId) const
 

Static Protected Member Functions

static bool compareRenderingOrder (VIEW_LAYER *aI, VIEW_LAYER *aJ)
 Check if every layer required by the aLayerId layer is enabled. More...
 

Protected Attributes

std::unique_ptr< KIGFX::VIEW_GROUPm_preview
 
std::vector< EDA_ITEM * > m_ownedItems
 Whether to use rendering order modifier or not. More...
 
bool m_enableOrderModifier
 The set of possible displayed layers and its properties. More...
 
std::vector< VIEW_LAYERm_layers
 Sorted list of pointers to members of m_layers. More...
 
std::vector< VIEW_LAYER * > m_orderedLayers
 Flat list of all items. More...
 
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
 The set of layers that are displayed on the top. More...
 
std::set< unsigned int > m_topLayers
 Center point of the VIEW (the point at which we are looking at). More...
 
VECTOR2D m_center
 Scale of displayed VIEW_ITEMs. More...
 
double m_scale
 View boundaries. More...
 
BOX2D m_boundary
 Scale lower limit. More...
 
double m_minScale
 Scale upper limit. More...
 
double m_maxScale
 Horizontal flip flag. More...
 
bool m_mirrorX
 Vertical flip flag. More...
 
bool m_mirrorY
 PAINTER contains information how do draw items. More...
 
PAINTERm_painter
 Interface to #PAINTER that is used to draw items. More...
 
GALm_gal
 Dynamic VIEW (eg. More...
 
bool m_dynamic
 Flag to mark targets as dirty so they have to be redrawn on the next refresh event. More...
 
bool m_dirtyTargets [TARGETS_NUMBER]
 Rendering order modifier for layers that are marked as top layers. More...
 
bool m_useDrawPriority
 The next sequential drawing priority. More...
 
int m_nextDrawPriority
 Flag to reverse the draw order when using draw priority. More...
 
bool m_reverseDrawOrder
 A control for printing: m_printMode <= 0 means no printing mode (normal draw mode m_printMode > 0 is a printing mode (currently means "we are in printing mode"). More...
 
int m_printMode
 

Static Protected Attributes

static const int TOP_LAYER_MODIFIER = -VIEW_MAX_LAYERS
 Flag to respect draw priority when drawing items. More...
 

Private Attributes

SCH_BASE_FRAMEm_frame
 
std::unique_ptr< DS_PROXY_VIEW_ITEMm_drawingSheet
 

Detailed Description

Definition at line 73 of file sch_view.h.

Member Typedef Documentation

◆ LAYER_ITEM_PAIR

typedef std::pair<VIEW_ITEM*, int> KIGFX::VIEW::LAYER_ITEM_PAIR
inherited

Definition at line 72 of file view.h.

Constructor & Destructor Documentation

◆ SCH_VIEW()

KIGFX::SCH_VIEW::SCH_VIEW ( bool  aIsDynamic,
SCH_BASE_FRAME aFrame 
)

Definition at line 46 of file sch_view.cpp.

46  :
47  VIEW( aIsDynamic )
48 {
49  m_frame = aFrame;
50  // Set m_boundary to define the max working area size. The default value is acceptable for
51  // Pcbnew and Gerbview, but too large for Eeschema due to very different internal units.
52  // A full size = 3 * MAX_PAGE_SIZE_MILS size allows a wide margin around the drawing-sheet.
53  double max_size = Mils2iu( MAX_PAGE_SIZE_MILS ) * 3.0;
54  m_boundary.SetOrigin( -max_size/4, -max_size/4 );
55  m_boundary.SetSize( max_size, max_size );
56 }
void SetSize(const Vec &size)
Definition: box2.h:212
BOX2D m_boundary
Scale lower limit.
Definition: view.h:829
void SetOrigin(const Vec &pos)
Definition: box2.h:210
SCH_BASE_FRAME * m_frame
Definition: sch_view.h:101
#define MAX_PAGE_SIZE_MILS
Definition: page_info.h:41
VIEW(bool aIsDynamic=true)
Definition: view.cpp:262

References KIGFX::VIEW::m_boundary, m_frame, MAX_PAGE_SIZE_MILS, BOX2< Vec >::SetOrigin(), and BOX2< Vec >::SetSize().

◆ ~SCH_VIEW()

KIGFX::SCH_VIEW::~SCH_VIEW ( )

Definition at line 59 of file sch_view.cpp.

60 {
61 }

Member Function Documentation

◆ Add()

void KIGFX::VIEW::Add ( VIEW_ITEM aItem,
int  aDrawPriority = -1 
)
virtualinherited

Add a VIEW_ITEM to the view.

Set aDrawPriority to -1 to assign sequential priorities.

Parameters
aItemitem to be added. No ownership is given
aDrawPrioritypriority to draw this item on its layer, lowest first.

Reimplemented in KIGFX::PCB_VIEW.

Definition at line 321 of file view.cpp.

322 {
323  int layers[VIEW_MAX_LAYERS], layers_count;
324 
325  if( aDrawPriority < 0 )
326  aDrawPriority = m_nextDrawPriority++;
327 
328  if( !aItem->m_viewPrivData )
329  aItem->m_viewPrivData = new VIEW_ITEM_DATA;
330 
331  aItem->m_viewPrivData->m_view = this;
332  aItem->m_viewPrivData->m_drawPriority = aDrawPriority;
333 
334  aItem->ViewGetLayers( layers, layers_count );
335  aItem->viewPrivData()->saveLayers( layers, layers_count );
336 
337  m_allItems->push_back( aItem );
338 
339  for( int i = 0; i < layers_count; ++i )
340  {
341  VIEW_LAYER& l = m_layers[layers[i]];
342  l.items->Insert( aItem );
343  MarkTargetDirty( l.target );
344  }
345 
346  SetVisible( aItem, true );
347  Update( aItem, KIGFX::INITIAL_ADD );
348 }
Item is being added to the view.
Definition: view_item.h:56
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:700
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
The set of layers that are displayed on the top.
Definition: view.h:817
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
Definition: view.h:574
int m_nextDrawPriority
Flag to reverse the draw order when using draw priority.
Definition: view.h:863
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Set the item visibility.
Definition: view.cpp:1454
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1508

References KIGFX::INITIAL_ADD, KIGFX::VIEW::VIEW_LAYER::items, KIGFX::VIEW::m_allItems, KIGFX::VIEW_ITEM_DATA::m_drawPriority, KIGFX::VIEW::m_layers, KIGFX::VIEW::m_nextDrawPriority, KIGFX::VIEW_ITEM_DATA::m_view, KIGFX::VIEW_ITEM::m_viewPrivData, KIGFX::VIEW::MarkTargetDirty(), KIGFX::VIEW_ITEM_DATA::saveLayers(), KIGFX::VIEW::SetVisible(), KIGFX::VIEW::VIEW_LAYER::target, KIGFX::VIEW::Update(), KIGFX::VIEW::VIEW_MAX_LAYERS, KIGFX::VIEW_ITEM::ViewGetLayers(), and KIGFX::VIEW_ITEM::viewPrivData().

Referenced by KIGFX::PCB_VIEW::Add(), SCH_BASE_FRAME::AddToScreen(), PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems(), EDA_DRAW_PANEL_GAL::DebugOverlay(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PCB_DRAW_PANEL_GAL::DisplayBoard(), DisplayComponent(), SYMBOL_PREVIEW_WIDGET::DisplayPart(), DisplaySheet(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), PL_DRAW_PANEL_GAL::DisplayWorksheet(), PCB_SELECTION_TOOL::doSelectionMenu(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawSegment(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), EE_GRID_HELPER::EE_GRID_HELPER(), KIGFX::VIEW::InitPreview(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), KIGFX::VIEW::MakeOverlay(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PCB_GRID_HELPER::PCB_GRID_HELPER(), DRAWING_TOOL::PlaceImportedGraphics(), DIALOG_PAD_PROPERTIES::prepareCanvas(), BOARD_COMMIT::Push(), GERBVIEW_FRAME::Read_EXCELLON_File(), GERBVIEW_FRAME::Read_GERBER_File(), DIALOG_PAD_PROPERTIES::redraw(), BOARD_EDITOR_CONTROL::Reset(), PCB_CONTROL::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), EE_SELECTION_TOOL::Reset(), BOARD_COMMIT::Revert(), GERBVIEW_SELECTION_TOOL::select(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), ZOOM_TOOL::selectRegion(), PCB_DRAW_PANEL_GAL::SetDrawingSheet(), GERBVIEW_DRAW_PANEL_GAL::SetDrawingSheet(), PNS_KICAD_IFACE::SetView(), PNS_PCBNEW_DEBUG_DECORATOR::SetView(), GERBVIEW_DRAW_PANEL_GAL::SwitchBackend(), DS_DATA_ITEM::SyncDrawItems(), DS_DATA_ITEM_POLYGONS::SyncDrawItems(), DS_DATA_ITEM_TEXT::SyncDrawItems(), DS_DATA_ITEM_BITMAP::SyncDrawItems(), DIALOG_ERC::testErc(), EE_POINT_EDITOR::updatePoints(), PCB_POINT_EDITOR::updatePoints(), SYMBOL_VIEWER_FRAME::updatePreviewSymbol(), KIGFX::VIEW::VIEW(), and ZONE_CREATE_HELPER::ZONE_CREATE_HELPER().

◆ AddToPreview()

void KIGFX::VIEW::AddToPreview ( EDA_ITEM aItem,
bool  aTakeOwnership = true 
)
inherited

Definition at line 1552 of file view.cpp.

1553 {
1554  Hide( aItem, false );
1555  m_preview->Add( aItem );
1556 
1557  if( aTakeOwnership )
1558  m_ownedItems.push_back( aItem );
1559 
1560  SetVisible( m_preview.get(), true );
1561  Hide( m_preview.get(), false );
1562  Update( m_preview.get() );
1563 }
void Hide(VIEW_ITEM *aItem, bool aHide=true)
Temporarily hide the item in the view (e.g.
Definition: view.cpp:1475
std::unique_ptr< KIGFX::VIEW_GROUP > m_preview
Definition: view.h:802
std::vector< EDA_ITEM * > m_ownedItems
Whether to use rendering order modifier or not.
Definition: view.h:805
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Set the item visibility.
Definition: view.cpp:1454
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1508

References KIGFX::VIEW::Hide(), KIGFX::VIEW::m_ownedItems, KIGFX::VIEW::m_preview, KIGFX::VIEW::SetVisible(), and KIGFX::VIEW::Update().

Referenced by SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), ROUTER_TOOL::InlineDrag(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ areRequiredLayersEnabled()

bool KIGFX::VIEW::areRequiredLayersEnabled ( int  aLayerId) const
protectedinherited

Definition at line 1354 of file view.cpp.

1355 {
1356  wxCHECK( (unsigned) aLayerId < m_layers.size(), false );
1357 
1358  std::set<int>::const_iterator it, it_end;
1359 
1360  for( it = m_layers.at( aLayerId ).requiredLayers.begin(),
1361  it_end = m_layers.at( aLayerId ).requiredLayers.end(); it != it_end; ++it )
1362  {
1363  // That is enough if just one layer is not enabled
1364  if( !m_layers.at( *it ).visible || !areRequiredLayersEnabled( *it ) )
1365  return false;
1366  }
1367 
1368  return true;
1369 }
bool areRequiredLayersEnabled(int aLayerId) const
Definition: view.cpp:1354
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811

References KIGFX::VIEW::m_layers.

Referenced by KIGFX::VIEW::redrawRect().

◆ Cleanup()

void KIGFX::SCH_VIEW::Cleanup ( )

Definition at line 64 of file sch_view.cpp.

65 {
66  Clear();
67  m_drawingSheet.reset();
68  m_preview.reset();
69 }
std::unique_ptr< DS_PROXY_VIEW_ITEM > m_drawingSheet
Definition: sch_view.h:104
std::unique_ptr< KIGFX::VIEW_GROUP > m_preview
Definition: view.h:802
void Clear()
Remove all items from the view.
Definition: view.cpp:1083

References KIGFX::VIEW::Clear(), m_drawingSheet, and KIGFX::VIEW::m_preview.

Referenced by SCH_DRAW_PANEL::DisplaySheet().

◆ Clear()

void KIGFX::VIEW::Clear ( )
inherited

Remove all items from the view.

Definition at line 1083 of file view.cpp.

1084 {
1085  BOX2I r;
1086  r.SetMaximum();
1087  m_allItems->clear();
1088 
1089  for( VIEW_LAYER& layer : m_layers )
1090  layer.items->RemoveAll();
1091 
1092  m_nextDrawPriority = 0;
1093 
1094  m_gal->ClearCache();
1095 }
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
The set of layers that are displayed on the top.
Definition: view.h:817
void SetMaximum()
Definition: box2.h:73
int m_nextDrawPriority
Flag to reverse the draw order when using draw priority.
Definition: view.h:863
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811
virtual void ClearCache()
Delete all data created during caching of graphic items.

References KIGFX::GAL::ClearCache(), KIGFX::VIEW::m_allItems, KIGFX::VIEW::m_gal, KIGFX::VIEW::m_layers, KIGFX::VIEW::m_nextDrawPriority, and BOX2< Vec >::SetMaximum().

Referenced by Cleanup(), GERBVIEW_FRAME::Clear_DrawLayers(), PCB_DRAW_PANEL_GAL::DisplayBoard(), SCH_DRAW_PANEL::DisplayComponent(), DisplayComponent(), SCH_DRAW_PANEL::DisplaySheet(), PL_DRAW_PANEL_GAL::DisplayWorksheet(), GERBVIEW_FRAME::doCloseWindow(), DISPLAY_FOOTPRINTS_FRAME::InitDisplay(), FOOTPRINT_PREVIEW_PANEL::renderFootprint(), DS_PROXY_UNDO_ITEM::Restore(), PCB_BASE_EDIT_FRAME::SetBoard(), SYMBOL_EDIT_FRAME::SetCurPart(), GERBVIEW_DRAW_PANEL_GAL::SwitchBackend(), DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME(), FOOTPRINT_PREVIEW_PANEL::~FOOTPRINT_PREVIEW_PANEL(), FOOTPRINT_VIEWER_FRAME::~FOOTPRINT_VIEWER_FRAME(), GERBVIEW_FRAME::~GERBVIEW_FRAME(), and PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME().

◆ clearGroupCache()

void KIGFX::VIEW::clearGroupCache ( )
protectedinherited

Definition at line 1173 of file view.cpp.

1174 {
1175  BOX2I r;
1176 
1177  r.SetMaximum();
1178  clearLayerCache visitor( this );
1179 
1180  for( VIEW_LAYER& layer : m_layers )
1181  layer.items->Query( r, visitor );
1182 }
void SetMaximum()
Definition: box2.h:73
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811

References KIGFX::VIEW::m_layers, and BOX2< Vec >::SetMaximum().

Referenced by KIGFX::VIEW::SetGAL().

◆ ClearHiddenFlags()

void KIGFX::SCH_VIEW::ClearHiddenFlags ( )

Clear the hide flag of all items in the view.

Definition at line 171 of file sch_view.cpp.

172 {
173  for( auto item : *m_allItems )
174  Hide( item, false );
175 }
void Hide(VIEW_ITEM *aItem, bool aHide=true)
Temporarily hide the item in the view (e.g.
Definition: view.cpp:1475
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
The set of layers that are displayed on the top.
Definition: view.h:817

References KIGFX::VIEW::Hide(), and KIGFX::VIEW::m_allItems.

Referenced by SCH_EDIT_FRAME::AddJunction(), SCH_EDIT_FRAME::PutDataInPreviousState(), SYMBOL_EDIT_FRAME::RebuildView(), and SYMBOL_EDIT_FRAME::SetCurPart().

◆ ClearPreview()

void KIGFX::VIEW::ClearPreview ( )
inherited

Definition at line 1530 of file view.cpp.

1531 {
1532  if( !m_preview )
1533  return;
1534 
1535  m_preview->Clear();
1536 
1537  for( EDA_ITEM *item : m_ownedItems )
1538  delete item;
1539 
1540  m_ownedItems.clear();
1541  Update( m_preview.get() );
1542 }
std::unique_ptr< KIGFX::VIEW_GROUP > m_preview
Definition: view.h:802
std::vector< EDA_ITEM * > m_ownedItems
Whether to use rendering order modifier or not.
Definition: view.h:805
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:149
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1508

References KIGFX::VIEW::m_ownedItems, KIGFX::VIEW::m_preview, and KIGFX::VIEW::Update().

Referenced by SCH_EDIT_FRAME::AddJunction(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), ROUTER_TOOL::InlineDrag(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ ClearTargets()

void KIGFX::VIEW::ClearTargets ( )
inherited

Clear targets that are marked as dirty.

Definition at line 1098 of file view.cpp.

1099 {
1101  {
1102  // TARGET_CACHED and TARGET_NONCACHED have to be redrawn together, as they contain
1103  // layers that rely on each other (eg. netnames are noncached, but tracks - are cached)
1106 
1107  MarkDirty();
1108  }
1109 
1110  if( IsTargetDirty( TARGET_OVERLAY ) )
1111  {
1113  }
1114 }
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
Auxiliary rendering target (noncached)
Definition: definitions.h:49
bool IsTargetDirty(int aTarget) const
Return true if any of layers belonging to the target or the target itself should be redrawn.
Definition: view.h:563
virtual void ClearTarget(RENDER_TARGET aTarget)
Clear the target for rendering.
Items that may change while the view stays the same (noncached)
Definition: definitions.h:50
Main rendering target (cached)
Definition: definitions.h:48
void MarkDirty()
Force redraw of view on the next rendering.
Definition: view.h:598

References KIGFX::GAL::ClearTarget(), KIGFX::VIEW::IsTargetDirty(), KIGFX::VIEW::m_gal, KIGFX::VIEW::MarkDirty(), KIGFX::TARGET_CACHED, KIGFX::TARGET_NONCACHED, and KIGFX::TARGET_OVERLAY.

Referenced by EDA_DRAW_PANEL_GAL::DoRePaint().

◆ ClearTopLayers()

void KIGFX::VIEW::ClearTopLayers ( )
inherited

Remove all layers from the on-the-top set (they are no longer displayed over the rest of layers).

Definition at line 884 of file view.cpp.

885 {
886  std::set<unsigned int>::iterator it;
887 
889  {
890  // Restore the previous rendering order for layers that were marked as top
891  for( it = m_topLayers.begin(); it != m_topLayers.end(); ++it )
892  m_layers[*it].renderingOrder -= TOP_LAYER_MODIFIER;
893  }
894 
895  m_topLayers.clear();
896 }
static const int TOP_LAYER_MODIFIER
Flag to respect draw priority when drawing items.
Definition: view.h:857
std::set< unsigned int > m_topLayers
Center point of the VIEW (the point at which we are looking at).
Definition: view.h:820
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811
bool m_enableOrderModifier
The set of possible displayed layers and its properties.
Definition: view.h:808

References KIGFX::VIEW::m_enableOrderModifier, KIGFX::VIEW::m_layers, KIGFX::VIEW::m_topLayers, and KIGFX::VIEW::TOP_LAYER_MODIFIER.

Referenced by GERBVIEW_DRAW_PANEL_GAL::SetTopLayer(), PL_DRAW_PANEL_GAL::SetTopLayer(), PCB_DRAW_PANEL_GAL::SetTopLayer(), and EDA_DRAW_PANEL_GAL::SetTopLayer().

◆ compareRenderingOrder()

static bool KIGFX::VIEW::compareRenderingOrder ( VIEW_LAYER aI,
VIEW_LAYER aJ 
)
inlinestaticprotectedinherited

Check if every layer required by the aLayerId layer is enabled.

Definition at line 787 of file view.h.

References KIGFX::VIEW::VIEW_LAYER::renderingOrder.

Referenced by KIGFX::VIEW::sortLayers().

◆ CopySettings()

void KIGFX::VIEW::CopySettings ( const VIEW aOtherView)
inherited

Copy layers and visibility settings from another view.

Parameters
aOtherViewview from which settings will be copied.

Definition at line 488 of file view.cpp.

489 {
490  wxASSERT_MSG( false, wxT( "This is not implemented" ) );
491 }

◆ DataReference()

std::unique_ptr< VIEW > KIGFX::VIEW::DataReference ( ) const
inherited

Return a new VIEW object that shares the same set of VIEW_ITEMs and LAYERs.

GAL, PAINTER and other properties are left uninitialized.

Definition at line 1444 of file view.cpp.

1445 {
1446  auto ret = std::make_unique<VIEW>();
1447  ret->m_allItems = m_allItems;
1448  ret->m_layers = m_layers;
1449  ret->sortLayers();
1450  return ret;
1451 }
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
The set of layers that are displayed on the top.
Definition: view.h:817
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811

References KIGFX::VIEW::m_allItems, and KIGFX::VIEW::m_layers.

Referenced by BOARD_PRINTOUT::DrawPage().

◆ DisplayComponent()

void KIGFX::SCH_VIEW::DisplayComponent ( LIB_PART aPart)

Definition at line 121 of file sch_view.cpp.

122 {
123  Clear();
124 
125  if( !aPart )
126  return;
127 
128  std::shared_ptr< LIB_PART > parent;
129  LIB_PART* drawnPart = aPart;
130 
131  // Draw the mandatory fields for aliases and parent symbols.
132  for( LIB_ITEM& item : aPart->GetDrawItems() )
133  {
134  if( item.Type() != LIB_FIELD_T )
135  continue;
136 
137  LIB_FIELD* field = static_cast< LIB_FIELD* >( &item );
138 
139  wxCHECK2( field, continue );
140 
141  if( field->GetText().IsEmpty() )
142  continue;
143 
144  Add( &item );
145  }
146 
147  // Draw the parent items if the symbol is inherited from another symbol.
148  if( aPart->IsAlias() )
149  {
150  parent = aPart->GetParent().lock();
151 
152  wxCHECK( parent, /* void */ );
153 
154  drawnPart = parent.get();
155  }
156 
157  for( LIB_ITEM& item : drawnPart->GetDrawItems() )
158  {
159  // Don't show parent symbol fields. Users may be confused by shown fields that can not
160  // be edited.
161  if( aPart->IsAlias() && item.Type() == LIB_FIELD_T )
162  continue;
163 
164  Add( &item );
165  }
166 
167  InitPreview();
168 }
Field object used in symbol libraries.
Definition: lib_field.h:59
void InitPreview()
Definition: view.cpp:1545
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
void Clear()
Remove all items from the view.
Definition: view.cpp:1083
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
Definition: lib_symbol.h:467
PART_REF & GetParent()
Definition: lib_symbol.h:120
Define a library symbol object.
Definition: lib_symbol.h:93
bool IsAlias() const
Definition: lib_symbol.h:168
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition: view.cpp:321
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133

References KIGFX::VIEW::Add(), KIGFX::VIEW::Clear(), LIB_PART::GetDrawItems(), LIB_PART::GetParent(), EDA_TEXT::GetText(), KIGFX::VIEW::InitPreview(), LIB_PART::IsAlias(), and LIB_FIELD_T.

Referenced by SCH_DRAW_PANEL::DisplayComponent().

◆ DisplaySheet()

void KIGFX::SCH_VIEW::DisplaySheet ( const SCH_SCREEN aScreen)

Definition at line 92 of file sch_view.cpp.

93 {
94  for( SCH_ITEM* item : aScreen->Items() )
95  Add( item );
96 
97  m_drawingSheet.reset( new DS_PROXY_VIEW_ITEM( static_cast<int>( IU_PER_MILS ),
98  &aScreen->GetPageSettings(),
99  &aScreen->Schematic()->Prj(),
100  &aScreen->GetTitleBlock() ) );
101  m_drawingSheet->SetPageNumber( TO_UTF8( aScreen->GetPageNumber() ) );
102  m_drawingSheet->SetSheetCount( aScreen->GetPageCount() );
103  m_drawingSheet->SetFileName( TO_UTF8( aScreen->GetFileName() ) );
105  m_drawingSheet->SetPageBorderColorLayer( LAYER_SCHEMATIC_GRID );
106  m_drawingSheet->SetIsFirstPage( aScreen->GetVirtualPageNumber() == 1 );
107 
108  if( m_frame && m_frame->IsType( FRAME_SCH ) )
109  m_drawingSheet->SetSheetName( TO_UTF8( m_frame->GetScreenDesc() ) );
110  else
111  m_drawingSheet->SetSheetName( "" );
112 
113  ResizeSheetWorkingArea( aScreen );
114 
115  Add( m_drawingSheet.get() );
116 
117  InitPreview();
118 }
std::unique_ptr< DS_PROXY_VIEW_ITEM > m_drawingSheet
Definition: sch_view.h:104
const wxString & GetFileName() const
Definition: sch_screen.h:192
int GetVirtualPageNumber() const
Definition: base_screen.h:79
void InitPreview()
Definition: view.cpp:1545
int GetPageCount() const
Definition: base_screen.h:76
const TITLE_BLOCK & GetTitleBlock() const
Definition: sch_screen.h:197
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:187
const wxString & GetPageNumber() const
Definition: base_screen.cpp:78
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: macros.h:96
void ResizeSheetWorkingArea(const SCH_SCREEN *aScreen)
Definition: sch_view.cpp:82
PROJECT & Prj() const override
Return a reference to the project this schematic is part of.
Definition: schematic.h:99
bool IsType(FRAME_T aType) const
SCHEMATIC * Schematic() const
Definition: sch_screen.cpp:87
EE_RTREE & Items()
Definition: sch_screen.h:162
#define IU_PER_MILS
Definition: plotter.cpp:137
SCH_BASE_FRAME * m_frame
Definition: sch_view.h:101
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition: view.cpp:321
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:196
virtual wxString GetScreenDesc() const

References KIGFX::VIEW::Add(), FRAME_SCH, SCH_SCREEN::GetFileName(), BASE_SCREEN::GetPageCount(), BASE_SCREEN::GetPageNumber(), SCH_SCREEN::GetPageSettings(), EDA_DRAW_FRAME::GetScreenDesc(), SCH_SCREEN::GetTitleBlock(), BASE_SCREEN::GetVirtualPageNumber(), KIGFX::VIEW::InitPreview(), EDA_BASE_FRAME::IsType(), SCH_SCREEN::Items(), IU_PER_MILS, LAYER_SCHEMATIC_DRAWINGSHEET, LAYER_SCHEMATIC_GRID, m_drawingSheet, m_frame, SCHEMATIC::Prj(), ResizeSheetWorkingArea(), SCH_SCREEN::Schematic(), and TO_UTF8.

Referenced by SCH_DRAW_PANEL::DisplaySheet().

◆ draw() [1/3]

void KIGFX::VIEW::draw ( VIEW_ITEM aItem,
int  aLayer,
bool  aImmediate = false 
)
protectedinherited

Draw an item, but on a specified layers.

It has to be marked that some of drawing settings are based on the layer on which an item is drawn.

Parameters
aItemis the item to be drawn.
aLayeris the layer which should be drawn.
aImmediatedictates the way of drawing - it allows one to force immediate drawing mode for cached items.

Definition at line 1001 of file view.cpp.

1002 {
1003  auto viewData = aItem->viewPrivData();
1004 
1005  if( !viewData )
1006  return;
1007 
1008  if( IsCached( aLayer ) && !aImmediate )
1009  {
1010  // Draw using cached information or create one
1011  int group = viewData->getGroup( aLayer );
1012 
1013  if( group >= 0 )
1014  m_gal->DrawGroup( group );
1015  else
1016  Update( aItem );
1017  }
1018  else
1019  {
1020  // Immediate mode
1021  if( !m_painter->Draw( aItem, aLayer ) )
1022  aItem->ViewDraw( aLayer, this ); // Alternative drawing method
1023  }
1024 }
virtual void DrawGroup(int aGroupNumber)
Draw the stored group.
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
PAINTER * m_painter
Interface to #PAINTER that is used to draw items.
Definition: view.h:844
virtual bool Draw(const VIEW_ITEM *aItem, int aLayer)=0
Takes an instance of VIEW_ITEM and passes it to a function that knows how to draw the item.
bool IsCached(int aLayer) const
Return true if the layer is cached.
Definition: view.h:581
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1508

References KIGFX::PAINTER::Draw(), KIGFX::GAL::DrawGroup(), KIGFX::VIEW_ITEM_DATA::getGroup(), KIGFX::VIEW::IsCached(), KIGFX::VIEW::m_gal, KIGFX::VIEW::m_painter, KIGFX::VIEW::Update(), KIGFX::VIEW_ITEM::ViewDraw(), and KIGFX::VIEW_ITEM::viewPrivData().

Referenced by KIGFX::VIEW::drawItem::deferredDraw(), KIGFX::VIEW::draw(), and KIGFX::VIEW::drawItem::operator()().

◆ draw() [2/3]

void KIGFX::VIEW::draw ( VIEW_ITEM aItem,
bool  aImmediate = false 
)
protectedinherited

Draw an item on all layers that the item uses.

Parameters
aItemis the item to be drawn.
aImmediatedictates the way of drawing - it allows one to force immediate drawing mode for cached items.

Definition at line 1027 of file view.cpp.

1028 {
1029  int layers[VIEW_MAX_LAYERS], layers_count;
1030 
1031  aItem->ViewGetLayers( layers, layers_count );
1032 
1033  // Sorting is needed for drawing order dependent GALs (like Cairo)
1034  SortLayers( layers, layers_count );
1035 
1036  for( int i = 0; i < layers_count; ++i )
1037  {
1038  m_gal->SetLayerDepth( m_layers.at( layers[i] ).renderingOrder );
1039  draw( aItem, layers[i], aImmediate );
1040  }
1041 }
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
virtual void SetLayerDepth(double aLayerDepth)
Set the depth of the layer (position on the z-axis)
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:700
void SortLayers(int aLayers[], int &aCount) const
Change the order of given layer ids, so after sorting the order corresponds to layers rendering order...
Definition: view.cpp:653
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811
void draw(VIEW_ITEM *aItem, int aLayer, bool aImmediate=false)
Draw an item, but on a specified layers.
Definition: view.cpp:1001

References KIGFX::VIEW::draw(), KIGFX::VIEW::m_gal, KIGFX::VIEW::m_layers, KIGFX::GAL::SetLayerDepth(), KIGFX::VIEW::SortLayers(), KIGFX::VIEW::VIEW_MAX_LAYERS, and KIGFX::VIEW_ITEM::ViewGetLayers().

◆ draw() [3/3]

void KIGFX::VIEW::draw ( VIEW_GROUP aGroup,
bool  aImmediate = false 
)
protectedinherited

Draw a group of items on all layers that those items use.

Parameters
aGroupis the group to be drawn.
aImmediatedictates the way of drawing - it allows one to force immediate drawing mode for cached items.Sort m_orderedLayers when layer rendering order has changed

Definition at line 1044 of file view.cpp.

1045 {
1046  for( unsigned int i = 0; i < aGroup->GetSize(); i++)
1047  draw( aGroup->GetItem(i), aImmediate );
1048 }
void draw(VIEW_ITEM *aItem, int aLayer, bool aImmediate=false)
Draw an item, but on a specified layers.
Definition: view.cpp:1001

References KIGFX::VIEW::draw(), KIGFX::VIEW_GROUP::GetItem(), and KIGFX::VIEW_GROUP::GetSize().

◆ EnableTopLayer()

void KIGFX::VIEW::EnableTopLayer ( bool  aEnable)
virtualinherited

Enable or disable display of the top layer.

When disabled, layers are rendered as usual with no influence from SetTopLayer function. Otherwise on the top there is displayed the layer set previously with SetTopLayer function.

Parameters
aEnablewhether to enable or disable display of the top layer.

Definition at line 859 of file view.cpp.

860 {
861  if( aEnable == m_enableOrderModifier )
862  return;
863 
864  m_enableOrderModifier = aEnable;
865 
866  std::set<unsigned int>::iterator it;
867 
868  if( aEnable )
869  {
870  for( it = m_topLayers.begin(); it != m_topLayers.end(); ++it )
871  m_layers[*it].renderingOrder += TOP_LAYER_MODIFIER;
872  }
873  else
874  {
875  for( it = m_topLayers.begin(); it != m_topLayers.end(); ++it )
876  m_layers[*it].renderingOrder -= TOP_LAYER_MODIFIER;
877  }
878 
881 }
static const int TOP_LAYER_MODIFIER
Flag to respect draw priority when drawing items.
Definition: view.h:857
std::set< unsigned int > m_topLayers
Center point of the VIEW (the point at which we are looking at).
Definition: view.h:820
void UpdateAllLayersOrder()
Do everything that is needed to apply the rendering order of layers.
Definition: view.cpp:899
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811
bool m_enableOrderModifier
The set of possible displayed layers and its properties.
Definition: view.h:808
void UpdateAllLayersColor()
Apply the new coloring scheme to all layers.
Definition: view.cpp:770

References KIGFX::VIEW::m_enableOrderModifier, KIGFX::VIEW::m_layers, KIGFX::VIEW::m_topLayers, KIGFX::VIEW::TOP_LAYER_MODIFIER, KIGFX::VIEW::UpdateAllLayersColor(), and KIGFX::VIEW::UpdateAllLayersOrder().

Referenced by PCB_DRAW_PANEL_GAL::SetTopLayer().

◆ GetBoundary()

const BOX2D& KIGFX::VIEW::GetBoundary ( ) const
inlineinherited
Returns
Current view area boundary.

Definition at line 292 of file view.h.

293  {
294  return m_boundary;
295  }
BOX2D m_boundary
Scale lower limit.
Definition: view.h:829

References KIGFX::VIEW::m_boundary.

Referenced by ROUTER_TOOL::handleCommonEvents(), KIGFX::WX_VIEW_CONTROLS::onScroll(), and KIGFX::WX_VIEW_CONTROLS::UpdateScrollbars().

◆ GetCenter()

const VECTOR2D& KIGFX::VIEW::GetCenter ( ) const
inlineinherited

Return the center point of this VIEW (in world space coordinates).

Returns
center point of the view

Definition at line 333 of file view.h.

334  {
335  return m_center;
336  }
VECTOR2D m_center
Scale of displayed VIEW_ITEMs.
Definition: view.h:823

References KIGFX::VIEW::m_center.

Referenced by EDA_DRAW_PANEL_GAL::DoRePaint(), KIGFX::WX_VIEW_CONTROLS::onButton(), KIGFX::WX_VIEW_CONTROLS::onScroll(), KIGFX::WX_VIEW_CONTROLS::onTimer(), KIGFX::WX_VIEW_CONTROLS::onWheel(), and SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor().

◆ GetDrawingSheet()

DS_PROXY_VIEW_ITEM* KIGFX::SCH_VIEW::GetDrawingSheet ( ) const
inline

Definition at line 98 of file sch_view.h.

98 { return m_drawingSheet.get(); }
std::unique_ptr< DS_PROXY_VIEW_ITEM > m_drawingSheet
Definition: sch_view.h:104

References m_drawingSheet.

Referenced by SCH_EDIT_FRAME::GetDocumentExtents(), SCH_EDIT_TOOL::Properties(), and DIALOG_ERC::testErc().

◆ GetGAL()

GAL* KIGFX::VIEW::GetGAL ( ) const
inlineinherited

Return the #GAL this view is using to draw graphical primitives.

Returns
Pointer to the currently used GAL instance.

Definition at line 189 of file view.h.

190  {
191  return m_gal;
192  }
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847

References KIGFX::VIEW::m_gal.

Referenced by PCB_GRID_HELPER::BestDragOrigin(), EE_GRID_HELPER::BestDragOrigin(), PCB_GRID_HELPER::BestSnapAnchor(), GRID_HELPER::canUseGrid(), KIGFX::WX_VIEW_CONTROLS::CenterOnCursor(), COMMON_TOOLS::CursorControl(), PCB_CONTROL::DoSetGridOrigin(), COMMON_TOOLS::doZoomInOut(), drawBacksideTicks(), KIGFX::PREVIEW::CENTRELINE_RECT_ITEM::drawPreviewShape(), KIGFX::PREVIEW::POLYGON_ITEM::drawPreviewShape(), KIGFX::PREVIEW::DrawTextNextToCursor(), drawTicksAlongLine(), KIGFX::VIEW_OVERLAY::COMMAND_LINE::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_RECTANGLE::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_CIRCLE::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_ARC::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_POLYGON::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_POLY_POLYGON::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_POINT_POLYGON::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_SET_STROKE::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_SET_FILL::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_SET_COLOR::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_SET_WIDTH::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_GLYPH_SIZE::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_BITMAP_TEXT::Execute(), GRID_HELPER::GetGrid(), EE_SELECTION_TOOL::GetNode(), GRID_HELPER::GetOrigin(), KIGFX::WX_VIEW_CONTROLS::GetRawCursorPosition(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), PCB_VIEWER_TOOLS::MeasureTool(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), COMMON_TOOLS::PanControl(), DIALOG_PAD_PROPERTIES::prepareCanvas(), KIGFX::WX_VIEW_CONTROLS::SetCrossHairCursorPosition(), KIGFX::VIEW_CONTROLS::ShowCursor(), PNS::TOOL_BASE::updateEndItem(), PNS::TOOL_BASE::updateStartItem(), PCB_BRIGHT_BOX::ViewDraw(), RATSNEST_VIEW_ITEM::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), KIGFX::PREVIEW::ARC_ASSISTANT::ViewDraw(), BRIGHT_BOX::ViewDraw(), KIGFX::ORIGIN_VIEWITEM::ViewDraw(), KIGFX::PREVIEW::TWO_POINT_ASSISTANT::ViewDraw(), KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::ViewDraw(), MY_DRAWING::ViewDraw(), KIGFX::PREVIEW::SELECTION_AREA::ViewDraw(), KIGFX::VIEW_GROUP::ViewDraw(), ROUTER_PREVIEW_ITEM::ViewDraw(), DS_PROXY_VIEW_ITEM::ViewDraw(), EDIT_POINTS::ViewDraw(), and KIGFX::WX_VIEW_CONTROLS::WarpCursor().

◆ GetLayerOrder()

int KIGFX::VIEW::GetLayerOrder ( int  aLayer) const
inherited

Return rendering order of a particular layer.

Lower values are rendered first.

Parameters
aLayeris the layer.
Returns
Rendering order of a particular layer.

Definition at line 647 of file view.cpp.

648 {
649  return m_layers.at( aLayer ).renderingOrder;
650 }
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811

References KIGFX::VIEW::m_layers.

Referenced by PCB_DRAW_PANEL_GAL::SetTopLayer(), and KIGFX::VIEW::SortLayers().

◆ GetPainter()

PAINTER* KIGFX::VIEW::GetPainter ( ) const
inlineinherited

Return the painter object used by the view for drawing #VIEW_ITEMS.

Returns
Pointer to the currently used Painter instance.

Definition at line 207 of file view.h.

208  {
209  return m_painter;
210  }
PAINTER * m_painter
Interface to #PAINTER that is used to draw items.
Definition: view.h:844

References KIGFX::VIEW::m_painter.

Referenced by PCB_BASE_FRAME::ActivateGalCanvas(), DS_PROXY_VIEW_ITEM::buildDrawList(), DIALOG_NET_INSPECTOR::buildNetsList(), BOARD_INSPECTION_TOOL::ClearHighlight(), PL_EDITOR_FRAME::CommonSettingsChanged(), PCB_BASE_FRAME::CommonSettingsChanged(), PCB_GRID_HELPER::computeAnchors(), SYMBOL_PREVIEW_WIDGET::DisplayPart(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), PL_DRAW_PANEL_GAL::DisplayWorksheet(), BOARD_INSPECTION_TOOL::doHideNet(), KIGFX::PREVIEW::POLYGON_ITEM::drawPreviewShape(), KIGFX::PREVIEW::DrawTextNextToCursor(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL(), FOOTPRINT_PREVIEW_PANEL::GetBackgroundColor(), FOOTPRINT_PREVIEW_PANEL::GetForegroundColor(), ROUTER_PREVIEW_ITEM::getLayerColor(), SCH_BASE_FRAME::GetRenderSettings(), PNS::TOOL_BASE::highlightNet(), BOARD_INSPECTION_TOOL::HighlightNet(), BOARD_INSPECTION_TOOL::highlightNet(), PNS_KICAD_IFACE::IsItemVisible(), PCB_BASE_FRAME::LoadSettings(), DIALOG_PAD_PROPERTIES::onChangePadMode(), ZONE_CREATE_HELPER::OnFirstPoint(), APPEARANCE_CONTROLS::OnLayerAlphaChanged(), GERBER_LAYER_WIDGET::OnLayerColorChange(), APPEARANCE_CONTROLS::onNetclassColorChanged(), APPEARANCE_CONTROLS::onNetclassContextMenu(), DIALOG_NET_INSPECTOR::onSelChanged(), GERBVIEW_DRAW_PANEL_GAL::OnShow(), PCB_DRAW_PANEL_GAL::OnShow(), DIALOG_NET_INSPECTOR::onSortingChanged(), PCB_GRID_HELPER::PCB_GRID_HELPER(), DIALOG_PAD_PROPERTIES::prepareCanvas(), PCB_GRID_HELPER::queryVisible(), NET_GRID_TABLE::Rebuild(), APPEARANCE_CONTROLS::rebuildNets(), DIALOG_PAD_PROPERTIES::redraw(), FOOTPRINT_PREVIEW_PANEL::renderFootprint(), GERBVIEW_SELECTION_TOOL::Reset(), EE_SELECTION_TOOL::Reset(), PCB_SELECTION_TOOL::Reset(), PCB_SELECTION_TOOL::Selectable(), GERBVIEW_DRAW_PANEL_GAL::SetHighContrastLayer(), PCB_DRAW_PANEL_GAL::SetHighContrastLayer(), EDA_DRAW_PANEL_GAL::SetHighContrastLayer(), PCBNEW_PRINTOUT::setupViewLayers(), SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET(), PANEL_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_PL_EDITOR_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_EDIT_OPTIONS::TransferDataFromWindow(), PANEL_SYM_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_EESCHEMA_COLOR_SETTINGS::TransferDataFromWindow(), PCB_DRAW_PANEL_GAL::UpdateColors(), KIGFX::PCB_VIEW::UpdateDisplayOptions(), NET_GRID_TABLE::updateNetColor(), PANEL_PCBNEW_COLOR_SETTINGS::updatePreview(), PANEL_EESCHEMA_COLOR_SETTINGS::updatePreview(), RATSNEST_VIEW_ITEM::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), KIGFX::PREVIEW::SELECTION_AREA::ViewDraw(), KIGFX::VIEW_GROUP::ViewDraw(), DS_PROXY_VIEW_ITEM::ViewDraw(), EDIT_POINTS::ViewDraw(), TRACK::ViewGetLOD(), VIA::ViewGetLOD(), and PAD::ViewGetLOD().

◆ GetPrintMode()

int KIGFX::VIEW::GetPrintMode ( ) const
inlineinherited

Get the current print mode.

Return values less than or equal to zero indicate the current mode is the draw mode. Return values greater than zero indicate print mode.

Returns
the printing mode.

Definition at line 690 of file view.h.

690 { return m_printMode; }
int m_printMode
Definition: view.h:870

References KIGFX::VIEW::m_printMode.

Referenced by KIGFX::VIEW::IsLayerVisible(), VIA::ViewGetLOD(), and PAD::ViewGetLOD().

◆ GetScale()

◆ GetScreenPixelSize()

const VECTOR2I & KIGFX::VIEW::GetScreenPixelSize ( ) const
inherited

Return the size of the our rendering area in pixels.

Returns
viewport screen size.

Definition at line 1149 of file view.cpp.

1150 {
1151  return m_gal->GetScreenPixelSize();
1152 }
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
const VECTOR2I & GetScreenPixelSize() const
Return GAL canvas size in pixels.

References KIGFX::GAL::GetScreenPixelSize(), and KIGFX::VIEW::m_gal.

Referenced by KIGFX::WX_VIEW_CONTROLS::handleAutoPanning(), KIGFX::WX_VIEW_CONTROLS::onScroll(), KIGFX::WX_VIEW_CONTROLS::onTimer(), and KIGFX::WX_VIEW_CONTROLS::onWheel().

◆ GetTopLayer()

int KIGFX::VIEW::GetTopLayer ( ) const
virtualinherited

Definition at line 823 of file view.cpp.

824 {
825  if( m_topLayers.size() == 0 )
826  return 0;
827 
828  return *m_topLayers.begin();
829 }
std::set< unsigned int > m_topLayers
Center point of the VIEW (the point at which we are looking at).
Definition: view.h:820

References KIGFX::VIEW::m_topLayers.

Referenced by ROUTER_TOOL::getStartLayer(), PCB_SELECTION_TOOL::GuessSelectionCandidates(), PNS::TOOL_BASE::pickSingleItem(), and PNS::TOOL_BASE::updateStartItem().

◆ GetViewport()

BOX2D KIGFX::VIEW::GetViewport ( ) const
inherited

Return the current viewport visible area rectangle.

Returns
Current viewport rectangle.

Definition at line 513 of file view.cpp.

514 {
515  BOX2D rect;
516  VECTOR2D screenSize = m_gal->GetScreenPixelSize();
517 
518  rect.SetOrigin( ToWorld( VECTOR2D( 0, 0 ) ) );
519  rect.SetEnd( ToWorld( screenSize ) );
520 
521  return rect.Normalize();
522 }
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Converts a screen space point/vector to a point/vector in world space coordinates.
Definition: view.cpp:450
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
const VECTOR2I & GetScreenPixelSize() const
Return GAL canvas size in pixels.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
BOX2< Vec > & Normalize()
Function Normalize ensures that the height ant width are positive.
Definition: box2.h:129
void SetEnd(coord_type x, coord_type y)
Definition: box2.h:225
void SetOrigin(const Vec &pos)
Definition: box2.h:210

References KIGFX::GAL::GetScreenPixelSize(), KIGFX::VIEW::m_gal, BOX2< Vec >::Normalize(), BOX2< Vec >::SetEnd(), BOX2< Vec >::SetOrigin(), and KIGFX::VIEW::ToWorld().

Referenced by drawBacksideTicks(), drawTicksAlongLine(), SCH_EDITOR_CONTROL::FindComponentAndItem(), EDA_DRAW_FRAME::FocusOnLocation(), PCB_SELECTION_TOOL::hitTestDistance(), and KIGFX::WX_VIEW_CONTROLS::UpdateScrollbars().

◆ Hide()

void KIGFX::VIEW::Hide ( VIEW_ITEM aItem,
bool  aHide = true 
)
inherited

Temporarily hide the item in the view (e.g.

for overlaying).

Parameters
aItemthe item to modify.
aHidewhether the item is hidden (on all layers), or not.

Definition at line 1475 of file view.cpp.

1476 {
1477  auto viewData = aItem->viewPrivData();
1478 
1479  if( !viewData )
1480  return;
1481 
1482  if( !( viewData->m_flags & VISIBLE ) )
1483  return;
1484 
1485  if( aHide )
1486  viewData->m_flags |= HIDDEN;
1487  else
1488  viewData->m_flags &= ~HIDDEN;
1489 
1490  Update( aItem, APPEARANCE );
1491 }
Item is temporarily hidden (e.g.
Definition: view_item.h:66
Visibility flag has changed.
Definition: view_item.h:52
Item is visible (in general)
Definition: view_item.h:65
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1508

References KIGFX::APPEARANCE, KIGFX::HIDDEN, KIGFX::VIEW_ITEM_DATA::m_flags, KIGFX::VIEW::Update(), KIGFX::VIEW_ITEM::viewPrivData(), and KIGFX::VISIBLE.

Referenced by KIGFX::VIEW::AddToPreview(), ClearHiddenFlags(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PCB_SELECTION_TOOL::highlightInternal(), ROUTER_TOOL::InlineDrag(), SCH_MOVE_TOOL::moveItem(), SCH_EDITOR_CONTROL::Paste(), GERBVIEW_SELECTION_TOOL::selectVisually(), PCB_SELECTION_TOOL::unhighlightInternal(), and GERBVIEW_SELECTION_TOOL::unselectVisually().

◆ HideDrawingSheet()

void KIGFX::SCH_VIEW::HideDrawingSheet ( )

Definition at line 178 of file sch_view.cpp.

179 {
180  // SetVisible( m_drawingSheet.get(), false );
181 }

Referenced by SYMBOL_EDIT_FRAME::RebuildView(), and SYMBOL_EDIT_FRAME::SetCurPart().

◆ InitPreview()

void KIGFX::VIEW::InitPreview ( )
inherited

Definition at line 1545 of file view.cpp.

1546 {
1547  m_preview.reset( new KIGFX::VIEW_GROUP() );
1548  Add( m_preview.get() );
1549 }
std::unique_ptr< KIGFX::VIEW_GROUP > m_preview
Definition: view.h:802
Extend VIEW_ITEM by possibility of grouping items into a single object.
Definition: view_group.h:46
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition: view.cpp:321

References KIGFX::VIEW::Add(), and KIGFX::VIEW::m_preview.

Referenced by DisplayComponent(), DisplaySheet(), ROUTER_TOOL::InlineDrag(), and PCB_BASE_EDIT_FRAME::SetBoard().

◆ invalidateItem()

void KIGFX::VIEW::invalidateItem ( VIEW_ITEM aItem,
int  aUpdateFlags 
)
protectedinherited

Manage dirty flags & redraw queuing when updating an item.

Parameters
aItemis the item to be updated.
aUpdateFlagsdetermines the way an item is refreshed.Update colors that are used for an item to be drawn

Definition at line 1185 of file view.cpp.

1186 {
1187  if( aUpdateFlags & INITIAL_ADD )
1188  {
1189  // Don't update layers or bbox, since it was done in VIEW::Add()
1190  // Now that we have initialized, set flags to ALL for the code below
1191  aUpdateFlags = ALL;
1192  }
1193  else
1194  {
1195  // updateLayers updates geometry too, so we do not have to update both of them at the
1196  // same time
1197  if( aUpdateFlags & LAYERS )
1198  {
1199  updateLayers( aItem );
1200  }
1201  else if( aUpdateFlags & GEOMETRY )
1202  {
1203  updateBbox( aItem );
1204  }
1205  }
1206 
1207  int layers[VIEW_MAX_LAYERS], layers_count;
1208  aItem->ViewGetLayers( layers, layers_count );
1209 
1210  // Iterate through layers used by the item and recache it immediately
1211  for( int i = 0; i < layers_count; ++i )
1212  {
1213  int layerId = layers[i];
1214 
1215  if( IsCached( layerId ) )
1216  {
1217  if( aUpdateFlags & ( GEOMETRY | LAYERS | REPAINT ) )
1218  updateItemGeometry( aItem, layerId );
1219  else if( aUpdateFlags & COLOR )
1220  updateItemColor( aItem, layerId );
1221  }
1222 
1223  // Mark those layers as dirty, so the VIEW will be refreshed
1224  MarkTargetDirty( m_layers[layerId].target );
1225  }
1226 
1227  aItem->viewPrivData()->clearUpdateFlags();
1228 }
Item is being added to the view.
Definition: view_item.h:56
void updateLayers(VIEW_ITEM *aItem)
Determine rendering order of layers. Used in display order sorting function.
Definition: view.cpp:1311
void updateItemColor(VIEW_ITEM *aItem, int aLayer)
Update all information needed to draw an item.
Definition: view.cpp:1246
Color has changed.
Definition: view_item.h:53
All except INITIAL_ADD.
Definition: view_item.h:58
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:700
Item needs to be redrawn.
Definition: view_item.h:57
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
Definition: view.h:574
void updateBbox(VIEW_ITEM *aItem)
Update set of layers that an item occupies.
Definition: view.cpp:1295
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811
void updateItemGeometry(VIEW_ITEM *aItem, int aLayer)
Update bounding box of an item.
Definition: view.cpp:1265
bool IsCached(int aLayer) const
Return true if the layer is cached.
Definition: view.h:581
Layers have changed.
Definition: view_item.h:55
Position or shape has changed.
Definition: view_item.h:54

References KIGFX::ALL, KIGFX::VIEW_ITEM_DATA::clearUpdateFlags(), KIGFX::COLOR, KIGFX::GEOMETRY, KIGFX::INITIAL_ADD, KIGFX::VIEW::IsCached(), KIGFX::LAYERS, KIGFX::VIEW::m_layers, KIGFX::VIEW::MarkTargetDirty(), KIGFX::REPAINT, KIGFX::VIEW::updateBbox(), KIGFX::VIEW::updateItemColor(), KIGFX::VIEW::updateItemGeometry(), KIGFX::VIEW::updateLayers(), KIGFX::VIEW::VIEW_MAX_LAYERS, KIGFX::VIEW_ITEM::ViewGetLayers(), and KIGFX::VIEW_ITEM::viewPrivData().

Referenced by KIGFX::VIEW::UpdateItems().

◆ IsCached()

bool KIGFX::VIEW::IsCached ( int  aLayer) const
inlineinherited

Return true if the layer is cached.

Definition at line 581 of file view.h.

582  {
583  wxCHECK( aLayer < (int) m_layers.size(), false );
584 
585  try
586  {
587  return m_layers.at( aLayer ).target == TARGET_CACHED;
588  }
589  catch( const std::out_of_range& )
590  {
591  return false;
592  }
593  }
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811
Main rendering target (cached)
Definition: definitions.h:48

References KIGFX::VIEW::m_layers, and KIGFX::TARGET_CACHED.

Referenced by KIGFX::VIEW::draw(), KIGFX::VIEW::invalidateItem(), KIGFX::VIEW::RecacheAllItems(), KIGFX::VIEW::updateItemColor(), KIGFX::VIEW::updateItemGeometry(), KIGFX::VIEW::UpdateLayerColor(), and KIGFX::VIEW::updateLayers().

◆ IsDirty()

bool KIGFX::VIEW::IsDirty ( ) const
inlineinherited

Return true if any of the VIEW layers needs to be refreshened.

Returns
True in case if any of layers is marked as dirty.

Definition at line 546 of file view.h.

547  {
548  for( int i = 0; i < TARGETS_NUMBER; ++i )
549  {
550  if( IsTargetDirty( i ) )
551  return true;
552  }
553 
554  return false;
555  }
Number of available rendering targets.
Definition: definitions.h:51
bool IsTargetDirty(int aTarget) const
Return true if any of layers belonging to the target or the target itself should be redrawn.
Definition: view.h:563

References KIGFX::VIEW::IsTargetDirty(), and KIGFX::TARGETS_NUMBER.

Referenced by EDA_DRAW_PANEL_GAL::DoRePaint(), and TOOL_MANAGER::ProcessEvent().

◆ IsDrawOrderReversed()

bool KIGFX::VIEW::IsDrawOrderReversed ( ) const
inlineinherited
Returns
true if draw order is reversed

Definition at line 651 of file view.h.

652  {
653  return m_reverseDrawOrder;
654  }
bool m_reverseDrawOrder
A control for printing: m_printMode <= 0 means no printing mode (normal draw mode m_printMode > 0 is ...
Definition: view.h:866

References KIGFX::VIEW::m_reverseDrawOrder.

◆ IsDynamic()

bool KIGFX::VIEW::IsDynamic ( ) const
inlineinherited

Tell if the VIEW is dynamic (ie.

can be changed, for example displaying PCBs in a window) or static (that cannot be modified, eg. displaying image/PDF).

Definition at line 536 of file view.h.

537  {
538  return m_dynamic;
539  }
bool m_dynamic
Flag to mark targets as dirty so they have to be redrawn on the next refresh event.
Definition: view.h:851

References KIGFX::VIEW::m_dynamic.

◆ IsLayerVisible()

bool KIGFX::VIEW::IsLayerVisible ( int  aLayer) const
inlineinherited

Return information about visibility of a particular layer.

Parameters
aLayertrue if the layer is visible, false otherwise.

Definition at line 404 of file view.h.

405  {
406  wxCHECK( aLayer < (int) m_layers.size(), false );
407 
408  if( GetPrintMode() > 0 )
409  return true;
410 
411  return m_layers.at( aLayer ).visible;
412  }
int GetPrintMode() const
Get the current print mode.
Definition: view.h:690
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811

References KIGFX::VIEW::GetPrintMode(), and KIGFX::VIEW::m_layers.

Referenced by GERBVIEW_DRAW_PANEL_GAL::GetDefaultViewBBox(), PCB_DRAW_PANEL_GAL::GetDefaultViewBBox(), GERBVIEW_FRAME::GetVisibleLayers(), APPEARANCE_CONTROLS::getVisibleLayers(), APPEARANCE_CONTROLS::getVisibleObjects(), PNS_KICAD_IFACE::IsAnyLayerVisible(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), GERBER_LAYER_WIDGET::ReFill(), PCB_SELECTION_TOOL::Selectable(), RATSNEST_VIEW_ITEM::ViewDraw(), KIGFX::VIEW_GROUP::ViewDraw(), FP_SHAPE::ViewGetLOD(), PCB_GROUP::ViewGetLOD(), ZONE::ViewGetLOD(), TRACK::ViewGetLOD(), FP_TEXT::ViewGetLOD(), VIA::ViewGetLOD(), FOOTPRINT::ViewGetLOD(), PAD::ViewGetLOD(), and FP_ZONE::ViewGetLOD().

◆ IsMirroredX()

◆ IsMirroredY()

bool KIGFX::VIEW::IsMirroredY ( ) const
inlineinherited

Return true if view is flipped across the Y axis.

Definition at line 245 of file view.h.

246  {
247  return m_mirrorY;
248  }
bool m_mirrorY
PAINTER contains information how do draw items.
Definition: view.h:841

References KIGFX::VIEW::m_mirrorY.

◆ IsTargetDirty()

bool KIGFX::VIEW::IsTargetDirty ( int  aTarget) const
inlineinherited

Return true if any of layers belonging to the target or the target itself should be redrawn.

Returns
True if the above condition is fulfilled.

Definition at line 563 of file view.h.

564  {
565  wxCHECK( aTarget < TARGETS_NUMBER, false );
566  return m_dirtyTargets[aTarget];
567  }
Number of available rendering targets.
Definition: definitions.h:51
bool m_dirtyTargets[TARGETS_NUMBER]
Rendering order modifier for layers that are marked as top layers.
Definition: view.h:854

References KIGFX::VIEW::m_dirtyTargets, and KIGFX::TARGETS_NUMBER.

Referenced by KIGFX::VIEW::ClearTargets(), EDA_DRAW_PANEL_GAL::DoRePaint(), KIGFX::VIEW::IsDirty(), and KIGFX::VIEW::redrawRect().

◆ IsUsingDrawPriority()

bool KIGFX::VIEW::IsUsingDrawPriority ( ) const
inlineinherited
Returns
true if draw priority is being respected while redrawing.

Definition at line 635 of file view.h.

636  {
637  return m_useDrawPriority;
638  }
bool m_useDrawPriority
The next sequential drawing priority.
Definition: view.h:860

References KIGFX::VIEW::m_useDrawPriority.

◆ IsVisible()

bool KIGFX::VIEW::IsVisible ( const VIEW_ITEM aItem) const
inherited

Return information if the item is visible (or not).

Parameters
aItemthe item to test.
Returns
when true, the item is visible (i.e. to be displayed, not visible in the current viewport)

Definition at line 1494 of file view.cpp.

1495 {
1496  const auto viewData = aItem->viewPrivData();
1497 
1498  return viewData && ( viewData->m_flags & VISIBLE );
1499 }
Item is visible (in general)
Definition: view_item.h:65

References KIGFX::VIEW_ITEM::viewPrivData(), and KIGFX::VISIBLE.

Referenced by EE_GRID_HELPER::BestSnapAnchor(), PCB_GRID_HELPER::BestSnapAnchor(), PCB_GRID_HELPER::computeAnchors(), PNS_KICAD_IFACE::HideItem(), PNS_KICAD_IFACE::IsItemVisible(), EE_GRID_HELPER::queryVisible(), PCB_GRID_HELPER::queryVisible(), and PCB_SELECTION_TOOL::Selectable().

◆ MakeOverlay()

std::shared_ptr< VIEW_OVERLAY > KIGFX::VIEW::MakeOverlay ( )
inherited

Definition at line 1521 of file view.cpp.

1522 {
1523  std::shared_ptr<VIEW_OVERLAY> overlay( new VIEW_OVERLAY );
1524 
1525  Add( overlay.get() );
1526  return overlay;
1527 }
static std::shared_ptr< KIGFX::VIEW_OVERLAY > overlay
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition: view.cpp:321

References KIGFX::VIEW::Add(), and overlay.

Referenced by AUTOPLACE_TOOL::autoplace().

◆ MarkDirty()

◆ MarkForUpdate()

void KIGFX::VIEW::MarkForUpdate ( VIEW_ITEM aItem)
inherited

Add an item to a list of items that are going to be refreshed upon the next frame rendering.

Parameters
aItemis the item to be refreshed.

◆ markTargetClean()

void KIGFX::VIEW::markTargetClean ( int  aTarget)
inlineprotectedinherited

Definition at line 722 of file view.h.

723  {
724  wxCHECK( aTarget < TARGETS_NUMBER, /* void */ );
725  m_dirtyTargets[aTarget] = false;
726  }
Number of available rendering targets.
Definition: definitions.h:51
bool m_dirtyTargets[TARGETS_NUMBER]
Rendering order modifier for layers that are marked as top layers.
Definition: view.h:854

References KIGFX::VIEW::m_dirtyTargets, and KIGFX::TARGETS_NUMBER.

Referenced by KIGFX::VIEW::Redraw().

◆ MarkTargetDirty()

◆ OnDestroy()

void KIGFX::VIEW::OnDestroy ( VIEW_ITEM aItem)
staticinherited

Nasty hack, invoked by the destructor of VIEW_ITEM to auto-remove the item from the owning VIEW if there is any.

KiCad relies too much on this mechanism. This is the only linking dependency now between EDA_ITEM and VIEW class. In near future I'll replace it with observers.

Definition at line 247 of file view.cpp.

248 {
249  auto data = aItem->viewPrivData();
250 
251  if( !data )
252  return;
253 
254  if( data->m_view )
255  data->m_view->VIEW::Remove( aItem );
256 
257  delete data;
258  aItem->ClearViewPrivData();
259 }

References KIGFX::VIEW_ITEM::ClearViewPrivData(), KIGFX::VIEW_ITEM_DATA::m_view, and KIGFX::VIEW_ITEM::viewPrivData().

Referenced by KIGFX::VIEW_ITEM::~VIEW_ITEM().

◆ Query()

int KIGFX::VIEW::Query ( const BOX2I aRect,
std::vector< LAYER_ITEM_PAIR > &  aResult 
) const
virtualinherited

Find all visible items that touch or are within the rectangle aRect.

Parameters
aRectarea to search for items
aResultresult of the search, containing VIEW_ITEMs associated with their layers. Sorted according to the rendering order (items that are on top of the rendering stack as first).
Returns
Number of found items.

Definition at line 427 of file view.cpp.

428 {
429  if( m_orderedLayers.empty() )
430  return 0;
431 
432  std::vector<VIEW_LAYER*>::const_reverse_iterator i;
433 
434  // execute queries in reverse direction, so that items that are on the top of
435  // the rendering stack are returned first.
436  for( i = m_orderedLayers.rbegin(); i != m_orderedLayers.rend(); ++i )
437  {
438  // ignore layers that do not contain actual items (i.e. the selection box, menus, floats)
439  if( ( *i )->displayOnly || !( *i )->visible )
440  continue;
441 
442  queryVisitor<std::vector<LAYER_ITEM_PAIR> > visitor( aResult, ( *i )->id );
443  ( *i )->items->Query( aRect, visitor );
444  }
445 
446  return aResult.size();
447 }
std::vector< VIEW_LAYER * > m_orderedLayers
Flat list of all items.
Definition: view.h:814

References KIGFX::VIEW::m_orderedLayers.

Referenced by DRAWING_TOOL::DrawVia(), EE_GRID_HELPER::queryVisible(), PCB_GRID_HELPER::queryVisible(), PCB_SELECTION_TOOL::SelectAll(), EE_SELECTION_TOOL::SelectAll(), EE_SELECTION_TOOL::selectMultiple(), and PCB_SELECTION_TOOL::selectMultiple().

◆ RecacheAllItems()

void KIGFX::VIEW::RecacheAllItems ( )
inherited

Rebuild GAL display lists.

Definition at line 1372 of file view.cpp.

1373 {
1374  BOX2I r;
1375 
1376  r.SetMaximum();
1377 
1378  for( const VIEW_LAYER& l : m_layers )
1379  {
1380  if( IsCached( l.id ) )
1381  {
1382  recacheItem visitor( this, m_gal, l.id );
1383  l.items->Query( r, visitor );
1384  }
1385  }
1386 }
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
void SetMaximum()
Definition: box2.h:73
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811
bool IsCached(int aLayer) const
Return true if the layer is cached.
Definition: view.h:581

References KIGFX::VIEW::IsCached(), KIGFX::VIEW::m_gal, KIGFX::VIEW::m_layers, and BOX2< Vec >::SetMaximum().

Referenced by GERBVIEW_FRAME::ActivateGalCanvas(), PCB_BASE_FRAME::ActivateGalCanvas(), PCB_CONTROL::FlipPcbView(), SCH_EDIT_TOOL::Mirror(), GERBVIEW_DRAW_PANEL_GAL::OnShow(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceImage(), SCH_EDIT_TOOL::Properties(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_TOOL::Rotate(), PANEL_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_GAL_DISPLAY_OPTIONS::TransferDataFromWindow(), and PANEL_EDIT_OPTIONS::TransferDataFromWindow().

◆ Redraw()

void KIGFX::VIEW::Redraw ( )
virtualinherited

Immediately redraws the whole view.

Definition at line 1117 of file view.cpp.

1118 {
1119 #ifdef __WXDEBUG__
1120  PROF_COUNTER totalRealTime;
1121 #endif /* __WXDEBUG__ */
1122 
1123  VECTOR2D screenSize = m_gal->GetScreenPixelSize();
1124  BOX2D rect( ToWorld( VECTOR2D( 0, 0 ) ),
1125  ToWorld( screenSize ) - ToWorld( VECTOR2D( 0, 0 ) ) );
1126 
1127  rect.Normalize();
1128  BOX2I recti( rect.GetPosition(), rect.GetSize() );
1129 
1130  // The view rtree uses integer positions. Large screens can overflow
1131  // this size so in this case, simply set the rectangle to the full rtree
1132  if( rect.GetWidth() > std::numeric_limits<int>::max() ||
1133  rect.GetHeight() > std::numeric_limits<int>::max() )
1134  recti.SetMaximum();
1135 
1136  redrawRect( recti );
1137  // All targets were redrawn, so nothing is dirty
1141 
1142 #ifdef __WXDEBUG__
1143  totalRealTime.Stop();
1144  wxLogTrace( "GAL_PROFILE", "VIEW::Redraw(): %.1f ms", totalRealTime.msecs() );
1145 #endif /* __WXDEBUG__ */
1146 }
void Stop()
Save the time when this function was called, and set the counter stane to stop.
Definition: profile.h:85
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Converts a screen space point/vector to a point/vector in world space coordinates.
Definition: view.cpp:450
double msecs(bool aSinceLast=false)
Definition: profile.h:146
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
A small class to help profiling.
Definition: profile.h:45
Auxiliary rendering target (noncached)
Definition: definitions.h:49
const VECTOR2I & GetScreenPixelSize() const
Return GAL canvas size in pixels.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
void SetMaximum()
Definition: box2.h:73
Items that may change while the view stays the same (noncached)
Definition: definitions.h:50
void markTargetClean(int aTarget)
Definition: view.h:722
void redrawRect(const BOX2I &aRect)
Definition: view.cpp:982
Main rendering target (cached)
Definition: definitions.h:48

References BOX2< Vec >::GetHeight(), BOX2< Vec >::GetPosition(), KIGFX::GAL::GetScreenPixelSize(), BOX2< Vec >::GetSize(), BOX2< Vec >::GetWidth(), KIGFX::VIEW::m_gal, KIGFX::VIEW::markTargetClean(), PROF_COUNTER::msecs(), BOX2< Vec >::Normalize(), KIGFX::VIEW::redrawRect(), BOX2< Vec >::SetMaximum(), PROF_COUNTER::Stop(), KIGFX::TARGET_CACHED, KIGFX::TARGET_NONCACHED, KIGFX::TARGET_OVERLAY, and KIGFX::VIEW::ToWorld().

Referenced by EDA_DRAW_PANEL_GAL::DoRePaint().

◆ redrawRect()

void KIGFX::VIEW::redrawRect ( const BOX2I aRect)
protectedinherited
  • Redraws contents within rect aRect

Definition at line 982 of file view.cpp.

983 {
984  for( VIEW_LAYER* l : m_orderedLayers )
985  {
986  if( l->visible && IsTargetDirty( l->target ) && areRequiredLayersEnabled( l->id ) )
987  {
988  drawItem drawFunc( this, l->id, m_useDrawPriority, m_reverseDrawOrder );
989 
990  m_gal->SetTarget( l->target );
991  m_gal->SetLayerDepth( l->renderingOrder );
992  l->items->Query( aRect, drawFunc );
993 
994  if( m_useDrawPriority )
995  drawFunc.deferredDraw();
996  }
997  }
998 }
bool m_useDrawPriority
The next sequential drawing priority.
Definition: view.h:860
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
bool areRequiredLayersEnabled(int aLayerId) const
Definition: view.cpp:1354
virtual void SetLayerDepth(double aLayerDepth)
Set the depth of the layer (position on the z-axis)
bool IsTargetDirty(int aTarget) const
Return true if any of layers belonging to the target or the target itself should be redrawn.
Definition: view.h:563
bool m_reverseDrawOrder
A control for printing: m_printMode <= 0 means no printing mode (normal draw mode m_printMode > 0 is ...
Definition: view.h:866
std::vector< VIEW_LAYER * > m_orderedLayers
Flat list of all items.
Definition: view.h:814
virtual void SetTarget(RENDER_TARGET aTarget)
Set the target for rendering.

References KIGFX::VIEW::areRequiredLayersEnabled(), KIGFX::VIEW::drawItem::deferredDraw(), KIGFX::VIEW::IsTargetDirty(), KIGFX::VIEW::m_gal, KIGFX::VIEW::m_orderedLayers, KIGFX::VIEW::m_reverseDrawOrder, KIGFX::VIEW::m_useDrawPriority, KIGFX::GAL::SetLayerDepth(), and KIGFX::GAL::SetTarget().

Referenced by KIGFX::VIEW::Redraw().

◆ Remove()

void KIGFX::VIEW::Remove ( VIEW_ITEM aItem)
virtualinherited

Remove a VIEW_ITEM from the view.

Parameters
aItemitem to be removed. Caller must dispose the removed item if necessary

Reimplemented in KIGFX::PCB_VIEW.

Definition at line 351 of file view.cpp.

352 {
353  if( !aItem )
354  return;
355 
356  auto viewData = aItem->viewPrivData();
357 
358  if( !viewData )
359  return;
360 
361  wxCHECK( viewData->m_view == this, /*void*/ );
362  auto item = std::find( m_allItems->begin(), m_allItems->end(), aItem );
363 
364  if( item != m_allItems->end() )
365  {
366  m_allItems->erase( item );
367  viewData->clearUpdateFlags();
368  }
369 
370  int layers[VIEW::VIEW_MAX_LAYERS], layers_count;
371  viewData->getLayers( layers, layers_count );
372 
373  for( int i = 0; i < layers_count; ++i )
374  {
375  VIEW_LAYER& l = m_layers[layers[i]];
376  l.items->Remove( aItem );
377  MarkTargetDirty( l.target );
378 
379  // Clear the GAL cache
380  int prevGroup = viewData->getGroup( layers[i] );
381 
382  if( prevGroup >= 0 )
383  m_gal->DeleteGroup( prevGroup );
384  }
385 
386  viewData->deleteGroups();
387  viewData->m_view = nullptr;
388 }
virtual void DeleteGroup(int aGroupNumber)
Delete the group from the memory.
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:700
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
The set of layers that are displayed on the top.
Definition: view.h:817
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
Definition: view.h:574
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811

References KIGFX::GAL::DeleteGroup(), KIGFX::VIEW::VIEW_LAYER::items, KIGFX::VIEW::m_allItems, KIGFX::VIEW::m_gal, KIGFX::VIEW::m_layers, KIGFX::VIEW::MarkTargetDirty(), KIGFX::VIEW::VIEW_LAYER::target, KIGFX::VIEW::VIEW_MAX_LAYERS, and KIGFX::VIEW_ITEM::viewPrivData().

Referenced by EDA_DRAW_PANEL_GAL::ClearDebugOverlay(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), SYMBOL_PREVIEW_WIDGET::DisplayPart(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), PL_EDIT_TOOL::DoDelete(), PCB_SELECTION_TOOL::doSelectionMenu(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawSegment(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), DRAWING_TOOL::PlaceImportedGraphics(), BOARD_COMMIT::Push(), KIGFX::PCB_VIEW::Remove(), EDIT_TOOL::Remove(), SCH_BASE_FRAME::RemoveFromScreen(), BOARD_EDITOR_CONTROL::Reset(), PCB_CONTROL::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), EE_SELECTION_TOOL::Reset(), BOARD_COMMIT::Revert(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), ZOOM_TOOL::selectRegion(), DS_DATA_ITEM::SyncDrawItems(), DS_DATA_ITEM_POLYGONS::SyncDrawItems(), DS_DATA_ITEM_TEXT::SyncDrawItems(), DS_DATA_ITEM_BITMAP::SyncDrawItems(), DIALOG_ERC::testErc(), GERBVIEW_SELECTION_TOOL::unselect(), EE_POINT_EDITOR::updatePoints(), PCB_POINT_EDITOR::updatePoints(), SYMBOL_VIEWER_FRAME::updatePreviewSymbol(), EE_SELECTION_TOOL::~EE_SELECTION_TOOL(), GERBVIEW_SELECTION_TOOL::~GERBVIEW_SELECTION_TOOL(), PCB_SELECTION_TOOL::~PCB_SELECTION_TOOL(), SYMBOL_PREVIEW_WIDGET::~SYMBOL_PREVIEW_WIDGET(), SYMBOL_VIEWER_FRAME::~SYMBOL_VIEWER_FRAME(), KIGFX::VIEW::~VIEW(), and ZONE_CREATE_HELPER::~ZONE_CREATE_HELPER().

◆ ReorderLayerData()

void KIGFX::VIEW::ReorderLayerData ( std::unordered_map< int, int >  aReorderMap)
inherited

Remap the data between layer ids without invalidating that data.

Used by GerbView for the "Sort by X2" functionality.

Parameters
aReorderMapis a mapping of old to new layer ids.

Definition at line 681 of file view.cpp.

682 {
683  std::vector<VIEW_LAYER> new_map;
684  new_map.reserve( m_layers.size() );
685 
686  for( int ii = 0; ii < VIEW_MAX_LAYERS; ++ii )
687  new_map.emplace_back();
688 
689  for( const VIEW_LAYER& layer : m_layers )
690  {
691  int orig_idx = layer.id;
692  int new_idx = orig_idx;
693 
694  if( aReorderMap.count( orig_idx ) )
695  new_idx = aReorderMap.at( orig_idx );
696 
697  new_map[new_idx] = layer;
698  new_map[new_idx].id = new_idx;
699  }
700 
701  m_layers = new_map;
702 
703  for( VIEW_ITEM* item : *m_allItems )
704  {
705  auto viewData = item->viewPrivData();
706 
707  if( !viewData )
708  continue;
709 
710  int layers[VIEW::VIEW_MAX_LAYERS], layers_count;
711 
712  item->ViewGetLayers( layers, layers_count );
713  viewData->saveLayers( layers, layers_count );
714 
715  viewData->reorderGroups( aReorderMap );
716 
717  viewData->m_requiredUpdate |= COLOR;
718  }
719 
720  UpdateItems();
721 }
friend class VIEW_ITEM
Definition: view.h:70
Color has changed.
Definition: view_item.h:53
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:700
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
The set of layers that are displayed on the top.
Definition: view.h:817
void UpdateItems()
Iterate through the list of items that asked for updating and updates them.
Definition: view.cpp:1389
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811

References KIGFX::COLOR, KIGFX::VIEW::m_allItems, KIGFX::VIEW::m_layers, KIGFX::VIEW::UpdateItems(), and KIGFX::VIEW::VIEW_MAX_LAYERS.

Referenced by GERBVIEW_FRAME::SortLayersByX2Attributes().

◆ ResizeSheetWorkingArea()

void KIGFX::SCH_VIEW::ResizeSheetWorkingArea ( const SCH_SCREEN aScreen)

Definition at line 82 of file sch_view.cpp.

83 {
84  const PAGE_INFO& page_info = aScreen->GetPageSettings();
85  double max_size_x = page_info.GetWidthIU() * 3.0;
86  double max_size_y = page_info.GetHeightIU() * 3.0;
87  m_boundary.SetOrigin( -max_size_x / 4, -max_size_y / 4 );
88  m_boundary.SetSize( max_size_x, max_size_y );
89 }
void SetSize(const Vec &size)
Definition: box2.h:212
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:187
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:53
BOX2D m_boundary
Scale lower limit.
Definition: view.h:829
void SetOrigin(const Vec &pos)
Definition: box2.h:210

References SCH_SCREEN::GetPageSettings(), KIGFX::VIEW::m_boundary, BOX2< Vec >::SetOrigin(), and BOX2< Vec >::SetSize().

Referenced by DisplaySheet().

◆ ReverseDrawOrder()

void KIGFX::VIEW::ReverseDrawOrder ( bool  aFlag)
inlineinherited

Only takes effect if UseDrawPriority is true.

Parameters
aFlagis true if draw order should be reversed

Definition at line 661 of file view.h.

662  {
663  m_reverseDrawOrder = aFlag;
664  }
bool m_reverseDrawOrder
A control for printing: m_printMode <= 0 means no printing mode (normal draw mode m_printMode > 0 is ...
Definition: view.h:866

References KIGFX::VIEW::m_reverseDrawOrder.

Referenced by EDA_DRAW_PANEL_GAL::SwitchBackend().

◆ SetBoundary() [1/2]

void KIGFX::VIEW::SetBoundary ( const BOX2D aBoundary)
inlineinherited

Set limits for view area.

Parameters
aBoundaryis the box that limits view area.

Definition at line 273 of file view.h.

274  {
275  m_boundary = aBoundary;
276  }
BOX2D m_boundary
Scale lower limit.
Definition: view.h:829

References KIGFX::VIEW::m_boundary.

Referenced by PL_DRAW_PANEL_GAL::DisplayWorksheet(), DIALOG_PAD_PROPERTIES::redraw(), and SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME().

◆ SetBoundary() [2/2]

void KIGFX::VIEW::SetBoundary ( const BOX2I aBoundary)
inlineinherited

Set limits for view area.

Parameters
aBoundaryis the box that limits view area.

Definition at line 283 of file view.h.

284  {
285  m_boundary.SetOrigin( aBoundary.GetOrigin() );
286  m_boundary.SetEnd( aBoundary.GetEnd() );
287  }
const Vec GetEnd() const
Definition: box2.h:195
void SetEnd(coord_type x, coord_type y)
Definition: box2.h:225
BOX2D m_boundary
Scale lower limit.
Definition: view.h:829
void SetOrigin(const Vec &pos)
Definition: box2.h:210
const Vec & GetOrigin() const
Definition: box2.h:193

References BOX2< Vec >::GetEnd(), BOX2< Vec >::GetOrigin(), KIGFX::VIEW::m_boundary, BOX2< Vec >::SetEnd(), and BOX2< Vec >::SetOrigin().

◆ SetCenter() [1/2]

void KIGFX::VIEW::SetCenter ( const VECTOR2D aCenter)
inherited

Set the center point of the VIEW (i.e.

the point in world space that will be drawn in the middle of the screen).

Parameters
aCenterthe new center point, in world space coordinates.

Definition at line 579 of file view.cpp.

580 {
581  m_center = aCenter;
582 
583  if( !m_boundary.Contains( aCenter ) )
584  {
585  if( m_center.x < m_boundary.GetLeft() )
587  else if( aCenter.x > m_boundary.GetRight() )
589 
590  if( m_center.y < m_boundary.GetTop() )
592  else if( m_center.y > m_boundary.GetBottom() )
594  }
595 
598 
599  // Redraw everything after the viewport has changed
600  MarkDirty();
601 }
coord_type GetTop() const
Definition: box2.h:204
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
coord_type GetRight() const
Definition: box2.h:199
coord_type GetBottom() const
Definition: box2.h:200
virtual void ComputeWorldScreenMatrix()
Compute the world <-> screen transformation matrix.
VECTOR2D m_center
Scale of displayed VIEW_ITEMs.
Definition: view.h:823
bool Contains(const Vec &aPoint) const
Function Contains.
Definition: box2.h:151
BOX2D m_boundary
Scale lower limit.
Definition: view.h:829
void SetLookAtPoint(const VECTOR2D &aPoint)
Set the Point in world space to look at.
coord_type GetLeft() const
Definition: box2.h:203
void MarkDirty()
Force redraw of view on the next rendering.
Definition: view.h:598

References KIGFX::GAL::ComputeWorldScreenMatrix(), BOX2< Vec >::Contains(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), KIGFX::VIEW::m_boundary, KIGFX::VIEW::m_center, KIGFX::VIEW::m_gal, KIGFX::VIEW::MarkDirty(), KIGFX::GAL::SetLookAtPoint(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by COMMON_TOOLS::CenterContents(), KIGFX::WX_VIEW_CONTROLS::CenterOnCursor(), SCH_BASE_FRAME::CenterScreen(), COMMON_TOOLS::doZoomFit(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), SYMBOL_PREVIEW_WIDGET::fitOnDrawArea(), EDA_DRAW_FRAME::FocusOnLocation(), KIGFX::WX_VIEW_CONTROLS::onMotion(), KIGFX::WX_VIEW_CONTROLS::onScroll(), EDA_DRAW_PANEL_GAL::onSize(), KIGFX::WX_VIEW_CONTROLS::onTimer(), KIGFX::WX_VIEW_CONTROLS::onWheel(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), SCH_BASE_FRAME::RedrawScreen(), ZOOM_TOOL::selectRegion(), KIGFX::VIEW::SetCenter(), KIGFX::WX_VIEW_CONTROLS::SetCrossHairCursorPosition(), KIGFX::VIEW::SetGAL(), KIGFX::VIEW::SetScale(), KIGFX::VIEW::SetViewport(), KIGFX::WX_VIEW_CONTROLS::WarpCursor(), PANEL_PCBNEW_COLOR_SETTINGS::zoomFitPreview(), and PCB_SELECTION_TOOL::zoomFitSelection().

◆ SetCenter() [2/2]

void KIGFX::VIEW::SetCenter ( VECTOR2D  aCenter,
const BOX2D occultingScreenRect 
)
inherited

Set the center point of the VIEW, attempting to avoid occultingScreenRect (for instance, the screen rect of a modeless dialog in front of the VIEW).

Parameters
aCenterthe new center point, in world space coordinates.
occultingScreenRectthe occulting rect, in screen space coordinates.

Definition at line 604 of file view.cpp.

605 {
606  BOX2D screenRect( VECTOR2D( 0, 0 ), m_gal->GetScreenPixelSize() );
607 
608  if( !screenRect.Intersects( occultingScreenRect ) )
609  {
610  SetCenter( aCenter );
611  return;
612  }
613 
614  BOX2D occultedRect = screenRect.Intersect( occultingScreenRect );
615  double topExposed = occultedRect.GetTop() - screenRect.GetTop();
616  double bottomExposed = screenRect.GetBottom() - occultedRect.GetBottom();
617  double leftExposed = occultedRect.GetLeft() - screenRect.GetLeft();
618  double rightExposed = screenRect.GetRight() - occultedRect.GetRight();
619 
620  if( std::max( topExposed, bottomExposed ) > std::max( leftExposed, rightExposed ) )
621  {
622  if( topExposed > bottomExposed )
623  aCenter.y += ToWorld( screenRect.GetHeight() / 2 - topExposed / 2 );
624  else
625  aCenter.y -= ToWorld( screenRect.GetHeight() / 2 - bottomExposed / 2 );
626  }
627  else
628  {
629  if( leftExposed > rightExposed )
630  aCenter.x += ToWorld( screenRect.GetWidth() / 2 - leftExposed / 2 );
631  else
632  aCenter.x -= ToWorld( screenRect.GetWidth() / 2 - rightExposed / 2 );
633  }
634 
635  SetCenter( aCenter );
636 }
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Converts a screen space point/vector to a point/vector in world space coordinates.
Definition: view.cpp:450
coord_type GetTop() const
Definition: box2.h:204
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
coord_type GetRight() const
Definition: box2.h:199
coord_type GetBottom() const
Definition: box2.h:200
const VECTOR2I & GetScreenPixelSize() const
Return GAL canvas size in pixels.
void SetCenter(const VECTOR2D &aCenter)
Set the center point of the VIEW (i.e.
Definition: view.cpp:579
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
coord_type GetLeft() const
Definition: box2.h:203
BOX2< Vec > Intersect(const BOX2< Vec > &aRect)
Function Intersect Returns the intersection of this with another rectangle.
Definition: box2.h:268

References BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), KIGFX::GAL::GetScreenPixelSize(), BOX2< Vec >::GetTop(), BOX2< Vec >::Intersect(), KIGFX::VIEW::m_gal, KIGFX::VIEW::SetCenter(), KIGFX::VIEW::ToWorld(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ SetGAL()

void KIGFX::VIEW::SetGAL ( GAL aGal)
inherited

Assign a rendering device for the VIEW.

Parameters
aGalpointer to the GAL output device.

Definition at line 494 of file view.cpp.

495 {
496  bool recacheGroups = ( m_gal != nullptr ); // recache groups only if GAL is reassigned
497  m_gal = aGal;
498 
499  // clear group numbers, so everything is going to be recached
500  if( recacheGroups )
501  clearGroupCache();
502 
503  // every target has to be refreshed
504  MarkDirty();
505 
506  // force the new GAL to display the current viewport.
507  SetCenter( m_center );
508  SetScale( m_scale );
510 }
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
void SetMirror(bool aMirrorX, bool aMirrorY)
Control the mirroring of the VIEW.
Definition: view.cpp:540
VECTOR2D m_center
Scale of displayed VIEW_ITEMs.
Definition: view.h:823
void SetCenter(const VECTOR2D &aCenter)
Set the center point of the VIEW (i.e.
Definition: view.cpp:579
bool m_mirrorX
Vertical flip flag.
Definition: view.h:838
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Set the scaling factor, zooming around a given anchor point.
Definition: view.cpp:553
void clearGroupCache()
Definition: view.cpp:1173
bool m_mirrorY
PAINTER contains information how do draw items.
Definition: view.h:841
double m_scale
View boundaries.
Definition: view.h:826
void MarkDirty()
Force redraw of view on the next rendering.
Definition: view.h:598

References KIGFX::VIEW::clearGroupCache(), KIGFX::VIEW::m_center, KIGFX::VIEW::m_gal, KIGFX::VIEW::m_mirrorX, KIGFX::VIEW::m_mirrorY, KIGFX::VIEW::m_scale, KIGFX::VIEW::MarkDirty(), KIGFX::VIEW::SetCenter(), KIGFX::VIEW::SetMirror(), and KIGFX::VIEW::SetScale().

Referenced by GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL(), PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL(), PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL(), SCH_DRAW_PANEL::SCH_DRAW_PANEL(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), and EDA_DRAW_PANEL_GAL::SwitchBackend().

◆ SetLayerDisplayOnly()

void KIGFX::VIEW::SetLayerDisplayOnly ( int  aLayer,
bool  aDisplayOnly = true 
)
inlineinherited

Definition at line 414 of file view.h.

415  {
416  wxCHECK( aLayer < (int) m_layers.size(), /*void*/ );
417  m_layers[aLayer].displayOnly = aDisplayOnly;
418  }
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811

References KIGFX::VIEW::m_layers.

Referenced by PL_DRAW_PANEL_GAL::setDefaultLayerDeps(), SCH_DRAW_PANEL::setDefaultLayerDeps(), SCH_PREVIEW_PANEL::setDefaultLayerDeps(), GERBVIEW_DRAW_PANEL_GAL::setDefaultLayerDeps(), and PCB_DRAW_PANEL_GAL::setDefaultLayerDeps().

◆ SetLayerOrder()

void KIGFX::VIEW::SetLayerOrder ( int  aLayer,
int  aRenderingOrder 
)
inherited

Set rendering order of a particular layer.

Lower values are rendered first.

Parameters
aLayeris the layer.
aRenderingOrderis an arbitrary number denoting the rendering order.

Definition at line 639 of file view.cpp.

640 {
641  m_layers[aLayer].renderingOrder = aRenderingOrder;
642 
643  sortLayers();
644 }
void sortLayers()
Clear cached GAL group numbers (ONLY numbers stored in VIEW_ITEMs, not group objects used by GAL)
Definition: view.cpp:1231
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811

References KIGFX::VIEW::m_layers, and KIGFX::VIEW::sortLayers().

Referenced by SCH_DRAW_PANEL::setDefaultLayerOrder(), SCH_PREVIEW_PANEL::setDefaultLayerOrder(), PCB_DRAW_PANEL_GAL::setDefaultLayerOrder(), GERBVIEW_DRAW_PANEL_GAL::SetTopLayer(), and PCB_DRAW_PANEL_GAL::SetTopLayer().

◆ SetLayerTarget()

void KIGFX::VIEW::SetLayerTarget ( int  aLayer,
RENDER_TARGET  aTarget 
)
inlineinherited

Change the rendering target for a particular layer.

Parameters
aLayeris the layer.
aTargetis the rendering target.

Definition at line 426 of file view.h.

427  {
428  wxCHECK( aLayer < (int) m_layers.size(), /*void*/ );
429  m_layers[aLayer].target = aTarget;
430  }
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811

References KIGFX::VIEW::m_layers.

Referenced by PL_DRAW_PANEL_GAL::setDefaultLayerDeps(), SCH_DRAW_PANEL::setDefaultLayerDeps(), SCH_PREVIEW_PANEL::setDefaultLayerDeps(), GERBVIEW_DRAW_PANEL_GAL::setDefaultLayerDeps(), PCB_DRAW_PANEL_GAL::setDefaultLayerDeps(), and BOARD_PRINTOUT::setupViewLayers().

◆ SetLayerVisible()

void KIGFX::VIEW::SetLayerVisible ( int  aLayer,
bool  aVisible = true 
)
inlineinherited

Control the visibility of a particular layer.

Parameters
aLayeris the layer to show/hide.
aVisibleis the layer visibility state.

Definition at line 387 of file view.h.

388  {
389  wxCHECK( aLayer < (int) m_layers.size(), /*void*/ );
390 
391  if( m_layers[aLayer].visible != aVisible )
392  {
393  // Target has to be redrawn after changing its visibility
394  MarkTargetDirty( m_layers[aLayer].target );
395  m_layers[aLayer].visible = aVisible;
396  }
397  }
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
Definition: view.h:574
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811

References KIGFX::VIEW::m_layers, and KIGFX::VIEW::MarkTargetDirty().

Referenced by APPEARANCE_CONTROLS::onLayerVisibilityChanged(), APPEARANCE_CONTROLS::onObjectVisibilityChanged(), GERBER_LAYER_WIDGET::OnRenderEnable(), PL_EDITOR_FRAME::OnSelectPage(), PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL(), GERBVIEW_FRAME::SetElementVisibility(), APPEARANCE_CONTROLS::SetLayerVisible(), APPEARANCE_CONTROLS::SetObjectVisible(), GERBVIEW_PRINTOUT::setupViewLayers(), PCBNEW_PRINTOUT::setupViewLayers(), BOARD_PRINTOUT::setupViewLayers(), GERBVIEW_FRAME::SetVisibleLayers(), APPEARANCE_CONTROLS::setVisibleLayers(), APPEARANCE_CONTROLS::setVisibleObjects(), PCB_DRAW_PANEL_GAL::SyncLayersVisibility(), and PCB_EDIT_FRAME::UpdateUserInterface().

◆ SetMirror()

void KIGFX::VIEW::SetMirror ( bool  aMirrorX,
bool  aMirrorY 
)
inherited

Control the mirroring of the VIEW.

Parameters
aMirrorXwhen true, the X axis is mirrored.
aMirrorYwhen true, the Y axis is mirrored.

Definition at line 540 of file view.cpp.

541 {
542  wxASSERT_MSG( !aMirrorY, _( "Mirroring for Y axis is not supported yet" ) );
543 
544  m_mirrorX = aMirrorX;
545  m_mirrorY = aMirrorY;
546  m_gal->SetFlip( aMirrorX, aMirrorY );
547 
548  // Redraw everything
549  MarkDirty();
550 }
void SetFlip(bool xAxis, bool yAxis)
Sets flipping of the screen.
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
bool m_mirrorX
Vertical flip flag.
Definition: view.h:838
#define _(s)
Definition: 3d_actions.cpp:33
bool m_mirrorY
PAINTER contains information how do draw items.
Definition: view.h:841
void MarkDirty()
Force redraw of view on the next rendering.
Definition: view.h:598

References _, KIGFX::VIEW::m_gal, KIGFX::VIEW::m_mirrorX, KIGFX::VIEW::m_mirrorY, KIGFX::VIEW::MarkDirty(), and KIGFX::GAL::SetFlip().

Referenced by GERBVIEW_CONTROL::DisplayControl(), PCB_CONTROL::FlipPcbView(), SCH_DRAW_PANEL::SCH_DRAW_PANEL(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), and KIGFX::VIEW::SetGAL().

◆ SetPainter()

void KIGFX::VIEW::SetPainter ( PAINTER aPainter)
inlineinherited

Set the painter object used by the view for drawing #VIEW_ITEMS.

Definition at line 197 of file view.h.

198  {
199  m_painter = aPainter;
200  }
PAINTER * m_painter
Interface to #PAINTER that is used to draw items.
Definition: view.h:844

References KIGFX::VIEW::m_painter.

Referenced by GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL(), PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL(), PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL(), SCH_DRAW_PANEL::SCH_DRAW_PANEL(), and SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL().

◆ SetPrintMode()

void KIGFX::VIEW::SetPrintMode ( int  aPrintMode)
inlineinherited

Set the printing mode.

Parameters
aPrintModeis the printing mode. If 0, the current mode is not a printing mode, just the draw mode

Definition at line 698 of file view.h.

698 { m_printMode = aPrintMode; }
int m_printMode
Definition: view.h:870

References KIGFX::VIEW::m_printMode.

Referenced by KIGFX::VIEW::VIEW().

◆ SetRequired()

void KIGFX::VIEW::SetRequired ( int  aLayerId,
int  aRequiredId,
bool  aRequired = true 
)
inherited

Mark the aRequiredId layer as required for the aLayerId layer.

In order to display the layer, all of its required layers have to be enabled.

Parameters
aLayerIdis the id of the layer for which we enable/disable the required layer.
aRequiredIdis the id of the required layer.
aRequiredtells if the required layer should be added or removed from the list.

Definition at line 391 of file view.cpp.

392 {
393  wxCHECK( (unsigned) aLayerId < m_layers.size(), /*void*/ );
394  wxCHECK( (unsigned) aRequiredId < m_layers.size(), /*void*/ );
395 
396  if( aRequired )
397  m_layers[aLayerId].requiredLayers.insert( aRequiredId );
398  else
399  m_layers[aLayerId].requiredLayers.erase( aRequired );
400 }
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811

References KIGFX::VIEW::m_layers.

Referenced by PCB_DRAW_PANEL_GAL::setDefaultLayerDeps().

◆ SetScale()

void KIGFX::SCH_VIEW::SetScale ( double  aScale,
VECTOR2D  aAnchor = { 0, 0 } 
)
overridevirtual

Set the scaling factor, zooming around a given anchor point.

(depending on correct GAL unit length & DPI settings).

Parameters
aAnchoris the zooming anchor point.
aScaleis the scale factor.

Reimplemented from KIGFX::VIEW.

Definition at line 72 of file sch_view.cpp.

73 {
74  VIEW::SetScale( aScale, aAnchor );
75 
76  //Redraw selection halos since their width is dependent on zoom
77  if( m_frame )
79 }
void RefreshSelection()
Mark selected items for refresh.
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Set the scaling factor, zooming around a given anchor point.
Definition: view.cpp:553
SCH_BASE_FRAME * m_frame
Definition: sch_view.h:101

References m_frame, SCH_BASE_FRAME::RefreshSelection(), and KIGFX::VIEW::SetScale().

Referenced by SCH_EDIT_FRAME::DisplayCurrentSheet().

◆ SetScaleLimits()

void KIGFX::VIEW::SetScaleLimits ( double  aMaximum,
double  aMinimum 
)
inlineinherited

Set minimum and maximum values for scale.

Parameters
aMaximumis the maximum value for scale.
aMinimumis the minimum value for scale.

Definition at line 303 of file view.h.

304  {
305  wxASSERT_MSG( aMaximum > aMinimum, wxT( "I guess you passed parameters in wrong order" ) );
306 
307  m_minScale = aMinimum;
308  m_maxScale = aMaximum;
309  }
double m_minScale
Scale upper limit.
Definition: view.h:832
double m_maxScale
Horizontal flip flag.
Definition: view.h:835

References KIGFX::VIEW::m_maxScale, and KIGFX::VIEW::m_minScale.

Referenced by GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL(), PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL(), PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL(), SCH_DRAW_PANEL::SCH_DRAW_PANEL(), and SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL().

◆ SetTopLayer()

void KIGFX::VIEW::SetTopLayer ( int  aLayer,
bool  aEnabled = true 
)
virtualinherited

Set given layer to be displayed on the top or sets back the default order of layers.

Parameters
aEnabled= true to display aLayer on the top.
aLayeris the layer or -1 in case when no particular layer should be displayed on the top.

Definition at line 832 of file view.cpp.

833 {
834  if( aEnabled )
835  {
836  if( m_topLayers.count( aLayer ) == 1 )
837  return;
838 
839  m_topLayers.insert( aLayer );
840 
841  // Move the layer closer to front
843  m_layers[aLayer].renderingOrder += TOP_LAYER_MODIFIER;
844  }
845  else
846  {
847  if( m_topLayers.count( aLayer ) == 0 )
848  return;
849 
850  m_topLayers.erase( aLayer );
851 
852  // Restore the previous rendering order
854  m_layers[aLayer].renderingOrder -= TOP_LAYER_MODIFIER;
855  }
856 }
static const int TOP_LAYER_MODIFIER
Flag to respect draw priority when drawing items.
Definition: view.h:857
std::set< unsigned int > m_topLayers
Center point of the VIEW (the point at which we are looking at).
Definition: view.h:820
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811
bool m_enableOrderModifier
The set of possible displayed layers and its properties.
Definition: view.h:808

References KIGFX::VIEW::m_enableOrderModifier, KIGFX::VIEW::m_layers, KIGFX::VIEW::m_topLayers, and KIGFX::VIEW::TOP_LAYER_MODIFIER.

Referenced by DIALOG_PAD_PROPERTIES::redraw(), GERBVIEW_DRAW_PANEL_GAL::SetTopLayer(), PL_DRAW_PANEL_GAL::SetTopLayer(), PCB_DRAW_PANEL_GAL::SetTopLayer(), EDA_DRAW_PANEL_GAL::SetTopLayer(), PCBNEW_PRINTOUT::setupViewLayers(), and BOARD_PRINTOUT::setupViewLayers().

◆ SetViewport()

void KIGFX::VIEW::SetViewport ( const BOX2D aViewport)
inherited

Set the visible area of the VIEW.

Parameters
aViewportdesired visible area, in world space coordinates.

Definition at line 525 of file view.cpp.

526 {
527  VECTOR2D ssize = ToWorld( m_gal->GetScreenPixelSize(), false );
528 
529  wxCHECK( ssize.x > 0 && ssize.y > 0, /*void*/ );
530 
531  VECTOR2D centre = aViewport.Centre();
532  VECTOR2D vsize = aViewport.GetSize();
533  double zoom = 1.0 / std::max( fabs( vsize.x / ssize.x ), fabs( vsize.y / ssize.y ) );
534 
535  SetCenter( centre );
536  SetScale( GetScale() * zoom );
537 }
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Converts a screen space point/vector to a point/vector in world space coordinates.
Definition: view.cpp:450
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
const VECTOR2I & GetScreenPixelSize() const
Return GAL canvas size in pixels.
void SetCenter(const VECTOR2D &aCenter)
Set the center point of the VIEW (i.e.
Definition: view.cpp:579
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Set the scaling factor, zooming around a given anchor point.
Definition: view.cpp:553
Vec Centre() const
Definition: box2.h:79
const Vec & GetSize() const
Definition: box2.h:189
double GetScale() const
Definition: view.h:263

References BOX2< Vec >::Centre(), KIGFX::VIEW::GetScale(), KIGFX::GAL::GetScreenPixelSize(), BOX2< Vec >::GetSize(), KIGFX::VIEW::m_gal, KIGFX::VIEW::SetCenter(), KIGFX::VIEW::SetScale(), KIGFX::VIEW::ToWorld(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by DIALOG_PAD_PROPERTIES::redraw(), and FOOTPRINT_PREVIEW_PANEL::renderFootprint().

◆ SetVisible()

void KIGFX::VIEW::SetVisible ( VIEW_ITEM aItem,
bool  aIsVisible = true 
)
inherited

Set the item visibility.

Parameters
aItemthe item to modify.
aIsVisiblewhether the item is visible (on all layers), or not.

Definition at line 1454 of file view.cpp.

1455 {
1456  auto viewData = aItem->viewPrivData();
1457 
1458  if( !viewData )
1459  return;
1460 
1461  bool cur_visible = viewData->m_flags & VISIBLE;
1462 
1463  if( cur_visible != aIsVisible )
1464  {
1465  if( aIsVisible )
1466  viewData->m_flags |= VISIBLE;
1467  else
1468  viewData->m_flags &= ~VISIBLE;
1469 
1470  Update( aItem, APPEARANCE | COLOR );
1471  }
1472 }
Visibility flag has changed.
Definition: view_item.h:52
Color has changed.
Definition: view_item.h:53
Item is visible (in general)
Definition: view_item.h:65
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1508

References KIGFX::APPEARANCE, KIGFX::COLOR, KIGFX::VIEW_ITEM_DATA::m_flags, KIGFX::VIEW::Update(), KIGFX::VIEW_ITEM::viewPrivData(), and KIGFX::VISIBLE.

Referenced by KIGFX::VIEW::Add(), KIGFX::VIEW::AddToPreview(), EE_GRID_HELPER::BestSnapAnchor(), PCB_GRID_HELPER::BestSnapAnchor(), MICROWAVE_TOOL::drawMicrowaveInductor(), EE_GRID_HELPER::EE_GRID_HELPER(), PNS_KICAD_IFACE::EraseView(), PNS_KICAD_IFACE::HideItem(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), ZONE_CREATE_HELPER::OnComplete(), ZONE_CREATE_HELPER::OnFirstPoint(), PCB_GRID_HELPER::PCB_GRID_HELPER(), FOOTPRINT_PREVIEW_PANEL::renderFootprint(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), ZOOM_TOOL::selectRegion(), GRID_HELPER::SetAuxAxes(), KIGFX::VIEW::ShowPreview(), and ZONE_CREATE_HELPER::~ZONE_CREATE_HELPER().

◆ ShowPreview()

void KIGFX::VIEW::ShowPreview ( bool  aShow = true)
inherited

Definition at line 1566 of file view.cpp.

1567 {
1568  SetVisible( m_preview.get(), aShow );
1569 }
std::unique_ptr< KIGFX::VIEW_GROUP > m_preview
Definition: view.h:802
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Set the item visibility.
Definition: view.cpp:1454

References KIGFX::VIEW::m_preview, and KIGFX::VIEW::SetVisible().

Referenced by SCH_EDIT_FRAME::AddJunction(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), and ROUTER_TOOL::InlineDrag().

◆ SortLayers()

void KIGFX::VIEW::SortLayers ( int  aLayers[],
int &  aCount 
) const
inherited

Change the order of given layer ids, so after sorting the order corresponds to layers rendering order (descending, ie.

order in which layers should be drawn - from the bottom to the top).

Parameters
aLayersstores id of layers to be sorted.
aCountstores the number of layers.

Definition at line 653 of file view.cpp.

654 {
655  int maxLay, maxOrd, maxIdx;
656 
657  for( int i = 0; i < aCount; ++i )
658  {
659  maxLay = aLayers[i];
660  maxOrd = GetLayerOrder( maxLay );
661  maxIdx = i;
662 
663  // Look for the max element in the range (j..aCount)
664  for( int j = i; j < aCount; ++j )
665  {
666  if( maxOrd < GetLayerOrder( aLayers[j] ) )
667  {
668  maxLay = aLayers[j];
669  maxOrd = GetLayerOrder( maxLay );
670  maxIdx = j;
671  }
672  }
673 
674  // Swap elements
675  aLayers[maxIdx] = aLayers[i];
676  aLayers[i] = maxLay;
677  }
678 }
int GetLayerOrder(int aLayer) const
Return rendering order of a particular layer.
Definition: view.cpp:647

References KIGFX::VIEW::GetLayerOrder().

Referenced by KIGFX::VIEW::draw(), and KIGFX::VIEW_GROUP::ViewDraw().

◆ sortLayers()

void KIGFX::VIEW::sortLayers ( )
protectedinherited

Clear cached GAL group numbers (ONLY numbers stored in VIEW_ITEMs, not group objects used by GAL)

Definition at line 1231 of file view.cpp.

1232 {
1233  int n = 0;
1234 
1235  m_orderedLayers.resize( m_layers.size() );
1236 
1237  for( VIEW_LAYER& layer : m_layers )
1238  m_orderedLayers[n++] = &layer;
1239 
1240  sort( m_orderedLayers.begin(), m_orderedLayers.end(), compareRenderingOrder );
1241 
1242  MarkDirty();
1243 }
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811
std::vector< VIEW_LAYER * > m_orderedLayers
Flat list of all items.
Definition: view.h:814
static bool compareRenderingOrder(VIEW_LAYER *aI, VIEW_LAYER *aJ)
Check if every layer required by the aLayerId layer is enabled.
Definition: view.h:787
void MarkDirty()
Force redraw of view on the next rendering.
Definition: view.h:598

References KIGFX::VIEW::compareRenderingOrder(), KIGFX::VIEW::m_layers, KIGFX::VIEW::m_orderedLayers, and KIGFX::VIEW::MarkDirty().

Referenced by KIGFX::VIEW::SetLayerOrder(), KIGFX::VIEW::UpdateAllLayersOrder(), and KIGFX::VIEW::VIEW().

◆ ToScreen() [1/2]

VECTOR2D KIGFX::VIEW::ToScreen ( const VECTOR2D aCoord,
bool  aAbsolute = true 
) const
inherited

Convert a world space point/vector to a point/vector in screen space coordinates.

Parameters
aCoordis the point/vector to be converted.
aAbsolutewhen true aCoord is treated as a point, otherwise as a direction (vector).

Definition at line 469 of file view.cpp.

470 {
471  const MATRIX3x3D& matrix = m_gal->GetWorldScreenMatrix();
472 
473  if( aAbsolute )
474  return VECTOR2D( matrix * aCoord );
475  else
476  return VECTOR2D( matrix.GetScale().x * aCoord.x, matrix.GetScale().y * aCoord.y );
477 }
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
VECTOR2< T > GetScale() const
Get the scale components of the matrix.
Definition: matrix3x3.h:269
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
const MATRIX3x3D & GetWorldScreenMatrix() const
Get the world <-> screen transformation matrix.

References MATRIX3x3< T >::GetScale(), KIGFX::GAL::GetWorldScreenMatrix(), KIGFX::VIEW::m_gal, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by KIGFX::WX_VIEW_CONTROLS::handleAutoPanning(), ROUTER_TOOL::handleLayerSwitch(), TOOL_DISPATCHER::handleMouseButton(), KIGFX::WX_VIEW_CONTROLS::SetCrossHairCursorPosition(), KIGFX::VIEW::SetScale(), and KIGFX::WX_VIEW_CONTROLS::WarpCursor().

◆ ToScreen() [2/2]

double KIGFX::VIEW::ToScreen ( double  aSize) const
inherited

Convert a world space one dimensional size to a one dimensional size in screen space.

Parameters
aSizethe size to be transformed.

Definition at line 480 of file view.cpp.

481 {
482  const MATRIX3x3D& matrix = m_gal->GetWorldScreenMatrix();
483 
484  return matrix.GetScale().x * aSize;
485 }
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
VECTOR2< T > GetScale() const
Get the scale components of the matrix.
Definition: matrix3x3.h:269
const MATRIX3x3D & GetWorldScreenMatrix() const
Get the world <-> screen transformation matrix.

References MATRIX3x3< T >::GetScale(), KIGFX::GAL::GetWorldScreenMatrix(), KIGFX::VIEW::m_gal, and VECTOR2< T >::x.

◆ ToWorld() [1/2]

VECTOR2D KIGFX::VIEW::ToWorld ( const VECTOR2D aCoord,
bool  aAbsolute = true 
) const
inherited

Converts a screen space point/vector to a point/vector in world space coordinates.

Parameters
aCoordis the point/vector to be converted.
aAbsolutewhen true aCoord is treated as a point, otherwise as a direction (vector).

Definition at line 450 of file view.cpp.

451 {
452  const MATRIX3x3D& matrix = m_gal->GetScreenWorldMatrix();
453 
454  if( aAbsolute )
455  return VECTOR2D( matrix * aCoord );
456  else
457  return VECTOR2D( matrix.GetScale().x * aCoord.x, matrix.GetScale().y * aCoord.y );
458 }
const MATRIX3x3D & GetScreenWorldMatrix() const
Get the screen <-> world transformation matrix.
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
VECTOR2< T > GetScale() const
Get the scale components of the matrix.
Definition: matrix3x3.h:269
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622

References MATRIX3x3< T >::GetScale(), KIGFX::GAL::GetScreenWorldMatrix(), KIGFX::VIEW::m_gal, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by EE_POINT_EDITOR::addCornerCondition(), COMMON_TOOLS::CenterContents(), COMMON_TOOLS::doZoomFit(), KIGFX::PREVIEW::POLYGON_ITEM::drawPreviewShape(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), EDIT_POINTS::FindPoint(), SYMBOL_PREVIEW_WIDGET::fitOnDrawArea(), GENERAL_COLLECTORS_GUIDE::GENERAL_COLLECTORS_GUIDE(), KIGFX::WX_VIEW_CONTROLS::GetMousePosition(), KIGFX::VIEW::GetViewport(), DS_PROXY_VIEW_ITEM::HitTestDrawingSheetItems(), KIGFX::WX_VIEW_CONTROLS::onMotion(), KIGFX::WX_VIEW_CONTROLS::onScroll(), EDA_DRAW_PANEL_GAL::onSize(), KIGFX::WX_VIEW_CONTROLS::onTimer(), KIGFX::WX_VIEW_CONTROLS::onWheel(), KIGFX::VIEW::Redraw(), KIGFX::WX_VIEW_CONTROLS::refreshMouse(), PL_SELECTION_TOOL::selectionContains(), EE_SELECTION_TOOL::selectionContains(), ZOOM_TOOL::selectRegion(), KIGFX::VIEW::SetCenter(), KIGFX::VIEW::SetScale(), KIGFX::VIEW::SetViewport(), KIGFX::ORIGIN_VIEWITEM::ViewDraw(), EDIT_POINTS::ViewDraw(), PANEL_PCBNEW_COLOR_SETTINGS::zoomFitPreview(), and PCB_SELECTION_TOOL::zoomFitSelection().

◆ ToWorld() [2/2]

double KIGFX::VIEW::ToWorld ( double  aSize) const
inherited

Converts a screen space one dimensional size to a one dimensional size in world space coordinates.

Parameters
aSizeis the size to be converted.

Definition at line 461 of file view.cpp.

462 {
463  const MATRIX3x3D& matrix = m_gal->GetScreenWorldMatrix();
464 
465  return fabs( matrix.GetScale().x * aSize );
466 }
const MATRIX3x3D & GetScreenWorldMatrix() const
Get the screen <-> world transformation matrix.
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
VECTOR2< T > GetScale() const
Get the scale components of the matrix.
Definition: matrix3x3.h:269

References MATRIX3x3< T >::GetScale(), KIGFX::GAL::GetScreenWorldMatrix(), KIGFX::VIEW::m_gal, and VECTOR2< T >::x.

◆ Update() [1/2]

void KIGFX::VIEW::Update ( const VIEW_ITEM aItem,
int  aUpdateFlags 
) const
virtualinherited

For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has changed.

For static views calling has no effect.

Parameters
aItemthe item to update.
aUpdateFlagshow much the object has changed.

Reimplemented in KIGFX::PCB_VIEW.

Definition at line 1508 of file view.cpp.

1509 {
1510  VIEW_ITEM_DATA* viewData = aItem->viewPrivData();
1511 
1512  if( !viewData )
1513  return;
1514 
1515  assert( aUpdateFlags != NONE );
1516 
1517  viewData->m_requiredUpdate |= aUpdateFlags;
1518 }
No updates are required.
Definition: view_item.h:51

References KIGFX::VIEW_ITEM_DATA::m_requiredUpdate, KIGFX::NONE, and KIGFX::VIEW_ITEM::viewPrivData().

Referenced by KIGFX::VIEW::Add(), PNS_PCBNEW_DEBUG_DECORATOR::AddLine(), KIGFX::VIEW::AddToPreview(), EE_GRID_HELPER::BestSnapAnchor(), PCB_GRID_HELPER::BestSnapAnchor(), SCH_EDIT_TOOL::ChangeTextType(), PNS_PCBNEW_DEBUG_DECORATOR::Clear(), KIGFX::VIEW::ClearPreview(), PL_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::ClearSelection(), PNS_KICAD_IFACE::DisplayItem(), PNS_KICAD_IFACE::DisplayRatline(), EDIT_TOOL::DragArcTrack(), KIGFX::VIEW::draw(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawSegment(), PL_DRAWING_TOOLS::DrawShape(), PAD_TOOL::EnumeratePads(), PNS_KICAD_IFACE::EraseView(), EE_INSPECTION_TOOL::ExcludeMarker(), DIALOG_ERC::ExcludeMarker(), KIGFX::VIEW::Hide(), PNS_KICAD_IFACE::HideItem(), PL_SELECTION_TOOL::highlight(), EE_SELECTION_TOOL::highlight(), EE_SELECTION_TOOL::Main(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), EDIT_TOOL::MoveExact(), PL_EDIT_TOOL::moveItem(), PROPERTIES_FRAME::OnAcceptPrms(), DIALOG_ERC::OnERCItemRClick(), ZONE_CREATE_HELPER::OnGeometryChange(), PCB_POINT_EDITOR::OnSelectionChange(), KIGFX::VIEW::recacheItem::operator()(), BOARD_EDITOR_CONTROL::PlaceFootprint(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), DRAWING_TOOL::PlaceText(), BOARD_COMMIT::Push(), SCH_EDIT_FRAME::RecalculateConnections(), SCH_EDIT_FRAME::RecomputeIntersheetRefs(), DIALOG_PAD_PROPERTIES::redraw(), PCB_DRAW_PANEL_GAL::RedrawRatsnest(), SCH_BASE_FRAME::RefreshSelection(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), ZOOM_TOOL::selectRegion(), GERBVIEW_SELECTION_TOOL::selectVisually(), KIGFX::VIEW::SetVisible(), SCH_EDIT_FRAME::TestDanglingEnds(), DIALOG_JUNCTION_PROPS::TransferDataFromWindow(), PL_SELECTION_TOOL::unhighlight(), EE_SELECTION_TOOL::unhighlight(), PCB_BASE_EDIT_FRAME::unitsChangeRefresh(), GERBVIEW_SELECTION_TOOL::unselectVisually(), KIGFX::PCB_VIEW::Update(), KIGFX::VIEW::Update(), PL_POINT_EDITOR::updateItem(), PCB_POINT_EDITOR::updateItem(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateItem(), SCH_BASE_FRAME::UpdateItem(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updateParentItem(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), PCB_POINT_EDITOR::updatePoints(), PCB_SELECTION_TOOL::updateSelection(), and SCH_EDIT_FRAME::UpdateSymbolFromEditor().

◆ Update() [2/2]

void KIGFX::VIEW::Update ( const VIEW_ITEM aItem) const
virtualinherited

Reimplemented in KIGFX::PCB_VIEW.

Definition at line 1502 of file view.cpp.

1503 {
1504  Update( aItem, ALL );
1505 }
All except INITIAL_ADD.
Definition: view_item.h:58
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1508

References KIGFX::ALL, and KIGFX::VIEW::Update().

◆ UpdateAllItems()

void KIGFX::VIEW::UpdateAllItems ( int  aUpdateFlags)
inherited

Update all items in the view according to the given flags.

Parameters
aUpdateFlagsis is according to KIGFX::VIEW_UPDATE_FLAGS

Definition at line 1412 of file view.cpp.

1413 {
1414  for( VIEW_ITEM* item : *m_allItems )
1415  {
1416  auto viewData = item->viewPrivData();
1417 
1418  if( !viewData )
1419  continue;
1420 
1421  viewData->m_requiredUpdate |= aUpdateFlags;
1422  }
1423 }
friend class VIEW_ITEM
Definition: view.h:70
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
The set of layers that are displayed on the top.
Definition: view.h:817

References KIGFX::VIEW::m_allItems.

Referenced by PL_EDITOR_FRAME::CommonSettingsChanged(), SCH_BASE_FRAME::CommonSettingsChanged(), PCB_BASE_FRAME::CommonSettingsChanged(), SCH_BASE_FRAME::HardRedraw(), GERBVIEW_CONTROL::HighlightControl(), SCH_EDIT_FRAME::KiwayMailIn(), DIALOG_NET_INSPECTOR::onRenameNet(), SYMBOL_EDITOR_CONTROL::ShowElectricalTypes(), SCH_BASE_FRAME::SyncView(), SCH_EDITOR_CONTROL::ToggleHiddenFields(), SCH_EDITOR_CONTROL::ToggleHiddenPins(), PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_SETUP_FORMATTING::TransferDataFromWindow(), PANEL_PCBNEW_COLOR_SETTINGS::updatePreview(), and PANEL_EESCHEMA_COLOR_SETTINGS::updatePreview().

◆ UpdateAllItemsConditionally()

void KIGFX::VIEW::UpdateAllItemsConditionally ( int  aUpdateFlags,
std::function< bool(VIEW_ITEM *)>  aCondition 
)
inherited

Update items in the view according to the given flags and condition.

Parameters
aUpdateFlagsis is according to KIGFX::VIEW_UPDATE_FLAGS.
aConditionis a function returning true if the item should be updated.

Definition at line 1426 of file view.cpp.

1428 {
1429  for( VIEW_ITEM* item : *m_allItems )
1430  {
1431  if( aCondition( item ) )
1432  {
1433  auto viewData = item->viewPrivData();
1434 
1435  if( !viewData )
1436  continue;
1437 
1438  viewData->m_requiredUpdate |= aUpdateFlags;
1439  }
1440  }
1441 }
friend class VIEW_ITEM
Definition: view.h:70
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
The set of layers that are displayed on the top.
Definition: view.h:817

References KIGFX::VIEW::m_allItems.

Referenced by SCH_EDIT_FRAME::OnModify(), PCB_BASE_FRAME::SetDisplayOptions(), GERBVIEW_FRAME::SetElementVisibility(), and GERBVIEW_FRAME::UpdateDisplayOptions().

◆ UpdateAllLayersColor()

void KIGFX::VIEW::UpdateAllLayersColor ( )
inherited

Apply the new coloring scheme to all layers.

The used scheme is held by #RENDER_SETTINGS.

See also
RENDER_SETTINGS

Definition at line 770 of file view.cpp.

771 {
772  if( m_gal->IsVisible() )
773  {
774  GAL_UPDATE_CONTEXT ctx( m_gal );
775 
776  for( VIEW_ITEM* item : *m_allItems )
777  {
778  auto viewData = item->viewPrivData();
779 
780  if( !viewData )
781  continue;
782 
783  int layers[VIEW::VIEW_MAX_LAYERS], layers_count;
784  viewData->getLayers( layers, layers_count );
785 
786  for( int i = 0; i < layers_count; ++i )
787  {
788  const COLOR4D color = m_painter->GetSettings()->GetColor( item, layers[i] );
789  int group = viewData->getGroup( layers[i] );
790 
791  if( group >= 0 )
792  m_gal->ChangeGroupColor( group, color );
793  }
794  }
795  }
796 
797  MarkDirty();
798 }
friend class VIEW_ITEM
Definition: view.h:70
int color
Definition: DXF_plotter.cpp:60
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:700
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
The set of layers that are displayed on the top.
Definition: view.h:817
virtual void ChangeGroupColor(int aGroupNumber, const COLOR4D &aNewColor)
Change the color used to draw the group.
PAINTER * m_painter
Interface to #PAINTER that is used to draw items.
Definition: view.h:844
virtual COLOR4D GetColor(const VIEW_ITEM *aItem, int aLayer) const =0
Returns the color that should be used to draw the specific VIEW_ITEM on the specific layer using curr...
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
virtual bool IsVisible() const
Return true if the GAL canvas is visible on the screen.
void MarkDirty()
Force redraw of view on the next rendering.
Definition: view.h:598
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98

References KIGFX::GAL::ChangeGroupColor(), color, KIGFX::RENDER_SETTINGS::GetColor(), KIGFX::PAINTER::GetSettings(), KIGFX::GAL::IsVisible(), KIGFX::VIEW::m_allItems, KIGFX::VIEW::m_gal, KIGFX::VIEW::m_painter, KIGFX::VIEW::MarkDirty(), and KIGFX::VIEW::VIEW_MAX_LAYERS.

Referenced by DIALOG_NET_INSPECTOR::buildNetsList(), BOARD_INSPECTION_TOOL::ClearHighlight(), FOOTPRINT_EDIT_FRAME::CommonSettingsChanged(), KIGFX::VIEW::EnableTopLayer(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), PNS::TOOL_BASE::highlightNet(), BOARD_INSPECTION_TOOL::HighlightNet(), BOARD_INSPECTION_TOOL::highlightNet(), APPEARANCE_CONTROLS::onNetclassColorChanged(), APPEARANCE_CONTROLS::onNetclassContextMenu(), APPEARANCE_CONTROLS::onNetColorModeChanged(), DIALOG_NET_INSPECTOR::onSelChanged(), DIALOG_NET_INSPECTOR::onSortingChanged(), GERBVIEW_DRAW_PANEL_GAL::SetHighContrastLayer(), PCB_DRAW_PANEL_GAL::SetHighContrastLayer(), EDA_DRAW_PANEL_GAL::SetHighContrastLayer(), and NET_GRID_TABLE::updateNetColor().

◆ UpdateAllLayersOrder()

void KIGFX::VIEW::UpdateAllLayersOrder ( )
inherited

Do everything that is needed to apply the rendering order of layers.

It has to be called after modification of renderingOrder field of LAYER.

Definition at line 899 of file view.cpp.

900 {
901  sortLayers();
902 
903  if( m_gal->IsVisible() )
904  {
905  GAL_UPDATE_CONTEXT ctx( m_gal );
906 
907  for( VIEW_ITEM* item : *m_allItems )
908  {
909  auto viewData = item->viewPrivData();
910 
911  if( !viewData )
912  continue;
913 
914  int layers[VIEW::VIEW_MAX_LAYERS], layers_count;
915  viewData->getLayers( layers, layers_count );
916 
917  for( int i = 0; i < layers_count; ++i )
918  {
919  int group = viewData->getGroup( layers[i] );
920 
921  if( group >= 0 )
922  m_gal->ChangeGroupDepth( group, m_layers[layers[i]].renderingOrder );
923  }
924  }
925  }
926 
927  MarkDirty();
928 }
void sortLayers()
Clear cached GAL group numbers (ONLY numbers stored in VIEW_ITEMs, not group objects used by GAL)
Definition: view.cpp:1231
friend class VIEW_ITEM
Definition: view.h:70
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:700
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
The set of layers that are displayed on the top.
Definition: view.h:817
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811
virtual bool IsVisible() const
Return true if the GAL canvas is visible on the screen.
virtual void ChangeGroupDepth(int aGroupNumber, int aDepth)
Change the depth (Z-axis position) of the group.
void MarkDirty()
Force redraw of view on the next rendering.
Definition: view.h:598

References KIGFX::GAL::ChangeGroupDepth(), KIGFX::GAL::IsVisible(), KIGFX::VIEW::m_allItems, KIGFX::VIEW::m_gal, KIGFX::VIEW::m_layers, KIGFX::VIEW::MarkDirty(), KIGFX::VIEW::sortLayers(), and KIGFX::VIEW::VIEW_MAX_LAYERS.

Referenced by KIGFX::VIEW::EnableTopLayer(), SCH_DRAW_PANEL::SCH_DRAW_PANEL(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), GERBVIEW_DRAW_PANEL_GAL::SetTopLayer(), PL_DRAW_PANEL_GAL::SetTopLayer(), PCB_DRAW_PANEL_GAL::SetTopLayer(), and EDA_DRAW_PANEL_GAL::SetTopLayer().

◆ updateBbox()

void KIGFX::VIEW::updateBbox ( VIEW_ITEM aItem)
protectedinherited

Update set of layers that an item occupies.

Definition at line 1295 of file view.cpp.

1296 {
1297  int layers[VIEW_MAX_LAYERS], layers_count;
1298 
1299  aItem->ViewGetLayers( layers, layers_count );
1300 
1301  for( int i = 0; i < layers_count; ++i )
1302  {
1303  VIEW_LAYER& l = m_layers[layers[i]];
1304  l.items->Remove( aItem );
1305  l.items->Insert( aItem );
1306  MarkTargetDirty( l.target );
1307  }
1308 }
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:700
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
Definition: view.h:574
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811

References KIGFX::VIEW::VIEW_LAYER::items, KIGFX::VIEW::m_layers, KIGFX::VIEW::MarkTargetDirty(), KIGFX::VIEW::VIEW_LAYER::target, KIGFX::VIEW::VIEW_MAX_LAYERS, and KIGFX::VIEW_ITEM::ViewGetLayers().

Referenced by KIGFX::VIEW::invalidateItem().

◆ updateItemColor()

void KIGFX::VIEW::updateItemColor ( VIEW_ITEM aItem,
int  aLayer 
)
protectedinherited

Update all information needed to draw an item.

Definition at line 1246 of file view.cpp.

1247 {
1248  auto viewData = aItem->viewPrivData();
1249  wxCHECK( (unsigned) aLayer < m_layers.size(), /*void*/ );
1250  wxCHECK( IsCached( aLayer ), /*void*/ );
1251 
1252  if( !viewData )
1253  return;
1254 
1255  // Obtain the color that should be used for coloring the item on the specific layerId
1256  const COLOR4D color = m_painter->GetSettings()->GetColor( aItem, aLayer );
1257  int group = viewData->getGroup( aLayer );
1258 
1259  // Change the color, only if it has group assigned
1260  if( group >= 0 )
1261  m_gal->ChangeGroupColor( group, color );
1262 }
int color
Definition: DXF_plotter.cpp:60
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
virtual void ChangeGroupColor(int aGroupNumber, const COLOR4D &aNewColor)
Change the color used to draw the group.
PAINTER * m_painter
Interface to #PAINTER that is used to draw items.
Definition: view.h:844
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811
virtual COLOR4D GetColor(const VIEW_ITEM *aItem, int aLayer) const =0
Returns the color that should be used to draw the specific VIEW_ITEM on the specific layer using curr...
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
bool IsCached(int aLayer) const
Return true if the layer is cached.
Definition: view.h:581
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98

References KIGFX::GAL::ChangeGroupColor(), color, KIGFX::RENDER_SETTINGS::GetColor(), KIGFX::PAINTER::GetSettings(), KIGFX::VIEW::IsCached(), KIGFX::VIEW::m_gal, KIGFX::VIEW::m_layers, KIGFX::VIEW::m_painter, and KIGFX::VIEW_ITEM::viewPrivData().

Referenced by KIGFX::VIEW::invalidateItem().

◆ updateItemGeometry()

void KIGFX::VIEW::updateItemGeometry ( VIEW_ITEM aItem,
int  aLayer 
)
protectedinherited

Update bounding box of an item.

Definition at line 1265 of file view.cpp.

1266 {
1267  auto viewData = aItem->viewPrivData();
1268  wxCHECK( (unsigned) aLayer < m_layers.size(), /*void*/ );
1269  wxCHECK( IsCached( aLayer ), /*void*/ );
1270 
1271  if( !viewData )
1272  return;
1273 
1274  VIEW_LAYER& l = m_layers.at( aLayer );
1275 
1276  m_gal->SetTarget( l.target );
1277  m_gal->SetLayerDepth( l.renderingOrder );
1278 
1279  // Redraw the item from scratch
1280  int group = viewData->getGroup( aLayer );
1281 
1282  if( group >= 0 )
1283  m_gal->DeleteGroup( group );
1284 
1285  group = m_gal->BeginGroup();
1286  viewData->setGroup( aLayer, group );
1287 
1288  if( !m_painter->Draw( static_cast<EDA_ITEM*>( aItem ), aLayer ) )
1289  aItem->ViewDraw( aLayer, this ); // Alternative drawing method
1290 
1291  m_gal->EndGroup();
1292 }
virtual void DeleteGroup(int aGroupNumber)
Delete the group from the memory.
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
virtual void SetLayerDepth(double aLayerDepth)
Set the depth of the layer (position on the z-axis)
virtual void EndGroup()
End the group.
virtual int BeginGroup()
Begin a group.
PAINTER * m_painter
Interface to #PAINTER that is used to draw items.
Definition: view.h:844
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811
virtual bool Draw(const VIEW_ITEM *aItem, int aLayer)=0
Takes an instance of VIEW_ITEM and passes it to a function that knows how to draw the item.
bool IsCached(int aLayer) const
Return true if the layer is cached.
Definition: view.h:581
virtual void SetTarget(RENDER_TARGET aTarget)
Set the target for rendering.

References KIGFX::GAL::BeginGroup(), KIGFX::GAL::DeleteGroup(), KIGFX::PAINTER::Draw(), KIGFX::GAL::EndGroup(), KIGFX::VIEW::IsCached(), KIGFX::VIEW::m_gal, KIGFX::VIEW::m_layers, KIGFX::VIEW::m_painter, KIGFX::VIEW::VIEW_LAYER::renderingOrder, KIGFX::GAL::SetLayerDepth(), KIGFX::GAL::SetTarget(), KIGFX::VIEW::VIEW_LAYER::target, KIGFX::VIEW_ITEM::ViewDraw(), and KIGFX::VIEW_ITEM::viewPrivData().

Referenced by KIGFX::VIEW::invalidateItem().

◆ UpdateItems()

void KIGFX::VIEW::UpdateItems ( )
inherited

Iterate through the list of items that asked for updating and updates them.

Definition at line 1389 of file view.cpp.

1390 {
1391  if( m_gal->IsVisible() )
1392  {
1393  GAL_UPDATE_CONTEXT ctx( m_gal );
1394 
1395  for( VIEW_ITEM* item : *m_allItems )
1396  {
1397  auto viewData = item->viewPrivData();
1398 
1399  if( !viewData )
1400  continue;
1401 
1402  if( viewData->m_requiredUpdate != NONE )
1403  {
1404  invalidateItem( item, viewData->m_requiredUpdate );
1405  viewData->m_requiredUpdate = NONE;
1406  }
1407  }
1408  }
1409 }
friend class VIEW_ITEM
Definition: view.h:70
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
The set of layers that are displayed on the top.
Definition: view.h:817
void invalidateItem(VIEW_ITEM *aItem, int aUpdateFlags)
Manage dirty flags & redraw queuing when updating an item.
Definition: view.cpp:1185
No updates are required.
Definition: view_item.h:51
virtual bool IsVisible() const
Return true if the GAL canvas is visible on the screen.

References KIGFX::VIEW::invalidateItem(), KIGFX::GAL::IsVisible(), KIGFX::VIEW::m_allItems, KIGFX::VIEW::m_gal, and KIGFX::NONE.

Referenced by EDA_DRAW_PANEL_GAL::DoRePaint(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SCH_DRAW_PANEL::OnShow(), PCB_DRAW_PANEL_GAL::OnShow(), KIGFX::VIEW::ReorderLayerData(), and SCH_EDITOR_CONTROL::UpdateFind().

◆ UpdateLayerColor()

void KIGFX::VIEW::UpdateLayerColor ( int  aLayer)
inherited

Apply the new coloring scheme held by RENDER_SETTINGS in case that it has changed.

Parameters
aLayeris a number of the layer to be updated.
See also
RENDER_SETTINGS

Definition at line 749 of file view.cpp.

750 {
751  // There is no point in updating non-cached layers
752  if( !IsCached( aLayer ) )
753  return;
754 
755  BOX2I r;
756 
757  r.SetMaximum();
758 
759  if( m_gal->IsVisible() )
760  {
761  GAL_UPDATE_CONTEXT ctx( m_gal );
762 
763  updateItemsColor visitor( aLayer, m_painter, m_gal );
764  m_layers[aLayer].items->Query( r, visitor );
765  MarkTargetDirty( m_layers[aLayer].target );
766  }
767 }
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
Definition: view.h:574
void SetMaximum()
Definition: box2.h:73
PAINTER * m_painter
Interface to #PAINTER that is used to draw items.
Definition: view.h:844
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811
bool IsCached(int aLayer) const
Return true if the layer is cached.
Definition: view.h:581
virtual bool IsVisible() const
Return true if the GAL canvas is visible on the screen.

References KIGFX::VIEW::IsCached(), KIGFX::GAL::IsVisible(), KIGFX::VIEW::m_gal, KIGFX::VIEW::m_layers, KIGFX::VIEW::m_painter, KIGFX::VIEW::MarkTargetDirty(), and BOX2< Vec >::SetMaximum().

Referenced by PCB_CONTROL::LayerAlphaDec(), PCB_CONTROL::LayerAlphaInc(), APPEARANCE_CONTROLS::OnColorSwatchChanged(), and GERBER_LAYER_WIDGET::OnLayerColorChange().

◆ updateLayers()

void KIGFX::VIEW::updateLayers ( VIEW_ITEM aItem)
protectedinherited

Determine rendering order of layers. Used in display order sorting function.

Definition at line 1311 of file view.cpp.

1312 {
1313  auto viewData = aItem->viewPrivData();
1314  int layers[VIEW_MAX_LAYERS], layers_count;
1315 
1316  if( !viewData )
1317  return;
1318 
1319  // Remove the item from previous layer set
1320  viewData->getLayers( layers, layers_count );
1321 
1322  for( int i = 0; i < layers_count; ++i )
1323  {
1324  VIEW_LAYER& l = m_layers[layers[i]];
1325  l.items->Remove( aItem );
1326  MarkTargetDirty( l.target );
1327 
1328  if( IsCached( l.id ) )
1329  {
1330  // Redraw the item from scratch
1331  int prevGroup = viewData->getGroup( layers[i] );
1332 
1333  if( prevGroup >= 0 )
1334  {
1335  m_gal->DeleteGroup( prevGroup );
1336  viewData->setGroup( l.id, -1 );
1337  }
1338  }
1339  }
1340 
1341  // Add the item to new layer set
1342  aItem->ViewGetLayers( layers, layers_count );
1343  viewData->saveLayers( layers, layers_count );
1344 
1345  for( int i = 0; i < layers_count; i++ )
1346  {
1347  VIEW_LAYER& l = m_layers[layers[i]];
1348  l.items->Insert( aItem );
1349  MarkTargetDirty( l.target );
1350  }
1351 }
virtual void DeleteGroup(int aGroupNumber)
Delete the group from the memory.
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:847
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:700
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
Definition: view.h:574
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:811
bool IsCached(int aLayer) const
Return true if the layer is cached.
Definition: view.h:581

References KIGFX::GAL::DeleteGroup(), KIGFX::VIEW_ITEM_DATA::getLayers(), KIGFX::VIEW::VIEW_LAYER::id, KIGFX::VIEW::IsCached(), KIGFX::VIEW::VIEW_LAYER::items, KIGFX::VIEW::m_gal, KIGFX::VIEW::m_layers, KIGFX::VIEW::MarkTargetDirty(), KIGFX::VIEW::VIEW_LAYER::target, KIGFX::VIEW::VIEW_MAX_LAYERS, KIGFX::VIEW_ITEM::ViewGetLayers(), and KIGFX::VIEW_ITEM::viewPrivData().

Referenced by KIGFX::VIEW::invalidateItem().

◆ UseDrawPriority()

void KIGFX::VIEW::UseDrawPriority ( bool  aFlag)
inlineinherited
Parameters
aFlagis true if draw priority should be respected while redrawing.

Definition at line 643 of file view.h.

644  {
645  m_useDrawPriority = aFlag;
646  }
bool m_useDrawPriority
The next sequential drawing priority.
Definition: view.h:860

References KIGFX::VIEW::m_useDrawPriority.

Member Data Documentation

◆ m_allItems

◆ m_boundary

BOX2D KIGFX::VIEW::m_boundary
protectedinherited

◆ m_center

VECTOR2D KIGFX::VIEW::m_center
protectedinherited

Scale of displayed VIEW_ITEMs.

Definition at line 823 of file view.h.

Referenced by KIGFX::VIEW::GetCenter(), KIGFX::VIEW::SetCenter(), KIGFX::VIEW::SetGAL(), and KIGFX::VIEW::SetScale().

◆ m_dirtyTargets

bool KIGFX::VIEW::m_dirtyTargets[TARGETS_NUMBER]
protectedinherited

Rendering order modifier for layers that are marked as top layers.

Definition at line 854 of file view.h.

Referenced by KIGFX::VIEW::IsTargetDirty(), KIGFX::VIEW::MarkDirty(), KIGFX::VIEW::markTargetClean(), and KIGFX::VIEW::MarkTargetDirty().

◆ m_drawingSheet

std::unique_ptr<DS_PROXY_VIEW_ITEM> KIGFX::SCH_VIEW::m_drawingSheet
private

Definition at line 104 of file sch_view.h.

Referenced by Cleanup(), DisplaySheet(), and GetDrawingSheet().

◆ m_dynamic

bool KIGFX::VIEW::m_dynamic
protectedinherited

Flag to mark targets as dirty so they have to be redrawn on the next refresh event.

Definition at line 851 of file view.h.

Referenced by KIGFX::VIEW::IsDynamic().

◆ m_enableOrderModifier

bool KIGFX::VIEW::m_enableOrderModifier
protectedinherited

The set of possible displayed layers and its properties.

Definition at line 808 of file view.h.

Referenced by KIGFX::VIEW::ClearTopLayers(), KIGFX::VIEW::EnableTopLayer(), and KIGFX::VIEW::SetTopLayer().

◆ m_frame

SCH_BASE_FRAME* KIGFX::SCH_VIEW::m_frame
private

Definition at line 101 of file sch_view.h.

Referenced by DisplaySheet(), SCH_VIEW(), and SetScale().

◆ m_gal

◆ m_layers

◆ m_maxScale

double KIGFX::VIEW::m_maxScale
protectedinherited

Horizontal flip flag.

Definition at line 835 of file view.h.

Referenced by KIGFX::VIEW::SetScale(), and KIGFX::VIEW::SetScaleLimits().

◆ m_minScale

double KIGFX::VIEW::m_minScale
protectedinherited

Scale upper limit.

Definition at line 832 of file view.h.

Referenced by KIGFX::VIEW::SetScale(), and KIGFX::VIEW::SetScaleLimits().

◆ m_mirrorX

bool KIGFX::VIEW::m_mirrorX
protectedinherited

Vertical flip flag.

Definition at line 838 of file view.h.

Referenced by KIGFX::VIEW::IsMirroredX(), KIGFX::VIEW::SetGAL(), and KIGFX::VIEW::SetMirror().

◆ m_mirrorY

bool KIGFX::VIEW::m_mirrorY
protectedinherited

PAINTER contains information how do draw items.

Definition at line 841 of file view.h.

Referenced by KIGFX::VIEW::IsMirroredY(), KIGFX::VIEW::SetGAL(), and KIGFX::VIEW::SetMirror().

◆ m_nextDrawPriority

int KIGFX::VIEW::m_nextDrawPriority
protectedinherited

Flag to reverse the draw order when using draw priority.

Definition at line 863 of file view.h.

Referenced by KIGFX::VIEW::Add(), and KIGFX::VIEW::Clear().

◆ m_orderedLayers

std::vector<VIEW_LAYER*> KIGFX::VIEW::m_orderedLayers
protectedinherited

Flat list of all items.

Definition at line 814 of file view.h.

Referenced by KIGFX::VIEW::Query(), KIGFX::VIEW::redrawRect(), and KIGFX::VIEW::sortLayers().

◆ m_ownedItems

std::vector<EDA_ITEM *> KIGFX::VIEW::m_ownedItems
protectedinherited

Whether to use rendering order modifier or not.

Definition at line 805 of file view.h.

Referenced by KIGFX::VIEW::AddToPreview(), and KIGFX::VIEW::ClearPreview().

◆ m_painter

PAINTER* KIGFX::VIEW::m_painter
protectedinherited

◆ m_preview

std::unique_ptr<KIGFX::VIEW_GROUP> KIGFX::VIEW::m_preview
protectedinherited

◆ m_printMode

int KIGFX::VIEW::m_printMode
protectedinherited

Definition at line 870 of file view.h.

Referenced by KIGFX::VIEW::GetPrintMode(), and KIGFX::VIEW::SetPrintMode().

◆ m_reverseDrawOrder

bool KIGFX::VIEW::m_reverseDrawOrder
protectedinherited

A control for printing: m_printMode <= 0 means no printing mode (normal draw mode m_printMode > 0 is a printing mode (currently means "we are in printing mode").

Definition at line 866 of file view.h.

Referenced by KIGFX::VIEW::IsDrawOrderReversed(), KIGFX::VIEW::redrawRect(), and KIGFX::VIEW::ReverseDrawOrder().

◆ m_scale

double KIGFX::VIEW::m_scale
protectedinherited

View boundaries.

Definition at line 826 of file view.h.

Referenced by KIGFX::VIEW::GetScale(), KIGFX::VIEW::drawItem::operator()(), KIGFX::VIEW::SetGAL(), and KIGFX::VIEW::SetScale().

◆ m_topLayers

std::set<unsigned int> KIGFX::VIEW::m_topLayers
protectedinherited

Center point of the VIEW (the point at which we are looking at).

Definition at line 820 of file view.h.

Referenced by KIGFX::VIEW::ClearTopLayers(), KIGFX::VIEW::EnableTopLayer(), KIGFX::VIEW::GetTopLayer(), and KIGFX::VIEW::SetTopLayer().

◆ m_useDrawPriority

bool KIGFX::VIEW::m_useDrawPriority
protectedinherited

The next sequential drawing priority.

Definition at line 860 of file view.h.

Referenced by KIGFX::VIEW::IsUsingDrawPriority(), KIGFX::VIEW::redrawRect(), and KIGFX::VIEW::UseDrawPriority().

◆ TOP_LAYER_MODIFIER

const int KIGFX::VIEW::TOP_LAYER_MODIFIER = -VIEW_MAX_LAYERS
staticprotectedinherited

Flag to respect draw priority when drawing items.

Definition at line 857 of file view.h.

Referenced by KIGFX::VIEW::ClearTopLayers(), KIGFX::VIEW::EnableTopLayer(), and KIGFX::VIEW::SetTopLayer().

◆ VIEW_MAX_LAYERS


The documentation for this class was generated from the following files: