KiCad PCB EDA Suite
WS_DRAW_ITEM_BASE Class Referenceabstract

#include <worksheet_shape_builder.h>

Inheritance diagram for WS_DRAW_ITEM_BASE:
WS_DRAW_ITEM_BITMAP WS_DRAW_ITEM_LINE WS_DRAW_ITEM_POLYGON WS_DRAW_ITEM_TEXT WS_DRAW_ITEM_RECT

Public Types

enum  WS_DRAW_TYPE {
  wsg_line, wsg_rect, wsg_poly, wsg_text,
  wsg_bitmap
}
 

Public Member Functions

virtual ~WS_DRAW_ITEM_BASE ()
 
COLOR4D GetColor () const
 
WS_DRAW_TYPE GetType () const
 
WORKSHEET_DATAITEMGetParent () const
 
virtual void DrawWsItem (EDA_RECT *aClipBox, wxDC *aDC)
 The function to draw a WS_DRAW_ITEM. More...
 
virtual void DrawWsItem (EDA_RECT *aClipBox, wxDC *aDC, const wxPoint &aOffset, GR_DRAWMODE aDrawMode, COLOR4D aColor=COLOR4D::UNSPECIFIED)=0
 More advanced version of DrawWsItem. More...
 
virtual bool HitTest (const wxPoint &aPosition) const =0
 Abstract function: should exist for derived items return true if the point aPosition is on the item. More...
 
virtual bool HitTest (const EDA_RECT &aRect) const =0
 Abstract function: should exist for derived items return true if the rect aRect intersects on the item. More...
 
virtual bool HitTestStartPoint (const wxPoint &aPosition)=0
 Abstract function: should exist for derived items return true if the point aPosition is near the starting point of this item, for items defined by 2 points (segments, rect) or the position of the item, for items having only one point (texts or polygons) the maxi dist is WORKSHEET_DATAITEM::GetMarkerSizeUi()/2. More...
 
virtual bool HitTestEndPoint (const wxPoint &aPosition)
 return true if the point aPosition is near the ending point of this item This is avirtual function which should be overriden for items defien by 2 points the maxi dist is WORKSHEET_DATAITEM::GetMarkerSizeUi()/2 More...
 

Public Attributes

int m_Flags
 

Protected Member Functions

 WS_DRAW_ITEM_BASE (WORKSHEET_DATAITEM *aParent, WS_DRAW_TYPE aType, COLOR4D aColor)
 

Protected Attributes

WS_DRAW_TYPE m_type
 
COLOR4D m_color
 
WORKSHEET_DATAITEMm_parent
 

Detailed Description

Definition at line 55 of file worksheet_shape_builder.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

WS_DRAW_ITEM_BASE::WS_DRAW_ITEM_BASE ( WORKSHEET_DATAITEM aParent,
WS_DRAW_TYPE  aType,
COLOR4D  aColor 
)
inlineprotected

Definition at line 71 of file worksheet_shape_builder.h.

73  {
74  m_type = aType;
75  m_color = aColor;
76  m_parent = aParent;
77  m_Flags = 0;
78  }
WORKSHEET_DATAITEM * m_parent
virtual WS_DRAW_ITEM_BASE::~WS_DRAW_ITEM_BASE ( )
inlinevirtual

Definition at line 81 of file worksheet_shape_builder.h.

81 {}

Member Function Documentation

virtual void WS_DRAW_ITEM_BASE::DrawWsItem ( EDA_RECT aClipBox,
wxDC *  aDC 
)
inlinevirtual

The function to draw a WS_DRAW_ITEM.

Definition at line 91 of file worksheet_shape_builder.h.

References UNSPECIFIED_DRAWMODE.

92  {
93  wxPoint offset( 0, 0 );
94  DrawWsItem( aClipBox, aDC, offset, UNSPECIFIED_DRAWMODE, COLOR4D::UNSPECIFIED );
95  }
virtual void DrawWsItem(EDA_RECT *aClipBox, wxDC *aDC)
The function to draw a WS_DRAW_ITEM.
virtual void WS_DRAW_ITEM_BASE::DrawWsItem ( EDA_RECT aClipBox,
wxDC *  aDC,
const wxPoint aOffset,
GR_DRAWMODE  aDrawMode,
COLOR4D  aColor = COLOR4D::UNSPECIFIED 
)
pure virtual

More advanced version of DrawWsItem.

This is what must be defined in the derived type.

Implemented in WS_DRAW_ITEM_BITMAP, WS_DRAW_ITEM_TEXT, WS_DRAW_ITEM_RECT, WS_DRAW_ITEM_POLYGON, and WS_DRAW_ITEM_LINE.

WORKSHEET_DATAITEM* WS_DRAW_ITEM_BASE::GetParent ( void  ) const
inline
WS_DRAW_TYPE WS_DRAW_ITEM_BASE::GetType ( ) const
inline

Definition at line 85 of file worksheet_shape_builder.h.

References m_type.

Referenced by KIGFX::WORKSHEET_VIEWITEM::ViewDraw().

85 { return m_type; };
virtual bool WS_DRAW_ITEM_BASE::HitTest ( const wxPoint aPosition) const
pure virtual

Abstract function: should exist for derived items return true if the point aPosition is on the item.

Implemented in WS_DRAW_ITEM_BITMAP, WS_DRAW_ITEM_TEXT, WS_DRAW_ITEM_RECT, WS_DRAW_ITEM_POLYGON, and WS_DRAW_ITEM_LINE.

virtual bool WS_DRAW_ITEM_BASE::HitTest ( const EDA_RECT aRect) const
pure virtual

Abstract function: should exist for derived items return true if the rect aRect intersects on the item.

Implemented in WS_DRAW_ITEM_BITMAP, WS_DRAW_ITEM_TEXT, WS_DRAW_ITEM_RECT, WS_DRAW_ITEM_POLYGON, and WS_DRAW_ITEM_LINE.

virtual bool WS_DRAW_ITEM_BASE::HitTestEndPoint ( const wxPoint aPosition)
inlinevirtual

return true if the point aPosition is near the ending point of this item This is avirtual function which should be overriden for items defien by 2 points the maxi dist is WORKSHEET_DATAITEM::GetMarkerSizeUi()/2

Reimplemented in WS_DRAW_ITEM_RECT, and WS_DRAW_ITEM_LINE.

Definition at line 130 of file worksheet_shape_builder.h.

131  {
132  return false;
133  }
virtual bool WS_DRAW_ITEM_BASE::HitTestStartPoint ( const wxPoint aPosition)
pure virtual

Abstract function: should exist for derived items return true if the point aPosition is near the starting point of this item, for items defined by 2 points (segments, rect) or the position of the item, for items having only one point (texts or polygons) the maxi dist is WORKSHEET_DATAITEM::GetMarkerSizeUi()/2.

Implemented in WS_DRAW_ITEM_BITMAP, WS_DRAW_ITEM_TEXT, WS_DRAW_ITEM_RECT, WS_DRAW_ITEM_POLYGON, and WS_DRAW_ITEM_LINE.

Member Data Documentation

COLOR4D WS_DRAW_ITEM_BASE::m_color
protected

Definition at line 66 of file worksheet_shape_builder.h.

Referenced by GetColor().

int WS_DRAW_ITEM_BASE::m_Flags

Definition at line 61 of file worksheet_shape_builder.h.

Referenced by PL_EDITOR_FRAME::Locate().

WORKSHEET_DATAITEM* WS_DRAW_ITEM_BASE::m_parent
protected

Definition at line 67 of file worksheet_shape_builder.h.

Referenced by GetParent().

WS_DRAW_TYPE WS_DRAW_ITEM_BASE::m_type
protected

Definition at line 65 of file worksheet_shape_builder.h.

Referenced by GetType(), and WS_DRAW_ITEM_RECT::WS_DRAW_ITEM_RECT().


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