Commit 058e17ed authored by Wayne Stambaugh's avatar Wayne Stambaugh

Minor code and Doxygen comment improvements.

* Remove double Clone() function calls from all classes derived from
  EDA_ITEM.
* Lots of Doxygen comment warning fixes.
parent ffbbd64c
...@@ -99,17 +99,10 @@ void EDA_ITEM::SetModified() ...@@ -99,17 +99,10 @@ void EDA_ITEM::SetModified()
} }
EDA_ITEM* EDA_ITEM::doClone() const
{
wxCHECK_MSG( false, NULL, wxT( "doClone not implemented in derived class " ) + GetClass() +
wxT( ". Bad programmer." ) );
}
EDA_ITEM* EDA_ITEM::Clone() const EDA_ITEM* EDA_ITEM::Clone() const
{ {
// save about 6 bytes per call by hiding the virtual function in this non-inline function. wxCHECK_MSG( false, NULL, wxT( "Clone not implemented in derived class " ) + GetClass() +
return doClone(); wxT( ". Bad programmer!" ) );
} }
...@@ -272,9 +265,9 @@ std::ostream& EDA_ITEM::NestedSpace( int nestLevel, std::ostream& os ) ...@@ -272,9 +265,9 @@ std::ostream& EDA_ITEM::NestedSpace( int nestLevel, std::ostream& os )
#endif #endif
/**************************************************/ /*******************************************/
/* EDA_TEXT (basic class, not directly used */ /* EDA_TEXT (base class, not directly used */
/**************************************************/ /*******************************************/
EDA_TEXT::EDA_TEXT( const wxString& text ) EDA_TEXT::EDA_TEXT( const wxString& text )
{ {
m_Size.x = m_Size.y = DEFAULT_SIZE_TEXT; // Width and height of font. m_Size.x = m_Size.y = DEFAULT_SIZE_TEXT; // Width and height of font.
......
...@@ -476,7 +476,7 @@ void SCH_EDIT_FRAME::RepeatDrawItem( wxDC* DC ) ...@@ -476,7 +476,7 @@ void SCH_EDIT_FRAME::RepeatDrawItem( wxDC* DC )
if( m_itemToRepeat == NULL ) if( m_itemToRepeat == NULL )
return; return;
m_itemToRepeat = m_itemToRepeat->Clone(); m_itemToRepeat = (SCH_ITEM*) m_itemToRepeat->Clone();
if( m_itemToRepeat->Type() == SCH_COMPONENT_T ) // If repeat component then put in move mode if( m_itemToRepeat->Type() == SCH_COMPONENT_T ) // If repeat component then put in move mode
{ {
......
...@@ -221,7 +221,7 @@ bool LIB_ARC::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTran ...@@ -221,7 +221,7 @@ bool LIB_ARC::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTran
} }
EDA_ITEM* LIB_ARC::doClone() const EDA_ITEM* LIB_ARC::Clone() const
{ {
return new LIB_ARC( *this ); return new LIB_ARC( *this );
} }
......
...@@ -106,12 +106,7 @@ public: ...@@ -106,12 +106,7 @@ public:
virtual bool Load( LINE_READER& aLineReader, wxString& aErrorMsg ); virtual bool Load( LINE_READER& aLineReader, wxString& aErrorMsg );
/** /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
* Tests if the given wxPoint is within the bounds of this object.
*
* @param aPosition - Coordinates to test
* @return - True if a hit, else false
*/
virtual bool HitTest( const wxPoint& aPosition ); virtual bool HitTest( const wxPoint& aPosition );
/** /**
...@@ -204,8 +199,10 @@ public: ...@@ -204,8 +199,10 @@ public:
/** @copydoc EDA_ITEM::GetMenuImage() */ /** @copydoc EDA_ITEM::GetMenuImage() */
virtual BITMAP_DEF GetMenuImage() const { return add_arc_xpm; } virtual BITMAP_DEF GetMenuImage() const { return add_arc_xpm; }
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
private: private:
virtual EDA_ITEM* doClone() const;
/** /**
* Function compare * Function compare
......
...@@ -132,7 +132,7 @@ bool LIB_BEZIER::Load( LINE_READER& aLineReader, wxString& aErrorMsg ) ...@@ -132,7 +132,7 @@ bool LIB_BEZIER::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
} }
EDA_ITEM* LIB_BEZIER::doClone() const EDA_ITEM* LIB_BEZIER::Clone() const
{ {
return new LIB_BEZIER( *this ); return new LIB_BEZIER( *this );
} }
......
...@@ -84,13 +84,8 @@ public: ...@@ -84,13 +84,8 @@ public:
*/ */
unsigned GetCornerCount() const { return m_PolyPoints.size(); } unsigned GetCornerCount() const { return m_PolyPoints.size(); }
/** /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
* Test if the given point is within the bounds of this object. virtual bool HitTest( const wxPoint& aPosition );
*
* @param aRefPos - A wxPoint to test
* @return true if a hit, else false
*/
virtual bool HitTest( const wxPoint& aRefPos );
/** /**
* @param aPosRef = a wxPoint to test * @param aPosRef = a wxPoint to test
...@@ -160,8 +155,10 @@ public: ...@@ -160,8 +155,10 @@ public:
virtual void DisplayInfo( EDA_DRAW_FRAME* aFrame ); virtual void DisplayInfo( EDA_DRAW_FRAME* aFrame );
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
private: private:
virtual EDA_ITEM* doClone() const;
/** /**
* Function compare * Function compare
......
...@@ -114,7 +114,7 @@ bool LIB_CIRCLE::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTra ...@@ -114,7 +114,7 @@ bool LIB_CIRCLE::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTra
} }
EDA_ITEM* LIB_CIRCLE::doClone() const EDA_ITEM* LIB_CIRCLE::Clone() const
{ {
return new LIB_CIRCLE( *this ); return new LIB_CIRCLE( *this );
} }
......
...@@ -75,13 +75,8 @@ public: ...@@ -75,13 +75,8 @@ public:
virtual bool Load( LINE_READER& aLineReader, wxString& aErrorMsg ); virtual bool Load( LINE_READER& aLineReader, wxString& aErrorMsg );
/** /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
* Test if the given point is within the bounds of this object. virtual bool HitTest( const wxPoint& aPosition );
*
* @param aPosRef - A wxPoint to test
* @return bool - true if a hit, else false
*/
virtual bool HitTest( const wxPoint& aPosRef );
/** /**
* @param aPosRef - a wxPoint to test * @param aPosRef - a wxPoint to test
...@@ -174,8 +169,10 @@ public: ...@@ -174,8 +169,10 @@ public:
/** @copydoc EDA_ITEM::GetMenuImage() */ /** @copydoc EDA_ITEM::GetMenuImage() */
virtual BITMAP_DEF GetMenuImage() const { return add_circle_xpm; } virtual BITMAP_DEF GetMenuImage() const { return add_circle_xpm; }
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
private: private:
virtual EDA_ITEM* doClone() const;
/** /**
* Function compare * Function compare
......
...@@ -227,14 +227,7 @@ public: ...@@ -227,14 +227,7 @@ public:
return (LIB_COMPONENT *)m_Parent; return (LIB_COMPONENT *)m_Parent;
} }
/** /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
* Tests if the given point is within the bounds of this object.
*
* Derived classes should override this function.
*
* @param aPosition - The coordinates to test.
* @return - true if a hit, else false
*/
virtual bool HitTest( const wxPoint& aPosition ) virtual bool HitTest( const wxPoint& aPosition )
{ {
return false; return false;
......
...@@ -369,7 +369,7 @@ bool LIB_FIELD::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTr ...@@ -369,7 +369,7 @@ bool LIB_FIELD::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTr
} }
EDA_ITEM* LIB_FIELD::doClone() const EDA_ITEM* LIB_FIELD::Clone() const
{ {
LIB_FIELD* newfield = new LIB_FIELD( m_id ); LIB_FIELD* newfield = new LIB_FIELD( m_id );
......
...@@ -187,13 +187,8 @@ public: ...@@ -187,13 +187,8 @@ public:
*/ */
virtual void DisplayInfo( EDA_DRAW_FRAME* aFrame ); virtual void DisplayInfo( EDA_DRAW_FRAME* aFrame );
/** /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
* Test if the given point is within the bounds of this object. virtual bool HitTest( const wxPoint& aPosition );
*
* @param aPosition A point to test in field coordinate system
* @return True if a hit, else false
*/
bool HitTest( const wxPoint& aPosition );
/** /**
* @param aPosition = a wxPoint to test * @param aPosition = a wxPoint to test
...@@ -325,8 +320,10 @@ public: ...@@ -325,8 +320,10 @@ public:
/** @copydoc EDA_ITEM::GetMenuImage() */ /** @copydoc EDA_ITEM::GetMenuImage() */
virtual BITMAP_DEF GetMenuImage() const { return move_field_xpm; } virtual BITMAP_DEF GetMenuImage() const { return move_field_xpm; }
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
private: private:
virtual EDA_ITEM* doClone() const;
/** /**
* Function compare * Function compare
......
...@@ -1670,7 +1670,7 @@ void LIB_PIN::SetPinNumFromString( wxString& buffer ) ...@@ -1670,7 +1670,7 @@ void LIB_PIN::SetPinNumFromString( wxString& buffer )
} }
EDA_ITEM* LIB_PIN::doClone() const EDA_ITEM* LIB_PIN::Clone() const
{ {
return new LIB_PIN( *this ); return new LIB_PIN( *this );
} }
......
...@@ -149,17 +149,8 @@ public: ...@@ -149,17 +149,8 @@ public:
virtual bool Load( LINE_READER& aLineReader, wxString& aErrorMsg ); virtual bool Load( LINE_READER& aLineReader, wxString& aErrorMsg );
/** /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
* Function HitTest virtual bool HitTest( const wxPoint& aPosition );
* verifies that \a aRefPos within the bounds of this pin attached to \a aComponent.
* <p>
* The coordinates of the pin are calculated relative to \a aComponent if not NULL.
* Otherwise, the pin coordinates are relative to the library anchor position.
* </p>
* @param aRefPos A wxPoint to test
* @return True \a aRefPos lies within the pin bounding box else false.
*/
virtual bool HitTest( const wxPoint& aRefPos );
/** /**
* @param aPosRef - a wxPoint to test * @param aPosRef - a wxPoint to test
...@@ -575,8 +566,10 @@ public: ...@@ -575,8 +566,10 @@ public:
/** @copydoc EDA_ITEM::GetSelectMenuText() */ /** @copydoc EDA_ITEM::GetSelectMenuText() */
virtual wxString GetSelectMenuText() const; virtual wxString GetSelectMenuText() const;
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
private: private:
virtual EDA_ITEM* doClone() const;
/** /**
* Function compare * Function compare
......
...@@ -133,7 +133,7 @@ bool LIB_POLYLINE::Load( LINE_READER& aLineReader, wxString& aErrorMsg ) ...@@ -133,7 +133,7 @@ bool LIB_POLYLINE::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
} }
EDA_ITEM* LIB_POLYLINE::doClone() const EDA_ITEM* LIB_POLYLINE::Clone() const
{ {
return new LIB_POLYLINE( *this ); return new LIB_POLYLINE( *this );
} }
......
...@@ -88,12 +88,7 @@ public: ...@@ -88,12 +88,7 @@ public:
*/ */
unsigned GetCornerCount() const { return m_PolyPoints.size(); } unsigned GetCornerCount() const { return m_PolyPoints.size(); }
/** /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
* Test if the given point is within the bounds of this object.
*
* @param aPosition - A wxPoint to test
* @return - true if a hit, else false
*/
virtual bool HitTest( const wxPoint& aPosition ); virtual bool HitTest( const wxPoint& aPosition );
/** /**
...@@ -190,8 +185,10 @@ public: ...@@ -190,8 +185,10 @@ public:
/** @copydoc EDA_ITEM::GetMenuImage() */ /** @copydoc EDA_ITEM::GetMenuImage() */
virtual BITMAP_DEF GetMenuImage() const { return add_polygon_xpm; } virtual BITMAP_DEF GetMenuImage() const { return add_polygon_xpm; }
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
private: private:
virtual EDA_ITEM* doClone() const;
/** /**
* Function compare * Function compare
......
...@@ -88,7 +88,7 @@ bool LIB_RECTANGLE::Load( LINE_READER& aLineReader, wxString& aErrorMsg ) ...@@ -88,7 +88,7 @@ bool LIB_RECTANGLE::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
} }
EDA_ITEM* LIB_RECTANGLE::doClone() const EDA_ITEM* LIB_RECTANGLE::Clone() const
{ {
return new LIB_RECTANGLE( *this ); return new LIB_RECTANGLE( *this );
} }
......
...@@ -79,12 +79,7 @@ public: ...@@ -79,12 +79,7 @@ public:
virtual bool Load( LINE_READER& aLineReader, wxString& aErrorMsg ); virtual bool Load( LINE_READER& aLineReader, wxString& aErrorMsg );
/** /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
* Test if the given point is within the bounds of this object.
*
* @param aPosition - A wxPoint to test
* @return - true if a hit, else false
*/
virtual bool HitTest( const wxPoint& aPosition ); virtual bool HitTest( const wxPoint& aPosition );
/** /**
...@@ -178,8 +173,10 @@ public: ...@@ -178,8 +173,10 @@ public:
/** @copydoc EDA_ITEM::GetMenuImage() */ /** @copydoc EDA_ITEM::GetMenuImage() */
virtual BITMAP_DEF GetMenuImage() const { return add_rectangle_xpm; } virtual BITMAP_DEF GetMenuImage() const { return add_rectangle_xpm; }
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
private: private:
virtual EDA_ITEM* doClone() const;
/** /**
* Function compare * Function compare
......
...@@ -214,7 +214,7 @@ bool LIB_TEXT::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTra ...@@ -214,7 +214,7 @@ bool LIB_TEXT::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTra
} }
EDA_ITEM* LIB_TEXT::doClone() const EDA_ITEM* LIB_TEXT::Clone() const
{ {
LIB_TEXT* newitem = new LIB_TEXT(NULL); LIB_TEXT* newitem = new LIB_TEXT(NULL);
......
...@@ -94,12 +94,7 @@ public: ...@@ -94,12 +94,7 @@ public:
virtual bool Load( LINE_READER& aLineReader, wxString& aErrorMsg ); virtual bool Load( LINE_READER& aLineReader, wxString& aErrorMsg );
/** /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
* Test if the given point is within the bounds of this object.
*
* @param aPosition - A wxPoint to test
* @return - true if a hit, else false
*/
virtual bool HitTest( const wxPoint& aPosition ); virtual bool HitTest( const wxPoint& aPosition );
/** /**
...@@ -210,8 +205,10 @@ public: ...@@ -210,8 +205,10 @@ public:
/** @copydoc EDA_ITEM::GetMenuImage() */ /** @copydoc EDA_ITEM::GetMenuImage() */
virtual BITMAP_DEF GetMenuImage() const { return add_text_xpm; } virtual BITMAP_DEF GetMenuImage() const { return add_text_xpm; }
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
private: private:
virtual EDA_ITEM* doClone() const;
/** /**
* Function compare * Function compare
......
...@@ -65,8 +65,6 @@ public: ...@@ -65,8 +65,6 @@ public:
* @param id_NetType = netlist type id * @param id_NetType = netlist type id
* @param idCheckBox = event ID attached to the "format is default" check box * @param idCheckBox = event ID attached to the "format is default" check box
* @param idCreateFile = event ID attached to the "create netlist" button * @param idCreateFile = event ID attached to the "create netlist" button
* @param selected = true to have this notebook page selected when the dialog is opened
* Only one page can be created with selected = true.
*/ */
NETLIST_PAGE_DIALOG( wxNotebook* parent, const wxString& title, NETLIST_PAGE_DIALOG( wxNotebook* parent, const wxString& title,
int id_NetType, int idCheckBox, int idCreateFile ); int id_NetType, int idCheckBox, int idCreateFile );
......
...@@ -237,7 +237,7 @@ SCH_ITEM* DuplicateStruct( SCH_ITEM* aDrawStruct, bool aClone ) ...@@ -237,7 +237,7 @@ SCH_ITEM* DuplicateStruct( SCH_ITEM* aDrawStruct, bool aClone )
wxCHECK_MSG( aDrawStruct != NULL, NULL, wxCHECK_MSG( aDrawStruct != NULL, NULL,
wxT( "Cannot duplicate NULL schematic item! Bad programmer." ) ); wxT( "Cannot duplicate NULL schematic item! Bad programmer." ) );
SCH_ITEM* NewDrawStruct = aDrawStruct->Clone(); SCH_ITEM* NewDrawStruct = (SCH_ITEM*) aDrawStruct->Clone();
if( aClone ) if( aClone )
NewDrawStruct->SetTimeStamp( aDrawStruct->GetTimeStamp() ); NewDrawStruct->SetTimeStamp( aDrawStruct->GetTimeStamp() );
......
...@@ -122,7 +122,7 @@ bool SCH_BITMAP::Save( FILE* aFile ) const ...@@ -122,7 +122,7 @@ bool SCH_BITMAP::Save( FILE* aFile ) const
} }
EDA_ITEM* SCH_BITMAP::doClone() const EDA_ITEM* SCH_BITMAP::Clone() const
{ {
return new SCH_BITMAP( *this ); return new SCH_BITMAP( *this );
} }
......
...@@ -163,22 +163,22 @@ public: ...@@ -163,22 +163,22 @@ public:
/** @copydoc SCH_ITEM::SetPosition() */ /** @copydoc SCH_ITEM::SetPosition() */
virtual void SetPosition( const wxPoint& aPosition ) { m_Pos = aPosition; } virtual void SetPosition( const wxPoint& aPosition ) { m_Pos = aPosition; }
/** @copydoc SCH_ITEM::HitTest(wxPoint&,int) */ /** @copydoc SCH_ITEM::HitTest(const wxPoint&,int)const */
virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const; virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const;
/** @copydoc SCH_ITEM::HitTest(EDA_RECT&,bool=false,int=0) */ /** @copydoc SCH_ITEM::HitTest(const EDA_RECT&,bool,int)const */
virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false, virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false,
int aAccuracy = 0 ) const; int aAccuracy = 0 ) const;
/** @copydoc SCH_ITEM::Plot() */ /** @copydoc SCH_ITEM::Plot() */
virtual void Plot( PLOTTER* aPlotter ); virtual void Plot( PLOTTER* aPlotter );
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // override void Show( int nestLevel, std::ostream& os ) const; // override
#endif #endif
private:
virtual EDA_ITEM* doClone() const;
}; };
......
...@@ -60,7 +60,7 @@ SCH_BUS_ENTRY::SCH_BUS_ENTRY( const wxPoint& pos, int shape, int id ) : ...@@ -60,7 +60,7 @@ SCH_BUS_ENTRY::SCH_BUS_ENTRY( const wxPoint& pos, int shape, int id ) :
} }
EDA_ITEM* SCH_BUS_ENTRY::doClone() const EDA_ITEM* SCH_BUS_ENTRY::Clone() const
{ {
return new SCH_BUS_ENTRY( *this ); return new SCH_BUS_ENTRY( *this );
} }
......
...@@ -161,22 +161,22 @@ public: ...@@ -161,22 +161,22 @@ public:
/** @copydoc SCH_ITEM::SetPosition() */ /** @copydoc SCH_ITEM::SetPosition() */
virtual void SetPosition( const wxPoint& aPosition ) { m_pos = aPosition; } virtual void SetPosition( const wxPoint& aPosition ) { m_pos = aPosition; }
/** @copydoc SCH_ITEM::HitTest(wxPoint&,int) */ /** @copydoc SCH_ITEM::HitTest(const wxPoint&,int)const */
virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const; virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const;
/** @copydoc SCH_ITEM::HitTest(EDA_RECT&,bool=false,int=0) */ /** @copydoc SCH_ITEM::HitTest(const EDA_RECT&,bool,int)const */
virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false, virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false,
int aAccuracy = 0 ) const; int aAccuracy = 0 ) const;
/** @copydoc SCH_ITEM::Plot() */ /** @copydoc SCH_ITEM::Plot() */
virtual void Plot( PLOTTER* aPlotter ); virtual void Plot( PLOTTER* aPlotter );
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif
private:
virtual EDA_ITEM* doClone() const;
}; };
......
...@@ -231,7 +231,7 @@ void SCH_COMPONENT::Init( const wxPoint& pos ) ...@@ -231,7 +231,7 @@ void SCH_COMPONENT::Init( const wxPoint& pos )
} }
EDA_ITEM* SCH_COMPONENT::doClone() const EDA_ITEM* SCH_COMPONENT::Clone() const
{ {
return new SCH_COMPONENT( *this ); return new SCH_COMPONENT( *this );
} }
......
...@@ -407,16 +407,19 @@ public: ...@@ -407,16 +407,19 @@ public:
/** @copydoc SCH_ITEM::SetPosition() */ /** @copydoc SCH_ITEM::SetPosition() */
virtual void SetPosition( const wxPoint& aPosition ) { Move( aPosition - m_Pos ); } virtual void SetPosition( const wxPoint& aPosition ) { Move( aPosition - m_Pos ); }
/** @copydoc SCH_ITEM::HitTest(wxPoint&,int) */ /** @copydoc SCH_ITEM::HitTest(const wxPoint&,int)const */
virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const; virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const;
/** @copydoc SCH_ITEM::HitTest(EDA_RECT&,bool=false,int=0) */ /** @copydoc SCH_ITEM::HitTest(const EDA_RECT&,bool,int)const */
virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false, virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false,
int aAccuracy = 0 ) const; int aAccuracy = 0 ) const;
/** @copydoc SCH_ITEM::Plot() */ /** @copydoc SCH_ITEM::Plot() */
virtual void Plot( PLOTTER* aPlotter ); virtual void Plot( PLOTTER* aPlotter );
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // override void Show( int nestLevel, std::ostream& os ) const; // override
#endif #endif
...@@ -424,8 +427,6 @@ public: ...@@ -424,8 +427,6 @@ public:
private: private:
/** @copydoc SCH_ITEM::doIsConnected() */ /** @copydoc SCH_ITEM::doIsConnected() */
virtual bool doIsConnected( const wxPoint& aPosition ) const; virtual bool doIsConnected( const wxPoint& aPosition ) const;
virtual EDA_ITEM* doClone() const;
}; };
......
...@@ -84,7 +84,7 @@ SCH_FIELD::~SCH_FIELD() ...@@ -84,7 +84,7 @@ SCH_FIELD::~SCH_FIELD()
} }
EDA_ITEM* SCH_FIELD::doClone() const EDA_ITEM* SCH_FIELD::Clone() const
{ {
return new SCH_FIELD( *this ); return new SCH_FIELD( *this );
} }
......
...@@ -223,22 +223,22 @@ public: ...@@ -223,22 +223,22 @@ public:
/** @copydoc SCH_ITEM::SetPosition() */ /** @copydoc SCH_ITEM::SetPosition() */
virtual void SetPosition( const wxPoint& aPosition ); virtual void SetPosition( const wxPoint& aPosition );
/** @copydoc SCH_ITEM::HitTest(wxPoint&,int) */ /** @copydoc SCH_ITEM::HitTest(const wxPoint&,int)const */
virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const; virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const;
/** @copydoc SCH_ITEM::HitTest(EDA_RECT&,bool=false,int=0) */ /** @copydoc SCH_ITEM::HitTest(const EDA_RECT&,bool,int)const */
virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false, virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false,
int aAccuracy = 0 ) const; int aAccuracy = 0 ) const;
/** @copydoc SCH_ITEM::Plot() */ /** @copydoc SCH_ITEM::Plot() */
virtual void Plot( PLOTTER* aPlotter ); virtual void Plot( PLOTTER* aPlotter );
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif
private:
virtual EDA_ITEM* doClone() const;
}; };
......
...@@ -65,7 +65,7 @@ bool SCH_JUNCTION::Save( FILE* aFile ) const ...@@ -65,7 +65,7 @@ bool SCH_JUNCTION::Save( FILE* aFile ) const
} }
EDA_ITEM* SCH_JUNCTION::doClone() const EDA_ITEM* SCH_JUNCTION::Clone() const
{ {
return new SCH_JUNCTION( *this ); return new SCH_JUNCTION( *this );
} }
......
...@@ -122,23 +122,24 @@ public: ...@@ -122,23 +122,24 @@ public:
/** @copydoc SCH_ITEM::SetPosition() */ /** @copydoc SCH_ITEM::SetPosition() */
virtual void SetPosition( const wxPoint& aPosition ) { m_pos = aPosition; } virtual void SetPosition( const wxPoint& aPosition ) { m_pos = aPosition; }
/** @copydoc SCH_ITEM::HitTest(wxPoint&,int) */ /** @copydoc SCH_ITEM::HitTest(const wxPoint&,int)const */
virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const; virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const;
/** @copydoc SCH_ITEM::HitTest(EDA_RECT&,bool=false,int=0) */ /** @copydoc SCH_ITEM::HitTest(const EDA_RECT&,bool,int)const */
virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false, virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false,
int aAccuracy = 0 ) const; int aAccuracy = 0 ) const;
/** @copydoc SCH_ITEM::Plot() */ /** @copydoc SCH_ITEM::Plot() */
virtual void Plot( PLOTTER* aPlotter ); virtual void Plot( PLOTTER* aPlotter );
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // override void Show( int nestLevel, std::ostream& os ) const; // override
#endif #endif
private: private:
virtual EDA_ITEM* doClone() const;
/** @copydoc SCH_ITEM::doIsConnected() */ /** @copydoc SCH_ITEM::doIsConnected() */
virtual bool doIsConnected( const wxPoint& aPosition ) const; virtual bool doIsConnected( const wxPoint& aPosition ) const;
}; };
......
...@@ -78,7 +78,7 @@ SCH_LINE::SCH_LINE( const SCH_LINE& aLine ) : ...@@ -78,7 +78,7 @@ SCH_LINE::SCH_LINE( const SCH_LINE& aLine ) :
} }
EDA_ITEM* SCH_LINE::doClone() const EDA_ITEM* SCH_LINE::Clone() const
{ {
return new SCH_LINE( *this ); return new SCH_LINE( *this );
} }
......
...@@ -175,16 +175,19 @@ public: ...@@ -175,16 +175,19 @@ public:
/** @copydoc SCH_ITEM::SetPosition() */ /** @copydoc SCH_ITEM::SetPosition() */
virtual void SetPosition( const wxPoint& aPosition ); virtual void SetPosition( const wxPoint& aPosition );
/** @copydoc SCH_ITEM::HitTest(wxPoint&,int) */ /** @copydoc SCH_ITEM::HitTest(const wxPoint&,int)const */
virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const; virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const;
/** @copydoc SCH_ITEM::HitTest(EDA_RECT&,bool=false,int=0) */ /** @copydoc SCH_ITEM::HitTest(const EDA_RECT&,bool,int)const */
virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false, virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false,
int aAccuracy = 0 ) const; int aAccuracy = 0 ) const;
/** @copydoc SCH_ITEM::Plot() */ /** @copydoc SCH_ITEM::Plot() */
virtual void Plot( PLOTTER* aPlotter ); virtual void Plot( PLOTTER* aPlotter );
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // override void Show( int nestLevel, std::ostream& os ) const; // override
#endif #endif
...@@ -192,8 +195,6 @@ public: ...@@ -192,8 +195,6 @@ public:
private: private:
/** @copydoc SCH_ITEM::doIsConnected() */ /** @copydoc SCH_ITEM::doIsConnected() */
virtual bool doIsConnected( const wxPoint& aPosition ) const; virtual bool doIsConnected( const wxPoint& aPosition ) const;
virtual EDA_ITEM* doClone() const;
}; };
......
...@@ -73,7 +73,7 @@ SCH_MARKER::~SCH_MARKER() ...@@ -73,7 +73,7 @@ SCH_MARKER::~SCH_MARKER()
} }
EDA_ITEM* SCH_MARKER::doClone() const EDA_ITEM* SCH_MARKER::Clone() const
{ {
return new SCH_MARKER( *this ); return new SCH_MARKER( *this );
} }
......
...@@ -135,14 +135,15 @@ public: ...@@ -135,14 +135,15 @@ public:
/** @copydoc SCH_ITEM::SetPosition() */ /** @copydoc SCH_ITEM::SetPosition() */
virtual void SetPosition( const wxPoint& aPosition ) { m_Pos = aPosition; } virtual void SetPosition( const wxPoint& aPosition ) { m_Pos = aPosition; }
/** @copydoc SCH_ITEM::HitTest(wxPoint&,int) */ /** @copydoc SCH_ITEM::HitTest(const wxPoint&,int)const */
virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const; virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const;
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // override void Show( int nestLevel, std::ostream& os ) const; // override
#endif #endif
virtual EDA_ITEM* doClone() const;
}; };
#endif // TYPE_SCH_MARKER_H_ #endif // TYPE_SCH_MARKER_H_
...@@ -54,7 +54,7 @@ SCH_NO_CONNECT::SCH_NO_CONNECT( const wxPoint& pos ) : ...@@ -54,7 +54,7 @@ SCH_NO_CONNECT::SCH_NO_CONNECT( const wxPoint& pos ) :
} }
EDA_ITEM* SCH_NO_CONNECT::doClone() const EDA_ITEM* SCH_NO_CONNECT::Clone() const
{ {
return new SCH_NO_CONNECT( *this ); return new SCH_NO_CONNECT( *this );
} }
......
...@@ -128,16 +128,19 @@ public: ...@@ -128,16 +128,19 @@ public:
/** @copydoc SCH_ITEM::SetPosition() */ /** @copydoc SCH_ITEM::SetPosition() */
virtual void SetPosition( const wxPoint& aPosition ) { m_pos = aPosition; } virtual void SetPosition( const wxPoint& aPosition ) { m_pos = aPosition; }
/** @copydoc SCH_ITEM::HitTest(wxPoint&,int) */ /** @copydoc SCH_ITEM::HitTest(const wxPoint&,int)const */
virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const; virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const;
/** @copydoc SCH_ITEM::HitTest(EDA_RECT&,bool=false,int=0) */ /** @copydoc SCH_ITEM::HitTest(const EDA_RECT&,bool,int)const */
virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false, virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false,
int aAccuracy = 0 ) const; int aAccuracy = 0 ) const;
/** @copydoc SCH_ITEM::Plot() */ /** @copydoc SCH_ITEM::Plot() */
virtual void Plot( PLOTTER* aPlotter ); virtual void Plot( PLOTTER* aPlotter );
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif
...@@ -145,8 +148,6 @@ public: ...@@ -145,8 +148,6 @@ public:
private: private:
/** @copydoc SCH_ITEM::doIsConnected() */ /** @copydoc SCH_ITEM::doIsConnected() */
virtual bool doIsConnected( const wxPoint& aPosition ) const; virtual bool doIsConnected( const wxPoint& aPosition ) const;
virtual EDA_ITEM* doClone() const;
}; };
......
...@@ -64,7 +64,7 @@ SCH_POLYLINE::~SCH_POLYLINE() ...@@ -64,7 +64,7 @@ SCH_POLYLINE::~SCH_POLYLINE()
} }
EDA_ITEM* SCH_POLYLINE::doClone() const EDA_ITEM* SCH_POLYLINE::Clone() const
{ {
return new SCH_POLYLINE( *this ); return new SCH_POLYLINE( *this );
} }
......
...@@ -155,19 +155,19 @@ public: ...@@ -155,19 +155,19 @@ public:
/** @copydoc SCH_ITEM::SetPosition() */ /** @copydoc SCH_ITEM::SetPosition() */
virtual void SetPosition( const wxPoint& aPosition ); virtual void SetPosition( const wxPoint& aPosition );
/** @copydoc SCH_ITEM::HitTest(wxPoint&,int) */ /** @copydoc SCH_ITEM::HitTest(const wxPoint&,int)const */
virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const; virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const;
/** @copydoc SCH_ITEM::HitTest(EDA_RECT&,bool=false,int=0) */ /** @copydoc SCH_ITEM::HitTest(const EDA_RECT&,bool,int)const */
virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false, virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false,
int aAccuracy = 0 ) const; int aAccuracy = 0 ) const;
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif
private:
virtual EDA_ITEM* doClone() const;
}; };
......
...@@ -259,7 +259,7 @@ void SCH_SCREEN::ExtractWires( DLIST< SCH_ITEM >& aList, bool aCreateCopy ) ...@@ -259,7 +259,7 @@ void SCH_SCREEN::ExtractWires( DLIST< SCH_ITEM >& aList, bool aCreateCopy )
aList.Append( item ); aList.Append( item );
if( aCreateCopy ) if( aCreateCopy )
m_drawList.Insert( item->Clone(), next_item ); m_drawList.Insert( (SCH_ITEM*) item->Clone(), next_item );
break; break;
......
...@@ -98,7 +98,7 @@ SCH_SHEET::~SCH_SHEET() ...@@ -98,7 +98,7 @@ SCH_SHEET::~SCH_SHEET()
} }
EDA_ITEM* SCH_SHEET::doClone() const EDA_ITEM* SCH_SHEET::Clone() const
{ {
return new SCH_SHEET( *this ); return new SCH_SHEET( *this );
} }
......
...@@ -78,8 +78,6 @@ private: ...@@ -78,8 +78,6 @@ private:
*/ */
int m_edge; int m_edge;
virtual EDA_ITEM* doClone() const;
public: public:
SCH_SHEET_PIN( SCH_SHEET* parent, SCH_SHEET_PIN( SCH_SHEET* parent,
const wxPoint& pos = wxPoint( 0, 0 ), const wxPoint& pos = wxPoint( 0, 0 ),
...@@ -221,8 +219,11 @@ public: ...@@ -221,8 +219,11 @@ public:
virtual void SetPosition( const wxPoint& aPosition ) { ConstrainOnEdge( aPosition ); } virtual void SetPosition( const wxPoint& aPosition ) { ConstrainOnEdge( aPosition ); }
/** @copydoc SCH_ITEM::HitTest(wxPoint&,int) */ /** @copydoc SCH_ITEM::HitTest(const wxPoint&,int)const */
virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const; virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const;
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
}; };
...@@ -632,16 +633,19 @@ public: ...@@ -632,16 +633,19 @@ public:
/** @copydoc SCH_ITEM::SetPosition() */ /** @copydoc SCH_ITEM::SetPosition() */
virtual void SetPosition( const wxPoint& aPosition ) { m_pos = aPosition; } virtual void SetPosition( const wxPoint& aPosition ) { m_pos = aPosition; }
/** @copydoc SCH_ITEM::HitTest(wxPoint&,int) */ /** @copydoc SCH_ITEM::HitTest(const wxPoint&,int)const */
virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const; virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const;
/** @copydoc SCH_ITEM::HitTest(EDA_RECT&,bool=false,int=0) */ /** @copydoc SCH_ITEM::HitTest(const EDA_RECT&,bool,int)const */
virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false, virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false,
int aAccuracy = 0 ) const; int aAccuracy = 0 ) const;
/** @copydoc SCH_ITEM::Plot() */ /** @copydoc SCH_ITEM::Plot() */
virtual void Plot( PLOTTER* aPlotter ); virtual void Plot( PLOTTER* aPlotter );
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // override void Show( int nestLevel, std::ostream& os ) const; // override
#endif #endif
...@@ -656,9 +660,6 @@ protected: ...@@ -656,9 +660,6 @@ protected:
* sheet pin is added or removed. * sheet pin is added or removed.
*/ */
void renumberPins(); void renumberPins();
private:
virtual EDA_ITEM* doClone() const;
}; };
......
...@@ -61,7 +61,7 @@ SCH_SHEET_PIN::SCH_SHEET_PIN( SCH_SHEET* parent, const wxPoint& pos, const wxStr ...@@ -61,7 +61,7 @@ SCH_SHEET_PIN::SCH_SHEET_PIN( SCH_SHEET* parent, const wxPoint& pos, const wxStr
} }
EDA_ITEM* SCH_SHEET_PIN::doClone() const EDA_ITEM* SCH_SHEET_PIN::Clone() const
{ {
return new SCH_SHEET_PIN( *this ); return new SCH_SHEET_PIN( *this );
} }
......
...@@ -122,7 +122,7 @@ SCH_TEXT::SCH_TEXT( const SCH_TEXT& aText ) : ...@@ -122,7 +122,7 @@ SCH_TEXT::SCH_TEXT( const SCH_TEXT& aText ) :
} }
EDA_ITEM* SCH_TEXT::doClone() const EDA_ITEM* SCH_TEXT::Clone() const
{ {
return new SCH_TEXT( *this ); return new SCH_TEXT( *this );
} }
...@@ -758,7 +758,7 @@ SCH_LABEL::SCH_LABEL( const wxPoint& pos, const wxString& text ) : ...@@ -758,7 +758,7 @@ SCH_LABEL::SCH_LABEL( const wxPoint& pos, const wxString& text ) :
} }
EDA_ITEM* SCH_LABEL::doClone() const EDA_ITEM* SCH_LABEL::Clone() const
{ {
return new SCH_LABEL( *this ); return new SCH_LABEL( *this );
} }
...@@ -960,7 +960,7 @@ SCH_GLOBALLABEL::SCH_GLOBALLABEL( const wxPoint& pos, const wxString& text ) : ...@@ -960,7 +960,7 @@ SCH_GLOBALLABEL::SCH_GLOBALLABEL( const wxPoint& pos, const wxString& text ) :
} }
EDA_ITEM* SCH_GLOBALLABEL::doClone() const EDA_ITEM* SCH_GLOBALLABEL::Clone() const
{ {
return new SCH_GLOBALLABEL( *this ); return new SCH_GLOBALLABEL( *this );
} }
...@@ -1389,7 +1389,7 @@ SCH_HIERLABEL::SCH_HIERLABEL( const wxPoint& pos, const wxString& text, KICAD_T ...@@ -1389,7 +1389,7 @@ SCH_HIERLABEL::SCH_HIERLABEL( const wxPoint& pos, const wxString& text, KICAD_T
} }
EDA_ITEM* SCH_HIERLABEL::doClone() const EDA_ITEM* SCH_HIERLABEL::Clone() const
{ {
return new SCH_HIERLABEL( *this ); return new SCH_HIERLABEL( *this );
} }
......
...@@ -247,22 +247,22 @@ public: ...@@ -247,22 +247,22 @@ public:
/** @copydoc SCH_ITEM::SetPosition() */ /** @copydoc SCH_ITEM::SetPosition() */
virtual void SetPosition( const wxPoint& aPosition ) { m_Pos = aPosition; } virtual void SetPosition( const wxPoint& aPosition ) { m_Pos = aPosition; }
/** @copydoc SCH_ITEM::HitTest(wxPoint&,int) */ /** @copydoc SCH_ITEM::HitTest(const wxPoint&,int)const */
virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const; virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const;
/** @copydoc SCH_ITEM::HitTest(EDA_RECT&,bool=false,int=0) */ /** @copydoc SCH_ITEM::HitTest(const EDA_RECT&,bool,int)const */
virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false, virtual bool HitTest( const EDA_RECT& aRect, bool aContained = false,
int aAccuracy = 0 ) const; int aAccuracy = 0 ) const;
/** @copydoc SCH_ITEM::Plot() */ /** @copydoc SCH_ITEM::Plot() */
virtual void Plot( PLOTTER* aPlotter ); virtual void Plot( PLOTTER* aPlotter );
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // override void Show( int nestLevel, std::ostream& os ) const; // override
#endif #endif
private:
virtual EDA_ITEM* doClone() const;
}; };
...@@ -358,14 +358,15 @@ public: ...@@ -358,14 +358,15 @@ public:
*/ */
virtual bool IsReplaceable() const { return true; } virtual bool IsReplaceable() const { return true; }
/** @copydoc SCH_ITEM::HitTest(wxPoint&,int) */ /** @copydoc SCH_ITEM::HitTest(const wxPoint&,int)const */
virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const; virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const;
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
private: private:
/** @copydoc SCH_ITEM::doIsConnected() */ /** @copydoc SCH_ITEM::doIsConnected() */
virtual bool doIsConnected( const wxPoint& aPosition ) const { return m_Pos == aPosition; } virtual bool doIsConnected( const wxPoint& aPosition ) const { return m_Pos == aPosition; }
virtual EDA_ITEM* doClone() const;
}; };
...@@ -467,14 +468,15 @@ public: ...@@ -467,14 +468,15 @@ public:
/** @copydoc EDA_ITEM::GetMenuImage() */ /** @copydoc EDA_ITEM::GetMenuImage() */
virtual BITMAP_DEF GetMenuImage() const { return add_glabel_xpm; } virtual BITMAP_DEF GetMenuImage() const { return add_glabel_xpm; }
/** @copydoc SCH_ITEM::HitTest(wxPoint&,int) */ /** @copydoc SCH_ITEM::HitTest(const wxPoint&,int)const */
virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const; virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const;
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
private: private:
/** @copydoc SCH_ITEM::doIsConnected() */ /** @copydoc SCH_ITEM::doIsConnected() */
virtual bool doIsConnected( const wxPoint& aPosition ) const { return m_Pos == aPosition; } virtual bool doIsConnected( const wxPoint& aPosition ) const { return m_Pos == aPosition; }
virtual EDA_ITEM* doClone() const;
}; };
...@@ -578,14 +580,15 @@ public: ...@@ -578,14 +580,15 @@ public:
/** @copydoc EDA_ITEM::GetMenuImage() */ /** @copydoc EDA_ITEM::GetMenuImage() */
virtual BITMAP_DEF GetMenuImage() const { return add_hierarchical_label_xpm; } virtual BITMAP_DEF GetMenuImage() const { return add_hierarchical_label_xpm; }
/** @copydoc SCH_ITEM::HitTest(wxPoint&,int) */ /** @copydoc SCH_ITEM::HitTest(const wxPoint&,int)const */
virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const; virtual bool HitTest( const wxPoint& aPosition, int aAccuracy ) const;
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
private: private:
/** @copydoc SCH_ITEM::doIsConnected() */ /** @copydoc SCH_ITEM::doIsConnected() */
virtual bool doIsConnected( const wxPoint& aPosition ) const { return m_Pos == aPosition; } virtual bool doIsConnected( const wxPoint& aPosition ) const { return m_Pos == aPosition; }
virtual EDA_ITEM* doClone() const;
}; };
#endif /* CLASS_TEXT_LABEL_H */ #endif /* CLASS_TEXT_LABEL_H */
...@@ -391,7 +391,7 @@ void SCH_EDIT_FRAME::SetUndoItem( const SCH_ITEM* aItem ) ...@@ -391,7 +391,7 @@ void SCH_EDIT_FRAME::SetUndoItem( const SCH_ITEM* aItem )
m_undoItem = NULL; m_undoItem = NULL;
if( aItem ) if( aItem )
m_undoItem = aItem->Clone(); m_undoItem = (SCH_ITEM*) aItem->Clone();
} }
......
...@@ -389,22 +389,8 @@ protected: ...@@ -389,22 +389,8 @@ protected:
EDA_ITEM* m_Image; EDA_ITEM* m_Image;
private: private:
void InitVars();
/** void InitVars();
* Function doClone
* is used by the derived class to actually implement the cloning.
*
* The default version will return NULL in release builds and likely crash the
* program. In debug builds, an 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.
*
* @return A clone of the item.
*/
virtual EDA_ITEM* doClone() const;
public: public:
...@@ -542,14 +528,16 @@ public: ...@@ -542,14 +528,16 @@ public:
* Function Clone * Function Clone
* creates a duplicate of this item with linked list members set to NULL. * creates a duplicate of this item with linked list members set to NULL.
* *
* The Clone() function only calls the private virtual doClone() which actually * The default version will return NULL in release builds and likely crash the
* does the cloning for the derived object. * program. In debug builds, a warning message indicating the derived class
* * has not implemented cloning. This really should be a pure virtual function.
* @todo: use this instead of Copy() everywhere, then kill Copy(). * 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.
* *
* @return A clone of the item. * @return A clone of the item.
*/ */
EDA_ITEM* Clone() const; // should not be inline, to save the ~ 6 bytes per call site. virtual EDA_ITEM* Clone() const; // should not be inline, to save the ~ 6 bytes per call site.
/** /**
* Function IterateForward * Function IterateForward
......
...@@ -276,7 +276,7 @@ extern bool g_ShowPageLimits; ///< true to display the page limits ...@@ -276,7 +276,7 @@ extern bool g_ShowPageLimits; ///< true to display the page limits
/// Name of default configuration file. (kicad.pro) /// Name of default configuration file. (kicad.pro)
extern wxString g_Prj_Default_Config_FullFilename; extern wxString g_Prj_Default_Config_FullFilename;
/// Name of local configuration file. (<curr projet>.pro) /// Name of local configuration file. (\<curr projet\>.pro)
extern wxString g_Prj_Config_LocalFilename; extern wxString g_Prj_Config_LocalFilename;
extern EDA_UNITS_T g_UserUnit; ///< display units extern EDA_UNITS_T g_UserUnit; ///< display units
......
...@@ -137,8 +137,6 @@ public: ...@@ -137,8 +137,6 @@ public:
return wxT( "SCH_ITEM" ); return wxT( "SCH_ITEM" );
} }
SCH_ITEM* Clone() const { return ( SCH_ITEM* ) EDA_ITEM::Clone(); }
/** /**
* Function SwapData * Function SwapData
* swap the internal data structures \a aItem with the schematic item. * swap the internal data structures \a aItem with the schematic item.
...@@ -301,6 +299,7 @@ public: ...@@ -301,6 +299,7 @@ public:
*/ */
bool IsConnected( const wxPoint& aPoint ) const; bool IsConnected( const wxPoint& aPoint ) const;
/** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
virtual bool HitTest( const wxPoint& aPosition ) { return HitTest( aPosition, 0 ); } virtual bool HitTest( const wxPoint& aPosition ) { return HitTest( aPosition, 0 ); }
/** /**
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -731,7 +730,7 @@ public: ...@@ -731,7 +730,7 @@ public:
/** /**
* Function DoGenFootprintsPositionFile * Function DoGenFootprintsPositionFile
* Creates an ascii footprint position file * Creates an ascii footprint position file
* @param aFullFilename = the full file name of the file to create * @param aFullFileName = the full file name of the file to create
* @param aUnitsMM = false to use inches, true to use mm in coordinates * @param aUnitsMM = false to use inches, true to use mm in coordinates
* @param aForceSmdItems = true to force all footprints with smd pads in list * @param aForceSmdItems = true to force all footprints with smd pads in list
* = false to put only footprints with option "INSERT" in list * = false to put only footprints with option "INSERT" in list
......
...@@ -560,7 +560,6 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed ...@@ -560,7 +560,6 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
* Undo the last edition: * Undo the last edition:
* - Save the current board state in Redo list * - Save the current board state in Redo list
* - Get an old version of the board state from Undo list * - Get an old version of the board state from Undo list
* @return none
*/ */
void PCB_EDIT_FRAME::GetBoardFromUndoList( wxCommandEvent& event ) void PCB_EDIT_FRAME::GetBoardFromUndoList( wxCommandEvent& event )
{ {
......
...@@ -602,7 +602,7 @@ wxString DIMENSION::GetSelectMenuText() const ...@@ -602,7 +602,7 @@ wxString DIMENSION::GetSelectMenuText() const
} }
EDA_ITEM* DIMENSION::doClone() const EDA_ITEM* DIMENSION::Clone() const
{ {
return new DIMENSION( *this ); return new DIMENSION( *this );
} }
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -151,11 +150,11 @@ public: ...@@ -151,11 +150,11 @@ public:
*/ */
void DisplayInfo( EDA_DRAW_FRAME* frame ); void DisplayInfo( EDA_DRAW_FRAME* frame );
/** @copydoc EDA_ITEM::HitTest(wxPoint&) */ /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
bool HitTest( const wxPoint& aPosition ); virtual bool HitTest( const wxPoint& aPosition );
/** @copydoc EDA_ITEM::HitTest(EDA_RECT&) */ /** @copydoc EDA_ITEM::HitTest(const EDA_RECT&)const */
bool HitTest( const EDA_RECT& aRect ) const; virtual bool HitTest( const EDA_RECT& aRect ) const;
/** /**
* Function GetClass * Function GetClass
...@@ -173,12 +172,12 @@ public: ...@@ -173,12 +172,12 @@ public:
virtual BITMAP_DEF GetMenuImage() const { return add_dimension_xpm; } virtual BITMAP_DEF GetMenuImage() const { return add_dimension_xpm; }
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif
private:
virtual EDA_ITEM* doClone() const;
}; };
#endif // DIMENSION_H_ #endif // DIMENSION_H_
...@@ -538,7 +538,7 @@ wxString DRAWSEGMENT::GetSelectMenuText() const ...@@ -538,7 +538,7 @@ wxString DRAWSEGMENT::GetSelectMenuText() const
} }
EDA_ITEM* DRAWSEGMENT::doClone() const EDA_ITEM* DRAWSEGMENT::Clone() const
{ {
return new DRAWSEGMENT( *this ); return new DRAWSEGMENT( *this );
} }
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -186,11 +185,11 @@ public: ...@@ -186,11 +185,11 @@ public:
*/ */
virtual EDA_RECT GetBoundingBox() const; virtual EDA_RECT GetBoundingBox() const;
/** @copydoc EDA_ITEM::HitTest(wxPoint&) */ /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
bool HitTest( const wxPoint& aPosition ); virtual bool HitTest( const wxPoint& aPosition );
/** @copydoc EDA_ITEM::HitTest(EDA_RECT&) */ /** @copydoc EDA_ITEM::HitTest(const EDA_RECT&)const */
bool HitTest( const EDA_RECT& aRect ) const; virtual bool HitTest( const EDA_RECT& aRect ) const;
/** /**
* Function GetClass * Function GetClass
...@@ -261,12 +260,12 @@ public: ...@@ -261,12 +260,12 @@ public:
virtual BITMAP_DEF GetMenuImage() const { return add_dashed_line_xpm; } virtual BITMAP_DEF GetMenuImage() const { return add_dashed_line_xpm; }
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // overload void Show( int nestLevel, std::ostream& os ) const; // overload
#endif #endif
private:
virtual EDA_ITEM* doClone() const;
}; };
#endif // CLASS_DRAWSEGMENT_H_ #endif // CLASS_DRAWSEGMENT_H_
...@@ -273,7 +273,7 @@ wxString EDGE_MODULE::GetSelectMenuText() const ...@@ -273,7 +273,7 @@ wxString EDGE_MODULE::GetSelectMenuText() const
} }
EDA_ITEM* EDGE_MODULE::doClone() const EDA_ITEM* EDGE_MODULE::Clone() const
{ {
return new EDGE_MODULE( *this ); return new EDGE_MODULE( *this );
} }
......
...@@ -107,12 +107,12 @@ public: ...@@ -107,12 +107,12 @@ public:
virtual BITMAP_DEF GetMenuImage() const { return show_mod_edge_xpm; } virtual BITMAP_DEF GetMenuImage() const { return show_mod_edge_xpm; }
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // overload void Show( int nestLevel, std::ostream& os ) const; // overload
#endif #endif
private:
virtual EDA_ITEM* doClone() const;
}; };
#endif // CLASS_EDGE_MOD_H_ #endif // CLASS_EDGE_MOD_H_
...@@ -80,8 +80,8 @@ public: ...@@ -80,8 +80,8 @@ public:
const wxPoint& GetPosition() const { return m_Pos; } const wxPoint& GetPosition() const { return m_Pos; }
void SetPosition( const wxPoint& aPos ) { m_Pos = aPos; } void SetPosition( const wxPoint& aPos ) { m_Pos = aPos; }
/** @copydoc EDA_ITEM::HitTest(wxPoint&) */ /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
bool HitTest( const wxPoint& aPosition ) virtual bool HitTest( const wxPoint& aPosition )
{ {
return HitTestMarker( aPosition ); return HitTestMarker( aPosition );
} }
......
...@@ -219,7 +219,7 @@ wxString PCB_TARGET::GetSelectMenuText() const ...@@ -219,7 +219,7 @@ wxString PCB_TARGET::GetSelectMenuText() const
} }
EDA_ITEM* PCB_TARGET::doClone() const EDA_ITEM* PCB_TARGET::Clone() const
{ {
return new PCB_TARGET( *this ); return new PCB_TARGET( *this );
} }
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -118,11 +117,11 @@ public: ...@@ -118,11 +117,11 @@ public:
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode,
const wxPoint& offset = ZeroOffset ); const wxPoint& offset = ZeroOffset );
/** @copydoc EDA_ITEM::HitTest(wxPoint&) */ /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
bool HitTest( const wxPoint& aPosition ); virtual bool HitTest( const wxPoint& aPosition );
/** @copydoc EDA_ITEM::HitTest(EDA_RECT&) */ /** @copydoc EDA_ITEM::HitTest(const EDA_RECT&)const */
bool HitTest( const EDA_RECT& aRect ) const; virtual bool HitTest( const EDA_RECT& aRect ) const;
EDA_RECT GetBoundingBox() const; EDA_RECT GetBoundingBox() const;
...@@ -130,12 +129,12 @@ public: ...@@ -130,12 +129,12 @@ public:
virtual BITMAP_DEF GetMenuImage() const { return add_mires_xpm; } virtual BITMAP_DEF GetMenuImage() const { return add_mires_xpm; }
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif
private:
virtual EDA_ITEM* doClone() const;
}; };
......
...@@ -657,7 +657,7 @@ wxString MODULE::GetSelectMenuText() const ...@@ -657,7 +657,7 @@ wxString MODULE::GetSelectMenuText() const
} }
EDA_ITEM* MODULE::doClone() const EDA_ITEM* MODULE::Clone() const
{ {
return new MODULE( *this ); return new MODULE( *this );
} }
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -321,11 +320,11 @@ public: ...@@ -321,11 +320,11 @@ public:
*/ */
void DisplayInfo( EDA_DRAW_FRAME* frame ); void DisplayInfo( EDA_DRAW_FRAME* frame );
/** @copydoc EDA_ITEM::HitTest(wxPoint&) */ /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
bool HitTest( const wxPoint& aPosition ); virtual bool HitTest( const wxPoint& aPosition );
/** @copydoc EDA_ITEM::HitTest(EDA_RECT&) */ /** @copydoc EDA_ITEM::HitTest(const EDA_RECT&)const */
bool HitTest( const EDA_RECT& aRect ) const; virtual bool HitTest( const EDA_RECT& aRect ) const;
/** /**
* Function GetReference * Function GetReference
...@@ -338,9 +337,10 @@ public: ...@@ -338,9 +337,10 @@ public:
/** /**
* Function SetReference * Function SetReference
* @param const wxString& - the reference designator text. * @param aReference A reference to a wxString object containing the reference designator
* text.
*/ */
void SetReference( const wxString& aReference) void SetReference( const wxString& aReference )
{ {
m_Reference->m_Text = aReference; m_Reference->m_Text = aReference;
} }
...@@ -356,7 +356,7 @@ public: ...@@ -356,7 +356,7 @@ public:
/** /**
* Function SetValue * Function SetValue
* @param const wxString& - the value text. * @param aValue A reference to a wxString object containing the value text.
*/ */
void SetValue( const wxString& aValue ) void SetValue( const wxString& aValue )
{ {
...@@ -413,12 +413,12 @@ public: ...@@ -413,12 +413,12 @@ public:
virtual BITMAP_DEF GetMenuImage() const { return module_xpm; } virtual BITMAP_DEF GetMenuImage() const { return module_xpm; }
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // overload void Show( int nestLevel, std::ostream& os ) const; // overload
#endif #endif
private:
virtual EDA_ITEM* doClone() const;
}; };
......
...@@ -823,7 +823,7 @@ wxString D_PAD::GetSelectMenuText() const ...@@ -823,7 +823,7 @@ wxString D_PAD::GetSelectMenuText() const
return text; return text;
} }
EDA_ITEM* D_PAD::doClone() const EDA_ITEM* D_PAD::Clone() const
{ {
return new D_PAD( *this ); return new D_PAD( *this );
} }
......
...@@ -386,8 +386,8 @@ public: ...@@ -386,8 +386,8 @@ public:
*/ */
bool IsOnLayer( int aLayer ) const; bool IsOnLayer( int aLayer ) const;
/** @copydoc EDA_ITEM::HitTest(wxPoint&) */ /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
bool HitTest( const wxPoint& aPosition ); virtual bool HitTest( const wxPoint& aPosition );
/** /**
* Function GetClass * Function GetClass
...@@ -448,14 +448,15 @@ public: ...@@ -448,14 +448,15 @@ public:
*/ */
void AppendConfigs( PARAM_CFG_ARRAY* aResult ); void AppendConfigs( PARAM_CFG_ARRAY* aResult );
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // overload void Show( int nestLevel, std::ostream& os ) const; // overload
#endif #endif
private: private:
virtual EDA_ITEM* doClone() const;
/** /**
* Function boundingRadius * Function boundingRadius
* returns a calculated radius of a bounding circle for this pad. * returns a calculated radius of a bounding circle for this pad.
......
...@@ -184,7 +184,7 @@ wxString TEXTE_PCB::GetSelectMenuText() const ...@@ -184,7 +184,7 @@ wxString TEXTE_PCB::GetSelectMenuText() const
} }
EDA_ITEM* TEXTE_PCB::doClone() const EDA_ITEM* TEXTE_PCB::Clone() const
{ {
return new TEXTE_PCB( *this ); return new TEXTE_PCB( *this );
} }
......
...@@ -108,14 +108,14 @@ public: ...@@ -108,14 +108,14 @@ public:
*/ */
void DisplayInfo( EDA_DRAW_FRAME* frame ); void DisplayInfo( EDA_DRAW_FRAME* frame );
/** @copydoc EDA_ITEM::HitTest(wxPoint&) */ /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
bool HitTest( const wxPoint& aPosition ) virtual bool HitTest( const wxPoint& aPosition )
{ {
return TextHitTest( aPosition ); return TextHitTest( aPosition );
} }
/** @copydoc EDA_ITEM::HitTest(EDA_RECT&) */ /** @copydoc EDA_ITEM::HitTest(const EDA_RECT&)const */
bool HitTest( const EDA_RECT& aRect ) virtual bool HitTest( const EDA_RECT& aRect ) const
{ {
return TextHitTest( aRect ); return TextHitTest( aRect );
} }
...@@ -153,12 +153,12 @@ public: ...@@ -153,12 +153,12 @@ public:
virtual EDA_RECT GetBoundingBox() const { return GetTextBox(); }; virtual EDA_RECT GetBoundingBox() const { return GetTextBox(); };
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; void Show( int nestLevel, std::ostream& os ) const;
#endif #endif
private:
virtual EDA_ITEM* doClone() const;
}; };
#endif // #define CLASS_PCB_TEXT_H #endif // #define CLASS_PCB_TEXT_H
...@@ -474,7 +474,7 @@ wxString TEXTE_MODULE::GetSelectMenuText() const ...@@ -474,7 +474,7 @@ wxString TEXTE_MODULE::GetSelectMenuText() const
} }
EDA_ITEM* TEXTE_MODULE::doClone() const EDA_ITEM* TEXTE_MODULE::Clone() const
{ {
return new TEXTE_MODULE( *this ); return new TEXTE_MODULE( *this );
} }
......
...@@ -167,8 +167,8 @@ public: ...@@ -167,8 +167,8 @@ public:
void DisplayInfo( EDA_DRAW_FRAME* frame ); void DisplayInfo( EDA_DRAW_FRAME* frame );
/** @copydoc EDA_ITEM::HitTest(wxPoint&) */ /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
bool HitTest( const wxPoint& aPosition ); virtual bool HitTest( const wxPoint& aPosition );
/** /**
* Function IsOnLayer * Function IsOnLayer
...@@ -208,12 +208,12 @@ public: ...@@ -208,12 +208,12 @@ public:
virtual BITMAP_DEF GetMenuImage() const { return footprint_text_xpm; } virtual BITMAP_DEF GetMenuImage() const { return footprint_text_xpm; }
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // overload void Show( int nestLevel, std::ostream& os ) const; // overload
#endif #endif
private:
virtual EDA_ITEM* doClone() const;
}; };
#endif // TEXT_MODULE_H_ #endif // TEXT_MODULE_H_
...@@ -130,7 +130,7 @@ TRACK::TRACK( BOARD_ITEM* aParent, KICAD_T idtype ) : ...@@ -130,7 +130,7 @@ TRACK::TRACK( BOARD_ITEM* aParent, KICAD_T idtype ) :
} }
EDA_ITEM* TRACK::doClone() const EDA_ITEM* TRACK::Clone() const
{ {
return new TRACK( *this ); return new TRACK( *this );
} }
...@@ -152,7 +152,7 @@ SEGZONE::SEGZONE( BOARD_ITEM* aParent ) : ...@@ -152,7 +152,7 @@ SEGZONE::SEGZONE( BOARD_ITEM* aParent ) :
} }
EDA_ITEM* SEGZONE::doClone() const EDA_ITEM* SEGZONE::Clone() const
{ {
return new SEGZONE( *this ); return new SEGZONE( *this );
} }
...@@ -190,7 +190,7 @@ SEGVIA::SEGVIA( BOARD_ITEM* aParent ) : ...@@ -190,7 +190,7 @@ SEGVIA::SEGVIA( BOARD_ITEM* aParent ) :
} }
EDA_ITEM* SEGVIA::doClone() const EDA_ITEM* SEGVIA::Clone() const
{ {
return new SEGVIA( *this ); return new SEGVIA( *this );
} }
......
...@@ -303,11 +303,11 @@ public: ...@@ -303,11 +303,11 @@ public:
const KICAD_T scanTypes[] ); const KICAD_T scanTypes[] );
/** @copydoc EDA_ITEM::HitTest(wxPoint&) */ /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
bool HitTest( const wxPoint& aPosition ); virtual bool HitTest( const wxPoint& aPosition );
/** @copydoc EDA_ITEM::HitTest(EDA_RECT&) */ /** @copydoc EDA_ITEM::HitTest(const EDA_RECT&)const */
bool HitTest( const EDA_RECT& aRect ) const; virtual bool HitTest( const EDA_RECT& aRect ) const;
/** /**
* Function GetVia * Function GetVia
...@@ -381,6 +381,8 @@ public: ...@@ -381,6 +381,8 @@ public:
virtual BITMAP_DEF GetMenuImage() const { return showtrack_xpm; } virtual BITMAP_DEF GetMenuImage() const { return showtrack_xpm; }
virtual EDA_ITEM* Clone() const;
#if defined (DEBUG) #if defined (DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // overload void Show( int nestLevel, std::ostream& os ) const; // overload
...@@ -393,9 +395,6 @@ public: ...@@ -393,9 +395,6 @@ public:
static wxString ShowState( int stateBits ); static wxString ShowState( int stateBits );
#endif #endif
private:
virtual EDA_ITEM* doClone() const;
}; };
...@@ -423,8 +422,7 @@ public: ...@@ -423,8 +422,7 @@ public:
virtual BITMAP_DEF GetMenuImage() const { return add_zone_xpm; } virtual BITMAP_DEF GetMenuImage() const { return add_zone_xpm; }
private: virtual EDA_ITEM* Clone() const;
virtual EDA_ITEM* doClone() const;
}; };
...@@ -485,12 +483,12 @@ public: ...@@ -485,12 +483,12 @@ public:
virtual BITMAP_DEF GetMenuImage() const { return via_sketch_xpm; } virtual BITMAP_DEF GetMenuImage() const { return via_sketch_xpm; }
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined (DEBUG) #if defined (DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // overload void Show( int nestLevel, std::ostream& os ) const; // overload
#endif #endif
private:
virtual EDA_ITEM* doClone() const;
}; };
......
...@@ -94,7 +94,7 @@ ZONE_CONTAINER::~ZONE_CONTAINER() ...@@ -94,7 +94,7 @@ ZONE_CONTAINER::~ZONE_CONTAINER()
} }
EDA_ITEM* ZONE_CONTAINER::doClone() const EDA_ITEM* ZONE_CONTAINER::Clone() const
{ {
return new ZONE_CONTAINER( *this ); return new ZONE_CONTAINER( *this );
} }
......
...@@ -297,8 +297,8 @@ public: ...@@ -297,8 +297,8 @@ public:
int GetMinThickness() const { return m_ZoneMinThickness; } int GetMinThickness() const { return m_ZoneMinThickness; }
void SetMinThickness( int aMinThickness ) { m_ZoneMinThickness = aMinThickness; } void SetMinThickness( int aMinThickness ) { m_ZoneMinThickness = aMinThickness; }
/** @copydoc EDA_ITEM::HitTest(wxPoint&) */ /** @copydoc EDA_ITEM::HitTest(const wxPoint&) */
bool HitTest( const wxPoint& aPosition ); virtual bool HitTest( const wxPoint& aPosition );
/** /**
* Function HitTestFilledArea * Function HitTestFilledArea
...@@ -371,8 +371,8 @@ public: ...@@ -371,8 +371,8 @@ public:
*/ */
bool HitTestForEdge( const wxPoint& refPos ); bool HitTestForEdge( const wxPoint& refPos );
/** @copydoc EDA_ITEM::HitTest(EDA_RECT&) */ /** @copydoc EDA_ITEM::HitTest(const EDA_RECT&)const */
bool HitTest( const EDA_RECT& refArea ) const; virtual bool HitTest( const EDA_RECT& aRect ) const;
/** /**
* Function Fill_Zone * Function Fill_Zone
...@@ -552,12 +552,12 @@ public: ...@@ -552,12 +552,12 @@ public:
virtual BITMAP_DEF GetMenuImage() const { return add_zone_xpm; } virtual BITMAP_DEF GetMenuImage() const { return add_zone_xpm; }
/** @copydoc EDA_ITEM::Clone() */
virtual EDA_ITEM* Clone() const;
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif
private:
virtual EDA_ITEM* doClone() const;
}; };
......
...@@ -872,13 +872,15 @@ bool PCB_EDIT_FRAME::WriteGeneralDescrPcb( FILE* File ) ...@@ -872,13 +872,15 @@ bool PCB_EDIT_FRAME::WriteGeneralDescrPcb( FILE* File )
/** /**
* Function WriteSheetDescr * Function WriteSheetDescr
* Save the page information (size, texts, date ..) * Save the page information (size, texts, date ..)
* @param screen BASE_SCREEN to save * @param aPageSettings The page settings to write to \a aFile.
* @param File = an open FILE to write info * @param aTitleBlock The title block information to write to \a aFile.
* @param aFile An open FILE to write info.
*/ */
static bool WriteSheetDescr( const PAGE_INFO& aPageSettings, const TITLE_BLOCK& aTitleBlock, FILE* File ) static bool WriteSheetDescr( const PAGE_INFO& aPageSettings, const TITLE_BLOCK& aTitleBlock,
FILE* aFile )
{ {
fprintf( File, "$SHEETDESCR\n" ); fprintf( aFile, "$SHEETDESCR\n" );
fprintf( File, "Sheet %s %d %d%s\n", fprintf( aFile, "Sheet %s %d %d%s\n",
TO_UTF8( aPageSettings.GetType() ), TO_UTF8( aPageSettings.GetType() ),
aPageSettings.GetWidthMils(), aPageSettings.GetWidthMils(),
aPageSettings.GetHeightMils(), aPageSettings.GetHeightMils(),
...@@ -886,16 +888,16 @@ static bool WriteSheetDescr( const PAGE_INFO& aPageSettings, const TITLE_BLOCK& ...@@ -886,16 +888,16 @@ static bool WriteSheetDescr( const PAGE_INFO& aPageSettings, const TITLE_BLOCK&
" portrait" : "" " portrait" : ""
); );
fprintf( File, "Title %s\n", EscapedUTF8( aTitleBlock.GetTitle() ).c_str() ); fprintf( aFile, "Title %s\n", EscapedUTF8( aTitleBlock.GetTitle() ).c_str() );
fprintf( File, "Date %s\n", EscapedUTF8( aTitleBlock.GetDate() ).c_str() ); fprintf( aFile, "Date %s\n", EscapedUTF8( aTitleBlock.GetDate() ).c_str() );
fprintf( File, "Rev %s\n", EscapedUTF8( aTitleBlock.GetRevision() ).c_str() ); fprintf( aFile, "Rev %s\n", EscapedUTF8( aTitleBlock.GetRevision() ).c_str() );
fprintf( File, "Comp %s\n", EscapedUTF8( aTitleBlock.GetCompany() ).c_str() ); fprintf( aFile, "Comp %s\n", EscapedUTF8( aTitleBlock.GetCompany() ).c_str() );
fprintf( File, "Comment1 %s\n", EscapedUTF8( aTitleBlock.GetComment1() ).c_str() ); fprintf( aFile, "Comment1 %s\n", EscapedUTF8( aTitleBlock.GetComment1() ).c_str() );
fprintf( File, "Comment2 %s\n", EscapedUTF8( aTitleBlock.GetComment2() ).c_str() ); fprintf( aFile, "Comment2 %s\n", EscapedUTF8( aTitleBlock.GetComment2() ).c_str() );
fprintf( File, "Comment3 %s\n", EscapedUTF8( aTitleBlock.GetComment3() ).c_str() ); fprintf( aFile, "Comment3 %s\n", EscapedUTF8( aTitleBlock.GetComment3() ).c_str() );
fprintf( File, "Comment4 %s\n", EscapedUTF8( aTitleBlock.GetComment4() ).c_str() ); fprintf( aFile, "Comment4 %s\n", EscapedUTF8( aTitleBlock.GetComment4() ).c_str() );
fprintf( File, "$EndSHEETDESCR\n\n" ); fprintf( aFile, "$EndSHEETDESCR\n\n" );
return true; return true;
} }
......
...@@ -36,13 +36,14 @@ class PCB_BASE_FRAME; ...@@ -36,13 +36,14 @@ class PCB_BASE_FRAME;
* Function InvokeNonCopperZonesEditor * Function InvokeNonCopperZonesEditor
* invokes up a modal dialog window for non-copper zone editing. * invokes up a modal dialog window for non-copper zone editing.
* *
* @param aCaller is the PCB_BASE_FRAME calling parent window for the modal dialog, * @param aParent is the PCB_BASE_FRAME calling parent window for the modal dialog,
* and it gives access to the BOARD through PCB_BASE_FRAME::GetBoard(). * and it gives access to the BOARD through PCB_BASE_FRAME::GetBoard().
* @param aZone is the ZONE_CONTAINER to edit. * @param aZone is the ZONE_CONTAINER to edit.
* @param aSettings points to the ZONE_SETTINGS to edit. * @param aSettings points to the ZONE_SETTINGS to edit.
* @return ZONE_EDIT_T - tells if user aborted, changed only one zone, or all of them. * @return ZONE_EDIT_T - tells if user aborted, changed only one zone, or all of them.
*/ */
ZONE_EDIT_T InvokeNonCopperZonesEditor( PCB_BASE_FRAME* aCaller, ZONE_CONTAINER* aZone, ZONE_SETTINGS* aSettings ); ZONE_EDIT_T InvokeNonCopperZonesEditor( PCB_BASE_FRAME* aParent, ZONE_CONTAINER* aZone,
ZONE_SETTINGS* aSettings );
/** /**
* Function InvokeCopperZonesEditor * Function InvokeCopperZonesEditor
...@@ -50,7 +51,7 @@ ZONE_EDIT_T InvokeNonCopperZonesEditor( PCB_BASE_FRAME* aCaller, ZONE_CONTAINER* ...@@ -50,7 +51,7 @@ ZONE_EDIT_T InvokeNonCopperZonesEditor( PCB_BASE_FRAME* aCaller, ZONE_CONTAINER*
* *
* @param aCaller is the PCB_BASE_FRAME calling parent window for the modal dialog, * @param aCaller is the PCB_BASE_FRAME calling parent window for the modal dialog,
* and it gives access to the BOARD through PCB_BASE_FRAME::GetBoard(). * and it gives access to the BOARD through PCB_BASE_FRAME::GetBoard().
* @param aZone is the ZONE_CONTAINER to edit. * @param aSettings points to the ZONE_SETTINGS to edit.
* @return ZONE_EDIT_T - tells if user aborted, changed only one zone, or all of them. * @return ZONE_EDIT_T - tells if user aborted, changed only one zone, or all of them.
*/ */
ZONE_EDIT_T InvokeCopperZonesEditor( PCB_BASE_FRAME* aCaller, ZONE_SETTINGS* aSettings ); ZONE_EDIT_T InvokeCopperZonesEditor( PCB_BASE_FRAME* aCaller, ZONE_SETTINGS* aSettings );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment