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 DisplaySheet (SCH_SHEET *aSheet)
 
void DisplaySheet (SCH_SCREEN *aScreen)
 
void DisplayComponent (LIB_PART *aPart)
 
void ResizeSheetWorkingArea (SCH_SCREEN *aScreen)
 
KIGFX::PREVIEW::SELECTION_AREAGetSelectionArea () const
 
KIGFX::VIEW_GROUPGetPreview () const
 
void ClearPreview ()
 
void AddToPreview (EDA_ITEM *aItem, bool aTakeOwnership=true)
 
void ShowSelectionArea (bool aShow=true)
 
void ShowPreview (bool aShow=true)
 
void ClearHiddenFlags ()
 Clear the hide flag of all items in the view. More...
 
void HideWorksheet ()
 
void HighlightItem (EDA_ITEM *aItem, LIB_PIN *aPin=nullptr)
 
virtual void Add (VIEW_ITEM *aItem, int aDrawPriority=-1)
 Function Add() Adds a VIEW_ITEM to the view. More...
 
virtual void Remove (VIEW_ITEM *aItem)
 Function Remove() Removes a VIEW_ITEM from the view. More...
 
virtual int Query (const BOX2I &aRect, std::vector< LAYER_ITEM_PAIR > &aResult) const
 Function Query() Finds all visible items that touch or are within the rectangle aRect. More...
 
void SetVisible (VIEW_ITEM *aItem, bool aIsVisible=true)
 Sets the item visibility. More...
 
void Hide (VIEW_ITEM *aItem, bool aHide=true)
 Temporarily hides the item in the view (e.g. More...
 
bool IsVisible (const VIEW_ITEM *aItem) const
 Returns information if the item is visible (or not). More...
 
virtual void Update (VIEW_ITEM *aItem, int aUpdateFlags)
 For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has changed. More...
 
virtual void Update (VIEW_ITEM *aItem)
 
void SetRequired (int aLayerId, int aRequiredId, bool aRequired=true)
 Function SetRequired() Marks the aRequiredId layer as required for the aLayerId layer. More...
 
void CopySettings (const VIEW *aOtherView)
 Function CopySettings() Copies layers and visibility settings from another view. More...
 
void SetGAL (GAL *aGal)
 Function SetGAL() Assigns a rendering device for the VIEW. More...
 
GALGetGAL () const
 Function GetGAL() Returns the GAL this view is using to draw graphical primitives. More...
 
void SetPainter (PAINTER *aPainter)
 Function SetPainter() Sets the painter object used by the view for drawing VIEW_ITEMS. More...
 
PAINTERGetPainter () const
 Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS. More...
 
void SetViewport (const BOX2D &aViewport)
 Function SetViewport() Sets the visible area of the VIEW. More...
 
BOX2D GetViewport () const
 Function GetViewport() Returns the current viewport visible area rectangle. More...
 
void SetMirror (bool aMirrorX, bool aMirrorY)
 Function SetMirror() Controls the mirroring of the VIEW. More...
 
bool IsMirroredX () const
 Function IsMirroredX() Returns true if view is flipped across the X axis. More...
 
bool IsMirroredY () const
 Function IsMirroredX() Returns true if view is flipped across the Y axis. More...
 
void SetScale (double aScale)
 Function SetScale() Sets the scaling factor. More...
 
void SetScale (double aScale, const VECTOR2D &aAnchor)
 Function SetScale() Sets the scaling factor, zooming around a given anchor point. More...
 
double GetScale () const
 Function GetScale() More...
 
void SetBoundary (const BOX2D &aBoundary)
 Function SetBoundary() Sets limits for view area. More...
 
void SetBoundary (const BOX2I &aBoundary)
 Function SetBoundary() Sets limits for view area. More...
 
const BOX2DGetBoundary () const
 Function GetBoundary() More...
 
void SetScaleLimits (double aMaximum, double aMinimum)
 Function SetScaleLimits() Sets minimum and maximum values for scale. More...
 
void SetCenter (const VECTOR2D &aCenter)
 Function SetCenter() Sets the center point of the VIEW (i.e. More...
 
void SetCenter (VECTOR2D aCenter, const BOX2D &occultingScreenRect)
 Function SetCenter() Sets 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
 Function GetCenter() Returns the center point of this VIEW (in world space coordinates) More...
 
VECTOR2D ToWorld (const VECTOR2D &aCoord, bool aAbsolute=true) const
 Function ToWorld() Converts a screen space point/vector to a point/vector in world space coordinates. More...
 
double ToWorld (double aSize) const
 Function ToWorld() 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
 Function ToScreen() Converts a world space point/vector to a point/vector in screen space coordinates. More...
 
double ToScreen (double aSize) const
 Function ToScreen() Converts a world space one dimensionsal size to a one dimensional size in screen space. More...
 
const VECTOR2IGetScreenPixelSize () const
 Function GetScreenPixelSize() Returns the size of the our rendering area, in pixels. More...
 
void AddLayer (int aLayer, bool aDisplayOnly=false)
 Function AddLayer() Adds a new layer to the view. More...
 
void ClearLayer (int aLayer)
 Function ClearLayer() Removes all items from a given layer. More...
 
void Clear ()
 Function Clear() Removes all items from the view. More...
 
void SetLayerVisible (int aLayer, bool aVisible=true)
 Function SetLayerVisible() Controls the visibility of a particular layer. More...
 
bool IsLayerVisible (int aLayer) const
 Function IsLayerVisible() Returns information about visibility of a particular layer. More...
 
void SetLayerDisplayOnly (int aLayer, bool aDisplayOnly=true)
 
void SetLayerTarget (int aLayer, RENDER_TARGET aTarget)
 Function SetLayerTarget() Changes the rendering target for a particular layer. More...
 
void SetLayerOrder (int aLayer, int aRenderingOrder)
 Function SetLayerOrder() Sets rendering order of a particular layer. More...
 
int GetLayerOrder (int aLayer) const
 Function GetLayerOrder() Returns rendering order of a particular layer. More...
 
void SortLayers (int aLayers[], int &aCount) const
 Function SortLayers() Changes 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)
 Remaps the data between layer ids without invalidating that data. More...
 
void UpdateLayerColor (int aLayer)
 Function UpdateLayerColor() Applies the new coloring scheme held by RENDER_SETTINGS in case that it has changed. More...
 
void UpdateAllLayersColor ()
 Function UpdateAllLayersColor() Applies the new coloring scheme to all layers. More...
 
virtual void SetTopLayer (int aLayer, bool aEnabled=true)
 Function SetTopLayer() Sets given layer to be displayed on the top or sets back the default order of layers. More...
 
virtual void EnableTopLayer (bool aEnable)
 Function EnableTopLayer() Enables or disables display of the top layer. More...
 
virtual int GetTopLayer () const
 
void ClearTopLayers ()
 Function ClearTopLayers() Removes all layers from the on-the-top set (they are no longer displayed over the rest of layers). More...
 
void UpdateAllLayersOrder ()
 Function UpdateLayerOrder() Does everything that is needed to apply the rendering order of layers. More...
 
void ClearTargets ()
 Function ClearTargets() Clears targets that are marked as dirty. More...
 
virtual void Redraw ()
 Function Redraw() Immediately redraws the whole view. More...
 
void RecacheAllItems ()
 Function RecacheAllItems() Rebuilds GAL display lists. More...
 
bool IsDynamic () const
 Function IsDynamic() Tells if the VIEW is dynamic (ie. More...
 
bool IsDirty () const
 Function IsDirty() Returns true if any of the VIEW layers needs to be refreshened. More...
 
bool IsTargetDirty (int aTarget) const
 Function IsTargetDirty() Returns true if any of layers belonging to the target or the target itself should be redrawn. More...
 
void MarkTargetDirty (int aTarget)
 Function MarkTargetDirty() Sets or clears target 'dirty' flag. More...
 
bool IsCached (int aLayer) const
 Returns true if the layer is cached. More...
 
void MarkDirty ()
 Function MarkDirty() Forces redraw of view on the next rendering. More...
 
void MarkForUpdate (VIEW_ITEM *aItem)
 Function MarkForUpdate() Adds an item to a list of items that are going to be refreshed upon the next frame rendering. More...
 
void UpdateItems ()
 Function UpdateItems() Iterates through the list of items that asked for updating and updates them. More...
 
void UpdateAllItems (int aUpdateFlags)
 Updates all items in the view according to the given flags. More...
 
void UpdateAllItemsConditionally (int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
 Updates items in the view according to the given flags and condition. More...
 
bool IsUsingDrawPriority () const
 Function IsUsingDrawPriority() More...
 
void UseDrawPriority (bool aFlag)
 Function UseDrawPriority() More...
 
bool IsDrawOrderReversed () const
 Function IsDrawOrderReversed() More...
 
void ReverseDrawOrder (bool aFlag)
 Function ReverseDrawOrder() Only takes effect if UseDrawPriority is true. More...
 
std::shared_ptr< VIEW_OVERLAYMakeOverlay ()
 
std::unique_ptr< VIEWDataReference () const
 Returns a new VIEW object that shares the same set of VIEW_ITEMs and LAYERs. More...
 
int GetPrintMode ()
 
void SetPrintMode (int aPrintMode)
 Set the printing mode. More...
 

Static Public Member Functions

static void OnDestroy (VIEW_ITEM *aItem)
 

Static Public Attributes

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

Protected Types

typedef std::unordered_map< int, VIEW_LAYERLAYER_MAP
 
typedef LAYER_MAP::iterator LAYER_MAP_ITER
 
typedef std::vector< VIEW_LAYER * > LAYER_ORDER
 
typedef std::vector< VIEW_LAYER * >::iterator LAYER_ORDER_ITER
 

Protected Member Functions

void redrawRect (const BOX2I &aRect)
 
void markTargetClean (int aTarget)
 
void draw (VIEW_ITEM *aItem, int aLayer, bool aImmediate=false)
 Function draw() Draws an item, but on a specified layers. More...
 
void draw (VIEW_ITEM *aItem, bool aImmediate=false)
 Function draw() Draws an item on all layers that the item uses. More...
 
void draw (VIEW_GROUP *aGroup, bool aImmediate=false)
 Function draw() Draws a group of items on all layers that those items use. More...
 
void sortLayers ()
 
void clearGroupCache ()
 
void invalidateItem (VIEW_ITEM *aItem, int aUpdateFlags)
 Function invalidateItem() Manages dirty flags & redraw queueing when updating an item. More...
 
void updateItemColor (VIEW_ITEM *aItem, int aLayer)
 Updates colors that are used for an item to be drawn. More...
 
void updateItemGeometry (VIEW_ITEM *aItem, int aLayer)
 Updates all informations needed to draw an item. More...
 
void updateBbox (VIEW_ITEM *aItem)
 Updates bounding box of an item. More...
 
void updateLayers (VIEW_ITEM *aItem)
 Updates set of layers that an item occupies. More...
 
bool areRequiredLayersEnabled (int aLayerId) const
 Checks if every layer required by the aLayerId layer is enabled. More...
 

Static Protected Member Functions

static bool compareRenderingOrder (VIEW_LAYER *aI, VIEW_LAYER *aJ)
 Determines rendering order of layers. Used in display order sorting function. More...
 

Protected Attributes

bool m_enableOrderModifier
 
LAYER_MAP m_layers
 Contains set of possible displayed layers and its properties. More...
 
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
 Flat list of all items. More...
 
LAYER_ORDER m_orderedLayers
 Sorted list of pointers to members of m_layers. More...
 
std::set< unsigned int > m_topLayers
 Stores set of layers that are displayed on the top. More...
 
VECTOR2D m_center
 Center point of the VIEW (the point at which we are looking at) More...
 
double m_scale
 Scale of displayed VIEW_ITEMs. More...
 
BOX2D m_boundary
 View boundaries. More...
 
double m_minScale
 Scale lower limit. More...
 
double m_maxScale
 Scale upper limit. More...
 
bool m_mirrorX
 

Horizontal flip flag

More...
 
bool m_mirrorY
 

Vertical flip flag

More...
 
PAINTERm_painter
 PAINTER contains information how do draw items. More...
 
GALm_gal
 Gives interface to PAINTER, that is used to draw items. More...
 
bool m_dynamic
 Dynamic VIEW (eg. More...
 
bool m_dirtyTargets [TARGETS_NUMBER]
 Flags to mark targets as dirty, so they have to be redrawn on the next refresh event. More...
 
bool m_useDrawPriority
 Flat list of all items Flag to respect draw priority when drawing items. More...
 
int m_nextDrawPriority
 The next sequential drawing priority. More...
 
bool m_reverseDrawOrder
 Flag to reverse the draw order when using draw priority. More...
 
int m_printMode
 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...
 

Static Protected Attributes

static const int TOP_LAYER_MODIFIER = -VIEW_MAX_LAYERS
 Rendering order modifier for layers that are marked as top layers. More...
 

Private Attributes

SCH_BASE_FRAMEm_frame
 
std::unique_ptr< WORKSHEET_VIEWITEMm_worksheet
 
std::unique_ptr< KIGFX::PREVIEW::SELECTION_AREAm_selectionArea
 
std::unique_ptr< KIGFX::VIEW_GROUPm_preview
 
std::vector< EDA_ITEM * > m_ownedItems
 

Detailed Description

Definition at line 71 of file sch_view.h.

Member Typedef Documentation

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

Definition at line 66 of file view.h.

typedef std::unordered_map<int, VIEW_LAYER> KIGFX::VIEW::LAYER_MAP
protectedinherited

Definition at line 727 of file view.h.

typedef LAYER_MAP::iterator KIGFX::VIEW::LAYER_MAP_ITER
protectedinherited

Definition at line 728 of file view.h.

typedef std::vector<VIEW_LAYER*> KIGFX::VIEW::LAYER_ORDER
protectedinherited

Definition at line 729 of file view.h.

typedef std::vector<VIEW_LAYER*>::iterator KIGFX::VIEW::LAYER_ORDER_ITER
protectedinherited

Definition at line 730 of file view.h.

Constructor & Destructor Documentation

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

Definition at line 47 of file sch_view.cpp.

References IU_PER_MILS, KIGFX::VIEW::m_boundary, m_frame, m_preview, m_selectionArea, MAX_PAGE_SIZE_EDITORS_MILS, BOX2< Vec >::SetOrigin(), and BOX2< Vec >::SetSize().

47  :
48  VIEW( aIsDynamic )
49 {
50  m_frame = aFrame;
51  // Set m_boundary to define the max working area size. The default value
52  // is acceptable for Pcbnew and Gerbview, but too large for Eeschema due to
53  // very different internal units.
54  // So we have to use a smaller value.
55  // A full size = 3 * MAX_PAGE_SIZE_EDITORS_MILS size allows a wide margin
56  // around the worksheet.
57  double max_size = MAX_PAGE_SIZE_EDITORS_MILS * IU_PER_MILS * 3.0;
58  m_boundary.SetOrigin( -max_size/4, -max_size/4 );
59  m_boundary.SetSize( max_size, max_size );
60 
62  m_preview.reset( new KIGFX::VIEW_GROUP() );
63 }
void SetSize(const Vec &size)
Definition: box2.h:210
std::unique_ptr< KIGFX::PREVIEW::SELECTION_AREA > m_selectionArea
Definition: sch_view.h:109
#define MAX_PAGE_SIZE_EDITORS_MILS
Definition: page_info.h:41
BOX2D m_boundary
View boundaries.
Definition: view.h:841
void SetOrigin(const Vec &pos)
Definition: box2.h:208
#define IU_PER_MILS
Definition: plotter.cpp:134
SCH_BASE_FRAME * m_frame
Definition: sch_view.h:106
Class SELECTION_AREA.
VIEW(bool aIsDynamic=true)
Constructor.
Definition: view.cpp:285
std::unique_ptr< KIGFX::VIEW_GROUP > m_preview
Definition: sch_view.h:110
KIGFX::SCH_VIEW::~SCH_VIEW ( )

Definition at line 66 of file sch_view.cpp.

67 {
68 }

Member Function Documentation

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

Function Add() Adds 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 345 of file view.cpp.

References i, 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(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PCB_DRAW_PANEL_GAL::DisplayBoard(), DisplayComponent(), SYMBOL_PREVIEW_WIDGET::DisplayPart(), DisplaySheet(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), SELECTION_TOOL::doSelectionMenu(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), GRID_HELPER::GRID_HELPER(), KIGFX::VIEW::MakeOverlay(), POINT_EDITOR::OnSelectionChange(), DRAWING_TOOL::PlaceImportedGraphics(), DIALOG_PAD_PROPERTIES::prepareCanvas(), BOARD_COMMIT::Push(), GERBVIEW_FRAME::Read_EXCELLON_File(), PCB_EDIT_FRAME::ReadPcbNetlist(), DIALOG_PAD_PROPERTIES::redraw(), FOOTPRINT_PREVIEW_PANEL::renderFootprint(), PCB_EDITOR_CONTROL::Reset(), PCBNEW_CONTROL::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), BOARD_COMMIT::Revert(), SCH_EDIT_FRAME::SaveWireImage(), GERBVIEW_SELECTION_TOOL::select(), GERBVIEW_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), PCB_DRAW_PANEL_GAL::SetWorksheet(), GERBVIEW_DRAW_PANEL_GAL::SetWorksheet(), GERBVIEW_DRAW_PANEL_GAL::SwitchBackend(), DIALOG_ERC::TestErc(), POINT_EDITOR::updatePoints(), LIB_VIEW_FRAME::updatePreviewSymbol(), and ZONE_CREATE_HELPER::ZONE_CREATE_HELPER().

346 {
347  int layers[VIEW_MAX_LAYERS], layers_count;
348 
349  if( aDrawPriority < 0 )
350  aDrawPriority = m_nextDrawPriority++;
351 
352  if( !aItem->m_viewPrivData )
353  aItem->m_viewPrivData = new VIEW_ITEM_DATA;
354 
355  aItem->m_viewPrivData->m_view = this;
356  aItem->m_viewPrivData->m_drawPriority = aDrawPriority;
357 
358  aItem->ViewGetLayers( layers, layers_count );
359  aItem->viewPrivData()->saveLayers( layers, layers_count );
360 
361  m_allItems->push_back( aItem );
362 
363  for( int i = 0; i < layers_count; ++i )
364  {
365  VIEW_LAYER& l = m_layers[layers[i]];
366  l.items->Insert( aItem );
367  MarkTargetDirty( l.target );
368  }
369 
370  SetVisible( aItem, true );
371  Update( aItem, KIGFX::INITIAL_ADD );
372 }
Layers have changed.
Definition: view_item.h:59
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:712
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
Flat list of all items.
Definition: view.h:826
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target &#39;dirty&#39; flag.
Definition: view.h:596
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1538
int m_nextDrawPriority
The next sequential drawing priority.
Definition: view.h:876
size_t i
Definition: json11.cpp:597
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Sets the item visibility.
Definition: view.cpp:1484
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void KIGFX::VIEW::AddLayer ( int  aLayer,
bool  aDisplayOnly = false 
)
inherited

Function AddLayer() Adds a new layer to the view.

Parameters
aLayerunique ID of the layer to be added.
aDisplayOnlylayer is display-only (example: selection boxes, floating hints/menus). Objects belonging to this layer are not taken into account by Query() method.

Definition at line 330 of file view.cpp.

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

Referenced by KIGFX::VIEW::GetCenter(), and KIGFX::VIEW::VIEW().

331 {
332  if( m_layers.find( aLayer ) == m_layers.end() )
333  {
334  m_layers[aLayer] = VIEW_LAYER();
335  m_layers[aLayer].items.reset( new VIEW_RTREE() );
336  m_layers[aLayer].id = aLayer;
337  m_layers[aLayer].renderingOrder = aLayer;
338  m_layers[aLayer].visible = true;
339  m_layers[aLayer].displayOnly = aDisplayOnly;
340  m_layers[aLayer].target = TARGET_CACHED;
341  }
342 }
Main rendering target (cached)
Definition: definitions.h:41
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void KIGFX::SCH_VIEW::AddToPreview ( EDA_ITEM aItem,
bool  aTakeOwnership = true 
)

Definition at line 145 of file sch_view.cpp.

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

146 {
147  Hide( aItem, false );
148  m_preview->Add( aItem );
149 
150  if( aTakeOwnership )
151  m_ownedItems.push_back( aItem );
152 
153  SetVisible( m_preview.get(), true );
154  Hide( m_preview.get(), false );
155  Update( m_preview.get() );
156 }
void Hide(VIEW_ITEM *aItem, bool aHide=true)
Temporarily hides the item in the view (e.g.
Definition: view.cpp:1505
std::vector< EDA_ITEM * > m_ownedItems
Definition: sch_view.h:111
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1538
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Sets the item visibility.
Definition: view.cpp:1484
std::unique_ptr< KIGFX::VIEW_GROUP > m_preview
Definition: sch_view.h:110
bool KIGFX::VIEW::areRequiredLayersEnabled ( int  aLayerId) const
protectedinherited

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

Definition at line 1382 of file view.cpp.

References KIGFX::VIEW::m_layers.

Referenced by KIGFX::VIEW::compareRenderingOrder(), and KIGFX::VIEW::redrawRect().

1383 {
1384  wxCHECK( (unsigned) aLayerId < m_layers.size(), false );
1385 
1386  std::set<int>::const_iterator it, it_end;
1387 
1388  for( it = m_layers.at( aLayerId ).requiredLayers.begin(),
1389  it_end = m_layers.at( aLayerId ).requiredLayers.end(); it != it_end; ++it )
1390  {
1391  // That is enough if just one layer is not enabled
1392  if( !m_layers.at( *it ).visible || !areRequiredLayersEnabled( *it ) )
1393  return false;
1394  }
1395 
1396  return true;
1397 }
bool areRequiredLayersEnabled(int aLayerId) const
Checks if every layer required by the aLayerId layer is enabled.
Definition: view.cpp:1382
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void KIGFX::VIEW::Clear ( )
inherited

Function Clear() Removes all items from the view.

Definition at line 1109 of file view.cpp.

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

Referenced by PCB_DRAW_PANEL_GAL::DisplayBoard(), DisplayComponent(), KIGFX::VIEW::GetCenter(), GERBVIEW_FRAME::OnCloseWindow(), FOOTPRINT_PREVIEW_PANEL::renderFootprint(), PCB_BASE_EDIT_FRAME::SetBoard(), GERBVIEW_DRAW_PANEL_GAL::SwitchBackend(), DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME(), FOOTPRINT_VIEWER_FRAME::~FOOTPRINT_VIEWER_FRAME(), and GERBVIEW_FRAME::~GERBVIEW_FRAME().

1110 {
1111  BOX2I r;
1112  r.SetMaximum();
1113  m_allItems->clear();
1114 
1115  for( LAYER_MAP_ITER i = m_layers.begin(); i != m_layers.end(); ++i )
1116  i->second.items->RemoveAll();
1117 
1118  m_nextDrawPriority = 0;
1119 
1120  m_gal->ClearCache();
1121 }
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
Flat list of all items.
Definition: view.h:826
void SetMaximum()
Definition: box2.h:71
int m_nextDrawPriority
The next sequential drawing priority.
Definition: view.h:876
LAYER_MAP::iterator LAYER_MAP_ITER
Definition: view.h:728
size_t i
Definition: json11.cpp:597
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
virtual void ClearCache()
Delete all data created during caching of graphic items.
void KIGFX::VIEW::clearGroupCache ( )
protectedinherited

Definition at line 1199 of file view.cpp.

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

Referenced by KIGFX::VIEW::markTargetClean(), and KIGFX::VIEW::SetGAL().

1200 {
1201  BOX2I r;
1202 
1203  r.SetMaximum();
1204  clearLayerCache visitor( this );
1205 
1206  for( LAYER_MAP_ITER i = m_layers.begin(); i != m_layers.end(); ++i )
1207  {
1208  VIEW_LAYER* l = &( ( *i ).second );
1209  l->items->Query( r, visitor );
1210  }
1211 }
void SetMaximum()
Definition: box2.h:71
LAYER_MAP::iterator LAYER_MAP_ITER
Definition: view.h:728
size_t i
Definition: json11.cpp:597
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void KIGFX::SCH_VIEW::ClearHiddenFlags ( )

Clear the hide flag of all items in the view.

Definition at line 179 of file sch_view.cpp.

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

Referenced by LIB_EDIT_FRAME::HandleBlockPlace(), SCH_EDIT_FRAME::HandleBlockPlace(), SCH_EDIT_FRAME::OnCancelCurrentCommand(), SCH_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::PutDataInPreviousState(), and LIB_EDIT_FRAME::RebuildView().

180 {
181  for( auto item : *m_allItems )
182  Hide( item, false );
183 }
void Hide(VIEW_ITEM *aItem, bool aHide=true)
Temporarily hides the item in the view (e.g.
Definition: view.cpp:1505
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
Flat list of all items.
Definition: view.h:826
void KIGFX::VIEW::ClearLayer ( int  aLayer)
inherited

Function ClearLayer() Removes all items from a given layer.

Parameters
aLayerID of the layer to be cleared

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

void KIGFX::SCH_VIEW::ClearPreview ( )

Definition at line 133 of file sch_view.cpp.

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

Referenced by SCH_EDIT_FRAME::AddJunction(), SCH_EDIT_FRAME::AddNoConnect(), SCH_EDIT_FRAME::EndSegment(), ExitSheet(), LIB_EDIT_FRAME::HandleBlockPlace(), SCH_EDIT_FRAME::HandleBlockPlace(), SCH_EDIT_FRAME::OnCancelCurrentCommand(), and SCH_EDIT_FRAME::OnLeftClick().

134 {
135  m_preview->Clear();
136 
137  for( auto item : m_ownedItems )
138  delete item;
139 
140  m_ownedItems.clear();
141  Update( m_preview.get() );
142 }
std::vector< EDA_ITEM * > m_ownedItems
Definition: sch_view.h:111
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1538
std::unique_ptr< KIGFX::VIEW_GROUP > m_preview
Definition: sch_view.h:110
void KIGFX::VIEW::ClearTargets ( )
inherited

Function ClearTargets() Clears targets that are marked as dirty.

Definition at line 1124 of file view.cpp.

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::onPaint(), and KIGFX::VIEW::SetLayerTarget().

1125 {
1127  {
1128  // TARGET_CACHED and TARGET_NONCACHED have to be redrawn together, as they contain
1129  // layers that rely on each other (eg. netnames are noncached, but tracks - are cached)
1132 
1133  MarkDirty();
1134  }
1135 
1136  if( IsTargetDirty( TARGET_OVERLAY ) )
1137  {
1139  }
1140 }
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
Auxiliary rendering target (noncached)
Definition: definitions.h:42
virtual void ClearTarget(RENDER_TARGET aTarget)
Clears the target for rendering.
bool IsTargetDirty(int aTarget) const
Function IsTargetDirty() Returns true if any of layers belonging to the target or the target itself s...
Definition: view.h:585
Items that may change while the view stays the same (noncached)
Definition: definitions.h:43
Main rendering target (cached)
Definition: definitions.h:41
void MarkDirty()
Function MarkDirty() Forces redraw of view on the next rendering.
Definition: view.h:621
void KIGFX::VIEW::ClearTopLayers ( )
inherited

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

Definition at line 910 of file view.cpp.

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

Referenced by KIGFX::VIEW::SetLayerTarget(), GERBVIEW_DRAW_PANEL_GAL::SetTopLayer(), PCB_DRAW_PANEL_GAL::SetTopLayer(), and EDA_DRAW_PANEL_GAL::SetTopLayer().

911 {
912  std::set<unsigned int>::iterator it;
913 
915  {
916  // Restore the previous rendering order for layers that were marked as top
917  for( it = m_topLayers.begin(); it != m_topLayers.end(); ++it )
918  m_layers[*it].renderingOrder -= TOP_LAYER_MODIFIER;
919  }
920 
921  m_topLayers.clear();
922 }
static const int TOP_LAYER_MODIFIER
Rendering order modifier for layers that are marked as top layers.
Definition: view.h:869
std::set< unsigned int > m_topLayers
Stores set of layers that are displayed on the top.
Definition: view.h:832
bool m_enableOrderModifier
Definition: view.h:820
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
static bool KIGFX::VIEW::compareRenderingOrder ( VIEW_LAYER aI,
VIEW_LAYER aJ 
)
inlinestaticprotectedinherited

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

Definition at line 811 of file view.h.

References KIGFX::VIEW::areRequiredLayersEnabled(), and KIGFX::VIEW::VIEW_LAYER::renderingOrder.

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

812  {
813  return aI->renderingOrder > aJ->renderingOrder;
814  }
void KIGFX::VIEW::CopySettings ( const VIEW aOtherView)
inherited

Function CopySettings() Copies layers and visibility settings from another view.

Parameters
aOtherViewview from which settings will be copied.

Definition at line 512 of file view.cpp.

513 {
514  wxASSERT_MSG( false, wxT( "This is not implemented" ) );
515 }
std::unique_ptr< VIEW > KIGFX::VIEW::DataReference ( ) const
inherited

Returns 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 1474 of file view.cpp.

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

Referenced by BOARD_PRINTOUT::DrawPage(), and KIGFX::VIEW::ReverseDrawOrder().

1475 {
1476  auto ret = std::make_unique<VIEW>();
1477  ret->m_allItems = m_allItems;
1478  ret->m_layers = m_layers;
1479  ret->sortLayers();
1480  return ret;
1481 }
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
Flat list of all items.
Definition: view.h:826
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void KIGFX::SCH_VIEW::DisplayComponent ( LIB_PART aPart)

Definition at line 116 of file sch_view.cpp.

References KIGFX::VIEW::Add(), KIGFX::VIEW::Clear(), LIB_PART::GetDrawItems(), m_preview, and m_selectionArea.

117 {
118  Clear();
119 
120  if( !aPart )
121  return;
122 
123  for( auto& item : aPart->GetDrawItems() )
124  Add( &item );
125 
127  m_preview.reset( new KIGFX::VIEW_GROUP() );
128  Add( m_selectionArea.get() );
129  Add( m_preview.get() );
130 }
std::unique_ptr< KIGFX::PREVIEW::SELECTION_AREA > m_selectionArea
Definition: sch_view.h:109
void Clear()
Function Clear() Removes all items from the view.
Definition: view.cpp:1109
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
Class SELECTION_AREA.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:345
std::unique_ptr< KIGFX::VIEW_GROUP > m_preview
Definition: sch_view.h:110
void KIGFX::SCH_VIEW::DisplaySheet ( SCH_SHEET aSheet)

Definition at line 110 of file sch_view.cpp.

References SCH_SHEET::GetScreen().

111 {
112  DisplaySheet( aSheet->GetScreen() );
113 }
void DisplaySheet(SCH_SHEET *aSheet)
Definition: sch_view.cpp:110
SCH_SCREEN * GetScreen()
Definition: sch_sheet.h:279
void KIGFX::SCH_VIEW::DisplaySheet ( SCH_SCREEN aScreen)

Definition at line 83 of file sch_view.cpp.

References KIGFX::VIEW::Add(), FRAME_SCH, SCH_SCREEN::GetDrawItems(), SCH_SCREEN::GetFileName(), SCH_SCREEN::GetPageSettings(), EDA_DRAW_FRAME::GetScreenDesc(), SCH_SCREEN::GetTitleBlock(), EDA_BASE_FRAME::IsType(), m_frame, BASE_SCREEN::m_NumberOfScreens, m_preview, BASE_SCREEN::m_ScreenNumber, m_selectionArea, m_worksheet, SCH_ITEM::Next(), ResizeSheetWorkingArea(), and TO_UTF8.

84 {
85  for( auto item = aScreen->GetDrawItems(); item; item = item->Next() )
86  Add( item );
87 
88  m_worksheet.reset( new KIGFX::WORKSHEET_VIEWITEM( 1, &aScreen->GetPageSettings(),
89  &aScreen->GetTitleBlock() ) );
90  m_worksheet->SetSheetNumber( aScreen->m_ScreenNumber );
91  m_worksheet->SetSheetCount( aScreen->m_NumberOfScreens );
92  m_worksheet->SetFileName( TO_UTF8( aScreen->GetFileName() ) );
93 
94  if( m_frame && m_frame->IsType( FRAME_SCH ) )
95  m_worksheet->SetSheetName( TO_UTF8( m_frame->GetScreenDesc() ) );
96  else
97  m_worksheet->SetSheetName( "" );
98 
99  ResizeSheetWorkingArea( aScreen );
100 
102  m_preview.reset( new KIGFX::VIEW_GROUP() );
103 
104  Add( m_worksheet.get() );
105  Add( m_selectionArea.get() );
106  Add( m_preview.get() );
107 }
int m_ScreenNumber
Definition: base_screen.h:216
void ResizeSheetWorkingArea(SCH_SCREEN *aScreen)
Definition: sch_view.cpp:71
const wxString & GetFileName() const
Definition: sch_screen.h:131
std::unique_ptr< KIGFX::PREVIEW::SELECTION_AREA > m_selectionArea
Definition: sch_view.h:109
SCH_ITEM * Next() const
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes...
Definition: macros.h:47
virtual wxString GetScreenDesc() const
const TITLE_BLOCK & GetTitleBlock() const
Definition: sch_screen.h:136
SCH_ITEM * GetDrawItems() const
Definition: sch_screen.h:160
std::unique_ptr< WORKSHEET_VIEWITEM > m_worksheet
Definition: sch_view.h:108
SCH_BASE_FRAME * m_frame
Definition: sch_view.h:106
int m_NumberOfScreens
Definition: base_screen.h:217
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:126
Class SELECTION_AREA.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:345
bool IsType(FRAME_T aType) const
std::unique_ptr< KIGFX::VIEW_GROUP > m_preview
Definition: sch_view.h:110
void KIGFX::VIEW::draw ( VIEW_ITEM aItem,
int  aLayer,
bool  aImmediate = false 
)
protectedinherited

Function draw() Draws 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 1027 of file view.cpp.

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::draw(), and KIGFX::VIEW::markTargetClean().

1028 {
1029  auto viewData = aItem->viewPrivData();
1030 
1031  if( !viewData )
1032  return;
1033 
1034  if( IsCached( aLayer ) && !aImmediate )
1035  {
1036  // Draw using cached information or create one
1037  int group = viewData->getGroup( aLayer );
1038 
1039  if( group >= 0 )
1040  m_gal->DrawGroup( group );
1041  else
1042  Update( aItem );
1043  }
1044  else
1045  {
1046  // Immediate mode
1047  if( !m_painter->Draw( aItem, aLayer ) )
1048  aItem->ViewDraw( aLayer, this ); // Alternative drawing method
1049  }
1050 }
virtual void DrawGroup(int aGroupNumber)
Draw the stored group.
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
PAINTER * m_painter
PAINTER contains information how do draw items.
Definition: view.h:856
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1538
virtual bool Draw(const VIEW_ITEM *aItem, int aLayer)=0
Function Draw Takes an instance of VIEW_ITEM and passes it to a function that know how to draw the it...
bool IsCached(int aLayer) const
Returns true if the layer is cached.
Definition: view.h:603
void KIGFX::VIEW::draw ( VIEW_ITEM aItem,
bool  aImmediate = false 
)
protectedinherited

Function draw() Draws 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 1053 of file view.cpp.

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

1054 {
1055  int layers[VIEW_MAX_LAYERS], layers_count;
1056 
1057  aItem->ViewGetLayers( layers, layers_count );
1058 
1059  // Sorting is needed for drawing order dependent GALs (like Cairo)
1060  SortLayers( layers, layers_count );
1061 
1062  for( int i = 0; i < layers_count; ++i )
1063  {
1064  m_gal->SetLayerDepth( m_layers.at( layers[i] ).renderingOrder );
1065  draw( aItem, layers[i], aImmediate );
1066  }
1067 }
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
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:712
void SortLayers(int aLayers[], int &aCount) const
Function SortLayers() Changes the order of given layer ids, so after sorting the order corresponds to...
Definition: view.cpp:676
size_t i
Definition: json11.cpp:597
void draw(VIEW_ITEM *aItem, int aLayer, bool aImmediate=false)
Function draw() Draws an item, but on a specified layers.
Definition: view.cpp:1027
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void KIGFX::VIEW::draw ( VIEW_GROUP aGroup,
bool  aImmediate = false 
)
protectedinherited

Function draw() Draws 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.

Definition at line 1070 of file view.cpp.

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

1071 {
1072  for( unsigned int i = 0; i < aGroup->GetSize(); i++)
1073  draw( aGroup->GetItem(i), aImmediate );
1074 }
size_t i
Definition: json11.cpp:597
void draw(VIEW_ITEM *aItem, int aLayer, bool aImmediate=false)
Function draw() Draws an item, but on a specified layers.
Definition: view.cpp:1027
void KIGFX::VIEW::EnableTopLayer ( bool  aEnable)
virtualinherited

Function EnableTopLayer() Enables or disables 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 885 of file view.cpp.

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 KIGFX::VIEW::SetLayerTarget().

886 {
887  if( aEnable == m_enableOrderModifier )
888  return;
889 
890  m_enableOrderModifier = aEnable;
891 
892  std::set<unsigned int>::iterator it;
893 
894  if( aEnable )
895  {
896  for( it = m_topLayers.begin(); it != m_topLayers.end(); ++it )
897  m_layers[*it].renderingOrder += TOP_LAYER_MODIFIER;
898  }
899  else
900  {
901  for( it = m_topLayers.begin(); it != m_topLayers.end(); ++it )
902  m_layers[*it].renderingOrder -= TOP_LAYER_MODIFIER;
903  }
904 
907 }
static const int TOP_LAYER_MODIFIER
Rendering order modifier for layers that are marked as top layers.
Definition: view.h:869
std::set< unsigned int > m_topLayers
Stores set of layers that are displayed on the top.
Definition: view.h:832
void UpdateAllLayersOrder()
Function UpdateLayerOrder() Does everything that is needed to apply the rendering order of layers...
Definition: view.cpp:925
bool m_enableOrderModifier
Definition: view.h:820
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void UpdateAllLayersColor()
Function UpdateAllLayersColor() Applies the new coloring scheme to all layers.
Definition: view.cpp:796
const BOX2D& KIGFX::VIEW::GetBoundary ( ) const
inlineinherited

Function GetBoundary()

Returns
Current view area boundary.

Definition at line 298 of file view.h.

References KIGFX::VIEW::m_boundary.

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

299  {
300  return m_boundary;
301  }
BOX2D m_boundary
View boundaries.
Definition: view.h:841
const VECTOR2D& KIGFX::VIEW::GetCenter ( ) const
inlineinherited
GAL* KIGFX::VIEW::GetGAL ( ) const
inlineinherited

Function GetGAL() Returns the GAL this view is using to draw graphical primitives.

Returns
Pointer to the currently used GAL instance.

Definition at line 180 of file view.h.

References KIGFX::VIEW::m_gal.

Referenced by KIGFX::WX_VIEW_CONTROLS::CenterOnCursor(), DIALOG_SET_GRID::DIALOG_SET_GRID(), PCBNEW_CONTROL::DoSetGridOrigin(), drawArcWithHilight(), drawLineWithHilight(), 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_POLYLINE::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_POLY_POLYLINE::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_POINT_POLYLINE::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::WX_VIEW_CONTROLS::GetRawCursorPosition(), DIALOG_PAD_PROPERTIES::prepareCanvas(), KIGFX::WX_VIEW_CONTROLS::SetCrossHairCursorPosition(), EDA_DRAW_FRAME::SetPresetGrid(), KIGFX::VIEW_CONTROLS::ShowCursor(), COMMON_TOOLS::updateGrid(), PCBNEW_CONTROL::updateGrid(), PCB_BRIGHT_BOX::ViewDraw(), KIGFX::PREVIEW::ARC_ASSISTANT::ViewDraw(), KIGFX::RATSNEST_VIEWITEM::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), BRIGHT_BOX::ViewDraw(), KIGFX::ORIGIN_VIEWITEM::ViewDraw(), KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::ViewDraw(), KIGFX::PREVIEW::SELECTION_AREA::ViewDraw(), KIGFX::VIEW_GROUP::ViewDraw(), ROUTER_PREVIEW_ITEM::ViewDraw(), KIGFX::WORKSHEET_VIEWITEM::ViewDraw(), EDIT_POINTS::ViewDraw(), and KIGFX::WX_VIEW_CONTROLS::WarpCursor().

181  {
182  return m_gal;
183  }
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
int KIGFX::VIEW::GetLayerOrder ( int  aLayer) const
inherited

Function GetLayerOrder() Returns rendering order of a particular layer.

Lower values are rendered first.

Parameters
aLayerthe layer
Returns
Rendering order of a particular layer.

Definition at line 670 of file view.cpp.

References KIGFX::VIEW::m_layers.

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

671 {
672  return m_layers.at( aLayer ).renderingOrder;
673 }
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
PAINTER* KIGFX::VIEW::GetPainter ( ) const
inlineinherited

Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.

Returns
Pointer to the currently used Painter instance.

Definition at line 199 of file view.h.

References KIGFX::VIEW::GetViewport(), KIGFX::VIEW::m_painter, KIGFX::VIEW::SetMirror(), and KIGFX::VIEW::SetViewport().

Referenced by FOOTPRINT_VIEWER_FRAME::ApplyDisplaySettingsToGAL(), DISPLAY_FOOTPRINTS_FRAME::ApplyDisplaySettingsToGAL(), PCB_EDITOR_CONTROL::ClearHighlight(), SYMBOL_PREVIEW_WIDGET::DisplayPart(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), drawArcWithHilight(), drawLineWithHilight(), BOARD_PRINTOUT::DrawPage(), KIGFX::PREVIEW::POLYGON_ITEM::drawPreviewShape(), KIGFX::PREVIEW::DrawTextNextToCursor(), drawTicksAlongLine(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL(), ROUTER_PREVIEW_ITEM::getLayerColor(), SCH_BASE_FRAME::GetRenderSettings(), GERBVIEW_CONTROL::HighlightControl(), PNS::TOOL_BASE::highlightNet(), PCB_EDITOR_CONTROL::HighlightNet(), highlightNet(), PCBNEW_CONTROL::LayerAlphaDec(), PCBNEW_CONTROL::LayerAlphaInc(), SCH_EDIT_FRAME::LoadSettings(), LIB_EDIT_FRAME::LoadSettings(), FOOTPRINT_PREVIEW_PANEL::New(), DIALOG_PAD_PROPERTIES::onChangePadMode(), ZONE_CREATE_HELPER::OnFirstPoint(), PCB_LAYER_WIDGET::OnLayerColorChange(), GERBER_LAYER_WIDGET::OnLayerColorChange(), PCB_LAYER_WIDGET::OnRenderColorChange(), GERBER_LAYER_WIDGET::OnRenderColorChange(), GERBVIEW_FRAME::OnSelectHighlightChoice(), SCH_EDIT_FRAME::OnSelectOptionToolbar(), GERBVIEW_DRAW_PANEL_GAL::OnShow(), PCB_DRAW_PANEL_GAL::OnShow(), DIALOG_PAD_PROPERTIES::prepareCanvas(), GRID_HELPER::queryVisible(), DIALOG_PAD_PROPERTIES::redraw(), GERBVIEW_SELECTION_TOOL::Reset(), SELECTION_TOOL::Reset(), GERBVIEW_SELECTION_TOOL::selectable(), SELECTION_TOOL::selectable(), GERBVIEW_DRAW_PANEL_GAL::SetHighContrastLayer(), PCB_DRAW_PANEL_GAL::SetHighContrastLayer(), EDA_DRAW_PANEL_GAL::SetHighContrastLayer(), PCB_LAYER_WIDGET::SyncLayerAlphaIndicators(), PANEL_PCBNEW_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_PCBNEW_SETTINGS::TransferDataFromWindow(), KIGFX::PCB_VIEW::UpdateDisplayOptions(), GERBVIEW_DRAW_PANEL_GAL::UseColorScheme(), PCB_DRAW_PANEL_GAL::UseColorScheme(), PCB_BASE_FRAME::UseGalCanvas(), KIGFX::PREVIEW::ARC_ASSISTANT::ViewDraw(), KIGFX::RATSNEST_VIEWITEM::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), KIGFX::PREVIEW::SELECTION_AREA::ViewDraw(), KIGFX::VIEW_GROUP::ViewDraw(), and KIGFX::WORKSHEET_VIEWITEM::ViewDraw().

200  {
201  return m_painter;
202  }
PAINTER * m_painter
PAINTER contains information how do draw items.
Definition: view.h:856
KIGFX::VIEW_GROUP* KIGFX::SCH_VIEW::GetPreview ( ) const
inline

Definition at line 88 of file sch_view.h.

Referenced by DrawMovingBlockOutlines().

88 { return m_preview.get(); }
std::unique_ptr< KIGFX::VIEW_GROUP > m_preview
Definition: sch_view.h:110
int KIGFX::VIEW::GetPrintMode ( )
inlineinherited
Returns
the printing mode. if return <= 0, the current mode is not a printing mode, just the draw mode

Definition at line 703 of file view.h.

References KIGFX::VIEW::m_printMode.

Referenced by D_PAD::ViewGetLOD().

703 { return m_printMode; }
int m_printMode
A control for printing: m_printMode <= 0 means no printing mode (normal draw mode m_printMode > 0 is ...
Definition: view.h:883
double KIGFX::VIEW::GetScale ( ) const
inlineinherited

Function GetScale()

Returns
Current scale factor of this VIEW.

Definition at line 268 of file view.h.

References KIGFX::VIEW::m_scale.

Referenced by KIGFX::WX_VIEW_CONTROLS::onWheel(), DIALOG_PAD_PROPERTIES::redraw(), KIGFX::VIEW::SetViewport(), SCH_BASE_FRAME::Window_Zoom(), SCH_BASE_FRAME::Zoom_Automatique(), COMMON_TOOLS::ZoomFitScreen(), and SELECTION_TOOL::zoomFitSelection().

269  {
270  return m_scale;
271  }
double m_scale
Scale of displayed VIEW_ITEMs.
Definition: view.h:838
const VECTOR2I & KIGFX::VIEW::GetScreenPixelSize ( ) const
inherited

Function GetScreenPixelSize() Returns the size of the our rendering area, in pixels.

Returns
viewport screen size

Definition at line 1175 of file view.cpp.

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

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

1176 {
1177  return m_gal->GetScreenPixelSize();
1178 }
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
const VECTOR2I & GetScreenPixelSize() const
Returns GAL canvas size in pixels.
KIGFX::PREVIEW::SELECTION_AREA* KIGFX::SCH_VIEW::GetSelectionArea ( ) const
inline

Definition at line 86 of file sch_view.h.

Referenced by DrawAndSizingBlockOutlines(), and LIB_EDIT_FRAME::HandleBlockEnd().

86 { return m_selectionArea.get(); }
std::unique_ptr< KIGFX::PREVIEW::SELECTION_AREA > m_selectionArea
Definition: sch_view.h:109
int KIGFX::VIEW::GetTopLayer ( ) const
virtualinherited

Definition at line 849 of file view.cpp.

References KIGFX::VIEW::m_topLayers.

Referenced by ROUTER_TOOL::getStartLayer(), SELECTION_TOOL::guessSelectionCandidates(), PNS::TOOL_BASE::pickSingleItem(), KIGFX::VIEW::SetLayerTarget(), and PNS::TOOL_BASE::updateStartItem().

850 {
851  if( m_topLayers.size() == 0 )
852  return 0;
853 
854  return *m_topLayers.begin();
855 }
std::set< unsigned int > m_topLayers
Stores set of layers that are displayed on the top.
Definition: view.h:832
BOX2D KIGFX::VIEW::GetViewport ( ) const
inherited

Function GetViewport() Returns the current viewport visible area rectangle.

Returns
Current viewport rectangle

Definition at line 537 of file view.cpp.

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

Referenced by KIGFX::VIEW::GetPainter(), SELECTION_TOOL::guessSelectionCandidates(), and KIGFX::WX_VIEW_CONTROLS::UpdateScrollbars().

538 {
539  BOX2D rect;
540  VECTOR2D screenSize = m_gal->GetScreenPixelSize();
541 
542  rect.SetOrigin( ToWorld( VECTOR2D( 0, 0 ) ) );
543  rect.SetEnd( ToWorld( screenSize ) );
544 
545  return rect.Normalize();
546 }
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Function ToWorld() Converts a screen space point/vector to a point/vector in world space coordinates...
Definition: view.cpp:474
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
VECTOR2< double > VECTOR2D
Definition: vector2d.h:586
BOX2< Vec > & Normalize()
Function Normalize ensures that the height ant width are positive.
Definition: box2.h:127
void SetEnd(coord_type x, coord_type y)
Definition: box2.h:223
const VECTOR2I & GetScreenPixelSize() const
Returns GAL canvas size in pixels.
void SetOrigin(const Vec &pos)
Definition: box2.h:208
void KIGFX::VIEW::Hide ( VIEW_ITEM aItem,
bool  aHide = true 
)
inherited

Temporarily hides 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 1505 of file view.cpp.

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

Referenced by AddToPreview(), ClearHiddenFlags(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), DrawMovePin(), DrawMovingBlockOutlines(), SELECTION_TOOL::highlight(), resizeSheetWithMouseCursor(), GERBVIEW_SELECTION_TOOL::selectVisually(), LIB_EDIT_FRAME::StartMoveDrawSymbol(), SELECTION_TOOL::unhighlight(), and GERBVIEW_SELECTION_TOOL::unselectVisually().

1506 {
1507  auto viewData = aItem->viewPrivData();
1508 
1509  if( !viewData )
1510  return;
1511 
1512  if( !( viewData->m_flags & VISIBLE ) )
1513  return;
1514 
1515  if( aHide )
1516  viewData->m_flags |= HIDDEN;
1517  else
1518  viewData->m_flags &= ~HIDDEN;
1519 
1520  Update( aItem, APPEARANCE );
1521 }
Item is visible (in general)
Definition: view_item.h:70
No updates are required.
Definition: view_item.h:55
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1538
void KIGFX::SCH_VIEW::HideWorksheet ( )

Definition at line 186 of file sch_view.cpp.

Referenced by LIB_EDIT_FRAME::RebuildView().

187 {
188  // SetVisible( m_worksheet.get(), false );
189 }
void KIGFX::SCH_VIEW::HighlightItem ( EDA_ITEM aItem,
LIB_PIN aPin = nullptr 
)

Definition at line 191 of file sch_view.cpp.

References KIGFX::ALL, EDA_ITEM::ClearFlags(), HIGHLIGHTED, KIGFX::VIEW::m_allItems, SCH_COMPONENT_T, EDA_ITEM::SetFlags(), EDA_ITEM::Type(), and KIGFX::VIEW::UpdateAllItems().

Referenced by SCH_EDIT_FRAME::ExecuteRemoteCommand(), SCH_EDIT_FRAME::FindComponentAndItem(), SCH_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnRightClick(), DIALOG_FIELDS_EDITOR_GLOBAL::OnTableCellClick(), and DIALOG_FIELDS_EDITOR_GLOBAL::~DIALOG_FIELDS_EDITOR_GLOBAL().

192 {
193  if( !aItem )
194  {
195  for( auto item : *m_allItems )
196  {
197  // Not all view items can be highlighted, only EDA_ITEMs
198  // So clear flag of only EDA_ITEMs.
199  auto eitem = dynamic_cast<EDA_ITEM *>( item );
200 
201  if( eitem )
202  {
203  eitem->ClearFlags( HIGHLIGHTED );
204 
205  if( eitem->Type() == SCH_COMPONENT_T )
206  {
207  // Items inside a component (pins, fields can be highlighted.
208  static_cast<SCH_COMPONENT*>( eitem )->ClearAllHighlightFlags();
209  }
210  }
211  }
212  }
213  else
214  {
215  if( ( aItem->Type() == SCH_COMPONENT_T ) && aPin )
216  {
217  static_cast<SCH_COMPONENT*>( aItem )->HighlightPin( aPin );
218  }
219  else
220  aItem->SetFlags( HIGHLIGHTED );
221  }
222 
223  // ugly but I guess OK for the moment...
224  UpdateAllItems( ALL );
225 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
void UpdateAllItems(int aUpdateFlags)
Updates all items in the view according to the given flags.
Definition: view.cpp:1442
Item needs to be redrawn.
Definition: view_item.h:61
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
Flat list of all items.
Definition: view.h:826
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:256
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:137
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:70
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:257
void KIGFX::VIEW::invalidateItem ( VIEW_ITEM aItem,
int  aUpdateFlags 
)
protectedinherited

Function invalidateItem() Manages dirty flags & redraw queueing when updating an item.

Parameters
aItemis the item to be updated.
aUpdateFlagsdetermines the way an item is refreshed.

Definition at line 1214 of file view.cpp.

References KIGFX::ALL, KIGFX::VIEW_ITEM_DATA::clearUpdateFlags(), KIGFX::COLOR, KIGFX::GEOMETRY, i, 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::markTargetClean(), and KIGFX::VIEW::UpdateItems().

1215 {
1216  if( aUpdateFlags & INITIAL_ADD )
1217  {
1218  // Don't update layers or bbox, since it was done in VIEW::Add()
1219  // Now that we have initialized, set flags to ALL for the code below
1220  aUpdateFlags = ALL;
1221  }
1222  else
1223  {
1224  // updateLayers updates geometry too, so we do not have to update both of them at the same time
1225  if( aUpdateFlags & LAYERS )
1226  {
1227  updateLayers( aItem );
1228  }
1229  else if( aUpdateFlags & GEOMETRY )
1230  {
1231  updateBbox( aItem );
1232  }
1233  }
1234 
1235  int layers[VIEW_MAX_LAYERS], layers_count;
1236  aItem->ViewGetLayers( layers, layers_count );
1237 
1238  // Iterate through layers used by the item and recache it immediately
1239  for( int i = 0; i < layers_count; ++i )
1240  {
1241  int layerId = layers[i];
1242 
1243  if( IsCached( layerId ) )
1244  {
1245  if( aUpdateFlags & ( GEOMETRY | LAYERS | REPAINT ) )
1246  updateItemGeometry( aItem, layerId );
1247  else if( aUpdateFlags & COLOR )
1248  updateItemColor( aItem, layerId );
1249  }
1250 
1251  // Mark those layers as dirty, so the VIEW will be refreshed
1252  MarkTargetDirty( m_layers[layerId].target );
1253  }
1254 
1255  aItem->viewPrivData()->clearUpdateFlags();
1256 }
Layers have changed.
Definition: view_item.h:59
void updateLayers(VIEW_ITEM *aItem)
Updates set of layers that an item occupies.
Definition: view.cpp:1339
void updateItemColor(VIEW_ITEM *aItem, int aLayer)
Updates colors that are used for an item to be drawn.
Definition: view.cpp:1274
Visibility flag has changed.
Definition: view_item.h:56
Item needs to be redrawn.
Definition: view_item.h:61
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:712
Item is being added to the view.
Definition: view_item.h:60
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target &#39;dirty&#39; flag.
Definition: view.h:596
void updateBbox(VIEW_ITEM *aItem)
Updates bounding box of an item.
Definition: view.cpp:1323
void updateItemGeometry(VIEW_ITEM *aItem, int aLayer)
Updates all informations needed to draw an item.
Definition: view.cpp:1293
bool IsCached(int aLayer) const
Returns true if the layer is cached.
Definition: view.h:603
size_t i
Definition: json11.cpp:597
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
Position or shape has changed.
Definition: view_item.h:58
Color has changed.
Definition: view_item.h:57
bool KIGFX::VIEW::IsCached ( int  aLayer) const
inlineinherited

Returns true if the layer is cached.

Definition at line 603 of file view.h.

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().

604  {
605  wxCHECK( aLayer < (int) m_layers.size(), false );
606 
607  try
608  {
609  return m_layers.at( aLayer ).target == TARGET_CACHED;
610  }
611  catch( const std::out_of_range& )
612  {
613  return false;
614  }
615  }
Main rendering target (cached)
Definition: definitions.h:41
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
bool KIGFX::VIEW::IsDirty ( ) const
inlineinherited

Function IsDirty() Returns 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 568 of file view.h.

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

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

569  {
570  for( int i = 0; i < TARGETS_NUMBER; ++i )
571  {
572  if( IsTargetDirty( i ) )
573  return true;
574  }
575 
576  return false;
577  }
Number of available rendering targets.
Definition: definitions.h:44
bool IsTargetDirty(int aTarget) const
Function IsTargetDirty() Returns true if any of layers belonging to the target or the target itself s...
Definition: view.h:585
size_t i
Definition: json11.cpp:597
bool KIGFX::VIEW::IsDrawOrderReversed ( ) const
inlineinherited

Function IsDrawOrderReversed()

Returns
true if draw order is reversed

Definition at line 676 of file view.h.

References KIGFX::VIEW::m_reverseDrawOrder.

677  {
678  return m_reverseDrawOrder;
679  }
bool m_reverseDrawOrder
Flag to reverse the draw order when using draw priority.
Definition: view.h:879
bool KIGFX::VIEW::IsDynamic ( ) const
inlineinherited

Function IsDynamic() Tells 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 558 of file view.h.

References KIGFX::VIEW::m_dynamic.

559  {
560  return m_dynamic;
561  }
bool m_dynamic
Dynamic VIEW (eg.
Definition: view.h:863
bool KIGFX::VIEW::IsLayerVisible ( int  aLayer) const
inlineinherited

Function IsLayerVisible() Returns information about visibility of a particular layer.

Parameters
aLayertrue if the layer is visible, false otherwise

Definition at line 427 of file view.h.

References KIGFX::VIEW::m_layers.

Referenced by KIGFX::VIEW_GROUP::ViewDraw(), EDGE_MODULE::ViewGetLOD(), TEXTE_MODULE::ViewGetLOD(), TRACK::ViewGetLOD(), MODULE::ViewGetLOD(), and D_PAD::ViewGetLOD().

428  {
429  wxCHECK( aLayer < (int) m_layers.size(), false );
430  return m_layers.at( aLayer ).visible;
431  }
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
bool KIGFX::VIEW::IsMirroredX ( ) const
inlineinherited

Function IsMirroredX() Returns true if view is flipped across the X axis.

Definition at line 230 of file view.h.

References KIGFX::VIEW::m_mirrorX.

Referenced by COMMON_TOOLS::CursorControl(), KIGFX::WX_VIEW_CONTROLS::onScroll(), SELECTION_TOOL::selectMultiple(), KIGFX::WX_VIEW_CONTROLS::UpdateScrollbars(), and KIGFX::PREVIEW::SELECTION_AREA::ViewDraw().

231  {
232  return m_mirrorX;
233  }
bool m_mirrorX
Horizontal flip flag
Definition: view.h:850
bool KIGFX::VIEW::IsMirroredY ( ) const
inlineinherited

Function IsMirroredX() Returns true if view is flipped across the Y axis.

Definition at line 239 of file view.h.

References KIGFX::VIEW::m_mirrorY.

240  {
241  return m_mirrorY;
242  }
bool m_mirrorY
Vertical flip flag
Definition: view.h:853
bool KIGFX::VIEW::IsTargetDirty ( int  aTarget) const
inlineinherited

Function IsTargetDirty() Returns 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 585 of file view.h.

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

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

586  {
587  wxCHECK( aTarget < TARGETS_NUMBER, false );
588  return m_dirtyTargets[aTarget];
589  }
Number of available rendering targets.
Definition: definitions.h:44
bool m_dirtyTargets[TARGETS_NUMBER]
Flags to mark targets as dirty, so they have to be redrawn on the next refresh event.
Definition: view.h:866
bool KIGFX::VIEW::IsUsingDrawPriority ( ) const
inlineinherited

Function IsUsingDrawPriority()

Returns
true if draw priority is being respected while redrawing.

Definition at line 658 of file view.h.

References KIGFX::VIEW::m_useDrawPriority.

659  {
660  return m_useDrawPriority;
661  }
bool m_useDrawPriority
Flat list of all items Flag to respect draw priority when drawing items.
Definition: view.h:873
bool KIGFX::VIEW::IsVisible ( const VIEW_ITEM aItem) const
inherited

Returns 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 1524 of file view.cpp.

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

Referenced by GRID_HELPER::BestSnapAnchor(), and SELECTION_TOOL::selectable().

1525 {
1526  const auto viewData = aItem->viewPrivData();
1527 
1528  return viewData->m_flags & VISIBLE;
1529 }
std::shared_ptr< VIEW_OVERLAY > KIGFX::VIEW::MakeOverlay ( )
inherited

Definition at line 1552 of file view.cpp.

References KIGFX::VIEW::Add(), KIGFX::VIEW::TOP_LAYER_MODIFIER, and KIGFX::VIEW::VIEW_MAX_LAYERS.

Referenced by AUTOPLACE_TOOL::autoplace(), and KIGFX::VIEW::ReverseDrawOrder().

1553 {
1554  std::shared_ptr<VIEW_OVERLAY> overlay( new VIEW_OVERLAY );
1555 
1556  Add( overlay.get() );
1557  return overlay;
1558 }
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:345
void KIGFX::VIEW::MarkForUpdate ( VIEW_ITEM aItem)
inherited

Function MarkForUpdate() Adds 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.

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

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

Definition at line 745 of file view.h.

References KIGFX::VIEW::clearGroupCache(), KIGFX::VIEW::draw(), KIGFX::VIEW::invalidateItem(), KIGFX::VIEW::m_dirtyTargets, KIGFX::VIEW::sortLayers(), KIGFX::TARGETS_NUMBER, KIGFX::VIEW::updateBbox(), KIGFX::VIEW::updateItemColor(), KIGFX::VIEW::updateItemGeometry(), and KIGFX::VIEW::updateLayers().

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

746  {
747  wxCHECK( aTarget < TARGETS_NUMBER, /* void */ );
748  m_dirtyTargets[aTarget] = false;
749  }
Number of available rendering targets.
Definition: definitions.h:44
bool m_dirtyTargets[TARGETS_NUMBER]
Flags to mark targets as dirty, so they have to be redrawn on the next refresh event.
Definition: view.h:866
void KIGFX::VIEW::OnDestroy ( VIEW_ITEM aItem)
staticinherited

Definition at line 271 of file view.cpp.

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

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

272 {
273  auto data = aItem->viewPrivData();
274 
275  if( !data )
276  return;
277 
278  if( data->m_view )
279  data->m_view->VIEW::Remove( aItem );
280 
281  delete data;
282 }
int KIGFX::VIEW::Query ( const BOX2I aRect,
std::vector< LAYER_ITEM_PAIR > &  aResult 
) const
virtualinherited

Function Query() Finds 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 451 of file view.cpp.

References i, and KIGFX::VIEW::m_orderedLayers.

Referenced by GERBVIEW_SELECTION_TOOL::selectMultiple(), and SELECTION_TOOL::selectMultiple().

452 {
453  if( m_orderedLayers.empty() )
454  return 0;
455 
456  std::vector<VIEW_LAYER*>::const_reverse_iterator i;
457 
458  // execute queries in reverse direction, so that items that are on the top of
459  // the rendering stack are returned first.
460  for( i = m_orderedLayers.rbegin(); i != m_orderedLayers.rend(); ++i )
461  {
462  // ignore layers that do not contain actual items (i.e. the selection box, menus, floats)
463  if( ( *i )->displayOnly || !( *i )->visible )
464  continue;
465 
466  queryVisitor<std::vector<LAYER_ITEM_PAIR> > visitor( aResult, ( *i )->id );
467  ( *i )->items->Query( aRect, visitor );
468  }
469 
470  return aResult.size();
471 }
LAYER_ORDER m_orderedLayers
Sorted list of pointers to members of m_layers.
Definition: view.h:829
size_t i
Definition: json11.cpp:597
void KIGFX::VIEW::RecacheAllItems ( )
inherited

Function RecacheAllItems() Rebuilds GAL display lists.

Definition at line 1400 of file view.cpp.

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

Referenced by GERBVIEW_DRAW_PANEL_GAL::OnShow(), KIGFX::VIEW::SetLayerTarget(), PANEL_PCBNEW_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_LIBEDIT_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_MODEDIT_DISPLAY_OPTIONS::TransferDataFromWindow(), PCB_BASE_FRAME::UseGalCanvas(), and GERBVIEW_FRAME::UseGalCanvas().

1401 {
1402  BOX2I r;
1403 
1404  r.SetMaximum();
1405 
1406  for( LAYER_MAP_ITER i = m_layers.begin(); i != m_layers.end(); ++i )
1407  {
1408  VIEW_LAYER* l = &( ( *i ).second );
1409 
1410  if( IsCached( l->id ) )
1411  {
1412  recacheItem visitor( this, m_gal, l->id );
1413  l->items->Query( r, visitor );
1414  }
1415  }
1416 }
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
void SetMaximum()
Definition: box2.h:71
LAYER_MAP::iterator LAYER_MAP_ITER
Definition: view.h:728
bool IsCached(int aLayer) const
Returns true if the layer is cached.
Definition: view.h:603
size_t i
Definition: json11.cpp:597
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void KIGFX::VIEW::Redraw ( )
virtualinherited

Function Redraw() Immediately redraws the whole view.

Definition at line 1143 of file view.cpp.

References BOX2< Vec >::GetHeight(), BOX2< Vec >::GetPosition(), KIGFX::GAL::GetScreenPixelSize(), BOX2< Vec >::GetSize(), BOX2< Vec >::GetWidth(), KIGFX::VIEW::m_gal, KIGFX::VIEW::markTargetClean(), max, 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::onPaint(), and KIGFX::VIEW::SetLayerTarget().

1144 {
1145 #ifdef __WXDEBUG__
1146  PROF_COUNTER totalRealTime;
1147 #endif /* __WXDEBUG__ */
1148 
1149  VECTOR2D screenSize = m_gal->GetScreenPixelSize();
1150  BOX2D rect( ToWorld( VECTOR2D( 0, 0 ) ),
1151  ToWorld( screenSize ) - ToWorld( VECTOR2D( 0, 0 ) ) );
1152 
1153  rect.Normalize();
1154  BOX2I recti( rect.GetPosition(), rect.GetSize() );
1155 
1156  // The view rtree uses integer positions. Large screens can overflow
1157  // this size so in this case, simply set the rectangle to the full rtree
1158  if( rect.GetWidth() > std::numeric_limits<int>::max() ||
1159  rect.GetHeight() > std::numeric_limits<int>::max() )
1160  recti.SetMaximum();
1161 
1162  redrawRect( recti );
1163  // All targets were redrawn, so nothing is dirty
1167 
1168 #ifdef __WXDEBUG__
1169  totalRealTime.Stop();
1170  wxLogTrace( "GAL_PROFILE", "VIEW::Redraw(): %.1f ms", totalRealTime.msecs() );
1171 #endif /* __WXDEBUG__ */
1172 }
void Stop()
save the time when this function was called, and set the counter stane to stop
Definition: profile.h:82
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Function ToWorld() Converts a screen space point/vector to a point/vector in world space coordinates...
Definition: view.cpp:474
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
The class PROF_COUNTER is a small class to help profiling.
Definition: profile.h:45
Auxiliary rendering target (noncached)
Definition: definitions.h:42
VECTOR2< double > VECTOR2D
Definition: vector2d.h:586
void SetMaximum()
Definition: box2.h:71
Items that may change while the view stays the same (noncached)
Definition: definitions.h:43
void markTargetClean(int aTarget)
Definition: view.h:745
const VECTOR2I & GetScreenPixelSize() const
Returns GAL canvas size in pixels.
double msecs() const
Definition: profile.h:124
void redrawRect(const BOX2I &aRect)
Definition: view.cpp:1008
Main rendering target (cached)
Definition: definitions.h:41
#define max(a, b)
Definition: auxiliary.h:86
void KIGFX::VIEW::redrawRect ( const BOX2I aRect)
protectedinherited
  • Redraws contents within rect aRect

Definition at line 1008 of file view.cpp.

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().

1009 {
1010  for( VIEW_LAYER* l : m_orderedLayers )
1011  {
1012  if( l->visible && IsTargetDirty( l->target ) && areRequiredLayersEnabled( l->id ) )
1013  {
1014  drawItem drawFunc( this, l->id, m_useDrawPriority, m_reverseDrawOrder );
1015 
1016  m_gal->SetTarget( l->target );
1017  m_gal->SetLayerDepth( l->renderingOrder );
1018  l->items->Query( aRect, drawFunc );
1019 
1020  if( m_useDrawPriority )
1021  drawFunc.deferredDraw();
1022  }
1023  }
1024 }
bool m_useDrawPriority
Flat list of all items Flag to respect draw priority when drawing items.
Definition: view.h:873
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
virtual void SetLayerDepth(double aLayerDepth)
Set the depth of the layer (position on the z-axis)
bool IsTargetDirty(int aTarget) const
Function IsTargetDirty() Returns true if any of layers belonging to the target or the target itself s...
Definition: view.h:585
LAYER_ORDER m_orderedLayers
Sorted list of pointers to members of m_layers.
Definition: view.h:829
bool m_reverseDrawOrder
Flag to reverse the draw order when using draw priority.
Definition: view.h:879
bool areRequiredLayersEnabled(int aLayerId) const
Checks if every layer required by the aLayerId layer is enabled.
Definition: view.cpp:1382
virtual void SetTarget(RENDER_TARGET aTarget)
Sets the target for rendering.
void KIGFX::VIEW::Remove ( VIEW_ITEM aItem)
virtualinherited

Function Remove() Removes 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 375 of file view.cpp.

References KIGFX::GAL::DeleteGroup(), i, 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 GERBVIEW_SELECTION_TOOL::disambiguationMenu(), SYMBOL_PREVIEW_WIDGET::DisplayPart(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), SELECTION_TOOL::doSelectionMenu(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), POINT_EDITOR::OnSelectionChange(), DRAWING_TOOL::PlaceImportedGraphics(), BOARD_COMMIT::Push(), SCH_EDIT_FRAME::PutDataInPreviousState(), PCB_EDIT_FRAME::ReadPcbNetlist(), KIGFX::PCB_VIEW::Remove(), EDIT_TOOL::Remove(), SCH_BASE_FRAME::RemoveFromScreen(), PCB_EDITOR_CONTROL::Reset(), PCBNEW_CONTROL::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), BOARD_COMMIT::Revert(), SCH_EDIT_FRAME::SaveWireImage(), GERBVIEW_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), GERBVIEW_SELECTION_TOOL::unselect(), POINT_EDITOR::updatePoints(), LIB_VIEW_FRAME::updatePreviewSymbol(), CVPCB_SELECTION_TOOL::~CVPCB_SELECTION_TOOL(), GERBVIEW_SELECTION_TOOL::~GERBVIEW_SELECTION_TOOL(), LIB_VIEW_FRAME::~LIB_VIEW_FRAME(), SELECTION_TOOL::~SELECTION_TOOL(), SYMBOL_PREVIEW_WIDGET::~SYMBOL_PREVIEW_WIDGET(), and ZONE_CREATE_HELPER::~ZONE_CREATE_HELPER().

376 {
377  if( !aItem )
378  return;
379 
380  auto viewData = aItem->viewPrivData();
381 
382  if( !viewData )
383  return;
384 
385  wxCHECK( viewData->m_view == this, /*void*/ );
386  auto item = std::find( m_allItems->begin(), m_allItems->end(), aItem );
387 
388  if( item != m_allItems->end() )
389  {
390  m_allItems->erase( item );
391  viewData->clearUpdateFlags();
392  }
393 
394  int layers[VIEW::VIEW_MAX_LAYERS], layers_count;
395  viewData->getLayers( layers, layers_count );
396 
397  for( int i = 0; i < layers_count; ++i )
398  {
399  VIEW_LAYER& l = m_layers[layers[i]];
400  l.items->Remove( aItem );
401  MarkTargetDirty( l.target );
402 
403  // Clear the GAL cache
404  int prevGroup = viewData->getGroup( layers[i] );
405 
406  if( prevGroup >= 0 )
407  m_gal->DeleteGroup( prevGroup );
408  }
409 
410  viewData->deleteGroups();
411  viewData->m_view = nullptr;
412 }
virtual void DeleteGroup(int aGroupNumber)
Delete the group from the memory.
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:712
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
Flat list of all items.
Definition: view.h:826
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target &#39;dirty&#39; flag.
Definition: view.h:596
size_t i
Definition: json11.cpp:597
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void KIGFX::VIEW::ReorderLayerData ( std::unordered_map< int, int >  aReorderMap)
inherited

Remaps 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 704 of file view.cpp.

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

Referenced by KIGFX::VIEW::SetLayerTarget(), and GERBVIEW_FRAME::SortLayersByX2Attributes().

705 {
706  LAYER_MAP new_map;
707 
708  for( const auto& it : m_layers )
709  {
710  int orig_idx = it.first;
711  VIEW_LAYER layer = it.second;
712  int new_idx;
713 
714  try
715  {
716  new_idx = aReorderMap.at( orig_idx );
717  }
718  catch( const std::out_of_range& )
719  {
720  new_idx = orig_idx;
721  }
722 
723  layer.id = new_idx;
724  new_map[new_idx] = layer;
725  }
726 
727  m_layers = new_map;
728 
729  for( VIEW_ITEM* item : *m_allItems )
730  {
731  auto viewData = item->viewPrivData();
732 
733  if( !viewData )
734  continue;
735 
736  int layers[VIEW::VIEW_MAX_LAYERS], layers_count;
737 
738  item->ViewGetLayers( layers, layers_count );
739  viewData->saveLayers( layers, layers_count );
740 
741  viewData->reorderGroups( aReorderMap );
742 
743  viewData->m_requiredUpdate |= COLOR;
744  }
745 
746  UpdateItems();
747 }
friend class VIEW_ITEM
Definition: view.h:64
Visibility flag has changed.
Definition: view_item.h:56
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:712
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
Flat list of all items.
Definition: view.h:826
std::unordered_map< int, VIEW_LAYER > LAYER_MAP
Definition: view.h:727
void UpdateItems()
Function UpdateItems() Iterates through the list of items that asked for updating and updates them...
Definition: view.cpp:1419
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void KIGFX::SCH_VIEW::ResizeSheetWorkingArea ( SCH_SCREEN aScreen)

Definition at line 71 of file sch_view.cpp.

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

Referenced by DisplaySheet().

72 {
73  const PAGE_INFO& page_info = aScreen->GetPageSettings();
74  // A full size = 3 * page size allows a wide margin around the worksheet.
75  // This is useful to have a large working area.
76  double max_size_x = page_info.GetWidthMils() * IU_PER_MILS * 2.0;
77  double max_size_y = page_info.GetHeightMils() * IU_PER_MILS * 2.0;
78  m_boundary.SetOrigin( -max_size_x /4, -max_size_y/4 );
79  m_boundary.SetSize( max_size_x, max_size_y );
80 }
void SetSize(const Vec &size)
Definition: box2.h:210
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:54
int GetWidthMils() const
Definition: page_info.h:137
BOX2D m_boundary
View boundaries.
Definition: view.h:841
void SetOrigin(const Vec &pos)
Definition: box2.h:208
#define IU_PER_MILS
Definition: plotter.cpp:134
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:126
int GetHeightMils() const
Definition: page_info.h:140
void KIGFX::VIEW::ReverseDrawOrder ( bool  aFlag)
inlineinherited

Function ReverseDrawOrder() Only takes effect if UseDrawPriority is true.

Parameters
aFlagis true if draw order should be reversed

Definition at line 686 of file view.h.

References KIGFX::VIEW::DataReference(), KIGFX::VIEW::m_reverseDrawOrder, and KIGFX::VIEW::MakeOverlay().

Referenced by EDA_DRAW_PANEL_GAL::SwitchBackend().

687  {
688  m_reverseDrawOrder = aFlag;
689  }
bool m_reverseDrawOrder
Flag to reverse the draw order when using draw priority.
Definition: view.h:879
void KIGFX::VIEW::SetBoundary ( const BOX2D aBoundary)
inlineinherited

Function SetBoundary() Sets limits for view area.

Parameters
aBoundaryis the box that limits view area.

Definition at line 278 of file view.h.

References KIGFX::VIEW::m_boundary.

Referenced by DIALOG_PAD_PROPERTIES::redraw().

279  {
280  m_boundary = aBoundary;
281  }
BOX2D m_boundary
View boundaries.
Definition: view.h:841
void KIGFX::VIEW::SetBoundary ( const BOX2I aBoundary)
inlineinherited

Function SetBoundary() Sets limits for view area.

Parameters
aBoundaryis the box that limits view area.

Definition at line 288 of file view.h.

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

289  {
290  m_boundary.SetOrigin( aBoundary.GetOrigin() );
291  m_boundary.SetEnd( aBoundary.GetEnd() );
292  }
const Vec & GetOrigin() const
Definition: box2.h:191
const Vec GetEnd() const
Definition: box2.h:193
void SetEnd(coord_type x, coord_type y)
Definition: box2.h:223
BOX2D m_boundary
View boundaries.
Definition: view.h:841
void SetOrigin(const Vec &pos)
Definition: box2.h:208
void KIGFX::VIEW::SetCenter ( const VECTOR2D aCenter)
inherited

Function SetCenter() Sets 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 600 of file view.cpp.

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(), PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), SELECTION_TOOL::findCallback(), findDialog(), SYMBOL_PREVIEW_WIDGET::fitOnDrawArea(), EDA_DRAW_FRAME::FocusOnLocation(), KIGFX::WX_VIEW_CONTROLS::onMotion(), KIGFX::WX_VIEW_CONTROLS::onScroll(), KIGFX::WX_VIEW_CONTROLS::onTimer(), KIGFX::WX_VIEW_CONTROLS::onWheel(), KIGFX::VIEW::SetCenter(), KIGFX::WX_VIEW_CONTROLS::SetCrossHairCursorPosition(), KIGFX::VIEW::SetGAL(), KIGFX::VIEW::SetScale(), KIGFX::VIEW::SetScaleLimits(), KIGFX::VIEW::SetViewport(), EDA_DRAW_FRAME::UseGalCanvas(), KIGFX::WX_VIEW_CONTROLS::WarpCursor(), SCH_BASE_FRAME::Window_Zoom(), SCH_BASE_FRAME::Zoom_Automatique(), COMMON_TOOLS::ZoomFitScreen(), and SELECTION_TOOL::zoomFitSelection().

601 {
602  m_center = aCenter;
603 
604  if( !m_boundary.Contains( aCenter ) )
605  {
606  if( m_center.x < m_boundary.GetLeft() )
608  else if( aCenter.x > m_boundary.GetRight() )
610 
611  if( m_center.y < m_boundary.GetTop() )
613  else if( m_center.y > m_boundary.GetBottom() )
615  }
616 
619 
620  // Redraw everything after the viewport has changed
621  MarkDirty();
622 }
bool Contains(const Vec &aPoint) const
Function Contains.
Definition: box2.h:149
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
coord_type GetRight() const
Definition: box2.h:197
virtual void ComputeWorldScreenMatrix()
Compute the world <-> screen transformation matrix.
coord_type GetTop() const
Definition: box2.h:202
VECTOR2D m_center
Center point of the VIEW (the point at which we are looking at)
Definition: view.h:835
coord_type GetBottom() const
Definition: box2.h:198
BOX2D m_boundary
View boundaries.
Definition: view.h:841
void SetLookAtPoint(const VECTOR2D &aPoint)
Set the Point in world space to look at.
coord_type GetLeft() const
Definition: box2.h:201
void MarkDirty()
Function MarkDirty() Forces redraw of view on the next rendering.
Definition: view.h:621
void KIGFX::VIEW::SetCenter ( VECTOR2D  aCenter,
const BOX2D occultingScreenRect 
)
inherited

Function SetCenter() Sets 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 625 of file view.cpp.

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

626 {
627  BOX2D screenRect( VECTOR2D( 0, 0 ), m_gal->GetScreenPixelSize() );
628 
629  if( !screenRect.Intersects( occultingScreenRect ) )
630  {
631  SetCenter( aCenter );
632  return;
633  }
634 
635  BOX2D occultedRect = screenRect.Intersect( occultingScreenRect );
636  VECTOR2D offset( occultedRect.GetWidth() / 2, occultedRect.GetHeight() / 2 );
637 
638  double topExposed = occultedRect.GetTop() - screenRect.GetTop();
639  double bottomExposed = screenRect.GetBottom() - occultedRect.GetBottom();
640  double leftExposed = occultedRect.GetLeft() - screenRect.GetLeft();
641  double rightExposed = screenRect.GetRight() - occultedRect.GetRight();
642 
643  if( std::max( topExposed, bottomExposed ) > std::max( leftExposed, rightExposed ) )
644  {
645  if( topExposed > bottomExposed )
646  aCenter.y += ToWorld( occultedRect.GetHeight() / 2 );
647  else
648  aCenter.y -= ToWorld( occultedRect.GetHeight() / 2 );
649  }
650  else
651  {
652  if( leftExposed > rightExposed )
653  aCenter.x += ToWorld( occultedRect.GetWidth() / 2 );
654  else
655  aCenter.x -= ToWorld( occultedRect.GetWidth() / 2 );
656  }
657 
658  SetCenter( aCenter );
659 }
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Function ToWorld() Converts a screen space point/vector to a point/vector in world space coordinates...
Definition: view.cpp:474
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
coord_type GetRight() const
Definition: box2.h:197
coord_type GetTop() const
Definition: box2.h:202
coord_type GetWidth() const
Definition: box2.h:195
void SetCenter(const VECTOR2D &aCenter)
Function SetCenter() Sets the center point of the VIEW (i.e.
Definition: view.cpp:600
VECTOR2< double > VECTOR2D
Definition: vector2d.h:586
coord_type GetBottom() const
Definition: box2.h:198
const VECTOR2I & GetScreenPixelSize() const
Returns GAL canvas size in pixels.
coord_type GetHeight() const
Definition: box2.h:196
#define max(a, b)
Definition: auxiliary.h:86
coord_type GetLeft() const
Definition: box2.h:201
BOX2< Vec > Intersect(const BOX2< Vec > &aRect)
Function Intersect Returns the intersection of this with another rectangle.
Definition: box2.h:266
void KIGFX::VIEW::SetGAL ( GAL aGal)
inherited

Function SetGAL() Assigns a rendering device for the VIEW.

Parameters
aGalpointer to the GAL output device

Definition at line 518 of file view.cpp.

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(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), and EDA_DRAW_PANEL_GAL::SwitchBackend().

519 {
520  bool recacheGroups = ( m_gal != nullptr ); // recache groups only if GAL is reassigned
521  m_gal = aGal;
522 
523  // clear group numbers, so everything is going to be recached
524  if( recacheGroups )
525  clearGroupCache();
526 
527  // every target has to be refreshed
528  MarkDirty();
529 
530  // force the new GAL to display the current viewport.
531  SetCenter( m_center );
532  SetScale( m_scale );
534 }
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
void SetMirror(bool aMirrorX, bool aMirrorY)
Function SetMirror() Controls the mirroring of the VIEW.
Definition: view.cpp:564
void SetScale(double aScale)
Function SetScale() Sets the scaling factor.
Definition: view.h:250
VECTOR2D m_center
Center point of the VIEW (the point at which we are looking at)
Definition: view.h:835
void SetCenter(const VECTOR2D &aCenter)
Function SetCenter() Sets the center point of the VIEW (i.e.
Definition: view.cpp:600
bool m_mirrorX
Horizontal flip flag
Definition: view.h:850
void clearGroupCache()
Definition: view.cpp:1199
bool m_mirrorY
Vertical flip flag
Definition: view.h:853
double m_scale
Scale of displayed VIEW_ITEMs.
Definition: view.h:838
void MarkDirty()
Function MarkDirty() Forces redraw of view on the next rendering.
Definition: view.h:621
void KIGFX::VIEW::SetLayerDisplayOnly ( int  aLayer,
bool  aDisplayOnly = true 
)
inlineinherited

Definition at line 433 of file view.h.

References KIGFX::VIEW::m_layers.

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

434  {
435  wxCHECK( aLayer < (int) m_layers.size(), /*void*/ );
436  m_layers[aLayer].displayOnly = aDisplayOnly;
437  }
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void KIGFX::VIEW::SetLayerOrder ( int  aLayer,
int  aRenderingOrder 
)
inherited

Function SetLayerOrder() Sets rendering order of a particular layer.

Lower values are rendered first.

Parameters
aLayerthe layer
aRenderingOrderarbitrary number denoting the rendering order.

Definition at line 662 of file view.cpp.

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

Referenced by SCH_PREVIEW_PANEL::setDefaultLayerOrder(), PCB_DRAW_PANEL_GAL::setDefaultLayerOrder(), KIGFX::VIEW::SetLayerTarget(), GERBVIEW_DRAW_PANEL_GAL::SetTopLayer(), and PCB_DRAW_PANEL_GAL::SetTopLayer().

663 {
664  m_layers[aLayer].renderingOrder = aRenderingOrder;
665 
666  sortLayers();
667 }
void sortLayers()
Definition: view.cpp:1259
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void KIGFX::VIEW::SetLayerTarget ( int  aLayer,
RENDER_TARGET  aTarget 
)
inlineinherited

Function SetLayerTarget() Changes the rendering target for a particular layer.

Parameters
aLayeris the layer.
aTargetis the rendering target.

Definition at line 445 of file view.h.

References KIGFX::VIEW::ClearTargets(), KIGFX::VIEW::ClearTopLayers(), KIGFX::VIEW::EnableTopLayer(), KIGFX::VIEW::GetLayerOrder(), KIGFX::VIEW::GetTopLayer(), KIGFX::VIEW::m_layers, KIGFX::VIEW::RecacheAllItems(), KIGFX::VIEW::Redraw(), KIGFX::VIEW::ReorderLayerData(), KIGFX::VIEW::SetLayerOrder(), KIGFX::VIEW::SetTopLayer(), KIGFX::VIEW::SortLayers(), KIGFX::VIEW::UpdateAllLayersColor(), KIGFX::VIEW::UpdateAllLayersOrder(), and KIGFX::VIEW::UpdateLayerColor().

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

446  {
447  wxCHECK( aLayer < (int) m_layers.size(), /*void*/ );
448  m_layers[aLayer].target = aTarget;
449  }
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void KIGFX::VIEW::SetLayerVisible ( int  aLayer,
bool  aVisible = true 
)
inlineinherited

Function SetLayerVisible() Controls the visibility of a particular layer.

Parameters
aLayerthe layer to show/hide.
aVisiblethe obvious.

Definition at line 410 of file view.h.

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

Referenced by PCB_LAYER_WIDGET::OnLayerVisible(), PCB_LAYER_WIDGET::OnRenderEnable(), FOOTPRINT_EDIT_FRAME::SetElementVisibility(), and PCB_DRAW_PANEL_GAL::SyncLayersVisibility().

411  {
412  wxCHECK( aLayer < (int) m_layers.size(), /*void*/ );
413 
414  if( m_layers[aLayer].visible != aVisible )
415  {
416  // Target has to be redrawn after changing its visibility
417  MarkTargetDirty( m_layers[aLayer].target );
418  m_layers[aLayer].visible = aVisible;
419  }
420  }
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target &#39;dirty&#39; flag.
Definition: view.h:596
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void KIGFX::VIEW::SetMirror ( bool  aMirrorX,
bool  aMirrorY 
)
inherited

Function SetMirror() Controls the mirroring of the VIEW.

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

Definition at line 564 of file view.cpp.

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

Referenced by KIGFX::VIEW::GetPainter(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), and KIGFX::VIEW::SetGAL().

565 {
566  wxASSERT_MSG( !aMirrorY, _( "Mirroring for Y axis is not supported yet" ) );
567 
568  m_mirrorX = aMirrorX;
569  m_mirrorY = aMirrorY;
570  m_gal->SetFlip( aMirrorX, aMirrorY );
571 
572  // Redraw everything
573  MarkDirty();
574 }
void SetFlip(bool xAxis, bool yAxis)
Sets flipping of the screen.
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
bool m_mirrorX
Horizontal flip flag
Definition: view.h:850
bool m_mirrorY
Vertical flip flag
Definition: view.h:853
void MarkDirty()
Function MarkDirty() Forces redraw of view on the next rendering.
Definition: view.h:621
void KIGFX::VIEW::SetPainter ( PAINTER aPainter)
inlineinherited

Function SetPainter() Sets the painter object used by the view for drawing VIEW_ITEMS.

Definition at line 189 of file view.h.

References KIGFX::VIEW::m_painter.

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

190  {
191  m_painter = aPainter;
192  }
PAINTER * m_painter
PAINTER contains information how do draw items.
Definition: view.h:856
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 710 of file view.h.

References KIGFX::VIEW::m_printMode.

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

710 { m_printMode = aPrintMode; }
int m_printMode
A control for printing: m_printMode <= 0 means no printing mode (normal draw mode m_printMode > 0 is ...
Definition: view.h:883
void KIGFX::VIEW::SetRequired ( int  aLayerId,
int  aRequiredId,
bool  aRequired = true 
)
inherited

Function SetRequired() Marks 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 415 of file view.cpp.

References KIGFX::VIEW::m_layers.

Referenced by PCB_DRAW_PANEL_GAL::setDefaultLayerDeps().

416 {
417  wxCHECK( (unsigned) aLayerId < m_layers.size(), /*void*/ );
418  wxCHECK( (unsigned) aRequiredId < m_layers.size(), /*void*/ );
419 
420  if( aRequired )
421  m_layers[aLayerId].requiredLayers.insert( aRequiredId );
422  else
423  m_layers[aLayerId].requiredLayers.erase( aRequired );
424 }
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void KIGFX::VIEW::SetScale ( double  aScale)
inlineinherited

Function SetScale() Sets the scaling factor.

Scale = 1 corresponds to the real world size of the objects (depending on correct GAL unit length & DPI settings).

Parameters
aScalethe scalefactor

Definition at line 250 of file view.h.

References KIGFX::VIEW::m_center.

Referenced by COMMON_TOOLS::doZoomToPreset(), SYMBOL_PREVIEW_WIDGET::fitOnDrawArea(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), KIGFX::WX_VIEW_CONTROLS::onWheel(), EDA_DRAW_FRAME::OnZoom(), DIALOG_PAD_PROPERTIES::redraw(), SCH_BASE_FRAME::RedrawScreen(), SCH_BASE_FRAME::RedrawScreen2(), FOOTPRINT_PREVIEW_PANEL::renderFootprint(), KIGFX::VIEW::SetGAL(), KIGFX::VIEW::SetViewport(), EDA_DRAW_FRAME::UseGalCanvas(), SCH_BASE_FRAME::Window_Zoom(), SCH_BASE_FRAME::Zoom_Automatique(), COMMON_TOOLS::ZoomFitScreen(), and SELECTION_TOOL::zoomFitSelection().

251  {
252  SetScale( aScale, m_center );
253  }
void SetScale(double aScale)
Function SetScale() Sets the scaling factor.
Definition: view.h:250
VECTOR2D m_center
Center point of the VIEW (the point at which we are looking at)
Definition: view.h:835
void KIGFX::VIEW::SetScale ( double  aScale,
const VECTOR2D aAnchor 
)
inherited

Function SetScale() Sets the scaling factor, zooming around a given anchor point.

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

Parameters
aAnchorthe zooming anchor point
aScalethe scale factor

Definition at line 577 of file view.cpp.

References KIGFX::GAL::ComputeWorldScreenMatrix(), delta, KIGFX::VIEW::m_center, KIGFX::VIEW::m_gal, KIGFX::VIEW::m_maxScale, KIGFX::VIEW::m_minScale, KIGFX::VIEW::m_scale, KIGFX::VIEW::MarkDirty(), KIGFX::VIEW::SetCenter(), KIGFX::GAL::SetZoomFactor(), KIGFX::VIEW::ToScreen(), and KIGFX::VIEW::ToWorld().

578 {
579  VECTOR2D a = ToScreen( aAnchor );
580 
581  if( aScale < m_minScale )
583  else if( aScale > m_maxScale )
585  else
586  m_scale = aScale;
587 
590 
591  VECTOR2D delta = ToWorld( a ) - aAnchor;
592 
593  SetCenter( m_center - delta );
594 
595  // Redraw everything after the viewport has changed
596  MarkDirty();
597 }
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Function ToWorld() Converts a screen space point/vector to a point/vector in world space coordinates...
Definition: view.cpp:474
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
virtual void ComputeWorldScreenMatrix()
Compute the world <-> screen transformation matrix.
static const int delta[8][2]
Definition: solve.cpp:112
VECTOR2D m_center
Center point of the VIEW (the point at which we are looking at)
Definition: view.h:835
double m_minScale
Scale lower limit.
Definition: view.h:844
void SetCenter(const VECTOR2D &aCenter)
Function SetCenter() Sets the center point of the VIEW (i.e.
Definition: view.cpp:600
double m_maxScale
Scale upper limit.
Definition: view.h:847
VECTOR2D ToScreen(const VECTOR2D &aCoord, bool aAbsolute=true) const
Function ToScreen() Converts a world space point/vector to a point/vector in screen space coordinates...
Definition: view.cpp:493
void SetZoomFactor(double aZoomFactor)
Set the zoom factor of the scene.
double m_scale
Scale of displayed VIEW_ITEMs.
Definition: view.h:838
void MarkDirty()
Function MarkDirty() Forces redraw of view on the next rendering.
Definition: view.h:621
void KIGFX::VIEW::SetScaleLimits ( double  aMaximum,
double  aMinimum 
)
inlineinherited

Function SetScaleLimits() Sets minimum and maximum values for scale.

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

Definition at line 309 of file view.h.

References KIGFX::VIEW::m_maxScale, KIGFX::VIEW::m_minScale, and KIGFX::VIEW::SetCenter().

Referenced by SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL().

310  {
311  wxASSERT_MSG( aMaximum > aMinimum, wxT( "I guess you passed parameters in wrong order" ) );
312 
313  m_minScale = aMinimum;
314  m_maxScale = aMaximum;
315  }
double m_minScale
Scale lower limit.
Definition: view.h:844
double m_maxScale
Scale upper limit.
Definition: view.h:847
void KIGFX::VIEW::SetTopLayer ( int  aLayer,
bool  aEnabled = true 
)
virtualinherited

Function SetTopLayer() Sets 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.
aLayerthe layer or -1 in case when no particular layer should be displayed on the top.

Definition at line 858 of file view.cpp.

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(), KIGFX::VIEW::SetLayerTarget(), GERBVIEW_DRAW_PANEL_GAL::SetTopLayer(), PCB_DRAW_PANEL_GAL::SetTopLayer(), and EDA_DRAW_PANEL_GAL::SetTopLayer().

859 {
860  if( aEnabled )
861  {
862  if( m_topLayers.count( aLayer ) == 1 )
863  return;
864 
865  m_topLayers.insert( aLayer );
866 
867  // Move the layer closer to front
869  m_layers[aLayer].renderingOrder += TOP_LAYER_MODIFIER;
870  }
871  else
872  {
873  if( m_topLayers.count( aLayer ) == 0 )
874  return;
875 
876  m_topLayers.erase( aLayer );
877 
878  // Restore the previous rendering order
880  m_layers[aLayer].renderingOrder -= TOP_LAYER_MODIFIER;
881  }
882 }
static const int TOP_LAYER_MODIFIER
Rendering order modifier for layers that are marked as top layers.
Definition: view.h:869
std::set< unsigned int > m_topLayers
Stores set of layers that are displayed on the top.
Definition: view.h:832
bool m_enableOrderModifier
Definition: view.h:820
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void KIGFX::VIEW::SetViewport ( const BOX2D aViewport)
inherited

Function SetViewport() Sets the visible area of the VIEW.

Parameters
aViewportdesired visible area, in world space coordinates.

Definition at line 549 of file view.cpp.

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

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

550 {
551  VECTOR2D ssize = ToWorld( m_gal->GetScreenPixelSize(), false );
552 
553  wxCHECK( ssize.x > 0 && ssize.y > 0, /*void*/ );
554 
555  VECTOR2D centre = aViewport.Centre();
556  VECTOR2D vsize = aViewport.GetSize();
557  double zoom = 1.0 / std::max( fabs( vsize.x / ssize.x ), fabs( vsize.y / ssize.y ) );
558 
559  SetCenter( centre );
560  SetScale( GetScale() * zoom );
561 }
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Function ToWorld() Converts a screen space point/vector to a point/vector in world space coordinates...
Definition: view.cpp:474
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
const Vec & GetSize() const
Definition: box2.h:187
void SetScale(double aScale)
Function SetScale() Sets the scaling factor.
Definition: view.h:250
void SetCenter(const VECTOR2D &aCenter)
Function SetCenter() Sets the center point of the VIEW (i.e.
Definition: view.cpp:600
Vec Centre() const
Definition: box2.h:77
const VECTOR2I & GetScreenPixelSize() const
Returns GAL canvas size in pixels.
#define max(a, b)
Definition: auxiliary.h:86
double GetScale() const
Function GetScale()
Definition: view.h:268
void KIGFX::VIEW::SetVisible ( VIEW_ITEM aItem,
bool  aIsVisible = true 
)
inherited

Sets the item visibility.

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

Definition at line 1484 of file view.cpp.

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(), AddToPreview(), GRID_HELPER::BestSnapAnchor(), MICROWAVE_TOOL::drawMicrowaveInductor(), DrawMovingBlockOutlines(), GRID_HELPER::GRID_HELPER(), EDIT_TOOL::MeasureTool(), ZONE_CREATE_HELPER::OnComplete(), ZONE_CREATE_HELPER::OnFirstPoint(), FOOTPRINT_PREVIEW_PANEL::renderFootprint(), GERBVIEW_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), GRID_HELPER::SetAuxAxes(), ShowPreview(), ShowSelectionArea(), and ZONE_CREATE_HELPER::~ZONE_CREATE_HELPER().

1485 {
1486  auto viewData = aItem->viewPrivData();
1487 
1488  if( !viewData )
1489  return;
1490 
1491  bool cur_visible = viewData->m_flags & VISIBLE;
1492 
1493  if( cur_visible != aIsVisible )
1494  {
1495  if( aIsVisible )
1496  viewData->m_flags |= VISIBLE;
1497  else
1498  viewData->m_flags &= ~VISIBLE;
1499 
1500  Update( aItem, APPEARANCE | COLOR );
1501  }
1502 }
No updates are required.
Definition: view_item.h:55
Visibility flag has changed.
Definition: view_item.h:56
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1538
void KIGFX::SCH_VIEW::ShowPreview ( bool  aShow = true)

Definition at line 173 of file sch_view.cpp.

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

Referenced by SCH_EDIT_FRAME::OnCancelCurrentCommand().

174 {
175  SetVisible( m_preview.get(), aShow );
176 }
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Sets the item visibility.
Definition: view.cpp:1484
std::unique_ptr< KIGFX::VIEW_GROUP > m_preview
Definition: sch_view.h:110
void KIGFX::SCH_VIEW::ShowSelectionArea ( bool  aShow = true)

Definition at line 159 of file sch_view.cpp.

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

Referenced by SCH_BASE_FRAME::HandleBlockBegin(), and SCH_EDIT_FRAME::HandleBlockEnd().

160 {
161  if( aShow )
162  {
163  // Reset seleciton area so the previous one doesn't flash before the first
164  // mouse move updates it
165  m_selectionArea->SetOrigin( VECTOR2I() );
166  m_selectionArea->SetEnd( VECTOR2I() );
167  }
168 
169  SetVisible( m_selectionArea.get(), aShow );
170 }
VECTOR2< int > VECTOR2I
Definition: vector2d.h:587
std::unique_ptr< KIGFX::PREVIEW::SELECTION_AREA > m_selectionArea
Definition: sch_view.h:109
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Sets the item visibility.
Definition: view.cpp:1484
void KIGFX::VIEW::SortLayers ( int  aLayers[],
int &  aCount 
) const
inherited

Function SortLayers() Changes 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 676 of file view.cpp.

References KIGFX::VIEW::GetLayerOrder(), and i.

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

677 {
678  int maxLay, maxOrd, maxIdx;
679 
680  for( int i = 0; i < aCount; ++i )
681  {
682  maxLay = aLayers[i];
683  maxOrd = GetLayerOrder( maxLay );
684  maxIdx = i;
685 
686  // Look for the max element in the range (j..aCount)
687  for( int j = i; j < aCount; ++j )
688  {
689  if( maxOrd < GetLayerOrder( aLayers[j] ) )
690  {
691  maxLay = aLayers[j];
692  maxOrd = GetLayerOrder( maxLay );
693  maxIdx = j;
694  }
695  }
696 
697  // Swap elements
698  aLayers[maxIdx] = aLayers[i];
699  aLayers[i] = maxLay;
700  }
701 }
int GetLayerOrder(int aLayer) const
Function GetLayerOrder() Returns rendering order of a particular layer.
Definition: view.cpp:670
size_t i
Definition: json11.cpp:597
void KIGFX::VIEW::sortLayers ( )
protectedinherited
  • Sorts m_orderedLayers when layer rendering order has changed

Definition at line 1259 of file view.cpp.

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

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

1260 {
1261  int n = 0;
1262 
1263  m_orderedLayers.resize( m_layers.size() );
1264 
1265  for( LAYER_MAP_ITER i = m_layers.begin(); i != m_layers.end(); ++i )
1266  m_orderedLayers[n++] = &i->second;
1267 
1268  sort( m_orderedLayers.begin(), m_orderedLayers.end(), compareRenderingOrder );
1269 
1270  MarkDirty();
1271 }
LAYER_ORDER m_orderedLayers
Sorted list of pointers to members of m_layers.
Definition: view.h:829
LAYER_MAP::iterator LAYER_MAP_ITER
Definition: view.h:728
size_t i
Definition: json11.cpp:597
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
static bool compareRenderingOrder(VIEW_LAYER *aI, VIEW_LAYER *aJ)
Determines rendering order of layers. Used in display order sorting function.
Definition: view.h:811
void MarkDirty()
Function MarkDirty() Forces redraw of view on the next rendering.
Definition: view.h:621
VECTOR2D KIGFX::VIEW::ToScreen ( const VECTOR2D aCoord,
bool  aAbsolute = true 
) const
inherited

Function ToScreen() Converts a world space point/vector to a point/vector in screen space coordinates.

Parameters
aCoordthe point/vector to be converted
aAbsolutewhen true, aCoord is treated as a point, otherwise - as a direction (vector)

Definition at line 493 of file view.cpp.

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

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

494 {
495  const MATRIX3x3D& matrix = m_gal->GetWorldScreenMatrix();
496 
497  if( aAbsolute )
498  return VECTOR2D( matrix * aCoord );
499  else
500  return VECTOR2D( matrix.GetScale().x * aCoord.x, matrix.GetScale().y * aCoord.y );
501 }
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
const MATRIX3x3D & GetWorldScreenMatrix() const
Get the world <-> screen transformation matrix.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:586
VECTOR2< T > GetScale() const
Get the scale components of the matrix.
Definition: matrix3x3.h:269
double KIGFX::VIEW::ToScreen ( double  aSize) const
inherited

Function ToScreen() Converts a world space one dimensionsal size to a one dimensional size in screen space.

Parameters
aSizethe size to be transformed.

Definition at line 504 of file view.cpp.

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

505 {
506  const MATRIX3x3D& matrix = m_gal->GetWorldScreenMatrix();
507 
508  return matrix.GetScale().x * aSize;
509 }
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
const MATRIX3x3D & GetWorldScreenMatrix() const
Get the world <-> screen transformation matrix.
VECTOR2< T > GetScale() const
Get the scale components of the matrix.
Definition: matrix3x3.h:269
VECTOR2D KIGFX::VIEW::ToWorld ( const VECTOR2D aCoord,
bool  aAbsolute = true 
) const
inherited

Function ToWorld() Converts a screen space point/vector to a point/vector in world space coordinates.

Parameters
aCoordthe point/vector to be converted
aAbsolutewhen true, aCoord is treated as a point, otherwise - as a direction (vector)

Definition at line 474 of file view.cpp.

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

Referenced by COMMON_TOOLS::CenterContents(), EDIT_POINTS::FindPoint(), SYMBOL_PREVIEW_WIDGET::fitOnDrawArea(), GENERAL_COLLECTORS_GUIDE::GENERAL_COLLECTORS_GUIDE(), KIGFX::VIEW::GetCenter(), KIGFX::WX_VIEW_CONTROLS::GetMousePosition(), KIGFX::VIEW::GetViewport(), KIGFX::WX_VIEW_CONTROLS::onMotion(), KIGFX::WX_VIEW_CONTROLS::onScroll(), KIGFX::WX_VIEW_CONTROLS::onTimer(), KIGFX::WX_VIEW_CONTROLS::onWheel(), KIGFX::VIEW::Redraw(), KIGFX::WX_VIEW_CONTROLS::refreshMouse(), GERBVIEW_SELECTION_TOOL::selectionContains(), SELECTION_TOOL::selectionContains(), KIGFX::VIEW::SetCenter(), KIGFX::VIEW::SetScale(), KIGFX::VIEW::SetViewport(), KIGFX::ORIGIN_VIEWITEM::ViewDraw(), EDIT_POINTS::ViewDraw(), SCH_BASE_FRAME::Window_Zoom(), SCH_BASE_FRAME::Zoom_Automatique(), COMMON_TOOLS::ZoomFitScreen(), and SELECTION_TOOL::zoomFitSelection().

475 {
476  const MATRIX3x3D& matrix = m_gal->GetScreenWorldMatrix();
477 
478  if( aAbsolute )
479  return VECTOR2D( matrix * aCoord );
480  else
481  return VECTOR2D( matrix.GetScale().x * aCoord.x, matrix.GetScale().y * aCoord.y );
482 }
const MATRIX3x3D & GetScreenWorldMatrix() const
Get the screen <-> world transformation matrix.
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
VECTOR2< double > VECTOR2D
Definition: vector2d.h:586
VECTOR2< T > GetScale() const
Get the scale components of the matrix.
Definition: matrix3x3.h:269
double KIGFX::VIEW::ToWorld ( double  aSize) const
inherited

Function ToWorld() Converts a screen space one dimensional size to a one dimensional size in world space coordinates.

Parameters
aSize: the size to be converted

Definition at line 485 of file view.cpp.

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

486 {
487  const MATRIX3x3D& matrix = m_gal->GetScreenWorldMatrix();
488 
489  return fabs( matrix.GetScale().x * aSize );
490 }
const MATRIX3x3D & GetScreenWorldMatrix() const
Get the screen <-> world transformation matrix.
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
VECTOR2< T > GetScale() const
Get the scale components of the matrix.
Definition: matrix3x3.h:269
void KIGFX::VIEW::Update ( VIEW_ITEM aItem,
int  aUpdateFlags 
)
virtualinherited

For dynamic VIEWs, informs 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 1538 of file view.cpp.

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

Referenced by KIGFX::VIEW::Add(), AddToPreview(), GRID_HELPER::BestSnapAnchor(), ClearPreview(), KIGFX::VIEW::draw(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DrawMovingBlockOutlines(), DRAWING_TOOL::drawSegment(), PCB_EDIT_FRAME::Edit_Zone_Params(), LIB_EDIT_FRAME::EditField(), LIB_EDIT_FRAME::EditGraphicSymbol(), SCH_EDIT_FRAME::EditSheet(), LIB_EDIT_FRAME::EditSymbolText(), MODULE_EDITOR_TOOLS::EnumeratePads(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), SCH_EDIT_FRAME::HandleBlockPlace(), KIGFX::VIEW::Hide(), SCH_EDIT_FRAME::HighlightConnectionAtPosition(), SCH_EDIT_FRAME::MirrorSheet(), EDIT_TOOL::MoveExact(), LIB_EDIT_FRAME::OnEditPin(), SCH_EDIT_FRAME::OnFindReplace(), ZONE_CREATE_HELPER::OnGeometryChange(), LIB_EDIT_FRAME::OnOrient(), LIB_EDIT_FRAME::OnRotate(), DIALOG_UPDATE_PCB::PerformUpdate(), DRAWING_TOOL::PlaceImportedGraphics(), PCB_EDITOR_CONTROL::PlaceModule(), DRAWING_TOOL::PlaceText(), processBoardItem(), BOARD_COMMIT::Push(), PCB_EDIT_FRAME::ReadPcbNetlist(), DIALOG_PAD_PROPERTIES::redraw(), PCB_DRAW_PANEL_GAL::RedrawRatsnest(), refreshCallback(), SCH_BASE_FRAME::RefreshItem(), FOOTPRINT_PREVIEW_PANEL::renderFootprint(), SCH_EDIT_FRAME::RotateHierarchicalSheet(), GERBVIEW_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), GERBVIEW_SELECTION_TOOL::selectVisually(), KIGFX::VIEW::SetVisible(), SCH_EDIT_FRAME::TestDanglingEnds(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataFromWindow(), GERBVIEW_SELECTION_TOOL::unselectVisually(), KIGFX::PCB_VIEW::Update(), KIGFX::VIEW::Update(), POINT_EDITOR::updatePoints(), and SELECTION_TOOL::updateSelection().

1539 {
1540  auto viewData = aItem->viewPrivData();
1541 
1542  if( !viewData )
1543  return;
1544 
1545  assert( aUpdateFlags != NONE );
1546 
1547  viewData->m_requiredUpdate |= aUpdateFlags;
1548 
1549 }
void KIGFX::VIEW::Update ( VIEW_ITEM aItem)
virtualinherited

Reimplemented in KIGFX::PCB_VIEW.

Definition at line 1532 of file view.cpp.

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

1533 {
1534  Update( aItem, ALL );
1535 }
Item needs to be redrawn.
Definition: view_item.h:61
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1538
void KIGFX::VIEW::UpdateAllItems ( int  aUpdateFlags)
inherited

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

Parameters
aUpdateFlagsis is according to KIGFX::VIEW_UPDATE_FLAGS

Definition at line 1442 of file view.cpp.

References KIGFX::VIEW::m_allItems.

Referenced by FOOTPRINT_VIEWER_FRAME::ApplyDisplaySettingsToGAL(), DISPLAY_FOOTPRINTS_FRAME::ApplyDisplaySettingsToGAL(), GERBVIEW_CONTROL::HighlightControl(), HighlightItem(), SCH_EDIT_FRAME::KiwayMailIn(), KIGFX::VIEW::MarkDirty(), GERBVIEW_FRAME::OnSelectHighlightChoice(), SCH_EDIT_FRAME::OnSelectOptionToolbar(), LIB_EDIT_FRAME::OnShowElectricalType(), and SCH_BASE_FRAME::SyncView().

1443 {
1444  for( VIEW_ITEM* item : *m_allItems )
1445  {
1446  auto viewData = item->viewPrivData();
1447 
1448  if( !viewData )
1449  continue;
1450 
1451  viewData->m_requiredUpdate |= aUpdateFlags;
1452  }
1453 }
friend class VIEW_ITEM
Definition: view.h:64
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
Flat list of all items.
Definition: view.h:826
void KIGFX::VIEW::UpdateAllItemsConditionally ( int  aUpdateFlags,
std::function< bool(VIEW_ITEM *)>  aCondition 
)
inherited

Updates 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 1456 of file view.cpp.

References KIGFX::VIEW::m_allItems.

Referenced by KIGFX::VIEW::MarkDirty(), GERBVIEW_FRAME::SetElementVisibility(), and GERBVIEW_FRAME::UpdateDisplayOptions().

1458 {
1459  for( VIEW_ITEM* item : *m_allItems )
1460  {
1461  if( aCondition( item ) )
1462  {
1463  auto viewData = item->viewPrivData();
1464 
1465  if( !viewData )
1466  continue;
1467 
1468  viewData->m_requiredUpdate |= aUpdateFlags;
1469  }
1470  }
1471 }
friend class VIEW_ITEM
Definition: view.h:64
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
Flat list of all items.
Definition: view.h:826
void KIGFX::VIEW::UpdateAllLayersColor ( )
inherited

Function UpdateAllLayersColor() Applies the new coloring scheme to all layers.

The used scheme is held by RENDER_SETTINGS.

See also
RENDER_SETTINGS

Definition at line 796 of file view.cpp.

References KIGFX::GAL::ChangeGroupColor(), color, KIGFX::RENDER_SETTINGS::GetColor(), KIGFX::PAINTER::GetSettings(), i, 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 PCB_EDITOR_CONTROL::ClearHighlight(), KIGFX::VIEW::EnableTopLayer(), PNS::TOOL_BASE::highlightNet(), PCB_EDITOR_CONTROL::HighlightNet(), highlightNet(), GERBVIEW_DRAW_PANEL_GAL::SetHighContrastLayer(), PCB_DRAW_PANEL_GAL::SetHighContrastLayer(), EDA_DRAW_PANEL_GAL::SetHighContrastLayer(), and KIGFX::VIEW::SetLayerTarget().

797 {
798  if( m_gal->IsVisible() )
799  {
800  GAL_UPDATE_CONTEXT ctx( m_gal );
801 
802  for( VIEW_ITEM* item : *m_allItems )
803  {
804  auto viewData = item->viewPrivData();
805 
806  if( !viewData )
807  continue;
808 
809  int layers[VIEW::VIEW_MAX_LAYERS], layers_count;
810  viewData->getLayers( layers, layers_count );
811 
812  for( int i = 0; i < layers_count; ++i )
813  {
814  const COLOR4D color = m_painter->GetSettings()->GetColor( item, layers[i] );
815  int group = viewData->getGroup( layers[i] );
816 
817  if( group >= 0 )
818  m_gal->ChangeGroupColor( group, color );
819  }
820  }
821  }
822 
823  MarkDirty();
824 }
friend class VIEW_ITEM
Definition: view.h:64
int color
Definition: DXF_plotter.cpp:62
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
virtual bool IsVisible() const
Returns true if the GAL canvas is visible on the screen.
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:712
virtual const COLOR4D & GetColor(const VIEW_ITEM *aItem, int aLayer) const =0
Function GetColor Returns the color that should be used to draw the specific VIEW_ITEM on the specifi...
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
Flat list of all items.
Definition: view.h:826
virtual void ChangeGroupColor(int aGroupNumber, const COLOR4D &aNewColor)
Changes the color used to draw the group.
PAINTER * m_painter
PAINTER contains information how do draw items.
Definition: view.h:856
virtual RENDER_SETTINGS * GetSettings()=0
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
size_t i
Definition: json11.cpp:597
void MarkDirty()
Function MarkDirty() Forces redraw of view on the next rendering.
Definition: view.h:621
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
void KIGFX::VIEW::UpdateAllLayersOrder ( )
inherited

Function UpdateLayerOrder() Does 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 925 of file view.cpp.

References KIGFX::GAL::ChangeGroupDepth(), i, 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_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), KIGFX::VIEW::SetLayerTarget(), GERBVIEW_DRAW_PANEL_GAL::SetTopLayer(), PCB_DRAW_PANEL_GAL::SetTopLayer(), and EDA_DRAW_PANEL_GAL::SetTopLayer().

926 {
927  sortLayers();
928 
929  if( m_gal->IsVisible() )
930  {
931  GAL_UPDATE_CONTEXT ctx( m_gal );
932 
933  for( VIEW_ITEM* item : *m_allItems )
934  {
935  auto viewData = item->viewPrivData();
936 
937  if( !viewData )
938  continue;
939 
940  int layers[VIEW::VIEW_MAX_LAYERS], layers_count;
941  viewData->getLayers( layers, layers_count );
942 
943  for( int i = 0; i < layers_count; ++i )
944  {
945  int group = viewData->getGroup( layers[i] );
946 
947  if( group >= 0 )
948  m_gal->ChangeGroupDepth( group, m_layers[layers[i]].renderingOrder );
949  }
950  }
951  }
952 
953  MarkDirty();
954 }
void sortLayers()
Definition: view.cpp:1259
friend class VIEW_ITEM
Definition: view.h:64
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
virtual bool IsVisible() const
Returns true if the GAL canvas is visible on the screen.
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:712
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
Flat list of all items.
Definition: view.h:826
size_t i
Definition: json11.cpp:597
virtual void ChangeGroupDepth(int aGroupNumber, int aDepth)
Changes the depth (Z-axis position) of the group.
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void MarkDirty()
Function MarkDirty() Forces redraw of view on the next rendering.
Definition: view.h:621
void KIGFX::VIEW::updateBbox ( VIEW_ITEM aItem)
protectedinherited

Updates bounding box of an item.

Definition at line 1323 of file view.cpp.

References i, 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(), and KIGFX::VIEW::markTargetClean().

1324 {
1325  int layers[VIEW_MAX_LAYERS], layers_count;
1326 
1327  aItem->ViewGetLayers( layers, layers_count );
1328 
1329  for( int i = 0; i < layers_count; ++i )
1330  {
1331  VIEW_LAYER& l = m_layers[layers[i]];
1332  l.items->Remove( aItem );
1333  l.items->Insert( aItem );
1334  MarkTargetDirty( l.target );
1335  }
1336 }
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:712
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target &#39;dirty&#39; flag.
Definition: view.h:596
size_t i
Definition: json11.cpp:597
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void KIGFX::VIEW::updateItemColor ( VIEW_ITEM aItem,
int  aLayer 
)
protectedinherited

Updates colors that are used for an item to be drawn.

Definition at line 1274 of file view.cpp.

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(), and KIGFX::VIEW::markTargetClean().

1275 {
1276  auto viewData = aItem->viewPrivData();
1277  wxCHECK( (unsigned) aLayer < m_layers.size(), /*void*/ );
1278  wxCHECK( IsCached( aLayer ), /*void*/ );
1279 
1280  if( !viewData )
1281  return;
1282 
1283  // Obtain the color that should be used for coloring the item on the specific layerId
1284  const COLOR4D color = m_painter->GetSettings()->GetColor( aItem, aLayer );
1285  int group = viewData->getGroup( aLayer );
1286 
1287  // Change the color, only if it has group assigned
1288  if( group >= 0 )
1289  m_gal->ChangeGroupColor( group, color );
1290 }
int color
Definition: DXF_plotter.cpp:62
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
virtual const COLOR4D & GetColor(const VIEW_ITEM *aItem, int aLayer) const =0
Function GetColor Returns the color that should be used to draw the specific VIEW_ITEM on the specifi...
virtual void ChangeGroupColor(int aGroupNumber, const COLOR4D &aNewColor)
Changes the color used to draw the group.
PAINTER * m_painter
PAINTER contains information how do draw items.
Definition: view.h:856
virtual RENDER_SETTINGS * GetSettings()=0
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
bool IsCached(int aLayer) const
Returns true if the layer is cached.
Definition: view.h:603
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
void KIGFX::VIEW::updateItemGeometry ( VIEW_ITEM aItem,
int  aLayer 
)
protectedinherited

Updates all informations needed to draw an item.

Definition at line 1293 of file view.cpp.

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(), and KIGFX::VIEW::markTargetClean().

1294 {
1295  auto viewData = aItem->viewPrivData();
1296  wxCHECK( (unsigned) aLayer < m_layers.size(), /*void*/ );
1297  wxCHECK( IsCached( aLayer ), /*void*/ );
1298 
1299  if( !viewData )
1300  return;
1301 
1302  VIEW_LAYER& l = m_layers.at( aLayer );
1303 
1304  m_gal->SetTarget( l.target );
1305  m_gal->SetLayerDepth( l.renderingOrder );
1306 
1307  // Redraw the item from scratch
1308  int group = viewData->getGroup( aLayer );
1309 
1310  if( group >= 0 )
1311  m_gal->DeleteGroup( group );
1312 
1313  group = m_gal->BeginGroup();
1314  viewData->setGroup( aLayer, group );
1315 
1316  if( !m_painter->Draw( static_cast<EDA_ITEM*>( aItem ), aLayer ) )
1317  aItem->ViewDraw( aLayer, this ); // Alternative drawing method
1318 
1319  m_gal->EndGroup();
1320 }
virtual void DeleteGroup(int aGroupNumber)
Delete the group from the memory.
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
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
PAINTER contains information how do draw items.
Definition: view.h:856
virtual bool Draw(const VIEW_ITEM *aItem, int aLayer)=0
Function Draw Takes an instance of VIEW_ITEM and passes it to a function that know how to draw the it...
bool IsCached(int aLayer) const
Returns true if the layer is cached.
Definition: view.h:603
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
virtual void SetTarget(RENDER_TARGET aTarget)
Sets the target for rendering.
void KIGFX::VIEW::UpdateItems ( )
inherited

Function UpdateItems() Iterates through the list of items that asked for updating and updates them.

Definition at line 1419 of file view.cpp.

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

Referenced by KIGFX::VIEW::MarkDirty(), EDA_DRAW_PANEL_GAL::onPaint(), PCB_DRAW_PANEL_GAL::OnShow(), and KIGFX::VIEW::ReorderLayerData().

1420 {
1421  if( m_gal->IsVisible() )
1422  {
1423  GAL_UPDATE_CONTEXT ctx( m_gal );
1424 
1425  for( VIEW_ITEM* item : *m_allItems )
1426  {
1427  auto viewData = item->viewPrivData();
1428 
1429  if( !viewData )
1430  continue;
1431 
1432  if( viewData->m_requiredUpdate != NONE )
1433  {
1434  invalidateItem( item, viewData->m_requiredUpdate );
1435  viewData->m_requiredUpdate = NONE;
1436  }
1437  }
1438  }
1439 }
friend class VIEW_ITEM
Definition: view.h:64
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
virtual bool IsVisible() const
Returns true if the GAL canvas is visible on the screen.
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
Flat list of all items.
Definition: view.h:826
void invalidateItem(VIEW_ITEM *aItem, int aUpdateFlags)
Function invalidateItem() Manages dirty flags & redraw queueing when updating an item.
Definition: view.cpp:1214
void KIGFX::VIEW::UpdateLayerColor ( int  aLayer)
inherited

Function UpdateLayerColor() Applies 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 775 of file view.cpp.

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 PCBNEW_CONTROL::LayerAlphaDec(), PCBNEW_CONTROL::LayerAlphaInc(), PCB_LAYER_WIDGET::OnLayerColorChange(), GERBER_LAYER_WIDGET::OnLayerColorChange(), PCB_LAYER_WIDGET::OnRenderColorChange(), and KIGFX::VIEW::SetLayerTarget().

776 {
777  // There is no point in updating non-cached layers
778  if( !IsCached( aLayer ) )
779  return;
780 
781  BOX2I r;
782 
783  r.SetMaximum();
784 
785  if( m_gal->IsVisible() )
786  {
787  GAL_UPDATE_CONTEXT ctx( m_gal );
788 
789  updateItemsColor visitor( aLayer, m_painter, m_gal );
790  m_layers[aLayer].items->Query( r, visitor );
791  MarkTargetDirty( m_layers[aLayer].target );
792  }
793 }
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
virtual bool IsVisible() const
Returns true if the GAL canvas is visible on the screen.
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target &#39;dirty&#39; flag.
Definition: view.h:596
void SetMaximum()
Definition: box2.h:71
PAINTER * m_painter
PAINTER contains information how do draw items.
Definition: view.h:856
bool IsCached(int aLayer) const
Returns true if the layer is cached.
Definition: view.h:603
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void KIGFX::VIEW::updateLayers ( VIEW_ITEM aItem)
protectedinherited

Updates set of layers that an item occupies.

Definition at line 1339 of file view.cpp.

References KIGFX::GAL::DeleteGroup(), KIGFX::VIEW_ITEM_DATA::getLayers(), i, 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(), and KIGFX::VIEW::markTargetClean().

1340 {
1341  auto viewData = aItem->viewPrivData();
1342  int layers[VIEW_MAX_LAYERS], layers_count;
1343 
1344  if( !viewData )
1345  return;
1346 
1347  // Remove the item from previous layer set
1348  viewData->getLayers( layers, layers_count );
1349 
1350  for( int i = 0; i < layers_count; ++i )
1351  {
1352  VIEW_LAYER& l = m_layers[layers[i]];
1353  l.items->Remove( aItem );
1354  MarkTargetDirty( l.target );
1355 
1356  if( IsCached( l.id ) )
1357  {
1358  // Redraw the item from scratch
1359  int prevGroup = viewData->getGroup( layers[i] );
1360 
1361  if( prevGroup >= 0 )
1362  {
1363  m_gal->DeleteGroup( prevGroup );
1364  viewData->setGroup( l.id, -1 );
1365  }
1366  }
1367  }
1368 
1369  // Add the item to new layer set
1370  aItem->ViewGetLayers( layers, layers_count );
1371  viewData->saveLayers( layers, layers_count );
1372 
1373  for( int i = 0; i < layers_count; i++ )
1374  {
1375  VIEW_LAYER& l = m_layers[layers[i]];
1376  l.items->Insert( aItem );
1377  MarkTargetDirty( l.target );
1378  }
1379 }
virtual void DeleteGroup(int aGroupNumber)
Delete the group from the memory.
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:859
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:712
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target &#39;dirty&#39; flag.
Definition: view.h:596
bool IsCached(int aLayer) const
Returns true if the layer is cached.
Definition: view.h:603
size_t i
Definition: json11.cpp:597
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:823
void KIGFX::VIEW::UseDrawPriority ( bool  aFlag)
inlineinherited

Function UseDrawPriority()

Parameters
aFlagis true if draw priority should be respected while redrawing.

Definition at line 667 of file view.h.

References KIGFX::VIEW::m_useDrawPriority.

Referenced by GERBVIEW_FRAME::GERBVIEW_FRAME().

668  {
669  m_useDrawPriority = aFlag;
670  }
bool m_useDrawPriority
Flat list of all items Flag to respect draw priority when drawing items.
Definition: view.h:873

Member Data Documentation

BOX2D KIGFX::VIEW::m_boundary
protectedinherited
VECTOR2D KIGFX::VIEW::m_center
protectedinherited

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

Definition at line 835 of file view.h.

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

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

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

Definition at line 866 of file view.h.

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

bool KIGFX::VIEW::m_dynamic
protectedinherited

Dynamic VIEW (eg.

display PCB in window) allows changes once it is built, static (eg. image/PDF) - does not.

Definition at line 863 of file view.h.

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

bool KIGFX::VIEW::m_enableOrderModifier
protectedinherited
  • Whether to use rendering order modifier or not

Definition at line 820 of file view.h.

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

SCH_BASE_FRAME* KIGFX::SCH_VIEW::m_frame
private

Definition at line 106 of file sch_view.h.

Referenced by DisplaySheet(), and SCH_VIEW().

double KIGFX::VIEW::m_maxScale
protectedinherited

Scale upper limit.

Definition at line 847 of file view.h.

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

double KIGFX::VIEW::m_minScale
protectedinherited

Scale lower limit.

Definition at line 844 of file view.h.

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

bool KIGFX::VIEW::m_mirrorX
protectedinherited

Horizontal flip flag

Definition at line 850 of file view.h.

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

bool KIGFX::VIEW::m_mirrorY
protectedinherited

Vertical flip flag

Definition at line 853 of file view.h.

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

int KIGFX::VIEW::m_nextDrawPriority
protectedinherited

The next sequential drawing priority.

Definition at line 876 of file view.h.

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

LAYER_ORDER KIGFX::VIEW::m_orderedLayers
protectedinherited

Sorted list of pointers to members of m_layers.

Definition at line 829 of file view.h.

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

std::vector<EDA_ITEM *> KIGFX::SCH_VIEW::m_ownedItems
private

Definition at line 111 of file sch_view.h.

Referenced by AddToPreview(), and ClearPreview().

PAINTER* KIGFX::VIEW::m_painter
protectedinherited
std::unique_ptr<KIGFX::VIEW_GROUP> KIGFX::SCH_VIEW::m_preview
private
int KIGFX::VIEW::m_printMode
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 883 of file view.h.

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

bool KIGFX::VIEW::m_reverseDrawOrder
protectedinherited

Flag to reverse the draw order when using draw priority.

Definition at line 879 of file view.h.

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

double KIGFX::VIEW::m_scale
protectedinherited

Scale of displayed VIEW_ITEMs.

Definition at line 838 of file view.h.

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

std::unique_ptr<KIGFX::PREVIEW::SELECTION_AREA> KIGFX::SCH_VIEW::m_selectionArea
private

Definition at line 109 of file sch_view.h.

Referenced by DisplayComponent(), DisplaySheet(), SCH_VIEW(), and ShowSelectionArea().

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

Stores set of layers that are displayed on the top.

Definition at line 832 of file view.h.

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

bool KIGFX::VIEW::m_useDrawPriority
protectedinherited

Flat list of all items Flag to respect draw priority when drawing items.

Definition at line 873 of file view.h.

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

std::unique_ptr<WORKSHEET_VIEWITEM> KIGFX::SCH_VIEW::m_worksheet
private

Definition at line 108 of file sch_view.h.

Referenced by DisplaySheet().

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

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

Definition at line 869 of file view.h.

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


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