mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-18 17:59:17 +00:00
Merged upstream.
This commit is contained in:
commit
e13f862145
.bzrignore
3d-viewer
3d_canvas.cpp3d_draw.cpp3d_draw_basic_functions.cpp3d_draw_basic_functions.h3d_frame.cpp3d_toolbar.cpp3d_viewer_id.h
CMakeLists.txtdialogs
info3d_visu.cppinfo3d_visu.hCMakeModules
CreateBzrVersionHeader.cmakeFunctions.cmakePerformFeatureChecks.cmakecmake_uninstall.cmake.inconfig.h.cmakedownload_avhttp.cmakedownload_boost.cmakedownload_openssl.cmake
Documentation
INSTALL.txtTODO.txtcommon
CMakeLists.txtbase_struct.cppclass_bitmap_base.cppcommon_plotGERBER_functions.cppcommon_plot_functions.cppconfirm.cpp
dialogs
dialog_hotkeys_editor.cppdialog_hotkeys_editor_base.cppdialog_hotkeys_editor_base.fbpdialog_hotkeys_editor_base.hdialog_page_settings.cpp
eda_text.cppfootprint_info.cppfp_lib_table.cppgrid_tricks.cpphotkey_grid_table.cpphotkeys_basic.cpppage_layout
class_worksheet_dataitem.cpppage_layout_graphic_items.cpppage_layout_reader.cpppage_layout_reader.keywordstitle_block_shapes.cpptitle_block_shapes_gost.cpp
page_layout_default_description.cpppage_layout_reader.cpppage_layout_reader.keywordsrichio.cppsch_item_struct.cpptrigo.cppcvpcb
eeschema
CMakeLists.txtblock.cppclass_netlist_object.cppclass_netlist_object.hdangling_ends.cpp
dialogs
dialog_edit_component_in_schematic.cppdialog_erc.cppdialog_lib_edit_text_base.cppdialog_lib_edit_text_base.fbpdialog_lib_edit_text_base.hdialog_netlist.cppdialog_schematic_find.h
eeschema_config.cpperc.cpperc.hfiles-io.cppfind.cppgeneral.hhotkeys.cpplib_draw_item.hlibeditframe.cppnetform.cppnetlist.cppnetlist.honleftclick.cppprotos.hsch_collectors.cppsch_collectors.hsch_component.cppsch_component.hsch_field.cppsch_junction.cppsch_junction.hsch_line.cppsch_line.hsch_no_connect.cppsch_no_connect.hsch_screen.cppsch_sheet.cppsch_sheet.hsch_sheet_path.cppsch_sheet_path.hsch_text.cppsch_text.hschedit.cppschframe.cppgerbview
class_gbr_layout.h
dialogs
dialog_print_using_printer.cppdialog_print_using_printer_base.cppdialog_print_using_printer_base.fbpdialog_print_using_printer_base.h
draw_gerber_screen.cppexcellon_read_drill_file.cppexport_to_pcbnew.cppgerbview_frame.cppinclude
appl_wxstruct.hbase_struct.hclass_bitmap_base.hclass_board_item.hclass_drc_item.hclass_worksheet_dataitem.hcommon.hconfirm.hdialog_hotkeys_editor.hdsnlexer.heda_text.hfootprint_info.hfp_lib_table.hgrid_tricks.hhashtables.hhotkey_grid_table.hmacros.hrichio.hsch_item_struct.htrigo.hworksheet_shape_builder.hwxBasePcbFrame.hwxEeschemaStruct.hwxPcbStruct.h
lib_dxf
CMakeLists.txtCREDITS.txtdrw_base.hdrw_entities.cppdrw_entities.hdrw_interface.hdrw_objects.cppdrw_objects.h
intern
drw_cptable932.hdrw_cptable936.hdrw_cptable949.hdrw_cptable950.hdrw_cptables.hdrw_textcodec.cppdrw_textcodec.hdxfreader.cppdxfreader.hdxfwriter.cppdxfwriter.h
libdxfrw.cpplibdxfrw.hpagelayout_editor
design_tree_frame.cpp
dialogs
events_functions.cppfiles.cpponrightclick.cpppage_layout_writer.cpppl_editor.cpppl_editor_frame.cpppl_editor_id.hproperties_frame.cpppatches
pcbnew
CMakeLists.txtDoxyfile_pythonDoxyfile_xmlblock.cppboard_undo_redo.cppclass_board.cppclass_board.hclass_dimension.cppclass_dimension.hclass_drawsegment.cppclass_drawsegment.hclass_mire.cppclass_mire.hclass_module.cppclass_module.hclass_pad_draw_functions.cppclass_pcb_text.hclass_track.cppclass_track.hclass_zone.cppclass_zone.h
dialogs
dialog_copper_zones.cppdialog_fp_lib_table.cppdialog_fp_lib_table_base.cppdialog_fp_lib_table_base.fbpdialog_fp_lib_table_base.hdialog_fp_plugin_options.cppdialog_fp_plugin_options_base.cppdialog_fp_plugin_options_base.fbpdialog_fp_plugin_options_base.hdialog_pad_properties.cppdialog_plot.cppdialog_plot_base.cppdialog_plot_base.fbp
eagle_plugin.cppeagle_plugin.hedit.cppfiles.cppgithub
gpcb_plugin.cppgpcb_plugin.hhotkeys_board_editor.cppimport_dxf
dialog_dxf_import.cppdialog_dxf_import.fbpdialog_dxf_import_base.cppdialog_dxf_import_base.hdxf2brd_items.cppdxf2brd_items.h
invoke_pcb_dialog.hio_mgr.cppio_mgr.hkicad_plugin.cppkicad_plugin.hlegacy_plugin.cpplegacy_plugin.hlibrairi.cpploadcmp.cppmenubar_pcbframe.cppmodule_editor_frame.hmoduleframe.cppmodview.cppmodview_frame.cppmodview_frame.hexamples
pcad2kicadpcb_plugin
pcb_parser.cpppcb_parser.hpcbframe.cpppcbnew.cpppcbnew_config.cpppcbnew_id.hplugin.cppprintout_controler.cppprotos.hscripting
sel_layer.cppspecctra.hspecctra_export.cppswap_layers.cppzones_test_and_combine_areas.cpppolygon
scripting/build_tools
scripts
template
@ -3,13 +3,16 @@ boost_root
|
||||
common/netlist_keywords.*
|
||||
common/netlist_lexer.h
|
||||
common/pcb_plot_params_lexer.h
|
||||
common/page_layout_reader_keywords.cpp
|
||||
common/page_layout/page_layout_reader_keywords.cpp
|
||||
common/fp_lib_table_keywords.*
|
||||
include/fp_lib_table_lexer.h
|
||||
include/netlist_lexer.h
|
||||
include/page_layout_reader_lexer.h
|
||||
eeschema/cmp_library_lexer.h
|
||||
eeschema/cmp_library_keywords.*
|
||||
eeschema/dialogs/dialog_bom_cfg_keywords.cpp
|
||||
eeschema/dialogs/dialog_bom_cfg_lexer.h
|
||||
eeschema/dialogs/dialog_bom_help_html.h
|
||||
eeschema/template_fieldnames_keywords.*
|
||||
eeschema/template_fieldnames_lexer.h
|
||||
pcbnew/dialogs/dialog_freeroute_exchange_help_html.h
|
||||
|
@ -489,24 +489,24 @@ void EDA_3D_CANVAS::InitGL()
|
||||
m_ZTop = 10.0;
|
||||
|
||||
glDisable( GL_CULL_FACE ); // show back faces
|
||||
|
||||
glEnable( GL_DEPTH_TEST ); // Enable z-buferring
|
||||
|
||||
glEnable( GL_ALPHA_TEST );
|
||||
glEnable( GL_LINE_SMOOTH );
|
||||
// glEnable(GL_POLYGON_SMOOTH); // creates issues with some graphic cards
|
||||
glShadeModel( GL_SMOOTH );
|
||||
glEnable( GL_COLOR_MATERIAL );
|
||||
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
|
||||
|
||||
/* speedups */
|
||||
// speedups
|
||||
glEnable( GL_DITHER );
|
||||
glShadeModel( GL_SMOOTH );
|
||||
glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_DONT_CARE );
|
||||
glHint( GL_LINE_SMOOTH_HINT, GL_NICEST );
|
||||
glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST ); // can be GL_FASTEST
|
||||
glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST );
|
||||
|
||||
/* blend */
|
||||
// Initialize alpha blending function.
|
||||
glEnable( GL_BLEND );
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
|
||||
}
|
||||
}
|
||||
|
||||
// set viewing projection
|
||||
|
||||
|
@ -49,7 +49,6 @@
|
||||
#include <3d_draw_basic_functions.h>
|
||||
|
||||
// Imported function:
|
||||
extern void SetGLColor( EDA_COLOR_T color );
|
||||
extern void Set_Object_Data( std::vector<S3D_VERTEX>& aVertices, double aBiuTo3DUnits );
|
||||
extern void CheckGLError();
|
||||
|
||||
@ -147,11 +146,66 @@ void EDA_3D_CANVAS::Redraw( bool finish )
|
||||
SwapBuffers();
|
||||
}
|
||||
|
||||
// Helper function: initialize the copper color to draw the board
|
||||
// in realistic mode.
|
||||
static inline void SetGLCopperColor()
|
||||
{
|
||||
// Generates a golden yellow color, near board "copper" color
|
||||
const double lum = 0.7/255.0;
|
||||
glColor4f( 255.0*lum, 223.0*lum, 0.0*lum, 1.0 );
|
||||
}
|
||||
|
||||
// Helper function: initialize the color to draw the epoxy layers
|
||||
// ( body board and solder mask layers) in realistic mode.
|
||||
static inline void SetGLEpoxyColor( double aTransparency = 1.0 )
|
||||
{
|
||||
// Generates an epoxy color, near board color
|
||||
const double lum = 0.2/255.0;
|
||||
glColor4f( 100.0*lum, 255.0*lum, 180.0*lum, aTransparency );
|
||||
}
|
||||
|
||||
// Helper function: initialize the color to draw the non copper layers
|
||||
// in realistic mode and normal mode.
|
||||
static inline void SetGLTechLayersColor( LAYER_NUM aLayer )
|
||||
{
|
||||
if( g_Parm_3D_Visu.IsRealisticMode() )
|
||||
{
|
||||
switch( aLayer )
|
||||
{
|
||||
case SOLDERPASTE_N_BACK:
|
||||
case SOLDERPASTE_N_FRONT:
|
||||
SetGLColor( DARKGRAY, 0.7 );
|
||||
break;
|
||||
|
||||
case SILKSCREEN_N_BACK:
|
||||
case SILKSCREEN_N_FRONT:
|
||||
SetGLColor( LIGHTGRAY, 0.9 );
|
||||
break;
|
||||
|
||||
case SOLDERMASK_N_BACK:
|
||||
case SOLDERMASK_N_FRONT:
|
||||
SetGLEpoxyColor( 0.7 );
|
||||
break;
|
||||
|
||||
default:
|
||||
EDA_COLOR_T color = g_ColorsSettings.GetLayerColor( aLayer );
|
||||
SetGLColor( color, 0.7 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
EDA_COLOR_T color = g_ColorsSettings.GetLayerColor( aLayer );
|
||||
SetGLColor( color, 0.7 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_CANVAS::BuildBoard3DView()
|
||||
{
|
||||
PCB_BASE_FRAME* pcbframe = Parent()->Parent();
|
||||
BOARD* pcb = pcbframe->GetBoard();
|
||||
bool realistic_mode = g_Parm_3D_Visu.IsRealisticMode();
|
||||
|
||||
// Number of segments to draw a circle using segments
|
||||
const int segcountforcircle = 16;
|
||||
@ -161,14 +215,29 @@ void EDA_3D_CANVAS::BuildBoard3DView()
|
||||
// for holes and items which do not need
|
||||
// a fine representation
|
||||
double correctionFactorLQ = 1.0 / cos( M_PI / (segcountLowQuality * 2) );
|
||||
CPOLYGONS_LIST bufferPolys;
|
||||
|
||||
bufferPolys.reserve( 200000 ); // Reserve for large board (tracks mainly)
|
||||
CPOLYGONS_LIST bufferZonesPolys;
|
||||
bufferPolys.reserve( 500000 ); // Reserve for large board ( copper zones mainly )
|
||||
CPOLYGONS_LIST currLayerHoles; // Contains holes for the current layer
|
||||
CPOLYGONS_LIST allLayerHoles; // Contains through holes, calculated only once
|
||||
CPOLYGONS_LIST bufferPolys;
|
||||
bufferPolys.reserve( 200000 ); // Reserve for large board (tracks mainly)
|
||||
|
||||
CPOLYGONS_LIST bufferPcbOutlines; // stores the board main outlines
|
||||
CPOLYGONS_LIST allLayerHoles; // Contains through holes, calculated only once
|
||||
allLayerHoles.reserve( 20000 );
|
||||
|
||||
// Build a polygon from edge cut items
|
||||
wxString msg;
|
||||
if( ! pcb->GetBoardPolygonOutlines( bufferPcbOutlines,
|
||||
allLayerHoles, &msg ) )
|
||||
{
|
||||
msg << wxT("\n\n") <<
|
||||
_("Unable to calculate the board outlines.\n"
|
||||
"Therefore use the board boundary box.");
|
||||
wxMessageBox( msg );
|
||||
}
|
||||
|
||||
CPOLYGONS_LIST bufferZonesPolys;
|
||||
bufferZonesPolys.reserve( 500000 ); // Reserve for large board ( copper zones mainly )
|
||||
|
||||
CPOLYGONS_LIST currLayerHoles; // Contains holes for the current layer
|
||||
bool throughHolesListBuilt = false; // flag to build the through hole polygon list only once
|
||||
bool hightQualityMode = false;
|
||||
|
||||
@ -179,7 +248,7 @@ void EDA_3D_CANVAS::BuildBoard3DView()
|
||||
&& layer >= g_Parm_3D_Visu.m_CopperLayersCount )
|
||||
continue;
|
||||
|
||||
if( !g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) )
|
||||
if( !Is3DLayerEnabled( layer ) )
|
||||
continue;
|
||||
|
||||
bufferPolys.RemoveAllContours();
|
||||
@ -243,7 +312,7 @@ void EDA_3D_CANVAS::BuildBoard3DView()
|
||||
}
|
||||
|
||||
// Draw copper zones
|
||||
if( g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ZONE] )
|
||||
if( g_Parm_3D_Visu.GetFlag( FL_ZONE ) )
|
||||
{
|
||||
for( int ii = 0; ii < pcb->GetAreaCount(); ii++ )
|
||||
{
|
||||
@ -282,7 +351,8 @@ void EDA_3D_CANVAS::BuildBoard3DView()
|
||||
}
|
||||
}
|
||||
|
||||
// bufferPolys contains polygons to merge. Many overlaps . Calculate merged polygons
|
||||
// bufferPolys contains polygons to merge. Many overlaps .
|
||||
// Calculate merged polygons
|
||||
if( bufferPolys.GetCornersCount() == 0 )
|
||||
continue;
|
||||
|
||||
@ -301,11 +371,17 @@ void EDA_3D_CANVAS::BuildBoard3DView()
|
||||
// Merge polygons, remove holes
|
||||
currLayerPolyset -= polysetHoles;
|
||||
|
||||
EDA_COLOR_T color = g_ColorsSettings.GetLayerColor( layer );
|
||||
int thickness = g_Parm_3D_Visu.GetLayerObjectThicknessBIU( layer );
|
||||
int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU( layer );
|
||||
|
||||
SetGLColor( color );
|
||||
if( realistic_mode )
|
||||
SetGLCopperColor();
|
||||
else
|
||||
{
|
||||
EDA_COLOR_T color = g_ColorsSettings.GetLayerColor( layer );
|
||||
SetGLColor( color );
|
||||
}
|
||||
|
||||
glNormal3f( 0.0, 0.0, Get3DLayer_Z_Orientation( layer ) );
|
||||
|
||||
bufferPolys.RemoveAllContours();
|
||||
@ -336,14 +412,65 @@ void EDA_3D_CANVAS::BuildBoard3DView()
|
||||
Draw3DPadHole( pad );
|
||||
}
|
||||
|
||||
// Draw board substrate:
|
||||
if( bufferPcbOutlines.GetCornersCount() &&
|
||||
( realistic_mode || g_Parm_3D_Visu.GetFlag( FL_SHOW_BOARD_BODY ) ) )
|
||||
{
|
||||
int copper_thickness = g_Parm_3D_Visu.GetCopperThicknessBIU();
|
||||
// a small offset between substrate and external copper layer to avoid artifacts
|
||||
// when drawing copper items on board
|
||||
int epsilon = Millimeter2iu( 0.01 );
|
||||
int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_BACK );
|
||||
int board_thickness = g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_FRONT )
|
||||
- g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_BACK );
|
||||
// items on copper layers and having a thickness = copper_thickness
|
||||
// are drawn from zpos - copper_thickness/2 to zpos + copper_thickness
|
||||
// therefore substrate position is copper_thickness/2 to
|
||||
// substrate_height - copper_thickness/2
|
||||
zpos += (copper_thickness + epsilon) / 2;
|
||||
board_thickness -= copper_thickness + epsilon;
|
||||
|
||||
if( realistic_mode )
|
||||
SetGLEpoxyColor();
|
||||
else
|
||||
{
|
||||
EDA_COLOR_T color = g_ColorsSettings.GetLayerColor( EDGE_N );
|
||||
SetGLColor( color, 0.7 );
|
||||
}
|
||||
|
||||
glNormal3f( 0.0, 0.0, Get3DLayer_Z_Orientation( LAYER_N_FRONT ) );
|
||||
KI_POLYGON_SET currLayerPolyset;
|
||||
KI_POLYGON_SET polysetHoles;
|
||||
|
||||
// Add polygons, without holes
|
||||
bufferPcbOutlines.ExportTo( currLayerPolyset );
|
||||
|
||||
// Build holes list
|
||||
allLayerHoles.ExportTo( polysetHoles );
|
||||
|
||||
// remove holes
|
||||
currLayerPolyset -= polysetHoles;
|
||||
|
||||
bufferPcbOutlines.RemoveAllContours();
|
||||
bufferPcbOutlines.ImportFrom( currLayerPolyset );
|
||||
|
||||
// for Draw3D_SolidHorizontalPolyPolygons, zpos it the middle between bottom and top
|
||||
// sides
|
||||
Draw3D_SolidHorizontalPolyPolygons( bufferPcbOutlines, zpos + board_thickness/2,
|
||||
board_thickness, g_Parm_3D_Visu.m_BiuTo3Dunits );
|
||||
}
|
||||
|
||||
// draw graphic items, not on copper layers
|
||||
KI_POLYGON_SET brdpolysetHoles;
|
||||
allLayerHoles.ExportTo( brdpolysetHoles );
|
||||
|
||||
for( LAYER_NUM layer = FIRST_NON_COPPER_LAYER; layer <= LAST_NON_COPPER_LAYER;
|
||||
layer++ )
|
||||
{
|
||||
if( !Is3DLayerEnabled( layer ) )
|
||||
continue;
|
||||
|
||||
if( !g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) )
|
||||
if( layer == EDGE_N && g_Parm_3D_Visu.GetFlag( FL_SHOW_BOARD_BODY ) )
|
||||
continue;
|
||||
|
||||
bufferPolys.RemoveAllContours();
|
||||
@ -407,16 +534,35 @@ void EDA_3D_CANVAS::BuildBoard3DView()
|
||||
// Calculate merged polygons and remove pads and vias holes
|
||||
if( bufferPolys.GetCornersCount() == 0 )
|
||||
continue;
|
||||
|
||||
KI_POLYGON_SET currLayerPolyset;
|
||||
KI_POLYGON_SET polyset;
|
||||
bufferPolys.ExportTo( polyset );
|
||||
// merge polys:
|
||||
currLayerPolyset += polyset;
|
||||
|
||||
EDA_COLOR_T color = g_ColorsSettings.GetLayerColor( layer );
|
||||
// Solder mask layers are "negative" layers.
|
||||
// Shapes should be removed from the full board area.
|
||||
if( layer == SOLDERMASK_N_BACK || layer == SOLDERMASK_N_FRONT )
|
||||
{
|
||||
bufferPcbOutlines.ExportTo( currLayerPolyset );
|
||||
bufferPolys.Append( allLayerHoles );
|
||||
bufferPolys.ExportTo( polyset );
|
||||
currLayerPolyset -= polyset;
|
||||
}
|
||||
// Remove holes from Solder paste layers and siklscreen
|
||||
else if( layer == SOLDERPASTE_N_BACK || layer == SOLDERPASTE_N_FRONT
|
||||
|| layer == SILKSCREEN_N_BACK || layer == SILKSCREEN_N_FRONT )
|
||||
{
|
||||
bufferPolys.ExportTo( currLayerPolyset );
|
||||
currLayerPolyset -= brdpolysetHoles;
|
||||
}
|
||||
else // usuall layers, merge polys built from each item shape:
|
||||
{
|
||||
bufferPolys.ExportTo( polyset );
|
||||
currLayerPolyset += polyset;
|
||||
}
|
||||
|
||||
SetGLTechLayersColor( layer );
|
||||
int thickness = g_Parm_3D_Visu.GetLayerObjectThicknessBIU( layer );
|
||||
int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU( layer );
|
||||
glNormal3f( 0.0, 0.0, Get3DLayer_Z_Orientation( layer ) );
|
||||
|
||||
if( layer == EDGE_N )
|
||||
{
|
||||
@ -425,9 +571,17 @@ void EDA_3D_CANVAS::BuildBoard3DView()
|
||||
zpos = g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_BACK )
|
||||
+ (thickness / 2);
|
||||
}
|
||||
|
||||
SetGLColor( color );
|
||||
glNormal3f( 0.0, 0.0, Get3DLayer_Z_Orientation( layer ) );
|
||||
else
|
||||
{
|
||||
// for Draw3D_SolidHorizontalPolyPolygons, zpos it the middle between bottom and top
|
||||
// sides.
|
||||
// However for top layers, zpos should be the bottom layer pos,
|
||||
// and for bottom layers, zpos should be the top layer pos.
|
||||
if( Get3DLayer_Z_Orientation( layer ) > 0 )
|
||||
zpos += thickness/2;
|
||||
else
|
||||
zpos -= thickness/2 ;
|
||||
}
|
||||
|
||||
bufferPolys.RemoveAllContours();
|
||||
bufferPolys.ImportFrom( currLayerPolyset );
|
||||
@ -458,7 +612,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List()
|
||||
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
|
||||
|
||||
// draw axis
|
||||
if( g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_AXIS] )
|
||||
if( g_Parm_3D_Visu.GetFlag( FL_AXIS ) )
|
||||
{
|
||||
glEnable( GL_COLOR_MATERIAL );
|
||||
SetGLColor( WHITE );
|
||||
@ -490,7 +644,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List()
|
||||
BuildBoard3DView();
|
||||
|
||||
// Draw grid
|
||||
if( g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_GRID] )
|
||||
if( g_Parm_3D_Visu.GetFlag( FL_GRID ) )
|
||||
DrawGrid( g_Parm_3D_Visu.m_3D_Grid );
|
||||
|
||||
glEndList();
|
||||
@ -517,6 +671,7 @@ void EDA_3D_CANVAS::DrawGrid( double aGriSizeMM )
|
||||
EDA_COLOR_T gridcolor = DARKGRAY; // Color of grid lines
|
||||
EDA_COLOR_T gridcolor_marker = LIGHTGRAY; // Color of grid lines every 5 lines
|
||||
double scale = g_Parm_3D_Visu.m_BiuTo3Dunits;
|
||||
double transparency = 0.4;
|
||||
|
||||
glNormal3f( 0.0, 0.0, 1.0 );
|
||||
|
||||
@ -539,9 +694,9 @@ void EDA_3D_CANVAS::DrawGrid( double aGriSizeMM )
|
||||
for( int ii = 0; ; ii++ )
|
||||
{
|
||||
if( (ii % 5) )
|
||||
SetGLColor( gridcolor );
|
||||
SetGLColor( gridcolor, transparency );
|
||||
else
|
||||
SetGLColor( gridcolor_marker );
|
||||
SetGLColor( gridcolor_marker, transparency );
|
||||
|
||||
int delta = KiROUND( ii * aGriSizeMM * IU_PER_MM );
|
||||
|
||||
@ -588,9 +743,9 @@ void EDA_3D_CANVAS::DrawGrid( double aGriSizeMM )
|
||||
for( int ii = 0; ; ii++ )
|
||||
{
|
||||
if( (ii % 5) )
|
||||
SetGLColor( gridcolor );
|
||||
SetGLColor( gridcolor, transparency );
|
||||
else
|
||||
SetGLColor( gridcolor_marker );
|
||||
SetGLColor( gridcolor_marker, transparency );
|
||||
|
||||
double delta = ii * aGriSizeMM * IU_PER_MM;
|
||||
|
||||
@ -615,9 +770,9 @@ void EDA_3D_CANVAS::DrawGrid( double aGriSizeMM )
|
||||
for( int ii = 0; ; ii++ )
|
||||
{
|
||||
if( (ii % 5) )
|
||||
SetGLColor( gridcolor );
|
||||
SetGLColor( gridcolor, transparency);
|
||||
else
|
||||
SetGLColor( gridcolor_marker );
|
||||
SetGLColor( gridcolor_marker, transparency );
|
||||
|
||||
double delta = ii * aGriSizeMM * IU_PER_MM * scale;
|
||||
|
||||
@ -654,8 +809,14 @@ void EDA_3D_CANVAS::Draw3DViaHole( SEGVIA* aVia )
|
||||
aVia->ReturnLayerPair( &top_layer, &bottom_layer );
|
||||
|
||||
// Drawing via hole:
|
||||
EDA_COLOR_T color = g_ColorsSettings.GetItemColor( VIAS_VISIBLE + aVia->GetShape() );
|
||||
SetGLColor( color );
|
||||
if( g_Parm_3D_Visu.IsRealisticMode() )
|
||||
SetGLCopperColor();
|
||||
else
|
||||
{
|
||||
EDA_COLOR_T color = g_ColorsSettings.GetItemColor( VIAS_VISIBLE + aVia->GetShape() );
|
||||
SetGLColor( color );
|
||||
}
|
||||
|
||||
int height = g_Parm_3D_Visu.GetLayerZcoordBIU( top_layer ) -
|
||||
g_Parm_3D_Visu.GetLayerZcoordBIU( bottom_layer ) - thickness;
|
||||
int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU( bottom_layer ) + thickness / 2;
|
||||
@ -670,7 +831,7 @@ void MODULE::ReadAndInsert3DComponentShape( EDA_3D_CANVAS* glcanvas )
|
||||
// Draw module shape: 3D shape if exists (or module outlines if not exists)
|
||||
S3D_MASTER* struct3D = m_3D_Drawings;
|
||||
|
||||
if( g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_MODULE] )
|
||||
if( g_Parm_3D_Visu.GetFlag( FL_MODULE ) )
|
||||
{
|
||||
double zpos;
|
||||
|
||||
@ -721,7 +882,11 @@ void EDA_3D_CANVAS::Draw3DPadHole( D_PAD* aPad )
|
||||
int height = g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_FRONT ) -
|
||||
g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_BACK );
|
||||
|
||||
SetGLColor( DARKGRAY );
|
||||
if( g_Parm_3D_Visu.IsRealisticMode() )
|
||||
SetGLCopperColor();
|
||||
else
|
||||
SetGLColor( DARKGRAY );
|
||||
|
||||
int holeZpoz = g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_BACK ) + thickness / 2;
|
||||
int holeHeight = height - thickness;
|
||||
|
||||
@ -762,7 +927,8 @@ void EDA_3D_CANVAS::Draw3DPadHole( D_PAD* aPad )
|
||||
|
||||
bool Is3DLayerEnabled( LAYER_NUM aLayer )
|
||||
{
|
||||
int flg;
|
||||
DISPLAY3D_FLG flg;
|
||||
bool realistic_mode = g_Parm_3D_Visu.IsRealisticMode();
|
||||
|
||||
// see if layer needs to be shown
|
||||
// check the flags
|
||||
@ -770,41 +936,57 @@ bool Is3DLayerEnabled( LAYER_NUM aLayer )
|
||||
{
|
||||
case ADHESIVE_N_BACK:
|
||||
case ADHESIVE_N_FRONT:
|
||||
flg = g_Parm_3D_Visu.FL_ADHESIVE;
|
||||
flg = FL_ADHESIVE;
|
||||
break;
|
||||
|
||||
case SOLDERPASTE_N_BACK:
|
||||
case SOLDERPASTE_N_FRONT:
|
||||
flg = g_Parm_3D_Visu.FL_SOLDERPASTE;
|
||||
flg = FL_SOLDERPASTE;
|
||||
break;
|
||||
|
||||
case SILKSCREEN_N_BACK:
|
||||
case SILKSCREEN_N_FRONT:
|
||||
flg = g_Parm_3D_Visu.FL_SILKSCREEN;
|
||||
flg = FL_SILKSCREEN;
|
||||
break;
|
||||
|
||||
case SOLDERMASK_N_BACK:
|
||||
case SOLDERMASK_N_FRONT:
|
||||
flg = g_Parm_3D_Visu.FL_SOLDERMASK;
|
||||
flg = FL_SOLDERMASK;
|
||||
break;
|
||||
|
||||
case DRAW_N:
|
||||
case COMMENT_N:
|
||||
flg = g_Parm_3D_Visu.FL_COMMENTS;
|
||||
if( realistic_mode )
|
||||
return false;
|
||||
|
||||
flg = FL_COMMENTS;
|
||||
break;
|
||||
|
||||
case ECO1_N:
|
||||
case ECO2_N:
|
||||
flg = g_Parm_3D_Visu.FL_ECO;
|
||||
if( realistic_mode )
|
||||
return false;
|
||||
|
||||
flg = FL_ECO;
|
||||
break;
|
||||
|
||||
case LAYER_N_BACK:
|
||||
case LAYER_N_FRONT:
|
||||
return g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( aLayer )
|
||||
|| realistic_mode;
|
||||
break;
|
||||
|
||||
default:
|
||||
// the layer was not a layer with a flag, so show it
|
||||
return true;
|
||||
// the layer is an internal copper layer
|
||||
if( realistic_mode )
|
||||
return false;
|
||||
|
||||
return g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( aLayer );
|
||||
}
|
||||
|
||||
// if the layer has a flag, return the flag
|
||||
return g_Parm_3D_Visu.m_DrawFlags[flg];
|
||||
return g_Parm_3D_Visu.GetFlag( flg ) &&
|
||||
g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( aLayer );
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include <info3d_visu.h>
|
||||
#include <3d_draw_basic_functions.h>
|
||||
|
||||
|
||||
// Imported function:
|
||||
extern void Set_Object_Data( std::vector<S3D_VERTEX>& aVertices, double aBiuTo3DUnits );
|
||||
extern void CheckGLError();
|
||||
@ -122,7 +121,7 @@ static void Draw3D_VerticalPolygonalCylinder( const CPOLYGONS_LIST& aPolysList,
|
||||
}
|
||||
|
||||
|
||||
void SetGLColor( EDA_COLOR_T color )
|
||||
void SetGLColor( EDA_COLOR_T color, double alpha )
|
||||
{
|
||||
double red, green, blue;
|
||||
const StructColors &colordata = g_ColorRefs[ColorGetBase( color )];
|
||||
@ -130,7 +129,7 @@ void SetGLColor( EDA_COLOR_T color )
|
||||
red = colordata.m_Red / 255.0;
|
||||
blue = colordata.m_Blue / 255.0;
|
||||
green = colordata.m_Green / 255.0;
|
||||
glColor3f( red, green, blue );
|
||||
glColor4f( red, green, blue, alpha );
|
||||
}
|
||||
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
* @param aThickness = thickness in board internal units
|
||||
* @param aBiuTo3DUnits = board internal units to 3D units scaling value
|
||||
* If aThickness = 0, a polygon area is drawn in a XY plane at Z position = aZpos.
|
||||
* If aThickness 1 0, a solid object is drawn.
|
||||
* If aThickness > 0, a solid object is drawn.
|
||||
* The top side is located at aZpos + aThickness / 2
|
||||
* The bottom side is located at aZpos - aThickness / 2
|
||||
*/
|
||||
@ -118,5 +118,12 @@ void Draw3D_ZaxisCylinder( wxPoint aCenterPos, int aRadius,
|
||||
void Draw3D_ZaxisOblongCylinder( wxPoint aAxis1Pos, wxPoint aAxis2Pos,
|
||||
int aRadius, int aHeight, int aThickness,
|
||||
int aZpos, double aBiuTo3DUnits );
|
||||
/**
|
||||
* Set the current 3D color from a Kicad color, with optional transparency
|
||||
* @param aColor = a EDA_COLOR_T kicad color index
|
||||
* @param aTransparency = the color transparency (default = 1.0 = no transparency)
|
||||
*/
|
||||
void SetGLColor( EDA_COLOR_T aColor, double aTransparency = 1.0 );
|
||||
|
||||
|
||||
#endif // _3D_DRAW_BASIC_FUNCTIONS_H_
|
||||
|
@ -47,6 +47,7 @@ static const wxString keySizey( wxT( "Size_y" ) );
|
||||
static const wxString keyBgColor_Red( wxT( "BgColor_Red" ) );
|
||||
static const wxString keyBgColor_Green( wxT( "BgColor_Green" ) );
|
||||
static const wxString keyBgColor_Blue( wxT( "BgColor_Blue" ) );
|
||||
static const wxString keyShowRealisticMode( wxT( "ShowRealisticMode" ) );
|
||||
static const wxString keyShowAxis( wxT( "ShowAxis" ) );
|
||||
static const wxString keyShowZones( wxT( "ShowZones" ) );
|
||||
static const wxString keyShowFootprints( wxT( "ShowFootprints" ) );
|
||||
@ -56,6 +57,7 @@ static const wxString keyShowSilkScreenLayers( wxT( "ShowSilkScreenLayers" ) )
|
||||
static const wxString keyShowSolderMaskLayers( wxT( "ShowSolderMasLayers" ) );
|
||||
static const wxString keyShowSolderPasteLayers( wxT( "ShowSolderPasteLayers" ) );
|
||||
static const wxString keyShowCommentsLayer( wxT( "ShowCommentsLayers" ) );
|
||||
static const wxString keyShowBoardBody( wxT( "ShowBoardBody" ) );
|
||||
static const wxString keyShowEcoLayers( wxT( "ShowEcoLayers" ) );
|
||||
|
||||
BEGIN_EVENT_TABLE( EDA_3D_FRAME, wxFrame )
|
||||
@ -152,6 +154,7 @@ void EDA_3D_FRAME::GetSettings()
|
||||
{
|
||||
wxString text;
|
||||
wxConfig* config = wxGetApp().GetSettings(); // Current config used by application
|
||||
class INFO3D_VISU& prms = g_Parm_3D_Visu;
|
||||
|
||||
if( config )
|
||||
{
|
||||
@ -166,19 +169,43 @@ void EDA_3D_FRAME::GetSettings()
|
||||
config->Read( keyBgColor_Red, &g_Parm_3D_Visu.m_BgColor.m_Red, 0.0 );
|
||||
config->Read( keyBgColor_Green, &g_Parm_3D_Visu.m_BgColor.m_Green, 0.0 );
|
||||
config->Read( keyBgColor_Blue, &g_Parm_3D_Visu.m_BgColor.m_Blue, 0.0 );
|
||||
class INFO3D_VISU& prms = g_Parm_3D_Visu;
|
||||
config->Read( keyShowAxis, &prms.m_DrawFlags[prms.FL_AXIS], true );
|
||||
config->Read( keyShowFootprints, &prms.m_DrawFlags[prms.FL_MODULE], true );
|
||||
config->Read( keyShowCopperThickness,
|
||||
&prms.m_DrawFlags[prms.FL_USE_COPPER_THICKNESS],
|
||||
false );
|
||||
config->Read( keyShowZones, &prms.m_DrawFlags[prms.FL_ZONE], true );
|
||||
config->Read( keyShowAdhesiveLayers, &prms.m_DrawFlags[prms.FL_ADHESIVE], true );
|
||||
config->Read( keyShowSilkScreenLayers, &prms.m_DrawFlags[prms.FL_SILKSCREEN], true );
|
||||
config->Read( keyShowSolderMaskLayers, &prms.m_DrawFlags[prms.FL_SOLDERMASK], true );
|
||||
config->Read( keyShowSolderPasteLayers, &prms.m_DrawFlags[prms.FL_SOLDERPASTE], true );
|
||||
config->Read( keyShowCommentsLayer, &prms.m_DrawFlags[prms.FL_COMMENTS], true );
|
||||
config->Read( keyShowEcoLayers, &prms.m_DrawFlags[prms.FL_ECO], true );
|
||||
|
||||
bool tmp;
|
||||
config->Read( keyShowRealisticMode, &tmp, false );
|
||||
prms.SetFlag( FL_USE_REALISTIC_MODE, tmp );
|
||||
|
||||
config->Read( keyShowAxis, &tmp, true );
|
||||
prms.SetFlag( FL_AXIS, tmp );
|
||||
|
||||
config->Read( keyShowFootprints, &tmp, true );
|
||||
prms.SetFlag( FL_MODULE, tmp );
|
||||
|
||||
config->Read( keyShowCopperThickness, &tmp, false );
|
||||
prms.SetFlag( FL_USE_COPPER_THICKNESS, tmp );
|
||||
|
||||
config->Read( keyShowZones, &tmp, true );
|
||||
prms.SetFlag( FL_ZONE, tmp );
|
||||
|
||||
config->Read( keyShowAdhesiveLayers, &tmp, true );
|
||||
prms.SetFlag( FL_ADHESIVE, tmp );
|
||||
|
||||
config->Read( keyShowSilkScreenLayers, &tmp, true );
|
||||
prms.SetFlag( FL_SILKSCREEN, tmp );
|
||||
|
||||
config->Read( keyShowSolderMaskLayers, &tmp, true );
|
||||
prms.SetFlag( FL_SOLDERMASK, tmp );
|
||||
|
||||
config->Read( keyShowSolderPasteLayers, &tmp, true );
|
||||
prms.SetFlag( FL_SOLDERPASTE, tmp );
|
||||
|
||||
config->Read( keyShowCommentsLayer, &tmp, true );
|
||||
prms.SetFlag( FL_COMMENTS, tmp );
|
||||
|
||||
config->Read( keyShowEcoLayers, &tmp, true );
|
||||
prms.SetFlag( FL_ECO, tmp );
|
||||
|
||||
config->Read( keyShowBoardBody, &tmp, true );
|
||||
prms.SetFlag( FL_SHOW_BOARD_BODY, tmp );
|
||||
}
|
||||
}
|
||||
|
||||
@ -195,16 +222,18 @@ void EDA_3D_FRAME::SaveSettings()
|
||||
config->Write( keyBgColor_Green, g_Parm_3D_Visu.m_BgColor.m_Green );
|
||||
config->Write( keyBgColor_Blue, g_Parm_3D_Visu.m_BgColor.m_Blue );
|
||||
class INFO3D_VISU& prms = g_Parm_3D_Visu;
|
||||
config->Write( keyShowAxis, prms.m_DrawFlags[prms.FL_AXIS] );
|
||||
config->Write( keyShowFootprints, prms.m_DrawFlags[prms.FL_MODULE] );
|
||||
config->Write( keyShowCopperThickness, prms.m_DrawFlags[prms.FL_USE_COPPER_THICKNESS] );
|
||||
config->Write( keyShowZones, prms.m_DrawFlags[prms.FL_ZONE] );
|
||||
config->Write( keyShowAdhesiveLayers, prms.m_DrawFlags[prms.FL_ADHESIVE] );
|
||||
config->Write( keyShowSilkScreenLayers, prms.m_DrawFlags[prms.FL_SILKSCREEN] );
|
||||
config->Write( keyShowSolderMaskLayers, prms.m_DrawFlags[prms.FL_SOLDERMASK] );
|
||||
config->Write( keyShowSolderPasteLayers, prms.m_DrawFlags[prms.FL_SOLDERPASTE] );
|
||||
config->Write( keyShowCommentsLayer, prms.m_DrawFlags[prms.FL_COMMENTS] );
|
||||
config->Write( keyShowEcoLayers, prms.m_DrawFlags[prms.FL_ECO] );
|
||||
config->Write( keyShowRealisticMode, prms.GetFlag( FL_USE_REALISTIC_MODE ) );
|
||||
config->Write( keyShowAxis, prms.GetFlag( FL_AXIS ) );
|
||||
config->Write( keyShowFootprints, prms.GetFlag( FL_MODULE ) );
|
||||
config->Write( keyShowCopperThickness, prms.GetFlag( FL_USE_COPPER_THICKNESS ) );
|
||||
config->Write( keyShowZones, prms.GetFlag( FL_ZONE ) );
|
||||
config->Write( keyShowAdhesiveLayers, prms.GetFlag( FL_ADHESIVE ) );
|
||||
config->Write( keyShowSilkScreenLayers, prms.GetFlag( FL_SILKSCREEN ) );
|
||||
config->Write( keyShowSolderMaskLayers, prms.GetFlag( FL_SOLDERMASK ) );
|
||||
config->Write( keyShowSolderPasteLayers, prms.GetFlag( FL_SOLDERPASTE ) );
|
||||
config->Write( keyShowCommentsLayer, prms.GetFlag( FL_COMMENTS ) );
|
||||
config->Write( keyShowEcoLayers, prms.GetFlag( FL_ECO ) );
|
||||
config->Write( keyShowBoardBody, prms.GetFlag( FL_SHOW_BOARD_BODY ) );
|
||||
|
||||
if( IsIconized() )
|
||||
return;
|
||||
@ -355,53 +384,63 @@ void EDA_3D_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||
Set3DBgColor();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_REALISTIC_MODE:
|
||||
g_Parm_3D_Visu.SetFlag( FL_USE_REALISTIC_MODE, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_SHOW_BOARD_BODY:
|
||||
g_Parm_3D_Visu.SetFlag( FL_SHOW_BOARD_BODY, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_AXIS_ONOFF:
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_AXIS] = isChecked;
|
||||
g_Parm_3D_Visu.SetFlag( FL_AXIS, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_MODULE_ONOFF:
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_MODULE] = isChecked;
|
||||
g_Parm_3D_Visu.SetFlag( FL_MODULE, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_USE_COPPER_THICKNESS:
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_USE_COPPER_THICKNESS] = isChecked;
|
||||
g_Parm_3D_Visu.SetFlag( FL_USE_COPPER_THICKNESS, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_ZONE_ONOFF:
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ZONE] = isChecked;
|
||||
g_Parm_3D_Visu.SetFlag( FL_ZONE, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_ADHESIVE_ONOFF:
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ADHESIVE] = isChecked;
|
||||
g_Parm_3D_Visu.SetFlag( FL_ADHESIVE, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_SILKSCREEN_ONOFF:
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SILKSCREEN] = isChecked;
|
||||
g_Parm_3D_Visu.SetFlag( FL_SILKSCREEN, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_SOLDER_MASK_ONOFF:
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SOLDERMASK] = isChecked;
|
||||
g_Parm_3D_Visu.SetFlag( FL_SOLDERMASK, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_SOLDER_PASTE_ONOFF:
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SOLDERPASTE] = isChecked;
|
||||
g_Parm_3D_Visu.SetFlag( FL_SOLDERPASTE, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_COMMENTS_ONOFF:
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_COMMENTS] = isChecked;
|
||||
g_Parm_3D_Visu.SetFlag( FL_COMMENTS, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_ECO_ONOFF:
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ECO] = isChecked;
|
||||
g_Parm_3D_Visu.SetFlag( FL_ECO, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
@ -431,26 +470,26 @@ void EDA_3D_FRAME::On3DGridSelection( wxCommandEvent& event )
|
||||
switch( id )
|
||||
{
|
||||
case ID_MENU3D_GRID_NOGRID:
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_GRID] = false;
|
||||
g_Parm_3D_Visu.SetFlag( FL_GRID, false );
|
||||
break;
|
||||
|
||||
case ID_MENU3D_GRID_10_MM:
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_GRID] = true;
|
||||
g_Parm_3D_Visu.SetFlag( FL_GRID, true );
|
||||
g_Parm_3D_Visu.m_3D_Grid = 10.0;
|
||||
break;
|
||||
|
||||
case ID_MENU3D_GRID_5_MM:
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_GRID] = true;
|
||||
g_Parm_3D_Visu.SetFlag( FL_GRID, true );
|
||||
g_Parm_3D_Visu.m_3D_Grid = 5.0;
|
||||
break;
|
||||
|
||||
case ID_MENU3D_GRID_2P5_MM:
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_GRID] = true;
|
||||
g_Parm_3D_Visu.SetFlag( FL_GRID, true );
|
||||
g_Parm_3D_Visu.m_3D_Grid = 2.5;
|
||||
break;
|
||||
|
||||
case ID_MENU3D_GRID_1_MM:
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_GRID] = true;
|
||||
g_Parm_3D_Visu.SetFlag( FL_GRID, true );
|
||||
g_Parm_3D_Visu.m_3D_Grid = 1.0;
|
||||
break;
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
/*
|
||||
* 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) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -158,17 +158,19 @@ void EDA_3D_FRAME::CreateMenuBar()
|
||||
|
||||
menuBar->Append( prefsMenu, _( "&Preferences" ) );
|
||||
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_REALISTIC_MODE,
|
||||
_( "Realistic Mode" ), KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
|
||||
prefsMenu->AppendSeparator();
|
||||
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_BGCOLOR_SELECTION,
|
||||
_( "Choose background color" ), KiBitmap( palette_xpm ) );
|
||||
|
||||
wxMenuItem* item;
|
||||
item = AddMenuItem( prefsMenu, ID_MENU3D_AXIS_ONOFF,
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_AXIS_ONOFF,
|
||||
_( "Show 3D &Axis" ), KiBitmap( axis3d_front_xpm ), wxITEM_CHECK );
|
||||
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_AXIS]);
|
||||
|
||||
// Creates grid menu
|
||||
wxMenu * gridlistMenu = new wxMenu;
|
||||
item = AddMenuItem( prefsMenu, gridlistMenu, ID_MENU3D_GRID,
|
||||
AddMenuItem( prefsMenu, gridlistMenu, ID_MENU3D_GRID,
|
||||
_( "3D Grid" ), KiBitmap( grid_xpm ) );
|
||||
gridlistMenu->Append( ID_MENU3D_GRID_NOGRID, _( "No 3D Grid" ), wxEmptyString, true );
|
||||
gridlistMenu->Check( ID_MENU3D_GRID_NOGRID, true );
|
||||
@ -178,36 +180,42 @@ void EDA_3D_FRAME::CreateMenuBar()
|
||||
gridlistMenu->Append( ID_MENU3D_GRID_2P5_MM, _( "3D Grid 2.5 mm" ), wxEmptyString, true );
|
||||
gridlistMenu->Append( ID_MENU3D_GRID_1_MM, _( "3D Grid 1 mm" ), wxEmptyString, true );
|
||||
|
||||
item = AddMenuItem( prefsMenu, ID_MENU3D_USE_COPPER_THICKNESS,
|
||||
prefsMenu->AppendSeparator();
|
||||
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_SHOW_BOARD_BODY,
|
||||
_( "Show Board Body" ), KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
|
||||
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_USE_COPPER_THICKNESS,
|
||||
_( "Show Copper Thickness" ), KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
|
||||
|
||||
item = AddMenuItem( prefsMenu, ID_MENU3D_MODULE_ONOFF,
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_MODULE_ONOFF,
|
||||
_( "Show 3D F&ootprints" ), KiBitmap( shape_3d_xpm ), wxITEM_CHECK );
|
||||
|
||||
item = AddMenuItem( prefsMenu, ID_MENU3D_ZONE_ONOFF,
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_ZONE_ONOFF,
|
||||
_( "Show Zone &Filling" ), KiBitmap( add_zone_xpm ), wxITEM_CHECK );
|
||||
|
||||
item = AddMenuItem( prefsMenu, ID_MENU3D_ADHESIVE_ONOFF,
|
||||
_( "Show &Adhesive Layers" ), KiBitmap( tools_xpm ), wxITEM_CHECK );
|
||||
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ADHESIVE]);
|
||||
prefsMenu->AppendSeparator();
|
||||
|
||||
item = AddMenuItem( prefsMenu, ID_MENU3D_SILKSCREEN_ONOFF,
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_ADHESIVE_ONOFF,
|
||||
_( "Show &Adhesive Layers" ), KiBitmap( tools_xpm ), wxITEM_CHECK );
|
||||
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_SILKSCREEN_ONOFF,
|
||||
_( "Show &Silkscreen Layer" ), KiBitmap( add_text_xpm ), wxITEM_CHECK );
|
||||
|
||||
item = AddMenuItem( prefsMenu, ID_MENU3D_SOLDER_MASK_ONOFF,
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_SOLDER_MASK_ONOFF,
|
||||
_( "Show Solder &Mask Layers" ), KiBitmap( pads_mask_layers_xpm ), wxITEM_CHECK );
|
||||
|
||||
item = AddMenuItem( prefsMenu, ID_MENU3D_SOLDER_PASTE_ONOFF,
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_SOLDER_PASTE_ONOFF,
|
||||
_( "Show Solder &Paste Layers" ), KiBitmap( pads_mask_layers_xpm ), wxITEM_CHECK );
|
||||
|
||||
item = AddMenuItem( prefsMenu, ID_MENU3D_COMMENTS_ONOFF,
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_COMMENTS_ONOFF,
|
||||
_( "Show &Comments and Drawings Layer" ), KiBitmap( edit_sheet_xpm ), wxITEM_CHECK );
|
||||
|
||||
item = AddMenuItem( prefsMenu, ID_MENU3D_ECO_ONOFF,
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_ECO_ONOFF,
|
||||
_( "Show &Eco Layers" ), KiBitmap( edit_sheet_xpm ), wxITEM_CHECK );
|
||||
|
||||
SetMenuBarOptionsState();
|
||||
SetMenuBar( menuBar );
|
||||
SetMenuBarOptionsState();
|
||||
}
|
||||
|
||||
void EDA_3D_FRAME::SetMenuBarOptionsState()
|
||||
@ -219,32 +227,41 @@ void EDA_3D_FRAME::SetMenuBarOptionsState()
|
||||
|
||||
wxMenuItem* item;
|
||||
// Set the state of toggle menus according to the current display options
|
||||
item = menuBar->FindItem( ID_MENU3D_REALISTIC_MODE );
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_USE_REALISTIC_MODE ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_SHOW_BOARD_BODY );
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_SHOW_BOARD_BODY ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_USE_COPPER_THICKNESS );
|
||||
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_USE_COPPER_THICKNESS]);
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_USE_COPPER_THICKNESS ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_MODULE_ONOFF );
|
||||
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_MODULE]);
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_MODULE ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_ZONE_ONOFF );
|
||||
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ZONE]);
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_ZONE ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_AXIS_ONOFF );
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_AXIS ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_ADHESIVE_ONOFF );
|
||||
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ADHESIVE]);
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_ADHESIVE ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_SILKSCREEN_ONOFF );
|
||||
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SILKSCREEN]);
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_SILKSCREEN ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_SOLDER_MASK_ONOFF );
|
||||
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SOLDERMASK]);
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_SOLDERMASK ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_SOLDER_PASTE_ONOFF );
|
||||
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SOLDERPASTE]);
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_SOLDERPASTE ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_COMMENTS_ONOFF );
|
||||
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_COMMENTS]);
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_COMMENTS ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_ECO_ONOFF );
|
||||
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ECO]);
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_ECO ));
|
||||
}
|
||||
|
||||
void EDA_3D_FRAME::SetToolbars()
|
||||
|
@ -39,6 +39,8 @@ enum id_3dview_frm
|
||||
ID_MENU3D_SOLDER_MASK_ONOFF,
|
||||
ID_MENU3D_COMMENTS_ONOFF,
|
||||
ID_MENU3D_ECO_ONOFF,
|
||||
ID_MENU3D_SHOW_BOARD_BODY,
|
||||
ID_MENU3D_REALISTIC_MODE,
|
||||
ID_END_COMMAND_3D,
|
||||
|
||||
ID_TOOL_SET_VISIBLE_ITEMS,
|
||||
|
@ -10,6 +10,7 @@ public:
|
||||
|
||||
private:
|
||||
EDA_3D_FRAME* m_parent;
|
||||
INFO3D_VISU & m_3Dprms;
|
||||
|
||||
void initDialog();
|
||||
|
||||
@ -31,7 +32,7 @@ void EDA_3D_FRAME::Install_3D_ViewOptionDialog( wxCommandEvent& event )
|
||||
|
||||
|
||||
DIALOG_3D_VIEW_OPTIONS::DIALOG_3D_VIEW_OPTIONS( EDA_3D_FRAME* parent )
|
||||
:DIALOG_3D_VIEW_OPTIONS_BASE( parent )
|
||||
:DIALOG_3D_VIEW_OPTIONS_BASE( parent ), m_3Dprms( g_Parm_3D_Visu )
|
||||
{
|
||||
m_parent = parent;
|
||||
|
||||
@ -55,24 +56,15 @@ void DIALOG_3D_VIEW_OPTIONS::initDialog()
|
||||
m_bitmapECO->SetBitmap( KiBitmap( edit_sheet_xpm ) );
|
||||
|
||||
// Check/uncheck checkboxes
|
||||
m_checkBoxCuThickness->SetValue(
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_USE_COPPER_THICKNESS] );
|
||||
m_checkBox3Dshapes->SetValue(
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_MODULE] );
|
||||
m_checkBoxAreas->SetValue(
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ZONE] );
|
||||
m_checkBoxSilkscreen->SetValue(
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SILKSCREEN] );
|
||||
m_checkBoxSolderMask->SetValue(
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SOLDERMASK] );
|
||||
m_checkBoxSolderpaste->SetValue(
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SOLDERPASTE] );
|
||||
m_checkBoxAdhesive->SetValue(
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ADHESIVE] );
|
||||
m_checkBoxComments->SetValue(
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_COMMENTS] );
|
||||
m_checkBoxECO->SetValue(
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ECO] );
|
||||
m_checkBoxCuThickness->SetValue( m_3Dprms.GetFlag( FL_USE_COPPER_THICKNESS ) );
|
||||
m_checkBox3Dshapes->SetValue( m_3Dprms.GetFlag( FL_MODULE ) );
|
||||
m_checkBoxAreas->SetValue( m_3Dprms.GetFlag( FL_ZONE ) );
|
||||
m_checkBoxSilkscreen->SetValue( m_3Dprms.GetFlag( FL_SILKSCREEN ) );
|
||||
m_checkBoxSolderMask->SetValue( m_3Dprms.GetFlag( FL_SOLDERMASK ) );
|
||||
m_checkBoxSolderpaste->SetValue( m_3Dprms.GetFlag( FL_SOLDERPASTE ) );
|
||||
m_checkBoxAdhesive->SetValue( m_3Dprms.GetFlag( FL_ADHESIVE ) );
|
||||
m_checkBoxComments->SetValue( m_3Dprms.GetFlag( FL_COMMENTS ) );
|
||||
m_checkBoxECO->SetValue( m_3Dprms.GetFlag( FL_ECO ) );
|
||||
}
|
||||
|
||||
void DIALOG_3D_VIEW_OPTIONS::OnShowAllClick( wxCommandEvent& event )
|
||||
@ -105,24 +97,16 @@ void DIALOG_3D_VIEW_OPTIONS::OnShowNoneClick( wxCommandEvent& event )
|
||||
|
||||
void DIALOG_3D_VIEW_OPTIONS::OnOKClick( wxCommandEvent& event )
|
||||
{
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_USE_COPPER_THICKNESS] =
|
||||
m_checkBoxCuThickness->GetValue();
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_MODULE] =
|
||||
m_checkBox3Dshapes->GetValue();
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ZONE] =
|
||||
m_checkBoxAreas->GetValue();
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SILKSCREEN] =
|
||||
m_checkBoxSilkscreen->GetValue();
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SOLDERMASK] =
|
||||
m_checkBoxSolderMask->GetValue();
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SOLDERPASTE] =
|
||||
m_checkBoxSolderpaste->GetValue();
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ADHESIVE] =
|
||||
m_checkBoxAdhesive->GetValue();
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_COMMENTS] =
|
||||
m_checkBoxComments->GetValue();
|
||||
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ECO] =
|
||||
m_checkBoxECO->GetValue();
|
||||
m_3Dprms.SetFlag( FL_USE_COPPER_THICKNESS,
|
||||
m_checkBoxCuThickness->GetValue() );
|
||||
m_3Dprms.SetFlag( FL_MODULE, m_checkBox3Dshapes->GetValue() );
|
||||
m_3Dprms.SetFlag( FL_ZONE, m_checkBoxAreas->GetValue() );
|
||||
m_3Dprms.SetFlag( FL_SILKSCREEN, m_checkBoxSilkscreen->GetValue() );
|
||||
m_3Dprms.SetFlag( FL_SOLDERMASK, m_checkBoxSolderMask->GetValue() );
|
||||
m_3Dprms.SetFlag( FL_SOLDERPASTE, m_checkBoxSolderpaste->GetValue() );
|
||||
m_3Dprms.SetFlag( FL_ADHESIVE, m_checkBoxAdhesive->GetValue() );
|
||||
m_3Dprms.SetFlag( FL_COMMENTS, m_checkBoxComments->GetValue() );
|
||||
m_3Dprms.SetFlag( FL_ECO, m_checkBoxECO->GetValue( ) );
|
||||
|
||||
EndModal( wxID_OK );
|
||||
}
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
// Thickness of copper
|
||||
// TODO: define the actual copper thickness by user
|
||||
#define COPPER_THICKNESS KiROUND( 0.035 * IU_PER_MM ) // for 35 µm
|
||||
#define COPPER_THICKNESS KiROUND( 0.035 * IU_PER_MM ) // for 35 um
|
||||
#define TECH_LAYER_THICKNESS KiROUND( 0.04 * IU_PER_MM )
|
||||
#define EPOXY_THICKNESS KiROUND( 1.6 * IU_PER_MM ) // for 1.6 mm
|
||||
|
||||
@ -68,10 +68,10 @@ INFO3D_VISU::INFO3D_VISU()
|
||||
|
||||
// default all special item layers Visible
|
||||
for( ii = 0; ii < FL_LAST; ii++ )
|
||||
m_DrawFlags[ii] = true;
|
||||
m_drawFlags[ii] = true;
|
||||
|
||||
m_DrawFlags[FL_GRID] = false;
|
||||
m_DrawFlags[FL_USE_COPPER_THICKNESS] = false;
|
||||
SetFlag( FL_GRID, false );
|
||||
SetFlag( FL_USE_COPPER_THICKNESS, false );
|
||||
}
|
||||
|
||||
|
||||
@ -124,8 +124,10 @@ void INFO3D_VISU::InitSettings( BOARD* aBoard )
|
||||
m_EpoxyThickness * layer / (copper_layers_cnt - 1);
|
||||
}
|
||||
|
||||
double zpos_copper_back = m_LayerZcoord[0];
|
||||
double zpos_copper_front = m_EpoxyThickness;
|
||||
#define layerThicknessMargin 1.1
|
||||
double zpos_offset = m_NonCopperLayerThickness * layerThicknessMargin;
|
||||
double zpos_copper_back = m_LayerZcoord[0] - layerThicknessMargin*m_CopperThickness/2;
|
||||
double zpos_copper_front = m_EpoxyThickness + layerThicknessMargin*m_CopperThickness/2;
|
||||
|
||||
// Fill remaining unused copper layers and front layer zpos
|
||||
// with m_EpoxyThickness
|
||||
@ -138,54 +140,44 @@ void INFO3D_VISU::InitSettings( BOARD* aBoard )
|
||||
for( int layer_id = FIRST_NON_COPPER_LAYER; layer_id < NB_PCB_LAYERS; layer_id++ )
|
||||
{
|
||||
double zpos;
|
||||
#define NonCopperLayerThicknessMargin 1.1
|
||||
|
||||
switch( layer_id )
|
||||
{
|
||||
case ADHESIVE_N_BACK:
|
||||
zpos = zpos_copper_back -
|
||||
4 * m_NonCopperLayerThickness * NonCopperLayerThicknessMargin;
|
||||
zpos = zpos_copper_back - 4 * zpos_offset;
|
||||
break;
|
||||
|
||||
case ADHESIVE_N_FRONT:
|
||||
zpos = zpos_copper_front +
|
||||
4 * m_NonCopperLayerThickness * NonCopperLayerThicknessMargin;
|
||||
zpos = zpos_copper_front + 4 * zpos_offset;
|
||||
break;
|
||||
|
||||
case SOLDERPASTE_N_BACK:
|
||||
zpos = zpos_copper_back -
|
||||
3 * m_NonCopperLayerThickness * NonCopperLayerThicknessMargin;
|
||||
zpos = zpos_copper_back - 3 * zpos_offset;
|
||||
break;
|
||||
|
||||
case SOLDERPASTE_N_FRONT:
|
||||
zpos = zpos_copper_front +
|
||||
3 * m_NonCopperLayerThickness * NonCopperLayerThicknessMargin;
|
||||
zpos = zpos_copper_front + 3 * zpos_offset;
|
||||
break;
|
||||
|
||||
case SOLDERMASK_N_BACK:
|
||||
zpos = zpos_copper_back -
|
||||
1 * m_NonCopperLayerThickness * NonCopperLayerThicknessMargin;
|
||||
zpos = zpos_copper_back - 1 * zpos_offset;
|
||||
break;
|
||||
|
||||
case SOLDERMASK_N_FRONT:
|
||||
zpos = zpos_copper_front +
|
||||
1 * m_NonCopperLayerThickness * NonCopperLayerThicknessMargin;
|
||||
zpos = zpos_copper_front + 1 * zpos_offset;
|
||||
break;
|
||||
|
||||
case SILKSCREEN_N_BACK:
|
||||
zpos = zpos_copper_back -
|
||||
2 * m_NonCopperLayerThickness * NonCopperLayerThicknessMargin;
|
||||
zpos = zpos_copper_back - 2 * zpos_offset;
|
||||
break;
|
||||
|
||||
case SILKSCREEN_N_FRONT:
|
||||
zpos = zpos_copper_front +
|
||||
2 * m_NonCopperLayerThickness * NonCopperLayerThicknessMargin;
|
||||
zpos = zpos_copper_front + 2 * zpos_offset;
|
||||
break;
|
||||
|
||||
default:
|
||||
zpos = zpos_copper_front +
|
||||
(layer_id - FIRST_NON_COPPER_LAYER + 5) *
|
||||
m_NonCopperLayerThickness * NonCopperLayerThicknessMargin;
|
||||
(layer_id - FIRST_NON_COPPER_LAYER + 5) * zpos_offset;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -63,25 +63,27 @@ public: S3D_COLOR()
|
||||
};
|
||||
|
||||
/* information needed to display 3D board */
|
||||
enum DISPLAY3D_FLG {
|
||||
FL_AXIS=0, FL_MODULE, FL_ZONE,
|
||||
FL_ADHESIVE, FL_SILKSCREEN, FL_SOLDERMASK, FL_SOLDERPASTE,
|
||||
FL_COMMENTS, FL_ECO,
|
||||
FL_GRID,
|
||||
FL_USE_COPPER_THICKNESS,
|
||||
FL_SHOW_BOARD_BODY,
|
||||
FL_USE_REALISTIC_MODE,
|
||||
FL_LAST
|
||||
};
|
||||
|
||||
|
||||
class INFO3D_VISU
|
||||
{
|
||||
public:
|
||||
enum DISPLAY3D_FLG {
|
||||
FL_AXIS=0, FL_MODULE, FL_ZONE,
|
||||
FL_ADHESIVE, FL_SILKSCREEN, FL_SOLDERMASK, FL_SOLDERPASTE,
|
||||
FL_COMMENTS, FL_ECO,
|
||||
FL_GRID,
|
||||
FL_USE_COPPER_THICKNESS,
|
||||
FL_LAST
|
||||
};
|
||||
|
||||
double m_Beginx, m_Beginy; // position of mouse (used in drag commands)
|
||||
double m_Quat[4]; // orientation of 3D view
|
||||
double m_Rot[4]; // rotation parameters of 3D view
|
||||
double m_Zoom; // 3D zoom value
|
||||
double m_3D_Grid; // 3D grid value, in mm
|
||||
S3D_COLOR m_BgColor;
|
||||
bool m_DrawFlags[FL_LAST]; // Enable/disable flags (see DISPLAY3D_FLG list)
|
||||
wxPoint m_BoardPos; // center board actual position in board units
|
||||
wxSize m_BoardSize; // board actual size in board units
|
||||
int m_CopperLayersCount; // Number of copper layers actually used by the board
|
||||
@ -98,10 +100,18 @@ private:
|
||||
double m_CopperThickness; // Copper thickness (normalized)
|
||||
double m_EpoxyThickness; // Epoxy thickness (normalized)
|
||||
double m_NonCopperLayerThickness; // Non copper layers thickness
|
||||
bool m_drawFlags[FL_LAST]; // Enable/disable flags (see DISPLAY3D_FLG list)
|
||||
|
||||
public: INFO3D_VISU();
|
||||
~INFO3D_VISU();
|
||||
|
||||
// Accessors
|
||||
bool GetFlag( DISPLAY3D_FLG aFlag ) const { return m_drawFlags[aFlag]; }
|
||||
bool SetFlag( DISPLAY3D_FLG aFlag, bool aState )
|
||||
{
|
||||
return m_drawFlags[aFlag] = aState;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function InitSettings
|
||||
* Initialize info 3D Parameters from aBoard
|
||||
@ -133,11 +143,14 @@ public: INFO3D_VISU();
|
||||
* note: the thickness (Z size) of the copper is not the thickness
|
||||
* of the layer (the thickness of the layer is the epoxy thickness / layer count)
|
||||
*
|
||||
* Note: if m_DrawFlags[FL_USE_COPPER_THICKNESS] is not set, returns 0
|
||||
* Note: if m_drawFlags[FL_USE_COPPER_THICKNESS] is not set,
|
||||
* and normal mode, returns 0
|
||||
*/
|
||||
int GetCopperThicknessBIU() const
|
||||
{
|
||||
return m_DrawFlags[FL_USE_COPPER_THICKNESS] ?
|
||||
bool use_copper_thickness = GetFlag( FL_USE_COPPER_THICKNESS ) ||
|
||||
GetFlag( FL_USE_REALISTIC_MODE );
|
||||
return use_copper_thickness ?
|
||||
KiROUND( m_CopperThickness / m_BiuTo3Dunits )
|
||||
: 0;
|
||||
}
|
||||
@ -156,11 +169,13 @@ public: INFO3D_VISU();
|
||||
* @return the thickness (Z size) of a technical layer,
|
||||
* in Board Internal Units
|
||||
*
|
||||
* Note: if m_DrawFlags[FL_USE_COPPER_THICKNESS] is not set, returns 0
|
||||
* Note: if m_drawFlags[FL_USE_COPPER_THICKNESS] is not set, returns 0
|
||||
*/
|
||||
int GetNonCopperLayerThicknessBIU() const
|
||||
{
|
||||
return m_DrawFlags[FL_USE_COPPER_THICKNESS] ?
|
||||
bool use_copper_thickness = GetFlag( FL_USE_COPPER_THICKNESS ) ||
|
||||
GetFlag( FL_USE_REALISTIC_MODE );
|
||||
return use_copper_thickness ?
|
||||
KiROUND( m_NonCopperLayerThickness / m_BiuTo3Dunits )
|
||||
: 0;
|
||||
}
|
||||
@ -170,7 +185,7 @@ public: INFO3D_VISU();
|
||||
* @return the thickness (Z size) of the copper or a technical layer,
|
||||
* in Board Internal Units, depending on the layer id
|
||||
*
|
||||
* Note: if m_DrawFlags[FL_USE_COPPER_THICKNESS] is not set, returns 0
|
||||
* Note: if m_drawFlags[FL_USE_COPPER_THICKNESS] is not set, returns 0
|
||||
*/
|
||||
int GetLayerObjectThicknessBIU( int aLayerId) const
|
||||
{
|
||||
@ -178,6 +193,8 @@ public: INFO3D_VISU();
|
||||
GetNonCopperLayerThicknessBIU() :
|
||||
GetCopperThicknessBIU();
|
||||
}
|
||||
|
||||
bool IsRealisticMode() { return GetFlag( FL_USE_REALISTIC_MODE ); }
|
||||
};
|
||||
|
||||
extern INFO3D_VISU g_Parm_3D_Visu;
|
||||
|
149
CMakeLists.txt
149
CMakeLists.txt
@ -14,10 +14,6 @@ set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules )
|
||||
# reports.
|
||||
#
|
||||
|
||||
# Russian GOST patch
|
||||
option( wxUSE_UNICODE "enable/disable building unicode ( default OFF)" )
|
||||
option( KICAD_GOST "enable/disable building using GOST notation for multiple gates per package ( default OFF)" )
|
||||
|
||||
#for those who bored with uppercase
|
||||
option( KICAD_KEEPCASE "turn-off automatic component name conversion to uppercase if selected" )
|
||||
|
||||
@ -53,11 +49,10 @@ option( KICAD_SCRIPTING_WXPYTHON
|
||||
|
||||
option( USE_FP_LIB_TABLE "Use the new footprint library table implementation. ( default OFF)" )
|
||||
|
||||
#option( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." OFF )
|
||||
option( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." OFF )
|
||||
|
||||
|
||||
#Set version option (stable or testing)
|
||||
|
||||
# Set version option (stable or testing)
|
||||
if( KICAD_STABLE_VERSION)
|
||||
add_definitions( -DKICAD_STABLE_VERSION )
|
||||
message( STATUS "Building stable version of KiCad" )
|
||||
@ -70,6 +65,13 @@ endif()
|
||||
set( DOWNLOAD_DIR ${PROJECT_SOURCE_DIR}/.downloads-by-cmake
|
||||
CACHE PATH "Location of KiCad downloads, suggested is a dir common to all builds, i.e. global." )
|
||||
|
||||
if( UNIX )
|
||||
set( KICAD_USER_CONFIG_DIR $ENV{HOME} CACHE PATH "Location of user specifig KiCad config files" )
|
||||
elseif( MINGW )
|
||||
set( KICAD_USER_CONFIG_DIR $ENV{%APPDATA%} CACHE PATH "Location of user specifig KiCad config files" )
|
||||
endif()
|
||||
mark_as_advanced( KICAD_USER_CONFIG_DIR )
|
||||
|
||||
|
||||
#================================================
|
||||
# Set flags for GCC.
|
||||
@ -77,72 +79,60 @@ set( DOWNLOAD_DIR ${PROJECT_SOURCE_DIR}/.downloads-by-cmake
|
||||
|
||||
if( CMAKE_COMPILER_IS_GNUCXX )
|
||||
|
||||
set( KICAD_GCC_RELEASE_BUILD_FLAGS "-O2" )
|
||||
set( KICAD_GCC_RELEASE_DEBUG_FLAGS "" )
|
||||
|
||||
execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
||||
OUTPUT_VARIABLE GCC_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||
|
||||
# Added -Wno-narrowing on 10/7/12 to prevent a huge number of warnings when
|
||||
# compiling with GCC 4.7. This appears to be caused by and int to unsigned
|
||||
# conversion in the Boost polygon library. At some point in the future when
|
||||
# Boost is updated to the next version, -Wno-narrowing should be removed to
|
||||
# see if the problem has been resolved. Wayne.
|
||||
#
|
||||
# Also note the optimization level is -O1 instead of the usual -O2 level
|
||||
# because boost::polygon has a function ( inflate polygon) broken by
|
||||
# the -O2 level with GCC 4.7 (works fine with with GCC 4.6).
|
||||
# Establish -Wall early, so specialized relaxations of this may come
|
||||
# subsequently on the command line, such as in pcbnew/github/CMakeLists.txt
|
||||
set( CMAKE_C_FLAGS "-Wall" )
|
||||
set( CMAKE_CXX_FLAGS "-Wall" )
|
||||
|
||||
# The optimization level is -O1 instead of the usual -O2 level because
|
||||
# boost::polygon has a function (inflate polygon) broken by the -O2 level
|
||||
# with GCC 4.7.0 to 4.7.2 (works fine with with GCC 4.6 and 4.7.3).
|
||||
# This lower optimization level does not have a significant change on the speed.
|
||||
#
|
||||
# As newer versions of GCC and/or Boost are released, this code needs reviewed to
|
||||
# determine if the problems above have been fixed either in Boost or GCC.
|
||||
if( GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7 )
|
||||
set( KICAD_GCC_RELEASE_BUILD_FLAGS "-Wno-narrowing -O1" )
|
||||
set( KICAD_GCC_DEBUG_BUILD_FLAGS "-Wno-narrowing" )
|
||||
# See also:
|
||||
# https://bugs.launchpad.net/kicad/+bug/1056926
|
||||
# https://svn.boost.org/trac/boost/ticket/7983
|
||||
if( GCC_VERSION VERSION_EQUAL 4.7.0 OR ( GCC_VERSION VERSION_GREATER 4.7.0 AND GCC_VERSION VERSION_LESS 4.7.3 ) )
|
||||
set( CMAKE_C_FLAGS_RELEASE "-O1" )
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "-O1" )
|
||||
else()
|
||||
set( CMAKE_C_FLAGS_RELEASE "-O2" )
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "-O2" )
|
||||
endif()
|
||||
|
||||
if( CMAKE_BUILD_TYPE STREQUAL Debug )
|
||||
message( STATUS
|
||||
"Setting GCC version ${GCC_VERSION} build flags \"${KICAD_GCC_DEBUG_BUILD_FLAGS}\"" )
|
||||
else()
|
||||
message( STATUS
|
||||
"Setting GCC version ${GCC_VERSION} build flags \"${KICAD_GCC_RELEASE_BUILD_FLAGS}\"" )
|
||||
endif()
|
||||
set( CMAKE_C_FLAGS_DEBUG "-g3 -ggdb3 -DDEBUG" )
|
||||
set( CMAKE_CXX_FLAGS_DEBUG "-g3 -ggdb3 -DDEBUG" )
|
||||
|
||||
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNDEBUG" )
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG" )
|
||||
|
||||
if( MINGW )
|
||||
# According to some sources, under Windows -fPIC option is not needed:
|
||||
# http://mingw.5.n7.nabble.com/Option-fPIC-not-supported-td18480.html
|
||||
|
||||
# Set default flags for Release build.
|
||||
set( CMAKE_C_FLAGS_RELEASE "-Wall ${KICAD_GCC_RELEASE_BUILD_FLAGS} -DNDEBUG" )
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "-Wall ${KICAD_GCC_RELEASE_BUILD_FLAGS} -DNDEBUG" )
|
||||
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s -static-libgcc -static-libstdc++" )
|
||||
|
||||
# Set default flags for Debug build.
|
||||
set( CMAKE_C_FLAGS_DEBUG "-Wall ${KICAD_GCC_DEBUG_BUILD_FLAGS} -g3 -ggdb3 -DDEBUG" )
|
||||
set( CMAKE_CXX_FLAGS_DEBUG "-Wall ${KICAD_GCC_DEBUG_BUILD_FLAGS} -g3 -ggdb3 -DDEBUG" )
|
||||
set( CMAKE_MODULE_LINKER_FLAGS "-static-libgcc -static-libstdc++") # SWIG macros on Windows
|
||||
|
||||
else()
|
||||
# We build DLL/DSOs from static libraries, so create position independent code
|
||||
# for all cases, since we do not have DLL/DSO specific static libraries.
|
||||
# This flag could be localized to any object file going into a DLL/DSO in the future.
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" )
|
||||
# Subdirectories via add_subdirectores() reference this variable, and it is either set or empty,
|
||||
# empty for Windows.
|
||||
set( PIC_FLAG -fPIC )
|
||||
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PIC_FLAG}" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PIC_FLAG}" )
|
||||
|
||||
# Thou shalt not link vaporware and tell us it's a valid DSO:
|
||||
set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
|
||||
set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" ) # needed by SWIG macros on linux
|
||||
|
||||
# Set default flags for Release build.
|
||||
set( CMAKE_C_FLAGS_RELEASE "${KICAD_GCC_RELEASE_BUILD_FLAGS} -Wall -DNDEBUG" )
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "${KICAD_GCC_RELEASE_BUILD_FLAGS} -Wall -DNDEBUG" )
|
||||
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" )
|
||||
|
||||
# Set default flags for Debug build.
|
||||
set( CMAKE_C_FLAGS_DEBUG "${KICAD_GCC_DEBUG_BUILD_FLAGS} -Wall -g3 -ggdb3 -DDEBUG" )
|
||||
set( CMAKE_CXX_FLAGS_DEBUG "${KICAD_GCC_DEBUG_BUILD_FLAGS} -Wall -g3 -ggdb3 -DDEBUG" )
|
||||
endif()
|
||||
|
||||
# quiet GCC 4.8.1 while in boost
|
||||
@ -152,14 +142,6 @@ if( CMAKE_COMPILER_IS_GNUCXX )
|
||||
|
||||
endif( CMAKE_COMPILER_IS_GNUCXX )
|
||||
|
||||
if( wxUSE_UNICODE )
|
||||
add_definitions( -DwxUSE_UNICODE )
|
||||
endif()
|
||||
|
||||
if( KICAD_GOST )
|
||||
add_definitions( -DKICAD_GOST )
|
||||
endif()
|
||||
|
||||
if( KICAD_KEEPCASE )
|
||||
add_definitions( -DKICAD_KEEPCASE )
|
||||
endif()
|
||||
@ -393,6 +375,7 @@ add_subdirectory( cvpcb )
|
||||
add_subdirectory( eeschema )
|
||||
add_subdirectory( gerbview )
|
||||
add_subdirectory( kicad )
|
||||
add_subdirectory( lib_dxf )
|
||||
add_subdirectory( pcbnew )
|
||||
add_subdirectory( polygon )
|
||||
add_subdirectory( pagelayout_editor )
|
||||
@ -442,20 +425,26 @@ endif()
|
||||
|
||||
|
||||
#================================================
|
||||
# make uninstall rules
|
||||
# "make uninstall" rules
|
||||
#================================================
|
||||
configure_file(
|
||||
"${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY )
|
||||
"${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY )
|
||||
|
||||
add_custom_target( uninstall
|
||||
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" )
|
||||
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" )
|
||||
|
||||
|
||||
#================================================
|
||||
# Installation parameters
|
||||
# Installation
|
||||
#================================================
|
||||
|
||||
add_custom_target( install_user_configuration_files
|
||||
"${CMAKE_COMMAND}" -E copy "${PROJECT_SOURCE_DIR}/template/fp-lib-table" ${KICAD_USER_CONFIG_DIR}/
|
||||
COMMENT "Install template fp-lib-table into your home directory."
|
||||
)
|
||||
|
||||
install( FILES INSTALL.txt
|
||||
DESTINATION ${KICAD_DOCS}
|
||||
COMPONENT resources )
|
||||
@ -469,15 +458,16 @@ install( FILES resources/freeroute.jnlp
|
||||
###
|
||||
if( UNIX )
|
||||
install( DIRECTORY scripts
|
||||
DESTINATION ${KICAD_DOCS}
|
||||
COMPONENT resources
|
||||
PATTERN ".svn" EXCLUDE )
|
||||
DESTINATION ${KICAD_DOCS}
|
||||
COMPONENT resources
|
||||
)
|
||||
endif()
|
||||
|
||||
###
|
||||
# FreeDesktop .desktop and MIME resources
|
||||
###
|
||||
if( UNIX )
|
||||
|
||||
# Set paths
|
||||
set( UNIX_MIME_DIR resources/linux/mime )
|
||||
set( UNIX_MIMELNK_FILES ${UNIX_MIME_DIR}/mimelnk )
|
||||
@ -489,25 +479,46 @@ if( UNIX )
|
||||
install( DIRECTORY ${UNIX_MIMELNK_FILES}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share
|
||||
COMPONENT resources
|
||||
PATTERN ".svn" EXCLUDE )
|
||||
)
|
||||
|
||||
# Install Mime directory
|
||||
install( DIRECTORY ${UNIX_ICONS_FILES}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share
|
||||
COMPONENT resources
|
||||
PATTERN ".svn" EXCLUDE )
|
||||
)
|
||||
|
||||
# Install Icons
|
||||
install( DIRECTORY ${UNIX_MIME_FILES}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share
|
||||
COMPONENT resources
|
||||
PATTERN ".svn" EXCLUDE )
|
||||
)
|
||||
|
||||
# Install Applications directory (.desktop files)
|
||||
install( DIRECTORY ${UNIX_APPLICATIONS_FILES}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share
|
||||
COMPONENT resources
|
||||
PATTERN ".svn" EXCLUDE )
|
||||
)
|
||||
endif()
|
||||
|
||||
include( CTest )
|
||||
#include( CTest )
|
||||
|
||||
|
||||
if( UNIX AND NOT APPLE )
|
||||
|
||||
# Create a *.deb file:
|
||||
set( CPACK_GENERATOR "DEB" )
|
||||
set( CPACK_DEBIAN_PACKAGE_MAINTAINER "http://launchpad.net/kicad" )
|
||||
|
||||
set( CPACK_PACKAGE_VERSION_MAJOR 1 )
|
||||
set( CPACK_PACKAGE_VERSION_MINOR 0 )
|
||||
set( CPACK_PACKAGE_VERSION_PATCH 0 )
|
||||
#set( CPACK_PACKAGE_CONTACT Firstname Lastname <email@company.com> )
|
||||
set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "KiCad built by CMake build system." )
|
||||
|
||||
# Tell debian CPack about all files which are configuration files
|
||||
add_conffiles() # clear file
|
||||
add_conffiles( ${KICAD_USER_CONFIG_DIR}/fp-lib-table ) # append to it
|
||||
|
||||
include( CPack )
|
||||
|
||||
endif()
|
||||
|
@ -56,11 +56,7 @@ macro( create_bzr_version_header )
|
||||
if( Kicad_REPO_LAST_CHANGED_DATE )
|
||||
string( REGEX REPLACE "^([0-9]+)\\-([0-9]+)\\-([0-9]+)" "\\1-\\2-\\3"
|
||||
_kicad_bzr_date ${Kicad_REPO_LAST_CHANGED_DATE} )
|
||||
if( KICAD_GOST )
|
||||
set( KICAD_BUILD_VERSION "(${_kicad_bzr_date} BZR ${Kicad_REPO_REVISION} GOST)" )
|
||||
else( KICAD_GOST )
|
||||
set( KICAD_BUILD_VERSION "(${_kicad_bzr_date} BZR ${Kicad_REPO_REVISION})" )
|
||||
endif( KICAD_GOST )
|
||||
set( KICAD_BUILD_VERSION "(${_kicad_bzr_date} BZR ${Kicad_REPO_REVISION})" )
|
||||
|
||||
# Definition to conditionally use date and revision returned from the
|
||||
# Bazaar log command instead of hand coded date and revision in
|
||||
|
@ -55,3 +55,17 @@ function( make_lexer inputFile outHeaderFile outCppFile enum )
|
||||
|
||||
endfunction()
|
||||
|
||||
|
||||
# Is a macro instead of function so there's a higher probability that the
|
||||
# scope of CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA is global
|
||||
macro( add_conffiles )
|
||||
if( ${ARGC} STREQUAL "0" )
|
||||
# remove the file when user passes no arguments, which he should do exactly once at top
|
||||
file( REMOVE ${CMAKE_CURRENT_BINARY_DIR}/conffiles )
|
||||
else()
|
||||
foreach( filename ${ARGV} )
|
||||
file( APPEND ${CMAKE_CURRENT_BINARY_DIR}/conffiles "${filename}\n" )
|
||||
endforeach()
|
||||
set( CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${CMAKE_CURRENT_BINARY_DIR}/conffiles )
|
||||
endif()
|
||||
endmacro( add_conffiles )
|
||||
|
@ -63,11 +63,11 @@ macro(perform_feature_checks)
|
||||
# included in pyport.h which is where the problem ocurrs without this
|
||||
# fix.
|
||||
check_include_file("stdint.h" HAVE_STDINT_H)
|
||||
|
||||
|
||||
if( HAVE_STDINT_H )
|
||||
add_definitions( -DHAVE_STDINT_H )
|
||||
endif()
|
||||
|
||||
|
||||
# no place is this used, and "HAVE_STRINGS_H", if present in config.h then
|
||||
# conflicts with /usr/include/python2.6/Python.h. Please rename the macro if
|
||||
# re-introduce this.
|
||||
@ -81,14 +81,8 @@ macro(perform_feature_checks)
|
||||
# Some platforms define malloc and free in malloc.h instead of stdlib.h.
|
||||
check_symbol_exists(malloc "stdlib.h" MALLOC_IN_STDLIB_H)
|
||||
|
||||
# Use ISO C++ conformant names to disable Visual C++ warnings.
|
||||
check_symbol_exists(_stricmp "string.h" HAVE_ISO_STRICMP)
|
||||
check_symbol_exists(_strnicmp "string.h" HAVE_ISO_STRNICMP)
|
||||
check_symbol_exists(_snprintf "stdio.h" HAVE_ISO_SNPRINTF)
|
||||
|
||||
# Check for functions in math.h.
|
||||
check_include_file("math.h" HAVE_MATH_H)
|
||||
check_symbol_exists(_hypot "math.h" HAVE_ISO_HYPOT)
|
||||
|
||||
# Check for functions in C++ cmath.
|
||||
check_include_file_cxx(cmath HAVE_CXX_CMATH)
|
||||
|
@ -8,13 +8,13 @@ string( REGEX REPLACE "\n" ";" files "${files}" )
|
||||
foreach( file ${files} )
|
||||
message( STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"" )
|
||||
if( EXISTS "$ENV{DESTDIR}${file}" )
|
||||
EXEC_PROGRAM(
|
||||
exec_program(
|
||||
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RETURN_VALUE rm_retval
|
||||
)
|
||||
if( NOT "${rm_retval}" STREQUAL 0 )
|
||||
message( FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"" )
|
||||
if( NOT "${rm_retval}" STREQUAL "0" )
|
||||
message( STATUS "Problem when removing \"$ENV{DESTDIR}${file}\"" )
|
||||
endif()
|
||||
else()
|
||||
message( STATUS "File \"$ENV{DESTDIR}${file}\" does not exist." )
|
||||
|
@ -7,27 +7,9 @@
|
||||
|
||||
#cmakedefine HAVE_STRNCASECMP
|
||||
|
||||
#cmakedefine HAVE_ISO_STRICMP
|
||||
|
||||
#cmakedefine HAVE_ISO_STRNICMP
|
||||
|
||||
#cmakedefine HAVE_ISO_SNPRINTF
|
||||
|
||||
#if defined( HAVE_ISO_SNPRINTF )
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
|
||||
// Handle platform differences in math.h
|
||||
#cmakedefine HAVE_MATH_H
|
||||
|
||||
#cmakedefine HAVE_ISO_HYPOT
|
||||
|
||||
#if defined( HAVE_ISO_HYPOT )
|
||||
#define hypot _hypot
|
||||
#endif
|
||||
|
||||
|
||||
// Handle platform differences in C++ cmath.
|
||||
#cmakedefine HAVE_CXX_CMATH
|
||||
|
||||
@ -57,14 +39,10 @@
|
||||
|
||||
#if defined( HAVE_STRCASECMP )
|
||||
#define stricmp strcasecmp
|
||||
#elif defined( HAVE_ISO_STRICMP )
|
||||
#define stricmp _stricmp
|
||||
#endif
|
||||
|
||||
#if defined( HAVE_STRNCASECMP )
|
||||
#define strnicmp strncasecmp
|
||||
#elif defined( HAVE_ISO_STRNICMP )
|
||||
#define strnicmp _strnicmp
|
||||
#endif
|
||||
|
||||
// Use Posix getc_unlocked() instead of getc() when it's available.
|
||||
|
59
CMakeModules/download_avhttp.cmake
Normal file
59
CMakeModules/download_avhttp.cmake
Normal file
@ -0,0 +1,59 @@
|
||||
# This program source code file is part of KICAD, a free EDA CAD application.
|
||||
#
|
||||
# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
# Copyright (C) 2013 Kicad Developers, see AUTHORS.txt for contributors.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, you may find one here:
|
||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
# or you may search the http://www.gnu.org website for the version 2 license,
|
||||
# or you may write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
|
||||
|
||||
# Download av_http and install into ${PREFIX}, typically in our KiCad source tree.
|
||||
# Assumes include( ExternalProject ) was done inline previous to this file
|
||||
# and that set( DOWNLOAD_DIR ... ) was set in a higher context.
|
||||
|
||||
#-----<configure>-------------------------------------------------------------------------------------
|
||||
|
||||
# soon cmake will have https support, switch to a true download then:
|
||||
#set( AVHTTP_RELEASE ??? )
|
||||
#set( AVHTTP_MD5 ???? ) # re-calc this on every RELEASE change
|
||||
|
||||
#-----</configure>-----------------------------------------------------------------------------------
|
||||
|
||||
|
||||
# Where the library is to be installed.
|
||||
set( PREFIX ${DOWNLOAD_DIR}/avhttp )
|
||||
|
||||
|
||||
# Install the AVHTTP header only library ${PREFIX}
|
||||
ExternalProject_Add( avhttp
|
||||
PREFIX ${PREFIX}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR} # no true download yet
|
||||
|
||||
# grab it from a local zip file for now, cmake caller's source dir
|
||||
URL ${CMAKE_CURRENT_SOURCE_DIR}/avhttp-master.zip
|
||||
DEPENDS boost
|
||||
|
||||
CONFIGURE_COMMAND ""
|
||||
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR> <INSTALL_DIR>
|
||||
)
|
||||
|
||||
|
||||
set( AVHTTP_INCLUDE_DIR "${PREFIX}/include" CACHE FILEPATH "AVHTTP include directory" )
|
||||
mark_as_advanced( AVHTTP_INCLUDE_DIR )
|
@ -29,13 +29,8 @@
|
||||
|
||||
#-----<configure>----------------------------------------------------------------
|
||||
|
||||
if( false )
|
||||
set( BOOST_RELEASE 1.53.0 )
|
||||
set( BOOST_MD5 a00d22605d5dbcfb4c9936a9b35bc4c2 ) # re-calc this on every RELEASE change
|
||||
else()
|
||||
set( BOOST_RELEASE 1.54.0 )
|
||||
set( BOOST_MD5 15cb8c0803064faef0c4ddf5bc5ca279 ) # re-calc this on every RELEASE change
|
||||
endif()
|
||||
set( BOOST_RELEASE 1.54.0 )
|
||||
set( BOOST_MD5 15cb8c0803064faef0c4ddf5bc5ca279 ) # re-calc this on every RELEASE change
|
||||
|
||||
# The boost headers [and static libs if built] go here, at the top of KiCad
|
||||
# source tree in boost_root.
|
||||
@ -44,15 +39,22 @@ set( BOOST_ROOT "${PROJECT_SOURCE_DIR}/boost_root" )
|
||||
|
||||
if( BUILD_GITHUB_PLUGIN )
|
||||
# Space separated list which indicates the subset of boost libraries to compile.
|
||||
# Chosen libraries are based on AVHTTP requirements, and possibly
|
||||
# unit_test_framework for its own worth.
|
||||
set( BOOST_LIBS_BUILT
|
||||
#filesystem
|
||||
system
|
||||
#regex
|
||||
#program_options
|
||||
#date_time
|
||||
#thread
|
||||
#context
|
||||
#coroutine
|
||||
date_time
|
||||
#exception
|
||||
unit_test_framework
|
||||
filesystem
|
||||
iostreams
|
||||
locale
|
||||
program_options
|
||||
regex
|
||||
#signals
|
||||
system
|
||||
thread
|
||||
#unit_test_framework
|
||||
)
|
||||
endif()
|
||||
|
||||
@ -73,35 +75,54 @@ set( PREFIX ${DOWNLOAD_DIR}/boost_${BOOST_VERS} )
|
||||
set( headers_src "${PREFIX}/src/boost/boost" )
|
||||
|
||||
|
||||
# don't look at this:
|
||||
function( set_boost_lib_names libs output )
|
||||
foreach( lib ${libs} )
|
||||
set( fullpath_lib, "${BOOST_ROOT}/lib/libboost_${lib}.a" )
|
||||
message( STATUS "fullpath_lib:${fullpath_lib}" )
|
||||
set( output ${output} ${fullpath_lib} )
|
||||
set( fullpath_lib "${BOOST_ROOT}/lib/libboost_${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}" )
|
||||
list( APPEND results ${fullpath_lib} )
|
||||
endforeach()
|
||||
# set the results into variable represented by output into caller's scope
|
||||
set( ${output} ${results} PARENT_SCOPE )
|
||||
endfunction()
|
||||
|
||||
|
||||
if( BUILD_GITHUB_PLUGIN )
|
||||
|
||||
# (BTW "test" yields "unit_test_framework" when passed to bootstrap.{sh,bat} ).
|
||||
message( STATUS "BOOST_LIBS_BUILT:${BOOST_LIBS_BUILT}" )
|
||||
string( REPLACE "unit_test_framework" "test" libs_csv "${BOOST_LIBS_BUILT}" )
|
||||
message( STATUS "REPLACE libs_csv:${libs_csv}" )
|
||||
# It will probably be simpler to make this the only path in the future.
|
||||
|
||||
string( REGEX REPLACE "\\;" "," libs_csv "${libs_csv}" )
|
||||
message( STATUS "libs_csv:${libs_csv}" )
|
||||
# (BTW "test" yields "unit_test_framework" when passed to bootstrap.sh ).
|
||||
#message( STATUS "BOOST_LIBS_BUILT:${BOOST_LIBS_BUILT}" )
|
||||
string( REPLACE "unit_test_framework" "test" boost_libs_list "${BOOST_LIBS_BUILT}" )
|
||||
#message( STATUS "REPLACE libs_csv:${boost_libs_list}" )
|
||||
|
||||
if( MINGW )
|
||||
set( bootstrap "bootstart.bat mingw" )
|
||||
if( MSYS )
|
||||
# The Boost system does not build properly on MSYS using bootstrap.sh. Running
|
||||
# bootstrap.bat with cmd.exe does. It's ugly but it works. At least for Boost
|
||||
# version 1.54.
|
||||
set( bootstrap cmd.exe /c "bootstrap.bat mingw" )
|
||||
else()
|
||||
set( bootstrap ./bootstrap.bat mingw )
|
||||
endif()
|
||||
|
||||
foreach( lib ${boost_libs_list} )
|
||||
set( b2_libs ${b2_libs} --with-${lib} )
|
||||
endforeach()
|
||||
unset( PIC_STUFF )
|
||||
else()
|
||||
set( bootstrap bootstrap.sh )
|
||||
string( REGEX REPLACE "\\;" "," libs_csv "${boost_libs_list}" )
|
||||
#message( STATUS "libs_csv:${libs_csv}" )
|
||||
|
||||
set( bootstrap ./bootstrap.sh --with-libraries=${libs_csv} )
|
||||
# pass to *both* C and C++ compilers
|
||||
set( PIC_STUFF "cflags=${PIC_FLAG}" )
|
||||
set( BOOST_INCLUDE "${BOOST_ROOT}/include" )
|
||||
unset( b2_libs )
|
||||
endif()
|
||||
|
||||
ExternalProject_Add( boost
|
||||
PREFIX "${PREFIX}"
|
||||
DOWNLOAD_DIR "${DOWNLOAD_DIR}"
|
||||
INSTALL_DIR "${BOOST_ROOT}"
|
||||
URL http://downloads.sourceforge.net/project/boost/boost/${BOOST_RELEASE}/boost_${BOOST_VERS}.tar.bz2
|
||||
URL_MD5 ${BOOST_MD5}
|
||||
|
||||
@ -114,28 +135,56 @@ if( BUILD_GITHUB_PLUGIN )
|
||||
|
||||
BINARY_DIR "${PREFIX}/src/boost/"
|
||||
CONFIGURE_COMMAND ${bootstrap}
|
||||
--with-libraries=${libs_csv}
|
||||
|
||||
BUILD_COMMAND b2
|
||||
BUILD_COMMAND ./b2
|
||||
variant=release
|
||||
threading=multi
|
||||
toolset=gcc
|
||||
link=static
|
||||
--prefix=${BOOST_ROOT}
|
||||
${PIC_STUFF}
|
||||
${b2_libs}
|
||||
#link=static
|
||||
--prefix=<INSTALL_DIR>
|
||||
install
|
||||
|
||||
INSTALL_COMMAND ""
|
||||
)
|
||||
|
||||
file( GLOB boost_libs "${BOOST_ROOT}/lib/*" )
|
||||
#message( STATUS BOOST_ROOT:${BOOST_ROOT} boost_libs:${boost_libs} )
|
||||
set( Boost_LIBRARIES ${boost_libs} CACHE FILEPATH "Boost libraries directory" )
|
||||
set( Boost_INCLUDE_DIR "${BOOST_ROOT}/include" CACHE FILEPATH "Boost include directory" )
|
||||
if( MINGW )
|
||||
execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
||||
OUTPUT_VARIABLE GCC_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||
|
||||
string( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.[0-9]+.*" "\\1\\2" BOOST_GCC_VERSION ${GCC_VERSION} )
|
||||
#message( STATUS "BOOST_GCC_VERSION: ${BOOST_GCC_VERSION}" )
|
||||
|
||||
string( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9])" "\\1_\\2" BOOST_LIB_VERSION ${BOOST_RELEASE} )
|
||||
#message( STATUS "BOOST_LIB_VERSION: ${BOOST_LIB_VERSION}" )
|
||||
|
||||
# adjust the names of the libraries to suit the build. There's no
|
||||
# symbolic links provided on the MinGW build to allow us to use
|
||||
# generic names for the libs
|
||||
foreach( lib ${BOOST_LIBS_BUILT} )
|
||||
set( mingw_boost_libs ${mingw_boost_libs} ${lib}-mgw${BOOST_GCC_VERSION}-mt-${BOOST_LIB_VERSION} )
|
||||
endforeach()
|
||||
|
||||
set( BOOST_LIBS_BUILT ${mingw_boost_libs} )
|
||||
set( BOOST_INCLUDE "${BOOST_ROOT}/include/boost-${BOOST_LIB_VERSION}" )
|
||||
unset( mingw_boost_libs )
|
||||
endif()
|
||||
|
||||
set( boost_libs "" )
|
||||
set_boost_lib_names( "${BOOST_LIBS_BUILT}" boost_libs )
|
||||
|
||||
set( Boost_LIBRARIES ${boost_libs} CACHE FILEPATH "Boost libraries directory" )
|
||||
set( Boost_INCLUDE_DIR "${BOOST_INCLUDE}" CACHE FILEPATH "Boost include directory" )
|
||||
|
||||
mark_as_advanced( Boost_LIBRARIES Boost_INCLUDE_DIR )
|
||||
|
||||
#message( STATUS "BOOST_ROOT:${BOOST_ROOT} BOOST_LIBRARIES:${BOOST_LIBRARIES}" )
|
||||
#message( STATUS "Boost_INCLUDE_DIR: ${Boost_INCLUDE_DIR}" )
|
||||
|
||||
else( BUILD_GITHUB_PLUGIN )
|
||||
|
||||
|
||||
ExternalProject_Add( boost
|
||||
PREFIX "${PREFIX}"
|
||||
DOWNLOAD_DIR "${DOWNLOAD_DIR}"
|
||||
|
149
CMakeModules/download_openssl.cmake
Normal file
149
CMakeModules/download_openssl.cmake
Normal file
@ -0,0 +1,149 @@
|
||||
# This program source code file is part of KICAD, a free EDA CAD application.
|
||||
#
|
||||
# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
# Copyright (C) 2013 Kicad Developers, see AUTHORS.txt for contributors.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, you may find one here:
|
||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
# or you may search the http://www.gnu.org website for the version 2 license,
|
||||
# or you may write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
|
||||
|
||||
# Download OPENSSL and install into ${PREFIX}, typically in our KiCad source tree.
|
||||
# Assumes include( ExternalProject ) was done inline previous to this file
|
||||
# and that set( DOWNLOAD_DIR ... ) was set in a higher context.
|
||||
|
||||
#-----<configure>-------------------------------------------------------------------------------------
|
||||
|
||||
set( OPENSSL_RELEASE "1.0.1e" )
|
||||
set( OPENSSL_MD5 66bf6f10f060d561929de96f9dfe5b8c ) # re-calc on every RELEASE change
|
||||
|
||||
#-----</configure>-----------------------------------------------------------------------------------
|
||||
|
||||
unset( PIC_FLAG )
|
||||
set( CFLAGS CFLAGS=${CMAKE_C_FLAGS} )
|
||||
|
||||
if( MINGW ) # either MINGW or cross compiling?
|
||||
if( CMAKE_SIZEOF_VOID_P EQUAL 4 )
|
||||
set( MINGW32 true )
|
||||
set( MACHINE x86_32 )
|
||||
elseif( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
||||
set( MINGW64 true )
|
||||
set( MACHINE x86_64 )
|
||||
endif()
|
||||
|
||||
if( MINGW32 )
|
||||
set( HOST "--host=i586-pc-mingw32" )
|
||||
elseif( MINGW64 )
|
||||
set( HOST "--host=x86_64-pc-mingw32" )
|
||||
endif()
|
||||
|
||||
set( CC "CC=${CMAKE_C_COMPILER}" )
|
||||
set( RANLIB "RANLIB=${CMAKE_RANLIB}" )
|
||||
set( AR "AR=${CMAKE_AR}" )
|
||||
else()
|
||||
set( PIC_FLAG -fPIC )
|
||||
endif()
|
||||
|
||||
string( TOLOWER ${CMAKE_HOST_SYSTEM_NAME} build )
|
||||
|
||||
# Force some configure scripts into knowing this is a cross-compilation, if it is.
|
||||
set( BUILD --build=${CMAKE_HOST_SYSTEM_PROCESSOR}-pc-${build} )
|
||||
|
||||
|
||||
# http://www.blogcompiler.com/2011/12/21/openssl-for-windows/
|
||||
# http://qt-project.org/wiki/Compiling-OpenSSL-with-MinGW
|
||||
set( PREFIX ${DOWNLOAD_DIR}/openssl-${OPENSSL_RELEASE} )
|
||||
|
||||
unset( CROSS )
|
||||
if( MINGW32 )
|
||||
set( MW mingw )
|
||||
set( CROSS "CROSS_COMPILE=${CROSS_COMPILE}" )
|
||||
elseif( MINGW64 )
|
||||
set( MW mingw64 )
|
||||
set( CROSS "CROSS_COMPILE=${CROSS_COMPILE}" )
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(
|
||||
openssl
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
PREFIX ${PREFIX}
|
||||
TIMEOUT 60
|
||||
URL http://www.openssl.org/source/openssl-${OPENSSL_RELEASE}.tar.gz
|
||||
URL_MD5 ${OPENSSL_MD5}
|
||||
|
||||
# mingw uses msvcrt.dll's printf() which cannot handle %zd, so having
|
||||
# BIO_snprintf() reference printf()'s formating attributes is a bug, since
|
||||
# BIO_snprintf() does its own formatting and is different from msvcrt's printf().
|
||||
|
||||
# This one would be easier if Windows folks could be asked to install "patch.exe"
|
||||
# PATCH_COMMAND patch -p0 < ${PROJECT_SOURCE_DIR}/patches/openssl-1.0.1e.patch
|
||||
|
||||
# This one requires the bzr commit below, since bzr patch only knows a working tree.
|
||||
PATCH_COMMAND bzr patch -p0 ${PROJECT_SOURCE_DIR}/patches/openssl-1.0.1e.patch
|
||||
|
||||
# this requires that perl be installed:
|
||||
CONFIGURE_COMMAND
|
||||
${CROSS}
|
||||
<SOURCE_DIR>/Configure
|
||||
${MW}
|
||||
--prefix=<INSTALL_DIR>
|
||||
${PIC_FLAG} # empty for MINGW
|
||||
shared
|
||||
|
||||
BUILD_IN_SOURCE 1
|
||||
BUILD_COMMAND make depend
|
||||
COMMAND make
|
||||
INSTALL_COMMAND make install
|
||||
)
|
||||
|
||||
# In order to use "bzr patch", we have to have a bzr working tree, this means a bzr repo
|
||||
# must be created and source committed to it. These extra steps do that.
|
||||
|
||||
set( target "openssl" )
|
||||
|
||||
ExternalProject_Add_Step( ${target} bzr_commit_${target}
|
||||
COMMAND bzr ci -q -m pristine <SOURCE_DIR>
|
||||
COMMENT "committing pristine ${target} files to '${target} scratch repo'"
|
||||
DEPENDERS patch
|
||||
)
|
||||
|
||||
ExternalProject_Add_Step( ${target} bzr_add_${target}
|
||||
COMMAND bzr add -q <SOURCE_DIR>
|
||||
COMMENT "adding pristine ${target} files to '${target} scratch repo'"
|
||||
DEPENDERS bzr_commit_${target}
|
||||
)
|
||||
|
||||
ExternalProject_Add_Step( ${target} bzr_init_${target}
|
||||
COMMAND bzr init -q <SOURCE_DIR>
|
||||
COMMENT "creating '${target} scratch repo' specifically for tracking ${target} patches"
|
||||
DEPENDERS bzr_add_${target}
|
||||
DEPENDEES download
|
||||
)
|
||||
|
||||
# The spelling of these is always taken from CMake Module's FindXYZ.cmake file:
|
||||
set( OPENSSL_INCLUDE_DIR
|
||||
${PREFIX}/include
|
||||
CACHE FILEPATH "OPENSSL include directory"
|
||||
)
|
||||
|
||||
set( OPENSSL_LIBRARIES
|
||||
${PREFIX}/lib/libssl.a
|
||||
${PREFIX}/lib/libcrypto.a
|
||||
CACHE STRING "OPENSSL libraries"
|
||||
)
|
||||
set( OPENSSL_FOUND true )
|
||||
|
@ -111,11 +111,6 @@ This option is used to enable or disable building KiCad with images in menu
|
||||
items. If this is not defined when CMake is used to create the build files,
|
||||
images will be included in menu items on all platforms except OSX.
|
||||
|
||||
KICAD_GOST (ON/OFF)
|
||||
-------------------
|
||||
This option is used to enable or disable the GOST notation for multiple gates
|
||||
per package in Eeschema. The default is OFF
|
||||
|
||||
KICAD_KEEPCASE (ON/OFF)
|
||||
-----------------------
|
||||
This option enables or disables turning off the automatic component name
|
||||
|
@ -73,4 +73,11 @@ Dialogs:
|
||||
within the dialog, but for testing purposes please do not exceed this dialog
|
||||
size should the user have selected a font size of 13 points.
|
||||
|
||||
Quoting:
|
||||
Filenames and paths should be emphasized with <> angle brackets. Anything
|
||||
else should be emphasized with single quotes ''. e.g.:
|
||||
<filename.kicad_pcb>
|
||||
<longpath/subdir>
|
||||
'FOOTPRINTNAME'
|
||||
'anything else'
|
||||
|
||||
|
18
INSTALL.txt
18
INSTALL.txt
@ -128,13 +128,17 @@ project is created.
|
||||
Installation from source code
|
||||
-----------------------------
|
||||
|
||||
Some dependencies must be satisfied for the correct installation of KiCad:
|
||||
Some dependencies must be satisfied for the correct installation of KiCad:
|
||||
under Linux:
|
||||
wxWidgets >= 2.8.11 http://www.wxwidgets.org/
|
||||
(needs to be compiled with unicode support)
|
||||
under Windows:MacOSX
|
||||
wxWidgets >= 2.9.3 http://www.wxwidgets.org/
|
||||
CMake >= 2.6.4 http://www.cmake.org/
|
||||
Boost C++ Libraries (files used by kicad are provided in kicad sources) http://www.boost.org/
|
||||
wxWidgets >= 2.9.4 http://www.wxwidgets.org/
|
||||
|
||||
CMake >= 2.8.1 http://www.cmake.org/
|
||||
Boost C++ Libraries:
|
||||
files used by kicad are autmatically downloaded and patched if needed
|
||||
from boost site ( http://www.boost.org/ )
|
||||
OpenGL
|
||||
Linux: Mesa 3D Graphics Library http://www.mesa3d.org/
|
||||
Windows: built-in
|
||||
@ -186,12 +190,6 @@ configured and builded with "--enable-monolithic --disable-shared" parameters.
|
||||
For building dinamically linked executables. Can be used only if wxWidgets
|
||||
configured and builded with "--disable-monolithic --enable-shared" parameters.
|
||||
|
||||
-DwxUSE_UNICODE=ON
|
||||
Require on locale utf8 for build the KiCad with cyrillic fonts support.
|
||||
|
||||
-DKICAD_GOST=ON
|
||||
Build the KiCad with russian GOST support.
|
||||
|
||||
-DKICAD_KEEPCASE=ON
|
||||
Build the KiCad with no component name conversion to uppercase (if you want your
|
||||
ADuC.../Si.../bq... components named as just so).
|
||||
|
33
TODO.txt
33
TODO.txt
@ -140,25 +140,20 @@ PCBNew
|
||||
various zoom factors. I believe that a fixed distance in pixels might make
|
||||
for a friendlier UI.
|
||||
|
||||
*) Check that the new load visibility BOARD settings is properly setting the toolbar
|
||||
buttons like show grid or ratsnest. Add PCB_EDIT_FRAME::SetVisibleElements() so
|
||||
toolbar crap is not known to a BOARD.
|
||||
|
||||
*) Finish removing global access requirements from PLUGINs, so that:
|
||||
*) a BOARD is a fully self contained document description.
|
||||
*) plugin developers do not have to access globals, since a plugin could
|
||||
very well be a dynamically loaded DLL/DSO in the future.
|
||||
One final problem remains is the BASE_SCREEN's grid origin. An easy
|
||||
solution is to move just that one field into the BOARD.
|
||||
|
||||
*) Add ::Footprint*() functions to EAGLE_PLUGIN, so that Eagle footprint libraries
|
||||
can be used in situ.
|
||||
|
||||
*) Add a library table for Pcbnew like that in the sweet library and get rid of the
|
||||
damn search path strategy. This will enable concurrent usage of various types
|
||||
of PLUGIN::Footprint*() functions. At least LEGACY and KICAD are both needed
|
||||
concurrently.
|
||||
|
||||
*) Add a hot key to toggle the 45 degree constraint on and off so that it can be
|
||||
changed when drawing a trace.
|
||||
|
||||
|
||||
Dick's Final TODO List:
|
||||
======================
|
||||
*) Rewrite
|
||||
PCB_BASE_FRAME::Save_Module_In_Library
|
||||
PCB_EDIT_FRAME::ArchiveModulesOnBoard
|
||||
to use FP_LIB_TABLE mechanisms.
|
||||
*) write options dialog for fp table dialog.
|
||||
*) Apply Fabrizio and Alexander's linux desktop patches after unifying them.
|
||||
*) Get licensing cleaned up.
|
||||
*) Re-arrange the repo architecture.
|
||||
*) Merge KiCad GAL/TOM/ORSON if nobody else does.
|
||||
*) DLL-ization of pcbnew & eeschema
|
||||
http://www.eevblog.com/forum/open-source-kicad-geda/seriously-irritated-with-the-library-editor!/
|
||||
|
@ -126,6 +126,7 @@ set(COMMON_SRCS
|
||||
filter_reader.cpp
|
||||
gestfich.cpp
|
||||
getrunningmicrosecs.cpp
|
||||
grid_tricks.cpp
|
||||
gr_basic.cpp
|
||||
hotkeys_basic.cpp
|
||||
hotkey_grid_table.cpp
|
||||
@ -212,11 +213,15 @@ set(PCB_COMMON_SRCS
|
||||
../pcbnew/sel_layer.cpp
|
||||
../pcbnew/pcb_plot_params.cpp
|
||||
../pcbnew/io_mgr.cpp
|
||||
../pcbnew/plugin.cpp
|
||||
../pcbnew/eagle_plugin.cpp
|
||||
../pcbnew/legacy_plugin.cpp
|
||||
../pcbnew/kicad_plugin.cpp
|
||||
../pcbnew/gpcb_plugin.cpp
|
||||
../pcbnew/pcb_netlist.cpp
|
||||
../pcbnew/specctra.cpp
|
||||
../pcbnew/specctra_export.cpp
|
||||
../pcbnew/specctra_keywords.cpp
|
||||
pcb_plot_params_keywords.cpp
|
||||
pcb_keywords.cpp
|
||||
../pcbnew/pcb_parser.cpp
|
||||
@ -237,6 +242,17 @@ set_source_files_properties( ${PCB_COMMON_SRCS} PROPERTIES
|
||||
|
||||
add_library(pcbcommon STATIC ${PCB_COMMON_SRCS})
|
||||
|
||||
# auto-generate specctra_lexer.h and specctra_keywords.cpp
|
||||
make_lexer(
|
||||
${PROJECT_SOURCE_DIR}/pcbnew/specctra.keywords
|
||||
${PROJECT_SOURCE_DIR}/pcbnew/specctra_lexer.h
|
||||
${PROJECT_SOURCE_DIR}/pcbnew/specctra_keywords.cpp
|
||||
DSN
|
||||
|
||||
# Pass header file with dependency on *_lexer.h as extra_arg
|
||||
specctra.h
|
||||
)
|
||||
|
||||
# auto-generate netlist_lexer.h and netlist_keywords.cpp
|
||||
make_lexer(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/netlist.keywords
|
||||
@ -255,7 +271,7 @@ make_lexer(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params_keywords.cpp
|
||||
PCBPLOTPARAMS_T
|
||||
|
||||
# Pass header file with dependency on *_lexer.h as extra_arg
|
||||
# Pass header file with dependencies on *_lexer.h as extra_arg
|
||||
${PROJECT_SOURCE_DIR}/pcbnew/pcb_plot_params.h
|
||||
)
|
||||
|
||||
@ -287,11 +303,7 @@ make_lexer(
|
||||
TB_READER_T
|
||||
)
|
||||
|
||||
# The dsntest may not build properly using MS Visual Studio.
|
||||
if(NOT MSVC)
|
||||
# This one gets made only when testing.
|
||||
# to build it, first enable #define STAND_ALONE at top of dsnlexer.cpp
|
||||
add_executable( dsntest EXCLUDE_FROM_ALL dsnlexer.cpp )
|
||||
target_link_libraries( dsntest common ${wxWidgets_LIBRARIES} rt )
|
||||
|
||||
endif( NOT MSVC )
|
||||
# This one gets made only when testing.
|
||||
# to build it, first enable #define STAND_ALONE at top of dsnlexer.cpp
|
||||
add_executable( dsntest EXCLUDE_FROM_ALL dsnlexer.cpp )
|
||||
target_link_libraries( dsntest common ${wxWidgets_LIBRARIES} rt )
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user