KiCad PCB EDA Suite
Loading...
Searching...
No Matches
view.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2013-2016 CERN
5 * Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Tomasz Wlostowski <[email protected]>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
27#ifndef __VIEW_H
28#define __VIEW_H
29
30#include <vector>
31#include <set>
32#include <unordered_map>
33#include <memory>
34
35#include <math/box2.h>
36#include <gal/definitions.h>
37
38#include <view/view_overlay.h>
39#include <view/view.h>
40
41class EDA_ITEM;
42
43namespace KIGFX
44{
45class PAINTER;
46class GAL;
47class VIEW_ITEM;
48class VIEW_GROUP;
49class VIEW_RTREE;
50
68class VIEW
69{
70public:
71 friend class VIEW_ITEM;
72
73 typedef std::pair<VIEW_ITEM*, int> LAYER_ITEM_PAIR;
74
78 VIEW( bool aIsDynamic = true );
79
80 virtual ~VIEW();
81
89 static void OnDestroy( VIEW_ITEM* aItem );
90
99 virtual void Add( VIEW_ITEM* aItem, int aDrawPriority = -1 );
100
106 virtual void Remove( VIEW_ITEM* aItem );
107
108
118 virtual int Query( const BOX2I& aRect, std::vector<LAYER_ITEM_PAIR>& aResult ) const;
119
126 void SetVisible( VIEW_ITEM* aItem, bool aIsVisible = true );
127
134 void Hide( VIEW_ITEM* aItem, bool aHide = true );
135
143 bool IsVisible( const VIEW_ITEM* aItem ) const;
144
148 bool HasItem( const VIEW_ITEM* aItem ) const;
149
157 virtual void Update( const VIEW_ITEM* aItem, int aUpdateFlags ) const;
158 virtual void Update( const VIEW_ITEM* aItem ) const;
159
168 void SetRequired( int aLayerId, int aRequiredId, bool aRequired = true );
169
175 void CopySettings( const VIEW* aOtherView );
176
177 /*
178 * Convenience wrappers for adding multiple items
179 * template <class T> void AddItems( const T& aItems );
180 * template <class T> void RemoveItems( const T& aItems );
181 */
182
188 void SetGAL( GAL* aGal );
189
195 inline GAL* GetGAL() const
196 {
197 return m_gal;
198 }
199
203 inline void SetPainter( PAINTER* aPainter )
204 {
205 m_painter = aPainter;
206 }
207
213 inline PAINTER* GetPainter() const
214 {
215 return m_painter;
216 }
217
223 void SetViewport( const BOX2D& aViewport );
224
230 BOX2D GetViewport() const;
231
238 void SetMirror( bool aMirrorX, bool aMirrorY );
239
243 bool IsMirroredX() const
244 {
245 return m_mirrorX;
246 }
247
251 bool IsMirroredY() const
252 {
253 return m_mirrorY;
254 }
255
264 virtual void SetScale( double aScale, VECTOR2D aAnchor = { 0, 0 } );
265
269 inline double GetScale() const
270 {
271 return m_scale;
272 }
273
279 inline void SetBoundary( const BOX2D& aBoundary )
280 {
281 m_boundary = aBoundary;
282 }
283
289 inline void SetBoundary( const BOX2I& aBoundary )
290 {
291 m_boundary.SetOrigin( aBoundary.GetOrigin() );
292 m_boundary.SetEnd( aBoundary.GetEnd() );
293 }
294
298 inline const BOX2D& GetBoundary() const
299 {
300 return m_boundary;
301 }
302
309 void SetScaleLimits( double aMaximum, double aMinimum )
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 }
316
323 void SetCenter( const VECTOR2D& aCenter );
324
332 void SetCenter( const VECTOR2D& aCenter, const std::vector<BOX2D>& obscuringScreenRects );
333
339 const VECTOR2D& GetCenter() const
340 {
341 return m_center;
342 }
343
350 VECTOR2D ToWorld( const VECTOR2D& aCoord, bool aAbsolute = true ) const;
351
358 double ToWorld( double aSize ) const;
359
366 VECTOR2D ToScreen( const VECTOR2D& aCoord, bool aAbsolute = true ) const;
367
373 double ToScreen( double aSize ) const;
374
380 const VECTOR2I& GetScreenPixelSize() const;
381
385 void Clear();
386
393 inline void SetLayerVisible( int aLayer, bool aVisible = true )
394 {
395 wxCHECK( aLayer < (int) m_layers.size(), /*void*/ );
396
397 if( m_layers[aLayer].visible != aVisible )
398 {
399 // Target has to be redrawn after changing its visibility
400 MarkTargetDirty( m_layers[aLayer].target );
401 m_layers[aLayer].visible = aVisible;
402 }
403 }
404
410 inline bool IsLayerVisible( int aLayer ) const
411 {
412 wxCHECK( aLayer >= 0, false);
413 wxCHECK( aLayer < (int) m_layers.size(), false );
414
415 return m_layers.at( aLayer ).visible;
416 }
417
424 inline void SetLayerDiff( int aLayer, bool aDiff = true )
425 {
426 wxCHECK( aLayer < (int) m_layers.size(), /*void*/ );
427
428 if( m_layers[aLayer].diffLayer != aDiff )
429 {
430 // Target has to be redrawn after changing its layers' diff status
431 MarkTargetDirty( m_layers[aLayer].target );
432 m_layers[aLayer].diffLayer = aDiff;
433 }
434 }
435
442 inline void SetLayerHasNegatives( int aLayer, bool aNegatives = true )
443 {
444 wxCHECK( aLayer < (int) m_layers.size(), /*void*/ );
445
446 if( m_layers[aLayer].hasNegatives != aNegatives )
447 {
448 // Target has to be redrawn after changing a layers' negatives
449 MarkTargetDirty( m_layers[aLayer].target );
450 m_layers[aLayer].hasNegatives = aNegatives;
451 }
452 }
453
457 inline void SetLayerDisplayOnly( int aLayer, bool aDisplayOnly = true )
458 {
459 wxCHECK( aLayer < (int) m_layers.size(), /*void*/ );
460 m_layers[aLayer].displayOnly = aDisplayOnly;
461 }
462
469 inline void SetLayerTarget( int aLayer, RENDER_TARGET aTarget )
470 {
471 wxCHECK( aLayer < (int) m_layers.size(), /*void*/ );
472 m_layers[aLayer].target = aTarget;
473 }
474
481 void SetLayerOrder( int aLayer, int aRenderingOrder );
482
489 int GetLayerOrder( int aLayer ) const;
490
499 void SortLayers( int aLayers[], int& aCount ) const;
500
508 void ReorderLayerData( std::unordered_map<int, int> aReorderMap );
509
516 void UpdateLayerColor( int aLayer );
517
524
532 virtual void SetTopLayer( int aLayer, bool aEnabled = true );
533
543 virtual void EnableTopLayer( bool aEnable );
544
545 virtual int GetTopLayer() const;
546
551 void ClearTopLayers();
552
559
563 void ClearTargets();
564
568 virtual void Redraw();
569
573 void RecacheAllItems();
574
579 bool IsDynamic() const
580 {
581 return m_dynamic;
582 }
583
589 bool IsDirty() const
590 {
591 for( int i = 0; i < TARGETS_NUMBER; ++i )
592 {
593 if( IsTargetDirty( i ) )
594 return true;
595 }
596
597 return false;
598 }
599
606 bool IsTargetDirty( int aTarget ) const
607 {
608 wxCHECK( aTarget < TARGETS_NUMBER, false );
609 return m_dirtyTargets[aTarget];
610 }
611
617 inline void MarkTargetDirty( int aTarget )
618 {
619 wxCHECK( aTarget < TARGETS_NUMBER, /* void */ );
620 m_dirtyTargets[aTarget] = true;
621 }
622
624 inline bool IsCached( int aLayer ) const
625 {
626 wxCHECK( aLayer < (int) m_layers.size(), false );
627
628 try
629 {
630 return m_layers.at( aLayer ).target == TARGET_CACHED;
631 }
632 catch( const std::out_of_range& )
633 {
634 return false;
635 }
636 }
637
642 {
643 for( int i = 0; i < TARGETS_NUMBER; ++i )
644 m_dirtyTargets[i] = true;
645 }
646
651 {
652 for( int i = 0; i < TARGETS_NUMBER; ++i )
653 m_dirtyTargets[i] = false;
654 }
655
659 void UpdateItems();
660
666 void UpdateAllItems( int aUpdateFlags );
667
674 void UpdateAllItemsConditionally( int aUpdateFlags,
675 std::function<bool( VIEW_ITEM* )> aCondition );
676
682 void UpdateAllItemsConditionally( std::function<int( VIEW_ITEM* )> aItemFlagsProvider );
683
688 {
689 return m_useDrawPriority;
690 }
691
695 void UseDrawPriority( bool aFlag )
696 {
697 m_useDrawPriority = aFlag;
698 }
699
705 void ReverseDrawOrder( bool aFlag )
706 {
707 m_reverseDrawOrder = aFlag;
708 }
709
710 std::shared_ptr<VIEW_OVERLAY> MakeOverlay();
711
712 void InitPreview();
713
714 void ClearPreview();
715 void AddToPreview( EDA_ITEM* aItem, bool aTakeOwnership = true );
716
717 void ShowPreview( bool aShow = true );
718
724 std::unique_ptr<VIEW> DataReference() const;
725
727 static constexpr int VIEW_MAX_LAYERS = 512;
728
730 static constexpr int TOP_LAYER_MODIFIER = -VIEW_MAX_LAYERS;
731
732protected:
734 {
735 bool visible;
739 std::shared_ptr<VIEW_RTREE> items;
741 int id;
743 std::set<int> requiredLayers;
745 };
746
747
748
749 VIEW( const VIEW& ) = delete;
750
752 void redrawRect( const BOX2I& aRect );
753
754 inline void markTargetClean( int aTarget )
755 {
756 wxCHECK( aTarget < TARGETS_NUMBER, /* void */ );
757 m_dirtyTargets[aTarget] = false;
758 }
759
771 void draw( VIEW_ITEM* aItem, int aLayer, bool aImmediate = false );
772
780 void draw( VIEW_ITEM* aItem, bool aImmediate = false );
781
789 void draw( VIEW_GROUP* aGroup, bool aImmediate = false );
790
792 void sortLayers();
793
796 void clearGroupCache();
797
804 void invalidateItem( VIEW_ITEM* aItem, int aUpdateFlags );
805
807 void updateItemColor( VIEW_ITEM* aItem, int aLayer );
808
810 void updateItemGeometry( VIEW_ITEM* aItem, int aLayer );
811
813 void updateBbox( VIEW_ITEM* aItem );
814
816 void updateLayers( VIEW_ITEM* aItem );
817
820 {
821 return aI->renderingOrder > aJ->renderingOrder;
822 }
823
825 bool areRequiredLayersEnabled( int aLayerId ) const;
826
827 // Function objects that need to access VIEW/VIEW_ITEM private/protected members
828 struct CLEAR_LAYER_CACHE_VISITOR;
829 struct RECACHE_ITEM_VISITOR;
830 struct DRAW_ITEM_VISITOR;
831 struct UPDATE_COLOR_VISITOR;
832 struct UPDATE_DEPTH_VISITOR;
833
834 std::unique_ptr<KIGFX::VIEW_GROUP> m_preview;
835 std::vector<EDA_ITEM *> m_ownedItems;
836
839
841 std::vector<VIEW_LAYER> m_layers;
842
844 std::vector<VIEW_LAYER*> m_orderedLayers;
845
847 std::shared_ptr<std::vector<VIEW_ITEM*>> m_allItems;
848
850 std::set<unsigned int> m_topLayers;
851
854
855 double m_scale;
859
862
865
868
872
875
878
881
884};
885} // namespace KIGFX
886
887#endif
void SetOrigin(const Vec &pos)
Definition: box2.h:202
const Vec & GetOrigin() const
Definition: box2.h:183
const Vec GetEnd() const
Definition: box2.h:185
void SetEnd(coord_type x, coord_type y)
Definition: box2.h:255
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
Abstract interface for drawing on a 2D-surface.
Contains all the knowledge about how to draw graphical object onto any particular output device.
Definition: painter.h:58
Extend VIEW_ITEM by possibility of grouping items into a single object.
Definition: view_group.h:47
An abstract base class for deriving all objects that can be added to a VIEW.
Definition: view_item.h:77
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:69
double GetScale() const
Definition: view.h:269
void SetMirror(bool aMirrorX, bool aMirrorY)
Control the mirroring of the VIEW.
Definition: view.cpp:535
void SortLayers(int aLayers[], int &aCount) const
Change the order of given layer ids, so after sorting the order corresponds to layers rendering order...
Definition: view.cpp:645
void ShowPreview(bool aShow=true)
Definition: view.cpp:1666
void sortLayers()
Clear cached GAL group numbers (ONLY numbers stored in VIEW_ITEMs, not group objects used by GAL)
Definition: view.cpp:1261
bool m_dynamic
Flag to mark targets as dirty so they have to be redrawn on the next refresh event.
Definition: view.h:871
bool IsDynamic() const
Tell if the VIEW is dynamic (ie.
Definition: view.h:579
double m_maxScale
Definition: view.h:858
BOX2D GetViewport() const
Return the current viewport visible area rectangle.
Definition: view.cpp:508
void ReverseDrawOrder(bool aFlag)
Only takes effect if UseDrawPriority is true.
Definition: view.h:705
std::vector< VIEW_LAYER > m_layers
Sorted list of pointers to members of m_layers.
Definition: view.h:841
const VECTOR2D & GetCenter() const
Return the center point of this VIEW (in world space coordinates).
Definition: view.h:339
void CopySettings(const VIEW *aOtherView)
Copy layers and visibility settings from another view.
Definition: view.cpp:483
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Set the scaling factor, zooming around a given anchor point.
Definition: view.cpp:548
static constexpr int TOP_LAYER_MODIFIER
Definition: view.h:730
void draw(VIEW_ITEM *aItem, int aLayer, bool aImmediate=false)
Draw an item, but on a specified layers.
Definition: view.cpp:1032
VIEW(const VIEW &)=delete
bool m_reverseDrawOrder
Definition: view.h:883
void UpdateAllLayersOrder()
Do everything that is needed to apply the rendering order of layers.
Definition: view.cpp:889
void updateItemColor(VIEW_ITEM *aItem, int aLayer)
Update all information needed to draw an item.
Definition: view.cpp:1276
void SetViewport(const BOX2D &aViewport)
Set the visible area of the VIEW.
Definition: view.cpp:520
void SetRequired(int aLayerId, int aRequiredId, bool aRequired=true)
Mark the aRequiredId layer as required for the aLayerId layer.
Definition: view.cpp:386
VECTOR2D ToScreen(const VECTOR2D &aCoord, bool aAbsolute=true) const
Convert a world space point/vector to a point/vector in screen space coordinates.
Definition: view.cpp:464
void SetLayerDisplayOnly(int aLayer, bool aDisplayOnly=true)
Set a layer display-only (ie: to be rendered but not returned by hit test queries).
Definition: view.h:457
static bool compareRenderingOrder(VIEW_LAYER *aI, VIEW_LAYER *aJ)
Check if every layer required by the aLayerId layer is enabled.
Definition: view.h:819
int GetLayerOrder(int aLayer) const
Return rendering order of a particular layer.
Definition: view.cpp:639
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition: view.cpp:314
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
Definition: view.cpp:351
std::vector< EDA_ITEM * > m_ownedItems
Whether to use rendering order modifier or not.
Definition: view.h:835
void ClearTargets()
Clear targets that are marked as dirty.
Definition: view.cpp:1131
virtual void EnableTopLayer(bool aEnable)
Enable or disable display of the top layer.
Definition: view.cpp:849
bool m_mirrorX
Definition: view.h:860
void SetPainter(PAINTER *aPainter)
Set the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:203
void SetBoundary(const BOX2D &aBoundary)
Set limits for view area.
Definition: view.h:279
void UpdateAllLayersColor()
Apply the new coloring scheme to all layers.
Definition: view.cpp:758
bool m_mirrorY
PAINTER contains information how do draw items.
Definition: view.h:861
std::shared_ptr< std::vector< VIEW_ITEM * > > m_allItems
The set of layers that are displayed on the top.
Definition: view.h:847
std::shared_ptr< VIEW_OVERLAY > MakeOverlay()
Definition: view.cpp:1621
void SetLayerDiff(int aLayer, bool aDiff=true)
Set the whether the layer should drawn differentially.
Definition: view.h:424
void SetGAL(GAL *aGal)
Assign a rendering device for the VIEW.
Definition: view.cpp:489
virtual int Query(const BOX2I &aRect, std::vector< LAYER_ITEM_PAIR > &aResult) const
Find all visible items that touch or are within the rectangle aRect.
Definition: view.cpp:422
void SetLayerTarget(int aLayer, RENDER_TARGET aTarget)
Change the rendering target for a particular layer.
Definition: view.h:469
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1608
void invalidateItem(VIEW_ITEM *aItem, int aUpdateFlags)
Manage dirty flags & redraw queuing when updating an item.
Definition: view.cpp:1219
const VECTOR2I & GetScreenPixelSize() const
Return the size of the our rendering area in pixels.
Definition: view.cpp:1183
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
Definition: view.h:393
bool HasItem(const VIEW_ITEM *aItem) const
Indicates whether or not the given item has been added to the view.
Definition: view.cpp:1594
virtual int GetTopLayer() const
Definition: view.cpp:813
PAINTER * m_painter
Interface to #PAINTER that is used to draw items.
Definition: view.h:864
virtual void Redraw()
Immediately redraws the whole view.
Definition: view.cpp:1150
void Clear()
Remove all items from the view.
Definition: view.cpp:1116
std::set< unsigned int > m_topLayers
Center point of the VIEW (the point at which we are looking at).
Definition: view.h:850
void AddToPreview(EDA_ITEM *aItem, bool aTakeOwnership=true)
Definition: view.cpp:1652
bool m_enableOrderModifier
The set of possible displayed layers and its properties.
Definition: view.h:838
void SetLayerHasNegatives(int aLayer, bool aNegatives=true)
Set the status of negatives presense in a particular layer.
Definition: view.h:442
GAL * GetGAL() const
Return the #GAL this view is using to draw graphical primitives.
Definition: view.h:195
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Converts a screen space point/vector to a point/vector in world space coordinates.
Definition: view.cpp:445
void Hide(VIEW_ITEM *aItem, bool aHide=true)
Temporarily hide the item in the view (e.g.
Definition: view.cpp:1567
void ClearTopLayers()
Remove all layers from the on-the-top set (they are no longer displayed over the rest of layers).
Definition: view.cpp:874
void InitPreview()
Definition: view.cpp:1645
bool m_dirtyTargets[TARGETS_NUMBER]
Flag to respect draw priority when drawing items.
Definition: view.h:874
void ClearPreview()
Definition: view.cpp:1630
void MarkClean()
Force redraw of view on the next rendering.
Definition: view.h:650
void updateItemGeometry(VIEW_ITEM *aItem, int aLayer)
Update bounding box of an item.
Definition: view.cpp:1295
static constexpr int VIEW_MAX_LAYERS
Rendering order modifier for layers that are marked as top layers.
Definition: view.h:727
double m_minScale
Definition: view.h:857
double m_scale
Definition: view.h:855
void updateLayers(VIEW_ITEM *aItem)
Determine rendering order of layers. Used in display order sorting function.
Definition: view.cpp:1341
bool IsMirroredX() const
Return true if view is flipped across the X axis.
Definition: view.h:243
void RecacheAllItems()
Rebuild GAL display lists.
Definition: view.cpp:1401
bool areRequiredLayersEnabled(int aLayerId) const
Definition: view.cpp:1384
bool IsTargetDirty(int aTarget) const
Return true if any of layers belonging to the target or the target itself should be redrawn.
Definition: view.h:606
void SetBoundary(const BOX2I &aBoundary)
Set limits for view area.
Definition: view.h:289
int m_nextDrawPriority
Flag to reverse the draw order when using draw priority.
Definition: view.h:880
bool m_useDrawPriority
The next sequential drawing priority.
Definition: view.h:877
void UpdateItems()
Iterate through the list of items that asked for updating and updates them.
Definition: view.cpp:1418
bool IsCached(int aLayer) const
Return true if the layer is cached.
Definition: view.h:624
std::pair< VIEW_ITEM *, int > LAYER_ITEM_PAIR
Definition: view.h:73
bool IsMirroredY() const
Return true if view is flipped across the Y axis.
Definition: view.h:251
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition: view.cpp:1501
void UseDrawPriority(bool aFlag)
Definition: view.h:695
std::unique_ptr< KIGFX::VIEW_GROUP > m_preview
Definition: view.h:834
static void OnDestroy(VIEW_ITEM *aItem)
Nasty hack, invoked by the destructor of VIEW_ITEM to auto-remove the item from the owning VIEW if th...
Definition: view.cpp:241
bool IsUsingDrawPriority() const
Definition: view.h:687
virtual ~VIEW()
Definition: view.cpp:308
GAL * m_gal
Dynamic VIEW (eg.
Definition: view.h:867
bool IsDirty() const
Return true if any of the VIEW layers needs to be refreshened.
Definition: view.h:589
std::unique_ptr< VIEW > DataReference() const
Return a new VIEW object that shares the same set of VIEW_ITEMs and LAYERs.
Definition: view.cpp:1536
virtual void SetTopLayer(int aLayer, bool aEnabled=true)
Set given layer to be displayed on the top or sets back the default order of layers.
Definition: view.cpp:822
void markTargetClean(int aTarget)
Definition: view.h:754
void UpdateLayerColor(int aLayer)
Apply the new coloring scheme held by RENDER_SETTINGS in case that it has changed.
Definition: view.cpp:737
void MarkDirty()
Force redraw of view on the next rendering.
Definition: view.h:641
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
Definition: view.h:410
BOX2D m_boundary
Definition: view.h:856
const BOX2D & GetBoundary() const
Definition: view.h:298
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:213
void SetScaleLimits(double aMaximum, double aMinimum)
Set minimum and maximum values for scale.
Definition: view.h:309
void SetCenter(const VECTOR2D &aCenter)
Set the center point of the VIEW (i.e.
Definition: view.cpp:574
std::vector< VIEW_LAYER * > m_orderedLayers
Flat list of all items.
Definition: view.h:844
void clearGroupCache()
Definition: view.cpp:1207
VECTOR2D m_center
Definition: view.h:853
void SetLayerOrder(int aLayer, int aRenderingOrder)
Set rendering order of a particular layer.
Definition: view.cpp:631
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
Definition: view.h:617
void updateBbox(VIEW_ITEM *aItem)
Update set of layers that an item occupies.
Definition: view.cpp:1325
bool IsVisible(const VIEW_ITEM *aItem) const
Return information if the item is visible (or not).
Definition: view.cpp:1586
void UpdateAllItemsConditionally(int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
Update items in the view according to the given flags and condition.
Definition: view.cpp:1511
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Set the item visibility.
Definition: view.cpp:1546
void ReorderLayerData(std::unordered_map< int, int > aReorderMap)
Remap the data between layer ids without invalidating that data.
Definition: view.cpp:673
void redrawRect(const BOX2I &aRect)
Definition: view.cpp:989
The Cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:246
RENDER_TARGET
RENDER_TARGET: Possible rendering targets.
Definition: definitions.h:47
@ TARGET_CACHED
Main rendering target (cached)
Definition: definitions.h:48
@ TARGETS_NUMBER
Number of available rendering targets.
Definition: definitions.h:52
std::set< int > requiredLayers
Layers that have to be enabled to show the layer.
Definition: view.h:743
bool diffLayer
Layer should be drawn differentially over lower layers.
Definition: view.h:737
int renderingOrder
Rendering order of this layer.
Definition: view.h:740
bool hasNegatives
Layer should be drawn separately to not delete lower layers.
Definition: view.h:738
bool visible
Is the layer to be rendered?
Definition: view.h:735
bool displayOnly
Is the layer display only?
Definition: view.h:736
std::shared_ptr< VIEW_RTREE > items
R-tree indexing all items on this layer.
Definition: view.h:739
RENDER_TARGET target
Where the layer should be rendered.
Definition: view.h:742
int id
Layer ID.
Definition: view.h:741