|
|
|
@ -23,10 +23,7 @@ |
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|
|
|
*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* @file class_libentry.h |
|
|
|
* @brief Class LIB_PIN definition. |
|
|
|
*/ |
|
|
|
|
|
|
|
#ifndef CLASS_PIN_H |
|
|
|
#define CLASS_PIN_H |
|
|
|
|
|
|
|
@ -62,16 +59,11 @@ enum DrawPinOrient { |
|
|
|
|
|
|
|
class LIB_PIN : public LIB_ITEM |
|
|
|
{ |
|
|
|
// Unlike most of the other LIB_ITEMs, the SetXXX() routines on LIB_PINs are at the UI |
|
|
|
// level, performing additional pin checking, multi-pin editing, and setting the modified |
|
|
|
// flag. So the LEGACY_PLUGIN_CACHE needs direct access to the member variables. |
|
|
|
friend class SCH_LEGACY_PLUGIN_CACHE; |
|
|
|
|
|
|
|
protected: |
|
|
|
wxPoint m_position; // Position of the pin. |
|
|
|
int m_length; // Length of the pin. |
|
|
|
int m_orientation; // Pin orientation (Up, Down, Left, Right) |
|
|
|
GRAPHIC_PINSHAPE m_shape; // Shape drawn around pin |
|
|
|
int m_width; // Line width of the pin. |
|
|
|
ELECTRICAL_PINTYPE m_type; // Electrical type of the pin. |
|
|
|
int m_attributes; // Set bit 0 to indicate pin is invisible. |
|
|
|
wxString m_name; |
|
|
|
@ -79,272 +71,191 @@ class LIB_PIN : public LIB_ITEM |
|
|
|
int m_numTextSize; // Pin num and Pin name sizes |
|
|
|
int m_nameTextSize; |
|
|
|
|
|
|
|
protected: |
|
|
|
/** |
|
|
|
* Print a pin, with or without the pin texts |
|
|
|
* |
|
|
|
* @param aOffset Offset to draw |
|
|
|
* @param aData = used here as a boolean indicating whether or not to draw the pin |
|
|
|
* electrical types |
|
|
|
* @param aTransform Transform Matrix (rotation, mirror ..) |
|
|
|
*/ |
|
|
|
void print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData, |
|
|
|
const TRANSFORM& aTransform ) override; |
|
|
|
|
|
|
|
public: |
|
|
|
LIB_PIN( LIB_PART* aParent ); |
|
|
|
|
|
|
|
// Do not create a copy constructor. The one generated by the compiler is adequate. |
|
|
|
|
|
|
|
~LIB_PIN() { } |
|
|
|
|
|
|
|
wxString GetClass() const override |
|
|
|
{ |
|
|
|
return wxT( "LIB_PIN" ); |
|
|
|
} |
|
|
|
|
|
|
|
wxString GetTypeName() override |
|
|
|
{ |
|
|
|
return _( "Pin" ); |
|
|
|
} |
|
|
|
|
|
|
|
#if defined(DEBUG) |
|
|
|
void Show( int nestLevel, std::ostream& os ) const override; |
|
|
|
#endif |
|
|
|
|
|
|
|
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override; |
|
|
|
|
|
|
|
bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override; |
|
|
|
|
|
|
|
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override; |
|
|
|
|
|
|
|
/** |
|
|
|
* Display pin info (given by GetMsgPanelInfo) and add some info related to aComponent |
|
|
|
* (schematic pin position, and sheet path) |
|
|
|
* @param aList is the message list to fill |
|
|
|
* @param aComponent is the component which "owns" the pin |
|
|
|
* Print the pin symbol without text. |
|
|
|
* If \a aColor != 0, draw with \a aColor, else with the normal pin color. |
|
|
|
*/ |
|
|
|
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList, |
|
|
|
SCH_COMPONENT* aComponent ); |
|
|
|
|
|
|
|
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override; |
|
|
|
|
|
|
|
/* Cannot use a default parameter here as it will not be compatible with the virtual. */ |
|
|
|
const EDA_RECT GetBoundingBox() const override { return GetBoundingBox( false ); } |
|
|
|
void printPinSymbol( RENDER_SETTINGS* aSettings, const wxPoint& aPos, int aOrientation ); |
|
|
|
|
|
|
|
/** |
|
|
|
* @param aIncludeInvisibles - if false, do not include labels for invisible pins |
|
|
|
* in the calculation. |
|
|
|
* Put the pin number and pin text info, given the pin line coordinates. |
|
|
|
* The line must be vertical or horizontal. |
|
|
|
* If DrawPinName == false the pin name is not printed. |
|
|
|
* If DrawPinNum = false the pin number is not printed. |
|
|
|
* If TextInside then the text is been put inside,otherwise all is drawn outside. |
|
|
|
* Pin Name: substring between '~' is negated |
|
|
|
*/ |
|
|
|
const EDA_RECT GetBoundingBox( bool aIncludeInvisibles, bool aPinOnly = false ) const; |
|
|
|
void printPinTexts( RENDER_SETTINGS* aSettings, wxPoint& aPosition, int aOrientation, |
|
|
|
int TextInside, bool DrawPinNum, bool DrawPinName ); |
|
|
|
|
|
|
|
/** |
|
|
|
* @return The pin end position for a component in the normal orientation. |
|
|
|
* Draw the electrical type text of the pin (only for the footprint editor) |
|
|
|
*/ |
|
|
|
wxPoint PinEndPoint() const; |
|
|
|
void printPinElectricalTypeName( RENDER_SETTINGS* aSettings, wxPoint& aPosition, |
|
|
|
int aOrientation ); |
|
|
|
|
|
|
|
public: |
|
|
|
/** |
|
|
|
* Return the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT), |
|
|
|
* according to its orientation and the matrix transform (rot, mirror) \a aTransform. |
|
|
|
* Get a list of pin orientation names. |
|
|
|
* |
|
|
|
* @param aTransform Transform matrix |
|
|
|
* @return List of valid pin orientation names. |
|
|
|
*/ |
|
|
|
int PinDrawOrient( const TRANSFORM& aTransform ) const; |
|
|
|
|
|
|
|
const wxString& GetName() const |
|
|
|
{ |
|
|
|
return m_name; |
|
|
|
} |
|
|
|
static wxArrayString GetOrientationNames(); |
|
|
|
|
|
|
|
/** |
|
|
|
* Set the pin name. |
|
|
|
* |
|
|
|
* This will also all of the pin names marked by EnableEditMode(). |
|
|
|
* Get a list of pin orientation bitmaps for menus and dialogs. |
|
|
|
* |
|
|
|
* @param aName New pin name. |
|
|
|
* @param aTestOtherPins determines if other pins need to be updated |
|
|
|
* @return List of valid pin orientation bitmaps symbols in .xpm format |
|
|
|
*/ |
|
|
|
void SetName( const wxString& aName, bool aTestOtherPins = true ); |
|
|
|
static const BITMAP_DEF* GetOrientationSymbols(); |
|
|
|
|
|
|
|
/** |
|
|
|
* Set the \a aSize of the pin name text. |
|
|
|
* |
|
|
|
* This will also update the text size of the name of the pins marked |
|
|
|
* by EnableEditMode(). |
|
|
|
* Get the orientation code by index used to set the pin orientation. |
|
|
|
* |
|
|
|
* @param aSize The text size of the pin name in schematic units ( mils ). |
|
|
|
* @param aTestOtherPins determines if other pins need to be updated |
|
|
|
* @param aIndex - The index of the orientation code to look up. |
|
|
|
* @return Orientation code if index is valid. Returns right |
|
|
|
* orientation on index error. |
|
|
|
*/ |
|
|
|
void SetNameTextSize( int aSize, bool aTestOtherPins = true ); |
|
|
|
|
|
|
|
int GetNameTextSize() const { return m_nameTextSize; } |
|
|
|
|
|
|
|
const wxString& GetNumber() const |
|
|
|
{ |
|
|
|
return m_number; |
|
|
|
} |
|
|
|
static int GetOrientationCode( int aIndex ); |
|
|
|
|
|
|
|
/** |
|
|
|
* Set the pin number. |
|
|
|
* Get the index of the orientation code. |
|
|
|
* |
|
|
|
* Others pin numbers marked by EnableEditMode() are not modified |
|
|
|
* because each pin has its own number |
|
|
|
* @param aNumber New pin number. |
|
|
|
* @param aCode - The orientation code to look up. |
|
|
|
* @return The index of the orientation code if found. Otherwise, |
|
|
|
* return wxNOT_FOUND. |
|
|
|
*/ |
|
|
|
void SetNumber( const wxString& aNumber ); |
|
|
|
static int GetOrientationIndex( int aCode ); |
|
|
|
|
|
|
|
/** |
|
|
|
* Set the size of the pin number text. |
|
|
|
* |
|
|
|
* This will also update the text size of the number of the pins marked |
|
|
|
* by EnableEditMode(). |
|
|
|
* |
|
|
|
* @param aSize The text size of the pin number in schematic units ( mils ). |
|
|
|
* @param aTestOtherPins determines if other pins need to be updated |
|
|
|
* return a string giving the electrical type of a pin. |
|
|
|
* Can be used when a known, not translated name is needed (for instance in net lists) |
|
|
|
* @param aType is the electrical type (see enum ELECTRICAL_PINTYPE ) |
|
|
|
* @return The electrical name for a pin type (see enun MsgPinElectricType for names). |
|
|
|
*/ |
|
|
|
void SetNumberTextSize( int aSize, bool aTestOtherPins = true ); |
|
|
|
static const wxString GetCanonicalElectricalTypeName( ELECTRICAL_PINTYPE aType ); |
|
|
|
|
|
|
|
int GetNumberTextSize() const { return m_numTextSize; } |
|
|
|
public: |
|
|
|
~LIB_PIN() { } |
|
|
|
|
|
|
|
int GetOrientation() const { return m_orientation; } |
|
|
|
wxString GetClass() const override |
|
|
|
{ |
|
|
|
return wxT( "LIB_PIN" ); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Set orientation on the pin. |
|
|
|
* |
|
|
|
* This will also update the orientation of the pins marked by EnableEditMode(). |
|
|
|
* |
|
|
|
* @param aOrientation - The orientation of the pin. |
|
|
|
* @param aTestOtherPins determines if other pins need to be updated |
|
|
|
*/ |
|
|
|
void SetOrientation( int aOrientation, bool aTestOtherPins = true ); |
|
|
|
wxString GetTypeName() override |
|
|
|
{ |
|
|
|
return _( "Pin" ); |
|
|
|
} |
|
|
|
|
|
|
|
int GetOrientation() const { return m_orientation; } |
|
|
|
void SetOrientation( int aOrientation ) { m_orientation = aOrientation; } |
|
|
|
|
|
|
|
GRAPHIC_PINSHAPE GetShape() const { return m_shape; } |
|
|
|
void SetShape( GRAPHIC_PINSHAPE aShape ) { m_shape = aShape; } |
|
|
|
|
|
|
|
/** |
|
|
|
* Set the shape of the pin to \a aShape. |
|
|
|
* |
|
|
|
* This will also update the draw style of the pins marked by EnableEditMode(). |
|
|
|
* |
|
|
|
* @param aShape - The draw shape of the pin. See enum GRAPHIC_PINSHAPE. |
|
|
|
*/ |
|
|
|
void SetShape( GRAPHIC_PINSHAPE aShape ); |
|
|
|
int GetLength() const { return m_length; } |
|
|
|
void SetLength( int aLength ) { m_length = aLength; } |
|
|
|
|
|
|
|
/** |
|
|
|
* Get the electrical type of the pin. |
|
|
|
* |
|
|
|
* @return The electrical type of the pin (see enum ELECTRICAL_PINTYPE for values). |
|
|
|
*/ |
|
|
|
ELECTRICAL_PINTYPE GetType() const { return m_type; } |
|
|
|
void SetType( ELECTRICAL_PINTYPE aType ) { m_type = aType; } |
|
|
|
|
|
|
|
/** |
|
|
|
* return a string giving the electrical type of a pin. |
|
|
|
* Can be used when a known, not translated name is needed (for instance in net lists) |
|
|
|
* @param aType is the electrical type (see enum ELECTRICAL_PINTYPE ) |
|
|
|
* @return The electrical name for a pin type (see enun MsgPinElectricType for names). |
|
|
|
*/ |
|
|
|
static const wxString GetCanonicalElectricalTypeName( ELECTRICAL_PINTYPE aType ); |
|
|
|
|
|
|
|
/** |
|
|
|
* return a string giving the electrical type of the pin. |
|
|
|
* Can be used when a known, not translated name is needed (for instance in net lists) |
|
|
|
* @return The canonical electrical name of the pin. |
|
|
|
*/ |
|
|
|
wxString const GetCanonicalElectricalTypeName() const |
|
|
|
{ |
|
|
|
return GetCanonicalElectricalTypeName( m_type ); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* return a translated string for messages giving the electrical type of the pin. |
|
|
|
* @return The electrical name of the pin. |
|
|
|
*/ |
|
|
|
wxString const GetElectricalTypeName() const |
|
|
|
{ |
|
|
|
return ElectricalPinTypeGetText( m_type ); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Set the electrical type of the pin. |
|
|
|
* |
|
|
|
* This will also update the electrical type of the pins marked by |
|
|
|
* EnableEditMode(). |
|
|
|
* |
|
|
|
* @param aType - The electrical type of the pin(see enun ELECTRICAL_PINTYPE for values). |
|
|
|
* @param aTestOtherPins determines if other pins need to be updated |
|
|
|
*/ |
|
|
|
void SetType( ELECTRICAL_PINTYPE aType, bool aTestOtherPins = true ); |
|
|
|
bool IsVisible() const { return ( m_attributes & PIN_INVISIBLE ) == 0; } |
|
|
|
void SetVisible( bool aVisible ) |
|
|
|
{ |
|
|
|
if( aVisible ) |
|
|
|
m_attributes &= ~PIN_INVISIBLE; |
|
|
|
else |
|
|
|
m_attributes |= PIN_INVISIBLE; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Set the pin length. |
|
|
|
* |
|
|
|
* This will also update the length of the pins marked by EnableEditMode(). |
|
|
|
* |
|
|
|
* @param aLength - The length of the pin in mils. |
|
|
|
* @param aTestOtherPins determines if other pins need to be updated |
|
|
|
*/ |
|
|
|
void SetLength( int aLength, bool aTestOtherPins = true ); |
|
|
|
const wxString& GetName() const { return m_name; } |
|
|
|
void SetName( const wxString& aName ) |
|
|
|
{ |
|
|
|
m_name = aName; |
|
|
|
|
|
|
|
int GetLength() { return m_length; } |
|
|
|
// pin name string does not support spaces |
|
|
|
m_name.Replace( wxT( " " ), wxT( "_" ) ); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Set the pin part number. |
|
|
|
* |
|
|
|
* If the pin is changed from not common to common to all parts, any |
|
|
|
* linked pins will be removed from the parent component. |
|
|
|
* |
|
|
|
* @param aPart - Number of the part the pin belongs to. Set to zero to |
|
|
|
* make pin common to all parts in a multi-part component. |
|
|
|
*/ |
|
|
|
void SetPartNumber( int aPart ); |
|
|
|
const wxString& GetNumber() const { return m_number; } |
|
|
|
void SetNumber( const wxString& aNumber ) |
|
|
|
{ |
|
|
|
m_number = aNumber; |
|
|
|
|
|
|
|
// pin number string does not support spaces |
|
|
|
m_number.Replace( wxT( " " ), wxT( "_" ) ); |
|
|
|
} |
|
|
|
|
|
|
|
int GetNameTextSize() const { return m_nameTextSize; } |
|
|
|
void SetNameTextSize( int aSize ) { m_nameTextSize = aSize; } |
|
|
|
|
|
|
|
/** Get the pin part number. */ |
|
|
|
int GetPartNumber() const { return m_Unit; } |
|
|
|
int GetNumberTextSize() const { return m_numTextSize; } |
|
|
|
void SetNumberTextSize( int aSize ) { m_numTextSize = aSize; } |
|
|
|
|
|
|
|
const EDA_RECT GetBoundingBox( bool aIncludeInvisibles, bool aShowName, bool aShowNum, |
|
|
|
int aNameTextOffset ) const; |
|
|
|
/** |
|
|
|
* Set the body style (conversion) of the pin. |
|
|
|
* |
|
|
|
* If the pin is changed from not common to common to all body styles, any |
|
|
|
* linked pins will be removed from the parent component. |
|
|
|
* Print a pin, with or without the pin texts |
|
|
|
* |
|
|
|
* @param aConversion - Body style of the pin. Set to zero to make pin |
|
|
|
* common to all body styles. |
|
|
|
* @param aOffset Offset to draw |
|
|
|
* @param aData = used here as a boolean indicating whether or not to draw the pin |
|
|
|
* electrical types |
|
|
|
* @param aTransform Transform Matrix (rotation, mirror ..) |
|
|
|
*/ |
|
|
|
void SetConversion( int aConversion ); |
|
|
|
void print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData, |
|
|
|
const TRANSFORM& aTransform ) override; |
|
|
|
|
|
|
|
/** |
|
|
|
* Set or clear the visibility flag for the pin. |
|
|
|
* |
|
|
|
* This will also update the visibility of the pins marked by |
|
|
|
* EnableEditMode(). |
|
|
|
* Return the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT), |
|
|
|
* according to its orientation and the matrix transform (rot, mirror) \a aTransform. |
|
|
|
* |
|
|
|
* @param aVisible - True to make the pin visible or false to hide the pin. |
|
|
|
* @param aTransform Transform matrix |
|
|
|
*/ |
|
|
|
void SetVisible( bool aVisible ); |
|
|
|
int PinDrawOrient( const TRANSFORM& aTransform ) const; |
|
|
|
|
|
|
|
LIB_PIN( LIB_PART* aParent ); |
|
|
|
|
|
|
|
// Do not create a copy constructor. The one generated by the compiler is adequate. |
|
|
|
|
|
|
|
#if defined(DEBUG) |
|
|
|
void Show( int nestLevel, std::ostream& os ) const override; |
|
|
|
#endif |
|
|
|
|
|
|
|
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override; |
|
|
|
|
|
|
|
bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override; |
|
|
|
|
|
|
|
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override; |
|
|
|
|
|
|
|
/** |
|
|
|
* Enable or clear pin editing mode. |
|
|
|
* |
|
|
|
* The pin editing mode marks or unmarks all pins common to this |
|
|
|
* pin object for further editing. If any of the pin modification |
|
|
|
* methods are called after enabling the editing mode, all pins |
|
|
|
* marked for editing will have the same attribute changed. The |
|
|
|
* only case were this is not true making this pin common to all |
|
|
|
* parts or body styles in the component. See SetCommonToAllParts() |
|
|
|
* and SetCommonToAllBodyStyles() for more information. |
|
|
|
* |
|
|
|
* @param aEnable = true marks all common pins for editing mode. False |
|
|
|
* clears the editing mode. |
|
|
|
* @param aEditPinByPin == true enables the edit pin by pin mode. |
|
|
|
* aEditPinByPin == false enables the pin edit coupling between pins at the same location |
|
|
|
* if aEnable == false, aEditPinByPin is not used |
|
|
|
* Display pin info (given by GetMsgPanelInfo) and add some info related to aComponent |
|
|
|
* (schematic pin position, and sheet path) |
|
|
|
* @param aList is the message list to fill |
|
|
|
* @param aComponent is the component which "owns" the pin |
|
|
|
*/ |
|
|
|
void EnableEditMode( bool aEnable, bool aEditPinByPin = false ); |
|
|
|
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList, |
|
|
|
SCH_COMPONENT* aComponent ); |
|
|
|
|
|
|
|
/* Cannot use a default parameter here as it will not be compatible with the virtual. */ |
|
|
|
const EDA_RECT GetBoundingBox() const override { return GetBoundingBox( false ); } |
|
|
|
|
|
|
|
/** |
|
|
|
* Return the visibility status of the draw object. |
|
|
|
* |
|
|
|
* @return True if draw object is visible otherwise false. |
|
|
|
* @param aIncludeInvisibles - if false, do not include labels for invisible pins |
|
|
|
* in the calculation. |
|
|
|
*/ |
|
|
|
bool IsVisible() const { return ( m_attributes & PIN_INVISIBLE ) == 0; } |
|
|
|
const EDA_RECT GetBoundingBox( bool aIncludeInvisibles, bool aPinOnly = false ) const; |
|
|
|
|
|
|
|
/** |
|
|
|
* Return whether this pin forms an implicit power connection: i.e., is hidden |
|
|
|
@ -358,29 +269,6 @@ public: |
|
|
|
|
|
|
|
int GetPenWidth() const override; |
|
|
|
|
|
|
|
/** |
|
|
|
* Print the pin symbol without text. |
|
|
|
* If \a aColor != 0, draw with \a aColor, else with the normal pin color. |
|
|
|
*/ |
|
|
|
void PrintPinSymbol( RENDER_SETTINGS* aSettings, const wxPoint& aPos, int aOrientation ); |
|
|
|
|
|
|
|
/** |
|
|
|
* Put the pin number and pin text info, given the pin line coordinates. |
|
|
|
* The line must be vertical or horizontal. |
|
|
|
* If DrawPinName == false the pin name is not printed. |
|
|
|
* If DrawPinNum = false the pin number is not printed. |
|
|
|
* If TextInside then the text is been put inside,otherwise all is drawn outside. |
|
|
|
* Pin Name: substring between '~' is negated |
|
|
|
*/ |
|
|
|
void PrintPinTexts( RENDER_SETTINGS* aSettings, wxPoint& aPosition, int aOrientation, |
|
|
|
int TextInside, bool DrawPinNum, bool DrawPinName ); |
|
|
|
|
|
|
|
/** |
|
|
|
* Draw the electrical type text of the pin (only for the footprint editor) |
|
|
|
*/ |
|
|
|
void PrintPinElectricalTypeName( RENDER_SETTINGS* aSettings, wxPoint& aPosition, |
|
|
|
int aOrientation ); |
|
|
|
|
|
|
|
/** |
|
|
|
* Plot the pin number and pin text info, given the pin line coordinates. |
|
|
|
* Same as DrawPinTexts((), but output is the plotter |
|
|
|
@ -393,51 +281,12 @@ public: |
|
|
|
|
|
|
|
void PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrientation ); |
|
|
|
|
|
|
|
/** |
|
|
|
* Get a list of pin orientation names. |
|
|
|
* |
|
|
|
* @return List of valid pin orientation names. |
|
|
|
*/ |
|
|
|
static wxArrayString GetOrientationNames(); |
|
|
|
|
|
|
|
/** |
|
|
|
* Get a list of pin orientation bitmaps for menus and dialogs. |
|
|
|
* |
|
|
|
* @return List of valid pin orientation bitmaps symbols in .xpm format |
|
|
|
*/ |
|
|
|
static const BITMAP_DEF* GetOrientationSymbols(); |
|
|
|
|
|
|
|
/** |
|
|
|
* Get the orientation code by index used to set the pin orientation. |
|
|
|
* |
|
|
|
* @param aIndex - The index of the orientation code to look up. |
|
|
|
* @return Orientation code if index is valid. Returns right |
|
|
|
* orientation on index error. |
|
|
|
*/ |
|
|
|
static int GetOrientationCode( int aIndex ); |
|
|
|
|
|
|
|
/** |
|
|
|
* Get the index of the orientation code. |
|
|
|
* |
|
|
|
* @param aCode - The orientation code to look up. |
|
|
|
* @return The index of the orientation code if found. Otherwise, |
|
|
|
* return wxNOT_FOUND. |
|
|
|
*/ |
|
|
|
static int GetOrientationIndex( int aCode ); |
|
|
|
|
|
|
|
void Offset( const wxPoint& aOffset ) override; |
|
|
|
|
|
|
|
void MoveTo( const wxPoint& aPosition ) override; |
|
|
|
|
|
|
|
wxPoint GetPosition() const override { return m_position; } |
|
|
|
|
|
|
|
/** |
|
|
|
* move this and all linked pins to the new position |
|
|
|
* used in pin editing. |
|
|
|
* use SetPinPosition to set the position of this only |
|
|
|
* @param aPosition is the new position of this and linked pins |
|
|
|
*/ |
|
|
|
void SetPinPosition( wxPoint aPosition ); |
|
|
|
void SetPosition( const wxPoint& aPos ) { m_position = aPos; } |
|
|
|
|
|
|
|
void MirrorHorizontal( const wxPoint& aCenter ) override; |
|
|
|
void MirrorVertical( const wxPoint& aCenter ) override; |
|
|
|
@ -446,8 +295,9 @@ public: |
|
|
|
void Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, |
|
|
|
const TRANSFORM& aTransform ) override; |
|
|
|
|
|
|
|
int GetWidth() const override { return m_width; } |
|
|
|
void SetWidth( int aWidth ) override; |
|
|
|
// Get/SetWidth() not used for pins. Use GetPenWidth() for drawing. |
|
|
|
int GetWidth() const override { return 1; } |
|
|
|
void SetWidth( int aWidth ) override { }; |
|
|
|
|
|
|
|
BITMAP_DEF GetMenuImage() const override; |
|
|
|
|
|
|
|
|