KiCad PCB EDA Suite
PNS_LOG_VIEWER_OVERLAY Class Reference

#include <pns_log_viewer_frame.h>

Inheritance diagram for PNS_LOG_VIEWER_OVERLAY:
KIGFX::VIEW_OVERLAY KIGFX::VIEW_ITEM INSPECTABLE

Public Member Functions

 PNS_LOG_VIEWER_OVERLAY (KIGFX::GAL *aGal)
 
void AnnotatedPolyline (const SHAPE_LINE_CHAIN &aL, std::string name, bool aShowVertexNumbers=false)
 
void AnnotatedPoint (const VECTOR2I p, int size, std::string name="", bool aShowVertexNumbers=false)
 
void Arc (const SHAPE_ARC &arc)
 
void DrawAnnotations ()
 
void Clear ()
 
virtual const BOX2I ViewBBox () const override
 Return the bounding box of the item covering all its layers. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const override
 Draw the parts of the object belonging to layer aLayer. More...
 
virtual void ViewGetLayers (int aLayers[], int &aCount) const override
 Return the all the layers within the VIEW the object is painted on. More...
 
void Line (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
 
void Line (const SEG &aSeg)
 
void Segment (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth)
 
void Circle (const VECTOR2D &aCenterPoint, double aRadius)
 
void Arc (const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle)
 
void Rectangle (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
 
void Cross (const VECTOR2D &aP, int aSize)
 
void Polygon (const std::deque< VECTOR2D > &aPointList)
 
void Polygon (const SHAPE_POLY_SET &aPolySet)
 
void Polygon (const VECTOR2D aPointList[], int aListSize)
 
void Polyline (const SHAPE_LINE_CHAIN &aPolyLine)
 
void BitmapText (const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle)
 
void SetIsFill (bool aIsFillEnabled)
 
void SetIsStroke (bool aIsStrokeEnabled)
 
void SetFillColor (const COLOR4D &aColor)
 
void SetStrokeColor (const COLOR4D &aColor)
 
void SetGlyphSize (const VECTOR2D &aSize)
 
void SetLineWidth (double aLineWidth)
 
const COLOR4DGetStrokeColor () const
 
const COLOR4DGetFillColor () const
 
virtual double ViewGetLOD (int aLayer, VIEW *aView) const
 Return the level of detail (LOD) of the item. More...
 
VIEW_ITEM_DATA * viewPrivData () const
 
void ClearViewPrivData ()
 
bool Set (PROPERTY_BASE *aProperty, wxAny &aValue)
 
template<typename T >
bool Set (PROPERTY_BASE *aProperty, T aValue)
 
template<typename T >
bool Set (const wxString &aProperty, T aValue)
 
wxAny Get (PROPERTY_BASE *aProperty)
 
template<typename T >
Get (PROPERTY_BASE *aProperty)
 
template<typename T >
boost::optional< T > Get (const wxString &aProperty)
 

Private Attributes

std::unique_ptr< LABEL_MANAGERm_labelMgr
 

Detailed Description

Definition at line 80 of file pns_log_viewer_frame.h.

Constructor & Destructor Documentation

◆ PNS_LOG_VIEWER_OVERLAY()

PNS_LOG_VIEWER_OVERLAY::PNS_LOG_VIEWER_OVERLAY ( KIGFX::GAL aGal)

Definition at line 226 of file pns_log_viewer.cpp.

227 {
228  m_labelMgr.reset( new LABEL_MANAGER( aGal ) );
229 }
std::unique_ptr< LABEL_MANAGER > m_labelMgr

References m_labelMgr.

Member Function Documentation

◆ AnnotatedPoint()

void PNS_LOG_VIEWER_OVERLAY::AnnotatedPoint ( const VECTOR2I  p,
int  size,
std::string  name = "",
bool  aShowVertexNumbers = false 
)

Definition at line 242 of file pns_log_viewer.cpp.

243 {
244  Line( p + VECTOR2D( size, size ), p - VECTOR2D( size, size ) );
245  Line( p + VECTOR2D( -size, size ), p - VECTOR2D( -size, size ) );
246 
247  //if( aShowVertexNumbers)
248  // m_labelMgr->Add( aL, GetStrokeColor() );
249 }
void Line(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622

References KIGFX::VIEW_OVERLAY::Line().

◆ AnnotatedPolyline()

void PNS_LOG_VIEWER_OVERLAY::AnnotatedPolyline ( const SHAPE_LINE_CHAIN aL,
std::string  name,
bool  aShowVertexNumbers = false 
)

Definition at line 232 of file pns_log_viewer.cpp.

234 {
235  Polyline( aL );
236 
237  if( aShowVertexNumbers)
238  m_labelMgr->Add( aL, GetStrokeColor() );
239 }
const COLOR4D & GetStrokeColor() const
Definition: view_overlay.h:103
void Polyline(const SHAPE_LINE_CHAIN &aPolyLine)
std::unique_ptr< LABEL_MANAGER > m_labelMgr

References KIGFX::VIEW_OVERLAY::GetStrokeColor(), m_labelMgr, and KIGFX::VIEW_OVERLAY::Polyline().

◆ Arc() [1/2]

void KIGFX::VIEW_OVERLAY::Arc ( const VECTOR2D aCenterPoint,
double  aRadius,
double  aStartAngle,
double  aEndAngle 
)
inherited

Definition at line 365 of file view_overlay.cpp.

367 {
368  m_commands.push_back( new COMMAND_ARC( aCenterPoint, aRadius, aStartAngle, aEndAngle ) );
369 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References KIGFX::VIEW_OVERLAY::m_commands.

Referenced by Arc().

◆ Arc() [2/2]

void PNS_LOG_VIEWER_OVERLAY::Arc ( const SHAPE_ARC arc)

Definition at line 252 of file pns_log_viewer.cpp.

253 {
254  double radius = arc.GetRadius();
255  double start_angle = DEG2RAD( arc.GetStartAngle() );
256  double angle = DEG2RAD( arc.GetCentralAngle() );
257 
259  KIGFX::VIEW_OVERLAY::Arc( arc.GetCenter(), radius, start_angle, start_angle + angle );
260 
262  COLOR4D lightStrokeCol = prevStrokeCol.WithAlpha(0.5);
263  KIGFX::VIEW_OVERLAY::SetStrokeColor( lightStrokeCol );
264 
266  KIGFX::VIEW_OVERLAY::Arc( arc.GetCenter(), radius, start_angle, start_angle + angle );
267 
268  KIGFX::VIEW_OVERLAY::SetStrokeColor( prevStrokeCol );
269 }
double GetRadius() const
Definition: shape_arc.cpp:492
const COLOR4D & GetStrokeColor() const
Definition: view_overlay.h:103
COLOR4D WithAlpha(double aAlpha) const
Return a color with the same color, but the given alpha.
Definition: color4d.h:314
double GetStartAngle() const
Definition: shape_arc.cpp:444
void Arc(const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle)
void SetStrokeColor(const COLOR4D &aColor)
int GetWidth() const
Definition: shape_arc.h:156
void SetLineWidth(double aLineWidth)
double DEG2RAD(double deg)
Definition: trigo.h:229
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
double GetCentralAngle() const
Definition: shape_arc.cpp:479
VECTOR2I GetCenter() const
Definition: shape_arc.cpp:464
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References PNS::angle(), KIGFX::VIEW_OVERLAY::Arc(), DEG2RAD(), SHAPE_ARC::GetCenter(), SHAPE_ARC::GetCentralAngle(), SHAPE_ARC::GetRadius(), SHAPE_ARC::GetStartAngle(), KIGFX::VIEW_OVERLAY::GetStrokeColor(), SHAPE_ARC::GetWidth(), KIGFX::VIEW_OVERLAY::SetLineWidth(), KIGFX::VIEW_OVERLAY::SetStrokeColor(), and KIGFX::COLOR4D::WithAlpha().

◆ BitmapText()

void KIGFX::VIEW_OVERLAY::BitmapText ( const wxString &  aText,
const VECTOR2D aPosition,
double  aRotationAngle 
)
inherited

Definition at line 390 of file view_overlay.cpp.

392 {
393  m_commands.push_back( new COMMAND_BITMAP_TEXT( aText, aPosition, aRotationAngle ) );
394 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References KIGFX::VIEW_OVERLAY::m_commands.

Referenced by LABEL_MANAGER::Redraw().

◆ Circle()

void KIGFX::VIEW_OVERLAY::Circle ( const VECTOR2D aCenterPoint,
double  aRadius 
)
inherited

Definition at line 359 of file view_overlay.cpp.

360 {
361  m_commands.push_back( new COMMAND_CIRCLE( aCenterPoint, aRadius ) );
362 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References KIGFX::VIEW_OVERLAY::m_commands.

◆ Clear()

void KIGFX::VIEW_OVERLAY::Clear ( )
inherited

Definition at line 283 of file view_overlay.cpp.

284 {
285  releaseCommands();
286 }

References KIGFX::VIEW_OVERLAY::releaseCommands().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 143 of file view_item.h.

144  {
145  m_viewPrivData = nullptr;
146  }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:151

References KIGFX::VIEW_ITEM::m_viewPrivData.

Referenced by KIGFX::VIEW::OnDestroy().

◆ Cross()

void KIGFX::VIEW_OVERLAY::Cross ( const VECTOR2D aP,
int  aSize 
)
inherited

Definition at line 421 of file view_overlay.cpp.

422 {
423  Line( aP + VECTOR2D( -aSize, -aSize ), aP + VECTOR2D( aSize, aSize ) );
424  Line( aP + VECTOR2D( aSize, -aSize ), aP + VECTOR2D( -aSize, aSize ) );
425 }
void Line(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622

References KIGFX::VIEW_OVERLAY::Line().

◆ DrawAnnotations()

void PNS_LOG_VIEWER_OVERLAY::DrawAnnotations ( )

Definition at line 271 of file pns_log_viewer.cpp.

272 {
273  m_labelMgr->Redraw( this );
274 }
std::unique_ptr< LABEL_MANAGER > m_labelMgr

References m_labelMgr.

◆ Get() [1/3]

wxAny INSPECTABLE::Get ( PROPERTY_BASE aProperty)
inlineinherited

Definition at line 86 of file inspectable.h.

87  {
89  TYPE_ID thisType = TYPE_HASH( *this );
90  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
91  return object ? aProperty->getter( object ) : wxAny();
92  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
virtual wxAny getter(void *aObject) const =0
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

References PROPERTY_BASE::getter(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

Referenced by BOOST_AUTO_TEST_CASE(), CLASS_D_DESC::CLASS_D_DESC(), PCB_EXPR_VAR_REF::GetValue(), and PAD_DESC::PAD_DESC().

◆ Get() [2/3]

template<typename T >
T INSPECTABLE::Get ( PROPERTY_BASE aProperty)
inlineinherited

Definition at line 95 of file inspectable.h.

96  {
98  TYPE_ID thisType = TYPE_HASH( *this );
99  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
100  return object ? aProperty->get<T>( object ) : T();
101  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
T get(void *aObject)
Definition: property.h:268
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

References PROPERTY_BASE::get(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Get() [3/3]

template<typename T >
boost::optional<T> INSPECTABLE::Get ( const wxString &  aProperty)
inlineinherited

Definition at line 104 of file inspectable.h.

105  {
107  TYPE_ID thisType = TYPE_HASH( *this );
108  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
109  boost::optional<T> ret = T();
110 
111  if( prop )
112  {
113  void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
114 
115  if( object )
116  ret = prop->get<T>( object );
117  }
118 
119  return ret;
120  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Return a property for a specific type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
T get(void *aObject)
Definition: property.h:268
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

References PROPERTY_BASE::get(), PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ GetFillColor()

const COLOR4D& KIGFX::VIEW_OVERLAY::GetFillColor ( ) const
inlineinherited

Definition at line 104 of file view_overlay.h.

104 { return m_fillColor; }

References KIGFX::VIEW_OVERLAY::m_fillColor.

◆ GetStrokeColor()

const COLOR4D& KIGFX::VIEW_OVERLAY::GetStrokeColor ( ) const
inlineinherited

Definition at line 103 of file view_overlay.h.

103 { return m_strokeColor; }

References KIGFX::VIEW_OVERLAY::m_strokeColor.

Referenced by AnnotatedPolyline(), and Arc().

◆ Line() [1/2]

void KIGFX::VIEW_OVERLAY::Line ( const VECTOR2D aStartPoint,
const VECTOR2D aEndPoint 
)
inherited

Definition at line 312 of file view_overlay.cpp.

313 {
314  m_commands.push_back( new COMMAND_LINE( aStartPoint, aEndPoint ) );
315 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References KIGFX::VIEW_OVERLAY::m_commands.

Referenced by AnnotatedPoint(), KIGFX::VIEW_OVERLAY::Cross(), KIGFX::VIEW_OVERLAY::Line(), KIGFX::VIEW_OVERLAY::Polyline(), LABEL_MANAGER::Redraw(), and KIGFX::VIEW_OVERLAY::Segment().

◆ Line() [2/2]

void KIGFX::VIEW_OVERLAY::Line ( const SEG aSeg)
inherited

Definition at line 318 of file view_overlay.cpp.

319 {
320  Line( aSeg.A, aSeg.B );
321 }
void Line(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
VECTOR2I A
Definition: seg.h:48
VECTOR2I B
Definition: seg.h:49

References SEG::A, SEG::B, and KIGFX::VIEW_OVERLAY::Line().

◆ Polygon() [1/3]

void KIGFX::VIEW_OVERLAY::Polygon ( const std::deque< VECTOR2D > &  aPointList)
inherited

Definition at line 347 of file view_overlay.cpp.

348 {
349  m_commands.push_back( new COMMAND_POLYGON( aPointList ) );
350 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References KIGFX::VIEW_OVERLAY::m_commands.

◆ Polygon() [2/3]

void KIGFX::VIEW_OVERLAY::Polygon ( const SHAPE_POLY_SET aPolySet)
inherited

Definition at line 341 of file view_overlay.cpp.

342 {
343  m_commands.push_back( new COMMAND_POLY_POLYGON( aPolySet ) );
344 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References KIGFX::VIEW_OVERLAY::m_commands.

◆ Polygon() [3/3]

void KIGFX::VIEW_OVERLAY::Polygon ( const VECTOR2D  aPointList[],
int  aListSize 
)
inherited

Definition at line 353 of file view_overlay.cpp.

354 {
355  m_commands.push_back( new COMMAND_POINT_POLYGON( aPointList, aListSize ) );
356 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References KIGFX::VIEW_OVERLAY::m_commands.

◆ Polyline()

void KIGFX::VIEW_OVERLAY::Polyline ( const SHAPE_LINE_CHAIN aPolyLine)
inherited

Definition at line 331 of file view_overlay.cpp.

332 {
333  SetIsStroke( true );
334  SetIsFill( false );
335 
336  for( int i = 0; i < aPolyLine.SegmentCount(); i++ )
337  Line( aPolyLine.CSegment( i ) );
338 }
void SetIsStroke(bool aIsStrokeEnabled)
void Line(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
int SegmentCount() const
Return the number of segments in this line chain.
void SetIsFill(bool aIsFillEnabled)
const SEG CSegment(int aIndex) const
Return a constant copy of the aIndex segment in the line chain.

References SHAPE_LINE_CHAIN::CSegment(), KIGFX::VIEW_OVERLAY::Line(), SHAPE_LINE_CHAIN::SegmentCount(), KIGFX::VIEW_OVERLAY::SetIsFill(), and KIGFX::VIEW_OVERLAY::SetIsStroke().

Referenced by AnnotatedPolyline().

◆ Rectangle()

void KIGFX::VIEW_OVERLAY::Rectangle ( const VECTOR2D aStartPoint,
const VECTOR2D aEndPoint 
)
inherited

Definition at line 372 of file view_overlay.cpp.

373 {
374  m_commands.push_back( new COMMAND_RECTANGLE( aStartPoint, aEndPoint ) );
375 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References KIGFX::VIEW_OVERLAY::m_commands.

Referenced by LABEL_MANAGER::Redraw().

◆ Segment()

void KIGFX::VIEW_OVERLAY::Segment ( const VECTOR2D aStartPoint,
const VECTOR2D aEndPoint,
double  aWidth 
)
inherited

Definition at line 324 of file view_overlay.cpp.

325 {
326  SetLineWidth( aWidth );
327  Line( aStartPoint, aEndPoint );
328 }
void Line(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
void SetLineWidth(double aLineWidth)

References KIGFX::VIEW_OVERLAY::Line(), and KIGFX::VIEW_OVERLAY::SetLineWidth().

◆ Set() [1/3]

bool INSPECTABLE::Set ( PROPERTY_BASE aProperty,
wxAny &  aValue 
)
inlineinherited

Definition at line 42 of file inspectable.h.

43  {
45  TYPE_ID thisType = TYPE_HASH( *this );
46  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
47 
48  if( object )
49  aProperty->setter( object, aValue );
50 
51  return object != nullptr;
52  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
virtual void setter(void *aObject, wxAny &aValue)=0
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::setter(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Set() [2/3]

template<typename T >
bool INSPECTABLE::Set ( PROPERTY_BASE aProperty,
aValue 
)
inlineinherited

Definition at line 55 of file inspectable.h.

56  {
58  TYPE_ID thisType = TYPE_HASH( *this );
59  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
60 
61  if( object )
62  aProperty->set<T>( object, aValue );
63 
64  return object != nullptr;
65  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
void set(void *aObject, T aValue)
Definition: property.h:261
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Set() [3/3]

template<typename T >
bool INSPECTABLE::Set ( const wxString &  aProperty,
aValue 
)
inlineinherited

Definition at line 68 of file inspectable.h.

69  {
71  TYPE_ID thisType = TYPE_HASH( *this );
72  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
73  void* object = nullptr;
74 
75  if( prop )
76  {
77  object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
78 
79  if( object )
80  prop->set<T>( object, aValue );
81  }
82 
83  return object != nullptr;
84  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Return a property for a specific type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
void set(void *aObject, T aValue)
Definition: property.h:261
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

References PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ SetFillColor()

void KIGFX::VIEW_OVERLAY::SetFillColor ( const COLOR4D aColor)
inherited

Definition at line 403 of file view_overlay.cpp.

404 {
405  m_fillColor = aColor;
406  m_commands.push_back( new COMMAND_SET_COLOR( false, aColor ) );
407 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References KIGFX::VIEW_OVERLAY::m_commands, and KIGFX::VIEW_OVERLAY::m_fillColor.

◆ SetGlyphSize()

void KIGFX::VIEW_OVERLAY::SetGlyphSize ( const VECTOR2D aSize)
inherited

Definition at line 384 of file view_overlay.cpp.

385 {
386  m_commands.push_back( new COMMAND_GLYPH_SIZE( aSize ) );
387 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References KIGFX::VIEW_OVERLAY::m_commands.

◆ SetIsFill()

void KIGFX::VIEW_OVERLAY::SetIsFill ( bool  aIsFillEnabled)
inherited

Definition at line 378 of file view_overlay.cpp.

379 {
380  m_commands.push_back( new COMMAND_SET_FILL( aIsFillEnabled ) );
381 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References KIGFX::VIEW_OVERLAY::m_commands.

Referenced by KIGFX::VIEW_OVERLAY::Polyline(), and LABEL_MANAGER::Redraw().

◆ SetIsStroke()

void KIGFX::VIEW_OVERLAY::SetIsStroke ( bool  aIsStrokeEnabled)
inherited

Definition at line 397 of file view_overlay.cpp.

398 {
399  m_commands.push_back( new COMMAND_SET_STROKE( aIsStrokeEnabled ) );
400 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References KIGFX::VIEW_OVERLAY::m_commands.

Referenced by KIGFX::VIEW_OVERLAY::Polyline(), and LABEL_MANAGER::Redraw().

◆ SetLineWidth()

void KIGFX::VIEW_OVERLAY::SetLineWidth ( double  aLineWidth)
inherited

Definition at line 416 of file view_overlay.cpp.

417 {
418  m_commands.push_back( new COMMAND_SET_WIDTH( aLineWidth ) );
419 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References KIGFX::VIEW_OVERLAY::m_commands.

Referenced by Arc(), LABEL_MANAGER::Redraw(), and KIGFX::VIEW_OVERLAY::Segment().

◆ SetStrokeColor()

void KIGFX::VIEW_OVERLAY::SetStrokeColor ( const COLOR4D aColor)
inherited

Definition at line 410 of file view_overlay.cpp.

411 {
412  m_strokeColor = aColor;
413  m_commands.push_back( new COMMAND_SET_COLOR( true, aColor ) );
414 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References KIGFX::VIEW_OVERLAY::m_commands, and KIGFX::VIEW_OVERLAY::m_strokeColor.

Referenced by Arc(), and LABEL_MANAGER::Redraw().

◆ ViewBBox()

const BOX2I KIGFX::VIEW_OVERLAY::ViewBBox ( ) const
overridevirtualinherited

Return the bounding box of the item covering all its layers.

Returns
the current bounding box.

Implements KIGFX::VIEW_ITEM.

Definition at line 289 of file view_overlay.cpp.

290 {
291  BOX2I maxBox;
292 
293  maxBox.SetMaximum();
294  return maxBox;
295 }
void SetMaximum()
Definition: box2.h:57

References BOX2< Vec >::SetMaximum().

◆ ViewDraw()

void KIGFX::VIEW_OVERLAY::ViewDraw ( int  aLayer,
VIEW aView 
) const
overridevirtualinherited

Draw the parts of the object belonging to layer aLayer.

An alternative way for drawing objects if there is no #PAINTER assigned for the view or if the PAINTER doesn't know how to paint this particular implementation of VIEW_ITEM. The preferred way of drawing is to design an appropriate PAINTER object, the method below is intended only for quick hacks and debugging purposes.

Parameters
aLayeris the current drawing layer.
aViewis a pointer to the VIEW device we are drawing on.

Reimplemented from KIGFX::VIEW_ITEM.

Definition at line 298 of file view_overlay.cpp.

299 {
300  for( const VIEW_OVERLAY::COMMAND* cmd : m_commands )
301  cmd->Execute( aView );
302 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References KIGFX::VIEW_OVERLAY::m_commands.

◆ ViewGetLayers()

void KIGFX::VIEW_OVERLAY::ViewGetLayers ( int  aLayers[],
int &  aCount 
) const
overridevirtualinherited

Return the all the layers within the VIEW the object is painted on.

For instance, a PAD spans zero or more copper layers and a few technical layers. ViewDraw() or PAINTER::Draw() is repeatedly called for each of the layers returned by ViewGetLayers(), depending on the rendering order.

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

Implements KIGFX::VIEW_ITEM.

Definition at line 305 of file view_overlay.cpp.

306 {
307  aLayers[0] = LAYER_GP_OVERLAY;
308  aCount = 1;
309 }
general purpose overlay
Definition: layer_ids.h:214

References LAYER_GP_OVERLAY.

◆ ViewGetLOD()

virtual double KIGFX::VIEW_ITEM::ViewGetLOD ( int  aLayer,
VIEW aView 
) const
inlinevirtualinherited

Return the level of detail (LOD) 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.

Parameters
aLayeris the current drawing layer.
aViewis a pointer to the VIEW device we are drawing on.
Returns
the level of detail. 0 always show the item, because the actual zoom level (or VIEW scale) is always > 0

Reimplemented in FP_ZONE, PAD, FOOTPRINT, PCB_VIA, GERBER_DRAW_ITEM, FP_TEXT, PCB_TRACK, ZONE, PCB_GROUP, and FP_SHAPE.

Definition at line 132 of file view_item.h.

133  {
134  // By default always show the item
135  return 0.0;
136  }

Referenced by PNS_KICAD_IFACE::IsItemVisible(), KIGFX::VIEW::DRAW_ITEM_VISITOR::operator()(), EE_GRID_HELPER::queryVisible(), PCB_GRID_HELPER::queryVisible(), and PCB_SELECTION_TOOL::Selectable().

◆ viewPrivData()

Member Data Documentation

◆ m_labelMgr

std::unique_ptr<LABEL_MANAGER> PNS_LOG_VIEWER_OVERLAY::m_labelMgr
private

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