101 bb.
Merge( item->ViewBBox() );
115 constexpr double HIDE = std::numeric_limits<double>::max();
117 std::map<int, std::vector<VIEW_ITEM*>> layer_item_map;
125 std::vector<int> layers = item->ViewGetLayers();
127 for(
auto layer : layers )
129 wxCHECK2_MSG( layer <=
LAYER_ID_COUNT,
continue, wxT(
"Invalid item layer" ) );
130 layer_item_map[ layer ].push_back( item );
134 if( layer_item_map.empty() )
137 std::vector<int> layers;
138 layers.reserve( layer_item_map.size() );
140 for(
const std::pair<
const int, std::vector<VIEW_ITEM*>>& entry : layer_item_map )
141 layers.push_back( entry.first );
149 for(
int layer : layers )
178 for(
VIEW_ITEM* item : layer_item_map[ layer ] )
182 if( item->ViewGetLOD( layer, aView ) == HIDE )
185 if( !painter->
Draw( item, layer ) )
186 item->ViewDraw( layer, aView );
202 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.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
void SortLayers(std::vector< int > aLayers) const
Change the order of given layer ids, so after sorting the order corresponds to layers rendering order...
GAL * GetGAL() const
Return the #GAL this view is using to draw graphical primitives.
bool IsHiddenOnOverlay(const VIEW_ITEM *aItem) const
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.
#define LAYER_ID_COUNT
Must update this if you add any enums after GerbView!
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
@ LAYER_ZONE_START
Virtual layers for stacking zones and tracks on a given copper layer.
@ LAYER_SELECT_OVERLAY
currently selected items overlay
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).