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 (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 IsDanglingStateChanged (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 IsDangling () const override
 
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...
 
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 () 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)
 
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
 
wxPointGetStoredPos ()
 
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...
 
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 (time_t aNewTimeStamp)
 
time_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
 
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 ViewGetLayers (int aLayers[], int &aCount) const override
 Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on. 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 std::string FormatInternalUnits (int aValue)
 Function FormatInternalUnits converts aValue from schematic internal units to a string appropriate for writing to file. More...
 
static std::string FormatInternalUnits (const wxPoint &aPoint)
 
static std::string FormatInternalUnits (const wxSize &aSize)
 
static std::string FormatAngle (double aAngle)
 Function FormatAngle converts aAngle from board units to a string appropriate for writing to file. More...
 
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...
 
time_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 46 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().

46  :
47  SCH_ITEM( NULL, SCH_SHEET_T )
48 {
50  m_pos = pos;
55  m_screen = NULL;
56  m_name.Printf( wxT( "Sheet%8.8lX" ), (long) m_TimeStamp );
57  m_fileName.Printf( wxT( "file%8.8lX.sch" ), (long) m_TimeStamp );
58 }
SCH_LAYER_ID m_Layer
time_t m_TimeStamp
Time stamp used for logical links.
Definition: base_struct.h:183
int m_sheetNameSize
The height of the text used to draw the sheet name.
Definition: sch_sheet.h:229
time_t GetNewTimeStamp()
Definition: common.cpp:166
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
void SetTimeStamp(time_t aNewTimeStamp)
Definition: base_struct.h:217
wxString m_fileName
The file name is also in the SCH_SCREEN object associated with the sheet.
Definition: sch_sheet.h:222
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.
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 61 of file sch_sheet.cpp.

References 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().

61  :
62  SCH_ITEM( aSheet )
63 {
64  m_pos = aSheet.m_pos;
65  m_size = aSheet.m_size;
66  m_Layer = aSheet.m_Layer;
67  SetTimeStamp( aSheet.m_TimeStamp );
70  m_screen = aSheet.m_screen;
71  m_name = aSheet.m_name;
72  m_fileName = aSheet.m_fileName;
73  m_pins = aSheet.m_pins;
74 
75  for( size_t i = 0; i < m_pins.size(); i++ )
76  m_pins[i].SetParent( this );
77 
78  if( m_screen )
80 }
SCH_LAYER_ID m_Layer
time_t m_TimeStamp
Time stamp used for logical links.
Definition: base_struct.h:183
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 SetTimeStamp(time_t aNewTimeStamp)
Definition: base_struct.h:217
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:227
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
SCH_SCREEN * m_screen
Screen that contains the physical data for the sheet.
Definition: sch_sheet.h:215
void IncRefCount()
Definition: sch_screen.cpp:125
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType)
SCH_SHEET::~SCH_SHEET ( )

Definition at line 83 of file sch_sheet.cpp.

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

84 {
85  // also, look at the associated sheet & its reference count
86  // perhaps it should be deleted also.
87  if( m_screen )
88  {
90 
91  if( m_screen->GetRefCount() == 0 )
92  delete m_screen;
93  }
94 }
int GetRefCount() const
void DecRefCount()
Definition: sch_screen.cpp:131
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 176 of file sch_sheet.cpp.

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

177 {
178  wxASSERT( aSheetPin != NULL );
179  wxASSERT( aSheetPin->Type() == SCH_SHEET_PIN_T );
180 
181  m_pins.push_back( aSheetPin );
182  renumberPins();
183 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212
void renumberPins()
Renumber the sheet pins in the sheet.
Definition: sch_sheet.cpp:767
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 148 of file sch_item_struct.h.

References EDA_ITEM::Pback.

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

148 { return static_cast<SCH_ITEM*>( Pback ); }
EDA_ITEM * Pback
previous in linked list
Definition: base_struct.h:179
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
virtual bool SCH_ITEM::CanIncrementLabel ( ) const
inlinevirtualinherited

Reimplemented in SCH_TEXT.

Definition at line 340 of file sch_item_struct.h.

Referenced by SCH_EDIT_FRAME::RepeatDrawItem().

340 { 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 339 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 SCH_EDIT_FRAME::Process_Special_Functions().

340 {
341  SCH_SHEET_PINS::iterator i = m_pins.begin();
342 
343  while( i != m_pins.end() )
344  {
345  /* Search the schematic for a hierarchical label corresponding to this sheet label. */
346  EDA_ITEM* DrawStruct = m_screen->GetDrawItems();
347  const SCH_HIERLABEL* HLabel = NULL;
348 
349  for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Next() )
350  {
351  if( DrawStruct->Type() != SCH_HIERARCHICAL_LABEL_T )
352  continue;
353 
354  HLabel = static_cast<SCH_HIERLABEL*>( DrawStruct );
355 
356  if( i->GetText().CmpNoCase( HLabel->GetText() ) == 0 )
357  break; // Found!
358 
359  HLabel = NULL;
360  }
361 
362  if( HLabel == NULL ) // Hlabel not found: delete sheet label.
363  i = m_pins.erase( i );
364  else
365  ++i;
366  }
367 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212
EDA_ITEM * Next() const
Definition: base_struct.h:220
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:130
SCH_ITEM * GetDrawItems() const
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:165
void EDA_ITEM::ClearBrightened ( )
inlineinherited

Definition at line 247 of file base_struct.h.

References BRIGHTENED, and EDA_ITEM::ClearFlags().

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

247 { ClearFlags( BRIGHTENED ); }
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:151
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:268
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 300 of file sch_item_struct.h.

300 { 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 268 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(), abortMoveBitmap(), AbortMoveDimensionText(), abortMoveItem(), AbortMoveTextModule(), AbortPinMove(), SCH_SCREEN::addConnectedItemsToBlock(), SCH_EDIT_FRAME::addCurrentItemToList(), 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(), PCB_EDIT_FRAME::Change_Side_Module(), SCH_SCREEN::ClearAnnotation(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearHighlighted(), ClearMarkItems(), clearModuleItemFlags(), EDA_ITEM::ClearSelected(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::copyBlockItems(), CopyMarkedItems(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), MWAVE::CreateMicrowaveInductor(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), PCB_EDIT_FRAME::Delete_LastCreatedCorner(), PCB_EDIT_FRAME::Delete_Segment_Edge(), LIB_PART::DeleteSelectedItems(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), 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_Zone(), SCH_EDIT_FRAME::EndSegment(), PCB_EDIT_FRAME::Exchange_Module(), ExitSheet(), SCH_SCREEN::GetConnection(), PCB_BASE_FRAME::GlobalChange_PadSettings(), 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(), SCH_EAGLE_PLUGIN::loadSheet(), MarkItemsInBloc(), MirrorX(), MirrorY(), moveBitmap(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), LIB_EDIT_FRAME::OnEditPin(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnRotateItem(), 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(), PCBNEW_CONTROL::placeBoardItems(), 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(), EDIT_TOOL::Properties(), 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(), LIB_PIN::Save(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), FOOTPRINT_VIEWER_FRAME::SelectCurrentFootprint(), SCH_EDIT_FRAME::SetRepeatItem(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

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

Definition at line 246 of file base_struct.h.

References EDA_ITEM::ClearFlags(), and HIGHLIGHTED.

246 { ClearFlags( HIGHLIGHTED ); }
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:150
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:268
void EDA_ITEM::ClearSelected ( )
inlineinherited
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 97 of file sch_sheet.cpp.

References SCH_SHEET().

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

Count our own components, without the power components.

Returns
the component count.

Definition at line 532 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().

533 {
534  int n = 0;
535 
536  if( m_screen )
537  {
538  EDA_ITEM* bs;
539 
540  for( bs = m_screen->GetDrawItems(); bs != NULL; bs = bs->Next() )
541  {
542  if( bs->Type() == SCH_COMPONENT_T )
543  {
544  SCH_COMPONENT* Cmp = (SCH_COMPONENT*) bs;
545 
546  if( Cmp->GetField( VALUE )->GetText().GetChar( 0 ) != '#' )
547  n++;
548  }
549 
550  if( bs->Type() == SCH_SHEET_T )
551  {
552  SCH_SHEET* sheet = (SCH_SHEET*) bs;
553  n += sheet->ComponentCount();
554  }
555  }
556  }
557 
558  return n;
559 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212
int ComponentCount()
Count our own components, without the power components.
Definition: sch_sheet.cpp:532
EDA_ITEM * Next() const
Definition: base_struct.h:220
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:130
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
Field Value of part, i.e. "3.3K".
SCH_ITEM * GetDrawItems() const
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:69
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:165
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 624 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(), and SCH_EDIT_FRAME::SetSheetNumberAndCount().

625 {
626  int count = 1; //1 = this!!
627 
628  if( m_screen )
629  {
630  EDA_ITEM* strct = m_screen->GetDrawItems();
631 
632  for( ; strct; strct = strct->Next() )
633  {
634  if( strct->Type() == SCH_SHEET_T )
635  {
636  SCH_SHEET* subsheet = (SCH_SHEET*) strct;
637  count += subsheet->CountSheets();
638  }
639  }
640  }
641  return count;
642 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212
int CountSheets()
Count the number of sheets found in "this" sheet includeing all of the subsheets. ...
Definition: sch_sheet.cpp:624
EDA_ITEM * Next() const
Definition: base_struct.h:220
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
SCH_ITEM * GetDrawItems() const
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:165
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 425 of file sch_sheet.cpp.

References boundingBox(), BROWN, 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, TEXT_ANGLE_VERT, wxPoint::x, and wxPoint::y.

Referenced by resizeSheetWithMouseCursor().

427 {
428  COLOR4D txtcolor;
429  wxString Text;
430  COLOR4D color;
431  int name_orientation;
432  wxPoint pos_sheetname,pos_filename;
433  wxPoint pos = m_pos + aOffset;
434  int lineWidth = GetPenSize();
435  EDA_RECT* clipbox = aPanel? aPanel->GetClipBox() : NULL;
436 
437  if( aColor != COLOR4D::UNSPECIFIED )
438  color = aColor;
439  else
440  color = GetLayerColor( m_Layer );
441 
442  GRSetDrawMode( aDC, aDrawMode );
443 
444  GRRect( clipbox, aDC, pos.x, pos.y,
445  pos.x + m_size.x, pos.y + m_size.y, lineWidth, color );
446 
447  pos_sheetname = GetSheetNamePosition() + aOffset;
448  pos_filename = GetFileNamePosition() + aOffset;
449 
450  if( IsVerticalOrientation() )
451  name_orientation = TEXT_ANGLE_VERT;
452  else
453  name_orientation = TEXT_ANGLE_HORIZ;
454 
455  /* Draw text : SheetName */
456  if( aColor != COLOR4D::UNSPECIFIED )
457  txtcolor = aColor;
458  else
459  txtcolor = GetLayerColor( LAYER_SHEETNAME );
460 
461  Text = wxT( "Sheet: " ) + m_name;
462  DrawGraphicText( clipbox, aDC, pos_sheetname,
463  txtcolor, Text, name_orientation,
464  wxSize( m_sheetNameSize, m_sheetNameSize ),
466  false, false );
467 
468  /* Draw text : FileName */
469  if( aColor != COLOR4D::UNSPECIFIED )
470  txtcolor = aColor;
471  else
472  txtcolor = GetLayerColor( LAYER_SHEETFILENAME );
473 
474  Text = wxT( "File: " ) + m_fileName;
475  DrawGraphicText( clipbox, aDC, pos_filename,
476  txtcolor, Text, name_orientation,
477  wxSize( m_fileNameSize, m_fileNameSize ),
479  false, false );
480 
481  /* Draw text : SheetLabel */
482  for( SCH_SHEET_PIN& sheetPin : m_pins )
483  {
484  if( !sheetPin.IsMoving() )
485  sheetPin.Draw( aPanel, aDC, aOffset, aDrawMode, aColor );
486  }
487 
488 
489 #if 0
490  // Only for testing purposes, draw the component bounding box
492  GRRect( aPanel->GetClipBox(), aDC, boundingBox, 0, BROWN );
493  GRFilledCircle( aPanel->GetClipBox(), aDC, m_pos.x, m_pos.y, 10, 0, color, color );
494 #endif
495 }
#define TEXT_ANGLE_HORIZ
Frequent text rotations, used with {Set,Get}TextAngle(), in 0.1 degrees for now, hoping to migrate to...
Definition: common.h:90
SCH_LAYER_ID m_Layer
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), PLOTTER *aPlotter)
Function DrawGraphicText Draw a graphic text (like module texts)
Definition: drawtxt.cpp:122
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
Definition: gr_basic.cpp:296
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
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
Definition: eeschema.cpp:167
int GetPenSize() const override
Function GetPenSize virtual pure.
Definition: sch_sheet.cpp:382
void GRFilledCircle(EDA_RECT *ClipBox, wxDC *DC, int x, int y, int r, int width, COLOR4D Color, COLOR4D BgColor)
Definition: gr_basic.cpp:851
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
#define TEXT_ANGLE_VERT
Definition: common.h:91
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:1076
EDA_RECT const GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
Definition: sch_sheet.cpp:498
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
EDA_RECT * GetClipBox()
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:61
wxPoint GetFileNamePosition()
Definition: sch_sheet.cpp:406
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:388
Class EDA_RECT handles the component boundary box.
bool IsVerticalOrientation() const
Definition: sch_sheet.cpp:220
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
Definition: colors.h:62
std::string SCH_ITEM::FormatAngle ( double  aAngle)
staticinherited

Function FormatAngle converts aAngle from board units to a string appropriate for writing to file.

Note
Internal angles for board items can be either degrees or tenths of degree on how KiCad is built.
Parameters
aAngleA angle value to convert.
Returns
A std::string object containing the converted angle.

Definition at line 124 of file sch_item_struct.cpp.

125 {
126  char temp[50];
127  int len;
128 
129  len = snprintf( temp, sizeof(temp), "%.10g", aAngle / 10.0 );
130 
131  return std::string( temp, len );
132 }
std::string SCH_ITEM::FormatInternalUnits ( int  aValue)
staticinherited

Function FormatInternalUnits converts aValue from schematic internal units to a string appropriate for writing to file.

Parameters
aValueA coordinate value to convert.
Returns
A std::string object containing the converted value.

Definition at line 100 of file sch_item_struct.cpp.

Referenced by SCH_ITEM::FormatInternalUnits().

101 {
102  char buf[50];
103  double engUnits = aValue;
104  int len;
105 
106  if( engUnits != 0.0 && fabs( engUnits ) <= 0.0001 )
107  {
108  len = snprintf( buf, sizeof(buf), "%.10f", engUnits );
109 
110  while( --len > 0 && buf[len] == '0' )
111  buf[len] = '\0';
112 
113  ++len;
114  }
115  else
116  {
117  len = snprintf( buf, sizeof(buf), "%.10g", engUnits );
118  }
119 
120  return std::string( buf, len );
121 }
std::string SCH_ITEM::FormatInternalUnits ( const wxPoint aPoint)
staticinherited

Definition at line 135 of file sch_item_struct.cpp.

References SCH_ITEM::FormatInternalUnits(), wxPoint::x, and wxPoint::y.

136 {
137  return FormatInternalUnits( aPoint.x ) + " " + FormatInternalUnits( aPoint.y );
138 }
static std::string FormatInternalUnits(int aValue)
Function FormatInternalUnits converts aValue from schematic internal units to a string appropriate fo...
std::string SCH_ITEM::FormatInternalUnits ( const wxSize &  aSize)
staticinherited

Definition at line 141 of file sch_item_struct.cpp.

References SCH_ITEM::FormatInternalUnits().

142 {
143  return FormatInternalUnits( aSize.GetWidth() ) + " " + FormatInternalUnits( aSize.GetHeight() );
144 }
static std::string FormatInternalUnits(int aValue)
Function FormatInternalUnits converts aValue from schematic internal units to a string appropriate fo...
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 498 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(), EDA_RECT::SetY(), wxPoint::x, and wxPoint::y.

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

499 {
500  wxPoint end;
501  EDA_RECT box( m_pos, m_size );
502  int lineWidth = GetPenSize();
503 
504  // Determine length of texts
505  wxString text = wxT( "Sheet: " ) + m_name;
506  int textlen = GraphicTextWidth( text, wxSize( m_sheetNameSize, m_sheetNameSize ),
507  false, false );
508 
509  text = wxT( "File: " ) + m_fileName;
510  int textlen2 = GraphicTextWidth( text, wxSize( m_fileNameSize, m_fileNameSize ),
511  false, false );
512 
513  // Calculate bounding box X size:
514  textlen = std::max( textlen, textlen2 );
515  end.x = std::max( m_size.x, textlen );
516 
517  // Calculate bounding box pos:
518  end.y = m_size.y;
519  end += m_pos;
520 
521  // Move upper and lower limits to include texts:
522  box.SetY( box.GetY() - ( KiROUND( m_sheetNameSize * 1.3 ) + 8 ) );
523  end.y += KiROUND( m_fileNameSize * 1.3 ) + 8;
524 
525  box.SetEnd( end );
526  box.Inflate( lineWidth / 2 );
527 
528  return box;
529 }
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:106
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:382
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.
Definition: drawtxt.cpp:88
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.
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 834 of file sch_sheet.cpp.

References GetPins(), and GetPosition().

835 {
836  for( size_t i = 0; i < GetPins().size(); i++ )
837  aPoints.push_back( GetPins()[i].GetPosition() );
838 }
SCH_SHEET_PINS & GetPins()
Definition: sch_sheet.h:334
wxPoint GetPosition() const override
Function GetPosition.
Definition: sch_sheet.h:540
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 779 of file sch_sheet.cpp.

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

780 {
781  for( unsigned ii = 0; ii < GetPins().size(); ii++ )
782  {
783  SCH_SHEET_PIN &pinsheet = GetPins()[ii];
784 
785  wxCHECK2_MSG( pinsheet.Type() == SCH_SHEET_PIN_T, continue,
786  wxT( "Invalid item in schematic sheet pin list. Bad programmer!" ) );
787 
788  pinsheet.GetEndPoints( aItemList );
789  }
790 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212
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

Return the filename corresponding to this sheet.

Returns
a wxString containing the filename

Definition at line 645 of file sch_sheet.cpp.

References m_fileName.

Referenced by SCH_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::EditSheet(), SCH_LEGACY_PLUGIN::loadHierarchy(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), SCH_EDIT_FRAME::OnSaveProject(), SCH_EDIT_FRAME::PasteListOfItems(), Plot(), SCH_LEGACY_PLUGIN::saveSheet(), SCH_SHEET_PATH::TestForRecursion(), and SCH_SHEET_LIST::TestForRecursion().

646 {
647  return m_fileName;
648 }
wxString m_fileName
The file name is also in the SCH_SCREEN object associated with the sheet.
Definition: sch_sheet.h:222
wxPoint SCH_SHEET::GetFileNamePosition ( )
Returns
the position of the anchor of filename text

Definition at line 406 of file sch_sheet.cpp.

References GetPenSize(), IsVerticalOrientation(), m_pos, m_size, wxPoint::x, and wxPoint::y.

Referenced by Draw(), and Matches().

407 {
408  wxPoint pos = m_pos;
409  int margin = GetPenSize() + 4;
410 
411  if( IsVerticalOrientation() )
412  {
413  pos.x += m_size.x + margin;
414  pos.y += m_size.y;
415  }
416  else
417  {
418  pos.y += m_size.y + margin;
419  }
420 
421  return pos;
422 }
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:382
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
bool IsVerticalOrientation() const
Definition: sch_sheet.cpp:220
int SCH_SHEET::GetFileNameSize ( ) const
inline

Definition at line 275 of file sch_sheet.h.

References m_fileNameSize.

Referenced by SCH_EDIT_FRAME::EditSheet(), and SCH_LEGACY_PLUGIN::saveSheet().

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 269 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(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), 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(), 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(), SCH_SCREEN::GetConnection(), InitialiseDragParameters(), EDA_DRAW_FRAME::isBusy(), LIB_EDIT_FRAME::LoadOneSymbol(), Magnetize(), SCH_EDIT_FRAME::MirrorImage(), SCH_EDIT_FRAME::MirrorSheet(), moveBitmap(), 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(), SCH_EDIT_FRAME::OnMoveItem(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick(), TARGET_PROPERTIES_DIALOG_EDITOR::OnOkClick(), 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(), PCBNEW_CONTROL::placeBoardItems(), PCB_EDIT_FRAME::PlaceTarget(), FOOTPRINT_EDIT_FRAME::PrepareItemForHotkey(), LIB_EDIT_FRAME::Process_Special_Functions(), EDIT_TOOL::Properties(), 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(), SCH_EDIT_FRAME::SaveCopyInUndoList(), SCH_SCREEN::SelectBlockItems(), SCH_EDIT_FRAME::SetBusEntryShape(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp(), Show_Drag_Track_Segment_With_Cte_Slope(), Show_MoveNode(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), DIALOG_LABEL_EDITOR::TextPropertiesAccept(), DIALOG_PCB_TEXT_PROPERTIES::TransferDataFromWindow(), and DIALOG_MODULE_BOARD_EDITOR::TransferDataFromWindow().

269 { return m_Flags; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:189
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 300 of file sch_sheet.cpp.

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

Referenced by resizeSheetWithMouseCursor().

301 {
302  int height = MIN_SHEET_HEIGHT;
303 
304  for( size_t i = 0; i < m_pins.size(); i++ )
305  {
306  int edge = m_pins[i].GetEdge();
307  EDA_RECT pinRect = m_pins[i].GetBoundingBox();
308 
309  // Make sure pin is on top or bottom side of sheet.
311  {
312  if( height < pinRect.GetBottom() - m_pos.y )
313  height = pinRect.GetBottom() - m_pos.y;
314  }
315  else
316  {
317  if( height < pinRect.GetHeight() )
318  height = pinRect.GetHeight();
319 
320  for( size_t j = 0; j < m_pins.size(); j++ )
321  {
322  // Check for pin directly above or below the current pin.
323  if( (i == j) || (m_pins[i].GetPosition().x != m_pins[j].GetPosition().x) )
324  continue;
325 
326  if( height < pinRect.GetHeight() + m_pins[j].GetBoundingBox().GetHeight() )
327  {
328  height = pinRect.GetHeight() + m_pins[j].GetBoundingBox().GetHeight();
329  break;
330  }
331  }
332  }
333  }
334 
335  return height;
336 }
int GetHeight() const
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
Class EDA_RECT handles the component boundary box.
#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 260 of file sch_sheet.cpp.

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

Referenced by resizeSheetWithMouseCursor().

261 {
262  int width = MIN_SHEET_WIDTH;
263 
264  for( size_t i = 0; i < m_pins.size(); i++ )
265  {
266  int edge = m_pins[i].GetEdge();
267  EDA_RECT pinRect = m_pins[i].GetBoundingBox();
268 
269  wxASSERT( edge != SCH_SHEET_PIN::SHEET_UNDEFINED_SIDE );
270 
272  {
273  if( width < pinRect.GetRight() - m_pos.x )
274  width = pinRect.GetRight() - m_pos.x;
275  }
276  else
277  {
278  if( width < pinRect.GetWidth() )
279  width = pinRect.GetWidth();
280 
281  for( size_t j = 0; j < m_pins.size(); j++ )
282  {
283  // Check for pin directly across from the current pin.
284  if( (i == j) || (m_pins[i].GetPosition().y != m_pins[j].GetPosition().y) )
285  continue;
286 
287  if( width < pinRect.GetWidth() + m_pins[j].GetBoundingBox().GetWidth() )
288  {
289  width = pinRect.GetWidth() + m_pins[j].GetBoundingBox().GetWidth();
290  break;
291  }
292  }
293  }
294  }
295 
296  return width;
297 }
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
Class EDA_RECT handles the component boundary box.
int GetWidth() const
void SCH_SHEET::GetMsgPanelInfo ( 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 651 of file sch_sheet.cpp.

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

652 {
653  aList.push_back( MSG_PANEL_ITEM( _( "Sheet Name" ), m_name, CYAN ) );
654  aList.push_back( MSG_PANEL_ITEM( _( "File Name" ), m_fileName, BROWN ) );
655 
656 #if 0 // Set to 1 to display the sheet time stamp (mainly for test)
657  wxString msg;
658  msg.Printf( wxT( "%.8X" ), m_TimeStamp );
659  aList.push_back( MSG_PANEL_ITEM( _( "Time Stamp" ), msg, BLUE ) );
660 #endif
661 }
Definition: colors.h:57
time_t m_TimeStamp
Time stamp used for logical links.
Definition: base_struct.h:183
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.

References m_name.

Referenced by HIERARCHY_NAVIG_DLG::BuildTree(), SCH_EDIT_FRAME::EditSheet(), SCH_SCREEN::GetSheet(), and SCH_LEGACY_PLUGIN::saveSheet().

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(), 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 }
bool IsBusLabel(const wxString &aLabel)
Function IsBusLabel test if aLabel has a bus notation.
SCH_SHEET_PATH m_SheetPathInclude
SCH_SHEET_PATH m_SheetPath
NETLIST_ITEM_T m_Type
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.
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 382 of file sch_sheet.cpp.

References GetDefaultLineThickness().

Referenced by Draw(), GetBoundingBox(), GetFileNamePosition(), and Plot().

383 {
384  return GetDefaultLineThickness();
385 }
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 370 of file sch_sheet.cpp.

References m_pins.

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

371 {
372  for( SCH_SHEET_PIN& pin : m_pins )
373  {
374  if( pin.HitTest( aPosition, 0 ) )
375  return &pin;
376  }
377 
378  return NULL;
379 }
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.

References m_pins.

Referenced by GetConnectionPoints(), GetEndPoints(), IsDangling(), IsDanglingStateChanged(), and SCH_LEGACY_PLUGIN::saveSheet().

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.

References m_pins.

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 540 of file sch_sheet.h.

References m_pos.

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

540 { 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, m_size, wxPoint::x, and wxPoint::y.

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 135 of file sch_sheet.cpp.

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

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

136 {
137  SCH_SHEET* sheet = dynamic_cast< SCH_SHEET* >( GetParent() );
138 
139  if( sheet == NULL )
140  return this;
141 
142  // Recurse until a sheet is found with no parent which is the root sheet.
143  return sheet->GetRootSheet();
144 }
EDA_ITEM * GetParent() const
Definition: base_struct.h:222
SCH_SHEET * GetRootSheet()
Return the root sheet of this SCH_SHEET object.
Definition: sch_sheet.cpp:135
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 126 of file sch_sheet.cpp.

References SCH_SCREEN::GetRefCount(), and m_screen.

Referenced by SCH_EDIT_FRAME::EditSheet().

127 {
128  if( m_screen == NULL )
129  return 0;
130 
131  return m_screen->GetRefCount();
132 }
int GetRefCount() const
SCH_SCREEN * m_screen
Screen that contains the physical data for the sheet.
Definition: sch_sheet.h:215
wxString SCH_SHEET::GetSelectMenuText ( ) 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 868 of file sch_sheet.cpp.

References GetChars(), and m_name.

Referenced by Matches().

869 {
870  wxString tmp;
871  tmp.Printf( _( "Hierarchical Sheet %s" ), GetChars( m_name ) );
872  return tmp;
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
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
wxPoint SCH_SHEET::GetSheetNamePosition ( )
Returns
the position of the anchor of sheet name text

Definition at line 388 of file sch_sheet.cpp.

References IsVerticalOrientation(), m_pos, m_size, wxPoint::x, and wxPoint::y.

Referenced by Draw(), and Matches().

389 {
390  wxPoint pos = m_pos;
391 
392  if( IsVerticalOrientation() )
393  {
394  pos.x -= 8;
395  pos.y += m_size.y;
396  }
397  else
398  {
399  pos.y -= 8;
400  }
401 
402  return pos;
403 }
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
bool IsVerticalOrientation() const
Definition: sch_sheet.cpp:220
int SCH_SHEET::GetSheetNameSize ( ) const
inline

Definition at line 271 of file sch_sheet.h.

References m_sheetNameSize.

Referenced by SCH_EDIT_FRAME::EditSheet(), and SCH_LEGACY_PLUGIN::saveSheet().

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.

References m_size.

Referenced by 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 264 of file base_struct.h.

References EDA_ITEM::m_Status.

Referenced by PCB_IO::format().

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

Definition at line 159 of file sch_item_struct.h.

References SCH_ITEM::m_storedPos.

Referenced by moveItemWithMouseCursor().

159 { 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) ...
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 208 of file sch_sheet.cpp.

References m_pins.

Referenced by SCH_EDIT_FRAME::ImportSheetPin().

209 {
210  for( SCH_SHEET_PIN pin : m_pins )
211  {
212  if( pin.GetText().CmpNoCase( aName ) == 0 )
213  return true;
214  }
215 
216  return false;
217 }
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.

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 231 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().

232 {
233  for( SCH_SHEET_PIN pin : m_pins )
234  {
235  /* Search the schematic for a hierarchical label corresponding to this sheet label. */
236  EDA_ITEM* DrawStruct = m_screen->GetDrawItems();
237  const SCH_HIERLABEL* HLabel = NULL;
238 
239  for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Next() )
240  {
241  if( DrawStruct->Type() != SCH_HIERARCHICAL_LABEL_T )
242  continue;
243 
244  HLabel = static_cast<SCH_HIERLABEL*>( DrawStruct );
245 
246  if( pin.GetText().CmpNoCase( HLabel->GetText() ) == 0 )
247  break; // Found!
248 
249  HLabel = NULL;
250  }
251 
252  if( HLabel == NULL ) // Corresponding hierarchical label not found.
253  return true;
254  }
255 
256  return false;
257 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212
EDA_ITEM * Next() const
Definition: base_struct.h:220
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:130
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:61
SCH_ITEM * GetDrawItems() const
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:165
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 311 of file sch_item_struct.h.

312  {
313  return HitTest( aPosition, 0 );
314  }
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:498
Class EDA_RECT handles the component boundary box.
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:498
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
Class EDA_RECT handles the component boundary box.
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 238 of file base_struct.h.

References BRIGHTENED.

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

238 { return m_Flags & BRIGHTENED; }
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:151
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:189
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 525 of file sch_sheet.h.

525 { 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 72 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().

73 {
75  return false;
76 
77  return doIsConnected( aPosition );
78 }
#define SKIP_STRUCT
flag indicating that the structure should be ignored
Definition: base_struct.h:138
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:136
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:189
bool SCH_SHEET::IsDangling ( ) const
overridevirtual

Reimplemented from SCH_ITEM.

Definition at line 806 of file sch_sheet.cpp.

References GetPins().

Referenced by IsDanglingStateChanged().

807 {
808  // If any hierarchical label in the sheet is dangling, then the sheet is dangling.
809  for( size_t i = 0; i < GetPins().size(); i++ )
810  {
811  if( GetPins()[i].IsDangling() )
812  return true;
813  }
814 
815  return false;
816 }
SCH_SHEET_PINS & GetPins()
Definition: sch_sheet.h:334
bool SCH_SHEET::IsDanglingStateChanged ( 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 793 of file sch_sheet.cpp.

References GetPins(), and IsDangling().

794 {
795  bool currentState = IsDangling();
796 
797  for( SCH_SHEET_PIN& pinsheet : GetPins() )
798  {
799  pinsheet.IsDanglingStateChanged( aItemList );
800  }
801 
802  return currentState != IsDangling();
803 }
bool IsDangling() const override
Definition: sch_sheet.cpp:806
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
bool EDA_ITEM::IsDragging ( ) const
inlineinherited
bool EDA_ITEM::IsHighlighted ( ) const
inlineinherited

Definition at line 237 of file base_struct.h.

References HIGHLIGHTED.

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

Definition at line 231 of file base_struct.h.

References IS_CHANGED.

Referenced by LIB_EDIT_FRAME::OnEditPin().

231 { return m_Flags & IS_CHANGED; }
#define IS_CHANGED
std::function passed to nested users by ref, avoids copying std::function
Definition: base_struct.h:123
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:189
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 230 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(), abortMoveBitmap(), abortMoveItem(), AbortPinMove(), AbortSymbolTraceOn(), SCH_EDIT_FRAME::addCurrentItemToList(), 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(), DrawMovePin(), SCH_EDIT_FRAME::EditSheetPin(), LIB_PIN::EnableEditMode(), LIB_EDIT_FRAME::EndDrawGraphicItem(), SCH_EDIT_FRAME::EndSegment(), ExitSheet(), LIB_PART::LIB_PART(), 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(), LIB_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), LIB_EDIT_FRAME::OnRightClick(), SCH_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(), and DIALOG_LABEL_EDITOR::TextPropertiesAccept().

230 { return m_Flags & IS_NEW; }
#define IS_NEW
New item, just created.
Definition: base_struct.h:127
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:189
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.

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

Definition at line 236 of file base_struct.h.

References IS_RESIZED.

Referenced by ExitSheet().

236 { return m_Flags & IS_RESIZED; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:189
#define IS_RESIZED
Item being resized.
Definition: base_struct.h:128
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 819 of file sch_sheet.cpp.

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

820 {
821  bool previousState = IsSelected();
822 
824 
825  if( aRect.Intersects( boundingBox ) )
826  SetFlags( SELECTED );
827  else
828  ClearFlags( SELECTED );
829 
830  return previousState != IsSelected();
831 }
bool IsSelected() const
Definition: base_struct.h:235
BOX2I boundingBox(T aObject)
boundingBox template method
Definition: shape_index.h:59
#define SELECTED
Definition: base_struct.h:134
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:267
EDA_RECT const GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
Definition: sch_sheet.cpp:498
Class EDA_RECT handles the component boundary box.
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:268
bool SCH_SHEET::IsVerticalOrientation ( ) const

Definition at line 220 of file sch_sheet.cpp.

References m_pins.

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

221 {
222  for( SCH_SHEET_PIN pin : m_pins )
223  {
224  if( pin.GetEdge() > 1 )
225  return true;
226  }
227  return false;
228 }
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 234 of file base_struct.h.

References IS_WIRE_IMAGE.

Referenced by abortMoveItem(), and SCH_FIELD::Draw().

234 { return m_Flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:131
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:189
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 132 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(), GERBER_FILE_IMAGE::Visit(), MODULE::Visit(), and BOARD::Visit().

136 {
137  EDA_ITEM* p = listStart;
138 
139  for( ; p; p = p->Pnext )
140  {
141  if( SEARCH_QUIT == p->Visit( inspector, testData, scanTypes ) )
142  return SEARCH_QUIT;
143  }
144 
145  return SEARCH_CONTINUE;
146 }
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:165
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:178
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 233 of file sch_item_struct.h.

233 { 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 593 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().

594 {
595  if( m_screen )
596  {
597  aList->push_back( this );
598 
599  if( m_screen == aScreen )
600  return true;
601 
602  EDA_ITEM* strct = m_screen->GetDrawItems();
603 
604  while( strct )
605  {
606  if( strct->Type() == SCH_SHEET_T )
607  {
608  SCH_SHEET* ss = (SCH_SHEET*) strct;
609 
610  if( ss->LocatePathOfScreen( aScreen, aList ) )
611  return true;
612  }
613 
614  strct = strct->Next();
615  }
616 
617  aList->pop_back();
618  }
619 
620  return false;
621 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212
EDA_ITEM * Next() const
Definition: base_struct.h:220
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:593
SCH_ITEM * GetDrawItems() const
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:165
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 735 of file sch_sheet.cpp.

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

736 {
737  wxLogTrace( traceFindItem, wxT( " item " ) + GetSelectMenuText() );
738 
739  // Ignore the sheet file name if searching to replace.
740  if( !(aSearchData.GetFlags() & FR_SEARCH_REPLACE)
741  && SCH_ITEM::Matches( m_fileName, aSearchData ) )
742  {
743  if( aFindLocation )
744  *aFindLocation = GetFileNamePosition();
745 
746  return true;
747  }
748 
749  if( SCH_ITEM::Matches( m_name, aSearchData ) )
750  {
751  if( aFindLocation )
752  *aFindLocation = GetSheetNamePosition();
753 
754  return true;
755  }
756 
757  return false;
758 }
virtual bool Matches(wxFindReplaceData &aSearchData, void *aAuxData, wxPoint *aFindLocation)
Function Matches compares the item against the search criteria in aSearchData.
Definition: base_struct.h:414
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
const wxString traceFindItem
Flag to enable finding schematic item debug output.
wxString GetSelectMenuText() const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: sch_sheet.cpp:868
wxPoint GetFileNamePosition()
Definition: sch_sheet.cpp:406
wxPoint GetSheetNamePosition()
Definition: sch_sheet.cpp:388
Perform a search for a item that has replaceable text.
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 184 of file base_struct.cpp.

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

185 {
186  wxString text = aText;
187  wxString searchText = aSearchData.GetFindString();
188 
189  // Don't match if searching for replaceable item and the item doesn't support text replace.
190  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
191  return false;
192 
193  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
194  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
195 
196  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
197  {
198  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
199  return text.Matches( searchText );
200 
201  return text.MakeUpper().Matches( searchText.MakeUpper() );
202  }
203 
204  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
205  return aText.Find( searchText ) != wxNOT_FOUND;
206 
207  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
208 }
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:458
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 688 of file sch_sheet.cpp.

References m_pins, m_pos, m_size, MIRROR(), and wxPoint::y.

Referenced by SCH_EDIT_FRAME::MirrorSheet().

689 {
690  MIRROR( m_pos.y, aXaxis_position );
691  m_pos.y -= m_size.y;
692 
693  for( SCH_SHEET_PIN& sheetPin : m_pins )
694  {
695  sheetPin.MirrorX( aXaxis_position );
696  }
697 }
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:111
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 700 of file sch_sheet.cpp.

References m_pins, m_pos, m_size, MIRROR(), and wxPoint::x.

Referenced by SCH_EDIT_FRAME::MirrorSheet().

701 {
702  MIRROR( m_pos.x, aYaxis_position );
703  m_pos.x -= m_size.x;
704 
705  for( SCH_SHEET_PIN& label : m_pins )
706  {
707  label.MirrorY( aYaxis_position );
708  }
709 }
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:111
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.

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 147 of file sch_item_struct.h.

References EDA_ITEM::Pnext.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), SCH_SCREEN::addConnectedItemsToBlock(), SCH_SHEET_LIST::AnnotatePowerSymbols(), SCH_SCREEN::BreakSegment(), SCH_SCREEN::BreakSegmentsOnJunctions(), NETLIST_OBJECT_LIST::BuildNetListInfo(), HIERARCHY_NAVIG_DLG::BuildTree(), SCH_SCREENS::ChangeSymbolLibNickname(), SCH_SCREEN::CheckIfOnDrawList(), SCH_SCREEN::ClearAnnotation(), SCH_SCREEN::ClearDrawingState(), SCH_SCREEN::CountConnectedItems(), SCH_EDIT_FRAME::CreateArchiveLibrary(), SCH_SCREENS::DeleteAllMarkers(), DIALOG_ERC::DisplayERC_MarkersList(), SCH_SCREEN::Draw(), SCH_EDIT_FRAME::EndSegment(), SCH_SCREEN::ExtractWires(), 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(), SCH_SCREEN::GetSheetLabel(), SCH_SCREEN::GetWireOrBus(), SCH_SCREENS::HasNoFullyDefinedLibIds(), 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(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), SCH_SCREEN::ReplaceWires(), SCH_SCREEN::SchematicCleanUp(), SCH_SCREEN::SetComponentFootprint(), SCH_EDIT_FRAME::SetCurrentSheetHighlightFlags(), SCH_SCREEN::TestDanglingEnds(), TestDuplicateSheetNames(), and SCH_SCREEN::UpdatePickList().

147 { 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:178
bool SCH_ITEM::operator< ( const SCH_ITEM aItem) const
virtualinherited

Reimplemented in SCH_COMPONENT, and SCH_LINE.

Definition at line 87 of file sch_item_struct.cpp.

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

88 {
89  wxCHECK_MSG( false, this->Type() < aItem.Type(),
90  wxT( "Less than operator not defined for " ) + GetClass() );
91 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212
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 241 of file base_struct.cpp.

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

242 {
243  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
244  GetChars( GetClass() ) ) );
245 
246  return false;
247 }
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=(), 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:212
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, 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, TEXT_ANGLE_VERT, wxPoint::x, and wxPoint::y.

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 }
void FinishTo(const wxPoint &pos)
#define TEXT_ANGLE_HORIZ
Frequent text rotations, used with {Set,Get}TextAngle(), in 0.1 degrees for now, hoping to migrate to...
Definition: common.h:90
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:167
int GetPenSize() const override
Function GetPenSize virtual pure.
Definition: sch_sheet.cpp:382
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
#define TEXT_ANGLE_VERT
Definition: common.h:91
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.
Definition: drawtxt.cpp:229
void LineTo(const wxPoint &pos)
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
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...
Definition: drawtxt.cpp:67
wxString GetFileName(void) const
Return the filename corresponding to this sheet.
Definition: sch_sheet.cpp:645
void MoveTo(const wxPoint &pos)
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:220
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 186 of file sch_sheet.cpp.

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

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

187 {
188  wxASSERT( aSheetPin != NULL );
189  wxASSERT( aSheetPin->Type() == SCH_SHEET_PIN_T );
190 
191  SCH_SHEET_PINS::iterator i;
192 
193  for( i = m_pins.begin(); i < m_pins.end(); ++i )
194  {
195  if( *i == aSheetPin )
196  {
197  m_pins.erase( i );
198  renumberPins();
199  return;
200  }
201  }
202 
203  wxLogDebug( wxT( "Fix me: attempt to remove label %s which is not in sheet %s." ),
204  GetChars( aSheetPin->GetShownText() ), GetChars( m_name ) );
205 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212
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:135
void renumberPins()
Renumber the sheet pins in the sheet.
Definition: sch_sheet.cpp:767
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
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 767 of file sch_sheet.cpp.

References m_pins.

Referenced by AddPin(), and RemovePin().

768 {
769  int id = 2;
770 
771  for( SCH_SHEET_PIN& pin : m_pins )
772  {
773  pin.SetNumber( id );
774  id++;
775  }
776 }
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 211 of file base_struct.cpp.

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

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

212 {
213  wxCHECK_MSG( IsReplaceable(), false,
214  wxT( "Attempt to replace text in <" ) + GetClass() + wxT( "> item." ) );
215 
216  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
217 
218  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
219  aSearchData.GetFindString() :
220  aSearchData.GetFindString().Upper() );
221 
222  if( result == wxNOT_FOUND )
223  return false;
224 
225  wxString prefix = aText.Left( result );
226  wxString suffix;
227 
228  if( aSearchData.GetFindString().length() + result < aText.length() )
229  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
230 
231  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
232  GetChars( aText ), GetChars( prefix ), GetChars( aSearchData.GetReplaceString() ),
233  GetChars( suffix ) );
234 
235  aText = prefix + aSearchData.GetReplaceString() + suffix;
236 
237  return true;
238 }
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:458
const wxString traceFindReplace
Flag to enable find and replace debug tracing.
Definition: base_struct.cpp:58
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 761 of file sch_sheet.cpp.

References m_name, and EDA_ITEM::Replace().

762 {
763  return EDA_ITEM::Replace( aSearchData, m_name );
764 }
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 720 of file sch_sheet.cpp.

References m_pins, and m_size.

Referenced by resizeSheetWithMouseCursor().

721 {
722  if( aSize == m_size )
723  return;
724 
725  m_size = aSize;
726 
727  /* Move the sheet labels according to the new sheet size. */
728  for( SCH_SHEET_PIN& label : m_pins )
729  {
730  label.ConstrainOnEdge( label.GetPosition() );
731  }
732 }
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 664 of file sch_sheet.cpp.

References m_pins, m_pos, m_size, RotatePoint(), wxPoint::x, and wxPoint::y.

Referenced by SCH_EDIT_FRAME::RotateHierarchicalSheet().

665 {
666  RotatePoint( &m_pos, aPosition, 900 );
667  RotatePoint( &m_size.x, &m_size.y, 900 );
668 
669  if( m_size.x < 0 )
670  {
671  m_pos.x += m_size.x;
672  m_size.x = -m_size.x;
673  }
674 
675  if( m_size.y < 0 )
676  {
677  m_pos.y += m_size.y;
678  m_size.y = -m_size.y;
679  }
680 
681  for( SCH_SHEET_PIN& sheetPin : m_pins )
682  {
683  sheetPin.Rotate( aPosition );
684  }
685 }
wxSize m_size
The size of the sheet.
Definition: sch_sheet.h:238
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
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 562 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(), SCH_LEGACY_PLUGIN::loadHierarchy(), and SearchHierarchy().

563 {
564  if( m_screen )
565  {
566  EDA_ITEM* item = m_screen->GetDrawItems();
567 
568  while( item )
569  {
570  if( item->Type() == SCH_SHEET_T )
571  {
572  SCH_SHEET* sheet = (SCH_SHEET*) item;
573 
574  if( sheet->m_screen
575  && sheet->m_screen->GetFileName().CmpNoCase( aFilename ) == 0 )
576  {
577  *aScreen = sheet->m_screen;
578  return true;
579  }
580 
581  if( sheet->SearchHierarchy( aFilename, aScreen ) )
582  return true;
583  }
584 
585  item = item->Next();
586  }
587  }
588 
589  return false;
590 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
Definition: sch_sheet.cpp:562
const wxString & GetFileName() const
EDA_ITEM * Next() const
Definition: base_struct.h:220
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
SCH_ITEM * GetDrawItems() const
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:165
void EDA_ITEM::SetBack ( EDA_ITEM aBack)
inlineinherited

Definition at line 226 of file base_struct.h.

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

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

Definition at line 243 of file base_struct.h.

References BRIGHTENED, and EDA_ITEM::SetFlags().

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

243 { SetFlags( BRIGHTENED ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:267
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:151
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 267 of file base_struct.h.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), SCH_SCREEN::addConnectedItemsToBlock(), 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(), PCB_EDIT_FRAME::Change_Side_Module(), SCH_EDIT_FRAME::ConvertPart(), CopyMarkedItems(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), LIB_PART::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(), PCB_EDIT_FRAME::EditDimension(), LIB_PIN::EnableEditMode(), PCB_EDIT_FRAME::FlipTextePcb(), SCH_SCREEN::GetConnection(), PCB_BASE_FRAME::GlobalChange_PadSettings(), FOOTPRINT_EDIT_FRAME::HandleBlockEnd(), PCB_BASE_FRAME::Import_Pad_Settings(), SCH_EDIT_FRAME::ImportSheetPin(), 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(), PCB_BASE_FRAME::LoadModuleFromLibrary(), SCH_SCREEN::MarkConnections(), MarkItemsInBloc(), moveBitmap(), SCH_EDIT_FRAME::MoveImage(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), LIB_EDIT_FRAME::OnEditPin(), TARGET_PROPERTIES_DIALOG_EDITOR::OnOkClick(), SCH_EDIT_FRAME::OnSelectUnit(), PCB_EDIT_FRAME::Other_Layer_Route(), DRAWING_TOOL::PlaceText(), SCH_EDIT_FRAME::PrepareMoveItem(), LIB_EDIT_FRAME::Process_Special_Functions(), EDIT_TOOL::Properties(), 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(), SCH_SCREEN::SchematicCleanUp(), SCH_SCREEN::SelectBlockItems(), EDA_ITEM::SetBrightened(), LIB_PIN::SetConversion(), 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_PCB_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and UndrawAndMarkSegmentsToDrag().

267 { m_Flags |= aMask; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:189
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 279 of file base_struct.h.

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

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

Definition at line 242 of file base_struct.h.

References HIGHLIGHTED, and EDA_ITEM::SetFlags().

242 { SetFlags( HIGHLIGHTED ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:267
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:150
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 174 of file sch_item_struct.h.

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

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

Definition at line 228 of file base_struct.h.

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

228 { m_List = aList; }
DHEAD * m_List
which DLIST I am on.
Definition: base_struct.h:180
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::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 225 of file base_struct.h.

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

225 { Pnext = aNext; }
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:178
void EDA_ITEM::SetParent ( EDA_ITEM aParent)
inlineinherited

Definition at line 227 of file base_struct.h.

Referenced by MODULE::Add(), BOARD::Add(), BOARD_NETLIST_UPDATER::addNewComponent(), LIB_FIELD::Copy(), SCH_EDIT_FRAME::copyBlockItems(), CopyMarkedItems(), SCH_EDIT_FRAME::CreateSheet(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), PCB_EDIT_FRAME::Exchange_Module(), PCB_IO::FootprintSave(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), DIALOG_MODULE_MODULE_EDITOR::initModeditProperties(), DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties(), LIB_PART::LIB_PART(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), SCH_LEGACY_PLUGIN::loadHierarchy(), LIB_EDIT_FRAME::LoadOneSymbol(), MODULE::MODULE(), DIALOG_MODULE_BOARD_EDITOR::OnEditReference(), DIALOG_MODULE_BOARD_EDITOR::OnEditValue(), DIALOG_LIB_EDIT_PIN::OnPaintShowPanel(), MODULE::operator=(), SCH_COMPONENT::operator=(), PCB_PARSER::parseMODULE_unchecked(), PCBNEW_CONTROL::PasteItemsFromClipboard(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), BOARD_COMMIT::Push(), FOOTPRINT_PREVIEW_PANEL::renderFootprint(), BOARD_NETLIST_UPDATER::replaceComponent(), BOARD::ReplaceNetlist(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SaveCopyOfZones(), SCH_COMPONENT::SCH_COMPONENT(), SCH_SHEET(), SCH_SHEET_PIN::SCH_SHEET_PIN(), LIB_PART::SetFields(), SetSchItemParent(), PCB_EDIT_FRAME::StartMoveModule(), SwapData(), SCH_COMPONENT::SwapData(), and SwapItemData().

227 { m_Parent = aParent; }
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:182
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 711 of file sch_sheet.cpp.

References m_pos, and Move().

712 {
713  // Remember the sheet and all pin sheet positions must be
714  // modified. So use Move function to do that.
715  Move( aPosition - m_pos );
716 }
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 103 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().

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

Definition at line 241 of file base_struct.h.

References SELECTED, and EDA_ITEM::SetFlags().

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

241 { SetFlags( SELECTED ); }
#define SELECTED
Definition: base_struct.h:134
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:267
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.

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 160 of file sch_item_struct.h.

Referenced by SCH_EDIT_FRAME::PrepareMoveItem().

160 { 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 ( time_t  aNewTimeStamp)
inlineinherited
void EDA_ITEM::SetWireImage ( )
inlineinherited

Definition at line 240 of file base_struct.h.

References IS_WIRE_IMAGE, and EDA_ITEM::SetFlags().

Referenced by moveItemWithMouseCursor().

240 { SetFlags( IS_WIRE_IMAGE ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:267
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:131
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 477 of file base_struct.h.

Referenced by PART_LIB::GetEntryTypePowerNames().

477 { 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 147 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().

148 {
149  wxCHECK_RET( aItem->Type() == SCH_SHEET_T,
150  wxString::Format( wxT( "SCH_SHEET object cannot swap data with %s object." ),
151  GetChars( aItem->GetClass() ) ) );
152 
153  SCH_SHEET* sheet = ( SCH_SHEET* ) aItem;
154 
155  std::swap( m_pos, sheet->m_pos );
156  std::swap( m_size, sheet->m_size );
157  std::swap( m_name, sheet->m_name );
158  std::swap( m_sheetNameSize, sheet->m_sheetNameSize );
159  std::swap( m_fileNameSize, sheet->m_fileNameSize );
160  m_pins.swap( sheet->m_pins );
161 
162  // Ensure sheet labels have their .m_Parent member pointing really on their
163  // parent, after swapping.
164  for( SCH_SHEET_PIN& sheetPin : m_pins )
165  {
166  sheetPin.SetParent( this );
167  }
168 
169  for( SCH_SHEET_PIN& sheetPin : sheet->m_pins )
170  {
171  sheetPin.SetParent( sheet );
172  }
173 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212
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:227
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 212 of file base_struct.h.

References EDA_ITEM::m_StructType.

Referenced by Abort_Move_ModuleOutline(), abortMoveBitmap(), abortMoveItem(), AbortPinMove(), MODULE::Add(), CN_CLUSTER::Add(), BOARD::Add(), CN_CONNECTIVITY_ALGO::Add(), PCB_EDIT_FRAME::Add45DegreeSegment(), SCH_SCREEN::addConnectedItemsToBlock(), POINT_EDITOR::addCorner(), POINT_EDITOR::addCornerCondition(), SCH_EDIT_FRAME::addCurrentItemToList(), AddMenusForComponent(), AddMenusForEditComponent(), AddPin(), PCB_EDIT_FRAME::Attribut_Track(), PCB_EDIT_FRAME::Autoroute(), 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(), SCH_SCREENS::buildScreenList(), SCH_SHEET_LIST::BuildSheetList(), HIERARCHY_NAVIG_DLG::BuildTree(), calcArea(), calcMaxArea(), DIALOG_EXCHANGE_MODULE::changeAllFootprints(), DIALOG_EXCHANGE_MODULE::changeSameFootprints(), SCH_SCREENS::ChangeSymbolLibNickname(), TEXTE_PCB::ClassOf(), EDGE_MODULE::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), TEXTE_MODULE::ClassOf(), DRAWSEGMENT::ClassOf(), TRACK::ClassOf(), NETINFO_ITEM::ClassOf(), MODULE::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(), 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(), PCB_EDIT_FRAME::Delete_Segment_Edge(), SCH_SCREENS::DeleteAllMarkers(), SCH_SCREEN::DeleteItem(), LIB_EDIT_FRAME::deleteItem(), deleteItem(), SCH_EDIT_FRAME::DeleteItem(), DeleteItemsInList(), DeleteNullTrackSegments(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), DIALOG_ERC::DisplayERC_MarkersList(), DRC::doTrackDrc(), DRC::doTrackKeepoutDrc(), 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(), DuplicateItemsInList(), SCH_EDIT_FRAME::EditComponent(), SCH_EDIT_FRAME::EditComponentFieldText(), LIB_EDIT_FRAME::EditSymbolText(), SCH_EDIT_FRAME::EndSegment(), PCB_EDIT_FRAME::EraseRedundantTrack(), ExitSheet(), SCH_SCREEN::ExtractWires(), DRC::fillMarker(), 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(), POINT_EDITOR::finishItem(), FootprintWriteShape(), PCB_IO::Format(), PCB_IO::format(), FormatProbeItem(), POINT_EDITOR::get45DegConstrainer(), getAnchorPoint(), TRACK::GetBestInsertPoint(), BOARD_ITEM::GetBoard(), TRACK::GetBoundingBox(), BOARD_CONNECTED_ITEM::GetClearance(), 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(), SCH_EDIT_FRAME::ImportSheetPin(), DIALOG_LABEL_EDITOR::InitDialog(), ROUTER_TOOL::InlineDrag(), SCH_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), SCH_FIND_COLLECTOR::Inspect(), ARRAY_CREATOR::Invoke(), SCH_TEXT::IsDanglingStateChanged(), SCH_COLLECTOR::IsDraggableJunction(), SCH_COLLECTOR::IsNode(), TRACK::IsNull(), 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(), CONNECTIVITY_DATA::MarkItemNetAsDirty(), CN_CONNECTIVITY_ALGO::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(), SCH_EDIT_FRAME::OnEditItem(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), LIB_EDIT_FRAME::OnEditPin(), LIB_EDIT_FRAME::OnHotKey(), 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(), LIB_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnMoveItem(), SCH_EDIT_FRAME::OnOpenLibraryEditor(), SCH_EDIT_FRAME::OnOrient(), FOOTPRINT_EDIT_FRAME::OnRightClick(), LIB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRotate(), SCH_EDIT_FRAME::OnSelectUnit(), SCH_LINE::operator<(), LIB_ITEM::operator<(), SCH_ITEM::operator<(), SCH_COMPONENT::operator<(), SCH_BITMAP::operator=(), operator=(), SCH_COMPONENT::operator=(), LIB_ITEM::operator==(), OrCell_Trace(), SCH_EDIT_FRAME::OrientComponent(), BOARD_COMMIT::parentObject(), PCBNEW_CONTROL::PasteItemsFromClipboard(), SCH_EDIT_FRAME::PasteListOfItems(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), LIB_EDIT_FRAME::PlacePin(), SCH_FIELD::Plot(), BRDITEMS_PLOTTER::Plot_1_EdgeModule(), SCH_EDIT_FRAME::PrepareMoveItem(), GAL_ARRAY_CREATOR::prePushAction(), PCB_EDIT_FRAME::PrintPage(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), LIB_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), RedrawWhileMovingCursor(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), MODULE::Remove(), BOARD::Remove(), CN_CONNECTIVITY_ALGO::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(), GERBVIEW_SELECTION_TOOL::RequestSelection(), SELECTION_TOOL::RequestSelection(), PCB_EDIT_FRAME::Reset_All_Tracks_And_Vias_To_Netclass_Values(), PCB_BASE_FRAME::ResetTextSize(), SCH_EDIT_FRAME::ReSizeSheet(), BOARD_COMMIT::Revert(), SCH_EDIT_FRAME::RotateField(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SCH_EDIT_FRAME::SaveUndoItemInUndoList(), CN_CONNECTIVITY_ALGO::searchConnections(), SearchHierarchy(), SELECTION_TOOL::select(), SELECTION_TOOL::selectable(), SCH_SCREEN::SelectBlockItems(), PCB_EDIT_FRAME::SelectHighLight(), SELECTION_TOOL::selectVisually(), 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(), SCH_BITMAP::SwapData(), PCB_TARGET::SwapData(), SCH_FIELD::SwapData(), SCH_SHEET_PIN::SwapData(), TEXTE_PCB::SwapData(), DIMENSION::SwapData(), DRAWSEGMENT::SwapData(), TRACK::SwapData(), SwapData(), SCH_COMPONENT::SwapData(), VIA::SwapData(), MODULE::SwapData(), D_PAD::SwapData(), ZONE_CONTAINER::SwapData(), SwapItemData(), PCB_EDIT_FRAME::SwitchLayer(), TestDuplicateSheetNames(), TRACKS_CLEANER::testTrackEndpointDangling(), TEXTE_MODULE::TEXTE_MODULE(), TraceSegmentPcb(), TRACK::TransformShapeWithClearanceToPolygon(), SELECTION_TOOL::unselectVisually(), SCH_SHEET_PATH::UpdateAllScreenReferences(), DIALOG_SCH_EDIT_ONE_FIELD::UpdateField(), POINT_EDITOR::updateItem(), POINT_EDITOR::updatePoints(), PCB_BRIGHT_BOX::ViewDraw(), TRACK::Visit(), GERBER_DRAW_ITEM::Visit(), EDA_ITEM::Visit(), Visit(), and SCH_COMPONENT::Visit().

213  {
214  return m_StructType;
215  }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it...
Definition: base_struct.h:174
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, DRAWSEGMENT, DIMENSION, TEXTE_MODULE, MARKER_PCB, KIGFX::WORKSHEET_VIEWITEM, ROUTER_PREVIEW_ITEM, KIGFX::PREVIEW::CENTRELINE_RECT_ITEM, KIGFX::PREVIEW::POLYGON_ITEM, KIGFX::PREVIEW::SELECTION_AREA, KIGFX::ORIGIN_VIEWITEM, KIGFX::PREVIEW::RULER_ITEM, KIGFX::RATSNEST_VIEWITEM, BRIGHT_BOX, and KIGFX::PREVIEW::ARC_ASSISTANT.

Definition at line 267 of file base_struct.cpp.

References EDA_ITEM::GetBoundingBox().

Referenced by SELECTION_TOOL::selectMultiple(), BRIGHT_BOX::ViewBBox(), DIMENSION::ViewBBox(), DRAWSEGMENT::ViewBBox(), BRIGHT_BOX::ViewDraw(), and COMMON_TOOLS::ZoomFitScreen().

268 {
269  // Basic fallback
270  return BOX2I( VECTOR2I( GetBoundingBox().GetOrigin() ),
271  VECTOR2I( GetBoundingBox().GetSize() ) );
272 }
virtual const EDA_RECT GetBoundingBox() const
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
BOX2< VECTOR2I > BOX2I
Definition: box2.h:468
VECTOR2< int > VECTOR2I
Definition: vector2d.h:589
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, BRIGHT_BOX, KIGFX::PREVIEW::RULER_ITEM, KIGFX::ORIGIN_VIEWITEM, KIGFX::RATSNEST_VIEWITEM, KIGFX::PREVIEW::ARC_ASSISTANT, and PCB_BRIGHT_BOX.

Definition at line 115 of file view_item.h.

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

116  {}
void EDA_ITEM::ViewGetLayers ( int  aLayers[],
int &  aCount 
) const
overridevirtualinherited

Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on.

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

Parameters
aLayers[]output layer index array
aCountnumber of layer indices in aLayers[]

Implements KIGFX::VIEW_ITEM.

Reimplemented in D_PAD, MODULE, EDIT_POINTS, VIA, BOARD_ITEM, GERBER_DRAW_ITEM, TRACK, TEXTE_MODULE, ZONE_CONTAINER, MARKER_PCB, KIGFX::WORKSHEET_VIEWITEM, ROUTER_PREVIEW_ITEM, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM, BRIGHT_BOX, KIGFX::ORIGIN_VIEWITEM, KIGFX::RATSNEST_VIEWITEM, and KIGFX::PREVIEW::RULER_ITEM.

Definition at line 275 of file base_struct.cpp.

276 {
277  // Basic fallback
278  aCount = 1;
279  aLayers[0] = 0;
280 }
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, and TEXTE_MODULE.

Definition at line 139 of file view_item.h.

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

140  {
141  // By default always show the item
142  return 0;
143  }
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 841 of file sch_sheet.cpp.

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

842 {
843  KICAD_T stype;
844 
845  for( const KICAD_T* p = aFilterTypes; (stype = *p) != EOT; ++p )
846  {
847  // If caller wants to inspect my type
848  if( stype == Type() )
849  {
850  if( SEARCH_QUIT == aInspector( this, NULL ) )
851  return SEARCH_QUIT;
852  }
853  else if( stype == SCH_SHEET_PIN_T )
854  {
855  // Test the sheet labels.
856  for( size_t i = 0; i < m_pins.size(); i++ )
857  {
858  if( SEARCH_QUIT == aInspector( &m_pins[ i ], this ) )
859  return SEARCH_QUIT;
860  }
861  }
862  }
863 
864  return SEARCH_CONTINUE;
865 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212
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

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 123 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(), GetFileNameSize(), operator=(), Plot(), SCH_SHEET(), and SwapData().

STATUS_FLAGS EDA_ITEM::m_Flags
protectedinherited

Flag bits for editing and other uses.

Definition at line 189 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_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(), D_PAD::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(), 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 186 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 180 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(), GetName(), 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(), GetScreen(), 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(), GetSheetNameSize(), 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 124 of file sch_item_struct.h.

Referenced by SCH_ITEM::GetStoredPos().

time_t EDA_ITEM::m_TimeStamp
protectedinherited

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