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;
126 item->ViewGetLayers( item_layers, item_layers_count );
128 for(
int i = 0; i < item_layers_count; i++ )
130 wxCHECK2_MSG( item_layers[i] <=
LAYER_ID_COUNT,
continue, wxT(
"Invalid item layer" ) );
131 layer_item_map[ item_layers[i] ].push_back( item );
136 int layers_count = 0;
138 for(
const std::pair<
const int, std::vector<VIEW_ITEM*>>& entry : layer_item_map )
139 layers[ layers_count++ ] = entry.first;
141 if( layers_count == 0 )
150 for(
int i = 0; i < layers_count; i++ )
152 int layer = layers[i];
176 for(
VIEW_ITEM* item : layer_item_map[ layers[i] ] )
180 if( item->ViewGetLOD( layer, aView ) == HIDE )
183 if( !painter->
Draw( item, layers[i] ) )
184 item->ViewDraw( layers[i], aView );
201 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.
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return all the layers used by the stored items.
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(int aLayers[], int &aCount) 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
static constexpr int VIEW_MAX_LAYERS
Rendering order modifier for layers that are marked as top layers.
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).