KiCad PCB EDA Suite
|
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the GAL. More...
#include <view.h>
Classes | |
struct | CLEAR_LAYER_CACHE_VISITOR |
struct | DRAW_ITEM_VISITOR |
struct | RECACHE_ITEM_VISITOR |
struct | UPDATE_COLOR_VISITOR |
struct | UPDATE_DEPTH_VISITOR |
struct | VIEW_LAYER |
Public Types | |
typedef std::pair< VIEW_ITEM *, int > | LAYER_ITEM_PAIR |
Public Member Functions | |
VIEW () | |
virtual | ~VIEW () |
virtual void | Add (VIEW_ITEM *aItem, int aDrawPriority=-1) |
Add a VIEW_ITEM to the view. | |
virtual void | Remove (VIEW_ITEM *aItem) |
Remove a VIEW_ITEM from the view. | |
int | Query (const BOX2I &aRect, std::vector< LAYER_ITEM_PAIR > &aResult) const |
Find all visible items that touch or are within the rectangle aRect. | |
void | Query (const BOX2I &aRect, const std::function< bool(VIEW_ITEM *)> &aFunc) const |
Run a function on all visible items that touch or are within the rectangle aRect. | |
void | SetVisible (VIEW_ITEM *aItem, bool aIsVisible=true) |
Set the item visibility. | |
void | Hide (VIEW_ITEM *aItem, bool aHide=true, bool aHideOverlay=false) |
Temporarily hide the item in the view (e.g. | |
bool | IsVisible (const VIEW_ITEM *aItem) const |
Return information if the item is visible (or not). | |
bool | IsHiddenOnOverlay (const VIEW_ITEM *aItem) const |
bool | HasItem (const VIEW_ITEM *aItem) const |
Indicates whether or not the given item has been added to the view. | |
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 changed. | |
virtual void | Update (const VIEW_ITEM *aItem) const |
void | SetRequired (int aLayerId, int aRequiredId, bool aRequired=true) |
Mark the aRequiredId layer as required for the aLayerId layer. | |
void | CopySettings (const VIEW *aOtherView) |
Copy layers and visibility settings from another view. | |
void | SetGAL (GAL *aGal) |
Assign a rendering device for the VIEW. | |
GAL * | GetGAL () const |
Return the #GAL this view is using to draw graphical primitives. | |
void | SetPainter (PAINTER *aPainter) |
Set the painter object used by the view for drawing #VIEW_ITEMS. | |
PAINTER * | GetPainter () const |
Return the painter object used by the view for drawing #VIEW_ITEMS. | |
void | SetViewport (const BOX2D &aViewport) |
Set the visible area of the VIEW. | |
BOX2D | GetViewport () const |
Return the current viewport visible area rectangle. | |
void | SetMirror (bool aMirrorX, bool aMirrorY) |
Control the mirroring of the VIEW. | |
bool | IsMirroredX () const |
Return true if view is flipped across the X axis. | |
bool | IsMirroredY () const |
Return true if view is flipped across the Y axis. | |
virtual void | SetScale (double aScale, VECTOR2D aAnchor={ 0, 0 }) |
Set the scaling factor, zooming around a given anchor point. | |
double | GetScale () const |
void | SetBoundary (const BOX2D &aBoundary) |
Set limits for view area. | |
void | SetBoundary (const BOX2I &aBoundary) |
Set limits for view area. | |
const BOX2D & | GetBoundary () const |
void | SetScaleLimits (double aMaximum, double aMinimum) |
Set minimum and maximum values for scale. | |
void | SetCenter (const VECTOR2D &aCenter) |
Set the center point of the VIEW (i.e. | |
void | SetCenter (const VECTOR2D &aCenter, const std::vector< BOX2D > &obscuringScreenRects) |
Set the center point of the VIEW, attempting to avoid obscuringScreenRects (for instance, the screen rect of a modeless dialog in front of the VIEW). | |
const VECTOR2D & | GetCenter () const |
Return the center point of this VIEW (in world space coordinates). | |
VECTOR2D | ToWorld (const VECTOR2D &aCoord, bool aAbsolute=true) const |
Converts a screen space point/vector to a point/vector in world space coordinates. | |
double | ToWorld (double aSize) const |
Converts a screen space one dimensional size to a one dimensional size in world space coordinates. | |
VECTOR2D | ToScreen (const VECTOR2D &aCoord, bool aAbsolute=true) const |
Convert a world space point/vector to a point/vector in screen space coordinates. | |
double | ToScreen (double aSize) const |
Convert a world space one dimensional size to a one dimensional size in screen space. | |
const VECTOR2I & | GetScreenPixelSize () const |
Return the size of the our rendering area in pixels. | |
void | Clear () |
Remove all items from the view. | |
void | SetLayerVisible (int aLayer, bool aVisible=true) |
Control the visibility of a particular layer. | |
bool | IsLayerVisible (int aLayer) const |
Return information about visibility of a particular layer. | |
void | SetLayerDiff (int aLayer, bool aDiff=true) |
Set the whether the layer should drawn differentially. | |
void | SetLayerHasNegatives (int aLayer, bool aNegatives=true) |
Set the status of negatives presense in a particular layer. | |
void | SetLayerDisplayOnly (int aLayer, bool aDisplayOnly=true) |
Set a layer display-only (ie: to be rendered but not returned by hit test queries). | |
void | SetLayerTarget (int aLayer, RENDER_TARGET aTarget) |
Change the rendering target for a particular layer. | |
void | SetLayerOrder (int aLayer, int aRenderingOrder) |
Set rendering order of a particular layer. | |
int | GetLayerOrder (int aLayer) const |
Return rendering order of a particular layer. | |
void | SortLayers (std::vector< int > aLayers) const |
Change the order of given layer ids, so after sorting the order corresponds to layers rendering order (descending, ie. | |
void | ReorderLayerData (std::unordered_map< int, int > aReorderMap) |
Remap the data between layer ids without invalidating that data. | |
void | UpdateLayerColor (int aLayer) |
Apply the new coloring scheme held by RENDER_SETTINGS in case that it has changed. | |
void | UpdateAllLayersColor () |
Apply the new coloring scheme to all layers. | |
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. | |
virtual void | EnableTopLayer (bool aEnable) |
Enable or disable display of the top layer. | |
virtual int | GetTopLayer () const |
void | ClearTopLayers () |
Remove all layers from the on-the-top set (they are no longer displayed over the rest of layers). | |
void | UpdateAllLayersOrder () |
Do everything that is needed to apply the rendering order of layers. | |
void | ClearTargets () |
Clear targets that are marked as dirty. | |
virtual void | Redraw () |
Immediately redraws the whole view. | |
void | RecacheAllItems () |
Rebuild GAL display lists. | |
bool | IsDirty () const |
Return true if any of the VIEW layers needs to be refreshened. | |
bool | IsTargetDirty (int aTarget) const |
Return true if any of layers belonging to the target or the target itself should be redrawn. | |
void | MarkTargetDirty (int aTarget) |
Set or clear target 'dirty' flag. | |
bool | IsCached (int aLayer) const |
Return true if the layer is cached. | |
void | MarkDirty () |
Force redraw of view on the next rendering. | |
void | MarkClean () |
Force redraw of view on the next rendering. | |
void | UpdateItems () |
Iterate through the list of items that asked for updating and updates them. | |
void | UpdateAllItems (int aUpdateFlags) |
Update all items in the view according to the given flags. | |
void | UpdateAllItemsConditionally (int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition) |
Update items in the view according to the given flags and condition. | |
void | UpdateAllItemsConditionally (std::function< int(VIEW_ITEM *)> aItemFlagsProvider) |
Update items in the view according to the flags returned by the callback. | |
bool | IsUsingDrawPriority () const |
void | UseDrawPriority (bool aFlag) |
void | ReverseDrawOrder (bool aFlag) |
Only takes effect if UseDrawPriority is true. | |
std::shared_ptr< VIEW_OVERLAY > | MakeOverlay () |
void | InitPreview () |
void | ClearPreview () |
void | AddToPreview (VIEW_ITEM *aItem, bool aTakeOwnership=true) |
void | ShowPreview (bool aShow=true) |
std::unique_ptr< VIEW > | DataReference () const |
Return a new VIEW object that shares the same set of VIEW_ITEMs and LAYERs. | |
Static Public Member Functions | |
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 there is any. | |
Static Public Attributes | |
static constexpr int | VIEW_MAX_LAYERS = 512 |
Rendering order modifier for layers that are marked as top layers. | |
static constexpr int | TOP_LAYER_MODIFIER = -VIEW_MAX_LAYERS |
Protected Member Functions | |
VIEW (const VIEW &)=delete | |
void | redrawRect (const BOX2I &aRect) |
void | markTargetClean (int aTarget) |
void | draw (VIEW_ITEM *aItem, int aLayer, bool aImmediate=false) |
Draw an item, but on a specified layers. | |
void | draw (VIEW_ITEM *aItem, bool aImmediate=false) |
Draw an item on all layers that the item uses. | |
void | draw (VIEW_GROUP *aGroup, bool aImmediate=false) |
Draw a group of items on all layers that those items use. | |
void | sortOrderedLayers () |
Clear cached GAL group numbers (ONLY numbers stored in VIEW_ITEMs, not group objects used by GAL) | |
void | clearGroupCache () |
void | invalidateItem (VIEW_ITEM *aItem, int aUpdateFlags) |
Manage dirty flags & redraw queuing when updating an item. | |
void | updateItemColor (VIEW_ITEM *aItem, int aLayer) |
Update all information needed to draw an item. | |
void | updateItemGeometry (VIEW_ITEM *aItem, int aLayer) |
Update bounding box of an item. | |
void | updateBbox (VIEW_ITEM *aItem) |
Update set of layers that an item occupies. | |
void | updateLayers (VIEW_ITEM *aItem) |
Determine rendering order of layers. Used in display order sorting function. | |
bool | areRequiredLayersEnabled (int aLayerId) const |
Static Protected Member Functions | |
static bool | compareRenderingOrder (VIEW_LAYER *aI, VIEW_LAYER *aJ) |
Check if every layer required by the aLayerId layer is enabled. | |
Protected Attributes | |
std::unique_ptr< KIGFX::VIEW_GROUP > | m_preview |
std::vector< VIEW_ITEM * > | m_ownedItems |
Whether to use rendering order modifier or not. | |
bool | m_enableOrderModifier |
The set of possible displayed layers and its properties. | |
std::map< int, VIEW_LAYER > | m_layers |
Sorted list of pointers to members of m_layers. | |
std::vector< VIEW_LAYER * > | m_orderedLayers |
Flat list of all items. | |
std::shared_ptr< std::vector< VIEW_ITEM * > > | m_allItems |
The set of layers that are displayed on the top. | |
std::set< unsigned int > | m_topLayers |
Center point of the VIEW (the point at which we are looking at). | |
VECTOR2D | m_center |
double | m_scale |
BOX2D | m_boundary |
double | m_minScale |
double | m_maxScale |
bool | m_mirrorX |
bool | m_mirrorY |
PAINTER contains information how do draw items. | |
PAINTER * | m_painter |
Interface to #PAINTER that is used to draw items. | |
GAL * | m_gal |
Flag to mark targets as dirty so they have to be redrawn on the next refresh event. | |
bool | m_dirtyTargets [TARGETS_NUMBER] |
Flag to respect draw priority when drawing items. | |
bool | m_useDrawPriority |
The next sequential drawing priority. | |
int | m_nextDrawPriority |
Flag to reverse the draw order when using draw priority. | |
bool | m_reverseDrawOrder |
Friends | |
class | VIEW_ITEM |
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the GAL.
VIEWs can exist in two flavors:
Items in a view are grouped in layers (not to be confused with Kicad's PCB layers). Each layer is identified by an integer number. Visibility and rendering order can be set individually for each of the layers. Future versions of the VIEW will also allows one to assign different layers to different rendering targets, which will be composited at the final stage by the GAL. The VIEW class also provides fast methods for finding all visible objects that are within a given rectangular area, useful for object selection/hit testing.
typedef std::pair<VIEW_ITEM*, int> KIGFX::VIEW::LAYER_ITEM_PAIR |
KIGFX::VIEW::VIEW | ( | ) |
Definition at line 240 of file view.cpp.
References _, Add(), KIGFX::VIEW::VIEW_LAYER::diffLayer, KIGFX::VIEW::VIEW_LAYER::displayOnly, KIGFX::VIEW::VIEW_LAYER::hasNegatives, KIGFX::VIEW::VIEW_LAYER::id, KIGFX::VIEW::VIEW_LAYER::items, m_allItems, m_boundary, m_layers, m_preview, MarkDirty(), KIGFX::VIEW::VIEW_LAYER::renderingOrder, BOX2< Vec >::SetOrigin(), BOX2< Vec >::SetSize(), sortOrderedLayers(), KIGFX::VIEW::VIEW_LAYER::target, KIGFX::TARGET_CACHED, VIEW_MAX_LAYERS, and KIGFX::VIEW::VIEW_LAYER::visible.
|
virtual |
|
protecteddelete |
|
virtual |
Add a VIEW_ITEM to the view.
Set aDrawPriority to -1 to assign sequential priorities.
aItem | item to be added. No ownership is given |
aDrawPriority | priority to draw this item on its layer, lowest first. |
Reimplemented in KIGFX::PCB_VIEW.
Definition at line 299 of file view.cpp.
References KIGFX::INITIAL_ADD, KIGFX::VIEW::VIEW_LAYER::items, m_allItems, KIGFX::VIEW_ITEM_DATA::m_bbox, KIGFX::VIEW_ITEM_DATA::m_cachedIndex, KIGFX::VIEW_ITEM_DATA::m_drawPriority, m_layers, m_nextDrawPriority, KIGFX::VIEW_ITEM_DATA::m_view, KIGFX::VIEW_ITEM::m_viewPrivData, MarkTargetDirty(), KIGFX::VIEW_ITEM_DATA::saveLayers(), SetVisible(), KIGFX::VIEW::VIEW_LAYER::target, Update(), KIGFX::VIEW_ITEM::ViewBBox(), KIGFX::VIEW_ITEM::ViewGetLayers(), and KIGFX::VIEW_ITEM::viewPrivData().
Referenced by PANEL_ZONE_GAL::ActivateSelectedZone(), KIGFX::PCB_VIEW::Add(), SCH_BASE_FRAME::AddToScreen(), PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems(), EDA_DRAW_PANEL_GAL::DebugOverlay(), PCB_DRAW_PANEL_GAL::DisplayBoard(), DESIGN_BLOCK_PREVIEW_WIDGET::DisplayDesignBlock(), SYMBOL_DIFF_WIDGET::DisplayDiff(), PL_DRAW_PANEL_GAL::DisplayDrawingSheet(), SYMBOL_PREVIEW_WIDGET::DisplayPart(), KIGFX::SCH_VIEW::DisplaySheet(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), KIGFX::SCH_VIEW::DisplaySymbol(), SELECTION_TOOL::doSelectionMenu(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawOneBezier(), DRAWING_TOOL::drawShape(), EE_GRID_HELPER::EE_GRID_HELPER(), GRID_HELPER::enableAndGetAnchorDebug(), GRID_HELPER::GRID_HELPER(), SCH_DRAWING_TOOLS::ImportGraphics(), SYMBOL_EDITOR_DRAWING_TOOLS::ImportGraphics(), InitPreview(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), MakeOverlay(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_POINT_EDITOR::OnSelectionChange(), PANEL_ZONE_GAL::PANEL_ZONE_GAL(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PCB_GRID_HELPER::PCB_GRID_HELPER(), DRAWING_TOOL::PlaceImportedGraphics(), DRAWING_TOOL::PlaceTuningPattern(), DIALOG_PAD_PROPERTIES::prepareCanvas(), BOARD_COMMIT::Push(), SCH_COMMIT::pushSchEdit(), GERBVIEW_FRAME::Read_EXCELLON_File(), GERBVIEW_FRAME::Read_GERBER_File(), EE_SELECTION_TOOL::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), BOARD_EDITOR_CONTROL::Reset(), PCB_CONTROL::Reset(), SCH_COMMIT::Revert(), BOARD_COMMIT::Revert(), RULE_AREA_CREATE_HELPER::RULE_AREA_CREATE_HELPER(), GERBVIEW_SELECTION_TOOL::select(), EE_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::selectMultiple(), ZOOM_TOOL::selectRegion(), GERBVIEW_DRAW_PANEL_GAL::SetDrawingSheet(), PCB_DRAW_PANEL_GAL::SetDrawingSheet(), PNS_PCBNEW_DEBUG_DECORATOR::SetView(), PNS_KICAD_IFACE::SetView(), GERBVIEW_DRAW_PANEL_GAL::SwitchBackend(), DS_DATA_ITEM::SyncDrawItems(), DS_DATA_ITEM_POLYGONS::SyncDrawItems(), DS_DATA_ITEM_TEXT::SyncDrawItems(), DS_DATA_ITEM_BITMAP::SyncDrawItems(), DIALOG_ERC::testErc(), SYMBOL_VIEWER_FRAME::updatePreviewSymbol(), VIEW(), and ZONE_CREATE_HELPER::ZONE_CREATE_HELPER().
void KIGFX::VIEW::AddToPreview | ( | VIEW_ITEM * | aItem, |
bool | aTakeOwnership = true |
||
) |
Definition at line 1713 of file view.cpp.
References Hide(), m_ownedItems, m_preview, SetVisible(), and Update().
Referenced by SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape(), SCH_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_DRAWING_TOOLS::DrawTable(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), ROUTER_TOOL::performDragging(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceReferenceImage(), SCH_DRAWING_TOOLS::PlaceSymbol(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace().
|
protected |
Definition at line 1411 of file view.cpp.
References areRequiredLayersEnabled(), and m_layers.
Referenced by areRequiredLayersEnabled(), and redrawRect().
void KIGFX::VIEW::Clear | ( | ) |
Remove all items from the view.
Definition at line 1127 of file view.cpp.
References _, KIGFX::GAL::ClearCache(), m_allItems, m_gal, m_layers, m_nextDrawPriority, and BOX2< Vec >::SetMaximum().
Referenced by KIGFX::SCH_VIEW::Cleanup(), GERBVIEW_FRAME::Clear_DrawLayers(), FOOTPRINT_EDIT_FRAME::Clear_Pcb(), PCB_EDIT_FRAME::Clear_Pcb(), PCB_DRAW_PANEL_GAL::DisplayBoard(), DESIGN_BLOCK_PREVIEW_WIDGET::DisplayDesignBlock(), PL_DRAW_PANEL_GAL::DisplayDrawingSheet(), FOOTPRINT_PREVIEW_PANEL::DisplayFootprint(), FOOTPRINT_PREVIEW_PANEL::DisplayFootprints(), SCH_DRAW_PANEL::DisplaySheet(), KIGFX::SCH_VIEW::DisplaySymbol(), GERBVIEW_FRAME::doCloseWindow(), DISPLAY_FOOTPRINTS_FRAME::InitDisplay(), PCB_EDIT_FRAME::RebuildAndRefresh(), DISPLAY_FOOTPRINTS_FRAME::ReloadFootprint(), DS_PROXY_UNDO_ITEM::Restore(), PCB_BASE_EDIT_FRAME::SetBoard(), SYMBOL_EDIT_FRAME::SetCurSymbol(), GERBVIEW_DRAW_PANEL_GAL::SwitchBackend(), DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME(), FOOTPRINT_PREVIEW_PANEL::~FOOTPRINT_PREVIEW_PANEL(), FOOTPRINT_VIEWER_FRAME::~FOOTPRINT_VIEWER_FRAME(), GERBVIEW_FRAME::~GERBVIEW_FRAME(), and PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME().
|
protected |
void KIGFX::VIEW::ClearPreview | ( | ) |
Definition at line 1691 of file view.cpp.
References m_ownedItems, m_preview, and Update().
Referenced by RULE_AREA_CREATE_HELPER::commitRuleArea(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SYMBOL_EDITOR_DRAWING_TOOLS::doDrawShape(), SCH_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_DRAWING_TOOLS::DrawTable(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), SCH_DRAWING_TOOLS::ImportSheet(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), ROUTER_TOOL::performDragging(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceReferenceImage(), SCH_DRAWING_TOOLS::PlaceSymbol(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace().
void KIGFX::VIEW::ClearTargets | ( | ) |
Clear targets that are marked as dirty.
Definition at line 1142 of file view.cpp.
References KIGFX::GAL::ClearTarget(), IsTargetDirty(), m_gal, MarkDirty(), KIGFX::TARGET_CACHED, KIGFX::TARGET_NONCACHED, and KIGFX::TARGET_OVERLAY.
Referenced by EDA_DRAW_PANEL_GAL::DoRePaint().
void KIGFX::VIEW::ClearTopLayers | ( | ) |
Remove all layers from the on-the-top set (they are no longer displayed over the rest of layers).
Definition at line 881 of file view.cpp.
References m_enableOrderModifier, m_layers, m_topLayers, and TOP_LAYER_MODIFIER.
Referenced by DIALOG_PAD_PROPERTIES::redraw(), EDA_DRAW_PANEL_GAL::SetTopLayer(), GERBVIEW_DRAW_PANEL_GAL::SetTopLayer(), PL_DRAW_PANEL_GAL::SetTopLayer(), and PCB_DRAW_PANEL_GAL::SetTopLayer().
|
inlinestaticprotected |
Check if every layer required by the aLayerId layer is enabled.
Definition at line 839 of file view.h.
References KIGFX::VIEW::VIEW_LAYER::renderingOrder.
Referenced by sortOrderedLayers().
void KIGFX::VIEW::CopySettings | ( | const VIEW * | aOtherView | ) |
std::unique_ptr< VIEW > KIGFX::VIEW::DataReference | ( | ) | const |
Return a new VIEW object that shares the same set of VIEW_ITEMs and LAYERs.
GAL, PAINTER and other properties are left uninitialized. Maximum number of layers that may be shown
Definition at line 1586 of file view.cpp.
References m_allItems, and m_layers.
Referenced by BOARD_PRINTOUT::DrawPage(), and SCH_PRINTOUT::PrintPage().
|
protected |
Draw a group of items on all layers that those items use.
aGroup | is the group to be drawn. |
aImmediate | dictates the way of drawing - it allows one to force immediate drawing mode for cached items. Sort m_orderedLayers when layer rendering order has changed |
Definition at line 1086 of file view.cpp.
References draw(), KIGFX::VIEW_GROUP::GetItem(), and KIGFX::VIEW_GROUP::GetSize().
|
protected |
Draw an item on all layers that the item uses.
aItem | is the item to be drawn. |
aImmediate | dictates the way of drawing - it allows one to force immediate drawing mode for cached items. |
Definition at line 1065 of file view.cpp.
References draw(), KIGFX::GAL::IsOpenGlEngine(), m_gal, m_layers, KIGFX::GAL::SetLayerDepth(), SortLayers(), and KIGFX::VIEW_ITEM::ViewGetLayers().
|
protected |
Draw an item, but on a specified layers.
It has to be marked that some of drawing settings are based on the layer on which an item is drawn.
aItem | is the item to be drawn. |
aLayer | is the layer which should be drawn. |
aImmediate | dictates the way of drawing - it allows one to force immediate drawing mode for cached items. |
Definition at line 1039 of file view.cpp.
References KIGFX::PAINTER::Draw(), KIGFX::GAL::DrawGroup(), KIGFX::VIEW_ITEM_DATA::getGroup(), group, IsCached(), m_gal, m_painter, Update(), KIGFX::VIEW_ITEM::ViewDraw(), and KIGFX::VIEW_ITEM::viewPrivData().
Referenced by KIGFX::VIEW::DRAW_ITEM_VISITOR::deferredDraw(), draw(), and KIGFX::VIEW::DRAW_ITEM_VISITOR::operator()().
|
virtual |
Enable or disable display of the top layer.
When disabled, layers are rendered as usual with no influence from SetTopLayer function. Otherwise on the top there is displayed the layer set previously with SetTopLayer function.
aEnable | whether to enable or disable display of the top layer. |
Definition at line 856 of file view.cpp.
References m_enableOrderModifier, m_layers, m_topLayers, TOP_LAYER_MODIFIER, UpdateAllLayersColor(), and UpdateAllLayersOrder().
Referenced by PCB_DRAW_PANEL_GAL::SetTopLayer().
|
inline |
Definition at line 302 of file view.h.
Referenced by NL_PCBNEW_PLUGIN_IMPL::NL_PCBNEW_PLUGIN_IMPL(), KIGFX::WX_VIEW_CONTROLS::onScroll(), NL_SCHEMATIC_PLUGIN_IMPL::SetCanvas(), NL_GERBVIEW_PLUGIN_IMPL::SetCanvas(), NL_PL_EDITOR_PLUGIN_IMPL::SetCanvas(), and KIGFX::WX_VIEW_CONTROLS::UpdateScrollbars().
|
inline |
Return the center point of this VIEW (in world space coordinates).
Definition at line 343 of file view.h.
Referenced by EDA_DRAW_PANEL_GAL::DoRePaint(), NL_SCHEMATIC_PLUGIN_IMPL::GetCameraMatrix(), NL_GERBVIEW_PLUGIN_IMPL::GetCameraMatrix(), NL_PL_EDITOR_PLUGIN_IMPL::GetCameraMatrix(), NL_PCBNEW_PLUGIN_IMPL::GetCameraMatrix(), KIGFX::WX_VIEW_CONTROLS::onMotion(), KIGFX::WX_VIEW_CONTROLS::onPanGesture(), KIGFX::WX_VIEW_CONTROLS::onScroll(), KIGFX::WX_VIEW_CONTROLS::onTimer(), KIGFX::WX_VIEW_CONTROLS::onWheel(), KIGFX::WX_VIEW_CONTROLS::onZoomGesture(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), NL_SCHEMATIC_PLUGIN_IMPL::SetCameraMatrix(), NL_GERBVIEW_PLUGIN_IMPL::SetCameraMatrix(), NL_PL_EDITOR_PLUGIN_IMPL::SetCameraMatrix(), NL_PCBNEW_PLUGIN_IMPL::SetCameraMatrix(), NL_SCHEMATIC_PLUGIN_IMPL::SetViewExtents(), NL_GERBVIEW_PLUGIN_IMPL::SetViewExtents(), NL_PL_EDITOR_PLUGIN_IMPL::SetViewExtents(), and NL_PCBNEW_PLUGIN_IMPL::SetViewExtents().
|
inline |
Return the #GAL this view is using to draw graphical primitives.
Definition at line 199 of file view.h.
Referenced by EE_GRID_HELPER::BestDragOrigin(), GRID_HELPER::canUseGrid(), KIGFX::WX_VIEW_CONTROLS::CenterOnCursor(), PNS_PCBNEW_DEBUG_DECORATOR::Clear(), COMMON_TOOLS::CursorControl(), PCB_CONTROL::DoSetGridOrigin(), COMMON_TOOLS::doZoomInOut(), drawBacksideTicks(), KIGFX::PREVIEW::CENTRELINE_RECT_ITEM::drawPreviewShape(), KIGFX::PREVIEW::POLYGON_ITEM::drawPreviewShape(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), KIGFX::PREVIEW::DrawTextNextToCursor(), drawTicksAlongLine(), KIGFX::VIEW_OVERLAY::COMMAND_LINE::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_RECTANGLE::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_CIRCLE::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_ARC::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_POLYGON::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_POLY_POLYGON::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_POINT_POLYGON::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_SET_STROKE::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_SET_FILL::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_SET_COLOR::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_SET_WIDTH::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_GLYPH_SIZE::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_BITMAP_TEXT::Execute(), GRID_HELPER::GetGrid(), GRID_HELPER::GetGridSize(), EE_GRID_HELPER::GetGridSize(), PCB_GRID_HELPER::GetGridSize(), GRID_HELPER::GetOrigin(), KIGFX::WX_VIEW_CONTROLS::GetRawCursorPosition(), GRID_HELPER::GetVisibleGrid(), ROUTER_TOOL::handleCommonEvents(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), PCB_VIEWER_TOOLS::MeasureTool(), PNS_PCBNEW_DEBUG_DECORATOR::nextDepth(), COMMON_TOOLS::OnGridChanged(), COMMON_TOOLS::PanControl(), POSITION_RELATIVE_TOOL::PositionRelativeInteractively(), DIALOG_PAD_PROPERTIES::prepareCanvas(), SCH_BASE_FRAME::RefreshZoomDependentItems(), KIGFX::WX_VIEW_CONTROLS::SetCrossHairCursorPosition(), PNS_PCBNEW_DEBUG_DECORATOR::SetView(), KIGFX::VIEW_CONTROLS::ShowCursor(), PNS::TOOL_BASE::updateEndItem(), PNS::TOOL_BASE::updateStartItem(), DS_PROXY_VIEW_ITEM::ViewDraw(), KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::ViewDraw(), EDIT_POINTS::ViewDraw(), TUNING_STATUS_VIEW_ITEM::ViewDraw(), RATSNEST_VIEW_ITEM::ViewDraw(), ROUTER_PREVIEW_ITEM::ViewDraw(), ROUTER_STATUS_VIEW_ITEM::ViewDraw(), MY_DRAWING::ViewDraw(), KIGFX::PREVIEW::ARC_ASSISTANT::ViewDraw(), KIGFX::PREVIEW::BEZIER_ASSISTANT::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), KIGFX::PREVIEW::SELECTION_AREA::ViewDraw(), KIGFX::PREVIEW::TWO_POINT_ASSISTANT::ViewDraw(), KIGFX::ORIGIN_VIEWITEM::ViewDraw(), KIGFX::ANCHOR_DEBUG::ViewDraw(), KIGFX::CONSTRUCTION_GEOM::ViewDraw(), KIGFX::SNAP_INDICATOR::ViewDraw(), KIGFX::VIEW_GROUP::ViewDraw(), KIGFX::VIEW_OVERLAY::ViewDraw(), and KIGFX::WX_VIEW_CONTROLS::WarpMouseCursor().
int KIGFX::VIEW::GetLayerOrder | ( | int | aLayer | ) | const |
Return rendering order of a particular layer.
Lower values are rendered first.
aLayer | is the layer. |
Definition at line 656 of file view.cpp.
References m_layers.
Referenced by ROUTER_PREVIEW_ITEM::ROUTER_PREVIEW_ITEM(), and PCB_DRAW_PANEL_GAL::SetTopLayer().
|
inline |
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition at line 217 of file view.h.
Referenced by PCB_BASE_FRAME::ActivateGalCanvas(), GERBVIEW_FRAME::ApplyDisplaySettingsToGAL(), EDITOR_CONDITIONS::bboxesFunc(), DS_PROXY_VIEW_ITEM::buildDrawList(), GERBVIEW_CONTROL::ClearAllLayers(), BOARD_INSPECTION_TOOL::ClearHighlight(), SCH_BASE_FRAME::CommonSettingsChanged(), PCB_BASE_FRAME::CommonSettingsChanged(), PL_EDITOR_FRAME::CommonSettingsChanged(), PCB_GRID_HELPER::computeAnchors(), DESIGN_BLOCK_PREVIEW_WIDGET::DESIGN_BLOCK_PREVIEW_WIDGET(), SYMBOL_DIFF_WIDGET::DisplayDiff(), SYMBOL_PREVIEW_WIDGET::DisplayPart(), PNS_KICAD_IFACE::DisplayRatline(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), BOARD_INSPECTION_TOOL::doHideRatsnestNet(), KIGFX::PREVIEW::POLYGON_ITEM::drawPreviewShape(), KIGFX::PREVIEW::DrawTextNextToCursor(), PAD_TOOL::EditPad(), PAD_TOOL::EnumeratePads(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), PAD_TOOL::ExitPadEditMode(), PCB_SELECTION_TOOL::FilterCollectorForFootprints(), FOOTPRINT_PREVIEW_PANEL::GetBackgroundColor(), FOOTPRINT_PREVIEW_PANEL::GetForegroundColor(), ROUTER_PREVIEW_ITEM::getLayerColor(), GRID_HELPER::GRID_HELPER(), PCB_SELECTION_TOOL::GuessSelectionCandidates(), GERBVIEW_CONTROL::HighlightControl(), BOARD_INSPECTION_TOOL::HighlightNet(), BOARD_INSPECTION_TOOL::highlightNet(), PNS::TOOL_BASE::highlightNets(), PCB_NET_INSPECTOR_PANEL::highlightSelectedNets(), ROUTER_TOOL::Init(), DRAWING_TOOL::Init(), PCB_SELECTION_TOOL::Init(), PNS_KICAD_IFACE::IsItemVisible(), PCB_EDIT_FRAME::LoadProjectSettings(), PCB_BASE_FRAME::LoadSettings(), DIALOG_PAD_PROPERTIES::onChangePadMode(), PCB_NET_INSPECTOR_PANEL::onClearHighlighting(), ZONE_CREATE_HELPER::OnFirstPoint(), GERBER_LAYER_WIDGET::OnLayerColorChange(), GERBER_LAYER_WIDGET::OnLayerSelect(), APPEARANCE_CONTROLS::onNetclassContextMenu(), PCB_NET_INSPECTOR_PANEL::OnNetsListContextMenu(), GERBVIEW_FRAME::OnSelectActiveDCode(), GERBVIEW_FRAME::OnSelectActiveLayer(), PCB_DRAW_PANEL_GAL::OnShow(), PAD_TOOL::OnUndoRedo(), PCB_GRID_HELPER::PCB_GRID_HELPER(), POSITION_RELATIVE_TOOL::PositionRelativeInteractively(), DIALOG_PAD_PROPERTIES::prepareCanvas(), PCB_SELECTION_TOOL::pruneObscuredSelectionCandidates(), PCB_GRID_HELPER::queryVisible(), NET_GRID_TABLE::Rebuild(), DIALOG_PAD_PROPERTIES::redraw(), FOOTPRINT_PREVIEW_PANEL::renderFootprint(), EE_SELECTION_TOOL::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), PCB_SELECTION_TOOL::Reset(), PCB_EDIT_FRAME::SaveProjectLocalSettings(), PCB_EDIT_FRAME::saveProjectSettings(), SCH_EDIT_FRAME::SCH_EDIT_FRAME(), PCB_SELECTION_TOOL::Selectable(), NETS_SEARCH_HANDLER::SelectItems(), RATSNEST_SEARCH_HANDLER::SelectItems(), PCB_BASE_FRAME::SetBoard(), EDA_DRAW_PANEL_GAL::SetHighContrastLayer(), GERBVIEW_DRAW_PANEL_GAL::SetHighContrastLayer(), PCB_DRAW_PANEL_GAL::SetHighContrastLayer(), PCB_EDIT_FRAME::setupUIConditions(), PCBNEW_PRINTOUT::setupViewLayers(), SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET(), COMMON_TOOLS::ToggleBoundingBoxes(), PCB_DRAW_PANEL_GAL::UpdateColors(), KIGFX::PCB_VIEW::UpdateDisplayOptions(), NET_GRID_TABLE::updateNetColor(), PANEL_EESCHEMA_COLOR_SETTINGS::updatePreview(), PANEL_PCBNEW_COLOR_SETTINGS::updatePreview(), DS_PROXY_VIEW_ITEM::ViewDraw(), EDIT_POINTS::ViewDraw(), RATSNEST_VIEW_ITEM::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), KIGFX::PREVIEW::SELECTION_AREA::ViewDraw(), KIGFX::ANCHOR_DEBUG::ViewDraw(), KIGFX::VIEW_GROUP::ViewDraw(), PAD::ViewGetLOD(), PCB_FIELD::ViewGetLOD(), PCB_REFERENCE_IMAGE::ViewGetLOD(), PCB_SHAPE::ViewGetLOD(), PCB_TEXT::ViewGetLOD(), PCB_TEXTBOX::ViewGetLOD(), PCB_TRACK::ViewGetLOD(), and PCB_VIA::ViewGetLOD().
|
inline |
Definition at line 273 of file view.h.
Referenced by SCH_NAVIGATE_TOOL::changeSheet(), PCB_GRID_HELPER::computeAnchors(), COMMON_TOOLS::doZoomFit(), PAD_TOOL::EnumeratePads(), PCB_SELECTION_TOOL::FindItem(), SCH_FIND_REPLACE_TOOL::FindNext(), PNS_KICAD_IFACE::IsItemVisible(), DIALOG_ERC::OnERCItemSelected(), KIGFX::WX_VIEW_CONTROLS::onMagnify(), KIGFX::WX_VIEW_CONTROLS::onMotion(), SCH_EDIT_FRAME::OnPageSettingsChange(), KIGFX::WX_VIEW_CONTROLS::onWheel(), KIGFX::WX_VIEW_CONTROLS::onZoomGesture(), EE_GRID_HELPER::queryVisible(), PCB_GRID_HELPER::queryVisible(), PCB_EDIT_FRAME::redrawNetnames(), SCH_EDITOR_CONTROL::Revert(), DISPLAY_FOOTPRINTS_FRAME::SaveSettings(), FOOTPRINT_VIEWER_FRAME::SaveSettings(), ZOOM_TOOL::selectRegion(), NL_SCHEMATIC_PLUGIN_IMPL::SetViewExtents(), NL_GERBVIEW_PLUGIN_IMPL::SetViewExtents(), NL_PL_EDITOR_PLUGIN_IMPL::SetViewExtents(), NL_PCBNEW_PLUGIN_IMPL::SetViewExtents(), SetViewport(), PCB_SELECTION_TOOL::ZoomFitCrossProbeBBox(), PANEL_EESCHEMA_COLOR_SETTINGS::zoomFitPreview(), PANEL_PCBNEW_COLOR_SETTINGS::zoomFitPreview(), PANEL_ZONE_GAL::ZoomFitScreen(), and PCB_SELECTION_TOOL::zoomFitSelection().
const VECTOR2I & KIGFX::VIEW::GetScreenPixelSize | ( | ) | const |
Return the size of the our rendering area in pixels.
Definition at line 1186 of file view.cpp.
References KIGFX::GAL::GetScreenPixelSize(), and m_gal.
Referenced by KIGFX::WX_VIEW_CONTROLS::handleAutoPanning(), KIGFX::WX_VIEW_CONTROLS::onScroll(), KIGFX::WX_VIEW_CONTROLS::onTimer(), KIGFX::WX_VIEW_CONTROLS::onWheel(), and KIGFX::WX_VIEW_CONTROLS::PinCursorInsideNonAutoscrollArea().
|
virtual |
Definition at line 820 of file view.cpp.
References m_topLayers.
Referenced by ROUTER_TOOL::getStartLayer(), and BOARD_INSPECTION_TOOL::highlightNet().
BOX2D KIGFX::VIEW::GetViewport | ( | ) | const |
Return the current viewport visible area rectangle.
Definition at line 522 of file view.cpp.
References KIGFX::GAL::GetScreenPixelSize(), m_gal, BOX2< Vec >::Normalize(), BOX2< Vec >::SetEnd(), BOX2< Vec >::SetOrigin(), and ToWorld().
Referenced by drawBacksideTicks(), drawTicksAlongLine(), PCB_SELECTION_TOOL::FilterCollectorForFootprints(), PCB_SELECTION_TOOL::FindItem(), PCB_BASE_FRAME::FocusOnItems(), EDA_DRAW_FRAME::FocusOnLocation(), NL_SCHEMATIC_PLUGIN_IMPL::GetViewExtents(), NL_GERBVIEW_PLUGIN_IMPL::GetViewExtents(), NL_PL_EDITOR_PLUGIN_IMPL::GetViewExtents(), NL_PCBNEW_PLUGIN_IMPL::GetViewExtents(), PCB_SELECTION_TOOL::hitTestDistance(), APPEARANCE_CONTROLS::onViewportChanged(), PCB_EDIT_FRAME::redrawNetnames(), NL_SCHEMATIC_PLUGIN_IMPL::SetViewExtents(), NL_GERBVIEW_PLUGIN_IMPL::SetViewExtents(), NL_PL_EDITOR_PLUGIN_IMPL::SetViewExtents(), NL_PCBNEW_PLUGIN_IMPL::SetViewExtents(), KIGFX::WX_VIEW_CONTROLS::UpdateScrollbars(), DS_PROXY_VIEW_ITEM::ViewDraw(), KIGFX::ANCHOR_DEBUG::ViewDraw(), KIGFX::CONSTRUCTION_GEOM::ViewDraw(), PCB_TRACK::ViewGetLOD(), and EE_SELECTION_TOOL::ZoomFitCrossProbeBBox().
bool KIGFX::VIEW::HasItem | ( | const VIEW_ITEM * | aItem | ) | const |
Indicates whether or not the given item has been added to the view.
Definition at line 1655 of file view.cpp.
References KIGFX::VIEW_ITEM_DATA::m_view, and KIGFX::VIEW_ITEM::viewPrivData().
Referenced by PCB_BASE_FRAME::HideSolderMask(), and PCB_BASE_FRAME::ShowSolderMask().
void KIGFX::VIEW::Hide | ( | VIEW_ITEM * | aItem, |
bool | aHide = true , |
||
bool | aHideOverlay = false |
||
) |
Temporarily hide the item in the view (e.g.
for overlaying).
aItem | the item to modify. |
aHide | whether the item is hidden, or not. |
aHideOverlay | whether the item should also be hidden on overlays. |
Definition at line 1617 of file view.cpp.
References KIGFX::APPEARANCE, KIGFX::HIDDEN, KIGFX::VIEW_ITEM_DATA::m_flags, KIGFX::OVERLAY_HIDDEN, Update(), KIGFX::VIEW_ITEM::viewPrivData(), and KIGFX::VISIBLE.
Referenced by AddToPreview(), KIGFX::SCH_VIEW::ClearHiddenFlags(), PCB_TUNING_PATTERN::EditPush(), PCB_SELECTION_TOOL::EnterGroup(), PCB_SELECTION_TOOL::ExitGroup(), EE_SELECTION_TOOL::highlight(), PCB_SELECTION_TOOL::highlightInternal(), PCB_TEST_SELECTION_TOOL::highlightInternal(), ROUTER_TOOL::InlineDrag(), SCH_EDITOR_CONTROL::Paste(), GERBVIEW_SELECTION_TOOL::selectVisually(), EE_SELECTION_TOOL::unhighlight(), PCB_SELECTION_TOOL::unhighlightInternal(), PCB_TEST_SELECTION_TOOL::unhighlightInternal(), GERBVIEW_SELECTION_TOOL::unselectVisually(), and PCB_TUNING_PATTERN::Update().
void KIGFX::VIEW::InitPreview | ( | ) |
Definition at line 1706 of file view.cpp.
References Add(), and m_preview.
Referenced by KIGFX::SCH_VIEW::DisplaySheet(), KIGFX::SCH_VIEW::DisplaySymbol(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), ROUTER_TOOL::performDragging(), PCB_EDIT_FRAME::RebuildAndRefresh(), and PCB_BASE_EDIT_FRAME::SetBoard().
|
protected |
Manage dirty flags & redraw queuing when updating an item.
aItem | is the item to be updated. |
aUpdateFlags | determines the way an item is refreshed. Update colors that are used for an item to be drawn |
Definition at line 1222 of file view.cpp.
References KIGFX::ALL, KIGFX::VIEW_ITEM_DATA::clearUpdateFlags(), KIGFX::COLOR, KIGFX::GEOMETRY, KIGFX::INITIAL_ADD, IsCached(), KIGFX::LAYERS, m_layers, MarkTargetDirty(), KIGFX::REPAINT, updateBbox(), updateItemColor(), updateItemGeometry(), updateLayers(), KIGFX::VIEW_ITEM::ViewGetLayers(), and KIGFX::VIEW_ITEM::viewPrivData().
Referenced by UpdateItems().
|
inline |
Return true if the layer is cached.
Definition at line 643 of file view.h.
References KIGFX::TARGET_CACHED.
Referenced by draw(), invalidateItem(), RecacheAllItems(), updateItemColor(), UpdateLayerColor(), and updateLayers().
|
inline |
Return true if any of the VIEW layers needs to be refreshened.
Definition at line 608 of file view.h.
References KIGFX::TARGETS_NUMBER.
Referenced by EDA_DRAW_PANEL_GAL::DoRePaint(), and TOOL_MANAGER::ProcessEvent().
bool KIGFX::VIEW::IsHiddenOnOverlay | ( | const VIEW_ITEM * | aItem | ) | const |
Definition at line 1647 of file view.cpp.
References KIGFX::VIEW_ITEM_DATA::m_flags, KIGFX::OVERLAY_HIDDEN, and KIGFX::VIEW_ITEM::viewPrivData().
Referenced by KIGFX::VIEW_GROUP::ViewDraw().
|
inline |
Return information about visibility of a particular layer.
aLayer | true if the layer is visible, false otherwise. |
Definition at line 419 of file view.h.
Referenced by PCB_GRID_HELPER::computeAnchors(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawOneBezier(), DRAWING_TOOL::drawShape(), DRAWING_TOOL::DrawTable(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), PCB_SELECTION_TOOL::FilterCollectorForFootprints(), GERBVIEW_DRAW_PANEL_GAL::GetDefaultViewBBox(), PCB_DRAW_PANEL_GAL::GetDefaultViewBBox(), APPEARANCE_CONTROLS::getVisibleLayers(), GERBVIEW_FRAME::GetVisibleLayers(), APPEARANCE_CONTROLS::getVisibleObjects(), SCH_EDIT_TOOL::Init(), EDIT_TOOL::Init(), PNS_KICAD_IFACE::IsAnyLayerVisible(), DRAWING_TOOL::PlaceImportedGraphics(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Properties(), GERBER_LAYER_WIDGET::ReFill(), PCB_SELECTION_TOOL::Selectable(), GERBVIEW_FRAME::SetElementVisibility(), GERBVIEW_FRAME::UpdateXORLayers(), RATSNEST_VIEW_ITEM::ViewDraw(), KIGFX::VIEW_GROUP::ViewDraw(), FOOTPRINT::ViewGetLOD(), PAD::ViewGetLOD(), PCB_FIELD::ViewGetLOD(), PCB_GROUP::ViewGetLOD(), PCB_REFERENCE_IMAGE::ViewGetLOD(), PCB_SHAPE::ViewGetLOD(), PCB_TEXT::ViewGetLOD(), PCB_TEXTBOX::ViewGetLOD(), PCB_TRACK::ViewGetLOD(), PCB_VIA::ViewGetLOD(), and ZONE::ViewGetLOD().
|
inline |
Return true if view is flipped across the X axis.
Definition at line 247 of file view.h.
Referenced by APPEARANCE_CONTROLS::APPEARANCE_CONTROLS(), COMMON_TOOLS::CursorControl(), APPEARANCE_CONTROLS::doApplyLayerPreset(), drawBacksideTicks(), drawTicksAlongLine(), NL_SCHEMATIC_PLUGIN_IMPL::GetCameraMatrix(), NL_GERBVIEW_PLUGIN_IMPL::GetCameraMatrix(), NL_PL_EDITOR_PLUGIN_IMPL::GetCameraMatrix(), NL_PCBNEW_PLUGIN_IMPL::GetCameraMatrix(), KIGFX::WX_VIEW_CONTROLS::onScroll(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), PCB_EDIT_FRAME::setupUIConditions(), APPEARANCE_CONTROLS::UpdateDisplayOptions(), KIGFX::WX_VIEW_CONTROLS::UpdateScrollbars(), and KIGFX::PREVIEW::SELECTION_AREA::ViewDraw().
|
inline |
Return true if view is flipped across the Y axis.
Definition at line 255 of file view.h.
Referenced by APPEARANCE_CONTROLS::doApplyLayerPreset(), NL_SCHEMATIC_PLUGIN_IMPL::GetCameraMatrix(), NL_GERBVIEW_PLUGIN_IMPL::GetCameraMatrix(), NL_PL_EDITOR_PLUGIN_IMPL::GetCameraMatrix(), and NL_PCBNEW_PLUGIN_IMPL::GetCameraMatrix().
|
inline |
Return true if any of layers belonging to the target or the target itself should be redrawn.
Definition at line 625 of file view.h.
References KIGFX::TARGETS_NUMBER.
Referenced by ClearTargets(), EDA_DRAW_PANEL_GAL::DoRePaint(), and redrawRect().
|
inline |
bool KIGFX::VIEW::IsVisible | ( | const VIEW_ITEM * | aItem | ) | const |
Return information if the item is visible (or not).
aItem | the item to test. |
Definition at line 1639 of file view.cpp.
References KIGFX::VIEW_ITEM_DATA::m_flags, KIGFX::VIEW_ITEM::viewPrivData(), and KIGFX::VISIBLE.
Referenced by EE_GRID_HELPER::BestSnapAnchor(), PCB_GRID_HELPER::computeAnchors(), PAD_TOOL::EnumeratePads(), EE_GRID_HELPER::GetGrid(), PNS_KICAD_IFACE::HideItem(), PNS_KICAD_IFACE::IsItemVisible(), EE_GRID_HELPER::queryVisible(), PCB_GRID_HELPER::queryVisible(), PCB_SELECTION_TOOL::Selectable(), and GRID_HELPER::updateSnapPoint().
std::shared_ptr< VIEW_OVERLAY > KIGFX::VIEW::MakeOverlay | ( | ) |
Definition at line 1682 of file view.cpp.
References Add(), and overlay.
Referenced by AUTOPLACE_TOOL::autoplace().
|
inline |
Force redraw of view on the next rendering.
Definition at line 665 of file view.h.
References KIGFX::TARGETS_NUMBER.
Referenced by Redraw().
|
inline |
Force redraw of view on the next rendering.
Definition at line 656 of file view.h.
References KIGFX::TARGETS_NUMBER.
Referenced by ClearTargets(), EDA_DRAW_PANEL_GAL::DoRePaint(), BOARD_EDITOR_CONTROL::DoSetDrillOrigin(), PCB_CONTROL::DoSetGridOrigin(), EDA_DRAW_FRAME::OnMove(), SCH_EDITOR_CONTROL::PageSetup(), refreshCallback(), GERBVIEW_FRAME::RemapLayers(), SetCenter(), SetGAL(), GERBVIEW_FRAME::SetLayerDrawPrms(), SetMirror(), SetScale(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), sortOrderedLayers(), UpdateAllLayersColor(), UpdateAllLayersOrder(), GERBVIEW_FRAME::UpdateXORLayers(), and VIEW().
|
inlineprotected |
Definition at line 774 of file view.h.
References KIGFX::TARGETS_NUMBER.
|
inline |
Set or clear target 'dirty' flag.
aTarget | is the target to set. |
Definition at line 636 of file view.h.
References KIGFX::TARGETS_NUMBER.
Referenced by Add(), GERBVIEW_FRAME::ApplyDisplaySettingsToGAL(), DRC_INTERACTIVE_COURTYARD_CLEARANCE::ClearConflicts(), SCH_BASE_FRAME::CommonSettingsChanged(), GERBVIEW_FRAME::CommonSettingsChanged(), FOOTPRINT_EDIT_FRAME::CommonSettingsChanged(), PCB_EDIT_FRAME::CommonSettingsChanged(), PCB_SELECTION_TOOL::highlight(), invalidateItem(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), COMMON_TOOLS::OnGridChanged(), APPEARANCE_CONTROLS::onObjectVisibilityChanged(), GERBER_LAYER_WIDGET::OnRenderEnable(), EDA_DRAW_PANEL_GAL::onSize(), Remove(), EDA_DRAW_FRAME::SetGridVisibility(), PCB_SELECTION_TOOL::unhighlight(), PCB_TEST_SELECTION_TOOL::unhighlight(), updateBbox(), DRC_INTERACTIVE_COURTYARD_CLEARANCE::UpdateConflicts(), UpdateItems(), UpdateLayerColor(), and updateLayers().
|
static |
Nasty hack, invoked by the destructor of VIEW_ITEM to auto-remove the item from the owning VIEW if there is any.
KiCad relies too much on this mechanism. This is the only linking dependency now between EDA_ITEM and VIEW class. In near future I'll replace it with observers.
Definition at line 227 of file view.cpp.
References KIGFX::VIEW_ITEM_DATA::m_view, and KIGFX::VIEW_ITEM::m_viewPrivData.
Referenced by KIGFX::VIEW_ITEM::~VIEW_ITEM().
void KIGFX::VIEW::Query | ( | const BOX2I & | aRect, |
const std::function< bool(VIEW_ITEM *)> & | aFunc | ||
) | const |
Run a function on all visible items that touch or are within the rectangle aRect.
aFunc | the function to be executed; return true to continue, false to end query. |
Definition at line 443 of file view.cpp.
References m_orderedLayers.
int KIGFX::VIEW::Query | ( | const BOX2I & | aRect, |
std::vector< LAYER_ITEM_PAIR > & | aResult | ||
) | const |
Find all visible items that touch or are within the rectangle aRect.
aResult | result of the search, containing VIEW_ITEMs associated with their layers. Sorted according to the rendering order (items that are on top of the rendering stack as first). |
Definition at line 412 of file view.cpp.
References m_orderedLayers, and UNDEFINED_LAYER.
Referenced by MULTICHANNEL_TOOL::copyRuleAreaContents(), DRAWING_TOOL::DrawVia(), EE_GRID_HELPER::queryVisible(), PCB_GRID_HELPER::queryVisible(), EE_SELECTION_TOOL::SelectAll(), PCB_SELECTION_TOOL::SelectAll(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::UnselectAll(), and PCB_SELECTION_TOOL::UnselectAll().
void KIGFX::VIEW::RecacheAllItems | ( | ) |
Rebuild GAL display lists.
Definition at line 1435 of file view.cpp.
References _, IsCached(), m_gal, m_layers, and BOX2< Vec >::SetMaximum().
Referenced by GERBVIEW_FRAME::ActivateGalCanvas(), PCB_BASE_FRAME::ActivateGalCanvas(), SCH_BASE_FRAME::CommonSettingsChanged(), APPEARANCE_CONTROLS::doApplyLayerPreset(), PCB_CONTROL::FlipPcbView(), SCH_EDIT_TOOL::Mirror(), GERBVIEW_DRAW_PANEL_GAL::OnShow(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceReferenceImage(), SCH_EDIT_TOOL::Properties(), GERBVIEW_FRAME::RemapLayers(), SCH_EDIT_TOOL::Rotate(), GERBVIEW_FRAME::SetLayerDrawPrms(), PCB_BASE_EDIT_FRAME::ShowReferenceImagePropertiesDialog(), and GERBVIEW_FRAME::UpdateXORLayers().
|
virtual |
Immediately redraws the whole view.
Definition at line 1161 of file view.cpp.
References BOX2ISafe(), KIGFX::GAL::GetScreenPixelSize(), m_gal, MarkClean(), PROF_TIMER::msecs(), BOX2< Vec >::Normalize(), redrawRect(), PROF_TIMER::Stop(), ToWorld(), and traceGalProfile.
Referenced by EDA_DRAW_PANEL_GAL::DoRePaint().
|
protected |
Definition at line 996 of file view.cpp.
References areRequiredLayersEnabled(), KIGFX::VIEW::DRAW_ITEM_VISITOR::deferredDraw(), KIGFX::VIEW::DRAW_ITEM_VISITOR::drawForcedTransparent, KIGFX::GAL::EnableDepthTest(), KIGFX::GAL::EndDiffLayer(), KIGFX::GAL::EndNegativesLayer(), KIGFX::VIEW::DRAW_ITEM_VISITOR::foundForcedTransparent, IsTargetDirty(), m_gal, m_orderedLayers, m_reverseDrawOrder, m_useDrawPriority, KIGFX::GAL::SetLayerDepth(), KIGFX::GAL::SetTarget(), KIGFX::GAL::StartDiffLayer(), KIGFX::GAL::StartNegativesLayer(), and KIGFX::TARGET_NONCACHED.
Referenced by Redraw().
|
virtual |
Remove a VIEW_ITEM from the view.
aItem | item to be removed. Caller must dispose the removed item if necessary |
Reimplemented in KIGFX::PCB_VIEW.
Definition at line 334 of file view.cpp.
References KIGFX::VIEW_ITEM_DATA::clearUpdateFlags(), alg::delete_if(), KIGFX::GAL::DeleteGroup(), KIGFX::VIEW_ITEM_DATA::deleteGroups(), KIGFX::VIEW_ITEM_DATA::getGroup(), KIGFX::VIEW::VIEW_LAYER::items, m_allItems, KIGFX::VIEW_ITEM_DATA::m_bbox, KIGFX::VIEW_ITEM_DATA::m_cachedIndex, m_gal, KIGFX::VIEW_ITEM_DATA::m_layers, m_layers, KIGFX::VIEW_ITEM_DATA::m_view, KIGFX::VIEW_ITEM::m_viewPrivData, MarkTargetDirty(), and KIGFX::VIEW::VIEW_LAYER::target.
Referenced by PANEL_ZONE_GAL::ActivateSelectedZone(), PCB_GRID_HELPER::Align(), EDA_DRAW_PANEL_GAL::ClearDebugOverlay(), EDIT_TOOL::DeleteItems(), SYMBOL_DIFF_WIDGET::DisplayDiff(), SYMBOL_PREVIEW_WIDGET::DisplayPart(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), PL_EDIT_TOOL::DoDelete(), SELECTION_TOOL::doSelectionMenu(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawOneBezier(), DRAWING_TOOL::drawShape(), SCH_DRAWING_TOOLS::ImportGraphics(), SYMBOL_EDITOR_DRAWING_TOOLS::ImportGraphics(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_POINT_EDITOR::OnSelectionChange(), DRAWING_TOOL::PlaceImportedGraphics(), DRAWING_TOOL::PlaceTuningPattern(), BOARD_COMMIT::Push(), SCH_COMMIT::pushSchEdit(), KIGFX::PCB_VIEW::Remove(), SCH_BASE_FRAME::RemoveFromScreen(), EE_SELECTION_TOOL::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), BOARD_EDITOR_CONTROL::Reset(), PCB_CONTROL::Reset(), SCH_COMMIT::Revert(), BOARD_COMMIT::Revert(), EE_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::selectMultiple(), ZOOM_TOOL::selectRegion(), DS_DATA_ITEM::SyncDrawItems(), DS_DATA_ITEM_POLYGONS::SyncDrawItems(), DS_DATA_ITEM_TEXT::SyncDrawItems(), DS_DATA_ITEM_BITMAP::SyncDrawItems(), DIALOG_ERC::testErc(), GERBVIEW_SELECTION_TOOL::unselect(), SYMBOL_VIEWER_FRAME::updatePreviewSymbol(), EE_GRID_HELPER::~EE_GRID_HELPER(), EE_SELECTION_TOOL::~EE_SELECTION_TOOL(), GERBVIEW_SELECTION_TOOL::~GERBVIEW_SELECTION_TOOL(), PCB_GRID_HELPER::~PCB_GRID_HELPER(), PCB_SELECTION_TOOL::~PCB_SELECTION_TOOL(), RULE_AREA_CREATE_HELPER::~RULE_AREA_CREATE_HELPER(), SYMBOL_DIFF_FRAME::~SYMBOL_DIFF_FRAME(), SYMBOL_PREVIEW_WIDGET::~SYMBOL_PREVIEW_WIDGET(), SYMBOL_VIEWER_FRAME::~SYMBOL_VIEWER_FRAME(), ~VIEW(), and ZONE_CREATE_HELPER::~ZONE_CREATE_HELPER().
void KIGFX::VIEW::ReorderLayerData | ( | std::unordered_map< int, int > | aReorderMap | ) |
Remap the data between layer ids without invalidating that data.
Used by GerbView for the "Sort by X2" functionality.
aReorderMap | is a mapping of old to new layer ids. |
Definition at line 672 of file view.cpp.
References _, KIGFX::COLOR, m_allItems, m_layers, KIGFX::VIEW_ITEM_DATA::m_requiredUpdate, KIGFX::VIEW_ITEM_DATA::reorderGroups(), KIGFX::VIEW_ITEM_DATA::saveLayers(), and UpdateItems().
Referenced by GERBVIEW_FRAME::RemapLayers().
|
inline |
Only takes effect if UseDrawPriority is true.
aFlag | is true if draw order should be reversed |
Definition at line 720 of file view.h.
Referenced by EDA_DRAW_PANEL_GAL::SwitchBackend().
|
inline |
Set limits for view area.
aBoundary | is the box that limits view area. |
Definition at line 283 of file view.h.
Referenced by PL_DRAW_PANEL_GAL::DisplayDrawingSheet(), DIALOG_PAD_PROPERTIES::redraw(), and SYMBOL_DIFF_FRAME::SYMBOL_DIFF_FRAME().
|
inline |
Set limits for view area.
aBoundary | is the box that limits view area. |
Definition at line 293 of file view.h.
References BOX2< Vec >::GetEnd(), and BOX2< Vec >::GetOrigin().
void KIGFX::VIEW::SetCenter | ( | const VECTOR2D & | aCenter | ) |
Set the center point of the VIEW (i.e.
the point in world space that will be drawn in the middle of the screen).
aCenter | the new center point, in world space coordinates. |
Definition at line 588 of file view.cpp.
References KIGFX::GAL::ComputeWorldScreenMatrix(), BOX2< Vec >::Contains(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), m_boundary, m_center, m_gal, MarkDirty(), KIGFX::GAL::SetLookAtPoint(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by KIGFX::WX_VIEW_CONTROLS::CenterOnCursor(), SCH_EDIT_FRAME::DisplayCurrentSheet(), COMMON_TOOLS::doCenter(), COMMON_TOOLS::doZoomFit(), DESIGN_BLOCK_PREVIEW_WIDGET::fitOnDrawArea(), SYMBOL_PREVIEW_WIDGET::fitOnDrawArea(), EDA_DRAW_FRAME::FocusOnLocation(), KIGFX::WX_VIEW_CONTROLS::onMotion(), KIGFX::WX_VIEW_CONTROLS::onPanGesture(), KIGFX::WX_VIEW_CONTROLS::onScroll(), EDA_DRAW_PANEL_GAL::onSize(), KIGFX::WX_VIEW_CONTROLS::onTimer(), KIGFX::WX_VIEW_CONTROLS::onWheel(), KIGFX::WX_VIEW_CONTROLS::onZoomGesture(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), SCH_BASE_FRAME::RedrawScreen(), ZOOM_TOOL::selectRegion(), NL_SCHEMATIC_PLUGIN_IMPL::SetCameraMatrix(), NL_GERBVIEW_PLUGIN_IMPL::SetCameraMatrix(), NL_PL_EDITOR_PLUGIN_IMPL::SetCameraMatrix(), NL_PCBNEW_PLUGIN_IMPL::SetCameraMatrix(), SetCenter(), KIGFX::WX_VIEW_CONTROLS::SetCrossHairCursorPosition(), SetGAL(), SetScale(), SetViewport(), KIGFX::WX_VIEW_CONTROLS::WarpMouseCursor(), PANEL_EESCHEMA_COLOR_SETTINGS::zoomFitPreview(), PANEL_PCBNEW_COLOR_SETTINGS::zoomFitPreview(), PANEL_ZONE_GAL::ZoomFitScreen(), and PCB_SELECTION_TOOL::zoomFitSelection().
void KIGFX::VIEW::SetCenter | ( | const VECTOR2D & | aCenter, |
const std::vector< BOX2D > & | obscuringScreenRects | ||
) |
Set the center point of the VIEW, attempting to avoid obscuringScreenRects (for instance, the screen rect of a modeless dialog in front of the VIEW).
aCenter | the new center point, in world space coordinates. |
obscuringScreenRects | the obscuring rects, in screen space coordinates. |
Definition at line 613 of file view.cpp.
References ARC_LOW_DEF, SHAPE_POLY_SET::BBox(), SHAPE_POLY_SET::BooleanSubtract(), BOX2< Vec >::Centre(), SHAPE_POLY_SET::Deflate(), BOX2< Vec >::GetHeight(), KIGFX::GAL::GetScreenPixelSize(), BOX2< Vec >::GetWidth(), SHAPE_POLY_SET::IsEmpty(), m_gal, SHAPE_POLY_SET::PM_FAST, SetCenter(), and ToWorld().
void KIGFX::VIEW::SetGAL | ( | GAL * | aGal | ) |
Assign a rendering device for the VIEW.
aGal | pointer to the GAL output device. |
Definition at line 503 of file view.cpp.
References clearGroupCache(), m_center, m_gal, m_mirrorX, m_mirrorY, m_scale, MarkDirty(), SetCenter(), SetMirror(), and SetScale().
Referenced by GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL(), PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL(), PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL(), SCH_DRAW_PANEL::SCH_DRAW_PANEL(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), and EDA_DRAW_PANEL_GAL::SwitchBackend().
|
inline |
Set the whether the layer should drawn differentially.
aLayer | is the layer to set to be draw differentially |
aDiff | is the layer diff'ing state. |
Definition at line 435 of file view.h.
References KIGFX::VIEW::VIEW_LAYER::diffLayer, and KIGFX::VIEW::VIEW_LAYER::target.
Referenced by GERBVIEW_FRAME::UpdateXORLayers().
|
inline |
Set a layer display-only (ie: to be rendered but not returned by hit test queries).
Definition at line 478 of file view.h.
Referenced by SCH_DRAW_PANEL::setDefaultLayerDeps(), SCH_PREVIEW_PANEL::setDefaultLayerDeps(), GERBVIEW_DRAW_PANEL_GAL::setDefaultLayerDeps(), PL_DRAW_PANEL_GAL::setDefaultLayerDeps(), and PCB_DRAW_PANEL_GAL::setDefaultLayerDeps().
|
inline |
Set the status of negatives presense in a particular layer.
aLayer | is the layer to set as containing negatives (or not). |
aNegatives | is the layer negatives state. |
Definition at line 458 of file view.h.
References KIGFX::VIEW::VIEW_LAYER::hasNegatives, and KIGFX::VIEW::VIEW_LAYER::target.
Referenced by GERBVIEW_FRAME::unarchiveFiles().
void KIGFX::VIEW::SetLayerOrder | ( | int | aLayer, |
int | aRenderingOrder | ||
) |
Set rendering order of a particular layer.
Lower values are rendered first.
aLayer | is the layer. |
aRenderingOrder | is an arbitrary number denoting the rendering order. |
Definition at line 648 of file view.cpp.
References m_layers, and sortOrderedLayers().
Referenced by SCH_DRAW_PANEL::setDefaultLayerOrder(), SCH_PREVIEW_PANEL::setDefaultLayerOrder(), PCB_DRAW_PANEL_GAL::setDefaultLayerOrder(), GERBVIEW_DRAW_PANEL_GAL::SetTopLayer(), and PCB_DRAW_PANEL_GAL::SetTopLayer().
|
inline |
Change the rendering target for a particular layer.
aLayer | is the layer. |
aTarget | is the rendering target. |
Definition at line 494 of file view.h.
Referenced by SCH_DRAW_PANEL::setDefaultLayerDeps(), SCH_PREVIEW_PANEL::setDefaultLayerDeps(), GERBVIEW_DRAW_PANEL_GAL::setDefaultLayerDeps(), PL_DRAW_PANEL_GAL::setDefaultLayerDeps(), PCB_DRAW_PANEL_GAL::setDefaultLayerDeps(), BOARD_PRINTOUT::setupViewLayers(), and GERBVIEW_FRAME::UpdateXORLayers().
|
inline |
Control the visibility of a particular layer.
aLayer | is the layer to show/hide. |
aVisible | is the layer visibility state. |
Definition at line 397 of file view.h.
References KIGFX::VIEW::VIEW_LAYER::target, and KIGFX::VIEW::VIEW_LAYER::visible.
Referenced by SCH_EDIT_FRAME::CommonSettingsChanged(), PANEL_ZONE_GAL::OnLayerSelected(), APPEARANCE_CONTROLS::onLayerVisibilityToggled(), APPEARANCE_CONTROLS::onObjectVisibilityChanged(), GERBER_LAYER_WIDGET::OnRenderEnable(), PL_EDITOR_FRAME::OnSelectPage(), PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL(), SCH_EDIT_FRAME::SCH_EDIT_FRAME(), PCB_EDIT_FRAME::SetElementVisibility(), GERBVIEW_FRAME::SetElementVisibility(), APPEARANCE_CONTROLS::SetLayerVisible(), APPEARANCE_CONTROLS::SetObjectVisible(), BOARD_PRINTOUT::setupViewLayers(), GERBVIEW_PRINTOUT::setupViewLayers(), PCBNEW_PRINTOUT::setupViewLayers(), GERBVIEW_FRAME::SetVisibleLayers(), APPEARANCE_CONTROLS::setVisibleLayers(), APPEARANCE_CONTROLS::setVisibleObjects(), SCH_EDIT_FRAME::ShowAllIntersheetRefs(), PCB_DRAW_PANEL_GAL::SyncLayersVisibility(), SCH_EDITOR_CONTROL::ToggleERCErrors(), SCH_EDITOR_CONTROL::ToggleERCWarnings(), SCH_EDITOR_CONTROL::ToggleOPCurrents(), SCH_EDITOR_CONTROL::ToggleOPVoltages(), and PCB_EDIT_FRAME::UpdateUserInterface().
void KIGFX::VIEW::SetMirror | ( | bool | aMirrorX, |
bool | aMirrorY | ||
) |
Control the mirroring of the VIEW.
aMirrorX | when true, the X axis is mirrored. |
aMirrorY | when true, the Y axis is mirrored. |
Definition at line 549 of file view.cpp.
References _, m_gal, m_mirrorX, m_mirrorY, MarkDirty(), and KIGFX::GAL::SetFlip().
Referenced by GERBVIEW_CONTROL::DisplayControl(), APPEARANCE_CONTROLS::doApplyLayerPreset(), PCB_CONTROL::FlipPcbView(), SCH_DRAW_PANEL::SCH_DRAW_PANEL(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), and SetGAL().
|
inline |
Set the painter object used by the view for drawing #VIEW_ITEMS.
Definition at line 207 of file view.h.
Referenced by GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL(), PANEL_ZONE_GAL::PANEL_ZONE_GAL(), PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL(), PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL(), SCH_DRAW_PANEL::SCH_DRAW_PANEL(), and SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL().
void KIGFX::VIEW::SetRequired | ( | int | aLayerId, |
int | aRequiredId, | ||
bool | aRequired = true |
||
) |
Mark the aRequiredId layer as required for the aLayerId layer.
In order to display the layer, all of its required layers have to be enabled.
aLayerId | is the id of the layer for which we enable/disable the required layer. |
aRequiredId | is the id of the required layer. |
aRequired | tells if the required layer should be added or removed from the list. |
Definition at line 400 of file view.cpp.
References m_layers.
Referenced by PCB_DRAW_PANEL_GAL::setDefaultLayerDeps().
|
virtual |
Set the scaling factor, zooming around a given anchor point.
(depending on correct GAL unit length & DPI settings).
aAnchor | is the zooming anchor point. |
aScale | is the scale factor. |
Reimplemented in KIGFX::SCH_VIEW.
Definition at line 562 of file view.cpp.
References KIGFX::GAL::ComputeWorldScreenMatrix(), delta, m_center, m_gal, m_maxScale, m_minScale, m_scale, MarkDirty(), SetCenter(), KIGFX::GAL::SetZoomFactor(), ToScreen(), and ToWorld().
Referenced by COMMON_TOOLS::doZoomFit(), COMMON_TOOLS::doZoomToPreset(), PCB_SELECTION_TOOL::FindItem(), DESIGN_BLOCK_PREVIEW_WIDGET::fitOnDrawArea(), SYMBOL_PREVIEW_WIDGET::fitOnDrawArea(), FOOTPRINT_PREVIEW_PANEL::fitToCurrentFootprint(), KIGFX::WX_VIEW_CONTROLS::onMagnify(), KIGFX::WX_VIEW_CONTROLS::onMotion(), KIGFX::WX_VIEW_CONTROLS::onWheel(), KIGFX::WX_VIEW_CONTROLS::onZoomGesture(), ZOOM_TOOL::selectRegion(), SetGAL(), KIGFX::SCH_VIEW::SetScale(), NL_GERBVIEW_PLUGIN_IMPL::SetViewExtents(), NL_PL_EDITOR_PLUGIN_IMPL::SetViewExtents(), NL_PCBNEW_PLUGIN_IMPL::SetViewExtents(), SetViewport(), EE_SELECTION_TOOL::ZoomFitCrossProbeBBox(), PCB_SELECTION_TOOL::ZoomFitCrossProbeBBox(), PANEL_EESCHEMA_COLOR_SETTINGS::zoomFitPreview(), PANEL_PCBNEW_COLOR_SETTINGS::zoomFitPreview(), PANEL_ZONE_GAL::ZoomFitScreen(), and PCB_SELECTION_TOOL::zoomFitSelection().
|
inline |
Set minimum and maximum values for scale.
aMaximum | is the maximum value for scale. |
aMinimum | is the minimum value for scale. |
Definition at line 313 of file view.h.
Referenced by GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL(), PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL(), PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL(), SCH_DRAW_PANEL::SCH_DRAW_PANEL(), and SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL().
|
virtual |
Set given layer to be displayed on the top or sets back the default order of layers.
aEnabled | = true to display aLayer on the top. |
aLayer | is the layer or -1 in case when no particular layer should be displayed on the top. |
Definition at line 829 of file view.cpp.
References m_enableOrderModifier, m_layers, m_topLayers, and TOP_LAYER_MODIFIER.
Referenced by DIALOG_PAD_PROPERTIES::redraw(), EDA_DRAW_PANEL_GAL::SetTopLayer(), GERBVIEW_DRAW_PANEL_GAL::SetTopLayer(), PL_DRAW_PANEL_GAL::SetTopLayer(), PCB_DRAW_PANEL_GAL::SetTopLayer(), BOARD_PRINTOUT::setupViewLayers(), and PCBNEW_PRINTOUT::setupViewLayers().
void KIGFX::VIEW::SetViewport | ( | const BOX2D & | aViewport | ) |
Set the visible area of the VIEW.
aViewport | desired visible area, in world space coordinates. |
Definition at line 534 of file view.cpp.
References BOX2< Vec >::Centre(), GetScale(), KIGFX::GAL::GetScreenPixelSize(), BOX2< Vec >::GetSize(), m_gal, SetCenter(), SetScale(), ToWorld(), VECTOR2< T >::x, VECTOR2< T >::y, and zoom.
Referenced by APPEARANCE_CONTROLS::doApplyViewport(), FOOTPRINT_PREVIEW_PANEL::fitToCurrentFootprint(), and DIALOG_PAD_PROPERTIES::redraw().
void KIGFX::VIEW::SetVisible | ( | VIEW_ITEM * | aItem, |
bool | aIsVisible = true |
||
) |
Set the item visibility.
aItem | the item to modify. |
aIsVisible | whether the item is visible (on all layers), or not. |
Definition at line 1596 of file view.cpp.
References KIGFX::APPEARANCE, KIGFX::COLOR, KIGFX::VIEW_ITEM_DATA::m_flags, Update(), KIGFX::VIEW_ITEM::viewPrivData(), and KIGFX::VISIBLE.
Referenced by Add(), AddToPreview(), PCB_GRID_HELPER::BestSnapAnchor(), EE_GRID_HELPER::BestSnapAnchor(), MICROWAVE_TOOL::drawMicrowaveInductor(), EE_GRID_HELPER::EE_GRID_HELPER(), GRID_HELPER::enableAndGetAnchorDebug(), PNS_KICAD_IFACE::EraseView(), EE_GRID_HELPER::GetGrid(), GRID_HELPER::GRID_HELPER(), PNS_KICAD_IFACE::HideItem(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), RULE_AREA_CREATE_HELPER::OnComplete(), ZONE_CREATE_HELPER::OnComplete(), RULE_AREA_CREATE_HELPER::OnFirstPoint(), ZONE_CREATE_HELPER::OnFirstPoint(), RULE_AREA_CREATE_HELPER::OnGeometryChange(), ZONE_CREATE_HELPER::OnGeometryChange(), PCB_GRID_HELPER::PCB_GRID_HELPER(), POSITION_RELATIVE_TOOL::PositionRelativeInteractively(), FOOTPRINT_PREVIEW_PANEL::renderFootprint(), EE_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), ZOOM_TOOL::selectRegion(), GRID_HELPER::SetAuxAxes(), GRID_HELPER::showConstructionGeometry(), ShowPreview(), GRID_HELPER::updateSnapPoint(), RULE_AREA_CREATE_HELPER::~RULE_AREA_CREATE_HELPER(), and ZONE_CREATE_HELPER::~ZONE_CREATE_HELPER().
void KIGFX::VIEW::ShowPreview | ( | bool | aShow = true | ) |
Definition at line 1727 of file view.cpp.
References m_preview, and SetVisible().
Referenced by SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), ROUTER_TOOL::performDragging(), and DRAWING_TOOL::PlaceReferenceImage().
void KIGFX::VIEW::SortLayers | ( | std::vector< int > | aLayers | ) | const |
Change the order of given layer ids, so after sorting the order corresponds to layers rendering order (descending, ie.
order in which layers should be drawn - from the bottom to the top).
aLayers | stores id of layers to be sorted. |
Definition at line 662 of file view.cpp.
Referenced by draw(), and KIGFX::VIEW_GROUP::ViewDraw().
|
protected |
Clear cached GAL group numbers (ONLY numbers stored in VIEW_ITEMs, not group objects used by GAL)
Definition at line 1261 of file view.cpp.
References compareRenderingOrder(), m_layers, m_orderedLayers, and MarkDirty().
Referenced by SetLayerOrder(), UpdateAllLayersOrder(), and VIEW().
Convert a world space point/vector to a point/vector in screen space coordinates.
aCoord | is the point/vector to be converted. |
aAbsolute | when true aCoord is treated as a point, otherwise as a direction (vector). |
Definition at line 478 of file view.cpp.
References MATRIX3x3< T >::GetScale(), KIGFX::GAL::GetWorldScreenMatrix(), m_gal, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by KIGFX::WX_VIEW_CONTROLS::handleAutoPanning(), KIGFX::WX_VIEW_CONTROLS::SetCrossHairCursorPosition(), SetScale(), and KIGFX::WX_VIEW_CONTROLS::WarpMouseCursor().
double KIGFX::VIEW::ToScreen | ( | double | aSize | ) | const |
Convert a world space one dimensional size to a one dimensional size in screen space.
aSize | the size to be transformed. |
Definition at line 489 of file view.cpp.
References MATRIX3x3< T >::GetScale(), KIGFX::GAL::GetWorldScreenMatrix(), m_gal, and VECTOR2< T >::x.
Converts a screen space point/vector to a point/vector in world space coordinates.
aCoord | is the point/vector to be converted. |
aAbsolute | when true aCoord is treated as a point, otherwise as a direction (vector). |
Definition at line 459 of file view.cpp.
References MATRIX3x3< T >::GetScale(), KIGFX::GAL::GetScreenWorldMatrix(), m_gal, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by EE_POINT_EDITOR::addCornerCondition(), PCB_GRID_HELPER::BestDragOrigin(), PCB_GRID_HELPER::BestSnapAnchor(), COMMON_TOOLS::doCenter(), COMMON_TOOLS::doZoomFit(), KIGFX::PREVIEW::POLYGON_ITEM::drawPreviewShape(), EDIT_POINTS::FindPoint(), DESIGN_BLOCK_PREVIEW_WIDGET::fitOnDrawArea(), SYMBOL_PREVIEW_WIDGET::fitOnDrawArea(), PCB_BASE_FRAME::FocusOnItems(), GENERAL_COLLECTORS_GUIDE::GENERAL_COLLECTORS_GUIDE(), KIGFX::WX_VIEW_CONTROLS::GetMousePosition(), GetViewport(), DS_PROXY_VIEW_ITEM::HitTestDrawingSheetItems(), KIGFX::WX_VIEW_CONTROLS::onMagnify(), KIGFX::WX_VIEW_CONTROLS::onMotion(), KIGFX::WX_VIEW_CONTROLS::onPanGesture(), KIGFX::WX_VIEW_CONTROLS::onScroll(), EDA_DRAW_PANEL_GAL::onSize(), KIGFX::WX_VIEW_CONTROLS::onTimer(), KIGFX::WX_VIEW_CONTROLS::onWheel(), KIGFX::WX_VIEW_CONTROLS::onZoomGesture(), KIGFX::WX_VIEW_CONTROLS::PinCursorInsideNonAutoscrollArea(), Redraw(), KIGFX::WX_VIEW_CONTROLS::refreshMouse(), PL_SELECTION_TOOL::selectionContains(), ZOOM_TOOL::selectRegion(), SetCenter(), SetScale(), SetViewport(), EDIT_POINTS::ViewDraw(), KIGFX::PREVIEW::BEZIER_ASSISTANT::ViewDraw(), PCB_TUNING_PATTERN::ViewDraw(), KIGFX::ORIGIN_VIEWITEM::ViewDraw(), KIGFX::ANCHOR_DEBUG::ViewDraw(), KIGFX::CONSTRUCTION_GEOM::ViewDraw(), KIGFX::SNAP_INDICATOR::ViewDraw(), PCB_SELECTION_TOOL::ZoomFitCrossProbeBBox(), PANEL_EESCHEMA_COLOR_SETTINGS::zoomFitPreview(), PANEL_PCBNEW_COLOR_SETTINGS::zoomFitPreview(), PANEL_ZONE_GAL::ZoomFitScreen(), and PCB_SELECTION_TOOL::zoomFitSelection().
double KIGFX::VIEW::ToWorld | ( | double | aSize | ) | const |
Converts a screen space one dimensional size to a one dimensional size in world space coordinates.
aSize | is the size to be converted. |
Definition at line 470 of file view.cpp.
References MATRIX3x3< T >::GetScale(), KIGFX::GAL::GetScreenWorldMatrix(), m_gal, and VECTOR2< T >::x.
|
virtual |
Reimplemented in KIGFX::PCB_VIEW.
Definition at line 1663 of file view.cpp.
References KIGFX::ALL, and Update().
|
virtual |
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has changed.
For static views calling has no effect.
aItem | the item to update. |
aUpdateFlags | how much the object has changed. |
Reimplemented in KIGFX::PCB_VIEW.
Definition at line 1669 of file view.cpp.
References KIGFX::VIEW_ITEM_DATA::m_requiredUpdate, KIGFX::NONE, and KIGFX::VIEW_ITEM::viewPrivData().
Referenced by Add(), SCH_RULE_AREA::addDirective(), PNS_PCBNEW_DEBUG_DECORATOR::AddItem(), PNS_PCBNEW_DEBUG_DECORATOR::AddShape(), AddToPreview(), PCB_GRID_HELPER::BestSnapAnchor(), EE_GRID_HELPER::BestSnapAnchor(), PNS_PCBNEW_DEBUG_DECORATOR::Clear(), DRC_INTERACTIVE_COURTYARD_CLEARANCE::ClearConflicts(), SCH_RULE_AREA::clearDirectives(), ClearPreview(), PL_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::ClearSelection(), EDIT_TOOL::DeleteItems(), PNS_KICAD_IFACE::DisplayItem(), PNS_KICAD_IFACE::DisplayPathLine(), PNS_KICAD_IFACE::DisplayRatline(), EDIT_TOOL::DragArcTrack(), draw(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawOneBezier(), PL_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::drawShape(), DRAWING_TOOL::DrawTable(), PAD_TOOL::EnumeratePads(), PNS_KICAD_IFACE::EraseView(), EE_INSPECTION_TOOL::ExcludeMarker(), DIALOG_ERC::ExcludeMarker(), EE_GRID_HELPER::GetGrid(), Hide(), PNS_KICAD_IFACE::HideItem(), PL_SELECTION_TOOL::highlight(), EE_SELECTION_TOOL::highlight(), SCH_DRAWING_TOOLS::ImportGraphics(), SYMBOL_EDITOR_DRAWING_TOOLS::ImportGraphics(), EE_SELECTION_TOOL::Main(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), EDIT_TOOL::MoveExact(), PL_EDIT_TOOL::moveItem(), PROPERTIES_FRAME::OnAcceptPrms(), DIALOG_ERC::OnERCItemRClick(), RULE_AREA_CREATE_HELPER::OnGeometryChange(), ZONE_CREATE_HELPER::OnGeometryChange(), PCB_POINT_EDITOR::OnSelectionChange(), SYMBOL_DIFF_WIDGET::onSlider(), KIGFX::VIEW::RECACHE_ITEM_VISITOR::operator()(), BOARD_EDITOR_CONTROL::PlaceFootprint(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::PlaceTuningPattern(), DIALOG_CHANGE_SYMBOLS::processSymbols(), BOARD_COMMIT::Push(), SCH_COMMIT::pushLibEdit(), SCH_EDIT_FRAME::RecalculateConnections(), DIALOG_PAD_PROPERTIES::redraw(), PCB_EDIT_FRAME::redrawNetnames(), PCB_DRAW_PANEL_GAL::RedrawRatsnest(), SCH_EDIT_FRAME::RefreshOperatingPointDisplay(), SCH_BASE_FRAME::RefreshZoomDependentItems(), SCH_RULE_AREA::ResetDirectivesAndItems(), SCH_EDIT_FRAME::SaveSymbolToSchematic(), EE_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectPoint(), ZOOM_TOOL::selectRegion(), GERBVIEW_SELECTION_TOOL::selectVisually(), SetVisible(), SCH_EDIT_FRAME::TestDanglingEnds(), DIALOG_JUNCTION_PROPS::TransferDataFromWindow(), SCH_MOVE_TOOL::trimDanglingLines(), PL_SELECTION_TOOL::unhighlight(), EE_SELECTION_TOOL::unhighlight(), GERBVIEW_SELECTION_TOOL::unselectVisually(), Update(), KIGFX::PCB_VIEW::Update(), DRC_INTERACTIVE_COURTYARD_CLEARANCE::UpdateConflicts(), PL_POINT_EDITOR::updateItem(), PCB_POINT_EDITOR::updateItem(), EE_TOOL_BASE< T >::updateItem(), SCH_BASE_FRAME::UpdateItem(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), PCB_POINT_EDITOR::updatePoints(), PCB_SELECTION_TOOL::updateSelection(), GRID_HELPER::updateSnapPoint(), and BOARD::UpdateUserUnits().
void KIGFX::VIEW::UpdateAllItems | ( | int | aUpdateFlags | ) |
Update all items in the view according to the given flags.
aUpdateFlags | is is according to KIGFX::VIEW_UPDATE_FLAGS |
Definition at line 1545 of file view.cpp.
References m_allItems.
Referenced by SCH_BASE_FRAME::CommonSettingsChanged(), SYMBOL_EDIT_FRAME::CommonSettingsChanged(), GERBVIEW_FRAME::CommonSettingsChanged(), PCB_BASE_FRAME::CommonSettingsChanged(), PL_EDITOR_FRAME::CommonSettingsChanged(), GERBVIEW_CONTROL::DisplayControl(), SCH_BASE_FRAME::HardRedraw(), GERBVIEW_CONTROL::HighlightControl(), SCH_EDIT_FRAME::KiwayMailIn(), SYMBOL_VIEWER_FRAME::KiwayMailIn(), SYMBOL_EDIT_FRAME::LoadOneLibrarySymbolAux(), SYMBOL_EDIT_FRAME::LoadSymbolFromSchematic(), PCB_EDIT_FRAME::onBoardLoaded(), GERBER_LAYER_WIDGET::OnLayerSelect(), PCB_NET_INSPECTOR_PANEL::onRenameSelectedNet(), GERBVIEW_FRAME::OnSelectActiveDCode(), GERBVIEW_FRAME::OnSelectActiveLayer(), SCH_EDITOR_CONTROL::PageSetup(), SYMBOL_EDIT_FRAME::RebuildView(), FOOTPRINT_PREVIEW_PANEL::RefreshAll(), GERBVIEW_FRAME::RemapLayers(), GERBVIEW_FRAME::SetLayerDrawPrms(), SYMBOL_EDIT_FRAME::ShowChangedLanguage(), SYMBOL_EDITOR_CONTROL::ShowElectricalTypes(), SYMBOL_EDITOR_CONTROL::ShowPinNumbers(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), SCH_BASE_FRAME::SyncView(), COMMON_TOOLS::ToggleBoundingBoxes(), SCH_EDITOR_CONTROL::ToggleDirectiveLabels(), SCH_EDITOR_CONTROL::ToggleHiddenFields(), SYMBOL_EDITOR_CONTROL::ToggleHiddenFields(), SCH_EDITOR_CONTROL::ToggleHiddenPins(), SYMBOL_EDITOR_CONTROL::ToggleHiddenPins(), SCH_EDITOR_CONTROL::TogglePinAltIcons(), SYMBOL_EDITOR_CONTROL::TogglePinAltIcons(), PANEL_EESCHEMA_COLOR_SETTINGS::updatePreview(), PANEL_PCBNEW_COLOR_SETTINGS::updatePreview(), and GERBVIEW_FRAME::UpdateXORLayers().
void KIGFX::VIEW::UpdateAllItemsConditionally | ( | int | aUpdateFlags, |
std::function< bool(VIEW_ITEM *)> | aCondition | ||
) |
Update items in the view according to the given flags and condition.
aUpdateFlags | is is according to KIGFX::VIEW_UPDATE_FLAGS. |
aCondition | is a function returning true if the item should be updated. |
Definition at line 1555 of file view.cpp.
References m_allItems.
Referenced by PCB_BASE_FRAME::CommonSettingsChanged(), GERBVIEW_CONTROL::DisplayControl(), PAD_TOOL::enterPadEditMode(), PAD_TOOL::ExitPadEditMode(), SCH_EDITOR_CONTROL::MarkSimExclusions(), PCB_NET_INSPECTOR_PANEL::onDeleteSelectedNet(), PCB_EDIT_FRAME::OnNetlistChanged(), BOARD_EDITOR_CONTROL::PageSettings(), SCH_EDIT_FRAME::RecalculateConnections(), ZONE_FILLER_TOOL::refresh(), SCH_EDIT_FRAME::RefreshOperatingPointDisplay(), PCB_EDIT_FRAME::SetActiveLayer(), PCB_BASE_FRAME::SetDisplayOptions(), GERBVIEW_FRAME::SetElementVisibility(), PCB_BASE_FRAME::SetPlotSettings(), APPEARANCE_CONTROLS::setVisibleLayers(), and PCB_EDIT_FRAME::ShowBoardSetupDialog().
void KIGFX::VIEW::UpdateAllItemsConditionally | ( | std::function< int(VIEW_ITEM *)> | aItemFlagsProvider | ) |
Update items in the view according to the flags returned by the callback.
aItemFlagsProvider | is a function returning any KIGFX::VIEW_UPDATE_FLAGS that should be set on the VIEW_ITEM. |
Definition at line 1572 of file view.cpp.
References m_allItems.
void KIGFX::VIEW::UpdateAllLayersColor | ( | ) |
Apply the new coloring scheme to all layers.
The used scheme is held by #RENDER_SETTINGS.
Definition at line 765 of file view.cpp.
References KIGFX::GAL::ChangeGroupColor(), color, KIGFX::RENDER_SETTINGS::GetColor(), KIGFX::VIEW_ITEM_DATA::getGroup(), KIGFX::PAINTER::GetSettings(), group, KIGFX::GAL::IsVisible(), m_allItems, m_gal, KIGFX::VIEW_ITEM_DATA::m_layers, m_painter, and MarkDirty().
Referenced by BOARD_INSPECTION_TOOL::ClearHighlight(), FOOTPRINT_EDIT_FRAME::CommonSettingsChanged(), PCB_SELECTION_TOOL::doSyncSelection(), EnableTopLayer(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), BOARD_INSPECTION_TOOL::HighlightNet(), BOARD_INSPECTION_TOOL::highlightNet(), PNS::TOOL_BASE::highlightNets(), PCB_NET_INSPECTOR_PANEL::highlightSelectedNets(), PCB_NET_INSPECTOR_PANEL::onClearHighlighting(), APPEARANCE_CONTROLS::onNetclassColorChanged(), APPEARANCE_CONTROLS::onNetclassContextMenu(), APPEARANCE_CONTROLS::onNetColorMode(), NETS_SEARCH_HANDLER::SelectItems(), RATSNEST_SEARCH_HANDLER::SelectItems(), EDA_DRAW_PANEL_GAL::SetHighContrastLayer(), GERBVIEW_DRAW_PANEL_GAL::SetHighContrastLayer(), PCB_DRAW_PANEL_GAL::SetHighContrastLayer(), and NET_GRID_TABLE::updateNetColor().
void KIGFX::VIEW::UpdateAllLayersOrder | ( | ) |
Do everything that is needed to apply the rendering order of layers.
It has to be called after modification of renderingOrder field of LAYER.
Definition at line 896 of file view.cpp.
References KIGFX::GAL::ChangeGroupDepth(), KIGFX::VIEW_ITEM_DATA::getGroup(), group, KIGFX::GAL::IsVisible(), m_allItems, m_gal, KIGFX::VIEW_ITEM_DATA::m_layers, m_layers, MarkDirty(), and sortOrderedLayers().
Referenced by EnableTopLayer(), SCH_DRAW_PANEL::SCH_DRAW_PANEL(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), EDA_DRAW_PANEL_GAL::SetTopLayer(), GERBVIEW_DRAW_PANEL_GAL::SetTopLayer(), PL_DRAW_PANEL_GAL::SetTopLayer(), and PCB_DRAW_PANEL_GAL::SetTopLayer().
|
protected |
Update set of layers that an item occupies.
Definition at line 1331 of file view.cpp.
References KIGFX::VIEW::VIEW_LAYER::items, KIGFX::VIEW_ITEM_DATA::m_bbox, m_layers, KIGFX::VIEW_ITEM::m_viewPrivData, MarkTargetDirty(), KIGFX::VIEW::VIEW_LAYER::target, KIGFX::VIEW_ITEM::ViewBBox(), and KIGFX::VIEW_ITEM::ViewGetLayers().
Referenced by invalidateItem().
|
protected |
Update all information needed to draw an item.
Definition at line 1276 of file view.cpp.
References KIGFX::GAL::ChangeGroupColor(), color, KIGFX::RENDER_SETTINGS::GetColor(), KIGFX::VIEW_ITEM_DATA::getGroup(), KIGFX::PAINTER::GetSettings(), group, IsCached(), m_gal, m_painter, and KIGFX::VIEW_ITEM::viewPrivData().
Referenced by invalidateItem().
|
protected |
Update bounding box of an item.
Definition at line 1294 of file view.cpp.
References KIGFX::GAL::BeginGroup(), KIGFX::GAL::DeleteGroup(), KIGFX::PAINTER::Draw(), KIGFX::GAL::EndGroup(), KIGFX::VIEW_ITEM_DATA::getGroup(), group, m_gal, m_layers, m_painter, KIGFX::VIEW::VIEW_LAYER::renderingOrder, KIGFX::VIEW_ITEM_DATA::setGroup(), KIGFX::GAL::SetLayerDepth(), KIGFX::GAL::SetTarget(), KIGFX::VIEW::VIEW_LAYER::target, KIGFX::TARGET_CACHED, KIGFX::VIEW_ITEM::ViewDraw(), and KIGFX::VIEW_ITEM::viewPrivData().
Referenced by invalidateItem().
void KIGFX::VIEW::UpdateItems | ( | ) |
Iterate through the list of items that asked for updating and updates them.
Definition at line 1452 of file view.cpp.
References _, KIGFX::GEOMETRY, invalidateItem(), KIGFX::GAL::IsInitialized(), KIGFX::GAL::IsVisible(), KIGFX::VIEW::VIEW_LAYER::items, KI_TRACE, KIGFX::LAYERS, m_allItems, m_gal, m_layers, MarkTargetDirty(), KIGFX::NONE, KIGFX::VIEW::VIEW_LAYER::target, and traceGalProfile.
Referenced by EDA_DRAW_PANEL_GAL::DoRePaint(), SELECTION_TOOL::doSelectionMenu(), SCH_DRAW_PANEL::OnShow(), PCB_DRAW_PANEL_GAL::OnShow(), ReorderLayerData(), and SCH_FIND_REPLACE_TOOL::UpdateFind().
void KIGFX::VIEW::UpdateLayerColor | ( | int | aLayer | ) |
Apply the new coloring scheme held by RENDER_SETTINGS in case that it has changed.
aLayer | is a number of the layer to be updated. |
Definition at line 744 of file view.cpp.
References IsCached(), KIGFX::GAL::IsVisible(), m_gal, m_layers, m_painter, MarkTargetDirty(), and BOX2< Vec >::SetMaximum().
Referenced by PCB_CONTROL::LayerAlphaDec(), PCB_CONTROL::LayerAlphaInc(), APPEARANCE_CONTROLS::OnColorSwatchChanged(), and GERBER_LAYER_WIDGET::OnLayerColorChange().
|
protected |
Determine rendering order of layers. Used in display order sorting function.
Definition at line 1356 of file view.cpp.
References KIGFX::GAL::DeleteGroup(), KIGFX::VIEW_ITEM_DATA::getGroup(), KIGFX::VIEW::VIEW_LAYER::id, IsCached(), KIGFX::VIEW::VIEW_LAYER::items, KIGFX::VIEW_ITEM_DATA::m_bbox, m_gal, KIGFX::VIEW_ITEM_DATA::m_layers, m_layers, KIGFX::VIEW_ITEM::m_viewPrivData, MarkTargetDirty(), KIGFX::VIEW_ITEM_DATA::saveLayers(), KIGFX::VIEW_ITEM_DATA::setGroup(), KIGFX::VIEW::VIEW_LAYER::target, KIGFX::VIEW_ITEM::ViewBBox(), KIGFX::VIEW_ITEM::ViewGetLayers(), and KIGFX::VIEW_ITEM::viewPrivData().
Referenced by invalidateItem().
|
inline |
aFlag | is true if draw priority should be respected while redrawing. |
Definition at line 710 of file view.h.
Referenced by PANEL_ZONE_GAL::PANEL_ZONE_GAL().
|
protected |
The set of layers that are displayed on the top.
Definition at line 867 of file view.h.
Referenced by Add(), Clear(), KIGFX::SCH_VIEW::ClearHiddenFlags(), DataReference(), Remove(), ReorderLayerData(), UpdateAllItems(), UpdateAllItemsConditionally(), UpdateAllLayersColor(), UpdateAllLayersOrder(), UpdateItems(), and VIEW().
|
protected |
Definition at line 876 of file view.h.
Referenced by KIGFX::PCB_VIEW::PCB_VIEW(), KIGFX::SCH_VIEW::ResizeSheetWorkingArea(), KIGFX::SCH_VIEW::SCH_VIEW(), SetCenter(), and VIEW().
|
protected |
Definition at line 873 of file view.h.
Referenced by SetCenter(), SetGAL(), and SetScale().
|
protected |
|
protected |
The set of possible displayed layers and its properties.
Definition at line 858 of file view.h.
Referenced by ClearTopLayers(), EnableTopLayer(), and SetTopLayer().
|
protected |
Flag to mark targets as dirty so they have to be redrawn on the next refresh event.
Definition at line 887 of file view.h.
Referenced by Clear(), ClearTargets(), draw(), GetScreenPixelSize(), GetViewport(), RecacheAllItems(), Redraw(), redrawRect(), Remove(), SetCenter(), SetGAL(), SetMirror(), SetScale(), SetViewport(), ToScreen(), ToWorld(), UpdateAllLayersColor(), UpdateAllLayersOrder(), updateItemColor(), updateItemGeometry(), UpdateItems(), UpdateLayerColor(), and updateLayers().
|
protected |
Sorted list of pointers to members of m_layers.
Definition at line 861 of file view.h.
Referenced by Add(), areRequiredLayersEnabled(), Clear(), clearGroupCache(), ClearTopLayers(), DataReference(), draw(), EnableTopLayer(), GetLayerOrder(), invalidateItem(), RecacheAllItems(), Remove(), ReorderLayerData(), SetLayerOrder(), SetRequired(), SetTopLayer(), sortOrderedLayers(), UpdateAllLayersOrder(), updateBbox(), updateItemGeometry(), UpdateItems(), UpdateLayerColor(), updateLayers(), and VIEW().
|
protected |
Definition at line 878 of file view.h.
Referenced by SetScale().
|
protected |
Definition at line 877 of file view.h.
Referenced by SetScale().
|
protected |
Definition at line 880 of file view.h.
Referenced by SetGAL(), and SetMirror().
|
protected |
PAINTER contains information how do draw items.
Definition at line 881 of file view.h.
Referenced by SetGAL(), and SetMirror().
|
protected |
|
protected |
Flat list of all items.
Definition at line 864 of file view.h.
Referenced by Query(), redrawRect(), and sortOrderedLayers().
|
protected |
Whether to use rendering order modifier or not.
Definition at line 855 of file view.h.
Referenced by AddToPreview(), and ClearPreview().
|
protected |
Interface to #PAINTER that is used to draw items.
Definition at line 884 of file view.h.
Referenced by draw(), UpdateAllLayersColor(), updateItemColor(), updateItemGeometry(), and UpdateLayerColor().
|
protected |
Definition at line 854 of file view.h.
Referenced by AddToPreview(), KIGFX::SCH_VIEW::Cleanup(), ClearPreview(), InitPreview(), ShowPreview(), VIEW(), and ~VIEW().
|
protected |
Definition at line 899 of file view.h.
Referenced by redrawRect().
|
protected |
Definition at line 875 of file view.h.
Referenced by KIGFX::VIEW::DRAW_ITEM_VISITOR::operator()(), SetGAL(), and SetScale().
|
protected |
Center point of the VIEW (the point at which we are looking at).
Definition at line 870 of file view.h.
Referenced by ClearTopLayers(), EnableTopLayer(), GetTopLayer(), and SetTopLayer().
|
protected |
The next sequential drawing priority.
Definition at line 893 of file view.h.
Referenced by redrawRect().
|
staticconstexpr |
Definition at line 745 of file view.h.
Referenced by ClearTopLayers(), EnableTopLayer(), PCB_DRAW_PANEL_GAL::setDefaultLayerOrder(), and SetTopLayer().
|
staticconstexpr |
Rendering order modifier for layers that are marked as top layers.
Definition at line 742 of file view.h.
Referenced by SCH_PRINTOUT::PrintPage(), KIGFX::VIEW_ITEM_DATA::saveLayers(), SCH_DRAW_PANEL::setDefaultLayerDeps(), SCH_PREVIEW_PANEL::setDefaultLayerDeps(), GERBVIEW_DRAW_PANEL_GAL::setDefaultLayerDeps(), PL_DRAW_PANEL_GAL::setDefaultLayerDeps(), PCB_DRAW_PANEL_GAL::setDefaultLayerDeps(), SCH_DRAW_PANEL::setDefaultLayerOrder(), SCH_PREVIEW_PANEL::setDefaultLayerOrder(), PCB_DRAW_PANEL_GAL::setDefaultLayerOrder(), BOARD_PRINTOUT::setupViewLayers(), and VIEW().