2011-10-12 14:03:43 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2015-02-28 16:56:09 +00:00
|
|
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
|
|
|
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
2011-10-12 14:03:43 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2011-09-30 18:15:37 +00:00
|
|
|
/**
|
|
|
|
* @file sch_text.h
|
|
|
|
* @brief Definitions of the SCH_TEXT class and derivatives for Eeschema.
|
|
|
|
*/
|
2008-02-21 20:49:15 +00:00
|
|
|
|
|
|
|
#ifndef CLASS_TEXT_LABEL_H
|
|
|
|
#define CLASS_TEXT_LABEL_H
|
|
|
|
|
2010-11-10 15:30:12 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <macros.h>
|
2012-04-12 21:31:31 +00:00
|
|
|
#include <eda_text.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <sch_item_struct.h>
|
2010-11-10 15:30:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
class LINE_READER;
|
2013-09-25 19:09:57 +00:00
|
|
|
class NETLIST_OBJECT_LIST;
|
2010-11-10 15:30:12 +00:00
|
|
|
|
2008-02-21 20:49:15 +00:00
|
|
|
|
2016-02-28 18:16:59 +00:00
|
|
|
/* Shape/Type of SCH_HIERLABEL and SCH_GLOBALLABEL
|
2009-05-12 12:12:34 +00:00
|
|
|
* mainly used to handle the graphic associated shape
|
2009-11-03 13:26:31 +00:00
|
|
|
*/
|
2016-02-28 18:16:59 +00:00
|
|
|
enum PINSHEETLABEL_SHAPE {
|
2008-02-21 20:49:15 +00:00
|
|
|
NET_INPUT,
|
|
|
|
NET_OUTPUT,
|
|
|
|
NET_BIDI,
|
|
|
|
NET_TRISTATE,
|
2016-02-28 18:16:59 +00:00
|
|
|
NET_UNSPECIFIED
|
|
|
|
};
|
2008-02-21 20:49:15 +00:00
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2009-05-12 12:12:34 +00:00
|
|
|
extern const char* SheetLabelType[]; /* names of types of labels */
|
2009-05-09 21:54:33 +00:00
|
|
|
|
2011-03-29 19:33:07 +00:00
|
|
|
class SCH_TEXT : public SCH_ITEM, public EDA_TEXT
|
2009-05-12 12:12:34 +00:00
|
|
|
{
|
|
|
|
protected:
|
2016-02-28 18:16:59 +00:00
|
|
|
PINSHEETLABEL_SHAPE m_shape;
|
2011-12-08 15:45:01 +00:00
|
|
|
|
|
|
|
/// True if not connected to another object if the object derive from SCH_TEXT
|
|
|
|
/// supports connections.
|
|
|
|
bool m_isDangling;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The orientation of text and any associated drawing elements of derived objects.
|
|
|
|
* 0 is the horizontal and left justified.
|
|
|
|
* 1 is vertical and top justified.
|
|
|
|
* 2 is horizontal and right justified. It is the equivalent of the mirrored 0 orentation.
|
|
|
|
* 3 is veritcal and bottom justifiend. It is the equivalent of the mirrored 1 orentation.
|
|
|
|
* This is a duplicattion of m_Orient, m_HJustified, and m_VJustified in #EDA_TEXT but is
|
|
|
|
* easier to handle that 3 parameters when editing and reading and saving files.
|
|
|
|
*/
|
|
|
|
int m_schematicOrientation;
|
2009-05-12 12:12:34 +00:00
|
|
|
|
2008-02-21 20:49:15 +00:00
|
|
|
public:
|
2009-11-03 13:26:31 +00:00
|
|
|
SCH_TEXT( const wxPoint& pos = wxPoint( 0, 0 ),
|
|
|
|
const wxString& text = wxEmptyString,
|
2010-12-10 19:47:44 +00:00
|
|
|
KICAD_T aType = SCH_TEXT_T );
|
2010-12-21 15:13:09 +00:00
|
|
|
|
2012-01-09 20:26:55 +00:00
|
|
|
/**
|
|
|
|
* Copy Constructor
|
|
|
|
* clones \a aText into a new object. All members are copied as is except
|
|
|
|
* for the #m_isDangling member which is set to false. This prevents newly
|
|
|
|
* copied objects derived from #SCH_TEXT from having their connection state
|
|
|
|
* improperly set.
|
|
|
|
*/
|
2010-12-21 15:13:09 +00:00
|
|
|
SCH_TEXT( const SCH_TEXT& aText );
|
|
|
|
|
2008-03-20 01:50:21 +00:00
|
|
|
~SCH_TEXT() { }
|
2008-02-21 20:49:15 +00:00
|
|
|
|
|
|
|
virtual wxString GetClass() const
|
|
|
|
{
|
2008-03-20 01:50:21 +00:00
|
|
|
return wxT( "SCH_TEXT" );
|
2008-02-21 20:49:15 +00:00
|
|
|
}
|
|
|
|
|
2010-12-21 15:13:09 +00:00
|
|
|
/**
|
|
|
|
* Function IncrementLabel
|
2015-04-22 11:39:00 +00:00
|
|
|
* increments the label text, if it ends with a number.
|
|
|
|
* @param aIncrement = the increment value to add to the number
|
|
|
|
* ending the text
|
2010-12-21 15:13:09 +00:00
|
|
|
*/
|
2015-04-22 11:39:00 +00:00
|
|
|
void IncrementLabel( int aIncrement );
|
2008-02-21 20:49:15 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2011-03-03 01:58:12 +00:00
|
|
|
* Function SetOrientation
|
2011-12-08 15:45:01 +00:00
|
|
|
* Set m_schematicOrientation, and initialize
|
2009-11-03 13:26:31 +00:00
|
|
|
* m_orient,m_HJustified and m_VJustified, according to the value of
|
2011-12-08 15:45:01 +00:00
|
|
|
* m_schematicOrientation (for a text )
|
|
|
|
* must be called after changing m_schematicOrientation
|
2009-05-12 12:12:34 +00:00
|
|
|
* @param aSchematicOrientation =
|
|
|
|
* 0 = normal (horizontal, left justified).
|
|
|
|
* 1 = up (vertical)
|
2012-03-26 23:47:08 +00:00
|
|
|
* 2 = (horizontal, right justified). This can be seen as the mirrored position of 0
|
2009-05-12 12:12:34 +00:00
|
|
|
* 3 = bottom . This can be seen as the mirrored position of up
|
|
|
|
*/
|
2011-03-03 01:58:12 +00:00
|
|
|
virtual void SetOrientation( int aSchematicOrientation );
|
2009-05-12 12:12:34 +00:00
|
|
|
|
2011-12-08 15:45:01 +00:00
|
|
|
int GetOrientation() { return m_schematicOrientation; }
|
|
|
|
|
2016-02-28 18:16:59 +00:00
|
|
|
PINSHEETLABEL_SHAPE GetShape() const { return m_shape; }
|
2011-12-08 15:45:01 +00:00
|
|
|
|
2016-02-28 18:16:59 +00:00
|
|
|
void SetShape( PINSHEETLABEL_SHAPE aShape ) { m_shape = aShape; }
|
2009-05-12 12:12:34 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function GetSchematicTextOffset (virtual)
|
2011-12-08 15:45:01 +00:00
|
|
|
* @return the offset between the SCH_TEXT position and the text itself position
|
|
|
|
*
|
|
|
|
* This offset depends on the orientation, the type of text, and the area required to
|
|
|
|
* draw the associated graphic symbol or to put the text above a wire.
|
2009-05-12 12:12:34 +00:00
|
|
|
*/
|
2011-06-17 13:24:22 +00:00
|
|
|
virtual wxPoint GetSchematicTextOffset() const;
|
2009-05-12 12:12:34 +00:00
|
|
|
|
2015-02-28 16:56:09 +00:00
|
|
|
virtual void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
|
|
|
|
GR_DRAWMODE draw_mode, EDA_COLOR_T Color = UNSPECIFIED_COLOR );
|
2008-02-21 20:49:15 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function CreateGraphicShape
|
2010-09-11 16:33:43 +00:00
|
|
|
* Calculates the graphic shape (a polygon) associated to the text
|
2012-03-26 23:47:08 +00:00
|
|
|
* @param aPoints A buffer to fill with polygon corners coordinates
|
|
|
|
* @param Pos Position of the shape, for texts and labels: do nothing
|
2010-09-11 16:33:43 +00:00
|
|
|
* Mainly for derived classes (SCH_SHEET_PIN and Hierarchical labels)
|
|
|
|
*/
|
2011-06-17 13:24:22 +00:00
|
|
|
virtual void CreateGraphicShape( std::vector <wxPoint>& aPoints, const wxPoint& Pos )
|
2010-09-11 16:33:43 +00:00
|
|
|
{
|
2011-06-17 13:24:22 +00:00
|
|
|
aPoints.clear();
|
2010-09-11 16:33:43 +00:00
|
|
|
}
|
2008-02-21 20:49:15 +00:00
|
|
|
|
2011-10-19 20:32:21 +00:00
|
|
|
virtual void SwapData( SCH_ITEM* aItem );
|
2009-01-31 18:08:47 +00:00
|
|
|
|
2013-11-24 17:48:14 +00:00
|
|
|
virtual const EDA_RECT GetBoundingBox() const;
|
2008-04-15 19:38:19 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
virtual bool Save( FILE* aFile ) const;
|
2008-04-15 19:38:19 +00:00
|
|
|
|
2010-11-10 15:30:12 +00:00
|
|
|
virtual bool Load( LINE_READER& aLine, wxString& aErrorMsg );
|
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
virtual int GetPenSize() const;
|
2009-06-30 17:57:27 +00:00
|
|
|
|
2009-07-27 14:32:40 +00:00
|
|
|
// Geometric transforms (used in block operations):
|
2009-11-03 13:26:31 +00:00
|
|
|
|
|
|
|
virtual void Move( const wxPoint& aMoveVector )
|
2009-07-27 14:32:40 +00:00
|
|
|
{
|
|
|
|
m_Pos += aMoveVector;
|
|
|
|
}
|
|
|
|
|
2012-03-15 14:31:16 +00:00
|
|
|
virtual void MirrorY( int aYaxis_position );
|
2010-09-05 17:01:48 +00:00
|
|
|
|
2012-03-15 14:31:16 +00:00
|
|
|
virtual void MirrorX( int aXaxis_position );
|
2010-12-21 15:13:09 +00:00
|
|
|
|
2012-03-15 14:31:16 +00:00
|
|
|
virtual void Rotate( wxPoint aPosition );
|
2009-06-30 17:57:27 +00:00
|
|
|
|
2010-11-03 14:13:15 +00:00
|
|
|
virtual bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation );
|
|
|
|
|
2011-12-21 20:21:15 +00:00
|
|
|
virtual bool Replace( wxFindReplaceData& aSearchData, void* aAuxData = NULL )
|
2011-12-13 15:37:33 +00:00
|
|
|
{
|
|
|
|
return EDA_ITEM::Replace( aSearchData, m_Text );
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool IsReplaceable() const { return true; }
|
|
|
|
|
2010-11-03 14:13:15 +00:00
|
|
|
virtual void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList );
|
|
|
|
|
|
|
|
virtual bool IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemList );
|
|
|
|
|
2011-12-08 15:45:01 +00:00
|
|
|
virtual bool IsDangling() const { return m_isDangling; }
|
2010-11-03 14:13:15 +00:00
|
|
|
|
|
|
|
virtual bool IsSelectStateChanged( const wxRect& aRect );
|
|
|
|
|
2013-12-13 16:27:30 +00:00
|
|
|
virtual void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const;
|
2010-03-16 18:22:59 +00:00
|
|
|
|
2011-02-05 02:21:11 +00:00
|
|
|
virtual bool CanIncrementLabel() const { return true; }
|
|
|
|
|
2011-03-25 19:16:05 +00:00
|
|
|
virtual wxString GetSelectMenuText() const;
|
|
|
|
|
2011-08-29 03:04:59 +00:00
|
|
|
virtual BITMAP_DEF GetMenuImage() const { return add_text_xpm; }
|
2011-03-25 19:16:05 +00:00
|
|
|
|
2013-09-25 19:09:57 +00:00
|
|
|
virtual void GetNetListItem( NETLIST_OBJECT_LIST& aNetListItems,
|
|
|
|
SCH_SHEET_PATH* aSheetPath );
|
2011-10-12 14:03:43 +00:00
|
|
|
|
2012-03-15 14:31:16 +00:00
|
|
|
virtual wxPoint GetPosition() const { return m_Pos; }
|
|
|
|
|
|
|
|
virtual void SetPosition( const wxPoint& aPosition ) { m_Pos = aPosition; }
|
|
|
|
|
|
|
|
virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const;
|
|
|
|
|
|
|
|
virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false,
|
|
|
|
int aAccuracy = 0 ) const;
|
|
|
|
|
|
|
|
virtual void Plot( PLOTTER* aPlotter );
|
|
|
|
|
2012-03-17 14:39:27 +00:00
|
|
|
virtual EDA_ITEM* Clone() const;
|
|
|
|
|
2013-01-12 17:32:24 +00:00
|
|
|
void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList );
|
2012-11-20 11:35:09 +00:00
|
|
|
|
2008-04-22 16:38:23 +00:00
|
|
|
#if defined(DEBUG)
|
2011-12-14 17:25:42 +00:00
|
|
|
void Show( int nestLevel, std::ostream& os ) const; // override
|
2008-04-22 16:38:23 +00:00
|
|
|
#endif
|
2008-02-21 20:49:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-20 01:50:21 +00:00
|
|
|
class SCH_LABEL : public SCH_TEXT
|
2008-02-21 20:49:15 +00:00
|
|
|
{
|
|
|
|
public:
|
2010-12-10 19:47:44 +00:00
|
|
|
SCH_LABEL( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString );
|
2010-12-21 15:13:09 +00:00
|
|
|
|
2012-01-09 20:26:55 +00:00
|
|
|
// Do not create a copy constructor. The one generated by the compiler is adequate.
|
2010-12-21 15:13:09 +00:00
|
|
|
|
2008-03-20 01:50:21 +00:00
|
|
|
~SCH_LABEL() { }
|
2010-12-10 19:47:44 +00:00
|
|
|
|
2015-02-28 16:56:09 +00:00
|
|
|
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
|
|
|
|
GR_DRAWMODE draw_mode, EDA_COLOR_T Color = UNSPECIFIED_COLOR );
|
2008-02-21 20:49:15 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
wxString GetClass() const
|
2008-02-21 20:49:15 +00:00
|
|
|
{
|
2008-03-27 17:05:59 +00:00
|
|
|
return wxT( "SCH_LABEL" );
|
2008-02-21 20:49:15 +00:00
|
|
|
}
|
2008-04-15 19:38:19 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void SetOrientation( int aSchematicOrientation );
|
2009-05-12 12:12:34 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
wxPoint GetSchematicTextOffset() const;
|
2010-12-21 15:13:09 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void MirrorX( int aXaxis_position );
|
2010-12-21 15:13:09 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void Rotate( wxPoint aPosition );
|
2009-05-12 12:12:34 +00:00
|
|
|
|
2013-11-24 17:48:14 +00:00
|
|
|
const EDA_RECT GetBoundingBox() const; // Virtual
|
2009-11-28 09:24:37 +00:00
|
|
|
|
2011-03-25 19:16:05 +00:00
|
|
|
bool Save( FILE* aFile ) const;
|
2010-11-10 15:30:12 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
bool Load( LINE_READER& aLine, wxString& aErrorMsg );
|
2010-12-13 15:59:00 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
bool IsConnectable() const { return true; }
|
2011-01-07 19:24:24 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
wxString GetSelectMenuText() const;
|
2011-03-25 19:16:05 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
BITMAP_DEF GetMenuImage() const { return add_line_label_xpm; }
|
2011-03-25 19:16:05 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
bool IsReplaceable() const { return true; }
|
2011-12-01 16:49:28 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
EDA_ITEM* Clone() const;
|
2012-03-17 14:39:27 +00:00
|
|
|
|
2010-12-13 15:59:00 +00:00
|
|
|
private:
|
2012-03-26 23:47:08 +00:00
|
|
|
bool doIsConnected( const wxPoint& aPosition ) const { return m_Pos == aPosition; }
|
2008-02-21 20:49:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-20 01:50:21 +00:00
|
|
|
class SCH_GLOBALLABEL : public SCH_TEXT
|
2008-02-21 20:49:15 +00:00
|
|
|
{
|
|
|
|
public:
|
2010-12-10 19:47:44 +00:00
|
|
|
SCH_GLOBALLABEL( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString );
|
2010-12-21 15:13:09 +00:00
|
|
|
|
2012-01-09 20:26:55 +00:00
|
|
|
// Do not create a copy constructor. The one generated by the compiler is adequate.
|
2010-12-21 15:13:09 +00:00
|
|
|
|
2008-03-20 01:50:21 +00:00
|
|
|
~SCH_GLOBALLABEL() { }
|
2010-12-10 19:47:44 +00:00
|
|
|
|
2015-02-28 16:56:09 +00:00
|
|
|
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
|
|
|
|
GR_DRAWMODE draw_mode, EDA_COLOR_T Color = UNSPECIFIED_COLOR );
|
2008-02-21 20:49:15 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
wxString GetClass() const
|
2008-02-21 20:49:15 +00:00
|
|
|
{
|
2008-03-27 17:05:59 +00:00
|
|
|
return wxT( "SCH_GLOBALLABEL" );
|
2008-02-21 20:49:15 +00:00
|
|
|
}
|
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void SetOrientation( int aSchematicOrientation );
|
2009-05-12 12:12:34 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
wxPoint GetSchematicTextOffset() const;
|
2009-05-12 12:12:34 +00:00
|
|
|
|
2011-03-25 19:16:05 +00:00
|
|
|
bool Save( FILE* aFile ) const;
|
2008-04-15 19:38:19 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
bool Load( LINE_READER& aLine, wxString& aErrorMsg );
|
2010-11-10 15:30:12 +00:00
|
|
|
|
2013-11-24 17:48:14 +00:00
|
|
|
const EDA_RECT GetBoundingBox() const; // Virtual
|
2009-05-05 17:32:07 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void CreateGraphicShape( std::vector <wxPoint>& aPoints, const wxPoint& aPos );
|
2009-07-27 14:32:40 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void MirrorY( int aYaxis_position );
|
2010-12-14 15:56:30 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void MirrorX( int aXaxis_position );
|
2010-12-14 15:56:30 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void Rotate( wxPoint aPosition );
|
2010-12-13 15:59:00 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
bool IsConnectable() const { return true; }
|
2011-01-07 19:24:24 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
wxString GetSelectMenuText() const;
|
2011-03-25 19:16:05 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
BITMAP_DEF GetMenuImage() const { return add_glabel_xpm; }
|
2011-03-25 19:16:05 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
EDA_ITEM* Clone() const;
|
2012-03-17 14:39:27 +00:00
|
|
|
|
2010-12-13 15:59:00 +00:00
|
|
|
private:
|
2012-03-26 23:47:08 +00:00
|
|
|
bool doIsConnected( const wxPoint& aPosition ) const { return m_Pos == aPosition; }
|
2008-02-21 20:49:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-20 01:50:21 +00:00
|
|
|
class SCH_HIERLABEL : public SCH_TEXT
|
2008-02-21 20:49:15 +00:00
|
|
|
{
|
|
|
|
public:
|
2008-03-20 01:50:21 +00:00
|
|
|
SCH_HIERLABEL( const wxPoint& pos = wxPoint( 0, 0 ),
|
2010-12-10 19:47:44 +00:00
|
|
|
const wxString& text = wxEmptyString,
|
|
|
|
KICAD_T aType = SCH_HIERARCHICAL_LABEL_T );
|
|
|
|
|
2012-01-09 20:26:55 +00:00
|
|
|
// Do not create a copy constructor. The one generated by the compiler is adequate.
|
2010-12-21 15:13:09 +00:00
|
|
|
|
2008-03-20 01:50:21 +00:00
|
|
|
~SCH_HIERLABEL() { }
|
2010-12-21 15:13:09 +00:00
|
|
|
|
2015-02-28 16:56:09 +00:00
|
|
|
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
|
|
|
|
GR_DRAWMODE draw_mode, EDA_COLOR_T Color = UNSPECIFIED_COLOR );
|
2008-02-21 20:49:15 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
wxString GetClass() const
|
2008-02-21 20:49:15 +00:00
|
|
|
{
|
2008-03-27 17:05:59 +00:00
|
|
|
return wxT( "SCH_HIERLABEL" );
|
2008-02-21 20:49:15 +00:00
|
|
|
}
|
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void SetOrientation( int aSchematicOrientation );
|
2009-05-12 12:12:34 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
wxPoint GetSchematicTextOffset() const;
|
2009-05-12 12:12:34 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void CreateGraphicShape( std::vector <wxPoint>& aPoints, const wxPoint& Pos );
|
2008-03-30 09:27:53 +00:00
|
|
|
|
2011-03-25 19:16:05 +00:00
|
|
|
bool Save( FILE* aFile ) const;
|
2008-04-15 19:38:19 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
bool Load( LINE_READER& aLine, wxString& aErrorMsg );
|
2010-11-10 15:30:12 +00:00
|
|
|
|
2013-11-24 17:48:14 +00:00
|
|
|
const EDA_RECT GetBoundingBox() const; // Virtual
|
2009-01-31 18:08:47 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void MirrorY( int aYaxis_position );
|
2010-12-14 15:56:30 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void MirrorX( int aXaxis_position );
|
2010-12-14 15:56:30 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void Rotate( wxPoint aPosition );
|
2010-12-13 15:59:00 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
bool IsConnectable() const { return true; }
|
2011-01-07 19:24:24 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
wxString GetSelectMenuText() const;
|
2011-03-25 19:16:05 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
BITMAP_DEF GetMenuImage() const { return add_hierarchical_label_xpm; }
|
2011-03-25 19:16:05 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
EDA_ITEM* Clone() const;
|
2012-03-17 14:39:27 +00:00
|
|
|
|
2010-12-13 15:59:00 +00:00
|
|
|
private:
|
2012-03-26 23:47:08 +00:00
|
|
|
bool doIsConnected( const wxPoint& aPosition ) const { return m_Pos == aPosition; }
|
2008-02-21 20:49:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* CLASS_TEXT_LABEL_H */
|