101 bb.
Merge( item->ViewBBox() );
116 std::map<int, std::vector<VIEW_ITEM*>> layer_item_map;
124 std::vector<int> layers = item->ViewGetLayers();
126 for(
auto layer : layers )
128 wxCHECK2_MSG( layer <=
LAYER_ID_COUNT,
continue, wxT(
"Invalid item layer" ) );
129 layer_item_map[ layer ].push_back( item );
133 if( layer_item_map.empty() )
136 std::vector<int> layers;
137 layers.reserve( layer_item_map.size() );
139 for(
const std::pair<
const int, std::vector<VIEW_ITEM*>>& entry : layer_item_map )
140 layers.push_back( entry.first );
148 for(
int layer : layers )
189 for(
VIEW_ITEM* item : layer_item_map[ layer ] )
193 if( item->ViewGetLOD( layer, aView ) ==
LOD_HIDE )
196 if( !painter->
Draw( item, layer ) )
197 item->ViewDraw( layer, aView );
213 for(
unsigned int i = 0 ; i <
GetSize(); i++ )
constexpr void SetMaximum()
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Attribute save/restore for GAL attributes.
Abstract interface for drawing on a 2D-surface.
void AdvanceDepth()
Change the current depth to deeper, so it is possible to draw objects right beneath other.
Contains all the knowledge about how to draw graphical object onto any particular output device.
virtual bool Draw(const VIEW_ITEM *aItem, int aLayer)=0
Takes an instance of VIEW_ITEM and passes it to a function that knows how to draw the item.
virtual void Clear()
Remove all the stored items from the group.
virtual unsigned int GetSize() const
Return the number of stored items.
virtual void ViewDraw(int aLayer, VIEW *aView) const override
Draw all the stored items in the group on the given layer.
virtual VIEW_ITEM * GetItem(unsigned int aIdx) const
void FreeItems()
Free all the items that were added to the group.
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
std::vector< VIEW_ITEM * > m_groupItems
virtual void Remove(VIEW_ITEM *aItem)
Remove an item from the group.
VIEW_GROUP(VIEW *aView=nullptr)
virtual void Add(VIEW_ITEM *aItem)
Add an item to the group.
virtual const std::vector< VIEW_ITEM * > updateDrawList() const
virtual const BOX2I ViewBBox() const override
Return the bounding box for all stored items covering all its layers.
An abstract base class for deriving all objects that can be added to a VIEW.
static constexpr double LOD_HIDE
Return this constant from ViewGetLOD() to hide the item unconditionally.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
GAL * GetGAL() const
Return the #GAL this view is using to draw graphical primitives.
bool IsHiddenOnOverlay(const VIEW_ITEM *aItem) const
void SortLayers(std::vector< int > &aLayers) const
Change the order of given layer ids, so after sorting the order corresponds to layers rendering order...
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
bool IsPadCopperLayer(int aLayer)
#define LAYER_ID_COUNT
Must update this if you add any enums after Gerbview!
bool IsClearanceLayer(int aLayer)
@ LAYER_PAD_COPPER_START
Virtual layers for pad copper on a given copper layer.
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
@ LAYER_VIA_COPPER_START
Virtual layers for via copper on a given copper layer.
@ LAYER_CLEARANCE_START
Virtual layers for pad/via/track clearance outlines for a given copper layer.
@ LAYER_ZONE_START
Virtual layers for stacking zones and tracks on a given copper layer.
@ LAYER_SELECT_OVERLAY
Selected items overlay.
bool IsViaCopperLayer(int aLayer)
bool IsZoneFillLayer(int aLayer)
The Cairo implementation of the graphics abstraction layer.
void delete_matching(_Container &__c, _Value __value)
Covers for the horrifically named std::remove and std::remove_if (neither of which remove anything).