KiCad PCB EDA Suite
SCH_SHEET Class Reference

Sheet symbol placed in a schematic, and is the entry point for a sub schematic. More...

#include <sch_sheet.h>

Inheritance diagram for SCH_SHEET:
SCH_ITEM EDA_ITEM KIGFX::VIEW_ITEM

Public Member Functions

 SCH_SHEET (const wxPoint &pos=wxPoint(0, 0))
 
 SCH_SHEET (const SCH_SHEET &aSheet)
 Copy aSheet into a new object. More...
 
 ~SCH_SHEET ()
 
wxString GetClass () const override
 Function GetClass returns the class name. More...
 
bool IsMovableFromAnchorPoint () override
 Return true for items which are moved with the anchor point at mouse cursor and false for items moved with no reference to anchor. More...
 
wxString GetName () const
 
void SetName (const wxString &aName)
 
int GetSheetNameSize () const
 
void SetSheetNameSize (int aSize)
 
int GetFileNameSize () const
 
void SetFileNameSize (int aSize)
 
SCH_SCREENGetScreen ()
 
wxSize GetSize ()
 
void SetSize (const wxSize &aSize)
 
SCH_SHEETGetRootSheet ()
 Return the root sheet of this SCH_SHEET object. More...
 
void SetScreen (SCH_SCREEN *aScreen)
 Set the SCH_SCREEN associated with this sheet to aScreen. More...
 
int GetScreenCount () const
 Return the number of times the associated screen for the sheet is being used. More...
 
void GetMsgPanelInfo (EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList) override
 Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for display purposes. More...
 
bool IsVerticalOrientation () const
 
void AddPin (SCH_SHEET_PIN *aSheetPin)
 Add aSheetPin to the sheet. More...
 
SCH_SHEET_PINSGetPins ()
 
SCH_SHEET_PINSGetPins () const
 
void RemovePin (SCH_SHEET_PIN *aSheetPin)
 Remove aSheetPin from the sheet. More...
 
void CleanupSheet ()
 Delete sheet label which do not have a corresponding hierarchical label. More...
 
SCH_SHEET_PINGetPin (const wxPoint &aPosition)
 Return the sheet pin item found at aPosition in the sheet. More...
 
bool HasPin (const wxString &aName)
 Checks if the sheet already has a sheet pin named aName. More...
 
bool HasPins ()
 
bool HasUndefinedPins ()
 Check all sheet labels against schematic for undefined hierarchical labels. More...
 
int GetMinWidth () const
 Return the minimum width of the sheet based on the widths of the sheet pin text. More...
 
int GetMinHeight () const
 Return the minimum height that the sheet can be resized based on the sheet pin positions. More...
 
int GetPenSize () const override
 Function GetPenSize virtual pure. More...
 
void Draw (EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aOffset, GR_DRAWMODE aDrawMode, COLOR4D aColor=COLOR4D::UNSPECIFIED) override
 Function Draw Draw a schematic item. More...
 
EDA_RECT const GetBoundingBox () const override
 Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes. More...
 
wxPoint GetResizePosition () const
 Return the position of the lower right corner of the sheet in drawing units. More...
 
void SwapData (SCH_ITEM *aItem) override
 Function SwapData swap the internal data structures aItem with the schematic item. More...
 
int ComponentCount ()
 Count our own components, without the power components. More...
 
bool SearchHierarchy (const wxString &aFilename, SCH_SCREEN **aScreen)
 Search the existing hierarchy for an instance of screen loaded from aFileName. More...
 
bool LocatePathOfScreen (SCH_SCREEN *aScreen, SCH_SHEET_PATH *aList)
 Search the existing hierarchy for an instance of screen loaded from aFileName. More...
 
int CountSheets ()
 Count the number of sheets found in "this" sheet includeing all of the subsheets. More...
 
wxString GetFileName (void) const
 Return the filename corresponding to this sheet. More...
 
void SetFileName (const wxString &aFilename)
 
bool ChangeFileName (SCH_EDIT_FRAME *aFrame, const wxString &aFileName)
 
void Move (const wxPoint &aMoveVector) override
 Function Move moves the item by aMoveVector to a new position. More...
 
void MirrorY (int aYaxis_position) override
 Function MirrorY mirrors item relative to the Y axis about aYaxis_position. More...
 
void MirrorX (int aXaxis_position) override
 Function MirrorX mirrors item relative to the X axis about aXaxis_position. More...
 
void Rotate (wxPoint aPosition) override
 Function Rotate rotates the item around aPosition 90 degrees in the clockwise direction. More...
 
bool Matches (wxFindReplaceData &aSearchData, void *aAuxData, wxPoint *aFindLocation) override
 Function Matches compares the item against the search criteria in aSearchData. More...
 
bool Replace (wxFindReplaceData &aSearchData, void *aAuxData=NULL) override
 Function Replace performs a text replace using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
bool IsReplaceable () const override
 Function IsReplaceable. More...
 
void Resize (const wxSize &aSize)
 Resize this sheet to aSize and adjust all of the labels accordingly. More...
 
wxPoint GetSheetNamePosition ()
 
wxPoint GetFileNamePosition ()
 
void GetEndPoints (std::vector< DANGLING_END_ITEM > &aItemList) override
 Function GetEndPoints adds the schematic item end points to aItemList if the item has end points. More...
 
bool UpdateDanglingState (std::vector< DANGLING_END_ITEM > &aItemList) override
 Function IsDanglingStateChanged tests the schematic item to aItemList to check if it's dangling state has changed. More...
 
bool IsSelectStateChanged (const wxRect &aRect) override
 Function IsSelectStateChanged checks if the selection state of an item inside aRect has changed. More...
 
bool IsConnectable () const override
 Function IsConnectable returns true if the schematic item can connect to another schematic item. More...
 
bool CanConnect (const SCH_ITEM *aItem) const override
 
void GetConnectionPoints (std::vector< wxPoint > &aPoints) const override
 Function GetConnectionPoints add all the connection points for this item to aPoints. More...
 
SEARCH_RESULT Visit (INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
 Function Visit may be re-implemented for each derived class in order to handle all the types given by its member data. More...
 
wxString GetSelectMenuText (EDA_UNITS_T aUnits) const override
 Function GetSelectMenuText returns the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position. More...
 
BITMAP_DEF GetMenuImage () const override
 Function GetMenuImage returns a pointer to an image to be used in menus. More...
 
void GetNetListItem (NETLIST_OBJECT_LIST &aNetListItems, SCH_SHEET_PATH *aSheetPath) override
 Function GetNetListItem creates a new NETLIST_OBJECT for the schematic object and adds it to aNetListItems. More...
 
SCH_ITEMoperator= (const SCH_ITEM &aSheet)
 
void ViewGetLayers (int aLayers[], int &aCount) const override
 Function ViewGetLayers returns the layers the item is drawn on (which may be more than its "home" layer) More...
 
wxPoint GetPosition () const override
 Function GetPosition. More...
 
void SetPosition (const wxPoint &aPosition) override
 Function SetPosition set the schematic item position to aPosition. More...
 
bool HitTest (const wxPoint &aPosition, int aAccuracy) const override
 Function HitTest tests if aPosition is contained within or on the bounding box of an item. More...
 
bool HitTest (const EDA_RECT &aRect, bool aContained=false, int aAccuracy=0) const override
 Function HitTest tests if aRect intersects or is contained within the bounding box of an item. More...
 
void Plot (PLOTTER *aPlotter) override
 Function Plot plots the schematic item to aPlotter. More...
 
EDA_ITEMClone () const override
 Function Clone creates a duplicate of this item with linked list members set to NULL. More...
 
SCH_ITEMNext () const
 
SCH_ITEMBack () const
 
wxPoint & GetStoredPos ()
 
void SetStoredPos (wxPoint aPos)
 
SCH_LAYER_ID GetLayer () const
 Function GetLayer returns the layer this item is on. More...
 
void SetLayer (SCH_LAYER_ID aLayer)
 Function SetLayer sets the layer this item is on. More...
 
virtual bool Load (LINE_READER &aLine, wxString &aErrorMsg)
 Function Load reads a schematic item from aLine in a .sch file. More...
 
virtual bool IsDangling () const
 
void ClearConnections ()
 Function ClearConnections clears all of the connection items from the list. More...
 
bool IsConnected (const wxPoint &aPoint) const
 Function IsConnected tests the item to see if it is connected to aPoint. More...
 
virtual bool HitTest (const wxPoint &aPosition) const override
 Function HitTest tests if aPosition is contained within or on the bounding area of an item. More...
 
virtual bool CanIncrementLabel () const
 
virtual bool operator< (const SCH_ITEM &aItem) const
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
KICAD_T Type () const
 Function Type() More...
 
void SetTimeStamp (timestamp_t aNewTimeStamp)
 
timestamp_t GetTimeStamp () const
 
EDA_ITEMGetParent () const
 
DHEADGetList () const
 
void SetNext (EDA_ITEM *aNext)
 
void SetBack (EDA_ITEM *aBack)
 
void SetParent (EDA_ITEM *aParent)
 
void SetList (DHEAD *aList)
 
bool IsNew () const
 
bool IsModified () const
 
bool IsMoving () const
 
bool IsDragging () const
 
bool IsWireImage () const
 
bool IsSelected () const
 
bool IsResized () const
 
bool IsHighlighted () const
 
bool IsBrightened () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetHighlighted ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearHighlighted ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (int type) const
 
void SetState (int type, int state)
 
STATUS_FLAGS GetStatus () const
 
void SetStatus (STATUS_FLAGS aStatus)
 
void SetFlags (STATUS_FLAGS aMask)
 
void ClearFlags (STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
STATUS_FLAGS GetFlags () const
 
bool IsType (const KICAD_T aScanTypes[])
 Function IsType Checks whether the item is one of the listed types. More...
 
void SetForceVisible (bool aEnable)
 Function SetForceVisible is used to set and cleag force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible. More...
 
bool Replace (wxFindReplaceData &aSearchData, wxString &aText)
 Helper function used in search and replace dialog Function Replace performs a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual const BOX2I ViewBBox () const override
 Function ViewBBox() returns the bounding box of the item covering all its layers. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Function ViewDraw() Draws the parts of the object belonging to layer aLayer. More...
 
virtual unsigned int ViewGetLOD (int aLayer, VIEW *aView) const
 Function ViewGetLOD() Returns the level of detail (LOD) of the item. More...
 
VIEW_ITEM_DATA * viewPrivData () const
 

Static Public Member Functions

static SEARCH_RESULT IterateForward (EDA_ITEM *listStart, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 Function IterateForward walks through the object tree calling the inspector() on each object type requested in scanTypes. More...
 
static bool Sort (const EDA_ITEM *aLeft, const EDA_ITEM *aRight)
 Function Sort is a helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers. More...
 

Protected Member Functions

void renumberPins ()
 Renumber the sheet pins in the sheet. More...
 
bool Matches (const wxString &aText, wxFindReplaceData &aSearchData)
 Function Matches compares aText against search criteria in aSearchData. More...
 

Protected Attributes

SCH_LAYER_ID m_Layer
 
EDA_ITEMS m_connections
 List of items connected to this item. More...
 
wxPoint m_storedPos
 a temporary variable used in some move commands

to store a initial pos (of the item or mouse cursor)

More...
 
EDA_ITEMPnext
 next in linked list More...
 
EDA_ITEMPback
 previous in linked list More...
 
DHEADm_List
 which DLIST I am on. More...
 
EDA_ITEMm_Parent
 Linked list: Link (parent struct) More...
 
timestamp_t m_TimeStamp
 Time stamp used for logical links. More...
 
bool m_forceVisible
 Set to true to override the visibility setting of the item. More...
 
STATUS_FLAGS m_Flags
 Flag bits for editing and other uses. More...
 

Private Attributes

SCH_SCREENm_screen
 Screen that contains the physical data for the sheet. More...
 
SCH_SHEET_PINS m_pins
 The list of sheet connection points. More...
 
wxString m_fileName
 The file name is also in the SCH_SCREEN object associated with the sheet. More...
 
wxString m_name
 This is equivalent to the reference designator for components and is stored in F0 sheet pin in the schematic file. More...
 
int m_sheetNameSize
 The height of the text used to draw the sheet name. More...
 
int m_fileNameSize
 The height of the text used to draw the file name. More...
 
wxPoint m_pos
 The position of the sheet. More...
 
wxSize m_size
 The size of the sheet. More...
 

Friends

class SCH_SHEET_PIN
 

Detailed Description

Sheet symbol placed in a schematic, and is the entry point for a sub schematic.

Definition at line 209 of file sch_sheet.h.

Constructor & Destructor Documentation

SCH_SHEET::SCH_SHEET ( const wxPoint &  pos = wxPoint( 0, 0 ))

Definition at line 47 of file sch_sheet.cpp.

References GetDefaultTextSize(), GetNewTimeStamp(), LAYER_SHEET, m_fileName, m_fileNameSize, SCH_ITEM::m_Layer, m_name, m_pos, m_screen, m_sheetNameSize, m_size, EDA_ITEM::m_TimeStamp, MIN_SHEET_HEIGHT, MIN_SHEET_WIDTH, and EDA_ITEM::SetTimeStamp().

Referenced by Clone().

47  :
48  SCH_ITEM( NULL, SCH_SHEET_T )
49 {
51  m_pos = pos;
56  m_screen = NULL;
57  m_name.Printf( wxT( "Sheet%8.8lX" ), (long) m_TimeStamp );
58  m_fileName.Printf( wxT( "file%8.8lX.sch" ), (long) m_TimeStamp );
59 }
SCH_LAYER_ID m_Layer
timestamp_t m_TimeStamp
Time stamp used for logical links.
Definition: base_struct.h:172
int m_sheetNameSize
The height of the text used to draw the sheet name.
Definition: sch_sheet.h:229
wxSize m_size
The size of the sheet.
Definition: sch_sheet.h:238
wxString m_name
This is equivalent to the reference designator for components and is stored in F0 sheet pin in the sc...
Definition: sch_sheet.h:226
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
#define MIN_SHEET_WIDTH
Definition: sch_sheet.h:47
wxString m_fileName
The file name is also in the SCH_SCREEN object associated with the sheet.
Definition: sch_sheet.h:222
timestamp_t GetNewTimeStamp()
Definition: common.cpp:212
int m_fileNameSize
The height of the text used to draw the file name.
Definition: sch_sheet.h:232
SCH_SCREEN * m_screen
Screen that contains the physical data for the sheet.
Definition: sch_sheet.h:215
#define MIN_SHEET_HEIGHT
Definition: sch_sheet.h:48
int GetDefaultTextSize()
Default size for text in general.
void SetTimeStamp(timestamp_t aNewTimeStamp)
Definition: base_struct.h:206
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType)
SCH_SHEET::SCH_SHEET ( const SCH_SHEET aSheet)

Copy aSheet into a new object.

All sheet pins are copied as is except and the SCH_SHEET_PIN's m_Parent pointers are set to the new copied parent object.

Definition at line 62 of file sch_sheet.cpp.

References i, SCH_SCREEN::IncRefCount(), m_fileName, m_fileNameSize, SCH_ITEM::m_Layer, m_name, m_pins, m_pos, m_screen, m_sheetNameSize, m_size, EDA_ITEM::m_TimeStamp, EDA_ITEM::SetParent(), and EDA_ITEM::SetTimeStamp().

62  :
63  SCH_ITEM( aSheet )
64 {
65  m_pos = aSheet.m_pos;
66  m_size = aSheet.m_size;
67  m_Layer = aSheet.m_Layer;
68  SetTimeStamp( aSheet.m_TimeStamp );
71  m_screen = aSheet.m_screen;
72  m_name = aSheet.m_name;
73  m_fileName = aSheet.m_fileName;
74  m_pins = aSheet.m_pins;
75 
76  for( size_t i = 0; i < m_pins.size(); i++ )
77  m_pins[i].SetParent( this );
78 
79  if( m_screen )
81 }
SCH_LAYER_ID m_Layer
timestamp_t m_TimeStamp
Time stamp used for logical links.
Definition: base_struct.h:172
int m_sheetNameSize
The height of the text used to draw the sheet name.
Definition: sch_sheet.h:229
wxSize m_size
The size of the sheet.
Definition: sch_sheet.h:238
wxString m_name
This is equivalent to the reference designator for components and is stored in F0 sheet pin in the sc...
Definition: sch_sheet.h:226
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
wxString m_fileName
The file name is also in the SCH_SCREEN object associated with the sheet.
Definition: sch_sheet.h:222
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:216
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
int m_fileNameSize
The height of the text used to draw the file name.
Definition: sch_sheet.h:232
size_t i
Definition: json11.cpp:597
SCH_SCREEN * m_screen
Screen that contains the physical data for the sheet.
Definition: sch_sheet.h:215
void IncRefCount()
Definition: sch_screen.cpp:131
void SetTimeStamp(timestamp_t aNewTimeStamp)
Definition: base_struct.h:206
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType)
SCH_SHEET::~SCH_SHEET ( )

Definition at line 84 of file sch_sheet.cpp.

References SCH_SCREEN::DecRefCount(), SCH_SCREEN::GetRefCount(), and m_screen.

85 {
86  // also, look at the associated sheet & its reference count
87  // perhaps it should be deleted also.
88  if( m_screen )
89  {
91 
92  if( m_screen->GetRefCount() == 0 )
93  delete m_screen;
94  }
95 }
int GetRefCount() const
Definition: sch_screen.h:144
void DecRefCount()
Definition: sch_screen.cpp:137
SCH_SCREEN * m_screen
Screen that contains the physical data for the sheet.
Definition: sch_sheet.h:215

Member Function Documentation

void SCH_SHEET::AddPin ( SCH_SHEET_PIN aSheetPin)

Add aSheetPin to the sheet.

Note: Once a sheet pin is added to the sheet, it is owned by the sheet. Do not delete the sheet pin object or you will likely get a segfault when the sheet is destroyed.

Parameters
aSheetPinThe sheet pin item to add to the sheet.

Definition at line 177 of file sch_sheet.cpp.

References m_pins, renumberPins(), SCH_SHEET_PIN_T, and EDA_ITEM::Type().

Referenced by SCH_EDIT_FRAME::addCurrentItemToScreen().

178 {
179  wxASSERT( aSheetPin != NULL );
180  wxASSERT( aSheetPin->Type() == SCH_SHEET_PIN_T );
181 
182  m_pins.push_back( aSheetPin );
183  renumberPins();
184 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
void renumberPins()
Renumber the sheet pins in the sheet.
Definition: sch_sheet.cpp:784
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
SCH_ITEM* SCH_ITEM::Back ( ) const
inlineinherited

Definition at line 144 of file sch_item_struct.h.

Referenced by DrawSegment(), SCH_SHEET_PATH::FindPreviousItem(), and SCH_SHEET_LIST::FindPreviousItem().

144 { return static_cast<SCH_ITEM*>( Pback ); }
EDA_ITEM * Pback
previous in linked list
Definition: base_struct.h:168
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
bool SCH_SHEET::CanConnect ( const SCH_ITEM aItem) const
inlineoverridevirtual

Reimplemented from SCH_ITEM.

Definition at line 525 of file sch_sheet.h.

References SCH_TEXT::GetConnectionPoints(), SCH_ITEM::GetLayer(), SCH_SHEET_PIN::GetMenuImage(), SCH_TEXT::GetNetListItem(), SCH_SHEET_PIN::GetSelectMenuText(), LAYER_BUS, LAYER_WIRE, EDA_ITEM::operator=(), SCH_LINE_T, SCH_NO_CONNECT_T, EDA_ITEM::Type(), SCH_ITEM::ViewGetLayers(), and EDA_ITEM::Visit().

526  {
527  return ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_WIRE ) ||
528  ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_BUS ) ||
529  ( aItem->Type() == SCH_NO_CONNECT_T );
530  }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
SCH_LAYER_ID GetLayer() const
Function GetLayer returns the layer this item is on.
virtual bool SCH_ITEM::CanIncrementLabel ( ) const
inlinevirtualinherited

Reimplemented in SCH_TEXT.

Definition at line 344 of file sch_item_struct.h.

Referenced by SCH_EDIT_FRAME::RepeatDrawItem().

344 { return false; }
bool SCH_SHEET::ChangeFileName ( SCH_EDIT_FRAME aFrame,
const wxString &  aFileName 
)
void SCH_SHEET::CleanupSheet ( )

Delete sheet label which do not have a corresponding hierarchical label.

Note: Make sure you save a copy of the sheet in the undo list before calling CleanupSheet() otherwise any unreferenced sheet labels will be lost.

Definition at line 340 of file sch_sheet.cpp.

References SCH_SCREEN::GetDrawItems(), EDA_TEXT::GetText(), i, m_pins, m_screen, EDA_ITEM::Next(), SCH_HIERARCHICAL_LABEL_T, and EDA_ITEM::Type().

Referenced by SCH_EDIT_FRAME::Process_Special_Functions().

341 {
342  SCH_SHEET_PINS::iterator i = m_pins.begin();
343 
344  while( i != m_pins.end() )
345  {
346  /* Search the schematic for a hierarchical label corresponding to this sheet label. */
347  EDA_ITEM* DrawStruct = m_screen->GetDrawItems();
348  const SCH_HIERLABEL* HLabel = NULL;
349 
350  for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Next() )
351  {
352  if( DrawStruct->Type() != SCH_HIERARCHICAL_LABEL_T )
353  continue;
354 
355  HLabel = static_cast<SCH_HIERLABEL*>( DrawStruct );
356 
357  if( i->GetText().CmpNoCase( HLabel->GetText() ) == 0 )
358  break; // Found!
359 
360  HLabel = NULL;
361  }
362 
363  if( HLabel == NULL ) // Hlabel not found: delete sheet label.
364  i = m_pins.erase( i );
365  else
366  ++i;
367  }
368 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
EDA_ITEM * Next() const
Definition: base_struct.h:209
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:143
SCH_ITEM * GetDrawItems() const
Definition: sch_screen.h:160
size_t i
Definition: json11.cpp:597
SCH_SCREEN * m_screen
Screen that contains the physical data for the sheet.
Definition: sch_sheet.h:215
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
void EDA_ITEM::ClearBrightened ( )
inlineinherited

Definition at line 236 of file base_struct.h.

References BRIGHTENED, EDA_ITEM::ClearFlags(), and EDA_ITEM::SetModified().

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), and SELECTION_TOOL::unhighlight().

236 { ClearFlags( BRIGHTENED ); }
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:138
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:257
void SCH_ITEM::ClearConnections ( )
inlineinherited

Function ClearConnections clears all of the connection items from the list.

The vector release method is used to prevent the item pointers from being deleted. Do not use the vector erase method on the connection list.

Definition at line 304 of file sch_item_struct.h.

304 { m_connections.clear(); }
EDA_ITEMS m_connections
List of items connected to this item.
void EDA_ITEM::ClearFlags ( STATUS_FLAGS  aMask = EDA_ITEM_ALL_FLAGS)
inlineinherited

Definition at line 257 of file base_struct.h.

Referenced by Abort_Edit_Pcb_Text(), Abort_EditEdge(), Abort_Move_ModuleOutline(), Abort_Move_Pad(), Abort_MoveOrCopyModule(), Abort_MoveTrack(), Abort_Zone_Create_Outline(), Abort_Zone_Move_Corner_Or_Outlines(), AbortMoveAndEditTarget(), AbortMoveDimensionText(), abortMoveItem(), AbortMoveTextModule(), AbortPinMove(), SCH_SCREEN::addConnectedItemsToBlock(), SCH_EDIT_FRAME::addCurrentItemToScreen(), PNS_KICAD_IFACE::AddItem(), PCB_EDIT_FRAME::AppendBoardFile(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Zone(), SCH_EDIT_FRAME::BeginSegment(), PCB_EDIT_FRAME::Block_Delete(), PCB_EDIT_FRAME::Block_Flip(), PCB_EDIT_FRAME::Block_Move(), LIB_EDIT_FRAME::BlockCopySelectedItems(), PCB_EDIT_FRAME::Change_Side_Module(), SCH_COMPONENT::ClearAllHighlightFlags(), SCH_SCREEN::ClearAnnotation(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearHighlighted(), DRAG_LIST::ClearList(), ClearMarkItems(), clearModuleItemFlags(), EDA_ITEM::ClearSelected(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::copyBlockItems(), CopyMarkedItems(), MWAVE::CreateMicrowaveInductor(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), PCB_EDIT_FRAME::Delete_LastCreatedCorner(), PCB_EDIT_FRAME::Delete_Segment_Edge(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), PCB_EDIT_FRAME::EditDimension(), PCB_EDIT_FRAME::End_Edge(), FOOTPRINT_EDIT_FRAME::End_Edge_Module(), PCB_EDIT_FRAME::End_Move_Zone_Corner_Or_Outlines(), PCB_EDIT_FRAME::End_Route(), PCB_EDIT_FRAME::End_Zone(), EraseDragList(), PCB_EDIT_FRAME::Exchange_Module(), ExitSheet(), SCH_SCREEN::GetConnection(), KIGFX::SCH_VIEW::HighlightItem(), PCB_BASE_FRAME::Import_Pad_Settings(), SCH_JUNCTION::IsSelectStateChanged(), SCH_NO_CONNECT::IsSelectStateChanged(), SCH_MARKER::IsSelectStateChanged(), SCH_BUS_ENTRY_BASE::IsSelectStateChanged(), SCH_BITMAP::IsSelectStateChanged(), SCH_LINE::IsSelectStateChanged(), SCH_TEXT::IsSelectStateChanged(), IsSelectStateChanged(), SCH_COMPONENT::IsSelectStateChanged(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), FOOTPRINT_EDIT_FRAME::LoadModuleFromLibrary(), MarkItemsInBloc(), MirrorX(), MirrorY(), LIB_EDIT_FRAME::OnEditPin(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnOrient(), LIB_EDIT_FRAME::OnRotate(), SCH_EDIT_FRAME::OnSelectUnit(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), SCH_FIELD::Place(), PCB_EDIT_FRAME::Place_DrawItem(), FOOTPRINT_EDIT_FRAME::Place_EdgeMod(), PCB_EDIT_FRAME::Place_Texte_Pcb(), PCB_EDIT_FRAME::PlaceDimensionText(), PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment(), PCB_BASE_FRAME::PlaceModule(), PCB_BASE_FRAME::PlacePad(), PCB_EDIT_FRAME::PlaceTarget(), DRAWING_TOOL::PlaceText(), PCB_BASE_FRAME::PlaceTexteModule(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), LIB_EDIT_FRAME::Process_Special_Functions(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), BOARD_COMMIT::Revert(), PCB_BASE_FRAME::Rotate_Module(), RotateListOfItems(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_EDIT_FRAME::SetRepeatItem(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

257 { m_Flags &= ~aMask; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
void EDA_ITEM::ClearHighlighted ( )
inlineinherited

Definition at line 235 of file base_struct.h.

References EDA_ITEM::ClearFlags(), and HIGHLIGHTED.

235 { ClearFlags( HIGHLIGHTED ); }
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:137
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:257
void EDA_ITEM::ClearSelected ( )
inlineinherited

Definition at line 234 of file base_struct.h.

References EDA_ITEM::ClearFlags(), and SELECTED.

Referenced by POINT_EDITOR::addCorner(), EDIT_TOOL::Duplicate(), GAL_ARRAY_CREATOR::prePushAction(), SELECTION_TOOL::unhighlight(), and GERBVIEW_SELECTION_TOOL::unselectVisually().

234 { ClearFlags( SELECTED ); }
#define SELECTED
Definition: base_struct.h:121
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:257
EDA_ITEM * SCH_SHEET::Clone ( ) const
overridevirtual

Function Clone creates a duplicate of this item with linked list members set to NULL.

The default version will return NULL in release builds and likely crash the program. In debug builds, a warning message indicating the derived class has not implemented cloning. This really should be a pure virtual function. Due to the fact that there are so many objects derived from EDA_ITEM, the decision was made to return NULL until all the objects derived from EDA_ITEM implement cloning. Once that happens, this function should be made pure.

Returns
A clone of the item.

Reimplemented from EDA_ITEM.

Definition at line 98 of file sch_sheet.cpp.

References SCH_SHEET().

Referenced by resizeSheetWithMouseCursor().

99 {
100  return new SCH_SHEET( *this );
101 }
SCH_SHEET(const wxPoint &pos=wxPoint(0, 0))
Definition: sch_sheet.cpp:47
int SCH_SHEET::ComponentCount ( )

Count our own components, without the power components.

Returns
the component count.

Definition at line 549 of file sch_sheet.cpp.

References ComponentCount(), SCH_SCREEN::GetDrawItems(), SCH_COMPONENT::GetField(), EDA_TEXT::GetText(), m_screen, EDA_ITEM::Next(), SCH_COMPONENT_T, SCH_SHEET_T, EDA_ITEM::Type(), and VALUE.

Referenced by ComponentCount().

550 {
551  int n = 0;
552 
553  if( m_screen )
554  {
555  EDA_ITEM* bs;
556 
557  for( bs = m_screen->GetDrawItems(); bs != NULL; bs = bs->Next() )
558  {
559  if( bs->Type() == SCH_COMPONENT_T )
560  {
561  SCH_COMPONENT* Cmp = (SCH_COMPONENT*) bs;
562 
563  if( Cmp->GetField( VALUE )->GetText().GetChar( 0 ) != '#' )
564  n++;
565  }
566 
567  if( bs->Type() == SCH_SHEET_T )
568  {
569  SCH_SHEET* sheet = (SCH_SHEET*) bs;
570  n += sheet->ComponentCount();
571  }
572  }
573  }
574 
575  return n;
576 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
int ComponentCount()
Count our own components, without the power components.
Definition: sch_sheet.cpp:549
EDA_ITEM * Next() const
Definition: base_struct.h:209
#define VALUE
SCH_FIELD * GetField(int aFieldNdx) const
Returns a field in this symbol.
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:143
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
SCH_ITEM * GetDrawItems() const
Definition: sch_screen.h:160
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:70
SCH_SCREEN * m_screen
Screen that contains the physical data for the sheet.
Definition: sch_sheet.h:215
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
int SCH_SHEET::CountSheets ( )

Count the number of sheets found in "this" sheet includeing all of the subsheets.

Returns
the full count of sheets+subsheets contained by "this"

Definition at line 641 of file sch_sheet.cpp.

References CountSheets(), SCH_SCREEN::GetDrawItems(), m_screen, EDA_ITEM::Next(), SCH_SHEET_T, and EDA_ITEM::Type().

Referenced by CountSheets(), SCH_PRINTOUT::GetPageInfo(), SCH_PRINTOUT::HasPage(), SCH_EDIT_FRAME::OnFindReplace(), SCH_EDIT_FRAME::OnFindSchematicItem(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), and DIALOG_PRINT_USING_PRINTER::TransferDataFromWindow().

642 {
643  int count = 1; //1 = this!!
644 
645  if( m_screen )
646  {
647  EDA_ITEM* strct = m_screen->GetDrawItems();
648 
649  for( ; strct; strct = strct->Next() )
650  {
651  if( strct->Type() == SCH_SHEET_T )
652  {
653  SCH_SHEET* subsheet = (SCH_SHEET*) strct;
654  count += subsheet->CountSheets();
655  }
656  }
657  }
658  return count;
659 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
int CountSheets()
Count the number of sheets found in "this" sheet includeing all of the subsheets. ...
Definition: sch_sheet.cpp:641
EDA_ITEM * Next() const
Definition: base_struct.h:209
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
SCH_ITEM * GetDrawItems() const
Definition: sch_screen.h:160
SCH_SCREEN * m_screen
Screen that contains the physical data for the sheet.
Definition: sch_sheet.h:215
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
void SCH_SHEET::Draw ( EDA_DRAW_PANEL aPanel,
wxDC *  aDC,
const wxPoint &  aOffset,
GR_DRAWMODE  aDrawMode,
COLOR4D  aColor = COLOR4D::UNSPECIFIED 
)
overridevirtual

Function Draw Draw a schematic item.

Each schematic item should have its own method

Parameters
aPanelDrawPanel to use (can be null) mainly used for clipping purposes.
aDCDevice Context (can be null)
aOffsetdrawing Offset (usually wxPoint(0,0), but can be different when moving an object)
aDrawModeGR_OR, GR_XOR, ...
aColorCOLOR4D::UNSPECIFIED to use the normal body item color, or force this color if it is a valid color

Implements SCH_ITEM.

Definition at line 436 of file sch_sheet.cpp.

References boundingBox(), BROWN, Clamp_Text_PenSize(), color, DrawGraphicText(), GetBoundingBox(), EDA_DRAW_PANEL::GetClipBox(), GetFileNamePosition(), GetLayerColor(), GetPenSize(), GetSheetNamePosition(), GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_TOP, GRFilledCircle(), GRRect(), GRSetDrawMode(), IsVerticalOrientation(), LAYER_SHEETFILENAME, LAYER_SHEETNAME, m_fileName, m_fileNameSize, SCH_ITEM::m_Layer, m_name, m_pins, m_pos, m_sheetNameSize, m_size, TEXT_ANGLE_HORIZ, and TEXT_ANGLE_VERT.

438 {
439  COLOR4D txtcolor;
440  wxString Text;
441  COLOR4D color;
442  int name_orientation;
443  wxPoint pos_sheetname,pos_filename;
444  wxPoint pos = m_pos + aOffset;
445  int lineWidth = GetPenSize();
446  int textWidth;
447  wxSize textSize;
448  EDA_RECT* clipbox = aPanel? aPanel->GetClipBox() : NULL;
449 
450  if( aColor != COLOR4D::UNSPECIFIED )
451  color = aColor;
452  else
453  color = GetLayerColor( m_Layer );
454 
455  GRSetDrawMode( aDC, aDrawMode );
456 
457  GRRect( clipbox, aDC, pos.x, pos.y,
458  pos.x + m_size.x, pos.y + m_size.y, lineWidth, color );
459 
460  pos_sheetname = GetSheetNamePosition() + aOffset;
461  pos_filename = GetFileNamePosition() + aOffset;
462 
463  if( IsVerticalOrientation() )
464  name_orientation = TEXT_ANGLE_VERT;
465  else
466  name_orientation = TEXT_ANGLE_HORIZ;
467 
468  /* Draw text : SheetName */
469  if( aColor != COLOR4D::UNSPECIFIED )
470  txtcolor = aColor;
471  else
472  txtcolor = GetLayerColor( LAYER_SHEETNAME );
473 
474  Text = wxT( "Sheet: " ) + m_name;
475  textSize = wxSize( m_sheetNameSize, m_sheetNameSize );
476  textWidth = Clamp_Text_PenSize( lineWidth, textSize, false );
477  DrawGraphicText( clipbox, aDC, pos_sheetname,
478  txtcolor, Text, name_orientation,
479  textSize,
481  false, false );
482 
483  /* Draw text : FileName */
484  if( aColor != COLOR4D::UNSPECIFIED )
485  txtcolor = aColor;
486  else
487  txtcolor = GetLayerColor( LAYER_SHEETFILENAME );
488 
489  Text = wxT( "File: " ) + m_fileName;
490  textSize = wxSize( m_fileNameSize, m_fileNameSize );
491  textWidth = Clamp_Text_PenSize( lineWidth, textSize, false );
492  DrawGraphicText( clipbox, aDC, pos_filename,
493  txtcolor, Text, name_orientation,
494  textSize,
496  false, false );
497 
498  /* Draw text : SheetLabel */
499  for( SCH_SHEET_PIN& sheetPin : m_pins )
500  {
501  if( !sheetPin.IsMoving() )
502  sheetPin.Draw( aPanel, aDC, aOffset, aDrawMode, aColor );
503  }
504 
505 
506 #if 0
507  // Only for testing purposes, draw the component bounding box
509  GRRect( aPanel->GetClipBox(), aDC, boundingBox, 0, BROWN );
510  GRFilledCircle( aPanel->GetClipBox(), aDC, m_pos.x, m_pos.y, 10, 0, color, color );
511 #endif
512 }
#define TEXT_ANGLE_HORIZ
SCH_LAYER_ID m_Layer
int Clamp_Text_PenSize(int aPenSize, int aSize, bool aBold)
Function Clamp_Text_PenSize As a rule, pen width should not be >1/4em, otherwise the character will b...
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
Definition: gr_basic.cpp:223
#define TEXT_ANGLE_VERT
int color
Definition: DXF_plotter.cpp:62
int m_sheetNameSize
The height of the text used to draw the sheet name.
Definition: sch_sheet.h:229
wxSize m_size
The size of the sheet.
Definition: sch_sheet.h:238
wxString m_name
This is equivalent to the reference designator for components and is stored in F0 sheet pin in the sc...
Definition: sch_sheet.h:226
virtual EDA_RECT * GetClipBox()
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
Definition: eeschema.cpp:174
int GetPenSize() const override
Function GetPenSize virtual pure.
Definition: sch_sheet.cpp:383
void GRFilledCircle(EDA_RECT *ClipBox, wxDC *DC, int x, int y, int r, int width, COLOR4D Color, COLOR4D BgColor)
Definition: gr_basic.cpp:778
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
void DrawGraphicText(EDA_RECT *aClipBox, wxDC *aDC, const wxPoint &aPos, COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, void(*aCallback)(int x0, int y0, int xf, int yf, void *aData), void *aCallbackData, PLOTTER *aPlotter)
Function DrawGraphicText Draw a graphic text (like module texts)
wxString m_fileName
The file name is also in the SCH_SCREEN object associated with the sheet.
Definition: sch_sheet.h:222
BOX2I boundingBox(T aObject)
boundingBox template method
Definition: shape_index.h:59
void GRRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, COLOR4D aColor)
Definition: gr_basic.cpp:1003
EDA_RECT const GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
Definition: sch_sheet.cpp:515
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:61
wxPoint GetFileNamePosition()
Definition: sch_sheet.cpp:408
int m_fileNameSize
The height of the text used to draw the file name.
Definition: sch_sheet.h:232
wxPoint GetSheetNamePosition()
Definition: sch_sheet.cpp:389
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
bool IsVerticalOrientation() const
Definition: sch_sheet.cpp:221
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
Definition: colors.h:62
const EDA_RECT SCH_SHEET::GetBoundingBox ( ) const
overridevirtual

Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.

This box should be an enclosing perimeter for visible components of this object, and the units should be in the pcb or schematic coordinate system. It is OK to overestimate the size by a few counts.

Reimplemented from EDA_ITEM.

Definition at line 515 of file sch_sheet.cpp.

References GetPenSize(), EDA_RECT::GetY(), GraphicTextWidth(), EDA_RECT::Inflate(), KiROUND(), m_fileName, m_fileNameSize, m_name, m_pos, m_sheetNameSize, m_size, max, EDA_RECT::SetEnd(), and EDA_RECT::SetY().

Referenced by Draw(), HitTest(), IsSelectStateChanged(), SCH_EDIT_FRAME::MirrorSheet(), and SCH_EDIT_FRAME::RotateHierarchicalSheet().

516 {
517  wxPoint end;
518  EDA_RECT box( m_pos, m_size );
519  int lineWidth = GetPenSize();
520 
521  // Determine length of texts
522  wxString text = wxT( "Sheet: " ) + m_name;
523  int textlen = GraphicTextWidth( text, wxSize( m_sheetNameSize, m_sheetNameSize ),
524  false, false );
525 
526  text = wxT( "File: " ) + m_fileName;
527  int textlen2 = GraphicTextWidth( text, wxSize( m_fileNameSize, m_fileNameSize ),
528  false, false );
529 
530  // Calculate bounding box X size:
531  textlen = std::max( textlen, textlen2 );
532  end.x = std::max( m_size.x, textlen );
533 
534  // Calculate bounding box pos:
535  end.y = m_size.y;
536  end += m_pos;
537 
538  // Move upper and lower limits to include texts:
539  box.SetY( box.GetY() - ( KiROUND( m_sheetNameSize * 1.3 ) + 8 ) );
540  end.y += KiROUND( m_fileNameSize * 1.3 ) + 8;
541 
542  box.SetEnd( end );
543  box.Inflate( lineWidth / 2 );
544 
545  return box;
546 }
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:121
int m_sheetNameSize
The height of the text used to draw the sheet name.
Definition: sch_sheet.h:229
wxSize m_size
The size of the sheet.
Definition: sch_sheet.h:238
wxString m_name
This is equivalent to the reference designator for components and is stored in F0 sheet pin in the sc...
Definition: sch_sheet.h:226
int GetPenSize() const override
Function GetPenSize virtual pure.
Definition: sch_sheet.cpp:383
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
wxString m_fileName
The file name is also in the SCH_SCREEN object associated with the sheet.
Definition: sch_sheet.h:222
int GraphicTextWidth(const wxString &aText, const wxSize &aSize, bool aItalic, bool aBold)
Function GraphicTextWidth.
int m_fileNameSize
The height of the text used to draw the file name.
Definition: sch_sheet.h:232
#define max(a, b)
Definition: auxiliary.h:86
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
wxString SCH_SHEET::GetClass ( ) const
inlineoverridevirtual

Function GetClass returns the class name.

Returns
wxString

Reimplemented from SCH_ITEM.

Definition at line 251 of file sch_sheet.h.

Referenced by operator=(), and SCH_EDIT_FRAME::ReSizeSheet().

252  {
253  return wxT( "SCH_SHEET" );
254  }
void SCH_SHEET::GetConnectionPoints ( std::vector< wxPoint > &  aPoints) const
overridevirtual

Function GetConnectionPoints add all the connection points for this item to aPoints.

Not all schematic items have connection points so the default method does nothing.

Parameters
aPointsList of connection points to add to.

Reimplemented from SCH_ITEM.

Definition at line 836 of file sch_sheet.cpp.

References GetPins(), GetPosition(), and i.

837 {
838  for( size_t i = 0; i < GetPins().size(); i++ )
839  aPoints.push_back( GetPins()[i].GetPosition() );
840 }
SCH_SHEET_PINS & GetPins()
Definition: sch_sheet.h:334
wxPoint GetPosition() const override
Function GetPosition.
Definition: sch_sheet.h:547
size_t i
Definition: json11.cpp:597
void SCH_SHEET::GetEndPoints ( std::vector< DANGLING_END_ITEM > &  aItemList)
overridevirtual

Function GetEndPoints adds the schematic item end points to aItemList if the item has end points.

The default version doesn't do anything since many of the schematic object cannot be tested for dangling ends. If you add a new schematic item that can have a dangling end ( no connect ), override this method to provide the correct end points.

Parameters
aItemList- List of DANGLING_END_ITEMS to add to.

Reimplemented from SCH_ITEM.

Definition at line 796 of file sch_sheet.cpp.

References SCH_SHEET_PIN::GetEndPoints(), GetPins(), SCH_SHEET_PIN_T, and EDA_ITEM::Type().

797 {
798  for( unsigned ii = 0; ii < GetPins().size(); ii++ )
799  {
800  SCH_SHEET_PIN &pinsheet = GetPins()[ii];
801 
802  wxCHECK2_MSG( pinsheet.Type() == SCH_SHEET_PIN_T, continue,
803  wxT( "Invalid item in schematic sheet pin list. Bad programmer!" ) );
804 
805  pinsheet.GetEndPoints( aItemList );
806  }
807 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
SCH_SHEET_PINS & GetPins()
Definition: sch_sheet.h:334
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:61
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Function GetEndPoints adds the schematic item end points to aItemList if the item has end points...
wxString SCH_SHEET::GetFileName ( void  ) const
wxPoint SCH_SHEET::GetFileNamePosition ( )
Returns
the position of the anchor of filename text

Definition at line 408 of file sch_sheet.cpp.

References GetPenSize(), IsVerticalOrientation(), KiROUND(), m_fileNameSize, m_pos, and m_size.

Referenced by KIGFX::SCH_PAINTER::draw(), Draw(), and Matches().

409 {
410  wxPoint pos = m_pos;
411  int margin = KiROUND( GetPenSize() / 2.0 + 4 + m_fileNameSize * 0.4 );
412 
413  if( IsVerticalOrientation() )
414  {
415  pos.x += m_size.x + margin;
416  pos.y += m_size.y;
417  }
418  else
419  {
420  pos.y += m_size.y + margin;
421  }
422 
423  return pos;
424 }
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:121
wxSize m_size
The size of the sheet.
Definition: sch_sheet.h:238
int GetPenSize() const override
Function GetPenSize virtual pure.
Definition: sch_sheet.cpp:383
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
int m_fileNameSize
The height of the text used to draw the file name.
Definition: sch_sheet.h:232
bool IsVerticalOrientation() const
Definition: sch_sheet.cpp:221
int SCH_SHEET::GetFileNameSize ( ) const
inline

Definition at line 275 of file sch_sheet.h.

Referenced by KIGFX::SCH_PAINTER::draw(), SCH_LEGACY_PLUGIN::saveSheet(), and DIALOG_SCH_SHEET_PROPS::TransferDataToWindow().

275 { return m_fileNameSize; }
int m_fileNameSize
The height of the text used to draw the file name.
Definition: sch_sheet.h:232
STATUS_FLAGS EDA_ITEM::GetFlags ( ) const
inlineinherited

Definition at line 258 of file base_struct.h.

References EDA_ITEM::m_Flags.

Referenced by AbortMoveAndEditTarget(), SCH_SCREEN::addConnectedItemsToBlock(), AddMenusForBitmap(), AddMenusForBusEntry(), AddMenusForComponent(), AddMenusForComponentField(), AddMenusForEditComponent(), AddMenusForGLabel(), AddMenusForHierchicalSheet(), AddMenusForHLabel(), AddMenusForLabel(), AddMenusForSheetPin(), AddMenusForText(), SCH_EDIT_FRAME::BeginSegment(), SCH_EDIT_FRAME::ChangeTextOrient(), Collect_TrackSegmentsToDrag(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::copyBlockItems(), LIB_EDIT_FRAME::copySelectedItems(), LIB_EDIT_FRAME::CreatePin(), PCB_EDIT_FRAME::createPopUpMenuForFootprints(), PCB_EDIT_FRAME::createPopUpMenuForFpPads(), PCB_EDIT_FRAME::createPopUpMenuForFpTexts(), PCB_EDIT_FRAME::createPopUpMenuForTexts(), PCB_EDIT_FRAME::createPopupMenuForTracks(), PCB_EDIT_FRAME::createPopUpMenuForZones(), PCB_EDIT_FRAME::Delete_Segment_Edge(), SCH_EDIT_FRAME::DeleteItem(), SCH_EDIT_FRAME::DeleteItemsInList(), SCH_EDIT_FRAME::DeleteJunction(), PCB_BASE_FRAME::DeleteTextModule(), BOARD::Draw(), PCB_EDIT_FRAME::Edit_TrackSegm_Width(), SCH_EDIT_FRAME::EditComponentFieldText(), SCH_EDIT_FRAME::EditImage(), PCB_EDIT_FRAME::FlipTextePcb(), LIB_VIEW_FRAME::GeneralControl(), SCH_EDIT_FRAME::GeneralControl(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_SCREEN::GetConnection(), InitialiseDragParameters(), EDA_DRAW_FRAME::isBusy(), Magnetize(), SCH_EDIT_FRAME::MirrorImage(), SCH_EDIT_FRAME::MirrorSheet(), SCH_EDIT_FRAME::OnAutoplaceFields(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), SCH_EDIT_FRAME::OnDragItem(), SCH_EDIT_FRAME::OnEditItem(), LIB_EDIT_FRAME::OnEditPin(), FOOTPRINT_EDIT_FRAME::OnHotKey(), SCH_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyBeginRoute(), PCB_EDIT_FRAME::OnHotkeyCopyItem(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), PCB_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyFlipItem(), PCB_EDIT_FRAME::OnHotkeyMoveItem(), PCB_EDIT_FRAME::OnHotkeyPlaceItem(), PCB_EDIT_FRAME::OnHotkeyRotateItem(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), FOOTPRINT_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), EDA_DRAW_PANEL::OnMouseEvent(), SCH_EDIT_FRAME::OnMoveItem(), SCH_EDIT_FRAME::OnOpenLibraryEditor(), SCH_EDIT_FRAME::OnOrient(), FOOTPRINT_EDIT_FRAME::OnRightClick(), GERBVIEW_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRotate(), SCH_EDIT_FRAME::OnSelectUnit(), SCH_EDIT_FRAME::OrientComponent(), PCB_EDIT_FRAME::PlaceTarget(), FOOTPRINT_EDIT_FRAME::PrepareItemForHotkey(), LIB_EDIT_FRAME::Process_Special_Functions(), TRACKS_CLEANER::removeDuplicatesOfTrack(), PCB_BASE_FRAME::Rotate_Module(), PCB_EDIT_FRAME::Rotate_Texte_Pcb(), SCH_EDIT_FRAME::RotateField(), SCH_EDIT_FRAME::RotateHierarchicalSheet(), SCH_EDIT_FRAME::RotateImage(), PCB_BASE_FRAME::RotateTextModule(), LIB_EDIT_FRAME::SaveCopyInUndoList(), SCH_EDIT_FRAME::SaveCopyInUndoList(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_SCREEN::SelectBlockItems(), SCH_EDIT_FRAME::SetBusEntryShape(), Show_Drag_Track_Segment_With_Cte_Slope(), Show_MoveNode(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), and DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow().

258 { return m_Flags; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
DHEAD* EDA_ITEM::GetList ( ) const
inlineinherited
BITMAP_DEF SCH_SHEET::GetMenuImage ( ) const
overridevirtual

Function GetMenuImage returns a pointer to an image to be used in menus.

The default version returns the right arrow image. Override this function to provide object specific menu images.

Returns
The menu image associated with the item.

Reimplemented from EDA_ITEM.

Definition at line 876 of file sch_sheet.cpp.

877 {
878  return add_hierarchical_subsheet_xpm;
879 }
int SCH_SHEET::GetMinHeight ( ) const

Return the minimum height that the sheet can be resized based on the sheet pin positions.

The minimum width of a sheet is determined by the Y axis location of the bottom most sheet pin. If at some point in the future sheet objects can be rotated or pins can be placed in the vertical orientation, this function will need to be changed.

Returns
The minimum height the sheet can be resized.

Definition at line 301 of file sch_sheet.cpp.

References EDA_RECT::GetBottom(), EDA_RECT::GetHeight(), i, m_pins, m_pos, MIN_SHEET_HEIGHT, SCH_SHEET_PIN::SHEET_LEFT_SIDE, and SCH_SHEET_PIN::SHEET_RIGHT_SIDE.

Referenced by resizeSheetWithMouseCursor().

302 {
303  int height = MIN_SHEET_HEIGHT;
304 
305  for( size_t i = 0; i < m_pins.size(); i++ )
306  {
307  int edge = m_pins[i].GetEdge();
308  EDA_RECT pinRect = m_pins[i].GetBoundingBox();
309 
310  // Make sure pin is on top or bottom side of sheet.
312  {
313  if( height < pinRect.GetBottom() - m_pos.y )
314  height = pinRect.GetBottom() - m_pos.y;
315  }
316  else
317  {
318  if( height < pinRect.GetHeight() )
319  height = pinRect.GetHeight();
320 
321  for( size_t j = 0; j < m_pins.size(); j++ )
322  {
323  // Check for pin directly above or below the current pin.
324  if( (i == j) || (m_pins[i].GetPosition().x != m_pins[j].GetPosition().x) )
325  continue;
326 
327  if( height < pinRect.GetHeight() + m_pins[j].GetBoundingBox().GetHeight() )
328  {
329  height = pinRect.GetHeight() + m_pins[j].GetBoundingBox().GetHeight();
330  break;
331  }
332  }
333  }
334  }
335 
336  return height;
337 }
int GetHeight() const
Definition: eda_rect.h:118
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
int GetBottom() const
Definition: eda_rect.h:122
size_t i
Definition: json11.cpp:597
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
#define MIN_SHEET_HEIGHT
Definition: sch_sheet.h:48
int SCH_SHEET::GetMinWidth ( ) const

Return the minimum width of the sheet based on the widths of the sheet pin text.

The minimum sheet width is determined by the width of the bounding box of each hierarchical sheet pin. If two pins are horizontally adjacent ( same Y position ) to each other, the sum of the bounding box widths is used. If at some point in the future sheet objects can be rotated or pins can be placed in the vertical orientation, this function will need to be changed.

Returns
The minimum width the sheet can be resized.

Definition at line 261 of file sch_sheet.cpp.

References EDA_RECT::GetRight(), EDA_RECT::GetWidth(), i, m_pins, m_pos, MIN_SHEET_WIDTH, SCH_SHEET_PIN::SHEET_BOTTOM_SIDE, SCH_SHEET_PIN::SHEET_TOP_SIDE, and SCH_SHEET_PIN::SHEET_UNDEFINED_SIDE.

Referenced by resizeSheetWithMouseCursor().

262 {
263  int width = MIN_SHEET_WIDTH;
264 
265  for( size_t i = 0; i < m_pins.size(); i++ )
266  {
267  int edge = m_pins[i].GetEdge();
268  EDA_RECT pinRect = m_pins[i].GetBoundingBox();
269 
270  wxASSERT( edge != SCH_SHEET_PIN::SHEET_UNDEFINED_SIDE );
271 
273  {
274  if( width < pinRect.GetRight() - m_pos.x )
275  width = pinRect.GetRight() - m_pos.x;
276  }
277  else
278  {
279  if( width < pinRect.GetWidth() )
280  width = pinRect.GetWidth();
281 
282  for( size_t j = 0; j < m_pins.size(); j++ )
283  {
284  // Check for pin directly across from the current pin.
285  if( (i == j) || (m_pins[i].GetPosition().y != m_pins[j].GetPosition().y) )
286  continue;
287 
288  if( width < pinRect.GetWidth() + m_pins[j].GetBoundingBox().GetWidth() )
289  {
290  width = pinRect.GetWidth() + m_pins[j].GetBoundingBox().GetWidth();
291  break;
292  }
293  }
294  }
295  }
296 
297  return width;
298 }
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
#define MIN_SHEET_WIDTH
Definition: sch_sheet.h:47
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
int GetRight() const
Definition: eda_rect.h:119
size_t i
Definition: json11.cpp:597
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
int GetWidth() const
Definition: eda_rect.h:117
void SCH_SHEET::GetMsgPanelInfo ( EDA_UNITS_T  aUnits,
std::vector< MSG_PANEL_ITEM > &  aList 
)
overridevirtual

Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.

Note
This method replaces DisplayInfo() so that KiCad objects no longer have any knowledge of wxWidgets UI objects.
Parameters
aListis the list to populate.

Reimplemented from EDA_ITEM.

Definition at line 668 of file sch_sheet.cpp.

References BLUE, BROWN, CYAN, m_fileName, m_name, and EDA_ITEM::m_TimeStamp.

669 {
670  aList.push_back( MSG_PANEL_ITEM( _( "Sheet Name" ), m_name, CYAN ) );
671  aList.push_back( MSG_PANEL_ITEM( _( "File Name" ), m_fileName, BROWN ) );
672 
673 #if 0 // Set to 1 to display the sheet time stamp (mainly for test)
674  wxString msg;
675  msg.Printf( wxT( "%.8X" ), m_TimeStamp );
676  aList.push_back( MSG_PANEL_ITEM( _( "Time Stamp" ), msg, BLUE ) );
677 #endif
678 }
Definition: colors.h:57
timestamp_t m_TimeStamp
Time stamp used for logical links.
Definition: base_struct.h:172
wxString m_name
This is equivalent to the reference designator for components and is stored in F0 sheet pin in the sc...
Definition: sch_sheet.h:226
wxString m_fileName
The file name is also in the SCH_SCREEN object associated with the sheet.
Definition: sch_sheet.h:222
Definition: colors.h:59
Class EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
Definition: colors.h:62
wxString SCH_SHEET::GetName ( void  ) const
inline

Definition at line 267 of file sch_sheet.h.

Referenced by HIERARCHY_NAVIG_DLG::buildHierarchyTree(), KIGFX::SCH_PAINTER::draw(), SCH_EDIT_FRAME::EditSheet(), SCH_SCREEN::GetSheet(), SCH_LEGACY_PLUGIN::saveSheet(), and DIALOG_SCH_SHEET_PROPS::TransferDataToWindow().

267 { return m_name; }
wxString m_name
This is equivalent to the reference designator for components and is stored in F0 sheet pin in the sc...
Definition: sch_sheet.h:226
void SCH_SHEET::GetNetListItem ( NETLIST_OBJECT_LIST aNetListItems,
SCH_SHEET_PATH aSheetPath 
)
overridevirtual

Function GetNetListItem creates a new NETLIST_OBJECT for the schematic object and adds it to aNetListItems.

Not all schematic objects have net list items associated with them. This method only needs to be overridden for those schematic objects that have net list objects associated with them.

Reimplemented from SCH_ITEM.

Definition at line 911 of file sch_sheet.cpp.

References NETLIST_OBJECT::ConvertBusToNetListItems(), GetText(), i, IsBusLabel(), NETLIST_OBJECT::m_Comp, NETLIST_OBJECT::m_End, NETLIST_OBJECT::m_Label, NETLIST_OBJECT::m_Link, m_pins, NETLIST_OBJECT::m_SheetPath, NETLIST_OBJECT::m_SheetPathInclude, NETLIST_OBJECT::m_Start, NETLIST_OBJECT::m_Type, and NET_SHEETLABEL.

913 {
914  SCH_SHEET_PATH sheetPath = *aSheetPath;
915  sheetPath.push_back( this );
916 
917  for( size_t i = 0; i < m_pins.size(); i++ )
918  {
919  NETLIST_OBJECT* item = new NETLIST_OBJECT();
920  item->m_SheetPathInclude = sheetPath;
921  item->m_SheetPath = *aSheetPath;
922  item->m_Comp = &m_pins[i];
923  item->m_Link = this;
924  item->m_Type = NET_SHEETLABEL;
925  item->m_Label = m_pins[i].GetText();
926  item->m_Start = item->m_End = m_pins[i].GetPosition();
927  aNetListItems.push_back( item );
928 
929  if( IsBusLabel( m_pins[i].GetText() ) )
930  item->ConvertBusToNetListItems( aNetListItems );
931  }
932 }
SCH_SHEET_PATH m_SheetPathInclude
SCH_SHEET_PATH m_SheetPath
NETLIST_ITEM_T m_Type
EDA_ITEM * m_Comp
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
wxString GetText(GRAPHIC_PINSHAPE shape)
Definition: pin_shape.cpp:33
Class SCH_SHEET_PATH.
bool IsBusLabel(const wxString &aLabel)
Function IsBusLabel test if aLabel has a bus notation.
size_t i
Definition: json11.cpp:597
SCH_ITEM * m_Link
void ConvertBusToNetListItems(NETLIST_OBJECT_LIST &aNetListItems)
Function ConvertBusToNetListItems breaks the text of a bus label type net list object into as many me...
int SCH_SHEET::GetPenSize ( ) const
overridevirtual

Function GetPenSize virtual pure.

Returns
the size of the "pen" that be used to draw or plot this item

Reimplemented from SCH_ITEM.

Definition at line 383 of file sch_sheet.cpp.

References GetDefaultLineThickness().

Referenced by KIGFX::SCH_PAINTER::draw(), Draw(), GetBoundingBox(), GetFileNamePosition(), GetSheetNamePosition(), and Plot().

384 {
385  return GetDefaultLineThickness();
386 }
int GetDefaultLineThickness()
Default line thickness used to draw/plot items having a default thickness line value (i...
SCH_SHEET_PIN * SCH_SHEET::GetPin ( const wxPoint &  aPosition)

Return the sheet pin item found at aPosition in the sheet.

Parameters
aPositionThe position to check for a sheet pin.
Returns
The sheet pin found at aPosition or NULL if no sheet pin is found.

Definition at line 371 of file sch_sheet.cpp.

References m_pins.

Referenced by SCH_SCREEN::GetItem(), and SCH_SCREEN::GetSheetLabel().

372 {
373  for( SCH_SHEET_PIN& pin : m_pins )
374  {
375  if( pin.HitTest( aPosition, 0 ) )
376  return &pin;
377  }
378 
379  return NULL;
380 }
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:61
SCH_SHEET_PINS& SCH_SHEET::GetPins ( )
inline

Definition at line 334 of file sch_sheet.h.

Referenced by KIGFX::SCH_PAINTER::draw(), GetConnectionPoints(), GetEndPoints(), getSheetPin(), SCH_LEGACY_PLUGIN::saveSheet(), and UpdateDanglingState().

334 { return m_pins; }
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
SCH_SHEET_PINS& SCH_SHEET::GetPins ( ) const
inline

Definition at line 336 of file sch_sheet.h.

337  {
338  return const_cast< SCH_SHEET_PINS& >( m_pins );
339  }
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
boost::ptr_vector< SCH_SHEET_PIN > SCH_SHEET_PINS
Definition: sch_sheet.h:203
wxPoint SCH_SHEET::GetPosition ( ) const
inlineoverridevirtual

Function GetPosition.

Returns
A wxPoint object containing the schematic item position.

Implements SCH_ITEM.

Definition at line 547 of file sch_sheet.h.

References SCH_SHEET_PIN::Clone(), SCH_SHEET_PIN::HitTest(), SCH_TEXT::Plot(), and SCH_SHEET_PIN::SetPosition().

Referenced by KIGFX::SCH_PAINTER::draw(), GetConnectionPoints(), resizeSheetWithMouseCursor(), and SCH_LEGACY_PLUGIN::saveSheet().

547 { return m_pos; }
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
wxPoint SCH_SHEET::GetResizePosition ( ) const

Return the position of the lower right corner of the sheet in drawing units.

Returns
A wxPoint containing lower right corner of the sheet in drawing units.

Definition at line 905 of file sch_sheet.cpp.

References m_pos, and m_size.

Referenced by SCH_EDIT_FRAME::CreateSheet(), and SCH_EDIT_FRAME::ReSizeSheet().

906 {
907  return wxPoint( m_pos.x + m_size.GetWidth(), m_pos.y + m_size.GetHeight() );
908 }
wxSize m_size
The size of the sheet.
Definition: sch_sheet.h:238
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
SCH_SHEET * SCH_SHEET::GetRootSheet ( )

Return the root sheet of this SCH_SHEET object.

The root (top level) sheet can be found by walking up the parent links until the only sheet that has no parent is found. The root sheet can be found from any sheet without having to maintain a global root sheet pointer.

Returns
a SCH_SHEET pointer to the root sheet.

Definition at line 136 of file sch_sheet.cpp.

References EDA_ITEM::GetParent(), and GetRootSheet().

Referenced by GetRootSheet(), SCH_EAGLE_PLUGIN::Load(), and SCH_LEGACY_PLUGIN::Load().

137 {
138  SCH_SHEET* sheet = dynamic_cast< SCH_SHEET* >( GetParent() );
139 
140  if( sheet == NULL )
141  return this;
142 
143  // Recurse until a sheet is found with no parent which is the root sheet.
144  return sheet->GetRootSheet();
145 }
EDA_ITEM * GetParent() const
Definition: base_struct.h:211
SCH_SHEET * GetRootSheet()
Return the root sheet of this SCH_SHEET object.
Definition: sch_sheet.cpp:136
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
int SCH_SHEET::GetScreenCount ( ) const

Return the number of times the associated screen for the sheet is being used.

If no screen is associated with the sheet, then zero is returned.

Definition at line 127 of file sch_sheet.cpp.

References SCH_SCREEN::GetRefCount(), and m_screen.

Referenced by SCH_EDIT_FRAME::EditSheet().

128 {
129  if( m_screen == NULL )
130  return 0;
131 
132  return m_screen->GetRefCount();
133 }
int GetRefCount() const
Definition: sch_screen.h:144
SCH_SCREEN * m_screen
Screen that contains the physical data for the sheet.
Definition: sch_sheet.h:215
wxString SCH_SHEET::GetSelectMenuText ( EDA_UNITS_T  aUnits) const
overridevirtual

Function GetSelectMenuText returns the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position.

The default version of this function raises an assertion in the debug mode and returns a string to indicate that it was not overridden to provide the object specific text.

Returns
The menu text string.

Reimplemented from EDA_ITEM.

Definition at line 870 of file sch_sheet.cpp.

References Format(), and m_name.

Referenced by Matches().

871 {
872  return wxString::Format( _( "Hierarchical Sheet %s" ), m_name );
873 }
wxString m_name
This is equivalent to the reference designator for components and is stored in F0 sheet pin in the sc...
Definition: sch_sheet.h:226
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
wxPoint SCH_SHEET::GetSheetNamePosition ( )
Returns
the position of the anchor of sheet name text

Definition at line 389 of file sch_sheet.cpp.

References GetPenSize(), IsVerticalOrientation(), KiROUND(), m_pos, m_sheetNameSize, and m_size.

Referenced by KIGFX::SCH_PAINTER::draw(), Draw(), and Matches().

390 {
391  wxPoint pos = m_pos;
392  int margin = KiROUND( GetPenSize() / 2.0 + 4 + m_sheetNameSize * 0.3 );
393 
394  if( IsVerticalOrientation() )
395  {
396  pos.x -= margin;
397  pos.y += m_size.y;
398  }
399  else
400  {
401  pos.y -= margin;
402  }
403 
404  return pos;
405 }
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:121
int m_sheetNameSize
The height of the text used to draw the sheet name.
Definition: sch_sheet.h:229
wxSize m_size
The size of the sheet.
Definition: sch_sheet.h:238
int GetPenSize() const override
Function GetPenSize virtual pure.
Definition: sch_sheet.cpp:383
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
bool IsVerticalOrientation() const
Definition: sch_sheet.cpp:221
int SCH_SHEET::GetSheetNameSize ( ) const
inline

Definition at line 271 of file sch_sheet.h.

Referenced by KIGFX::SCH_PAINTER::draw(), SCH_LEGACY_PLUGIN::saveSheet(), and DIALOG_SCH_SHEET_PROPS::TransferDataToWindow().

271 { return m_sheetNameSize; }
int m_sheetNameSize
The height of the text used to draw the sheet name.
Definition: sch_sheet.h:229
wxSize SCH_SHEET::GetSize ( )
inline

Definition at line 281 of file sch_sheet.h.

Referenced by KIGFX::SCH_PAINTER::draw(), and SCH_LEGACY_PLUGIN::saveSheet().

281 { return m_size; }
wxSize m_size
The size of the sheet.
Definition: sch_sheet.h:238
STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 253 of file base_struct.h.

References EDA_ITEM::m_Status.

Referenced by PCB_IO::format(), and GERBER_DRAW_ITEM::HitTest().

253 { return m_Status; }
STATUS_FLAGS m_Status
Definition: base_struct.h:164
wxPoint& SCH_ITEM::GetStoredPos ( )
inlineinherited

Definition at line 155 of file sch_item_struct.h.

Referenced by moveItemWithMouseCursor().

155 { return m_storedPos; }
wxPoint m_storedPos
a temporary variable used in some move commands to store a initial pos (of the item or mouse cursor) ...
timestamp_t EDA_ITEM::GetTimeStamp ( ) const
inlineinherited

Definition at line 207 of file base_struct.h.

References EDA_ITEM::m_TimeStamp.

Referenced by FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn(), SCH_COMPONENT::AddSheetPathReferenceEntryIfMissing(), SCH_EDIT_FRAME::AnnotateComponents(), FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData(), PCB_EDIT_FRAME::Delete_OldZone_Fill(), PCB_EDIT_FRAME::Delete_Zone_Contour(), DuplicateStruct(), DIALOG_FOOTPRINT_BOARD_EDITOR::EditFootprint(), EDIT_TOOL::editFootprintInFpEditor(), SCH_EDIT_FRAME::EditSheet(), PCB_EDIT_FRAME::Exchange_Module(), PCB_IO::format(), FormatProbeItem(), NETLIST_OBJECT::GetShortNetName(), FIELDS_EDITOR_GRID_DATA_MODEL::groupMatch(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), NETLIST_EXPORTER_GENERIC::makeComponents(), mapExistingAnnotation(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), SCH_SHEET_PATH::Path(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_LEGACY_PLUGIN::saveComponent(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_LEGACY_PLUGIN::saveSheet(), SCH_REFERENCE::SCH_REFERENCE(), ZONE_FILLER_TOOL::SegzoneDeleteFill(), SortByTimeStamp(), SwapItemData(), DIALOG_SCH_SHEET_PROPS::TransferDataToWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow(), and DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS().

207 { return m_TimeStamp; }
timestamp_t m_TimeStamp
Time stamp used for logical links.
Definition: base_struct.h:172
bool SCH_SHEET::HasPin ( const wxString &  aName)

Checks if the sheet already has a sheet pin named aName.

Parameters
aNameName of the sheet pin to search for.
Returns
True if sheet pin with aName is found, otherwise false.

Definition at line 209 of file sch_sheet.cpp.

References m_pins.

Referenced by SCH_EDIT_FRAME::ImportSheetPin().

210 {
211  for( const SCH_SHEET_PIN& pin : m_pins )
212  {
213  if( pin.GetText().CmpNoCase( aName ) == 0 )
214  return true;
215  }
216 
217  return false;
218 }
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:61
bool SCH_SHEET::HasPins ( )
inline

Definition at line 374 of file sch_sheet.h.

References SCH_SHEET_PIN::Draw(), SCH_HIERLABEL::GetBoundingBox(), SCH_SHEET_PIN::GetPenSize(), and SCH_SHEET_PIN::SwapData().

Referenced by resizeSheetWithMouseCursor().

374 { return !m_pins.empty(); }
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
bool SCH_SHEET::HasUndefinedPins ( )

Check all sheet labels against schematic for undefined hierarchical labels.

Returns
True if there are any undefined labels.

Definition at line 232 of file sch_sheet.cpp.

References SCH_SCREEN::GetDrawItems(), EDA_TEXT::GetText(), m_pins, m_screen, EDA_ITEM::Next(), SCH_HIERARCHICAL_LABEL_T, and EDA_ITEM::Type().

Referenced by AddMenusForHierchicalSheet(), and SCH_EDIT_FRAME::Process_Special_Functions().

233 {
234  for( const SCH_SHEET_PIN& pin : m_pins )
235  {
236  /* Search the schematic for a hierarchical label corresponding to this sheet label. */
237  EDA_ITEM* DrawStruct = m_screen->GetDrawItems();
238  const SCH_HIERLABEL* HLabel = NULL;
239 
240  for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Next() )
241  {
242  if( DrawStruct->Type() != SCH_HIERARCHICAL_LABEL_T )
243  continue;
244 
245  HLabel = static_cast<SCH_HIERLABEL*>( DrawStruct );
246 
247  if( pin.GetText().CmpNoCase( HLabel->GetText() ) == 0 )
248  break; // Found!
249 
250  HLabel = NULL;
251  }
252 
253  if( HLabel == NULL ) // Corresponding hierarchical label not found.
254  return true;
255  }
256 
257  return false;
258 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
EDA_ITEM * Next() const
Definition: base_struct.h:209
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:143
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:61
SCH_ITEM * GetDrawItems() const
Definition: sch_screen.h:160
SCH_SCREEN * m_screen
Screen that contains the physical data for the sheet.
Definition: sch_sheet.h:215
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
virtual bool SCH_ITEM::HitTest ( const wxPoint &  aPosition) const
inlineoverridevirtualinherited

Function HitTest tests if aPosition is contained within or on the bounding area of an item.

Parameters
aPositionA reference to a wxPoint object containing the coordinates to test.
Returns
True if aPosition is within or on the item bounding area.

Reimplemented from EDA_ITEM.

Definition at line 315 of file sch_item_struct.h.

Referenced by SCH_SCREEN::addConnectedItemsToBlock().

316  {
317  return HitTest( aPosition, 0 );
318  }
virtual bool HitTest(const wxPoint &aPosition) const override
Function HitTest tests if aPosition is contained within or on the bounding area of an item...
bool SCH_SHEET::HitTest ( const wxPoint &  aPosition,
int  aAccuracy 
) const
overridevirtual

Function HitTest tests if aPosition is contained within or on the bounding box of an item.

Parameters
aPositionA reference to a wxPoint object containing the coordinates to test.
aAccuracyIncrease the item bounding box by this amount.
Returns
True if aPosition is within the item bounding box.

Reimplemented from SCH_ITEM.

Definition at line 882 of file sch_sheet.cpp.

References EDA_RECT::Contains(), GetBoundingBox(), and EDA_RECT::Inflate().

883 {
884  EDA_RECT rect = GetBoundingBox();
885 
886  rect.Inflate( aAccuracy );
887 
888  return rect.Contains( aPosition );
889 }
bool Contains(const wxPoint &aPoint) const
Function Contains.
EDA_RECT const GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
Definition: sch_sheet.cpp:515
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
bool SCH_SHEET::HitTest ( const EDA_RECT aRect,
bool  aContained = false,
int  aAccuracy = 0 
) const
overridevirtual

Function HitTest tests if aRect intersects or is contained within the bounding box of an item.

Parameters
aRectA reference to a EDA_RECT object containing the rectangle to test.
aContainedSet to true to test for containment instead of an intersection.
aAccuracyIncrease aRect by this amount.
Returns
True if aRect contains or intersects the item bounding box.

Reimplemented from SCH_ITEM.

Definition at line 892 of file sch_sheet.cpp.

References EDA_RECT::Contains(), GetBoundingBox(), EDA_RECT::Inflate(), and EDA_RECT::Intersects().

893 {
894  EDA_RECT rect = aRect;
895 
896  rect.Inflate( aAccuracy );
897 
898  if( aContained )
899  return rect.Contains( GetBoundingBox() );
900 
901  return rect.Intersects( GetBoundingBox() );
902 }
bool Contains(const wxPoint &aPoint) const
Function Contains.
EDA_RECT const GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
Definition: sch_sheet.cpp:515
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
bool EDA_ITEM::IsBrightened ( ) const
inlineinherited

Definition at line 227 of file base_struct.h.

References BRIGHTENED.

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), KIGFX::GERBVIEW_PAINTER::draw(), and KIGFX::PCB_RENDER_SETTINGS::GetColor().

227 { return m_Flags & BRIGHTENED; }
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:138
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
bool SCH_SHEET::IsConnectable ( ) const
inlineoverridevirtual

Function IsConnectable returns true if the schematic item can connect to another schematic item.

Reimplemented from SCH_ITEM.

Definition at line 523 of file sch_sheet.h.

523 { return true; }
bool SCH_ITEM::IsConnected ( const wxPoint &  aPoint) const
inherited

Function IsConnected tests the item to see if it is connected to aPoint.

Parameters
aPointA reference to a wxPoint object containing the coordinates to test.
Returns
True if connection to aPoint exists.

Definition at line 79 of file sch_item_struct.cpp.

References SCH_ITEM::doIsConnected(), EDA_ITEM::m_Flags, SKIP_STRUCT, and STRUCT_DELETED.

Referenced by SCH_SCREEN::addConnectedItemsToBlock(), SCH_SCREEN::CountConnectedItems(), and SCH_SCREEN::IsTerminalPoint().

80 {
82  return false;
83 
84  return doIsConnected( aPosition );
85 }
#define SKIP_STRUCT
flag indicating that the structure should be ignored
Definition: base_struct.h:125
virtual bool doIsConnected(const wxPoint &aPosition) const
Function doIsConnected provides the object specific test to see if it is connected to aPosition...
#define STRUCT_DELETED
flag indication structures to be erased
Definition: base_struct.h:123
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
virtual bool SCH_ITEM::IsDangling ( ) const
inlinevirtualinherited

Reimplemented in SCH_TEXT, SCH_LINE, and SCH_BUS_ENTRY_BASE.

Definition at line 265 of file sch_item_struct.h.

265 { return false; }
bool EDA_ITEM::IsDragging ( ) const
inlineinherited
bool EDA_ITEM::IsHighlighted ( ) const
inlineinherited

Definition at line 226 of file base_struct.h.

References HIGHLIGHTED.

Referenced by KIGFX::SCH_PAINTER::draw(), and KIGFX::getOverlayColor().

226 { return m_Flags & HIGHLIGHTED; }
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:137
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 220 of file base_struct.h.

References IS_CHANGED.

Referenced by LIB_EDIT_FRAME::OnEditPin().

220 { return m_Flags & IS_CHANGED; }
#define IS_CHANGED
std::function passed to nested users by ref, avoids copying std::function
Definition: base_struct.h:110
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
bool SCH_SHEET::IsMovableFromAnchorPoint ( )
inlineoverridevirtual

Return true for items which are moved with the anchor point at mouse cursor and false for items moved with no reference to anchor.

Usually return true for small items (labels, junctions) and false for items which can be large (hierarchical sheets, compoments)

Returns
false for a hierarchical sheet

Reimplemented from SCH_ITEM.

Definition at line 265 of file sch_sheet.h.

265 { return false; }
bool EDA_ITEM::IsNew ( ) const
inlineinherited

Definition at line 219 of file base_struct.h.

References IS_NEW.

Referenced by Abort_Edit_Pcb_Text(), Abort_EditEdge(), Abort_Move_ModuleOutline(), Abort_MoveOrCopyModule(), Abort_Zone_Create_Outline(), AbortBuildDimension(), AbortMoveAndEditTarget(), abortMoveItem(), AbortPinMove(), AbortSymbolTraceOn(), SCH_EDIT_FRAME::addCurrentItemToScreen(), SCH_EDIT_FRAME::addJunctionMenuEntries(), AddMenusForBus(), AddMenusForWire(), PCB_EDIT_FRAME::Delete_Segment(), PCB_EDIT_FRAME::Delete_Segment_Edge(), SCH_EDIT_FRAME::DeleteCurrentSegment(), LIB_ARC::drawEditGraphics(), LIB_ARC::drawGraphic(), LIB_PIN::EnableEditMode(), LIB_EDIT_FRAME::EndDrawGraphicItem(), SCH_EDIT_FRAME::EndSegment(), ExitSheet(), LIB_PART::LIB_PART(), EDIT_TOOL::MoveExact(), SCH_EDIT_FRAME::OnAutoplaceFields(), SCH_EDIT_FRAME::OnConvertTextType(), LIB_EDIT_FRAME::OnEditPin(), SCH_EDIT_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), FOOTPRINT_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnLeftDClick(), LIB_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnRightClick(), LIB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRotate(), PCB_EDIT_FRAME::Place_Texte_Pcb(), PCB_BASE_FRAME::PlaceModule(), LIB_EDIT_FRAME::PlacePin(), PCB_EDIT_FRAME::PlaceTarget(), SCH_EDIT_FRAME::PrepareMoveItem(), SCH_EDIT_FRAME::ReSizeSheet(), ShowClearance(), PCB_EDIT_FRAME::StartMoveTextePcb(), PCB_EDIT_FRAME::SwitchLayer(), DIALOG_SCH_EDIT_SHEET_PIN::TransferDataFromWindow(), and DIALOG_LABEL_EDITOR::TransferDataFromWindow().

219 { return m_Flags & IS_NEW; }
#define IS_NEW
New item, just created.
Definition: base_struct.h:114
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
bool SCH_SHEET::IsReplaceable ( ) const
inlineoverridevirtual

Function IsReplaceable.

Override this method in any derived object that supports test find and replace.

Returns
True if the item has replaceable text that can be modified using the find and replace dialog.

Reimplemented from EDA_ITEM.

Definition at line 498 of file sch_sheet.h.

References SCH_SHEET_PIN::GetEndPoints(), SCH_TEXT::IsSelectStateChanged(), and SCH_TEXT::UpdateDanglingState().

498 { return true; }
bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 225 of file base_struct.h.

References IS_RESIZED.

Referenced by ExitSheet().

225 { return m_Flags & IS_RESIZED; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
#define IS_RESIZED
Item being resized.
Definition: base_struct.h:115
bool EDA_ITEM::IsSelected ( ) const
inlineinherited
bool SCH_SHEET::IsSelectStateChanged ( const wxRect &  aRect)
overridevirtual

Function IsSelectStateChanged checks if the selection state of an item inside aRect has changed.

This is used by the block selection code to verify if an item is selected or not. True is be return anytime the select state changes. If you need to know the the current selection state, use the IsSelected() method.

Parameters
aRect- Rectangle to test against.

Reimplemented from SCH_ITEM.

Definition at line 821 of file sch_sheet.cpp.

References boundingBox(), EDA_ITEM::ClearFlags(), GetBoundingBox(), EDA_ITEM::IsSelected(), SELECTED, and EDA_ITEM::SetFlags().

822 {
823  bool previousState = IsSelected();
824 
826 
827  if( aRect.Intersects( boundingBox ) )
828  SetFlags( SELECTED );
829  else
830  ClearFlags( SELECTED );
831 
832  return previousState != IsSelected();
833 }
bool IsSelected() const
Definition: base_struct.h:224
BOX2I boundingBox(T aObject)
boundingBox template method
Definition: shape_index.h:59
#define SELECTED
Definition: base_struct.h:121
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:256
EDA_RECT const GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
Definition: sch_sheet.cpp:515
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:257
bool EDA_ITEM::IsType ( const KICAD_T  aScanTypes[])
inlineinherited

Function IsType Checks whether the item is one of the listed types.

Parameters
aScanTypesList of item types
Returns
true if the item type is contained in the list aScanTypes

Definition at line 266 of file base_struct.h.

References EOT.

267  {
268  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
269  {
270  if( m_StructType == *p )
271  return true;
272  }
273 
274  return false;
275  }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it...
Definition: base_struct.h:163
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
bool SCH_SHEET::IsVerticalOrientation ( ) const

Definition at line 221 of file sch_sheet.cpp.

References m_pins.

Referenced by KIGFX::SCH_PAINTER::draw(), Draw(), GetFileNamePosition(), GetSheetNamePosition(), Plot(), and SCH_SHEET_PIN::SCH_SHEET_PIN().

222 {
223  for( const SCH_SHEET_PIN& pin : m_pins )
224  {
225  if( pin.GetEdge() > 1 )
226  return true;
227  }
228  return false;
229 }
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:61
bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 223 of file base_struct.h.

References IS_WIRE_IMAGE.

Referenced by SCH_FIELD::Draw().

223 { return m_Flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:118
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
SEARCH_RESULT EDA_ITEM::IterateForward ( EDA_ITEM listStart,
INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
staticinherited

Function IterateForward walks through the object tree calling the inspector() on each object type requested in scanTypes.

Parameters
listStartThe first in a list of EDA_ITEMs to iterate over.
inspectorIs an INSPECTOR to call on each object that is one of the requested scanTypes.
testDataIs an aid to testFunc, and should be sufficient to allow it to fully determine if an item meets the match criteria, but it may also be used to collect output.
scanTypesA KICAD_T array that is EOT terminated, and provides both the order and interest level of of the types of objects to be iterated over.
Returns
SEARCH_RESULT SEARCH_QUIT if the called INSPECTOR returned SEARCH_QUIT, else SCAN_CONTINUE;

Definition at line 130 of file base_struct.cpp.

References EDA_ITEM::Pnext, SEARCH_CONTINUE, SEARCH_QUIT, and EDA_ITEM::Visit().

Referenced by SCH_COLLECTOR::Collect(), SCH_FIND_COLLECTOR::Collect(), SCH_TYPE_COLLECTOR::Collect(), SCH_FIND_COLLECTOR::GetItem(), EDA_ITEM::HitTest(), GERBER_FILE_IMAGE::Visit(), MODULE::Visit(), and BOARD::Visit().

134 {
135  EDA_ITEM* p = listStart;
136 
137  for( ; p; p = p->Pnext )
138  {
139  if( SEARCH_QUIT == p->Visit( inspector, testData, scanTypes ) )
140  return SEARCH_QUIT;
141  }
142 
143  return SEARCH_CONTINUE;
144 }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Function Visit may be re-implemented for each derived class in order to handle all the types given by...
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:167
virtual bool SCH_ITEM::Load ( LINE_READER aLine,
wxString &  aErrorMsg 
)
inlinevirtualinherited

Function Load reads a schematic item from aLine in a .sch file.

Parameters
aLine- Essentially this is file to read the object from.
aErrorMsg- Description of the error if an error occurs while loading the object.
Returns
True if the object loaded successfully.

Definition at line 235 of file sch_item_struct.h.

235 { return false; }
bool SCH_SHEET::LocatePathOfScreen ( SCH_SCREEN aScreen,
SCH_SHEET_PATH aList 
)

Search the existing hierarchy for an instance of screen loaded from aFileName.

Don't bother looking at the root sheet, it must be unique. No other references to its m_screen otherwise there would be loops in the hierarchy.

Parameters
aScreen= the SCH_SCREEN* screen that we search for
aList= the SCH_SHEET_PATH* that must be used
Returns
true if found

Definition at line 610 of file sch_sheet.cpp.

References SCH_SCREEN::GetDrawItems(), LocatePathOfScreen(), m_screen, EDA_ITEM::Next(), SCH_SHEET_T, and EDA_ITEM::Type().

Referenced by LocatePathOfScreen().

611 {
612  if( m_screen )
613  {
614  aList->push_back( this );
615 
616  if( m_screen == aScreen )
617  return true;
618 
619  EDA_ITEM* strct = m_screen->GetDrawItems();
620 
621  while( strct )
622  {
623  if( strct->Type() == SCH_SHEET_T )
624  {
625  SCH_SHEET* ss = (SCH_SHEET*) strct;
626 
627  if( ss->LocatePathOfScreen( aScreen, aList ) )
628  return true;
629  }
630 
631  strct = strct->Next();
632  }
633 
634  aList->pop_back();
635  }
636 
637  return false;
638 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
EDA_ITEM * Next() const
Definition: base_struct.h:209
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
bool LocatePathOfScreen(SCH_SCREEN *aScreen, SCH_SHEET_PATH *aList)
Search the existing hierarchy for an instance of screen loaded from aFileName.
Definition: sch_sheet.cpp:610
SCH_ITEM * GetDrawItems() const
Definition: sch_screen.h:160
SCH_SCREEN * m_screen
Screen that contains the physical data for the sheet.
Definition: sch_sheet.h:215
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
bool SCH_SHEET::Matches ( wxFindReplaceData &  aSearchData,
void *  aAuxData,
wxPoint *  aFindLocation 
)
overridevirtual

Function Matches compares the item against the search criteria in aSearchData.

The base class returns false since many of the objects derived from EDA_ITEM do not have any text to search.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search criteria.
aAuxDataA pointer to optional data required for the search or NULL if not used.
aFindLocationA pointer to a wxPoint object to store the location of matched item. The pointer can be NULL if it is not used.
Returns
True if the item's text matches the search criteria in aSearchData.

Reimplemented from EDA_ITEM.

Definition at line 752 of file sch_sheet.cpp.

References FR_SEARCH_REPLACE, GetFileNamePosition(), GetSelectMenuText(), GetSheetNamePosition(), m_fileName, m_name, EDA_ITEM::Matches(), MILLIMETRES, and traceFindItem.

753 {
754  wxLogTrace( traceFindItem, wxT( " item " ) + GetSelectMenuText( MILLIMETRES ) );
755 
756  // Ignore the sheet file name if searching to replace.
757  if( !(aSearchData.GetFlags() & FR_SEARCH_REPLACE)
758  && SCH_ITEM::Matches( m_fileName, aSearchData ) )
759  {
760  if( aFindLocation )
761  *aFindLocation = GetFileNamePosition();
762 
763  return true;
764  }
765 
766  if( SCH_ITEM::Matches( m_name, aSearchData ) )
767  {
768  if( aFindLocation )
769  *aFindLocation = GetSheetNamePosition();
770 
771  return true;
772  }
773 
774  return false;
775 }
virtual bool Matches(wxFindReplaceData &aSearchData, void *aAuxData, wxPoint *aFindLocation)
Function Matches compares the item against the search criteria in aSearchData.
Definition: base_struct.h:420
wxString m_name
This is equivalent to the reference designator for components and is stored in F0 sheet pin in the sc...
Definition: sch_sheet.h:226
wxString m_fileName
The file name is also in the SCH_SCREEN object associated with the sheet.
Definition: sch_sheet.h:222
wxPoint GetFileNamePosition()
Definition: sch_sheet.cpp:408
const wxChar *const traceFindItem
Flag to enable find debug tracing.
wxPoint GetSheetNamePosition()
Definition: sch_sheet.cpp:389
Perform a search for a item that has replaceable text.
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: sch_sheet.cpp:870
bool EDA_ITEM::Matches ( const wxString &  aText,
wxFindReplaceData &  aSearchData 
)
protectedinherited

Function Matches compares aText against search criteria in aSearchData.

This is a helper function for simplify derived class logic.

Parameters
aTextA reference to a wxString object containing the string to test.
aSearchDataThe criteria to search against.
Returns
True if aText matches the search criteria in aSearchData.

Definition at line 182 of file base_struct.cpp.

References FR_MATCH_WILDCARD, FR_SEARCH_REPLACE, and EDA_ITEM::IsReplaceable().

183 {
184  wxString text = aText;
185  wxString searchText = aSearchData.GetFindString();
186 
187  // Don't match if searching for replaceable item and the item doesn't support text replace.
188  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
189  return false;
190 
191  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
192  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
193 
194  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
195  {
196  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
197  return text.Matches( searchText );
198 
199  return text.MakeUpper().Matches( searchText.MakeUpper() );
200  }
201 
202  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
203  return aText.Find( searchText ) != wxNOT_FOUND;
204 
205  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
206 }
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:464
Perform search using simple wild card matching (* & ?).
Perform a search for a item that has replaceable text.
void SCH_SHEET::MirrorX ( int  aXaxis_position)
overridevirtual

Function MirrorX mirrors item relative to the X axis about aXaxis_position.

Parameters
aXaxis_positionThe X axis position to mirror around.

Implements SCH_ITEM.

Definition at line 705 of file sch_sheet.cpp.

References m_pins, m_pos, m_size, and MIRROR().

Referenced by SCH_EDIT_FRAME::MirrorSheet().

706 {
707  MIRROR( m_pos.y, aXaxis_position );
708  m_pos.y -= m_size.y;
709 
710  for( SCH_SHEET_PIN& sheetPin : m_pins )
711  {
712  sheetPin.MirrorX( aXaxis_position );
713  }
714 }
wxSize m_size
The size of the sheet.
Definition: sch_sheet.h:238
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
void MIRROR(T &aPoint, const T &aMirrorRef)
Definition: macros.h:114
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:61
void SCH_SHEET::MirrorY ( int  aYaxis_position)
overridevirtual

Function MirrorY mirrors item relative to the Y axis about aYaxis_position.

Parameters
aYaxis_positionThe Y axis position to mirror around.

Implements SCH_ITEM.

Definition at line 717 of file sch_sheet.cpp.

References m_pins, m_pos, m_size, and MIRROR().

Referenced by SCH_EDIT_FRAME::MirrorSheet().

718 {
719  MIRROR( m_pos.x, aYaxis_position );
720  m_pos.x -= m_size.x;
721 
722  for( SCH_SHEET_PIN& label : m_pins )
723  {
724  label.MirrorY( aYaxis_position );
725  }
726 }
wxSize m_size
The size of the sheet.
Definition: sch_sheet.h:238
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
void MIRROR(T &aPoint, const T &aMirrorRef)
Definition: macros.h:114
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:61
void SCH_SHEET::Move ( const wxPoint &  aMoveVector)
inlineoverridevirtual

Function Move moves the item by aMoveVector to a new position.

Parameters
aMoveVector= the displacement vector

Implements SCH_ITEM.

Definition at line 478 of file sch_sheet.h.

References SCH_SHEET_PIN::Matches(), SCH_SHEET_PIN::MirrorX(), SCH_SHEET_PIN::MirrorY(), SCH_SHEET_PIN::Replace(), and SCH_SHEET_PIN::Rotate().

Referenced by SetPosition().

479  {
480  m_pos += aMoveVector;
481 
482  for( SCH_SHEET_PIN& pin : m_pins )
483  {
484  pin.Move( aMoveVector );
485  }
486  }
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:61
SCH_ITEM* SCH_ITEM::Next ( ) const
inlineinherited

Definition at line 143 of file sch_item_struct.h.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), SCH_SCREEN::addConnectedItemsToBlock(), SCH_BASE_FRAME::AddToScreen(), SCH_SHEET_LIST::AnnotatePowerSymbols(), HIERARCHY_NAVIG_DLG::buildHierarchyTree(), NETLIST_OBJECT_LIST::BuildNetListInfo(), SCH_SCREENS::ChangeSymbolLibNickname(), SCH_SCREEN::CheckIfOnDrawList(), SCH_SCREEN::ClearAnnotation(), SCH_SCREEN::ClearDrawingState(), SCH_SCREEN::CountConnectedItems(), SCH_EDIT_FRAME::CreateArchiveLibrary(), SCH_SCREENS::DeleteAllMarkers(), SCH_EDIT_FRAME::DeleteJunction(), DIALOG_ERC::DisplayERC_MarkersList(), KIGFX::SCH_VIEW::DisplaySheet(), SCH_SCREEN::Draw(), DrawSegment(), SCH_EDIT_FRAME::EndSegment(), SCH_SCREEN::EnsureAlternateReferencesExist(), SCH_EDIT_FRAME::FindComponentAndItem(), SCH_SHEET_PATH::FindNextItem(), SCH_SHEET_LIST::FindNextItem(), SCH_SHEET_PATH::FirstDrawList(), SCH_LEGACY_PLUGIN::Format(), get_components(), AUTOPLACER::get_possible_colliders(), SCH_SHEET_PATH::GetComponents(), SCH_SCREEN::GetConnection(), SCH_SCREEN::GetHierarchicalItems(), SCH_SCREEN::GetItem(), SCH_SCREEN::GetLabel(), SCH_SCREENS::GetLibNicknames(), SCH_SCREEN::GetLine(), SCH_SCREENS::GetMarkerCount(), SCH_SHEET_PATH::GetMultiUnitComponents(), SCH_SCREEN::GetNode(), SCH_SCREEN::GetPin(), SCH_SCREEN::GetSheet(), getSheetBbox(), SCH_SCREEN::GetSheetLabel(), getSheetPin(), SCH_SCREEN::GetWireOrBus(), SCH_SCREENS::HasNoFullyDefinedLibIds(), DIALOG_EDIT_COMPONENTS_LIBID::initDlg(), SCH_SCREEN::IsJunctionNeeded(), SCH_EAGLE_PLUGIN::loadSheet(), SCH_SCREEN::MarkConnections(), SCH_EAGLE_PLUGIN::moveLabels(), SCH_EDIT_FRAME::OnConvertTextType(), DIALOG_ERC::OnLeftClickMarkersList(), SCH_EDIT_FRAME::OnUpdateFields(), SCH_SCREEN::Plot(), SCH_EDIT_FRAME::PutDataInPreviousState(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), SCH_SCREEN::ReplaceWires(), SCH_EDIT_FRAME::SaveWireImage(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_SCREEN::SetComponentFootprint(), SCH_EDIT_FRAME::SetCurrentSheetHighlightFlags(), SCH_SCREEN::TestDanglingEnds(), TestDuplicateSheetNames(), DIALOG_ERC::TestErc(), DIALOG_LABEL_EDITOR::TransferDataToWindow(), SCH_EDIT_FRAME::TrimWire(), and SCH_SCREEN::UpdatePickList().

143 { return static_cast<SCH_ITEM*>( Pnext ); }
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:167
bool SCH_ITEM::operator< ( const SCH_ITEM aItem) const
virtualinherited

Reimplemented in SCH_COMPONENT, and SCH_LINE.

Definition at line 94 of file sch_item_struct.cpp.

References SCH_ITEM::GetClass(), and EDA_ITEM::Type().

95 {
96  wxCHECK_MSG( false, this->Type() < aItem.Type(),
97  wxT( "Less than operator not defined for " ) + GetClass() );
98 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
virtual wxString GetClass() const override
Function GetClass returns the class name.
bool EDA_ITEM::operator< ( const EDA_ITEM aItem) const
inherited

Test if another item is less than this object.

Parameters
aItem- Item to compare against.
Returns
- True if aItem is less than the item.

Definition at line 239 of file base_struct.cpp.

References Format(), GetChars(), and EDA_ITEM::GetClass().

Referenced by EDA_ITEM::IsReplaceable(), and LIB_ALIAS::operator==().

240 {
241  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
242  GetChars( GetClass() ) ) );
243 
244  return false;
245 }
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
virtual wxString GetClass() const =0
Function GetClass returns the class name.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
SCH_ITEM & SCH_SHEET::operator= ( const SCH_ITEM aSheet)

Definition at line 1013 of file sch_sheet.cpp.

References SCH_ITEM::GetClass(), GetClass(), m_fileNameSize, m_name, m_pins, m_pos, m_sheetNameSize, m_size, EDA_ITEM::operator=(), TO_UTF8, and EDA_ITEM::Type().

1014 {
1015  wxLogDebug( wxT( "Sheet assignment operator." ) );
1016 
1017  wxCHECK_MSG( Type() == aItem.Type(), *this,
1018  wxT( "Cannot assign object type " ) + aItem.GetClass() + wxT( " to type " ) +
1019  GetClass() );
1020 
1021  if( &aItem != this )
1022  {
1023  SCH_ITEM::operator=( aItem );
1024 
1025  SCH_SHEET* sheet = (SCH_SHEET*) &aItem;
1026 
1027  m_pos = sheet->m_pos;
1028  m_size = sheet->m_size;
1029  m_name = sheet->m_name;
1031  m_fileNameSize = sheet->m_fileNameSize;
1032  m_pins = sheet->m_pins;
1033 
1034  // Ensure sheet labels have their #m_Parent member pointing really on their
1035  // parent, after assigning.
1036  for( SCH_SHEET_PIN& sheetPin : m_pins )
1037  {
1038  sheetPin.SetParent( this );
1039  }
1040  }
1041 
1042  return *this;
1043 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
int m_sheetNameSize
The height of the text used to draw the sheet name.
Definition: sch_sheet.h:229
wxSize m_size
The size of the sheet.
Definition: sch_sheet.h:238
wxString m_name
This is equivalent to the reference designator for components and is stored in F0 sheet pin in the sc...
Definition: sch_sheet.h:226
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_sheet.h:251
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:61
EDA_ITEM & operator=(const EDA_ITEM &aItem)
Operator assignment is used to assign the members of aItem to another object.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
int m_fileNameSize
The height of the text used to draw the file name.
Definition: sch_sheet.h:232
void SCH_SHEET::Plot ( PLOTTER aPlotter)
overridevirtual

Function Plot plots the schematic item to aPlotter.

Parameters
aPlotterA pointer to a PLOTTER object.

Reimplemented from SCH_ITEM.

Definition at line 935 of file sch_sheet.cpp.

References Clamp_Text_PenSize(), PLOTTER::FinishTo(), GetDefaultLineThickness(), GetFileName(), SCH_ITEM::GetLayer(), GetLayerColor(), GetPenSize(), GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_TOP, i, IsVerticalOrientation(), LAYER_SHEETFILENAME, LAYER_SHEETNAME, PLOTTER::LineTo(), m_fileNameSize, m_name, m_pins, m_pos, m_sheetNameSize, m_size, PLOTTER::MoveTo(), PLOTTER::SetColor(), PLOTTER::SetCurrentLineWidth(), PLOTTER::Text(), TEXT_ANGLE_HORIZ, and TEXT_ANGLE_VERT.

936 {
937  COLOR4D txtcolor = COLOR4D::UNSPECIFIED;
938  wxSize size;
939  wxString Text;
940  int name_orientation;
941  wxPoint pos_sheetname, pos_filename;
942  wxPoint pos;
943 
944  aPlotter->SetColor( GetLayerColor( GetLayer() ) );
945 
946  int thickness = GetPenSize();
947  aPlotter->SetCurrentLineWidth( thickness );
948 
949  aPlotter->MoveTo( m_pos );
950  pos = m_pos;
951  pos.x += m_size.x;
952 
953  aPlotter->LineTo( pos );
954  pos.y += m_size.y;
955 
956  aPlotter->LineTo( pos );
957  pos = m_pos;
958  pos.y += m_size.y;
959 
960  aPlotter->LineTo( pos );
961  aPlotter->FinishTo( m_pos );
962 
963  if( IsVerticalOrientation() )
964  {
965  pos_sheetname = wxPoint( m_pos.x - 8, m_pos.y + m_size.y );
966  pos_filename = wxPoint( m_pos.x + m_size.x + 4, m_pos.y + m_size.y );
967  name_orientation = TEXT_ANGLE_VERT;
968  }
969  else
970  {
971  pos_sheetname = wxPoint( m_pos.x, m_pos.y - 4 );
972  pos_filename = wxPoint( m_pos.x, m_pos.y + m_size.y + 4 );
973  name_orientation = TEXT_ANGLE_HORIZ;
974  }
975 
976  /* Draw texts: SheetName */
977  Text = m_name;
978  size = wxSize( m_sheetNameSize, m_sheetNameSize );
979 
980  //pos = m_pos; pos.y -= 4;
981  thickness = GetDefaultLineThickness();
982  thickness = Clamp_Text_PenSize( thickness, size, false );
983 
984  aPlotter->SetColor( GetLayerColor( LAYER_SHEETNAME ) );
985 
986  bool italic = false;
987  aPlotter->Text( pos_sheetname, txtcolor, Text, name_orientation, size,
989  thickness, italic, false );
990 
991  /*Draw texts : FileName */
992  Text = GetFileName();
993  size = wxSize( m_fileNameSize, m_fileNameSize );
994  thickness = GetDefaultLineThickness();
995  thickness = Clamp_Text_PenSize( thickness, size, false );
996 
998 
999  aPlotter->Text( pos_filename, txtcolor, Text, name_orientation, size,
1001  thickness, italic, false );
1002 
1003  aPlotter->SetColor( GetLayerColor( GetLayer() ) );
1004 
1005  /* Draw texts : SheetLabel */
1006  for( size_t i = 0; i < m_pins.size(); i++ )
1007  {
1008  m_pins[i].Plot( aPlotter );
1009  }
1010 }
#define TEXT_ANGLE_HORIZ
void FinishTo(const wxPoint &pos)
Definition: plotter.h:251
int Clamp_Text_PenSize(int aPenSize, int aSize, bool aBold)
Function Clamp_Text_PenSize As a rule, pen width should not be >1/4em, otherwise the character will b...
#define TEXT_ANGLE_VERT
virtual void SetColor(COLOR4D color)=0
int m_sheetNameSize
The height of the text used to draw the sheet name.
Definition: sch_sheet.h:229
int GetDefaultLineThickness()
Default line thickness used to draw/plot items having a default thickness line value (i...
wxSize m_size
The size of the sheet.
Definition: sch_sheet.h:238
wxString m_name
This is equivalent to the reference designator for components and is stored in F0 sheet pin in the sc...
Definition: sch_sheet.h:226
SCH_LAYER_ID GetLayer() const
Function GetLayer returns the layer this item is on.
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
Definition: eeschema.cpp:174
int GetPenSize() const override
Function GetPenSize virtual pure.
Definition: sch_sheet.cpp:383
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
virtual void Text(const wxPoint &aPos, const COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=NULL)
Draws text with the plotter.
void LineTo(const wxPoint &pos)
Definition: plotter.h:246
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
wxString GetFileName(void) const
Return the filename corresponding to this sheet.
Definition: sch_sheet.cpp:662
void MoveTo(const wxPoint &pos)
Definition: plotter.h:241
int m_fileNameSize
The height of the text used to draw the file name.
Definition: sch_sheet.h:232
size_t i
Definition: json11.cpp:597
bool IsVerticalOrientation() const
Definition: sch_sheet.cpp:221
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
void SCH_SHEET::RemovePin ( SCH_SHEET_PIN aSheetPin)

Remove aSheetPin from the sheet.

Parameters
aSheetPinThe sheet pin item to remove from the sheet.

Definition at line 187 of file sch_sheet.cpp.

References GetChars(), EDA_TEXT::GetShownText(), i, m_name, m_pins, renumberPins(), SCH_SHEET_PIN_T, and EDA_ITEM::Type().

Referenced by SCH_SCREEN::DeleteItem(), and SCH_EDIT_FRAME::DeleteItem().

188 {
189  wxASSERT( aSheetPin != NULL );
190  wxASSERT( aSheetPin->Type() == SCH_SHEET_PIN_T );
191 
192  SCH_SHEET_PINS::iterator i;
193 
194  for( i = m_pins.begin(); i < m_pins.end(); ++i )
195  {
196  if( *i == aSheetPin )
197  {
198  m_pins.erase( i );
199  renumberPins();
200  return;
201  }
202  }
203 
204  wxLogDebug( wxT( "Fix me: attempt to remove label %s which is not in sheet %s." ),
205  GetChars( aSheetPin->GetShownText() ), GetChars( m_name ) );
206 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
wxString m_name
This is equivalent to the reference designator for components and is stored in F0 sheet pin in the sc...
Definition: sch_sheet.h:226
virtual wxString GetShownText() const
Returns the string actually shown after processing of the base text.
Definition: eda_text.h:148
void renumberPins()
Renumber the sheet pins in the sheet.
Definition: sch_sheet.cpp:784
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
size_t i
Definition: json11.cpp:597
void SCH_SHEET::renumberPins ( )
protected

Renumber the sheet pins in the sheet.

This method is used internally by SCH_SHEET to update the pin numbering when the pin list changes. Make sure you call this method any time a sheet pin is added or removed.

Definition at line 784 of file sch_sheet.cpp.

References m_pins.

Referenced by AddPin(), and RemovePin().

785 {
786  int id = 2;
787 
788  for( SCH_SHEET_PIN& pin : m_pins )
789  {
790  pin.SetNumber( id );
791  id++;
792  }
793 }
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:61
bool EDA_ITEM::Replace ( wxFindReplaceData &  aSearchData,
wxString &  aText 
)
inherited

Helper function used in search and replace dialog Function Replace performs a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search and replace criteria.
aTextA reference to a wxString object containing the text to be replaced.
Returns
True if aText was modified, otherwise false.

Definition at line 209 of file base_struct.cpp.

References GetChars(), EDA_ITEM::GetClass(), EDA_ITEM::IsReplaceable(), and traceFindReplace.

Referenced by EDA_ITEM::Matches(), SCH_TEXT::Replace(), SCH_FIELD::Replace(), SCH_SHEET_PIN::Replace(), Replace(), and SCH_FIND_COLLECTOR::ReplaceItem().

210 {
211  wxCHECK_MSG( IsReplaceable(), false,
212  wxT( "Attempt to replace text in <" ) + GetClass() + wxT( "> item." ) );
213 
214  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
215 
216  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
217  aSearchData.GetFindString() :
218  aSearchData.GetFindString().Upper() );
219 
220  if( result == wxNOT_FOUND )
221  return false;
222 
223  wxString prefix = aText.Left( result );
224  wxString suffix;
225 
226  if( aSearchData.GetFindString().length() + result < aText.length() )
227  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
228 
229  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
230  GetChars( aText ), GetChars( prefix ), GetChars( aSearchData.GetReplaceString() ),
231  GetChars( suffix ) );
232 
233  aText = prefix + aSearchData.GetReplaceString() + suffix;
234 
235  return true;
236 }
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:464
const wxChar *const traceFindReplace
Flag to enable find and replace debug tracing.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
virtual wxString GetClass() const =0
Function GetClass returns the class name.
bool SCH_SHEET::Replace ( wxFindReplaceData &  aSearchData,
void *  aAuxData = NULL 
)
overridevirtual

Function Replace performs a text replace using the find and replace criteria in aSearchData on items that support text find and replace.

This function must be overridden for items that support text replace.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search and replace criteria.
aAuxDataA pointer to optional data required for the search or NULL if not used.
Returns
True if the item text was modified, otherwise false.

Reimplemented from EDA_ITEM.

Definition at line 778 of file sch_sheet.cpp.

References m_name, and EDA_ITEM::Replace().

779 {
780  return EDA_ITEM::Replace( aSearchData, m_name );
781 }
bool Replace(wxFindReplaceData &aSearchData, wxString &aText)
Helper function used in search and replace dialog Function Replace performs a text replace on aText u...
wxString m_name
This is equivalent to the reference designator for components and is stored in F0 sheet pin in the sc...
Definition: sch_sheet.h:226
void SCH_SHEET::Resize ( const wxSize &  aSize)

Resize this sheet to aSize and adjust all of the labels accordingly.

Parameters
aSize- The new size for this sheet.

Definition at line 737 of file sch_sheet.cpp.

References m_pins, and m_size.

Referenced by resizeSheetWithMouseCursor().

738 {
739  if( aSize == m_size )
740  return;
741 
742  m_size = aSize;
743 
744  /* Move the sheet labels according to the new sheet size. */
745  for( SCH_SHEET_PIN& label : m_pins )
746  {
747  label.ConstrainOnEdge( label.GetPosition() );
748  }
749 }
wxSize m_size
The size of the sheet.
Definition: sch_sheet.h:238
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:61
void SCH_SHEET::Rotate ( wxPoint  aPosition)
overridevirtual

Function Rotate rotates the item around aPosition 90 degrees in the clockwise direction.

Parameters
aPositionA reference to a wxPoint object containing the coordinates to rotate around.

Implements SCH_ITEM.

Definition at line 681 of file sch_sheet.cpp.

References m_pins, m_pos, m_size, and RotatePoint().

Referenced by SCH_EDIT_FRAME::RotateHierarchicalSheet().

682 {
683  RotatePoint( &m_pos, aPosition, 900 );
684  RotatePoint( &m_size.x, &m_size.y, 900 );
685 
686  if( m_size.x < 0 )
687  {
688  m_pos.x += m_size.x;
689  m_size.x = -m_size.x;
690  }
691 
692  if( m_size.y < 0 )
693  {
694  m_pos.y += m_size.y;
695  m_size.y = -m_size.y;
696  }
697 
698  for( SCH_SHEET_PIN& sheetPin : m_pins )
699  {
700  sheetPin.Rotate( aPosition );
701  }
702 }
wxSize m_size
The size of the sheet.
Definition: sch_sheet.h:238
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:216
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:61
bool SCH_SHEET::SearchHierarchy ( const wxString &  aFilename,
SCH_SCREEN **  aScreen 
)

Search the existing hierarchy for an instance of screen loaded from aFileName.

Parameters
aFilename= the filename to find
aScreen= a location to return a pointer to the screen (if found)
Returns
bool if found, and a pointer to the screen

Definition at line 579 of file sch_sheet.cpp.

References SCH_SCREEN::GetDrawItems(), SCH_SCREEN::GetFileName(), m_screen, EDA_ITEM::Next(), SCH_SHEET_T, SearchHierarchy(), and EDA_ITEM::Type().

Referenced by SCH_EDIT_FRAME::EditSheet(), and SearchHierarchy().

580 {
581  if( m_screen )
582  {
583  EDA_ITEM* item = m_screen->GetDrawItems();
584 
585  while( item )
586  {
587  if( item->Type() == SCH_SHEET_T )
588  {
589  SCH_SHEET* sheet = (SCH_SHEET*) item;
590 
591  if( sheet->m_screen
592  && sheet->m_screen->GetFileName().CmpNoCase( aFilename ) == 0 )
593  {
594  *aScreen = sheet->m_screen;
595  return true;
596  }
597 
598  if( sheet->SearchHierarchy( aFilename, aScreen ) )
599  return true;
600  }
601 
602  item = item->Next();
603  }
604  }
605 
606  return false;
607 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
Definition: sch_sheet.cpp:579
const wxString & GetFileName() const
Definition: sch_screen.h:131
EDA_ITEM * Next() const
Definition: base_struct.h:209
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
SCH_ITEM * GetDrawItems() const
Definition: sch_screen.h:160
SCH_SCREEN * m_screen
Screen that contains the physical data for the sheet.
Definition: sch_sheet.h:215
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
void EDA_ITEM::SetBack ( EDA_ITEM aBack)
inlineinherited

Definition at line 215 of file base_struct.h.

Referenced by DHEAD::append(), DHEAD::insert(), SCH_EDIT_FRAME::PutDataInPreviousState(), DHEAD::remove(), and SwapItemData().

215 { Pback = aBack; }
EDA_ITEM * Pback
previous in linked list
Definition: base_struct.h:168
void EDA_ITEM::SetBrightened ( )
inlineinherited

Definition at line 232 of file base_struct.h.

References BRIGHTENED, and EDA_ITEM::SetFlags().

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), and SELECTION_TOOL::highlight().

232 { SetFlags( BRIGHTENED ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:256
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:138
void SCH_SHEET::SetFileName ( const wxString &  aFilename)
inline

Definition at line 467 of file sch_sheet.h.

Referenced by SCH_EDIT_FRAME::EditSheet(), SCH_EDIT_FRAME::importFile(), and SCH_EDIT_FRAME::OpenProjectFiles().

468  {
469  m_fileName = aFilename;
470  // Filenames are stored using unix notation
471  m_fileName.Replace( wxT("\\"), wxT("/") );
472  }
wxString m_fileName
The file name is also in the SCH_SCREEN object associated with the sheet.
Definition: sch_sheet.h:222
void SCH_SHEET::SetFileNameSize ( int  aSize)
inline

Definition at line 277 of file sch_sheet.h.

Referenced by SCH_EDIT_FRAME::EditSheet().

277 { m_fileNameSize = aSize; }
int m_fileNameSize
The height of the text used to draw the file name.
Definition: sch_sheet.h:232
void EDA_ITEM::SetFlags ( STATUS_FLAGS  aMask)
inlineinherited

Definition at line 256 of file base_struct.h.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), SCH_SCREEN::addConnectedItemsToBlock(), PCB_BASE_FRAME::AddModuleToBoard(), AddSegmentToDragList(), PCBNEW_CONTROL::AppendBoard(), PCB_EDIT_FRAME::AppendBoardFile(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Zone(), PCB_EDIT_FRAME::BeginMoveDimensionText(), PCB_EDIT_FRAME::BeginMoveTarget(), SCH_EDIT_FRAME::BeginSegment(), LIB_EDIT_FRAME::BlockCopySelectedItems(), PCB_EDIT_FRAME::Change_Side_Module(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::copyBlockItems(), CopyMarkedItems(), LIB_EDIT_FRAME::copySelectedItems(), SCH_EDIT_FRAME::CreateBusBusEntry(), SCH_EDIT_FRAME::CreateBusWireEntry(), SCH_EDIT_FRAME::CreateNewImage(), SCH_EDIT_FRAME::CreateNewText(), LIB_EDIT_FRAME::CreatePin(), SCH_EDIT_FRAME::CreateSheet(), SCH_EDIT_FRAME::CreateSheetPin(), PCB_EDIT_FRAME::CreateTarget(), PCB_EDIT_FRAME::CreateTextePcb(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), SCH_EDIT_FRAME::DeleteItem(), KIGFX::SCH_PAINTER::draw(), DrawMovingBlockOutlines(), PCB_EDIT_FRAME::EditDimension(), PCB_EDIT_FRAME::FlipTextePcb(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_SCREEN::GetConnection(), FOOTPRINT_EDIT_FRAME::HandleBlockEnd(), SCH_EDIT_FRAME::HandleBlockPlace(), KIGFX::SCH_VIEW::HighlightItem(), PCB_BASE_FRAME::Import_Pad_Settings(), SCH_EDIT_FRAME::ImportSheetPin(), InvokeDialogImportGfxBoard(), InvokeDialogImportGfxModule(), SCH_JUNCTION::IsSelectStateChanged(), SCH_NO_CONNECT::IsSelectStateChanged(), SCH_MARKER::IsSelectStateChanged(), SCH_BUS_ENTRY_BASE::IsSelectStateChanged(), SCH_BITMAP::IsSelectStateChanged(), SCH_LINE::IsSelectStateChanged(), SCH_TEXT::IsSelectStateChanged(), IsSelectStateChanged(), SCH_COMPONENT::IsSelectStateChanged(), SCH_EDIT_FRAME::Load_Component(), SCH_SCREEN::MarkConnections(), MarkItemsInBloc(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), LIB_EDIT_FRAME::OnEditPin(), SCH_EDIT_FRAME::OnSelectUnit(), KIGFX::ORIGIN_VIEWITEM::ORIGIN_VIEWITEM(), PCB_EDIT_FRAME::Other_Layer_Route(), DRAWING_TOOL::PlaceText(), SCH_EDIT_FRAME::PrepareMoveItem(), LIB_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), SCH_EDIT_FRAME::ReSizeSheet(), PCB_BASE_FRAME::Rotate_Module(), PCB_EDIT_FRAME::Rotate_Texte_Pcb(), LIB_EDIT_FRAME::SaveCopyInUndoList(), SCH_SCREEN::SelectBlockItems(), EDA_ITEM::SetBrightened(), LIB_PIN::SetConversion(), BLOCK_SELECTOR::SetFlags(), EDA_ITEM::SetHighlighted(), EDA_ITEM::SetModified(), EDA_ITEM::SetSelected(), EDA_ITEM::SetWireImage(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::Start_Move_DrawItem(), FOOTPRINT_EDIT_FRAME::Start_Move_EdgeMod(), PCB_EDIT_FRAME::Start_Move_Zone_Corner(), PCB_EDIT_FRAME::Start_Move_Zone_Drag_Outline_Edge(), PCB_EDIT_FRAME::Start_Move_Zone_Outlines(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), PCB_BASE_FRAME::StartMovePad(), LIB_EDIT_FRAME::StartMovePin(), PCB_BASE_FRAME::StartMoveTexteModule(), PCB_EDIT_FRAME::StartMoveTextePcb(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and UndrawAndMarkSegmentsToDrag().

256 { m_Flags |= aMask; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
void EDA_ITEM::SetForceVisible ( bool  aEnable)
inlineinherited

Function SetForceVisible is used to set and cleag force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible.

Parameters
aEnableTrue forces the item to be drawn. False uses the item's visibility setting to determine if the item is to be drawn.

Definition at line 285 of file base_struct.h.

Referenced by SCH_EDIT_FRAME::OnFindSchematicItem(), and SCH_EDIT_FRAME::updateFindReplaceView().

285 { m_forceVisible = aEnable; }
bool m_forceVisible
Set to true to override the visibility setting of the item.
Definition: base_struct.h:175
void EDA_ITEM::SetHighlighted ( )
inlineinherited

Definition at line 231 of file base_struct.h.

References HIGHLIGHTED, and EDA_ITEM::SetFlags().

231 { SetFlags( HIGHLIGHTED ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:256
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:137
void SCH_ITEM::SetLayer ( SCH_LAYER_ID  aLayer)
inlineinherited

Function SetLayer sets the layer this item is on.

Parameters
aLayerThe layer number.

Definition at line 170 of file sch_item_struct.h.

Referenced by SCH_COMPONENT::Init(), SCH_FIELD::SCH_FIELD(), and SCH_NO_CONNECT::SCH_NO_CONNECT().

170 { m_Layer = aLayer; }
SCH_LAYER_ID m_Layer
void EDA_ITEM::SetList ( DHEAD aList)
inlineinherited

Definition at line 217 of file base_struct.h.

Referenced by DHEAD::append(), DHEAD::insert(), DHEAD::remove(), and SwapItemData().

217 { m_List = aList; }
DHEAD * m_List
which DLIST I am on.
Definition: base_struct.h:169
void EDA_ITEM::SetModified ( )
inherited
void SCH_SHEET::SetName ( const wxString &  aName)
inline

Definition at line 269 of file sch_sheet.h.

Referenced by SCH_EDIT_FRAME::AppendSchematic(), SCH_EDIT_FRAME::DuplicateItemsInList(), SCH_EDIT_FRAME::EditSheet(), and SCH_EDIT_FRAME::PasteListOfItems().

269 { m_name = aName; }
wxString m_name
This is equivalent to the reference designator for components and is stored in F0 sheet pin in the sc...
Definition: sch_sheet.h:226
void EDA_ITEM::SetNext ( EDA_ITEM aNext)
inlineinherited

Definition at line 214 of file base_struct.h.

Referenced by DHEAD::append(), DHEAD::insert(), SCH_EDIT_FRAME::PutDataInPreviousState(), DHEAD::remove(), and SwapItemData().

214 { Pnext = aNext; }
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:167
void SCH_SHEET::SetPosition ( const wxPoint &  aPosition)
overridevirtual

Function SetPosition set the schematic item position to aPosition.

Parameters
aPositionA reference to a wxPoint object containing the new position.

Implements SCH_ITEM.

Definition at line 728 of file sch_sheet.cpp.

References m_pos, and Move().

729 {
730  // Remember the sheet and all pin sheet positions must be
731  // modified. So use Move function to do that.
732  Move( aPosition - m_pos );
733 }
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
void Move(const wxPoint &aMoveVector) override
Function Move moves the item by aMoveVector to a new position.
Definition: sch_sheet.h:478
void SCH_SHEET::SetScreen ( SCH_SCREEN aScreen)

Set the SCH_SCREEN associated with this sheet to aScreen.

The screen reference counting is performed by SetScreen. If aScreen is not the same as the current screen, the current screen reference count is decremented and aScreen becomes the screen for the sheet. If the current screen reference count reaches zero, the current screen is deleted. NULL is a valid value for aScreen.

Parameters
aScreenThe new screen to associate with the sheet.

Definition at line 104 of file sch_sheet.cpp.

References SCH_SCREEN::DecRefCount(), SCH_SCREEN::GetRefCount(), SCH_SCREEN::IncRefCount(), and m_screen.

Referenced by SCH_EDIT_FRAME::CreateScreens(), SCH_EDIT_FRAME::CreateSheet(), SCH_EDIT_FRAME::EditSheet(), and SCH_LEGACY_PLUGIN::loadHierarchy().

105 {
106  if( aScreen == m_screen )
107  return;
108 
109  if( m_screen != NULL )
110  {
112 
113  if( m_screen->GetRefCount() == 0 )
114  {
115  delete m_screen;
116  m_screen = NULL;
117  }
118  }
119 
120  m_screen = aScreen;
121 
122  if( m_screen )
124 }
int GetRefCount() const
Definition: sch_screen.h:144
void DecRefCount()
Definition: sch_screen.cpp:137
SCH_SCREEN * m_screen
Screen that contains the physical data for the sheet.
Definition: sch_sheet.h:215
void IncRefCount()
Definition: sch_screen.cpp:131
void EDA_ITEM::SetSelected ( )
inlineinherited

Definition at line 230 of file base_struct.h.

References SELECTED, and EDA_ITEM::SetFlags().

Referenced by SELECTION_TOOL::highlight(), LIB_EDIT_FRAME::pasteClipboard(), and GERBVIEW_SELECTION_TOOL::selectVisually().

230 { SetFlags( SELECTED ); }
#define SELECTED
Definition: base_struct.h:121
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:256
void SCH_SHEET::SetSheetNameSize ( int  aSize)
inline

Definition at line 273 of file sch_sheet.h.

Referenced by SCH_EDIT_FRAME::EditSheet().

273 { m_sheetNameSize = aSize; }
int m_sheetNameSize
The height of the text used to draw the sheet name.
Definition: sch_sheet.h:229
void SCH_SHEET::SetSize ( const wxSize &  aSize)
inline

Definition at line 283 of file sch_sheet.h.

References SCH_TEXT::GetMsgPanelInfo().

283 { m_size = aSize; }
wxSize m_size
The size of the sheet.
Definition: sch_sheet.h:238
void EDA_ITEM::SetStatus ( STATUS_FLAGS  aStatus)
inlineinherited
void SCH_ITEM::SetStoredPos ( wxPoint  aPos)
inlineinherited

Definition at line 156 of file sch_item_struct.h.

Referenced by SCH_EDIT_FRAME::PrepareMoveItem().

156 { m_storedPos = aPos; }
wxPoint m_storedPos
a temporary variable used in some move commands to store a initial pos (of the item or mouse cursor) ...
void EDA_ITEM::SetTimeStamp ( timestamp_t  aNewTimeStamp)
inlineinherited

Definition at line 206 of file base_struct.h.

Referenced by PCB_BASE_FRAME::AddModuleToBoard(), BOARD_NETLIST_UPDATER::addNewComponent(), PCAD2KICAD::PCB_TEXT::AddToBoard(), PCAD2KICAD::PCB_LINE::AddToBoard(), PCAD2KICAD::PCB_ARC::AddToBoard(), PCAD2KICAD::PCB_PAD::AddToBoard(), PCAD2KICAD::PCB_POLYGON::AddToBoard(), PCAD2KICAD::PCB_MODULE::AddToBoard(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::Begin_Zone(), SCH_EDIT_FRAME::CreateSheet(), Diagnose(), SCH_EDIT_FRAME::DuplicateItemsInList(), DuplicateStruct(), DIALOG_FOOTPRINT_BOARD_EDITOR::EditFootprint(), EDIT_TOOL::editFootprintInFpEditor(), PCB_EDIT_FRAME::Exchange_Module(), PCB_IO::FootprintSave(), EDA_ITEM::initVars(), BOARD::InsertArea(), LEGACY_PLUGIN::loadMODULE(), LEGACY_PLUGIN::loadPCB_TARGET(), LEGACY_PLUGIN::loadPCB_TEXT(), EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::loadPolygon(), EAGLE_PLUGIN::loadSignals(), LEGACY_PLUGIN::loadTrackList(), EDA_ITEM::operator=(), EAGLE_PLUGIN::packageCircle(), EAGLE_PLUGIN::packagePolygon(), EAGLE_PLUGIN::packageRectangle(), EAGLE_PLUGIN::packageText(), PCB_PARSER::parseDIMENSION(), SCH_EDIT_FRAME::PasteListOfItems(), PCB_EDIT_FRAME::Process_Special_Functions(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), BOARD::ReplaceNetlist(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SHEET(), SCH_COMPONENT::SetTimeStamp(), SimilarLabelsDiagnose(), SwapItemData(), TestDuplicateSheetNames(), and DIALOG_ERC::TestErc().

206 { m_TimeStamp = aNewTimeStamp; }
timestamp_t m_TimeStamp
Time stamp used for logical links.
Definition: base_struct.h:172
void EDA_ITEM::SetWireImage ( )
inlineinherited

Definition at line 229 of file base_struct.h.

References IS_WIRE_IMAGE, and EDA_ITEM::SetFlags().

229 { SetFlags( IS_WIRE_IMAGE ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:256
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:118
static bool EDA_ITEM::Sort ( const EDA_ITEM aLeft,
const EDA_ITEM aRight 
)
inlinestaticinherited

Function Sort is a helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers.

Parameters
aLeftThe left hand item to compare.
aRightThe right hand item to compare.
Returns
True if aLeft is less than aRight.

Definition at line 483 of file base_struct.h.

References EDA_ITEM::Matches(), EDA_ITEM::operator=(), EDA_ITEM::ViewBBox(), and EDA_ITEM::ViewGetLayers().

Referenced by PART_LIB::GetEntryTypePowerNames().

483 { return *aLeft < *aRight; }
void SCH_SHEET::SwapData ( SCH_ITEM aItem)
overridevirtual

Function SwapData swap the internal data structures aItem with the schematic item.

Obviously, aItem must have the same type than me

Parameters
aItemThe item to swap the data structures with.

Reimplemented from SCH_ITEM.

Definition at line 148 of file sch_sheet.cpp.

References Format(), GetChars(), SCH_ITEM::GetClass(), m_fileNameSize, m_name, m_pins, m_pos, m_sheetNameSize, m_size, SCH_SHEET_T, EDA_ITEM::SetParent(), and EDA_ITEM::Type().

149 {
150  wxCHECK_RET( aItem->Type() == SCH_SHEET_T,
151  wxString::Format( wxT( "SCH_SHEET object cannot swap data with %s object." ),
152  GetChars( aItem->GetClass() ) ) );
153 
154  SCH_SHEET* sheet = ( SCH_SHEET* ) aItem;
155 
156  std::swap( m_pos, sheet->m_pos );
157  std::swap( m_size, sheet->m_size );
158  std::swap( m_name, sheet->m_name );
159  std::swap( m_sheetNameSize, sheet->m_sheetNameSize );
160  std::swap( m_fileNameSize, sheet->m_fileNameSize );
161  m_pins.swap( sheet->m_pins );
162 
163  // Ensure sheet labels have their .m_Parent member pointing really on their
164  // parent, after swapping.
165  for( SCH_SHEET_PIN& sheetPin : m_pins )
166  {
167  sheetPin.SetParent( this );
168  }
169 
170  for( SCH_SHEET_PIN& sheetPin : sheet->m_pins )
171  {
172  sheetPin.SetParent( sheet );
173  }
174 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
int m_sheetNameSize
The height of the text used to draw the sheet name.
Definition: sch_sheet.h:229
wxSize m_size
The size of the sheet.
Definition: sch_sheet.h:238
wxString m_name
This is equivalent to the reference designator for components and is stored in F0 sheet pin in the sc...
Definition: sch_sheet.h:226
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:216
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:61
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
int m_fileNameSize
The height of the text used to draw the file name.
Definition: sch_sheet.h:232
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
virtual wxString GetClass() const override
Function GetClass returns the class name.
KICAD_T EDA_ITEM::Type ( ) const
inlineinherited

Function Type()

returns the type of object. This attribute should never be changed after a constructor sets it, so there is no public "setter" method.

Returns
KICAD_T - the type of object.

Definition at line 201 of file base_struct.h.

References EDA_ITEM::m_StructType.

Referenced by Abort_Move_ModuleOutline(), abortMoveItem(), AbortPinMove(), MODULE::Add(), CN_CONNECTIVITY_ALGO::Add(), BOARD::Add(), CN_CLUSTER::Add(), PCB_EDIT_FRAME::Add45DegreeSegment(), SCH_SCREEN::addConnectedItemsToBlock(), POINT_EDITOR::addCorner(), SCH_EDIT_FRAME::addCurrentItemToScreen(), AddMenusForComponent(), AddMenusForEditComponent(), AddPin(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), CN_ITEM::AnchorCount(), PCB_EDIT_FRAME::Attribut_Track(), PCB_EDIT_FRAME::Begin_Route(), SCH_EDIT_FRAME::BeginSegment(), PCB_EDIT_FRAME::Block_Delete(), PCB_EDIT_FRAME::Block_Duplicate(), PCB_EDIT_FRAME::Block_Flip(), PCB_EDIT_FRAME::Block_Move(), PCB_EDIT_FRAME::Block_Rotate(), LIB_EDIT_FRAME::BlockCopySelectedItems(), HIERARCHY_NAVIG_DLG::buildHierarchyTree(), SCH_SCREENS::buildScreenList(), SCH_SHEET_LIST::BuildSheetList(), calcArea(), calcMaxArea(), POINT_EDITOR::canAddCorner(), SCH_JUNCTION::CanConnect(), SCH_NO_CONNECT::CanConnect(), SCH_BUS_WIRE_ENTRY::CanConnect(), SCH_LINE::CanConnect(), SCH_BUS_BUS_ENTRY::CanConnect(), SCH_LABEL::CanConnect(), SCH_GLOBALLABEL::CanConnect(), SCH_HIERLABEL::CanConnect(), CanConnect(), SCH_COMPONENT::CanConnect(), ROUTER_TOOL::CanInlineDrag(), SCH_SCREENS::ChangeSymbolLibNickname(), SCH_EDIT_FRAME::CheckListConnections(), CN_VISITOR::checkZoneItemConnection(), TEXTE_PCB::ClassOf(), EDGE_MODULE::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), PCB_TARGET::ClassOf(), TEXTE_MODULE::ClassOf(), DRAWSEGMENT::ClassOf(), ZONE_CONTAINER::ClassOf(), MARKER_PCB::ClassOf(), DIMENSION::ClassOf(), TRACK::ClassOf(), NETINFO_ITEM::ClassOf(), MODULE::ClassOf(), SCH_COMPONENT::ClassOf(), D_PAD::ClassOf(), BOARD::ClassOf(), VIA::ClassOf(), CleanupSheet(), Collect_TrackSegmentsToDrag(), LIB_BEZIER::compare(), LIB_CIRCLE::compare(), LIB_RECTANGLE::compare(), LIB_POLYLINE::compare(), LIB_TEXT::compare(), LIB_ARC::compare(), LIB_FIELD::compare(), LIB_PIN::compare(), ComponentCount(), GRID_HELPER::computeAnchors(), SCH_SCREEN::CountConnectedItems(), CountSheets(), MODULE::CoverageRatio(), LIB_EDIT_FRAME::CreateGraphicItem(), CINFO3D_VISU::createLayers(), BOARD::CreateLockPoint(), SCH_EDIT_FRAME::CreateNewText(), CINFO3D_VISU::createNewTrack(), PCB_EDIT_FRAME::createPopupMenuForTracks(), CreateRoutesSection(), PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), D_PAD::D_PAD(), FOOTPRINT_EDIT_FRAME::Delete_Edge_Module(), SCH_SCREENS::DeleteAllMarkers(), SCH_SCREEN::DeleteItem(), LIB_EDIT_FRAME::deleteItem(), SCH_EDIT_FRAME::DeleteItem(), DeleteNullTrackSegments(), PYTHON_ACTION_PLUGINS::deregister_action(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_ERC::DisplayERC_MarkersList(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), DRC::doTrackDrc(), DRC::doTrackKeepoutDrc(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::Draw(), KIGFX::PCB_PAINTER::Draw(), KIGFX::PCB_PAINTER::draw(), DrawMovePin(), DrawMovingBlockOutlines(), drawPickedItems(), CN_ITEM::Dump(), BOARD::Duplicate(), MODULE::Duplicate(), PCB_EDIT_FRAME::duplicateItems(), SCH_EDIT_FRAME::DuplicateItemsInList(), SCH_EDIT_FRAME::EditComponent(), SCH_EDIT_FRAME::EditComponentFieldText(), LIB_EDIT_FRAME::EditSymbolText(), EditToolSelectionFilter(), SCH_EDIT_FRAME::EndSegment(), PCB_EDIT_FRAME::EraseRedundantTrack(), ExitSheet(), find_vias_and_tracks_at(), SCH_EDIT_FRAME::FindComponentAndItem(), NETLIST_EXPORTER::findNextComponent(), NETLIST_EXPORTER::findNextComponentAndCreatePinList(), SCH_SHEET_PATH::FindNextItem(), SCH_SHEET_LIST::FindNextItem(), SCH_SHEET_PATH::FindPreviousItem(), SCH_SHEET_LIST::FindPreviousItem(), EDIT_TOOL::FootprintFilter(), FootprintWriteShape(), PCB_IO::Format(), PCB_IO::format(), FormatProbeItem(), POINT_EDITOR::get45DegConstrainer(), CN_ITEM::GetAnchor(), TRACK::GetBestInsertPoint(), BOARD_ITEM::GetBoard(), TRACK::GetBoundingBox(), BOARD_CONNECTED_ITEM::GetClearance(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), NETLIST_OBJECT::GetComponentParent(), SCH_SCREEN::GetConnection(), SCH_TEXT::GetConnectionPoints(), SCH_TEXT::GetEndPoints(), GetEndPoints(), GetFirstTrack(), GetFirstVia(), SCH_SCREEN::GetHierarchicalItems(), SCH_SCREENS::GetLibNicknames(), TEXTE_PCB::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), BOARD_CONNECTED_ITEM::GetNetClass(), CONNECTIVITY_DATA::GetNetItems(), LIB_PART::GetNextDrawItem(), DRAWSEGMENT::GetParentModule(), SCH_SCREEN::GetPin(), LIB_PART::GetPin(), SCH_COMPONENT::GetPinPhysicalPosition(), getRect(), SELECTION::GetTopLeftItem(), LIB_EDIT_FRAME::GlobalSetPins(), SELECTION_TOOL::guessSelectionCandidates(), hash_eda(), SCH_SCREENS::HasNoFullyDefinedLibIds(), HasUndefinedPins(), SELECTION_TOOL::highlight(), KIGFX::SCH_VIEW::HighlightItem(), SCH_EDIT_FRAME::ImportSheetPin(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), SCH_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), SCH_FIND_COLLECTOR::Inspect(), PCB_LAYER_COLLECTOR::Inspect(), ARRAY_CREATOR::Invoke(), SCH_COLLECTOR::IsNode(), TRACK::IsNull(), SCH_LINE::IsParallel(), SCH_SCREEN::IsTerminalPoint(), BOARD_ITEM::IsTrack(), itemIsIncludedByFilter(), CLIPBOARD_IO::Load(), PNS_PCBNEW_RULE_RESOLVER::localPadClearance(), SCH_EDIT_FRAME::LocateAndShowItem(), SCH_EDIT_FRAME::LocateItem(), LocatePathOfScreen(), Magnetize(), EDIT_POINTS_FACTORY::Make(), SCH_SCREEN::MarkConnections(), CN_CONNECTIVITY_ALGO::markItemNetAsDirty(), CONNECTIVITY_DATA::MarkItemNetAsDirty(), MarkItemsInBloc(), BOARD::MarkTrace(), TRACKS_CLEANER::mergeCollinearSegmentIfPossible(), TRACKS_CLEANER::MergeCollinearTracks(), SCH_LINE::MergeOverlap(), FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay(), moveItemWithMouseCursor(), MoveMarkedItems(), MoveMarkedItemsExactly(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), SCH_EDIT_FRAME::OnDragItem(), LIB_EDIT_FRAME::OnEditComponentProperties(), SCH_EDIT_FRAME::OnEditItem(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), SCH_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyCopyItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyDuplicateItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyFlipItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItem(), PCB_EDIT_FRAME::OnHotkeyMoveItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItemExact(), PCB_EDIT_FRAME::OnHotkeyPlaceItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyRotateItem(), PCB_EDIT_FRAME::OnHotkeyRotateItem(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftDClick(), LIB_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnMoveItem(), SCH_EDIT_FRAME::OnOpenLibraryEditor(), SCH_EDIT_FRAME::OnOrient(), FOOTPRINT_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRightClick(), LIB_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRotate(), POINT_EDITOR::OnSelectionChange(), SCH_LINE::operator<(), LIB_ITEM::operator<(), SCH_ITEM::operator<(), SCH_COMPONENT::operator<(), SCH_BITMAP::operator=(), operator=(), SCH_COMPONENT::operator=(), LIB_ITEM::operator==(), OrCell_Trace(), EDIT_TOOL::PadFilter(), BOARD_COMMIT::parentObject(), PCBNEW_CONTROL::PasteItemsFromClipboard(), SCH_EDIT_FRAME::PasteListOfItems(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), DRAWING_TOOL::PlaceImportedGraphics(), LIB_EDIT_FRAME::PlacePin(), SCH_FIELD::Plot(), BRDITEMS_PLOTTER::Plot_1_EdgeModule(), SCH_EDIT_FRAME::PrepareMoveItem(), GAL_ARRAY_CREATOR::prePushAction(), LIB_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), DIALOG_EXCHANGE_FOOTPRINTS::processMatchingModules(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_BASE_FRAME::RefreshItem(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), MODULE::Remove(), CN_CONNECTIVITY_ALGO::Remove(), BOARD::Remove(), POINT_EDITOR::removeCorner(), POINT_EDITOR::removeCornerCondition(), LIB_PART::RemoveDrawItem(), TRACKS_CLEANER::removeDuplicatesOfTrack(), RemovePin(), FOOTPRINT_EDIT_FRAME::RemoveStruct(), PCB_EDIT_FRAME::RemoveStruct(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_SCREEN::ReplaceWires(), PCB_BASE_FRAME::ResetTextSize(), SCH_EDIT_FRAME::ReSizeSheet(), BOARD_COMMIT::Revert(), SCH_TEXT::Rotate(), SCH_EDIT_FRAME::RotateField(), SCH_LEGACY_PLUGIN_CACHE::saveArc(), SCH_LEGACY_PLUGIN_CACHE::saveBezier(), SCH_LEGACY_PLUGIN_CACHE::saveCircle(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_LEGACY_PLUGIN_CACHE::savePolyLine(), SCH_LEGACY_PLUGIN_CACHE::saveRectangle(), SCH_LEGACY_PLUGIN_CACHE::saveText(), SCH_EDIT_FRAME::SaveUndoItemInUndoList(), SCH_EDIT_FRAME::SaveWireImage(), SCH_EDIT_FRAME::SchematicCleanUp(), SearchHierarchy(), SELECTION_TOOL::select(), SELECTION_TOOL::selectable(), SCH_SCREEN::SelectBlockItems(), PCB_EDIT_FRAME::SelectHighLight(), ITEM_PICKER::SetItem(), SetSchItemParent(), DIALOG_LABEL_EDITOR::SetTitle(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), PCB_EDIT_FRAME::Show_1_Ratsnest(), Show_MoveNode(), ShowClearance(), ShowNewTrackWhenMovingCursor(), SortByTimeStamp(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), LIB_EDIT_FRAME::StartMoveDrawSymbol(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), SCH_JUNCTION::SwapData(), SCH_NO_CONNECT::SwapData(), PCB_TARGET::SwapData(), SCH_BITMAP::SwapData(), SCH_FIELD::SwapData(), SCH_SHEET_PIN::SwapData(), TEXTE_PCB::SwapData(), DIMENSION::SwapData(), DRAWSEGMENT::SwapData(), TRACK::SwapData(), SwapData(), VIA::SwapData(), SCH_COMPONENT::SwapData(), ZONE_CONTAINER::SwapData(), MODULE::SwapData(), D_PAD::SwapData(), SwapItemData(), PCB_EDIT_FRAME::SwitchLayer(), TestDuplicateSheetNames(), TRACKS_CLEANER::testTrackEndpointDangling(), TEXTE_MODULE::TEXTE_MODULE(), AR_MATRIX::TraceSegmentPcb(), TraceSegmentPcb(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_LABEL_EDITOR::TransferDataToWindow(), SELECTION_TOOL::unhighlight(), SCH_SHEET_PATH::UpdateAllScreenReferences(), SCH_TEXT::UpdateDanglingState(), POINT_EDITOR::updateItem(), POINT_EDITOR::updatePoints(), PCB_BRIGHT_BOX::ViewDraw(), SCH_BUS_ENTRY_BASE::ViewGetLayers(), TRACK::Visit(), GERBER_DRAW_ITEM::Visit(), EDA_ITEM::Visit(), Visit(), and SCH_COMPONENT::Visit().

202  {
203  return m_StructType;
204  }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it...
Definition: base_struct.h:163
bool SCH_SHEET::UpdateDanglingState ( std::vector< DANGLING_END_ITEM > &  aItemList)
overridevirtual

Function IsDanglingStateChanged tests the schematic item to aItemList to check if it's dangling state has changed.

Note that the return value only true when the state of the test has changed. Use the IsDangling() method to get the current dangling state of the item. Some of the schematic objects cannot be tested for a dangling state, the default method always returns false. Only override the method if the item can be tested for a dangling state.

Parameters
aItemList- List of items to test item against.
Returns
True if the dangling state has changed from it's current setting.

Reimplemented from SCH_ITEM.

Definition at line 810 of file sch_sheet.cpp.

References GetPins().

Referenced by SCH_EDIT_FRAME::ReSizeSheet().

811 {
812  bool changed = false;
813 
814  for( SCH_SHEET_PIN& pinsheet : GetPins() )
815  changed |= pinsheet.UpdateDanglingState( aItemList );
816 
817  return changed;
818 }
SCH_SHEET_PINS & GetPins()
Definition: sch_sheet.h:334
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:61
const BOX2I EDA_ITEM::ViewBBox ( ) const
overridevirtualinherited

Function ViewBBox() returns the bounding box of the item covering all its layers.

Returns
BOX2I - the current bounding box

Implements KIGFX::VIEW_ITEM.

Reimplemented in D_PAD, MODULE, EDIT_POINTS, GERBER_DRAW_ITEM, TRACK, DRAWSEGMENT, DIMENSION, TEXTE_MODULE, KIGFX::WORKSHEET_VIEWITEM, MARKER_PCB, ROUTER_PREVIEW_ITEM, KIGFX::PREVIEW::CENTRELINE_RECT_ITEM, KIGFX::ORIGIN_VIEWITEM, KIGFX::PREVIEW::POLYGON_ITEM, KIGFX::PREVIEW::SELECTION_AREA, KIGFX::PREVIEW::RULER_ITEM, KIGFX::RATSNEST_VIEWITEM, BRIGHT_BOX, and KIGFX::PREVIEW::ARC_ASSISTANT.

Definition at line 265 of file base_struct.cpp.

References EDA_ITEM::GetBoundingBox().

Referenced by EDA_ITEM::Sort(), BRIGHT_BOX::ViewBBox(), DIMENSION::ViewBBox(), DRAWSEGMENT::ViewBBox(), BRIGHT_BOX::ViewDraw(), and COMMON_TOOLS::ZoomFitScreen().

266 {
267  // Basic fallback
268  return BOX2I( VECTOR2I( GetBoundingBox().GetOrigin() ),
269  VECTOR2I( GetBoundingBox().GetSize() ) );
270 }
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:520
VECTOR2< int > VECTOR2I
Definition: vector2d.h:587
virtual void KIGFX::VIEW_ITEM::ViewDraw ( int  aLayer,
VIEW aView 
) const
inlinevirtualinherited

Function ViewDraw() Draws the parts of the object belonging to layer aLayer.

viewDraw() is an alternative way for drawing objects if 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
aLayercurrent drawing layer
aViewpointer to the VIEW device we are drawing on

Reimplemented in EDIT_POINTS, KIGFX::WORKSHEET_VIEWITEM, ROUTER_PREVIEW_ITEM, KIGFX::VIEW_GROUP, KIGFX::PREVIEW::SELECTION_AREA, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM, KIGFX::VIEW_OVERLAY, KIGFX::ORIGIN_VIEWITEM, BRIGHT_BOX, KIGFX::PREVIEW::RULER_ITEM, KIGFX::RATSNEST_VIEWITEM, KIGFX::PREVIEW::ARC_ASSISTANT, and PCB_BRIGHT_BOX.

Definition at line 116 of file view_item.h.

References KIGFX::VIEW_ITEM::ViewGetLayers().

Referenced by KIGFX::VIEW::draw(), and KIGFX::VIEW::updateItemGeometry().

117  {}
void SCH_SHEET::ViewGetLayers ( int  aLayers[],
int &  aCount 
) const
overridevirtual

Function ViewGetLayers returns the layers the item is drawn on (which may be more than its "home" layer)

Reimplemented from SCH_ITEM.

Definition at line 427 of file sch_sheet.cpp.

References LAYER_HIERLABEL, LAYER_SHEET, and LAYER_SHEET_BACKGROUND.

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

Function ViewGetLOD() Returns 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
aLayercurrent drawing layer
aViewpointer 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 D_PAD, MODULE, VIA, GERBER_DRAW_ITEM, TRACK, TEXTE_MODULE, and EDGE_MODULE.

Definition at line 140 of file view_item.h.

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

141  {
142  // By default always show the item
143  return 0;
144  }
SEARCH_RESULT SCH_SHEET::Visit ( INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
overridevirtual

Function Visit may be re-implemented for each derived class in order to handle all the types given by its member data.

Implementations should call inspector->Inspect() on types in scanTypes[], and may use IterateForward() to do so on lists of such data.

Parameters
inspectorAn INSPECTOR instance to use in the inspection.
testDataArbitrary data used by the inspector.
scanTypesWhich KICAD_T types are of interest and the order is significant too, terminated by EOT.
Returns
SEARCH_RESULT SEARCH_QUIT if the Iterator is to stop the scan, else SCAN_CONTINUE, and determined by the inspector.

Reimplemented from EDA_ITEM.

Definition at line 843 of file sch_sheet.cpp.

References EOT, i, m_pins, SCH_SHEET_PIN_T, SEARCH_CONTINUE, SEARCH_QUIT, and EDA_ITEM::Type().

844 {
845  KICAD_T stype;
846 
847  for( const KICAD_T* p = aFilterTypes; (stype = *p) != EOT; ++p )
848  {
849  // If caller wants to inspect my type
850  if( stype == Type() )
851  {
852  if( SEARCH_QUIT == aInspector( this, NULL ) )
853  return SEARCH_QUIT;
854  }
855  else if( stype == SCH_SHEET_PIN_T )
856  {
857  // Test the sheet labels.
858  for( size_t i = 0; i < m_pins.size(); i++ )
859  {
860  if( SEARCH_QUIT == aInspector( &m_pins[ i ], this ) )
861  return SEARCH_QUIT;
862  }
863  }
864  }
865 
866  return SEARCH_CONTINUE;
867 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
size_t i
Definition: json11.cpp:597

Friends And Related Function Documentation

friend class SCH_SHEET_PIN
friend

Definition at line 211 of file sch_sheet.h.

Member Data Documentation

EDA_ITEMS SCH_ITEM::m_connections
protectedinherited

List of items connected to this item.

Definition at line 119 of file sch_item_struct.h.

Referenced by SCH_ITEM::~SCH_ITEM().

wxString SCH_SHEET::m_fileName
private

The file name is also in the SCH_SCREEN object associated with the sheet.

It is also needed here for loading after reading the sheet description from file.

Definition at line 222 of file sch_sheet.h.

Referenced by Draw(), GetBoundingBox(), GetFileName(), GetMsgPanelInfo(), Matches(), and SCH_SHEET().

int SCH_SHEET::m_fileNameSize
private

The height of the text used to draw the file name.

Definition at line 232 of file sch_sheet.h.

Referenced by Draw(), GetBoundingBox(), GetFileNamePosition(), operator=(), Plot(), SCH_SHEET(), and SwapData().

STATUS_FLAGS EDA_ITEM::m_Flags
protectedinherited

Flag bits for editing and other uses.

Definition at line 178 of file base_struct.h.

Referenced by LIB_CIRCLE::BeginEdit(), LIB_RECTANGLE::BeginEdit(), LIB_POLYLINE::BeginEdit(), LIB_TEXT::BeginEdit(), LIB_ARC::BeginEdit(), LIB_FIELD::BeginEdit(), LIB_CIRCLE::CalcEdit(), LIB_POLYLINE::CalcEdit(), LIB_RECTANGLE::CalcEdit(), LIB_TEXT::CalcEdit(), LIB_ARC::CalcEdit(), LIB_FIELD::CalcEdit(), LIB_PIN::CalcEdit(), LIB_TEXT::Clone(), LIB_CIRCLE::ContinueEdit(), LIB_RECTANGLE::ContinueEdit(), LIB_POLYLINE::ContinueEdit(), LIB_TEXT::ContinueEdit(), LIB_ARC::ContinueEdit(), LIB_FIELD::ContinueEdit(), SCH_LINE::Draw(), TRACK::Draw(), DRAWSEGMENT::Draw(), MODULE::Draw(), SEGZONE::Draw(), LIB_CIRCLE::drawGraphic(), LIB_POLYLINE::drawGraphic(), LIB_RECTANGLE::drawGraphic(), LIB_BEZIER::drawGraphic(), LIB_ARC::drawGraphic(), DRAWSEGMENT::DRAWSEGMENT(), LIB_CIRCLE::EndEdit(), LIB_RECTANGLE::EndEdit(), LIB_POLYLINE::EndEdit(), LIB_TEXT::EndEdit(), LIB_ARC::EndEdit(), LIB_ITEM::EndEdit(), LIB_FIELD::EndEdit(), EDA_ITEM::GetFlags(), TRACK::GetMsgPanelInfoBase_Common(), SCH_JUNCTION::HitTest(), SCH_LINE::HitTest(), GERBER_DRAW_ITEM::HitTest(), SCH_COMPONENT::HitTest(), LIB_ITEM::InEditMode(), EDA_ITEM::initVars(), SCH_ITEM::IsConnected(), SCH_LINE::Move(), EDA_ITEM::operator=(), SCH_COMPONENT::SCH_COMPONENT(), LIB_PIN::SetConversion(), LIB_PIN::SetLength(), LIB_PIN::SetName(), LIB_PIN::SetNameTextSize(), LIB_PIN::SetNumberTextSize(), LIB_PIN::SetOrientation(), LIB_PIN::SetPartNumber(), LIB_PIN::SetPinPosition(), LIB_PIN::SetShape(), LIB_PIN::SetType(), and LIB_PIN::SetVisible().

bool EDA_ITEM::m_forceVisible
protectedinherited

Set to true to override the visibility setting of the item.

Definition at line 175 of file base_struct.h.

Referenced by SCH_FIELD::Draw(), EDA_ITEM::initVars(), and EDA_ITEM::operator=().

DHEAD* EDA_ITEM::m_List
protectedinherited

which DLIST I am on.

Definition at line 169 of file base_struct.h.

Referenced by EDA_ITEM::GetList(), and EDA_ITEM::initVars().

wxString SCH_SHEET::m_name
private

This is equivalent to the reference designator for components and is stored in F0 sheet pin in the schematic file.

Definition at line 226 of file sch_sheet.h.

Referenced by Draw(), GetBoundingBox(), GetMsgPanelInfo(), GetSelectMenuText(), Matches(), operator=(), Plot(), RemovePin(), Replace(), SCH_SHEET(), and SwapData().

SCH_SCREEN* SCH_SHEET::m_screen
private

Screen that contains the physical data for the sheet.

In complex hierarchies multiple sheets can share a common screen.

Definition at line 215 of file sch_sheet.h.

Referenced by CleanupSheet(), ComponentCount(), CountSheets(), GetScreenCount(), HasUndefinedPins(), LocatePathOfScreen(), SCH_SHEET(), SearchHierarchy(), SetScreen(), and ~SCH_SHEET().

int SCH_SHEET::m_sheetNameSize
private

The height of the text used to draw the sheet name.

Definition at line 229 of file sch_sheet.h.

Referenced by Draw(), GetBoundingBox(), GetSheetNamePosition(), operator=(), Plot(), SCH_SHEET(), and SwapData().

wxPoint SCH_ITEM::m_storedPos
protectedinherited

a temporary variable used in some move commands

to store a initial pos (of the item or mouse cursor)

Definition at line 120 of file sch_item_struct.h.

timestamp_t EDA_ITEM::m_TimeStamp
protectedinherited
EDA_ITEM* EDA_ITEM::Pback
protectedinherited

previous in linked list

Definition at line 168 of file base_struct.h.

Referenced by SCH_LINE::Back(), TRACK::Back(), BOARD_ITEM::Back(), EDA_ITEM::Back(), EDA_ITEM::initVars(), and TRACK::SetBack().


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