Loading gerbview/gerbview.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -15,6 +15,7 @@ #include "bitmaps.h" #include "bitmaps.h" #include "protos.h" #include "protos.h" #include "zones.h" #include "zones.h" #include "class_board_design_settings.h" #include <wx/file.h> #include <wx/file.h> #include <wx/snglinst.h> #include <wx/snglinst.h> Loading Loading @@ -45,6 +46,8 @@ bool WinEDA_App::OnInit() ScreenPcb = new PCB_SCREEN(); ScreenPcb = new PCB_SCREEN(); ScreenPcb->m_CurrentSheetDesc = &g_Sheet_GERBER; ScreenPcb->m_CurrentSheetDesc = &g_Sheet_GERBER; g_DesignSettings.SetEnabledLayers( FULL_LAYERS ); // All 32 layers enabled at first. ActiveScreen = ScreenPcb; ActiveScreen = ScreenPcb; // read current setup and reopen last directory if no filename to open in // read current setup and reopen last directory if no filename to open in Loading gerbview/protos.h +0 −92 Original line number Original line Diff line number Diff line Loading @@ -12,9 +12,6 @@ bool Read_Config(); bool Read_Hotkey_Config( WinEDA_DrawFrame* frame, bool verbose ); bool Read_Hotkey_Config( WinEDA_DrawFrame* frame, bool verbose ); /* pcbplot.cpp */ void Plume( int state ); /****************/ /****************/ /* lay2plot.cpp */ /* lay2plot.cpp */ Loading @@ -26,100 +23,11 @@ void Print_PcbItems( BOARD* Pcb, wxDC* DC, int drawmode, int printmasklayer ); void DisplayColorSetupFrame( WinEDA_DrawFrame* parent, const wxPoint& framepos ); void DisplayColorSetupFrame( WinEDA_DrawFrame* parent, const wxPoint& framepos ); /* PLOT_RTN.CC */ void ComputePlotFileName( char* FullFileName, char* Ext ); void calcule_coord_plot( int* dx, int* dy ); void calcule_dim_plot( int* dx, int* dy ); void Trace_Un_TextePcb( TEXTE_PCB* pt_texte, int format_plot, int masque_layer ); /* Trace 1 Texte type PCB , c.a.d autre que les textes sur modules, * prepare les parametres de trace de texte */ void trace_1_arc( int format_plot, int cx, int cy, int start, int end, int rayon, int epaisseur ); void trace_1_cercle( int format_plot, int epaisseur, int cx, int cy, int rayon ); void Trace_Un_DrawSegment( DRAWSEGMENT* PtSegm, int format_plot, int masque_layer ); void Trace_Une_MirePcb( MIREPCB* PtMire, int format_plot, int masque_layer ); /* PLOTGERB.CC */ void trace_1_segment_GERBER( int pos_X0, int pos_Y0, int pos_X1, int pos_Y1, int hauteur ); void trace_1_cercle_GERBER( int cx, int cy, int rayon, int epaisseur ); void trace_1_contour_GERBER( int cX, int cY, int dimX, int dimY, int deltaX, int deltaY, int dim_trait, int orient ); /* Trace 1 contour rectangulaire ou trapezoidal d'orientation quelconque * donne par son centre cX, cY, ses dimensions dimX et dimY, * ses variations deltaX et deltaY et son orientation orient */ /* PLOTHPGL.CC */ void Init_Trace_HPGL(); void Fin_Trace_HPGL(); void trace_1_segment_HPGL( int pos_X0, int pos_Y0, int pos_X1, int pos_Y1, int hauteur ); void trace_1_pad_TRAPEZE_HPGL( int cX, int cY, int dimX, int dimY, int deltaX, int deltaY, int orient, int modetrace ); void trace_1_pastille_RONDE_HPGL( int pos_X, int pos_Y, int diametre, int modetrace ); void trace_1_pastille_OVALE_HPGL( int pos_X, int pos_Y, int dx, int dy, int orient, int modetrace ); void trace_1_pad_rectangulaire_HPGL( int cX, int cY, int dimX, int dimY, int orient, int modetrace ); void Move_Plume_HPGL( int x, int y, int plume ); /* deplace la plume levee (plume = 'U') ou baissee (plume = 'D') * en position x,y */ void Plume_HPGL( int plume ); /* leve (plume = 'U') ou baisse (plume = 'D') la plume */ /**************/ /* PRINTPS.CC */ /**************/ void trace_1_pastille_OVALE_POST( int pos_X, int pos_Y, int dx, int dy, int orient, int modetrace ); void trace_1_pastille_RONDE_POST( int pos_X, int pos_Y, int diametre, int modetrace ); void trace_1_pad_rectangulaire_POST( int cX, int cY, int dimX, int dimY, int orient, int modetrace ); void trace_1_contour_POST( int cX, int cY, int dimX, int dimY, int deltaX, int deltaY, int dim_trait, int orient ); void trace_1_pad_TRAPEZE_POST( int cX, int cY, int dimX, int dimY, int deltaX, int deltaY, int orient, int modetrace ); void trace_1_segment_POST( int pos_X0, int pos_Y0, int pos_X1, int pos_Y1, int large ); void trace_1_Cercle_POST( int pos_X, int pos_Y, int diametre, int width ); void PlotArcPS( int x, int y, int StAngle, int EndAngle, int rayon, int width ); /***************/ /***************/ /* trpiste.cpp */ /* trpiste.cpp */ /***************/ /***************/ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int drawmode, int printmasklayer ); void Trace_Segment( WinEDA_DrawPanel* panel, void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, wxDC* DC, TRACK* pt_piste, TRACK* pt_piste, int draw_mode ); int draw_mode ); void Trace_1_texte_pcb( WinEDA_DrawPanel* panel, wxDC* DC, TEXTE_PCB* pt_texte, int ox, int oy, int DrawMode ); void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int drawmode ); gerbview/tracepcb.cpp +102 −130 Original line number Original line Diff line number Diff line Loading @@ -17,45 +17,36 @@ #include "protos.h" #include "protos.h" #include "class_board_design_settings.h" #include "class_board_design_settings.h" static void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int drawmode, int printmasklayer ); static void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int drawmode ); /************************************************************************************************************/ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmasklayer, bool aPrintMirrorMode ) /*************************************************************************************************************/ /* Draw gerbview layers, for printing /* Draw gerbview layers, for printing */ */ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmasklayer, bool aPrintMirrorMode ) { { DISPLAY_OPTIONS save_opt; DISPLAY_OPTIONS save_opt; int DisplayPolygonsModeImg; int DisplayPolygonsModeImg; save_opt = DisplayOpt; save_opt = DisplayOpt; if( printmasklayer & ALL_CU_LAYERS ) { DisplayOpt.DisplayPadFill = true; DisplayOpt.DisplayViaFill = true; } else { DisplayOpt.DisplayPadFill = false; DisplayOpt.DisplayViaFill = false; } DisplayOpt.DisplayPadNum = 0; DisplayOpt.DisplayPadNoConn = 0; DisplayOpt.DisplayPadIsol = 0; DisplayOpt.DisplayModEdge = FILLED; DisplayOpt.DisplayModText = FILLED; DisplayOpt.DisplayPcbTrackFill = FILLED; DisplayOpt.DisplayPcbTrackFill = FILLED; DisplayOpt.ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE; DisplayOpt.ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE; DisplayOpt.DisplayDrawItems = FILLED; DisplayOpt.DisplayDrawItems = FILLED; DisplayOpt.DisplayZonesMode = 0; DisplayOpt.DisplayZonesMode = 0; DisplayPolygonsModeImg = g_DisplayPolygonsModeSketch; DisplayPolygonsModeImg = g_DisplayPolygonsModeSketch; g_DisplayPolygonsModeSketch = 0; g_DisplayPolygonsModeSketch = 0; m_PrintIsMirrored = aPrintMirrorMode; m_PrintIsMirrored = aPrintMirrorMode; ( (WinEDA_GerberFrame*) m_Parent )->Trace_Gerber( DC, ( (WinEDA_GerberFrame*) m_Parent )->Trace_Gerber( DC, GR_COPY, printmasklayer ); GR_COPY, printmasklayer ); if( Print_Sheet_Ref ) if( Print_Sheet_Ref ) m_Parent->TraceWorkSheet( DC, GetScreen(), 0 ); m_Parent->TraceWorkSheet( DC, GetScreen(), 0 ); Loading @@ -67,9 +58,12 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, } } /* Trace the PCB, and additional elements (axis, grid ..) /*******************************************************************/ */ void WinEDA_GerberFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) void WinEDA_GerberFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) /*******************************************************************/ /* Trace le PCB, et les elements complementaires ( axes, grille .. ) */ { { PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen(); PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen(); Loading @@ -92,27 +86,24 @@ void WinEDA_GerberFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) DrawPanel->Trace_Curseur( DC ); DrawPanel->Trace_Curseur( DC ); } } /********************************************************************/ /* Redraw the BOARD items but not cursors, axis or grid */ // @todo: replace WinEDA_GerberFrame::Trace_Gerber() by this function void BOARD::Draw( WinEDA_DrawPanel* aPanel, wxDC* DC, void BOARD::Draw( WinEDA_DrawPanel* aPanel, wxDC* DC, int aDrawMode, const wxPoint& offset ) int aDrawMode, const wxPoint& offset ) /********************************************************************/ /* Redraw the BOARD items but not cursors, axis or grid */ // @todo: replace WinEDA_GerberFrame::Trace_Gerber() by this function { { } } /* /***********************************************************************************/ * Trace all elements of PCBs on the active screen. void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklayer ) * /***********************************************************************************/ * @param DC = device context to draw /* Draws the gerber items on screen * @param draw_mode = draw mode for the device context (GR_COPY, GR_OR, GR_XOR * @param DC = current device context * ..) * @param draw_mode = draw mode for the device context (GR_COPY, GR_OR, GR_XOR ..) * @param printmasklayer = mask for allowed layer (=-1 to draw all layers) * @param printmasklayer = mask for allowed layer (=-1 to draw all layers) */ */ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklayer ) { { if( !GetBoard() ) if( !GetBoard() ) return; return; Loading @@ -124,21 +115,21 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, // Draw filled polygons // Draw filled polygons std::vector<wxPoint> points; std::vector<wxPoint> points; // minimize reallocations of the vector's internal array by starting with a // minimize reallocations of the vector's internal array by starting with a good sized one. // good sized one. points.reserve(10000); points.reserve(10000); for( TRACK* track = GetBoard()->m_Zone; track; track = track->Next() ) for( TRACK* track = GetBoard()->m_Zone; track; track = track->Next() ) { { if( !(track->ReturnMaskLayer() & printmasklayer) ) if( !(track->ReturnMaskLayer() & printmasklayer) ) continue; continue; if( g_DesignSettings.IsLayerVisible( track->GetLayer() ) == false ) continue; D( printf( "D:%p\n", track ); ) // D(printf("D:%p\n", track );) if( track->GetNet() == 0 ) // StartPoint if( track->GetNet() == 0 ) // StartPoint { { if( points.size() ) // we have found a new polygon: Draw the if( points.size() ) // we have found a new polygon: Draw the old polygon // old polygon { { if( erase ) if( erase ) { { Loading @@ -151,8 +142,7 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, filled = (g_DisplayPolygonsModeSketch == 0); filled = (g_DisplayPolygonsModeSketch == 0); } } GRClosedPoly( &DrawPanel->m_ClipBox, DC, GRClosedPoly( &DrawPanel->m_ClipBox, DC, points.size(), &points[0], points.size(), &points[0], filled, Color, Color ); filled, Color, Color ); } } Loading Loading @@ -185,8 +175,7 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, } } } } // Draw tracks and flashes down here. This will probably not be a final // Draw tracks and flashes down here. This will probably not be a final solution to drawing order issues // solution to drawing order issues Draw_Track_Buffer( DrawPanel, DC, GetBoard(), draw_mode, printmasklayer ); Draw_Track_Buffer( DrawPanel, DC, GetBoard(), draw_mode, printmasklayer ); if( DisplayOpt.DisplayPadNum ) if( DisplayOpt.DisplayPadNum ) Loading @@ -195,20 +184,18 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, GetScreen()->ClrRefreshReq(); GetScreen()->ClrRefreshReq(); } } /***************************************************************************************************/ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int draw_mode, int printmasklayer ) /***************************************************************************************************/ /* Function to draw the tracks (i.e Spots or lines) in gerbview /* Function to draw the tracks (i.e Spots or lines) in gerbview * Polygons are not handled here (there are in Pcb->m_Zone) * Polygons are not handled here (there are in Pcb->m_Zone) * @param DC = device context to draw * @param DC = device context to draw * @param Pcb = Board to draw (only Pcb->m_Track is used) * @param Pcb = Board to draw (only Pcb->m_Track is used) * @param draw_mode = draw mode for the device context (GR_COPY, GR_OR, GR_XOR * @param draw_mode = draw mode for the device context (GR_COPY, GR_OR, GR_XOR ..) * ..) * @param printmasklayer = mask for allowed layer (=-1 to draw all layers) * @param printmasklayer = mask for allowed layer (=-1 to draw all layers) */ */ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int draw_mode, int printmasklayer ) { { int layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer; int layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer; GERBER* gerber = g_GERBER_List[layer]; GERBER* gerber = g_GERBER_List[layer]; Loading @@ -222,7 +209,7 @@ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, if( !(track->ReturnMaskLayer() & printmasklayer) ) if( !(track->ReturnMaskLayer() & printmasklayer) ) continue; continue; D( printf( "D:%p\n", track ); ) // D(printf("D:%p\n", track );) if( dcode_hightlight == track->GetNet() && track->GetLayer()==layer ) if( dcode_hightlight == track->GetNet() && track->GetLayer()==layer ) Trace_Segment( panel, DC, track, draw_mode | GR_SURBRILL ); Trace_Segment( panel, DC, track, draw_mode | GR_SURBRILL ); Loading @@ -234,16 +221,15 @@ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, #if 1 #if 1 /***********************************************************************************/ void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track, int draw_mode ) /***********************************************************************************/ /* Trace 1 segment of track. /* routine de trace de 1 segment de piste. * Parameters: * Parametres : * Track = address of the description of the track buflib * track = adresse de la description de la piste en buflib * Draw_mode = mode (GR_XOR, GR_OR ..) * draw_mode = mode ( GR_XOR, GR_OR..) */ */ void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track, int draw_mode ) { { int l_piste; int l_piste; int color; int color; Loading @@ -252,8 +238,7 @@ void Trace_Segment( WinEDA_DrawPanel* panel, int halfPenWidth; int halfPenWidth; static bool show_err; static bool show_err; if( track->m_Flags & DRAW_ERASED ) // draw in background color, used by if( track->m_Flags & DRAW_ERASED ) // draw in background color, used by classs TRACK in gerbview // class TRACK in gerbview { { color = g_DrawBgColor; color = g_DrawBgColor; } } Loading @@ -277,6 +262,7 @@ void Trace_Segment( WinEDA_DrawPanel* panel, GRSetDrawMode( DC, draw_mode ); GRSetDrawMode( DC, draw_mode ); fillopt = DisplayOpt.DisplayPcbTrackFill ? FILLED : SKETCH; fillopt = DisplayOpt.DisplayPcbTrackFill ? FILLED : SKETCH; switch( track->m_Shape ) switch( track->m_Shape ) Loading @@ -294,32 +280,16 @@ void Trace_Segment( WinEDA_DrawPanel* panel, if( fillopt == SKETCH ) if( fillopt == SKETCH ) { { // draw the border of the pen's path using two circles, each as // draw the border of the pen's path using two circles, each as narrow as possible // narrow as possible GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y, GRCircle( &panel->m_ClipBox, radius - halfPenWidth, 0, color ); DC, GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y, track->m_Start.x, radius + halfPenWidth, 0, color ); track->m_Start.y, radius - halfPenWidth, 0, color ); GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y, radius + halfPenWidth, 0, color ); } } else else { { GRCircle( &panel->m_ClipBox, GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y, DC, radius, track->m_Width, color ); track->m_Start.x, track->m_Start.y, radius, track->m_Width, color ); } } break; break; Loading Loading @@ -427,14 +397,12 @@ void Trace_Segment( WinEDA_DrawPanel* panel, } } } } #endif #endif void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, /*****************************************************************************************/ wxDC* DC, void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int drawmode ) BOARD* Pcb, /*****************************************************************************************/ int drawmode ) { { TRACK* track; TRACK* track; wxPoint pos; wxPoint pos; Loading @@ -445,6 +413,9 @@ void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, track = Pcb->m_Track; track = Pcb->m_Track; for( ; track != NULL; track = track->Next() ) for( ; track != NULL; track = track->Next() ) { { if( g_DesignSettings.IsLayerVisible( track->GetLayer() ) == false ) continue; if( (track->m_Shape == S_ARC) if( (track->m_Shape == S_ARC) || (track->m_Shape == S_CIRCLE) || (track->m_Shape == S_CIRCLE) || (track->m_Shape == S_ARC_RECT) ) || (track->m_Shape == S_ARC_RECT) ) Loading @@ -462,7 +433,7 @@ void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, width = track->m_Width; width = track->m_Width; orient = TEXT_ORIENT_HORIZ; orient = TEXT_ORIENT_HORIZ; if( track->m_Shape >= S_SPOT_CIRCLE ) // form flash if( track->m_Shape >= S_SPOT_CIRCLE ) // forme flash { { width /= 3; width /= 3; } } Loading @@ -476,7 +447,8 @@ void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, width /= 2; width /= 2; } } DrawGraphicText( panel, DC, pos, (EDA_Colors) g_DCodesColor, Line, DrawGraphicText( panel, DC, pos, (EDA_Colors) g_DCodesColor, Line, orient, wxSize( width, width ), orient, wxSize( width, width ), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, 0, false, false, false); 0, false, false, false); Loading @@ -484,7 +456,7 @@ void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, } } /* Virtual function needed by the PCB_SCREEN class derived from BASE_SCREEN /* Virtual fonction needed by the PCB_SCREEN class derived from BASE_SCREEN * this is a virtual pure function in BASE_SCREEN * this is a virtual pure function in BASE_SCREEN * do nothing in gerbview * do nothing in gerbview * could be removed later * could be removed later Loading include/pcbstruct.h +3 −2 Original line number Original line Diff line number Diff line Loading @@ -115,8 +115,9 @@ #define LAST_NON_COPPER_LAYER EDGE_N #define LAST_NON_COPPER_LAYER EDGE_N // extra bits 0xE0000000 // extra bits 0xE0000000 /* masques generaux : */ /* Helpful global layers maks : */ #define ALL_LAYERS 0x1FFFFFFF #define ALL_LAYERS 0x1FFFFFFF // Pcbnew used 29 layers #define FULL_LAYERS 0xFFFFFFFF // Gerbview used 32 layers #define ALL_NO_CU_LAYERS 0x1FFF0000 #define ALL_NO_CU_LAYERS 0x1FFF0000 #define ALL_CU_LAYERS 0x0000FFFF #define ALL_CU_LAYERS 0x0000FFFF #define INTERNAL_LAYERS 0x00007FFE /* Bits layers internes */ #define INTERNAL_LAYERS 0x00007FFE /* Bits layers internes */ Loading pcbnew/class_board_design_settings.cpp +2 −1 Original line number Original line Diff line number Diff line Loading @@ -83,7 +83,8 @@ int EDA_BoardDesignSettings::GetVisibleLayers() const void EDA_BoardDesignSettings::SetVisibleLayers( int aMask ) void EDA_BoardDesignSettings::SetVisibleLayers( int aMask ) { { m_VisibleLayers = aMask & m_EnabledLayers & ALL_LAYERS; // Altough Pcbnew uses only 29, Gerbview uses all 32 layers m_VisibleLayers = aMask & m_EnabledLayers & FULL_LAYERS; } } Loading Loading
gerbview/gerbview.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -15,6 +15,7 @@ #include "bitmaps.h" #include "bitmaps.h" #include "protos.h" #include "protos.h" #include "zones.h" #include "zones.h" #include "class_board_design_settings.h" #include <wx/file.h> #include <wx/file.h> #include <wx/snglinst.h> #include <wx/snglinst.h> Loading Loading @@ -45,6 +46,8 @@ bool WinEDA_App::OnInit() ScreenPcb = new PCB_SCREEN(); ScreenPcb = new PCB_SCREEN(); ScreenPcb->m_CurrentSheetDesc = &g_Sheet_GERBER; ScreenPcb->m_CurrentSheetDesc = &g_Sheet_GERBER; g_DesignSettings.SetEnabledLayers( FULL_LAYERS ); // All 32 layers enabled at first. ActiveScreen = ScreenPcb; ActiveScreen = ScreenPcb; // read current setup and reopen last directory if no filename to open in // read current setup and reopen last directory if no filename to open in Loading
gerbview/protos.h +0 −92 Original line number Original line Diff line number Diff line Loading @@ -12,9 +12,6 @@ bool Read_Config(); bool Read_Hotkey_Config( WinEDA_DrawFrame* frame, bool verbose ); bool Read_Hotkey_Config( WinEDA_DrawFrame* frame, bool verbose ); /* pcbplot.cpp */ void Plume( int state ); /****************/ /****************/ /* lay2plot.cpp */ /* lay2plot.cpp */ Loading @@ -26,100 +23,11 @@ void Print_PcbItems( BOARD* Pcb, wxDC* DC, int drawmode, int printmasklayer ); void DisplayColorSetupFrame( WinEDA_DrawFrame* parent, const wxPoint& framepos ); void DisplayColorSetupFrame( WinEDA_DrawFrame* parent, const wxPoint& framepos ); /* PLOT_RTN.CC */ void ComputePlotFileName( char* FullFileName, char* Ext ); void calcule_coord_plot( int* dx, int* dy ); void calcule_dim_plot( int* dx, int* dy ); void Trace_Un_TextePcb( TEXTE_PCB* pt_texte, int format_plot, int masque_layer ); /* Trace 1 Texte type PCB , c.a.d autre que les textes sur modules, * prepare les parametres de trace de texte */ void trace_1_arc( int format_plot, int cx, int cy, int start, int end, int rayon, int epaisseur ); void trace_1_cercle( int format_plot, int epaisseur, int cx, int cy, int rayon ); void Trace_Un_DrawSegment( DRAWSEGMENT* PtSegm, int format_plot, int masque_layer ); void Trace_Une_MirePcb( MIREPCB* PtMire, int format_plot, int masque_layer ); /* PLOTGERB.CC */ void trace_1_segment_GERBER( int pos_X0, int pos_Y0, int pos_X1, int pos_Y1, int hauteur ); void trace_1_cercle_GERBER( int cx, int cy, int rayon, int epaisseur ); void trace_1_contour_GERBER( int cX, int cY, int dimX, int dimY, int deltaX, int deltaY, int dim_trait, int orient ); /* Trace 1 contour rectangulaire ou trapezoidal d'orientation quelconque * donne par son centre cX, cY, ses dimensions dimX et dimY, * ses variations deltaX et deltaY et son orientation orient */ /* PLOTHPGL.CC */ void Init_Trace_HPGL(); void Fin_Trace_HPGL(); void trace_1_segment_HPGL( int pos_X0, int pos_Y0, int pos_X1, int pos_Y1, int hauteur ); void trace_1_pad_TRAPEZE_HPGL( int cX, int cY, int dimX, int dimY, int deltaX, int deltaY, int orient, int modetrace ); void trace_1_pastille_RONDE_HPGL( int pos_X, int pos_Y, int diametre, int modetrace ); void trace_1_pastille_OVALE_HPGL( int pos_X, int pos_Y, int dx, int dy, int orient, int modetrace ); void trace_1_pad_rectangulaire_HPGL( int cX, int cY, int dimX, int dimY, int orient, int modetrace ); void Move_Plume_HPGL( int x, int y, int plume ); /* deplace la plume levee (plume = 'U') ou baissee (plume = 'D') * en position x,y */ void Plume_HPGL( int plume ); /* leve (plume = 'U') ou baisse (plume = 'D') la plume */ /**************/ /* PRINTPS.CC */ /**************/ void trace_1_pastille_OVALE_POST( int pos_X, int pos_Y, int dx, int dy, int orient, int modetrace ); void trace_1_pastille_RONDE_POST( int pos_X, int pos_Y, int diametre, int modetrace ); void trace_1_pad_rectangulaire_POST( int cX, int cY, int dimX, int dimY, int orient, int modetrace ); void trace_1_contour_POST( int cX, int cY, int dimX, int dimY, int deltaX, int deltaY, int dim_trait, int orient ); void trace_1_pad_TRAPEZE_POST( int cX, int cY, int dimX, int dimY, int deltaX, int deltaY, int orient, int modetrace ); void trace_1_segment_POST( int pos_X0, int pos_Y0, int pos_X1, int pos_Y1, int large ); void trace_1_Cercle_POST( int pos_X, int pos_Y, int diametre, int width ); void PlotArcPS( int x, int y, int StAngle, int EndAngle, int rayon, int width ); /***************/ /***************/ /* trpiste.cpp */ /* trpiste.cpp */ /***************/ /***************/ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int drawmode, int printmasklayer ); void Trace_Segment( WinEDA_DrawPanel* panel, void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, wxDC* DC, TRACK* pt_piste, TRACK* pt_piste, int draw_mode ); int draw_mode ); void Trace_1_texte_pcb( WinEDA_DrawPanel* panel, wxDC* DC, TEXTE_PCB* pt_texte, int ox, int oy, int DrawMode ); void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int drawmode );
gerbview/tracepcb.cpp +102 −130 Original line number Original line Diff line number Diff line Loading @@ -17,45 +17,36 @@ #include "protos.h" #include "protos.h" #include "class_board_design_settings.h" #include "class_board_design_settings.h" static void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int drawmode, int printmasklayer ); static void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int drawmode ); /************************************************************************************************************/ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmasklayer, bool aPrintMirrorMode ) /*************************************************************************************************************/ /* Draw gerbview layers, for printing /* Draw gerbview layers, for printing */ */ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmasklayer, bool aPrintMirrorMode ) { { DISPLAY_OPTIONS save_opt; DISPLAY_OPTIONS save_opt; int DisplayPolygonsModeImg; int DisplayPolygonsModeImg; save_opt = DisplayOpt; save_opt = DisplayOpt; if( printmasklayer & ALL_CU_LAYERS ) { DisplayOpt.DisplayPadFill = true; DisplayOpt.DisplayViaFill = true; } else { DisplayOpt.DisplayPadFill = false; DisplayOpt.DisplayViaFill = false; } DisplayOpt.DisplayPadNum = 0; DisplayOpt.DisplayPadNoConn = 0; DisplayOpt.DisplayPadIsol = 0; DisplayOpt.DisplayModEdge = FILLED; DisplayOpt.DisplayModText = FILLED; DisplayOpt.DisplayPcbTrackFill = FILLED; DisplayOpt.DisplayPcbTrackFill = FILLED; DisplayOpt.ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE; DisplayOpt.ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE; DisplayOpt.DisplayDrawItems = FILLED; DisplayOpt.DisplayDrawItems = FILLED; DisplayOpt.DisplayZonesMode = 0; DisplayOpt.DisplayZonesMode = 0; DisplayPolygonsModeImg = g_DisplayPolygonsModeSketch; DisplayPolygonsModeImg = g_DisplayPolygonsModeSketch; g_DisplayPolygonsModeSketch = 0; g_DisplayPolygonsModeSketch = 0; m_PrintIsMirrored = aPrintMirrorMode; m_PrintIsMirrored = aPrintMirrorMode; ( (WinEDA_GerberFrame*) m_Parent )->Trace_Gerber( DC, ( (WinEDA_GerberFrame*) m_Parent )->Trace_Gerber( DC, GR_COPY, printmasklayer ); GR_COPY, printmasklayer ); if( Print_Sheet_Ref ) if( Print_Sheet_Ref ) m_Parent->TraceWorkSheet( DC, GetScreen(), 0 ); m_Parent->TraceWorkSheet( DC, GetScreen(), 0 ); Loading @@ -67,9 +58,12 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, } } /* Trace the PCB, and additional elements (axis, grid ..) /*******************************************************************/ */ void WinEDA_GerberFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) void WinEDA_GerberFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) /*******************************************************************/ /* Trace le PCB, et les elements complementaires ( axes, grille .. ) */ { { PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen(); PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen(); Loading @@ -92,27 +86,24 @@ void WinEDA_GerberFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) DrawPanel->Trace_Curseur( DC ); DrawPanel->Trace_Curseur( DC ); } } /********************************************************************/ /* Redraw the BOARD items but not cursors, axis or grid */ // @todo: replace WinEDA_GerberFrame::Trace_Gerber() by this function void BOARD::Draw( WinEDA_DrawPanel* aPanel, wxDC* DC, void BOARD::Draw( WinEDA_DrawPanel* aPanel, wxDC* DC, int aDrawMode, const wxPoint& offset ) int aDrawMode, const wxPoint& offset ) /********************************************************************/ /* Redraw the BOARD items but not cursors, axis or grid */ // @todo: replace WinEDA_GerberFrame::Trace_Gerber() by this function { { } } /* /***********************************************************************************/ * Trace all elements of PCBs on the active screen. void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklayer ) * /***********************************************************************************/ * @param DC = device context to draw /* Draws the gerber items on screen * @param draw_mode = draw mode for the device context (GR_COPY, GR_OR, GR_XOR * @param DC = current device context * ..) * @param draw_mode = draw mode for the device context (GR_COPY, GR_OR, GR_XOR ..) * @param printmasklayer = mask for allowed layer (=-1 to draw all layers) * @param printmasklayer = mask for allowed layer (=-1 to draw all layers) */ */ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklayer ) { { if( !GetBoard() ) if( !GetBoard() ) return; return; Loading @@ -124,21 +115,21 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, // Draw filled polygons // Draw filled polygons std::vector<wxPoint> points; std::vector<wxPoint> points; // minimize reallocations of the vector's internal array by starting with a // minimize reallocations of the vector's internal array by starting with a good sized one. // good sized one. points.reserve(10000); points.reserve(10000); for( TRACK* track = GetBoard()->m_Zone; track; track = track->Next() ) for( TRACK* track = GetBoard()->m_Zone; track; track = track->Next() ) { { if( !(track->ReturnMaskLayer() & printmasklayer) ) if( !(track->ReturnMaskLayer() & printmasklayer) ) continue; continue; if( g_DesignSettings.IsLayerVisible( track->GetLayer() ) == false ) continue; D( printf( "D:%p\n", track ); ) // D(printf("D:%p\n", track );) if( track->GetNet() == 0 ) // StartPoint if( track->GetNet() == 0 ) // StartPoint { { if( points.size() ) // we have found a new polygon: Draw the if( points.size() ) // we have found a new polygon: Draw the old polygon // old polygon { { if( erase ) if( erase ) { { Loading @@ -151,8 +142,7 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, filled = (g_DisplayPolygonsModeSketch == 0); filled = (g_DisplayPolygonsModeSketch == 0); } } GRClosedPoly( &DrawPanel->m_ClipBox, DC, GRClosedPoly( &DrawPanel->m_ClipBox, DC, points.size(), &points[0], points.size(), &points[0], filled, Color, Color ); filled, Color, Color ); } } Loading Loading @@ -185,8 +175,7 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, } } } } // Draw tracks and flashes down here. This will probably not be a final // Draw tracks and flashes down here. This will probably not be a final solution to drawing order issues // solution to drawing order issues Draw_Track_Buffer( DrawPanel, DC, GetBoard(), draw_mode, printmasklayer ); Draw_Track_Buffer( DrawPanel, DC, GetBoard(), draw_mode, printmasklayer ); if( DisplayOpt.DisplayPadNum ) if( DisplayOpt.DisplayPadNum ) Loading @@ -195,20 +184,18 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, GetScreen()->ClrRefreshReq(); GetScreen()->ClrRefreshReq(); } } /***************************************************************************************************/ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int draw_mode, int printmasklayer ) /***************************************************************************************************/ /* Function to draw the tracks (i.e Spots or lines) in gerbview /* Function to draw the tracks (i.e Spots or lines) in gerbview * Polygons are not handled here (there are in Pcb->m_Zone) * Polygons are not handled here (there are in Pcb->m_Zone) * @param DC = device context to draw * @param DC = device context to draw * @param Pcb = Board to draw (only Pcb->m_Track is used) * @param Pcb = Board to draw (only Pcb->m_Track is used) * @param draw_mode = draw mode for the device context (GR_COPY, GR_OR, GR_XOR * @param draw_mode = draw mode for the device context (GR_COPY, GR_OR, GR_XOR ..) * ..) * @param printmasklayer = mask for allowed layer (=-1 to draw all layers) * @param printmasklayer = mask for allowed layer (=-1 to draw all layers) */ */ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int draw_mode, int printmasklayer ) { { int layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer; int layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer; GERBER* gerber = g_GERBER_List[layer]; GERBER* gerber = g_GERBER_List[layer]; Loading @@ -222,7 +209,7 @@ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, if( !(track->ReturnMaskLayer() & printmasklayer) ) if( !(track->ReturnMaskLayer() & printmasklayer) ) continue; continue; D( printf( "D:%p\n", track ); ) // D(printf("D:%p\n", track );) if( dcode_hightlight == track->GetNet() && track->GetLayer()==layer ) if( dcode_hightlight == track->GetNet() && track->GetLayer()==layer ) Trace_Segment( panel, DC, track, draw_mode | GR_SURBRILL ); Trace_Segment( panel, DC, track, draw_mode | GR_SURBRILL ); Loading @@ -234,16 +221,15 @@ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, #if 1 #if 1 /***********************************************************************************/ void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track, int draw_mode ) /***********************************************************************************/ /* Trace 1 segment of track. /* routine de trace de 1 segment de piste. * Parameters: * Parametres : * Track = address of the description of the track buflib * track = adresse de la description de la piste en buflib * Draw_mode = mode (GR_XOR, GR_OR ..) * draw_mode = mode ( GR_XOR, GR_OR..) */ */ void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track, int draw_mode ) { { int l_piste; int l_piste; int color; int color; Loading @@ -252,8 +238,7 @@ void Trace_Segment( WinEDA_DrawPanel* panel, int halfPenWidth; int halfPenWidth; static bool show_err; static bool show_err; if( track->m_Flags & DRAW_ERASED ) // draw in background color, used by if( track->m_Flags & DRAW_ERASED ) // draw in background color, used by classs TRACK in gerbview // class TRACK in gerbview { { color = g_DrawBgColor; color = g_DrawBgColor; } } Loading @@ -277,6 +262,7 @@ void Trace_Segment( WinEDA_DrawPanel* panel, GRSetDrawMode( DC, draw_mode ); GRSetDrawMode( DC, draw_mode ); fillopt = DisplayOpt.DisplayPcbTrackFill ? FILLED : SKETCH; fillopt = DisplayOpt.DisplayPcbTrackFill ? FILLED : SKETCH; switch( track->m_Shape ) switch( track->m_Shape ) Loading @@ -294,32 +280,16 @@ void Trace_Segment( WinEDA_DrawPanel* panel, if( fillopt == SKETCH ) if( fillopt == SKETCH ) { { // draw the border of the pen's path using two circles, each as // draw the border of the pen's path using two circles, each as narrow as possible // narrow as possible GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y, GRCircle( &panel->m_ClipBox, radius - halfPenWidth, 0, color ); DC, GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y, track->m_Start.x, radius + halfPenWidth, 0, color ); track->m_Start.y, radius - halfPenWidth, 0, color ); GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y, radius + halfPenWidth, 0, color ); } } else else { { GRCircle( &panel->m_ClipBox, GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y, DC, radius, track->m_Width, color ); track->m_Start.x, track->m_Start.y, radius, track->m_Width, color ); } } break; break; Loading Loading @@ -427,14 +397,12 @@ void Trace_Segment( WinEDA_DrawPanel* panel, } } } } #endif #endif void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, /*****************************************************************************************/ wxDC* DC, void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int drawmode ) BOARD* Pcb, /*****************************************************************************************/ int drawmode ) { { TRACK* track; TRACK* track; wxPoint pos; wxPoint pos; Loading @@ -445,6 +413,9 @@ void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, track = Pcb->m_Track; track = Pcb->m_Track; for( ; track != NULL; track = track->Next() ) for( ; track != NULL; track = track->Next() ) { { if( g_DesignSettings.IsLayerVisible( track->GetLayer() ) == false ) continue; if( (track->m_Shape == S_ARC) if( (track->m_Shape == S_ARC) || (track->m_Shape == S_CIRCLE) || (track->m_Shape == S_CIRCLE) || (track->m_Shape == S_ARC_RECT) ) || (track->m_Shape == S_ARC_RECT) ) Loading @@ -462,7 +433,7 @@ void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, width = track->m_Width; width = track->m_Width; orient = TEXT_ORIENT_HORIZ; orient = TEXT_ORIENT_HORIZ; if( track->m_Shape >= S_SPOT_CIRCLE ) // form flash if( track->m_Shape >= S_SPOT_CIRCLE ) // forme flash { { width /= 3; width /= 3; } } Loading @@ -476,7 +447,8 @@ void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, width /= 2; width /= 2; } } DrawGraphicText( panel, DC, pos, (EDA_Colors) g_DCodesColor, Line, DrawGraphicText( panel, DC, pos, (EDA_Colors) g_DCodesColor, Line, orient, wxSize( width, width ), orient, wxSize( width, width ), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, 0, false, false, false); 0, false, false, false); Loading @@ -484,7 +456,7 @@ void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, } } /* Virtual function needed by the PCB_SCREEN class derived from BASE_SCREEN /* Virtual fonction needed by the PCB_SCREEN class derived from BASE_SCREEN * this is a virtual pure function in BASE_SCREEN * this is a virtual pure function in BASE_SCREEN * do nothing in gerbview * do nothing in gerbview * could be removed later * could be removed later Loading
include/pcbstruct.h +3 −2 Original line number Original line Diff line number Diff line Loading @@ -115,8 +115,9 @@ #define LAST_NON_COPPER_LAYER EDGE_N #define LAST_NON_COPPER_LAYER EDGE_N // extra bits 0xE0000000 // extra bits 0xE0000000 /* masques generaux : */ /* Helpful global layers maks : */ #define ALL_LAYERS 0x1FFFFFFF #define ALL_LAYERS 0x1FFFFFFF // Pcbnew used 29 layers #define FULL_LAYERS 0xFFFFFFFF // Gerbview used 32 layers #define ALL_NO_CU_LAYERS 0x1FFF0000 #define ALL_NO_CU_LAYERS 0x1FFF0000 #define ALL_CU_LAYERS 0x0000FFFF #define ALL_CU_LAYERS 0x0000FFFF #define INTERNAL_LAYERS 0x00007FFE /* Bits layers internes */ #define INTERNAL_LAYERS 0x00007FFE /* Bits layers internes */ Loading
pcbnew/class_board_design_settings.cpp +2 −1 Original line number Original line Diff line number Diff line Loading @@ -83,7 +83,8 @@ int EDA_BoardDesignSettings::GetVisibleLayers() const void EDA_BoardDesignSettings::SetVisibleLayers( int aMask ) void EDA_BoardDesignSettings::SetVisibleLayers( int aMask ) { { m_VisibleLayers = aMask & m_EnabledLayers & ALL_LAYERS; // Altough Pcbnew uses only 29, Gerbview uses all 32 layers m_VisibleLayers = aMask & m_EnabledLayers & FULL_LAYERS; } } Loading