POINT_EDITOR: migrate to ZONE_FILLER class
This commit is contained in:
parent
83b020d4da
commit
56336fdafe
|
@ -45,6 +45,8 @@ using namespace std::placeholders;
|
||||||
#include <class_module.h>
|
#include <class_module.h>
|
||||||
#include <connectivity_data.h>
|
#include <connectivity_data.h>
|
||||||
|
|
||||||
|
#include "zone_filler.h"
|
||||||
|
|
||||||
// Point editor
|
// Point editor
|
||||||
TOOL_ACTION PCB_ACTIONS::pointEditorAddCorner( "pcbnew.PointEditor.addCorner",
|
TOOL_ACTION PCB_ACTIONS::pointEditorAddCorner( "pcbnew.PointEditor.addCorner",
|
||||||
AS_GLOBAL, 0,
|
AS_GLOBAL, 0,
|
||||||
|
@ -215,7 +217,7 @@ private:
|
||||||
|
|
||||||
|
|
||||||
POINT_EDITOR::POINT_EDITOR() :
|
POINT_EDITOR::POINT_EDITOR() :
|
||||||
TOOL_INTERACTIVE( "pcbnew.PointEditor" ), m_selectionTool( NULL ), m_editedPoint( NULL ),
|
PCB_TOOL( "pcbnew.PointEditor" ), m_selectionTool( NULL ), m_editedPoint( NULL ),
|
||||||
m_original( VECTOR2I( 0, 0 ) ), m_altConstrainer( VECTOR2I( 0, 0 ) )
|
m_original( VECTOR2I( 0, 0 ) ), m_altConstrainer( VECTOR2I( 0, 0 ) )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -559,21 +561,20 @@ void POINT_EDITOR::updateItem() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void POINT_EDITOR::finishItem() const
|
void POINT_EDITOR::finishItem()
|
||||||
{
|
{
|
||||||
EDA_ITEM* item = m_editPoints->GetParent();
|
auto item = m_editPoints->GetParent();
|
||||||
|
|
||||||
if( !item )
|
if( !item )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( item->Type() == PCB_ZONE_AREA_T )
|
if( item->Type() == PCB_ZONE_AREA_T )
|
||||||
{
|
{
|
||||||
ZONE_CONTAINER* zone = static_cast<ZONE_CONTAINER*>( item );
|
auto zone = static_cast<ZONE_CONTAINER*>( item );
|
||||||
|
|
||||||
if( zone->IsFilled() )
|
if( zone->IsFilled() )
|
||||||
{
|
{
|
||||||
getEditFrame<PCB_EDIT_FRAME>()->Fill_Zone( zone );
|
ZONE_FILLER filler( board() );
|
||||||
// zone->GetBoard()->GetRatsnest()->Recalculate( zone->GetNetCode() );
|
filler.Fill( { zone } );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ class SELECTION_TOOL;
|
||||||
*
|
*
|
||||||
* Tool that displays edit points allowing to modify items by dragging the points.
|
* Tool that displays edit points allowing to modify items by dragging the points.
|
||||||
*/
|
*/
|
||||||
class POINT_EDITOR : public TOOL_INTERACTIVE
|
class POINT_EDITOR : public PCB_TOOL
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
POINT_EDITOR();
|
POINT_EDITOR();
|
||||||
|
@ -82,7 +82,7 @@ private:
|
||||||
void updateItem() const;
|
void updateItem() const;
|
||||||
|
|
||||||
///> Applies the last changes to the edited item.
|
///> Applies the last changes to the edited item.
|
||||||
void finishItem() const;
|
void finishItem();
|
||||||
|
|
||||||
///> Updates edit points with item's points.
|
///> Updates edit points with item's points.
|
||||||
void updatePoints();
|
void updatePoints();
|
||||||
|
|
Loading…
Reference in New Issue