KiCad PCB EDA Suite
SELECTION Class Reference

#include <selection.h>

Inheritance diagram for SELECTION:
KIGFX::VIEW_GROUP KIGFX::VIEW_ITEM

Public Types

using ITER = std::set< EDA_ITEM * >::iterator
 
using CITER = std::set< EDA_ITEM * >::const_iterator
 

Public Member Functions

 SELECTION ()
 
 SELECTION (const SELECTION &aOther)
 
const SELECTIONoperator= (const SELECTION &aOther)
 
ITER begin ()
 
ITER end ()
 
CITER begin () const
 
CITER end () const
 
void SetIsHover (bool aIsHover)
 
bool IsHover () const
 
virtual void Add (EDA_ITEM *aItem)
 
virtual void Remove (EDA_ITEM *aItem)
 
virtual void Clear () override
 Function Clear() Removes all the stored items from the group. More...
 
virtual unsigned int GetSize () const override
 Function GetSize() Returns the number of stored items. More...
 
virtual KIGFX::VIEW_ITEMGetItem (unsigned int idx) const override
 
bool Contains (EDA_ITEM *aItem) const
 
bool Empty () const
 Checks if there is anything selected. More...
 
int Size () const
 Returns the number of selected parts. More...
 
const std::set< EDA_ITEM * > GetItems () const
 
VECTOR2I GetCenter () const
 Returns the center point of the selection area bounding box. More...
 
const BOX2I ViewBBox () const override
 Function ViewBBox() Returns the bounding box for all stored items covering all its layers. More...
 
VECTOR2I GetPosition () const
 Returns the top left point of the selection area bounding box. More...
 
EDA_RECT GetBoundingBox () const
 
EDA_ITEMGetTopLeftItem (bool onlyModules=false) const
 
EDA_ITEMGetTopLeftModule () const
 
EDA_ITEMoperator[] (const int index) const
 
EDA_ITEMFront () const
 
std::set< EDA_ITEM * > & Items ()
 
template<class T >
T * FirstOfKind () const
 
virtual const VIEW_GROUP::ITEMS updateDrawList () const override
 
bool HasReferencePoint () const
 
VECTOR2I GetReferencePoint () const
 
void SetReferencePoint (const VECTOR2I &aP)
 
void ClearReferencePoint ()
 
virtual void Add (VIEW_ITEM *aItem)
 Function Add() Adds an item to the group. More...
 
virtual void Remove (VIEW_ITEM *aItem)
 Function Remove() Removes an item from the group. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const override
 Function ViewDraw() Draws all the stored items in the group on the given layer. More...
 
virtual void ViewGetLayers (int aLayers[], int &aCount) const override
 Function ViewGetLayers() Returns all the layers used by the stored items. More...
 
virtual void SetLayer (int aLayer)
 Function SetLayer() Sets layer used to draw the group. More...
 
void FreeItems ()
 Function FreeItems() Frees all the items that were added to the group. More...
 
virtual unsigned int ViewGetLOD (int aLayer, VIEW *aView) const
 Function ViewGetLOD() Returns the level of detail of the item. More...
 
VIEW_ITEM_DATA * viewPrivData () const
 

Protected Types

typedef std::vector< VIEW_ITEM * > ITEMS
 

Protected Attributes

int m_layer
 Layer on which the group is drawn. More...
 
ITEMS m_groupItems
 Container for storing VIEW_ITEMs. More...
 

Private Attributes

boost::optional< VECTOR2Im_referencePoint
 
std::set< EDA_ITEM * > m_items
 Set of selected items. More...
 
bool m_isHover
 

Detailed Description

Definition at line 35 of file selection.h.

Member Typedef Documentation

using SELECTION::CITER = std::set<EDA_ITEM*>::const_iterator

Definition at line 54 of file selection.h.

typedef std::vector<VIEW_ITEM*> KIGFX::VIEW_GROUP::ITEMS
protectedinherited

Definition at line 45 of file view_group.h.

using SELECTION::ITER = std::set<EDA_ITEM*>::iterator

Definition at line 53 of file selection.h.

Constructor & Destructor Documentation

SELECTION::SELECTION ( )
inline

Definition at line 38 of file selection.h.

38 {};
SELECTION::SELECTION ( const SELECTION aOther)
inline

Definition at line 40 of file selection.h.

References m_isHover, and m_items.

41  {
42  m_items = aOther.m_items;
43  m_isHover = aOther.m_isHover;
44  }
bool m_isHover
Definition: selection.h:200
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198

Member Function Documentation

void VIEW_GROUP::Add ( VIEW_ITEM aItem)
virtualinherited

Function Add() Adds an item to the group.

Parameters
aItemis the item to be added.

Definition at line 55 of file view_group.cpp.

References KIGFX::VIEW_GROUP::m_groupItems.

Referenced by PNS_PCBNEW_DEBUG_DECORATOR::AddLine(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), SELECTION_TOOL::disambiguationMenu(), PNS_KICAD_IFACE::DisplayItem(), PCB_TOOL::doInteractiveItemPlacement(), PCB_EDITOR_CONTROL::PlaceModule(), and PCB_EDITOR_CONTROL::PlaceTarget().

56 {
57  m_groupItems.push_back( aItem );
58 }
ITEMS m_groupItems
Container for storing VIEW_ITEMs.
Definition: view_group.h:135
virtual void SELECTION::Add ( EDA_ITEM aItem)
inlinevirtual
ITER SELECTION::begin ( )
inline

Definition at line 56 of file selection.h.

References m_items.

56 { return m_items.begin(); }
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198
CITER SELECTION::begin ( ) const
inline

Definition at line 58 of file selection.h.

References m_items.

58 { return m_items.cbegin(); }
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198
virtual void SELECTION::Clear ( )
inlineoverridevirtual

Function Clear() Removes all the stored items from the group.

Reimplemented from KIGFX::VIEW_GROUP.

Definition at line 81 of file selection.h.

References m_items.

Referenced by PCB_TOOL::doInteractiveItemPlacement(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::PlaceDXF(), DRAWING_TOOL::PlaceText(), GERBVIEW_SELECTION_TOOL::Reset(), and SELECTION_TOOL::Reset().

82  {
83  m_items.clear();
84  }
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198
void SELECTION::ClearReferencePoint ( )
inline

Definition at line 188 of file selection.h.

References m_referencePoint.

Referenced by SELECTION_TOOL::RequestSelection(), SELECTION_TOOL::selectMultiple(), and SELECTION_TOOL::selectPoint().

189  {
190  m_referencePoint = boost::none;
191  }
boost::optional< VECTOR2I > m_referencePoint
Definition: selection.h:195
bool SELECTION::Contains ( EDA_ITEM aItem) const
inline

Definition at line 100 of file selection.h.

References m_items.

Referenced by SELECTION_TOOL::select().

101  {
102  return m_items.find( aItem ) != m_items.end();
103  }
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198
ITER SELECTION::end ( )
inline

Definition at line 57 of file selection.h.

References m_items.

57 { return m_items.end(); }
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198
CITER SELECTION::end ( ) const
inline

Definition at line 59 of file selection.h.

References m_items.

59 { return m_items.cend(); }
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198
template<class T >
T* SELECTION::FirstOfKind ( ) const
inline

Definition at line 158 of file selection.h.

References m_items.

159  {
160  auto refType = T( nullptr ).Type();
161 
162  for( auto item : m_items )
163  {
164  if( item->Type() == refType )
165  return static_cast<T*> ( item );
166  }
167 
168  return nullptr;
169  }
T
enum T contains all this lexer's tokens.
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198
void VIEW_GROUP::FreeItems ( )
inherited

Function FreeItems() Frees all the items that were added to the group.

Definition at line 141 of file view_group.cpp.

References KIGFX::VIEW_GROUP::Clear(), KIGFX::VIEW_GROUP::GetItem(), and KIGFX::VIEW_GROUP::GetSize().

Referenced by PNS_PCBNEW_DEBUG_DECORATOR::Clear(), PNS_KICAD_IFACE::EraseView(), DRAWING_TOOL::PlaceDXF(), PNS_KICAD_IFACE::SetView(), and PNS_KICAD_IFACE::~PNS_KICAD_IFACE().

142 {
143  for( unsigned int i = 0 ; i < GetSize(); i++ )
144  delete GetItem( i );
145 
146  Clear();
147 }
virtual VIEW_ITEM * GetItem(unsigned int aIdx) const
Definition: view_group.cpp:86
virtual void Clear()
Function Clear() Removes all the stored items from the group.
Definition: view_group.cpp:74
virtual unsigned int GetSize() const
Function GetSize() Returns the number of stored items.
Definition: view_group.cpp:80
EDA_RECT SELECTION::GetBoundingBox ( ) const

Definition at line 2012 of file pcbnew/tools/selection_tool.cpp.

References Front(), EDA_ITEM::GetBoundingBox(), m_items, and EDA_RECT::Merge().

Referenced by ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignLeft(), ALIGN_DISTRIBUTE_TOOL::AlignRight(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), GetCenter(), and GetPosition().

2013 {
2014  EDA_RECT bbox;
2015 
2016  bbox = Front()->GetBoundingBox();
2017  auto i = m_items.begin();
2018  ++i;
2019 
2020  for( ; i != m_items.end(); ++i )
2021  {
2022  bbox.Merge( (*i)->GetBoundingBox() );
2023  }
2024 
2025  return bbox;
2026 }
virtual const EDA_RECT GetBoundingBox() const
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
void Merge(const EDA_RECT &aRect)
Function Merge modifies the position and size of the rectangle in order to contain aRect...
EDA_ITEM * Front() const
Definition: selection.h:144
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198
Class EDA_RECT handles the component boundary box.
VECTOR2I SELECTION::GetCenter ( ) const

Returns the center point of the selection area bounding box.

Definition at line 2006 of file pcbnew/tools/selection_tool.cpp.

References EDA_RECT::Centre(), and GetBoundingBox().

Referenced by getAnchorPoint(), GAL_ARRAY_CREATOR::getRotationCentre(), and POSITION_RELATIVE_TOOL::RelativeItemSelectionMove().

2007 {
2008  return static_cast<VECTOR2I>( GetBoundingBox().Centre() );
2009 }
EDA_RECT GetBoundingBox() const
wxPoint Centre() const
virtual KIGFX::VIEW_ITEM* SELECTION::GetItem ( unsigned int  idx) const
inlineoverridevirtual

Reimplemented from KIGFX::VIEW_GROUP.

Definition at line 91 of file selection.h.

References m_items.

92  {
93  auto iter = m_items.begin();
94 
95  std::advance( iter, idx );
96 
97  return *iter;
98  }
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198
const std::set<EDA_ITEM*> SELECTION::GetItems ( ) const
inline

Definition at line 117 of file selection.h.

References m_items.

Referenced by SELECTION_TOOL::filterSelection(), SELECTION_TOOL::selectConnection(), SELECTION_TOOL::selectCopper(), and SELECTION_TOOL::selectNet().

118  {
119  return m_items;
120  }
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198
VECTOR2I SELECTION::GetPosition ( ) const

Returns the top left point of the selection area bounding box.

Definition at line 2000 of file pcbnew/tools/selection_tool.cpp.

References GetBoundingBox(), and EDA_RECT::GetPosition().

2001 {
2002  return static_cast<VECTOR2I>( GetBoundingBox().GetPosition() );
2003 }
EDA_RECT GetBoundingBox() const
const wxPoint & GetPosition() const
VECTOR2I SELECTION::GetReferencePoint ( ) const
inline

Definition at line 178 of file selection.h.

References m_referencePoint.

Referenced by CLIPBOARD_IO::SaveSelection().

179  {
180  return *m_referencePoint;
181  }
boost::optional< VECTOR2I > m_referencePoint
Definition: selection.h:195
virtual unsigned int SELECTION::GetSize ( ) const
inlineoverridevirtual

Function GetSize() Returns the number of stored items.

Returns
Number of stored items.

Reimplemented from KIGFX::VIEW_GROUP.

Definition at line 86 of file selection.h.

References m_items.

Referenced by getAnchorPoint(), GERBVIEW_SELECTION_TOOL::RequestSelection(), and SELECTION_TOOL::RequestSelection().

87  {
88  return m_items.size();
89  }
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198
EDA_ITEM * SELECTION::GetTopLeftItem ( bool  onlyModules = false) const

Definition at line 2029 of file pcbnew/tools/selection_tool.cpp.

References BOARD_ITEM::GetPosition(), m_items, PCB_MODULE_T, EDA_ITEM::Type(), wxPoint::x, and wxPoint::y.

Referenced by getAnchorPoint(), and GetTopLeftModule().

2030 {
2031  BOARD_ITEM* topLeftItem = nullptr;
2032  BOARD_ITEM* currentItem;
2033 
2034  wxPoint pnt;
2035 
2036  // find the leftmost (smallest x coord) and highest (smallest y with the smallest x) item in the selection
2037  for( auto item : m_items )
2038  {
2039  currentItem = static_cast<BOARD_ITEM*>( item );
2040  pnt = currentItem->GetPosition();
2041 
2042  if( ( currentItem->Type() != PCB_MODULE_T ) && onlyModules )
2043  {
2044  continue;
2045  }
2046  else
2047  {
2048  if( topLeftItem == nullptr )
2049  {
2050  topLeftItem = currentItem;
2051  }
2052  else if( ( pnt.x < topLeftItem->GetPosition().x ) ||
2053  ( ( topLeftItem->GetPosition().x == pnt.x ) &&
2054  ( pnt.y < topLeftItem->GetPosition().y ) ) )
2055  {
2056  topLeftItem = currentItem;
2057  }
2058  }
2059  }
2060 
2061  return static_cast<EDA_ITEM*>( topLeftItem );
2062 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
virtual const wxPoint & GetPosition() const =0
class MODULE, a footprint
Definition: typeinfo.h:101
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:165
EDA_ITEM * SELECTION::GetTopLeftModule ( ) const

Definition at line 2065 of file pcbnew/tools/selection_tool.cpp.

References GetTopLeftItem().

Referenced by getAnchorPoint().

2066 {
2067  return GetTopLeftItem( true );
2068 }
EDA_ITEM * GetTopLeftItem(bool onlyModules=false) const
bool SELECTION::HasReferencePoint ( ) const
inline

Definition at line 173 of file selection.h.

References m_referencePoint.

Referenced by CLIPBOARD_IO::SaveSelection(), and EDIT_TOOL::updateModificationPoint().

174  {
175  return m_referencePoint != boost::none;
176  }
boost::optional< VECTOR2I > m_referencePoint
Definition: selection.h:195
bool SELECTION::IsHover ( ) const
inline

Definition at line 66 of file selection.h.

References m_isHover.

Referenced by EDIT_TOOL::Main().

67  {
68  return m_isHover;
69  }
bool m_isHover
Definition: selection.h:200
std::set<EDA_ITEM*>& SELECTION::Items ( )
inline

Definition at line 152 of file selection.h.

References m_items.

153  {
154  return m_items;
155  }
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198
const SELECTION& SELECTION::operator= ( const SELECTION aOther)
inline

Definition at line 46 of file selection.h.

References m_isHover, and m_items.

47  {
48  m_items = aOther.m_items;
49  m_isHover = aOther.m_isHover;
50  return *this;
51  }
bool m_isHover
Definition: selection.h:200
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198
EDA_ITEM* SELECTION::operator[] ( const int  index) const
inline

Definition at line 134 of file selection.h.

References m_items.

135  {
136  if( index < 0 || (unsigned int) index >= m_items.size() )
137  return nullptr;
138 
139  auto iter = m_items.begin();
140  std::advance( iter, index );
141  return *iter;
142  }
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198
void VIEW_GROUP::Remove ( VIEW_ITEM aItem)
virtualinherited

Function Remove() Removes an item from the group.

Parameters
aItemis the item to be removed.

Definition at line 61 of file view_group.cpp.

References KIGFX::VIEW_GROUP::m_groupItems.

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), SELECTION_TOOL::disambiguationMenu(), PCB_TOOL::doInteractiveItemPlacement(), PCB_EDITOR_CONTROL::PlaceModule(), and PCB_EDITOR_CONTROL::PlaceTarget().

62 {
63  for( auto iter = m_groupItems.begin(); iter != m_groupItems.end(); ++iter )
64  {
65  if( aItem == *iter )
66  {
67  m_groupItems.erase( iter );
68  break;
69  }
70  }
71 }
ITEMS m_groupItems
Container for storing VIEW_ITEMs.
Definition: view_group.h:135
virtual void SELECTION::Remove ( EDA_ITEM aItem)
inlinevirtual

Definition at line 76 of file selection.h.

References m_items.

Referenced by PCB_TOOL::doInteractiveItemPlacement(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::PlaceText(), GERBVIEW_SELECTION_TOOL::unselect(), and SELECTION_TOOL::unselect().

77  {
78  m_items.erase( aItem );
79  }
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198
void SELECTION::SetIsHover ( bool  aIsHover)
inline
virtual void KIGFX::VIEW_GROUP::SetLayer ( int  aLayer)
inlinevirtualinherited

Function SetLayer() Sets layer used to draw the group.

Parameters
aLayeris the layer used for drawing.

Definition at line 115 of file view_group.h.

References KIGFX::VIEW_GROUP::m_layer.

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), SELECTION_TOOL::disambiguationMenu(), PNS_KICAD_IFACE::SetView(), and PNS_PCBNEW_DEBUG_DECORATOR::SetView().

116  {
117  m_layer = aLayer;
118  }
int m_layer
Layer on which the group is drawn.
Definition: view_group.h:131
void SELECTION::SetReferencePoint ( const VECTOR2I aP)
inline

Definition at line 183 of file selection.h.

References m_referencePoint.

Referenced by EDIT_TOOL::copyToClipboard(), and EDIT_TOOL::updateModificationPoint().

184  {
185  m_referencePoint = aP;
186  }
boost::optional< VECTOR2I > m_referencePoint
Definition: selection.h:195
const KIGFX::VIEW_GROUP::ITEMS SELECTION::updateDrawList ( ) const
overridevirtual

Reimplemented from KIGFX::VIEW_GROUP.

Definition at line 2095 of file pcbnew/tools/selection_tool.cpp.

References m_items, PCB_MODULE_T, and MODULE::RunOnChildren().

2096 {
2097  std::vector<VIEW_ITEM*> items;
2098 
2099  for( auto item : m_items )
2100  {
2101  items.push_back( item );
2102 
2103  if( item->Type() == PCB_MODULE_T )
2104  {
2105  MODULE* module = static_cast<MODULE*>( item );
2106  module->RunOnChildren( [&] ( BOARD_ITEM* bitem ) { items.push_back( bitem ); } );
2107  }
2108  }
2109 
2110  return items;
2111 }
void RunOnChildren(std::function< void(BOARD_ITEM *)> aFunction)
Function RunOnChildren.
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
class MODULE, a footprint
Definition: typeinfo.h:101
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198
const BOX2I SELECTION::ViewBBox ( ) const
overridevirtual

Function ViewBBox() Returns the bounding box for all stored items covering all its layers.

Returns
The current bounding box

Reimplemented from KIGFX::VIEW_GROUP.

Definition at line 2071 of file pcbnew/tools/selection_tool.cpp.

References Front(), EDA_ITEM::GetBoundingBox(), EDA_RECT::GetOrigin(), EDA_RECT::GetSize(), m_items, EDA_RECT::Merge(), and Size().

Referenced by GERBVIEW_SELECTION_TOOL::zoomFitSelection(), and SELECTION_TOOL::zoomFitSelection().

2072 {
2073  EDA_RECT eda_bbox;
2074 
2075  if( Size() == 1 )
2076  {
2077  eda_bbox = Front()->GetBoundingBox();
2078  }
2079  else if( Size() > 1 )
2080  {
2081  eda_bbox = Front()->GetBoundingBox();
2082  auto i = m_items.begin();
2083  ++i;
2084 
2085  for( ; i != m_items.end(); ++i )
2086  {
2087  eda_bbox.Merge( (*i)->GetBoundingBox() );
2088  }
2089  }
2090 
2091  return BOX2I( eda_bbox.GetOrigin(), eda_bbox.GetSize() );
2092 }
virtual const EDA_RECT GetBoundingBox() const
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
BOX2< VECTOR2I > BOX2I
Definition: box2.h:468
void Merge(const EDA_RECT &aRect)
Function Merge modifies the position and size of the rectangle in order to contain aRect...
EDA_ITEM * Front() const
Definition: selection.h:144
const wxPoint & GetOrigin() const
std::set< EDA_ITEM * > m_items
Set of selected items.
Definition: selection.h:198
Class EDA_RECT handles the component boundary box.
int Size() const
Returns the number of selected parts.
Definition: selection.h:112
const wxSize & GetSize() const
void VIEW_GROUP::ViewDraw ( int  aLayer,
VIEW aView 
) const
overridevirtualinherited

Function ViewDraw() Draws all the stored items in the group on the given layer.

Parameters
aLayeris the layer which should be drawn.
aViewis the VIEW that should be used for drawing.

Reimplemented from KIGFX::VIEW_ITEM.

Definition at line 101 of file view_group.cpp.

References KIGFX::PAINTER::Draw(), KIGFX::VIEW::GetGAL(), KIGFX::VIEW::GetPainter(), KIGFX::VIEW::IsLayerVisible(), KIGFX::VIEW::SortLayers(), KIGFX::VIEW_GROUP::updateDrawList(), and KIGFX::VIEW::VIEW_MAX_LAYERS.

102 {
103  auto gal = aView->GetGAL();
104  PAINTER* painter = aView->GetPainter();
105 
106  const auto drawList = updateDrawList();
107 
108  // Draw all items immediately (without caching)
109  for( auto item : drawList )
110  {
111  gal->PushDepth();
112 
113  int layers[VIEW::VIEW_MAX_LAYERS], layers_count;
114  item->ViewGetLayers( layers, layers_count );
115  aView->SortLayers( layers, layers_count );
116 
117  for( int i = 0; i < layers_count; i++ )
118  {
119  if( aView->IsLayerVisible( layers[i] ) )
120  {
121  gal->AdvanceDepth();
122 
123  if( !painter->Draw( item, layers[i] ) )
124  item->ViewDraw( layers[i], aView ); // Alternative drawing method
125  }
126  }
127 
128  gal->PopDepth();
129  }
130 }
bool IsLayerVisible(int aLayer) const
Function IsLayerVisible() Returns information about visibility of a particular layer.
Definition: view.h:404
virtual const ITEMS updateDrawList() const
Definition: view_group.cpp:150
void SortLayers(int aLayers[], int &aCount) const
Function SortLayers() Changes the order of given layer ids, so after sorting the order corresponds to...
Definition: view.cpp:604
Class PAINTER contains all the knowledge about how to draw graphical object onto any particular outpu...
Definition: painter.h:278
GAL * GetGAL() const
Function GetGAL() Returns the GAL this view is using to draw graphical primitives.
Definition: view.h:177
static const int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:652
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:196
virtual bool Draw(const VIEW_ITEM *aItem, int aLayer)=0
Function Draw Takes an instance of VIEW_ITEM and passes it to a function that know how to draw the it...
void VIEW_GROUP::ViewGetLayers ( int  aLayers[],
int &  aCount 
) const
overridevirtualinherited

Function ViewGetLayers() Returns all the layers used by the stored items.

Parameters
aLayers[]is the output layer index array.
aCountis the number of layer indices in aLayers[].

Implements KIGFX::VIEW_ITEM.

Definition at line 133 of file view_group.cpp.

References KIGFX::VIEW_GROUP::m_layer.

134 {
135  // Everything is displayed on a single layer
136  aLayers[0] = m_layer;
137  aCount = 1;
138 }
int m_layer
Layer on which the group is drawn.
Definition: view_group.h:131
virtual unsigned int KIGFX::VIEW_ITEM::ViewGetLOD ( int  aLayer,
VIEW aView 
) const
inlinevirtualinherited

Function ViewGetLOD() Returns the level of detail of the item.

A level of detail is the minimal VIEW scale that is sufficient for an item to be shown on a given layer.

Reimplemented in D_PAD, MODULE, VIA, GERBER_DRAW_ITEM, TRACK, and TEXTE_MODULE.

Definition at line 134 of file view_item.h.

Referenced by KIGFX::VIEW::drawItem::operator()().

135  {
136  // By default always show the item
137  return 0;
138  }

Member Data Documentation

ITEMS KIGFX::VIEW_GROUP::m_groupItems
protectedinherited
bool SELECTION::m_isHover
private

Definition at line 200 of file selection.h.

Referenced by IsHover(), operator=(), SELECTION(), and SetIsHover().

std::set<EDA_ITEM*> SELECTION::m_items
private
int KIGFX::VIEW_GROUP::m_layer
protectedinherited

Layer on which the group is drawn.

Definition at line 131 of file view_group.h.

Referenced by KIGFX::VIEW_GROUP::SetLayer(), and KIGFX::VIEW_GROUP::ViewGetLayers().

boost::optional<VECTOR2I> SELECTION::m_referencePoint
private

The documentation for this class was generated from the following files: