2009-01-11 19:12:18 +00:00
|
|
|
/************************************************************/
|
|
|
|
/* print_board_functions.cpp: some functions to plot boards */
|
|
|
|
/************************************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
#include "gr_basic.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "class_drawpanel.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "pcbnew.h"
|
2010-03-18 20:35:29 +00:00
|
|
|
#include "wxPcbStruct.h"
|
2010-08-10 18:34:26 +00:00
|
|
|
#include "module_editor_frame.h"
|
2009-10-28 11:48:47 +00:00
|
|
|
#include "class_board_design_settings.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "pcbplot.h"
|
2010-01-09 20:25:39 +00:00
|
|
|
#include "printout_controler.h"
|
2010-01-29 20:36:12 +00:00
|
|
|
#include "colors_selection.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "protos.h"
|
|
|
|
|
|
|
|
|
2011-01-21 19:30:59 +00:00
|
|
|
static void Print_Module( EDA_DRAW_PANEL* aPanel, wxDC* aDC, MODULE* aModule,
|
2010-01-09 20:25:39 +00:00
|
|
|
int aDraw_mode, int aMasklayer,
|
|
|
|
PRINT_PARAMETERS::DrillShapeOptT aDrillShapeOpt );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-08-26 17:01:17 +00:00
|
|
|
void FOOTPRINT_EDIT_FRAME::PrintPage( wxDC* aDC,
|
|
|
|
int aPrintMaskLayer,
|
|
|
|
bool aPrintMirrorMode,
|
|
|
|
void * aData)
|
2010-04-21 17:22:27 +00:00
|
|
|
{
|
|
|
|
MODULE* Module;
|
|
|
|
int drawmode = GR_COPY;
|
|
|
|
DISPLAY_OPTIONS save_opt;
|
|
|
|
BOARD* Pcb = GetBoard();
|
|
|
|
int defaultPenSize = 50;
|
|
|
|
|
|
|
|
PRINT_PARAMETERS * printParameters = (PRINT_PARAMETERS*) aData; // can be null
|
|
|
|
PRINT_PARAMETERS::DrillShapeOptT drillShapeOpt = PRINT_PARAMETERS::FULL_DRILL_SHAPE;
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2010-04-21 17:22:27 +00:00
|
|
|
if( printParameters )
|
|
|
|
defaultPenSize = printParameters->m_PenDefaultSize;
|
|
|
|
|
|
|
|
save_opt = DisplayOpt;
|
|
|
|
|
|
|
|
DisplayOpt.ContrastModeDisplay = false;
|
|
|
|
DisplayOpt.DisplayPadFill = true;
|
2010-04-23 09:54:40 +00:00
|
|
|
DisplayOpt.DisplayViaFill = true;
|
2010-04-21 17:22:27 +00:00
|
|
|
|
|
|
|
m_DisplayPadFill = DisplayOpt.DisplayPadFill;
|
|
|
|
m_DisplayViaFill = DisplayOpt.DisplayViaFill;
|
|
|
|
m_DisplayPadNum = DisplayOpt.DisplayPadNum = false;
|
|
|
|
bool nctmp = GetBoard()->IsElementVisible(NO_CONNECTS_VISIBLE);
|
|
|
|
GetBoard()->SetElementVisibility(NO_CONNECTS_VISIBLE, false);
|
|
|
|
DisplayOpt.DisplayPadIsol = false;
|
|
|
|
DisplayOpt.DisplayModEdge = FILLED;
|
|
|
|
DisplayOpt.DisplayModText = FILLED;
|
|
|
|
m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill = FILLED;
|
|
|
|
DisplayOpt.ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE;
|
|
|
|
DisplayOpt.DisplayDrawItems = FILLED;
|
|
|
|
DisplayOpt.DisplayZonesMode = 0;
|
|
|
|
DisplayOpt.DisplayNetNamesMode = 0;
|
|
|
|
|
|
|
|
DrawPanel->m_PrintIsMirrored = aPrintMirrorMode;
|
|
|
|
|
2011-08-26 17:01:17 +00:00
|
|
|
// The OR mode is used in color mode, but be aware the background *must be
|
2010-04-21 17:22:27 +00:00
|
|
|
// BLACK. In the print page dialog, we first print in BLACK, and after
|
2011-08-26 17:01:17 +00:00
|
|
|
// reprint in color, on the black "local" background, in OR mode the black
|
2010-04-21 17:22:27 +00:00
|
|
|
// print is not made before, only a white page is printed
|
|
|
|
if( GetGRForceBlackPenState() == false )
|
|
|
|
drawmode = GR_OR;
|
|
|
|
|
|
|
|
// Draw footprints, this is done at last in order to print the pad holes in
|
|
|
|
// white (or g_DrawBgColor) after the tracks and zones
|
|
|
|
Module = (MODULE*) Pcb->m_Modules;
|
|
|
|
int tmp = D_PAD::m_PadSketchModePenSize;
|
|
|
|
D_PAD::m_PadSketchModePenSize = defaultPenSize;
|
2011-01-15 18:06:10 +00:00
|
|
|
wxPoint offset;
|
|
|
|
offset.x = GetScreen()->m_CurrentSheetDesc->m_Size.x / 2;
|
|
|
|
offset.y = GetScreen()->m_CurrentSheetDesc->m_Size.y / 2;
|
|
|
|
// offset is in mils, converts in internal units
|
|
|
|
offset.x *= m_InternalUnits / 1000;
|
|
|
|
offset.y *= m_InternalUnits / 1000;
|
|
|
|
|
2010-04-21 17:22:27 +00:00
|
|
|
for( ; Module != NULL; Module = Module->Next() )
|
|
|
|
{
|
2011-01-15 18:06:10 +00:00
|
|
|
Module->Move( offset );
|
2010-04-21 17:22:27 +00:00
|
|
|
Print_Module( DrawPanel, aDC, Module, drawmode, aPrintMaskLayer, drillShapeOpt );
|
2011-01-15 18:06:10 +00:00
|
|
|
Module->Move( -offset );
|
2010-04-21 17:22:27 +00:00
|
|
|
}
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2010-04-21 17:22:27 +00:00
|
|
|
D_PAD::m_PadSketchModePenSize = tmp;
|
|
|
|
|
|
|
|
DrawPanel->m_PrintIsMirrored = false;
|
|
|
|
|
|
|
|
DisplayOpt = save_opt;
|
|
|
|
m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill;
|
|
|
|
m_DisplayPadFill = DisplayOpt.DisplayPadFill;
|
|
|
|
m_DisplayViaFill = DisplayOpt.DisplayViaFill;
|
|
|
|
m_DisplayPadNum = DisplayOpt.DisplayPadNum;
|
|
|
|
GetBoard()->SetElementVisibility(NO_CONNECTS_VISIBLE, nctmp);
|
|
|
|
}
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
2010-11-12 16:59:16 +00:00
|
|
|
/**
|
|
|
|
* Function PrintPage
|
|
|
|
* is used to print the board (on printer, or when creating SVF files).
|
2010-01-09 20:25:39 +00:00
|
|
|
* Print the board, but only layers allowed by aPrintMaskLayer
|
|
|
|
* @param aDC = the print device context
|
2010-12-29 17:47:32 +00:00
|
|
|
* @param aPrintMaskLayer = a 32 bits mask: bit n = 1 -> layer n is printed
|
2010-01-09 20:25:39 +00:00
|
|
|
* @param aPrintMirrorMode = true to plot mirrored
|
|
|
|
* @param aData = a pointer to an optional data (NULL if not used)
|
2007-08-23 04:28:46 +00:00
|
|
|
*/
|
2011-03-01 19:26:17 +00:00
|
|
|
void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
|
|
|
|
int aPrintMaskLayer,
|
|
|
|
bool aPrintMirrorMode,
|
|
|
|
void* aData)
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-11-20 14:55:20 +00:00
|
|
|
MODULE* Module;
|
|
|
|
int drawmode = GR_COPY;
|
2011-09-07 19:41:04 +00:00
|
|
|
DISPLAY_OPTIONS save_opt;
|
|
|
|
TRACK* pt_trace;
|
|
|
|
BOARD* Pcb = GetBoard();
|
|
|
|
int defaultPenSize = 50;
|
|
|
|
bool onePagePerLayer = false;
|
2010-03-29 16:42:03 +00:00
|
|
|
|
2010-01-09 20:25:39 +00:00
|
|
|
PRINT_PARAMETERS * printParameters = (PRINT_PARAMETERS*) aData; // can be null
|
2011-09-07 19:41:04 +00:00
|
|
|
|
2010-03-29 16:42:03 +00:00
|
|
|
if( printParameters && printParameters->m_OptionPrintPage == 0 )
|
|
|
|
onePagePerLayer = true;
|
2010-01-09 20:25:39 +00:00
|
|
|
|
|
|
|
PRINT_PARAMETERS::DrillShapeOptT drillShapeOpt = PRINT_PARAMETERS::FULL_DRILL_SHAPE;
|
2011-09-07 19:41:04 +00:00
|
|
|
|
2010-01-09 20:25:39 +00:00
|
|
|
if( printParameters )
|
2010-02-22 19:56:32 +00:00
|
|
|
{
|
2010-01-09 20:25:39 +00:00
|
|
|
drillShapeOpt = printParameters->m_DrillShapeOpt;
|
2010-02-22 19:56:32 +00:00
|
|
|
defaultPenSize = printParameters->m_PenDefaultSize;
|
|
|
|
}
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
save_opt = DisplayOpt;
|
2010-03-29 16:42:03 +00:00
|
|
|
int activeLayer = GetScreen()->m_Active_Layer;
|
|
|
|
|
|
|
|
DisplayOpt.ContrastModeDisplay = false;
|
|
|
|
DisplayOpt.DisplayPadFill = true;
|
|
|
|
DisplayOpt.DisplayViaFill = true;
|
|
|
|
|
|
|
|
if( (aPrintMaskLayer & ALL_CU_LAYERS) == 0 )
|
2009-09-29 04:44:35 +00:00
|
|
|
{
|
2010-03-29 16:42:03 +00:00
|
|
|
if( onePagePerLayer )
|
2011-09-07 19:41:04 +00:00
|
|
|
{ // We can print mask layers (solder mask and solder paste) with the actual
|
|
|
|
// pad sizes. To do that, we must set ContrastModeDisplay to true and set
|
|
|
|
//the GetScreen()->m_Active_Layer to the current printed layer
|
2010-03-29 16:42:03 +00:00
|
|
|
DisplayOpt.ContrastModeDisplay = true;
|
|
|
|
DisplayOpt.DisplayPadFill = true;
|
2010-04-23 09:54:40 +00:00
|
|
|
|
2010-03-29 16:42:03 +00:00
|
|
|
// Calculate the active layer number to print from its mask layer:
|
|
|
|
GetScreen()->m_Active_Layer = 0;
|
2011-09-07 19:41:04 +00:00
|
|
|
|
2010-03-29 16:42:03 +00:00
|
|
|
for(int kk = 0; kk < 32; kk ++ )
|
|
|
|
{
|
|
|
|
if( ((1 << kk) & aPrintMaskLayer) != 0 )
|
|
|
|
{
|
|
|
|
GetScreen()->m_Active_Layer = kk;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2010-04-23 09:54:40 +00:00
|
|
|
|
2010-03-29 16:42:03 +00:00
|
|
|
// pads on Silkscreen layer are usually plot in sketch mode:
|
2011-08-26 17:01:17 +00:00
|
|
|
if( (GetScreen()->m_Active_Layer == SILKSCREEN_N_BACK)
|
|
|
|
|| (GetScreen()->m_Active_Layer == SILKSCREEN_N_FRONT) )
|
2010-03-29 16:42:03 +00:00
|
|
|
DisplayOpt.DisplayPadFill = false;
|
2010-04-23 09:54:40 +00:00
|
|
|
|
2010-03-29 16:42:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DisplayOpt.DisplayPadFill = false;
|
|
|
|
}
|
2009-09-29 04:44:35 +00:00
|
|
|
}
|
2010-04-23 09:54:40 +00:00
|
|
|
|
2009-09-29 04:44:35 +00:00
|
|
|
|
2010-03-18 20:35:29 +00:00
|
|
|
m_DisplayPadFill = DisplayOpt.DisplayPadFill;
|
|
|
|
m_DisplayViaFill = DisplayOpt.DisplayViaFill;
|
|
|
|
m_DisplayPadNum = DisplayOpt.DisplayPadNum = false;
|
2011-08-26 17:01:17 +00:00
|
|
|
bool nctmp = GetBoard()->IsElementVisible( NO_CONNECTS_VISIBLE );
|
|
|
|
GetBoard()->SetElementVisibility( NO_CONNECTS_VISIBLE, false );
|
2008-12-17 06:51:39 +00:00
|
|
|
DisplayOpt.DisplayPadIsol = false;
|
2011-01-21 14:19:06 +00:00
|
|
|
m_DisplayModEdge = DisplayOpt.DisplayModEdge = FILLED;
|
|
|
|
m_DisplayModText = DisplayOpt.DisplayModText = FILLED;
|
2010-03-18 20:35:29 +00:00
|
|
|
m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill = FILLED;
|
2009-06-18 20:51:01 +00:00
|
|
|
DisplayOpt.ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE;
|
2009-11-20 14:55:20 +00:00
|
|
|
DisplayOpt.DisplayDrawItems = FILLED;
|
|
|
|
DisplayOpt.DisplayZonesMode = 0;
|
|
|
|
DisplayOpt.DisplayNetNamesMode = 0;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
2010-03-18 20:35:29 +00:00
|
|
|
DrawPanel->m_PrintIsMirrored = aPrintMirrorMode;
|
2009-06-18 20:51:01 +00:00
|
|
|
|
2011-08-26 17:01:17 +00:00
|
|
|
// The OR mode is used in color mode, but be aware the background *must be
|
2010-03-29 16:42:03 +00:00
|
|
|
// BLACK. In the print page dialog, we first print in BLACK, and after
|
2011-08-26 17:01:17 +00:00
|
|
|
// reprint in color, on the black "local" background, in OR mode the black
|
2009-11-20 14:55:20 +00:00
|
|
|
// print is not made before, only a white page is printed
|
|
|
|
if( GetGRForceBlackPenState() == false )
|
2009-01-15 14:32:29 +00:00
|
|
|
drawmode = GR_OR;
|
|
|
|
|
2008-12-17 06:51:39 +00:00
|
|
|
/* Print the pcb graphic items (texts, ...) */
|
2009-01-15 14:32:29 +00:00
|
|
|
GRSetDrawMode( aDC, drawmode );
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2009-11-20 14:55:20 +00:00
|
|
|
for( BOARD_ITEM* item = Pcb->m_Drawings; item; item = item->Next() )
|
2007-08-23 04:28:46 +00:00
|
|
|
{
|
2008-04-01 06:32:48 +00:00
|
|
|
switch( item->Type() )
|
2007-08-23 04:28:46 +00:00
|
|
|
{
|
2008-12-04 04:28:11 +00:00
|
|
|
case TYPE_DRAWSEGMENT:
|
2010-04-23 09:54:40 +00:00
|
|
|
case TYPE_DIMENSION:
|
2008-12-04 04:28:11 +00:00
|
|
|
case TYPE_TEXTE:
|
2011-09-07 19:41:04 +00:00
|
|
|
case PCB_TARGET_T:
|
2009-11-20 14:55:20 +00:00
|
|
|
if( ( ( 1 << item->GetLayer() ) & aPrintMaskLayer ) == 0 )
|
2007-08-23 04:28:46 +00:00
|
|
|
break;
|
|
|
|
|
2010-03-18 20:35:29 +00:00
|
|
|
item->Draw( DrawPanel, aDC, drawmode );
|
2007-08-23 04:28:46 +00:00
|
|
|
break;
|
|
|
|
|
2009-11-20 14:55:20 +00:00
|
|
|
case TYPE_MARKER_PCB:
|
2007-08-23 04:28:46 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-17 06:51:39 +00:00
|
|
|
/* Print tracks */
|
2011-09-07 19:41:04 +00:00
|
|
|
pt_trace = Pcb->m_Track;
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2011-09-07 19:41:04 +00:00
|
|
|
for( ; pt_trace != NULL; pt_trace = pt_trace->Next() )
|
2007-08-23 04:28:46 +00:00
|
|
|
{
|
2011-09-07 19:41:04 +00:00
|
|
|
if( ( aPrintMaskLayer & pt_trace->ReturnMaskLayer() ) == 0 )
|
2007-08-23 04:28:46 +00:00
|
|
|
continue;
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2011-09-07 19:41:04 +00:00
|
|
|
if( pt_trace->Type() == TYPE_VIA ) /* VIA encountered. */
|
2007-08-23 04:28:46 +00:00
|
|
|
{
|
2011-09-07 19:41:04 +00:00
|
|
|
int radius = pt_trace->m_Width >> 1;
|
|
|
|
int color = g_ColorsSettings.GetItemColor( VIAS_VISIBLE + pt_trace->m_Shape );
|
2009-01-13 19:18:54 +00:00
|
|
|
GRSetDrawMode( aDC, drawmode );
|
2010-03-18 20:35:29 +00:00
|
|
|
GRFilledCircle( &DrawPanel->m_ClipBox, aDC,
|
2011-09-07 19:41:04 +00:00
|
|
|
pt_trace->m_Start.x,
|
|
|
|
pt_trace->m_Start.y,
|
|
|
|
radius,
|
2010-01-09 20:25:39 +00:00
|
|
|
0, color, color );
|
2007-08-23 04:28:46 +00:00
|
|
|
}
|
|
|
|
else
|
2011-08-26 17:01:17 +00:00
|
|
|
{
|
2011-09-07 19:41:04 +00:00
|
|
|
pt_trace->Draw( DrawPanel, aDC, drawmode );
|
2011-08-26 17:01:17 +00:00
|
|
|
}
|
2007-08-23 04:28:46 +00:00
|
|
|
}
|
|
|
|
|
2011-09-07 19:41:04 +00:00
|
|
|
pt_trace = Pcb->m_Zone;
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2011-09-07 19:41:04 +00:00
|
|
|
for( ; pt_trace != NULL; pt_trace = pt_trace->Next() )
|
2007-08-23 04:28:46 +00:00
|
|
|
{
|
2011-09-07 19:41:04 +00:00
|
|
|
if( ( aPrintMaskLayer & pt_trace->ReturnMaskLayer() ) == 0 )
|
2007-08-23 04:28:46 +00:00
|
|
|
continue;
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2011-09-07 19:41:04 +00:00
|
|
|
pt_trace->Draw( DrawPanel, aDC, drawmode );
|
2007-08-23 04:28:46 +00:00
|
|
|
}
|
|
|
|
|
2009-01-15 14:32:29 +00:00
|
|
|
/* Draw filled areas (i.e. zones) */
|
|
|
|
for( int ii = 0; ii < Pcb->GetAreaCount(); ii++ )
|
|
|
|
{
|
2009-11-20 14:55:20 +00:00
|
|
|
ZONE_CONTAINER* zone = Pcb->GetArea( ii );
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2009-11-20 14:55:20 +00:00
|
|
|
if( ( aPrintMaskLayer & ( 1 << zone->GetLayer() ) ) == 0 )
|
2009-01-15 14:32:29 +00:00
|
|
|
continue;
|
|
|
|
|
2010-03-18 20:35:29 +00:00
|
|
|
zone->DrawFilledArea( DrawPanel, aDC, drawmode );
|
2009-01-15 14:32:29 +00:00
|
|
|
}
|
|
|
|
|
2009-11-20 14:55:20 +00:00
|
|
|
// Draw footprints, this is done at last in order to print the pad holes in
|
|
|
|
// white (or g_DrawBgColor) after the tracks and zones
|
2009-08-13 06:18:06 +00:00
|
|
|
Module = (MODULE*) Pcb->m_Modules;
|
2010-02-22 19:56:32 +00:00
|
|
|
int tmp = D_PAD::m_PadSketchModePenSize;
|
|
|
|
D_PAD::m_PadSketchModePenSize = defaultPenSize;
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2009-08-13 06:18:06 +00:00
|
|
|
for( ; Module != NULL; Module = Module->Next() )
|
|
|
|
{
|
2010-03-18 20:35:29 +00:00
|
|
|
Print_Module( DrawPanel, aDC, Module, drawmode, aPrintMaskLayer, drillShapeOpt );
|
2009-08-13 06:18:06 +00:00
|
|
|
}
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2010-02-22 19:56:32 +00:00
|
|
|
D_PAD::m_PadSketchModePenSize = tmp;
|
2009-08-13 06:18:06 +00:00
|
|
|
|
2009-11-20 14:55:20 +00:00
|
|
|
/* Print via holes in bg color: Not sure it is good for buried or blind
|
|
|
|
* vias */
|
2010-01-09 20:25:39 +00:00
|
|
|
if( drillShapeOpt != PRINT_PARAMETERS::NO_DRILL_SHAPE )
|
2007-08-23 04:28:46 +00:00
|
|
|
{
|
2011-09-07 19:41:04 +00:00
|
|
|
pt_trace = Pcb->m_Track;
|
2010-01-09 20:25:39 +00:00
|
|
|
int color = g_DrawBgColor;
|
|
|
|
bool blackpenstate = GetGRForceBlackPenState();
|
|
|
|
GRForceBlackPen( false );
|
|
|
|
GRSetDrawMode( aDC, GR_COPY );
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2011-09-07 19:41:04 +00:00
|
|
|
for( ; pt_trace != NULL; pt_trace = pt_trace->Next() )
|
2007-08-23 04:28:46 +00:00
|
|
|
{
|
2011-09-07 19:41:04 +00:00
|
|
|
if( ( aPrintMaskLayer & pt_trace->ReturnMaskLayer() ) == 0 )
|
2010-01-09 20:25:39 +00:00
|
|
|
continue;
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2011-09-07 19:41:04 +00:00
|
|
|
if( pt_trace->Type() == TYPE_VIA ) /* VIA encountered. */
|
2010-01-09 20:25:39 +00:00
|
|
|
{
|
|
|
|
int diameter;
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2010-01-09 20:25:39 +00:00
|
|
|
if( drillShapeOpt == PRINT_PARAMETERS::SMALL_DRILL_SHAPE )
|
2011-09-07 19:41:04 +00:00
|
|
|
diameter = min( SMALL_DRILL, pt_trace->GetDrillValue() );
|
2010-01-09 20:25:39 +00:00
|
|
|
else
|
2011-09-07 19:41:04 +00:00
|
|
|
diameter = pt_trace->GetDrillValue();
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2010-03-18 20:35:29 +00:00
|
|
|
GRFilledCircle( &DrawPanel->m_ClipBox, aDC,
|
2011-09-07 19:41:04 +00:00
|
|
|
pt_trace->m_Start.x, pt_trace->m_Start.y,
|
2010-01-09 20:25:39 +00:00
|
|
|
diameter/2,
|
|
|
|
0, color, color );
|
|
|
|
}
|
2007-08-23 04:28:46 +00:00
|
|
|
}
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2010-01-09 20:25:39 +00:00
|
|
|
GRForceBlackPen( blackpenstate );
|
2007-08-23 04:28:46 +00:00
|
|
|
}
|
2009-11-20 14:55:20 +00:00
|
|
|
|
2010-03-18 20:35:29 +00:00
|
|
|
DrawPanel->m_PrintIsMirrored = false;
|
2008-11-02 19:52:57 +00:00
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
DisplayOpt = save_opt;
|
2010-03-29 16:42:03 +00:00
|
|
|
GetScreen()->m_Active_Layer = activeLayer;
|
2010-03-18 20:35:29 +00:00
|
|
|
m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill;
|
|
|
|
m_DisplayPadFill = DisplayOpt.DisplayPadFill;
|
|
|
|
m_DisplayViaFill = DisplayOpt.DisplayViaFill;
|
|
|
|
m_DisplayPadNum = DisplayOpt.DisplayPadNum;
|
2011-01-21 14:19:06 +00:00
|
|
|
m_DisplayModEdge = DisplayOpt.DisplayModEdge;
|
|
|
|
m_DisplayModText = DisplayOpt.DisplayModText;
|
2010-03-18 20:35:29 +00:00
|
|
|
GetBoard()->SetElementVisibility(NO_CONNECTS_VISIBLE, nctmp);
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-01-21 19:30:59 +00:00
|
|
|
static void Print_Module( EDA_DRAW_PANEL* aPanel, wxDC* aDC, MODULE* aModule,
|
2010-01-09 20:25:39 +00:00
|
|
|
int aDraw_mode, int aMasklayer,
|
|
|
|
PRINT_PARAMETERS::DrillShapeOptT aDrillShapeOpt )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2010-12-08 20:12:46 +00:00
|
|
|
D_PAD* pt_pad;
|
|
|
|
EDA_ITEM* PtStruct;
|
|
|
|
TEXTE_MODULE* TextMod;
|
|
|
|
int mlayer;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
2008-12-17 06:51:39 +00:00
|
|
|
/* Print pads */
|
2010-01-09 20:25:39 +00:00
|
|
|
pt_pad = aModule->m_Pads;
|
2010-02-22 19:56:32 +00:00
|
|
|
|
2008-11-24 06:53:43 +00:00
|
|
|
for( ; pt_pad != NULL; pt_pad = pt_pad->Next() )
|
2007-08-23 04:28:46 +00:00
|
|
|
{
|
2011-09-07 19:41:04 +00:00
|
|
|
if( (pt_pad->m_layerMask & aMasklayer ) == 0 )
|
2007-08-23 04:28:46 +00:00
|
|
|
continue;
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2010-03-29 16:42:03 +00:00
|
|
|
// Manage hole according to the print drill option
|
|
|
|
wxSize drill_tmp = pt_pad->m_Drill;
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2010-03-29 16:42:03 +00:00
|
|
|
switch ( aDrillShapeOpt )
|
2010-01-09 20:25:39 +00:00
|
|
|
{
|
2010-03-29 16:42:03 +00:00
|
|
|
case PRINT_PARAMETERS::NO_DRILL_SHAPE:
|
|
|
|
pt_pad->m_Drill = wxSize(0,0);
|
|
|
|
break;
|
|
|
|
case PRINT_PARAMETERS::SMALL_DRILL_SHAPE:
|
|
|
|
pt_pad->m_Drill.x = MIN(SMALL_DRILL,pt_pad->m_Drill.x);
|
|
|
|
pt_pad->m_Drill.y = MIN(SMALL_DRILL,pt_pad->m_Drill.y);
|
|
|
|
break;
|
|
|
|
case PRINT_PARAMETERS::FULL_DRILL_SHAPE:
|
|
|
|
// Do nothing
|
|
|
|
break;
|
2010-01-09 20:25:39 +00:00
|
|
|
}
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2010-03-29 16:42:03 +00:00
|
|
|
pt_pad->Draw( aPanel, aDC, aDraw_mode );
|
|
|
|
pt_pad->m_Drill = drill_tmp;
|
2007-08-23 04:28:46 +00:00
|
|
|
}
|
|
|
|
|
2008-12-17 06:51:39 +00:00
|
|
|
/* Print footprint graphic shapes */
|
2010-01-09 20:25:39 +00:00
|
|
|
PtStruct = aModule->m_Drawings;
|
|
|
|
mlayer = g_TabOneLayerMask[aModule->GetLayer()];
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2010-01-09 20:25:39 +00:00
|
|
|
if( aModule->GetLayer() == LAYER_N_BACK )
|
2009-12-21 18:51:37 +00:00
|
|
|
mlayer = SILKSCREEN_LAYER_BACK;
|
2010-01-09 20:25:39 +00:00
|
|
|
else if( aModule->GetLayer() == LAYER_N_FRONT )
|
2009-12-21 18:51:37 +00:00
|
|
|
mlayer = SILKSCREEN_LAYER_FRONT;
|
2008-04-01 05:21:50 +00:00
|
|
|
|
2010-01-09 20:25:39 +00:00
|
|
|
if( mlayer & aMasklayer )
|
2007-08-23 04:28:46 +00:00
|
|
|
{
|
2010-01-09 20:25:39 +00:00
|
|
|
if( !aModule->m_Reference->m_NoShow )
|
|
|
|
aModule->m_Reference->Draw( aPanel, aDC, aDraw_mode );
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2010-01-09 20:25:39 +00:00
|
|
|
if( !aModule->m_Value->m_NoShow )
|
|
|
|
aModule->m_Value->Draw( aPanel, aDC, aDraw_mode );
|
2007-08-23 04:28:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
|
|
|
|
{
|
2007-09-01 12:00:30 +00:00
|
|
|
switch( PtStruct->Type() )
|
2007-08-23 04:28:46 +00:00
|
|
|
{
|
2008-12-04 04:28:11 +00:00
|
|
|
case TYPE_TEXTE_MODULE:
|
2011-08-26 17:01:17 +00:00
|
|
|
if( ( mlayer & aMasklayer ) == 0 )
|
2007-08-23 04:28:46 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
TextMod = (TEXTE_MODULE*) PtStruct;
|
2010-01-09 20:25:39 +00:00
|
|
|
TextMod->Draw( aPanel, aDC, aDraw_mode );
|
2007-08-23 04:28:46 +00:00
|
|
|
break;
|
|
|
|
|
2008-12-04 04:28:11 +00:00
|
|
|
case TYPE_EDGE_MODULE:
|
2007-08-23 04:28:46 +00:00
|
|
|
{
|
|
|
|
EDGE_MODULE* edge = (EDGE_MODULE*) PtStruct;
|
2011-09-07 19:41:04 +00:00
|
|
|
|
2010-01-09 20:25:39 +00:00
|
|
|
if( ( g_TabOneLayerMask[edge->GetLayer()] & aMasklayer ) == 0 )
|
2007-08-23 04:28:46 +00:00
|
|
|
break;
|
2011-09-07 19:41:04 +00:00
|
|
|
|
2010-01-09 20:25:39 +00:00
|
|
|
edge->Draw( aPanel, aDC, aDraw_mode );
|
2007-08-23 04:28:46 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|