74 lines
1.9 KiB
C++
74 lines
1.9 KiB
C++
/*****************************************************************************/
|
|
/* sch_item_struct.h : Basic classes for most eeschema items descriptions */
|
|
/*****************************************************************************/
|
|
|
|
#ifndef SCH_ITEM_STRUCT_H
|
|
#define SCH_ITEM_STRUCT_H
|
|
|
|
|
|
class WinEDA_SchematicFrame;
|
|
|
|
|
|
/**
|
|
* Class SCH_ITEM
|
|
* is a base class for any item which can be embedded within the SCHEMATIC
|
|
* container class, and therefore instances of derived classes should only be
|
|
* found in EESCHEMA or other programs that use class SCHEMATIC and its contents.
|
|
* The corresponding class in PCBNEW is BOARD_ITEM.
|
|
*/
|
|
class SCH_ITEM : public EDA_BaseStruct
|
|
{
|
|
protected:
|
|
int m_Layer;
|
|
|
|
|
|
public:
|
|
SCH_ITEM( EDA_BaseStruct* aParent, KICAD_T aType );
|
|
|
|
~SCH_ITEM();
|
|
|
|
virtual wxString GetClass() const
|
|
{
|
|
return wxT( "SCH_ITEM" );
|
|
}
|
|
|
|
SCH_ITEM* Next() { return (SCH_ITEM*) Pnext; }
|
|
|
|
/**
|
|
* Function GetLayer
|
|
* returns the layer this item is on.
|
|
*/
|
|
int GetLayer() const { return m_Layer; }
|
|
|
|
/**
|
|
* Function SetLayer
|
|
* sets the layer this item is on.
|
|
* @param aLayer The layer number.
|
|
*/
|
|
void SetLayer( int aLayer ) { m_Layer = aLayer; }
|
|
|
|
/**
|
|
* Function Draw
|
|
*/
|
|
virtual void Draw( WinEDA_DrawPanel* panel,
|
|
wxDC* DC,
|
|
const wxPoint& offset,
|
|
int draw_mode,
|
|
int Color = -1 ) = 0;
|
|
|
|
|
|
/* fonction de placement */
|
|
virtual void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
|
|
|
|
/**
|
|
* Function Save
|
|
* writes the data structures for this object out to a FILE in "*.sch"
|
|
* format.
|
|
* @param aFile The FILE to write to.
|
|
* @return bool - true if success writing else false.
|
|
*/
|
|
virtual bool Save( FILE* aFile ) const = 0;
|
|
};
|
|
|
|
#endif /* SCH_ITEM_STRUCT_H */
|