KiCad PCB EDA Suite
Loading...
Searching...
No Matches
DS_DATA_ITEM Class Reference

Drawing sheet structure type definitions. More...

#include <ds_data_item.h>

Inheritance diagram for DS_DATA_ITEM:
DS_DATA_ITEM_BITMAP DS_DATA_ITEM_POLYGONS DS_DATA_ITEM_TEXT

Public Types

enum  DS_ITEM_TYPE {
  DS_TEXT , DS_SEGMENT , DS_RECT , DS_POLYPOLYGON ,
  DS_BITMAP
}
 

Public Member Functions

 DS_DATA_ITEM (DS_ITEM_TYPE aType)
 
virtual ~DS_DATA_ITEM ()
 
const std::vector< DS_DRAW_ITEM_BASE * > & GetDrawItems () const
 
virtual void SyncDrawItems (DS_DRAW_ITEM_LIST *aCollector, KIGFX::VIEW *aView)
 
void SetStart (double aPosx, double aPosy, enum CORNER_ANCHOR aAnchor=RB_CORNER)
 
void SetEnd (double aPosx, double aPosy, enum CORNER_ANCHOR aAnchor=RB_CORNER)
 
DS_ITEM_TYPE GetType () const
 
PAGE_OPTION GetPage1Option () const
 
void SetPage1Option (PAGE_OPTION aChoice)
 
const VECTOR2I GetStartPosIU (int ii=0) const
 
const VECTOR2I GetEndPosIU (int ii=0) const
 
const VECTOR2D GetStartPos (int ii=0) const
 
const VECTOR2D GetEndPos (int ii=0) const
 
virtual int GetPenSizeIU ()
 
void MoveTo (const VECTOR2D &aPosition)
 Move item to a new position.
 
void MoveToIU (const VECTOR2I &aPosition)
 Move item to a new position.
 
void MoveStartPointTo (const VECTOR2D &aPosition)
 Move the starting point of the item to a new position.
 
void MoveStartPointToIU (const VECTOR2I &aPosition)
 Move the starting point of the item to a new position.
 
void MoveEndPointTo (const VECTOR2D &aPosition)
 Move the ending point of the item to a new position.
 
void MoveEndPointToIU (const VECTOR2I &aPosition)
 Move the ending point of the item to a new position.
 
virtual bool IsInsidePage (int ii) const
 
const wxString GetClassName () const
 

Public Attributes

wxString m_Name
 
wxString m_Info
 
POINT_COORD m_Pos
 
POINT_COORD m_End
 
double m_LineWidth
 
int m_RepeatCount
 
VECTOR2D m_IncrementVector
 
int m_IncrementLabel
 

Protected Attributes

DS_ITEM_TYPE m_type
 
PAGE_OPTION m_pageOption
 
std::vector< DS_DRAW_ITEM_BASE * > m_drawItems
 

Detailed Description

Drawing sheet structure type definitions.

Basic items are:

  • segment and rect (defined by 2 points)
  • text (defined by a coordinate), the text and its justifications
  • poly polygon defined by a coordinate, and a set of list of corners ( because we use it for logos, there are more than one polygon in this description

Definition at line 95 of file ds_data_item.h.

Member Enumeration Documentation

◆ DS_ITEM_TYPE

Enumerator
DS_TEXT 
DS_SEGMENT 
DS_RECT 
DS_POLYPOLYGON 
DS_BITMAP 

Definition at line 98 of file ds_data_item.h.

Constructor & Destructor Documentation

◆ DS_DATA_ITEM()

DS_DATA_ITEM::DS_DATA_ITEM ( DS_ITEM_TYPE  aType)

Definition at line 64 of file ds_data_item.cpp.

References ALL_PAGES, m_IncrementLabel, m_LineWidth, m_pageOption, m_RepeatCount, and m_type.

◆ ~DS_DATA_ITEM()

DS_DATA_ITEM::~DS_DATA_ITEM ( )
virtual

Definition at line 74 of file ds_data_item.cpp.

References m_drawItems.

Member Function Documentation

◆ GetClassName()

const wxString DS_DATA_ITEM::GetClassName ( ) const

◆ GetDrawItems()

◆ GetEndPos()

◆ GetEndPosIU()

const VECTOR2I DS_DATA_ITEM::GetEndPosIU ( int  ii = 0) const

◆ GetPage1Option()

PAGE_OPTION DS_DATA_ITEM::GetPage1Option ( ) const
inline
Returns
true if the item has a end point (segment; rect) of false (text, polygon).

Definition at line 133 of file ds_data_item.h.

References m_pageOption.

Referenced by PROPERTIES_FRAME::CopyPrmsFromItemToPanel(), DS_DATA_MODEL_IO::formatOptions(), DS_DRAW_ITEM_BASE::GetMsgPanelInfo(), and DS_DRAW_ITEM_BASE::ViewGetLayers().

◆ GetPenSizeIU()

int DS_DATA_ITEM::GetPenSizeIU ( )
virtual

◆ GetStartPos()

◆ GetStartPosIU()

◆ GetType()

◆ IsInsidePage()

bool DS_DATA_ITEM::IsInsidePage ( int  ii) const
virtual
Returns
true if the item is inside the rectangle defined by the 4 corners, false otherwise.

Reimplemented in DS_DATA_ITEM_POLYGONS.

Definition at line 342 of file ds_data_item.cpp.

References GetEndPos(), GetStartPos(), DS_DATA_MODEL::GetTheInstance(), DS_DATA_MODEL::m_LT_Corner, DS_DATA_MODEL::m_RB_Corner, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by SyncDrawItems(), DS_DATA_ITEM_TEXT::SyncDrawItems(), and DS_DATA_ITEM_BITMAP::SyncDrawItems().

◆ MoveEndPointTo()

void DS_DATA_ITEM::MoveEndPointTo ( const VECTOR2D aPosition)

Move the ending point of the item to a new position.

This has meaning only for items defined by 2 points (segments and rectangles).

Parameters
aPositionis the new position of the ending point, in mm.

Definition at line 213 of file ds_data_item.cpp.

References DS_RECT, DS_SEGMENT, DS_DATA_MODEL::GetTheInstance(), GetType(), LB_CORNER, LT_CORNER, POINT_COORD::m_Anchor, m_End, DS_DATA_MODEL::m_LT_Corner, POINT_COORD::m_Pos, DS_DATA_MODEL::m_RB_Corner, RB_CORNER, RT_CORNER, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by MoveEndPointToIU(), and MoveTo().

◆ MoveEndPointToIU()

void DS_DATA_ITEM::MoveEndPointToIU ( const VECTOR2I aPosition)

Move the ending point of the item to a new position.

This has meaning only for items defined by 2 points (segments and rectangles).

Parameters
aPositionis the new position of the ending point in graphic units

Definition at line 256 of file ds_data_item.cpp.

References DS_DATA_MODEL::GetTheInstance(), DS_DATA_MODEL::m_WSunits2Iu, MoveEndPointTo(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PL_POINT_EDITOR::updateItem().

◆ MoveStartPointTo()

void DS_DATA_ITEM::MoveStartPointTo ( const VECTOR2D aPosition)

Move the starting point of the item to a new position.

Parameters
aPositionthe new position of the starting point, in mm.

Definition at line 171 of file ds_data_item.cpp.

References DS_DATA_MODEL::GetTheInstance(), LB_CORNER, LT_CORNER, POINT_COORD::m_Anchor, DS_DATA_MODEL::m_LT_Corner, POINT_COORD::m_Pos, m_Pos, DS_DATA_MODEL::m_RB_Corner, RB_CORNER, RT_CORNER, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by MoveStartPointToIU(), and MoveTo().

◆ MoveStartPointToIU()

void DS_DATA_ITEM::MoveStartPointToIU ( const VECTOR2I aPosition)

Move the starting point of the item to a new position.

Parameters
aPositionis the new position of item in graphic units.

Definition at line 204 of file ds_data_item.cpp.

References DS_DATA_MODEL::GetTheInstance(), DS_DATA_MODEL::m_WSunits2Iu, MoveStartPointTo(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PL_DRAWING_TOOLS::PlaceItem(), and PL_POINT_EDITOR::updateItem().

◆ MoveTo()

void DS_DATA_ITEM::MoveTo ( const VECTOR2D aPosition)

Move item to a new position.

Parameters
aPositionthe new position of item, in mm.

Definition at line 155 of file ds_data_item.cpp.

References GetEndPos(), GetEndPosIU(), GetStartPos(), GetStartPosIU(), m_drawItems, MoveEndPointTo(), and MoveStartPointTo().

Referenced by MoveToIU().

◆ MoveToIU()

void DS_DATA_ITEM::MoveToIU ( const VECTOR2I aPosition)

Move item to a new position.

Parameters
aPositionthe new position of the starting point in graphic units.

Definition at line 145 of file ds_data_item.cpp.

References DS_DATA_MODEL::GetTheInstance(), DS_DATA_MODEL::m_WSunits2Iu, MoveTo(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PL_DRAWING_TOOLS::DrawShape(), and PL_EDIT_TOOL::moveItem().

◆ SetEnd()

void DS_DATA_ITEM::SetEnd ( double  aPosx,
double  aPosy,
enum CORNER_ANCHOR  aAnchor = RB_CORNER 
)
inline

◆ SetPage1Option()

void DS_DATA_ITEM::SetPage1Option ( PAGE_OPTION  aChoice)
inline

◆ SetStart()

void DS_DATA_ITEM::SetStart ( double  aPosx,
double  aPosy,
enum CORNER_ANCHOR  aAnchor = RB_CORNER 
)
inline

◆ SyncDrawItems()

Member Data Documentation

◆ m_drawItems

◆ m_End

◆ m_IncrementLabel

◆ m_IncrementVector

◆ m_Info

◆ m_LineWidth

◆ m_Name

◆ m_pageOption

PAGE_OPTION DS_DATA_ITEM::m_pageOption
protected

Definition at line 209 of file ds_data_item.h.

Referenced by DS_DATA_ITEM(), GetPage1Option(), and SetPage1Option().

◆ m_Pos

◆ m_RepeatCount

◆ m_type

DS_ITEM_TYPE DS_DATA_ITEM::m_type
protected

Definition at line 208 of file ds_data_item.h.

Referenced by DS_DATA_ITEM(), GetType(), and SyncDrawItems().


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