KiCad PCB EDA Suite
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  * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef __VIEW_H
26 #define __VIEW_H
27 
28 #include <vector>
29 #include <set>
30 #include <unordered_map>
31 
32 #include <math/box2.h>
33 #include <gal/definitions.h>
34 
35 namespace KIGFX
36 {
37 class PAINTER;
38 class GAL;
39 class VIEW_ITEM;
40 class VIEW_GROUP;
41 class VIEW_RTREE;
42 
58 class VIEW
59 {
60 public:
61  friend class VIEW_ITEM;
62 
63  typedef std::pair<VIEW_ITEM*, int> LAYER_ITEM_PAIR;
64 
69  VIEW( bool aIsDynamic = true );
70 
71  virtual ~VIEW();
72 
73  // nasty hack, invoked by the destructor of VIEW_ITEM to auto-remove the item
74  // from the owning VIEW if there is any. Kicad relies too much on this mechanism.
75  // this is the only linking dependency now between EDA_ITEM and VIEW class. In near future
76  // I'll replace it with observers.
77  static void OnDestroy( VIEW_ITEM* aItem );
78 
86  virtual void Add( VIEW_ITEM* aItem, int aDrawPriority = -1 );
87 
93  virtual void Remove( VIEW_ITEM* aItem );
94 
95 
105  virtual int Query( const BOX2I& aRect, std::vector<LAYER_ITEM_PAIR>& aResult ) const;
106 
113  void SetVisible( VIEW_ITEM* aItem, bool aIsVisible = true );
114 
121  void Hide( VIEW_ITEM* aItem, bool aHide = true );
122 
130  bool IsVisible( const VIEW_ITEM* aItem ) const;
131 
139  virtual void Update( VIEW_ITEM* aItem, int aUpdateFlags );
140  virtual void Update( VIEW_ITEM* aItem );
141 
150  void SetRequired( int aLayerId, int aRequiredId, bool aRequired = true );
151 
157  void CopySettings( const VIEW* aOtherView );
158 
159  /*
160  * Convenience wrappers for adding multiple items
161  * template <class T> void AddItems( const T& aItems );
162  * template <class T> void RemoveItems( const T& aItems );
163  */
164 
170  void SetGAL( GAL* aGal );
171 
177  inline GAL* GetGAL() const
178  {
179  return m_gal;
180  }
181 
186  inline void SetPainter( PAINTER* aPainter )
187  {
188  m_painter = aPainter;
189  }
190 
196  inline PAINTER* GetPainter() const
197  {
198  return m_painter;
199  }
200 
206  void SetViewport( const BOX2D& aViewport );
207 
213  BOX2D GetViewport() const;
214 
221  void SetMirror( bool aMirrorX, bool aMirrorY );
222 
227  bool IsMirroredX() const
228  {
229  return m_mirrorX;
230  }
231 
236  bool IsMirroredY() const
237  {
238  return m_mirrorY;
239  }
240 
247  inline void SetScale( double aScale )
248  {
249  SetScale( aScale, m_center );
250  }
251 
259  void SetScale( double aScale, const VECTOR2D& aAnchor );
260 
265  inline double GetScale() const
266  {
267  return m_scale;
268  }
269 
275  inline void SetBoundary( const BOX2I& aBoundary )
276  {
277  m_boundary = aBoundary;
278  }
279 
284  inline const BOX2I& GetBoundary() const
285  {
286  return m_boundary;
287  }
288 
295  void SetScaleLimits( double aMaximum, double aMinimum )
296  {
297  wxASSERT_MSG( aMaximum > aMinimum, wxT( "I guess you passed parameters in wrong order" ) );
298 
299  m_minScale = aMinimum;
300  m_maxScale = aMaximum;
301  }
302 
309  void SetCenter( const VECTOR2D& aCenter );
310 
316  const VECTOR2D& GetCenter() const
317  {
318  return m_center;
319  }
320 
327  VECTOR2D ToWorld( const VECTOR2D& aCoord, bool aAbsolute = true ) const;
328 
335  double ToWorld( double aSize ) const;
336 
343  VECTOR2D ToScreen( const VECTOR2D& aCoord, bool aAbsolute = true ) const;
344 
350  double ToScreen( double aSize ) const;
351 
357  const VECTOR2I& GetScreenPixelSize() const;
358 
366  void AddLayer( int aLayer, bool aDisplayOnly = false );
367 
373  void ClearLayer( int aLayer );
374 
379  void Clear();
380 
387  inline void SetLayerVisible( int aLayer, bool aVisible = true )
388  {
389  wxASSERT( aLayer < (int) m_layers.size() );
390 
391  if( m_layers[aLayer].visible != aVisible )
392  {
393  // Target has to be redrawn after changing its visibility
394  MarkTargetDirty( m_layers[aLayer].target );
395  m_layers[aLayer].visible = aVisible;
396  }
397  }
398 
404  inline bool IsLayerVisible( int aLayer ) const
405  {
406  wxASSERT( aLayer < (int) m_layers.size() );
407 
408  return m_layers.at( aLayer ).visible;
409  }
410 
411  inline void SetLayerDisplayOnly( int aLayer, bool aDisplayOnly = true )
412  {
413  wxASSERT( aLayer < (int) m_layers.size() );
414 
415  m_layers[aLayer].displayOnly = aDisplayOnly;
416  }
417 
424  inline void SetLayerTarget( int aLayer, RENDER_TARGET aTarget )
425  {
426  wxASSERT( aLayer < (int) m_layers.size() );
427 
428  m_layers[aLayer].target = aTarget;
429  }
430 
437  void SetLayerOrder( int aLayer, int aRenderingOrder );
438 
445  int GetLayerOrder( int aLayer ) const;
446 
455  void SortLayers( int aLayers[], int& aCount ) const;
456 
464  void ReorderLayerData( std::unordered_map<int, int> aReorderMap );
465 
472  void UpdateLayerColor( int aLayer );
473 
479  void UpdateAllLayersColor();
480 
488  virtual void SetTopLayer( int aLayer, bool aEnabled = true );
489 
497  virtual void EnableTopLayer( bool aEnable );
498 
499  virtual int GetTopLayer() const;
500 
506  void ClearTopLayers();
507 
513  void UpdateAllLayersOrder();
514 
519  void ClearTargets();
520 
525  virtual void Redraw();
526 
531  void RecacheAllItems();
532 
538  bool IsDynamic() const
539  {
540  return m_dynamic;
541  }
542 
548  bool IsDirty() const
549  {
550  for( int i = 0; i < TARGETS_NUMBER; ++i )
551  {
552  if( IsTargetDirty( i ) )
553  return true;
554  }
555 
556  return false;
557  }
558 
565  bool IsTargetDirty( int aTarget ) const
566  {
567  wxASSERT( aTarget < TARGETS_NUMBER );
568 
569  return m_dirtyTargets[aTarget];
570  }
571 
577  inline void MarkTargetDirty( int aTarget )
578  {
579  wxASSERT( aTarget < TARGETS_NUMBER );
580 
581  m_dirtyTargets[aTarget] = true;
582  }
583 
585  inline bool IsCached( int aLayer ) const
586  {
587  wxASSERT( aLayer < (int) m_layers.size() );
588 
589  try
590  {
591  return m_layers.at( aLayer ).target == TARGET_CACHED;
592  }
593  catch( std::out_of_range )
594  {
595  return false;
596  }
597  }
598 
603  void MarkDirty()
604  {
605  for( int i = 0; i < TARGETS_NUMBER; ++i )
606  m_dirtyTargets[i] = true;
607  }
608 
614  void MarkForUpdate( VIEW_ITEM* aItem );
615 
620  void UpdateItems();
621 
626  void UpdateAllItems( int aUpdateFlags );
627 
633  void UpdateAllItemsConditionally( int aUpdateFlags,
634  std::function<bool( VIEW_ITEM* )> aCondition );
635 
636  const BOX2I CalculateExtents() ;
637 
642  bool IsUsingDrawPriority() const
643  {
644  return m_useDrawPriority;
645  }
646 
651  void UseDrawPriority( bool aFlag )
652  {
653  m_useDrawPriority = aFlag;
654  }
655 
660  bool IsDrawOrderReversed() const
661  {
662  return m_reverseDrawOrder;
663  }
664 
670  void ReverseDrawOrder( bool aFlag )
671  {
672  m_reverseDrawOrder = aFlag;
673  }
674 
675  static const int VIEW_MAX_LAYERS = 512;
676 
677 
678 private:
679  struct VIEW_LAYER
680  {
681  bool visible;
682  bool displayOnly;
685  int id;
687  std::set<int> requiredLayers;
688  };
689 
690  // Convenience typedefs
691  typedef std::unordered_map<int, VIEW_LAYER> LAYER_MAP;
692  typedef LAYER_MAP::iterator LAYER_MAP_ITER;
693  typedef std::vector<VIEW_LAYER*> LAYER_ORDER;
694  typedef std::vector<VIEW_LAYER*>::iterator LAYER_ORDER_ITER;
695 
696  // Function objects that need to access VIEW/VIEW_ITEM private/protected members
697  struct clearLayerCache;
698  struct recacheItem;
699  struct drawItem;
700  struct unlinkItem;
701  struct updateItemsColor;
702  struct changeItemsDepth;
703  struct extentsVisitor;
704 
705 
707  void redrawRect( const BOX2I& aRect );
708 
709  inline void markTargetClean( int aTarget )
710  {
711  wxASSERT( aTarget < TARGETS_NUMBER );
712 
713  m_dirtyTargets[aTarget] = false;
714  }
715 
726  void draw( VIEW_ITEM* aItem, int aLayer, bool aImmediate = false );
727 
736  void draw( VIEW_ITEM* aItem, bool aImmediate = false );
737 
746  void draw( VIEW_GROUP* aGroup, bool aImmediate = false );
747 
749  void sortLayers();
750 
753  void clearGroupCache();
754 
761  void invalidateItem( VIEW_ITEM* aItem, int aUpdateFlags );
762 
764  void updateItemColor( VIEW_ITEM* aItem, int aLayer );
765 
767  void updateItemGeometry( VIEW_ITEM* aItem, int aLayer );
768 
770  void updateBbox( VIEW_ITEM* aItem );
771 
773  void updateLayers( VIEW_ITEM* aItem );
774 
777  {
778  return aI->renderingOrder > aJ->renderingOrder;
779  }
780 
782  bool areRequiredLayersEnabled( int aLayerId ) const;
783 
786 
788  LAYER_MAP m_layers;
789 
791  LAYER_ORDER m_orderedLayers;
792 
794  std::set<unsigned int> m_topLayers;
795 
798 
800  double m_scale;
801 
804 
806  double m_minScale;
807 
809  double m_maxScale;
810 
812  bool m_mirrorX;
813 
815  bool m_mirrorY;
816 
819 
822 
825  bool m_dynamic;
826 
829 
831  static const int TOP_LAYER_MODIFIER;
832 
834  std::vector<VIEW_ITEM*> m_allItems;
835 
838 
841 
844 };
845 } // namespace KIGFX
846 
847 #endif
void MarkForUpdate(VIEW_ITEM *aItem)
Function MarkForUpdate() Adds an item to a list of items that are going to be refreshed upon the next...
void SetScaleLimits(double aMaximum, double aMinimum)
Function SetScaleLimits() Sets minimum and maximum values for scale.
Definition: view.h:295
void Hide(VIEW_ITEM *aItem, bool aHide=true)
Temporarily hides the item in the view (e.g.
Definition: view.cpp:1466
Number of available rendering targets.
Definition: definitions.h:44
const VECTOR2D & GetCenter() const
Function GetCenter() Returns the center point of this VIEW (in world space coordinates) ...
Definition: view.h:316
virtual int GetTopLayer() const
Definition: view.cpp:794
void SetViewport(const BOX2D &aViewport)
Function SetViewport() Sets the visible area of the VIEW.
Definition: view.cpp:536
void updateLayers(VIEW_ITEM *aItem)
Updates set of layers that an item occupies.
Definition: view.cpp:1274
void AddLayer(int aLayer, bool aDisplayOnly=false)
Function AddLayer() Adds a new layer to the view.
Definition: view.cpp:317
void UpdateAllItemsConditionally(int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
Updates items in the view according to the given flags and condition.
Definition: view.cpp:1390
void ReverseDrawOrder(bool aFlag)
Function ReverseDrawOrder() Only takes effect if UseDrawPriority is true.
Definition: view.h:670
void SetLayerOrder(int aLayer, int aRenderingOrder)
Function SetLayerOrder() Sets rendering order of a particular layer.
Definition: view.cpp:612
void SetRequired(int aLayerId, int aRequiredId, bool aRequired=true)
Function SetRequired() Marks the aRequiredId layer as required for the aLayerId layer.
Definition: view.cpp:404
void updateItemColor(VIEW_ITEM *aItem, int aLayer)
Updates colors that are used for an item to be drawn.
Definition: view.cpp:1209
bool m_useDrawPriority
Flag to respect draw priority when drawing items.
Definition: view.h:837
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:58
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 ...
Definition: view.cpp:803
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.
Definition: view.cpp:440
static const int TOP_LAYER_MODIFIER
Rendering order modifier for layers that are marked as top layers.
Definition: view.h:831
bool IsLayerVisible(int aLayer) const
Function IsLayerVisible() Returns information about visibility of a particular layer.
Definition: view.h:404
void sortLayers()
Definition: view.cpp:1194
bool IsMirroredX() const
Function IsMirroredX() Returns true if view is flipped across the X axis.
Definition: view.h:227
const BOX2I & GetBoundary() const
Function GetBoundary()
Definition: view.h:284
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:463
void UseDrawPriority(bool aFlag)
Function UseDrawPriority()
Definition: view.h:651
void RecacheAllItems()
Function RecacheAllItems() Rebuilds GAL display lists.
Definition: view.cpp:1335
void UpdateAllItems(int aUpdateFlags)
Updates all items in the view according to the given flags.
Definition: view.cpp:1376
virtual void Remove(VIEW_ITEM *aItem)
Function Remove() Removes a VIEW_ITEM from the view.
Definition: view.cpp:364
GAL * m_gal
Gives interface to PAINTER, that is used to draw items.
Definition: view.h:821
std::set< unsigned int > m_topLayers
Stores set of layers that are displayed on the top.
Definition: view.h:794
bool IsMirroredY() const
Function IsMirroredX() Returns true if view is flipped across the Y axis.
Definition: view.h:236
void UpdateAllLayersOrder()
Function UpdateLayerOrder() Does everything that is needed to apply the rendering order of layers...
Definition: view.cpp:870
void SetMirror(bool aMirrorX, bool aMirrorY)
Function SetMirror() Controls the mirroring of the VIEW.
Definition: view.cpp:551
Class VIEW_ITEM - is an abstract base class for deriving all objects that can be added to a VIEW...
Definition: view_item.h:84
bool IsDirty() const
Function IsDirty() Returns true if any of the VIEW layers needs to be refreshened.
Definition: view.h:548
void SetScale(double aScale)
Function SetScale() Sets the scaling factor.
Definition: view.h:247
std::vector< VIEW_LAYER * > LAYER_ORDER
Definition: view.h:693
virtual void EnableTopLayer(bool aEnable)
Function EnableTopLayer() Enables or disables display of the top layer.
Definition: view.cpp:830
VECTOR2D m_center
Center point of the VIEW (the point at which we are looking at)
Definition: view.h:797
void SetBoundary(const BOX2I &aBoundary)
Function SetBoundary() Sets limits for view area.
Definition: view.h:275
double m_minScale
Scale lower limit.
Definition: view.h:806
void SetLayerTarget(int aLayer, RENDER_TARGET aTarget)
Function SetLayerTarget() Changes the rendering target for a particular layer.
Definition: view.h:424
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:626
Class PAINTER contains all the knowledge about how to draw graphical object onto any particular outpu...
Definition: painter.h:278
bool IsUsingDrawPriority() const
Function IsUsingDrawPriority()
Definition: view.h:642
BOX2I m_boundary
View boundaries.
Definition: view.h:803
void SetCenter(const VECTOR2D &aCenter)
Function SetCenter() Sets the center point of the VIEW (i.e.
Definition: view.cpp:587
BOX2D GetViewport() const
Function GetViewport() Returns the current viewport visible area rectangle.
Definition: view.cpp:524
virtual void Redraw()
Function Redraw() Immediately redraws the whole view.
Definition: view.cpp:1085
GAL * GetGAL() const
Function GetGAL() Returns the GAL this view is using to draw graphical primitives.
Definition: view.h:177
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target &#39;dirty&#39; flag.
Definition: view.h:577
void Clear()
Function Clear() Removes all items from the view.
Definition: view.cpp:1051
int GetLayerOrder(int aLayer) const
Function GetLayerOrder() Returns rendering order of a particular layer.
Definition: view.cpp:620
bool visible
is the layer to be rendered?
Definition: view.h:681
const BOX2I CalculateExtents()
Definition: view.cpp:1430
void SetLayerDisplayOnly(int aLayer, bool aDisplayOnly=true)
Definition: view.h:411
std::unordered_map< int, VIEW_LAYER > LAYER_MAP
Definition: view.h:691
static const int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:675
bool m_mirrorX
Horizontal flip flag
Definition: view.h:812
void invalidateItem(VIEW_ITEM *aItem, int aUpdateFlags)
Function invalidateItem() Manages dirty flags & redraw queueing when updating an item.
Definition: view.cpp:1149
bool m_dynamic
Dynamic VIEW (eg.
Definition: view.h:825
Class VIEW_RTREE - Implements an R-tree for fast spatial indexing of VIEW items.
Definition: view_rtree.h:41
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:565
int id
layer ID
Definition: view.h:685
LAYER_ORDER m_orderedLayers
Sorted list of pointers to members of m_layers.
Definition: view.h:791
void SetLayerVisible(int aLayer, bool aVisible=true)
Function SetLayerVisible() Controls the visibility of a particular layer.
Definition: view.h:387
void ReorderLayerData(std::unordered_map< int, int > aReorderMap)
Remaps the data between layer ids without invalidating that data.
Definition: view.cpp:654
void UpdateItems()
Function UpdateItems() Iterates through the list of items that asked for updating and updates them...
Definition: view.cpp:1354
void markTargetClean(int aTarget)
Definition: view.h:709
void updateBbox(VIEW_ITEM *aItem)
Updates bounding box of an item.
Definition: view.cpp:1258
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:196
PAINTER * m_painter
PAINTER contains information how do draw items.
Definition: view.h:818
bool m_reverseDrawOrder
Flag to reverse the draw order when using draw priority.
Definition: view.h:843
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:1499
int m_nextDrawPriority
The next sequential drawing priority.
Definition: view.h:840
void ClearTopLayers()
Function ClearTopLayers() Removes all layers from the on-the-top set (they are no longer displayed ov...
Definition: view.cpp:855
LAYER_MAP::iterator LAYER_MAP_ITER
Definition: view.h:692
void clearGroupCache()
Definition: view.cpp:1134
double m_maxScale
Scale upper limit.
Definition: view.h:809
void UpdateLayerColor(int aLayer)
Function UpdateLayerColor() Applies the new coloring scheme held by RENDER_SETTINGS in case that it h...
Definition: view.cpp:725
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:828
void redrawRect(const BOX2I &aRect)
Definition: view.cpp:950
void updateItemGeometry(VIEW_ITEM *aItem, int aLayer)
Updates all informations needed to draw an item.
Definition: view.cpp:1228
Main rendering target (cached)
Definition: definitions.h:41
bool areRequiredLayersEnabled(int aLayerId) const
Checks if every layer required by the aLayerId layer is enabled.
Definition: view.cpp:1317
bool m_enableOrderModifier
Definition: view.h:785
static void OnDestroy(VIEW_ITEM *aItem)
Definition: view.cpp:269
std::vector< VIEW_ITEM * > m_allItems
Flat list of all items.
Definition: view.h:834
bool IsCached(int aLayer) const
Returns true if the layer is cached.
Definition: view.h:585
std::pair< VIEW_ITEM *, int > LAYER_ITEM_PAIR
Definition: view.h:63
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:969
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:482
const VECTOR2I & GetScreenPixelSize() const
Function GetScreenPixelSize() Returns the size of the our rendering area, in pixels.
Definition: view.cpp:1110
bool m_mirrorY
Vertical flip flag
Definition: view.h:815
void ClearTargets()
Function ClearTargets() Clears targets that are marked as dirty.
Definition: view.cpp:1066
std::vector< VIEW_LAYER * >::iterator LAYER_ORDER_ITER
Definition: view.h:694
double GetScale() const
Function GetScale()
Definition: view.h:265
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Sets the item visibility.
Definition: view.cpp:1445
void CopySettings(const VIEW *aOtherView)
Function CopySettings() Copies layers and visibility settings from another view.
Definition: view.cpp:501
void SetPainter(PAINTER *aPainter)
Function SetPainter() Sets the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:186
LAYER_MAP m_layers
Contains set of possible displayed layers and its properties.
Definition: view.h:788
double m_scale
Scale of displayed VIEW_ITEMs.
Definition: view.h:800
int renderingOrder
rendering order of this layer
Definition: view.h:684
bool displayOnly
is the layer display only?
Definition: view.h:682
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:334
virtual ~VIEW()
Definition: view.cpp:310
RENDER_TARGET
RENDER_TARGET: Possible rendering targets.
Definition: definitions.h:39
VIEW(bool aIsDynamic=true)
Constructor.
Definition: view.cpp:283
Class VIEW.
Definition: view.h:58
bool IsVisible(const VIEW_ITEM *aItem) const
Returns information if the item is visible (or not).
Definition: view.cpp:1485
void UpdateAllLayersColor()
Function UpdateAllLayersColor() Applies the new coloring scheme to all layers.
Definition: view.cpp:743
bool IsDrawOrderReversed() const
Function IsDrawOrderReversed()
Definition: view.h:660
void SetGAL(GAL *aGal)
Function SetGAL() Assigns a rendering device for the VIEW.
Definition: view.cpp:507
void ClearLayer(int aLayer)
Function ClearLayer() Removes all items from a given layer.
static bool compareRenderingOrder(VIEW_LAYER *aI, VIEW_LAYER *aJ)
Determines rendering order of layers. Used in display order sorting function.
Definition: view.h:776
bool IsDynamic() const
Function IsDynamic() Tells if the VIEW is dynamic (ie.
Definition: view.h:538
void MarkDirty()
Function MarkDirty() Forces redraw of view on the next rendering.
Definition: view.h:603
std::set< int > requiredLayers
layers that have to be enabled to show the layer
Definition: view.h:687
Class GAL is the abstract interface for drawing on a 2D-surface.
VIEW_RTREE * items
R-tree indexing all items on this layer.
Definition: view.h:683
RENDER_TARGET target
where the layer should be rendered
Definition: view.h:686