Commit 3f970c85 authored by charras's avatar charras

more cleanup and enhancements about rats nest (work in progress)

parent e073bdc0
......@@ -56,7 +56,7 @@ set(PCB_COMMON_SRCS
../pcbnew/class_drawsegment.cpp
../pcbnew/class_drc_item.cpp
../pcbnew/class_edge_mod.cpp
../pcbnew/class_equipot.cpp
../pcbnew/class_netinfo_item.cpp
../pcbnew/class_netinfolist.cpp
../pcbnew/class_marker.cpp
../pcbnew/class_mire.cpp
......
......@@ -250,7 +250,7 @@ public:
#include "class_edge_mod.h" // Class for footprint graphic elements
#include "class_text_mod.h" // Class for footprint fields
#include "class_module.h" // Class for the footprint
#include "class_equipot.h"
#include "class_netinfo.h" // Class for nets
/***********************************/
......
......@@ -286,7 +286,7 @@ public:
void Build_Board_Ratsnest( wxDC* DC );
void DrawGeneralRatsnest( wxDC* DC, int net_code = 0 );
void trace_ratsnest_pad( wxDC* DC );
int* build_ratsnest_pad( EDA_BaseStruct* ref,
void build_ratsnest_pad( BOARD_ITEM* ref,
const wxPoint& refpos,
bool init );
......
......@@ -7,7 +7,7 @@
#include "dlist.h"
#include "class_equipot.h"
#include "class_netinfo.h"
class ZONE_CONTAINER;
......
......@@ -3,14 +3,14 @@
/*************************************************************************/
#include "fctsys.h"
#include "wxstruct.h"
#include "class_drawpanel.h"
#include "common.h"
#include "kicad_string.h"
#include "pcbnew.h"
/*********************************************************/
/* class NETINFO_ITEM: hand data relative to a given net */
/* class NETINFO_ITEM: handle data relative to a given net */
/*********************************************************/
/* Constructor */
......@@ -24,7 +24,7 @@ NETINFO_ITEM::NETINFO_ITEM( BOARD_ITEM* aParent )
}
/* destructot */
/* destructor */
NETINFO_ITEM::~NETINFO_ITEM()
{
......@@ -107,9 +107,8 @@ void NETINFO_ITEM::SetNetname( const wxString & aNetname )
/** function Draw (TODO)
* we actually could show a NET, simply show all the tracks and pads or net name on pad and vias
*/
void NETINFO_ITEM::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset )
void NETINFO_ITEM::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& aOffset )
{
}
......@@ -169,3 +168,24 @@ void NETINFO_ITEM::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const
valeur_param( (int) lengthnet, txt );
Affiche_1_Parametre( frame, 60, _( "Net Length" ), txt, RED );
}
/***********************/
/* class RATSNEST_ITEM */
/***********************/
/** function Draw
* Draws a line from the starting pad to the ending pad
*/
void RATSNEST_ITEM::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& aOffset )
{
EDA_Colors color = (EDA_Colors) g_DesignSettings.m_RatsnestColor;
if ( (m_Status & LOCAL_RATSNEST_ITEM) )
color = YELLOW;
GRLine( &panel->m_ClipBox, DC, m_PadStart->m_Pos.x + aOffset.x,
m_PadStart->m_Pos.y + aOffset.y,
m_PadEnd->m_Pos.x + aOffset.x,
m_PadEnd->m_Pos.y + aOffset.y,
0, color );
}
......@@ -86,7 +86,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
D_PAD* pt_pad = NULL;
TRACK* TrackOnStartPoint = NULL;
int masquelayer = g_TabOneLayerMask[((PCB_SCREEN*)GetScreen())->m_Active_Layer];
EDA_BaseStruct* LockPoint;
BOARD_ITEM* LockPoint;
wxPoint pos = GetScreen()->m_Curseur;
static int InitialTrackWidthValue; /* first track segment width.
......@@ -457,7 +457,7 @@ void WinEDA_PcbFrame::End_Route( TRACK* aTrack, wxDC* DC )
* ceci contribue a la reduction du temps de calcul */
/* Accrochage de la fin de la piste */
EDA_BaseStruct* LockPoint = LocateLockPoint( GetBoard(), pos, masquelayer );
BOARD_ITEM* LockPoint = LocateLockPoint( GetBoard(), pos, masquelayer );
if( LockPoint ) /* La fin de la piste est sur un PAD */
{
......
......@@ -924,7 +924,7 @@ bool WinEDA_PcbFrame::PlaceDraggedTrackSegment( TRACK* Track, wxDC* DC )
Track->SetState( EDIT, OFF );
Track->Draw( DrawPanel, DC, draw_mode );
/* Tracage des segments dragges */
/* Draw ddragged tracks */
pt_drag = g_DragSegmentList;
for( ; pt_drag; pt_drag = pt_drag->Pnext )
{
......@@ -954,10 +954,10 @@ bool WinEDA_PcbFrame::PlaceDraggedTrackSegment( TRACK* Track, wxDC* DC )
/************************************************************************/
EDA_BaseStruct* LocateLockPoint( BOARD* Pcb, wxPoint pos, int LayerMask )
BOARD_ITEM* LocateLockPoint( BOARD* Pcb, wxPoint pos, int LayerMask )
/************************************************************************/
/* Routine trouvant le point " d'accrochage " d'une extremite de piste.
/* Routine trouvant le point "d'accrochage" d'une extremite de piste.
* Ce point peut etre un PAD ou un autre segment de piste
* Retourne:
* - pointeur sur ce PAD ou:
......
......@@ -353,7 +353,7 @@ void MasqueAttributs( int* masque_set, int* masque_clr );
/* DUPLTRAC.CPP */
/***************/
EDA_BaseStruct* LocateLockPoint( BOARD* Pcb, wxPoint pos, int LayerMask );
BOARD_ITEM* LocateLockPoint( BOARD* Pcb, wxPoint pos, int LayerMask );
/* Routine trouvant le point " d'accrochage " d'une extremite de piste.
* Ce point peut etre un PAD ou un autre segment de piste
......
This diff is collapsed.
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