KiCad PCB EDA Suite
sch_no_connect.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
5  * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
29 #ifndef _SCH_NO_CONNECT_H_
30 #define _SCH_NO_CONNECT_H_
31 
32 
33 #include <sch_item_struct.h>
34 
36 
37 class SCH_NO_CONNECT : public SCH_ITEM
38 {
40  wxSize m_size;
41 
42 public:
43  SCH_NO_CONNECT( const wxPoint& pos = wxPoint( 0, 0 ) );
44 
45  // Do not create a copy constructor. The one generated by the compiler is adequate.
46 
48 
49  wxString GetClass() const override
50  {
51  return wxT( "SCH_NO_CONNECT" );
52  }
53 
54  int GetPenSize() const override;
55 
56  void SwapData( SCH_ITEM* aItem ) override;
57 
58  void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
59  GR_DRAWMODE aDrawMode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override;
60 
61  bool Save( FILE* aFile ) const override;
62 
63  bool Load( LINE_READER& aLine, wxString& aErrorMsg ) override;
64 
65  void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) override;
66 
67  const EDA_RECT GetBoundingBox() const override;
68 
69  // Geometric transforms (used in block operations):
70 
71  void Move( const wxPoint& aMoveVector ) override
72  {
73  m_pos += aMoveVector;
74  }
75 
76  void MirrorY( int aYaxis_position ) override;
77 
78  void MirrorX( int aXaxis_position ) override;
79 
80  void Rotate( wxPoint aPosition ) override;
81 
82  bool IsSelectStateChanged( const wxRect& aRect ) override;
83 
84  bool IsConnectable() const override { return true; }
85 
86  void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const override;
87 
88  wxString GetSelectMenuText() const override { return wxString( _( "No Connect" ) ); }
89 
90  BITMAP_DEF GetMenuImage() const override;
91 
92  void GetNetListItem( NETLIST_OBJECT_LIST& aNetListItems, SCH_SHEET_PATH* aSheetPath ) override;
93 
94  wxPoint GetPosition() const override { return m_pos; }
95 
96  void SetPosition( const wxPoint& aPosition ) override { m_pos = aPosition; }
97 
98  bool HitTest( const wxPoint& aPosition, int aAccuracy ) const override;
99 
100  bool HitTest( const EDA_RECT& aRect, bool aContained = false, int aAccuracy = 0 ) const override;
101 
102  void Plot( PLOTTER* aPlotter ) override;
103 
104  EDA_ITEM* Clone() const override;
105 
106 #if defined(DEBUG)
107  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
108 #endif
109 
110 private:
111  bool doIsConnected( const wxPoint& aPosition ) const override;
112 };
113 
114 
115 #endif // _SCH_NO_CONNECT_H_
Class LINE_READER is an abstract class from which implementation specific LINE_READERs may be derived...
Definition: richio.h:81
void MirrorY(int aYaxis_position) override
Function MirrorY mirrors item relative to the Y axis about aYaxis_position.
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...
PNG memory record (file in memory).
Definition: bitmap_types.h:38
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
bool Load(LINE_READER &aLine, wxString &aErrorMsg) override
Function Load reads a schematic item from aLine in a .sch file.
Base schematic object class definition.
wxPoint GetPosition() const override
Function GetPosition.
wxPoint m_pos
Position of the no connect object.
wxSize m_size
Size of the no connect object.
void MirrorX(int aXaxis_position) override
Function MirrorX mirrors item relative to the X axis about aXaxis_position.
wxString GetClass() const override
Function GetClass returns the class name.
void GetConnectionPoints(std::vector< wxPoint > &aPoints) const override
Function GetConnectionPoints add all the connection points for this item to aPoints.
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 aNetList...
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...
SCH_NO_CONNECT(const wxPoint &pos=wxPoint(0, 0))
void SwapData(SCH_ITEM *aItem) override
Function SwapData swap the internal data structures aItem with the schematic item.
bool Save(FILE *aFile) const override
Function Save writes the data structures for this object out to a FILE in "*.sch" format...
Class NETLIST_OBJECT_LIST is a container holding and owning NETLIST_OBJECTs, which are connected item...
void SetPosition(const wxPoint &aPosition) override
Function SetPosition set the schematic item position to aPosition.
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:41
bool IsConnectable() const override
Function IsConnectable returns true if the schematic item can connect to another schematic item...
Class SCH_SHEET_PATH.
void Move(const wxPoint &aMoveVector) override
Function Move moves the item by aMoveVector to a new position.
void Plot(PLOTTER *aPlotter) override
Function Plot plots the schematic item to aPlotter.
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
Base plotter engine class.
Definition: plot_common.h:86
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.
Class EDA_RECT handles the component boundary box.
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 Rotate(wxPoint aPosition) override
Function Rotate rotates the item around aPosition 90 degrees in the clockwise direction.
wxString GetSelectMenuText() const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
int GetPenSize() const override
Function GetPenSize virtual pure.
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
bool IsSelectStateChanged(const wxRect &aRect) override
Function IsSelectStateChanged checks if the selection state of an item inside aRect has changed...
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
bool doIsConnected(const wxPoint &aPosition) const override
Function doIsConnected provides the object specific test to see if it is connected to aPosition...
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39