Commit 4cbcf56c authored by jean-pierre charras's avatar jean-pierre charras

remove useless USE_BOOST_POLYGON_LIBRARY cmake option, and remove unused files.

BOOST POLYGON is always used in zone filling functions.
Kbool is still in use in other calculations.
parent 14c14860
......@@ -35,10 +35,6 @@ option(USE_WX_GRAPHICS_CONTEXT
option(USE_WX_OVERLAY
"Use wxOverlay: Always ON for MAC (default OFF). Warning, this is experimental")
option(USE_BOOST_POLYGON_LIBRARY
"Use boost polygon library instead of Kbool to calculate filled areas in zones (default ON)."
ON )
#One of these 2 option *must* be set to ON:
option(KICAD_STABLE_VERSION
"set this option to ON to build the stable version of KICAD. mainly used to set version ID (default OFF)"
......@@ -112,11 +108,6 @@ if(USE_WX_GRAPHICS_CONTEXT)
add_definitions(-DUSE_WX_GRAPHICS_CONTEXT)
endif(USE_WX_GRAPHICS_CONTEXT)
if(USE_BOOST_POLYGON_LIBRARY)
set( USE_BOOST_POLYGON_LIBRARY ON )
add_definitions(-DUSE_BOOST_POLYGON_LIBRARY)
endif(USE_BOOST_POLYGON_LIBRARY)
# Allow user to override the default settings for adding images to menu items. By default
# images in menu items are enabled on all plaforms except OSX. This can be over ridden by
# defining -DUSE_IMAGES_IN_MENUS=ON/OFF to force the preferred behavior.
......
......@@ -333,7 +333,7 @@ void BM2CMP_FRAME::OnExportPcbnew( wxCommandEvent& event )
if( path.IsEmpty() || !wxDirExists(path) )
path = ::wxGetCwd();
wxString msg = _( "Footprint file (*.mod)|*.mod" );
wxString msg = _( "Footprint file (*.mod;*.emp)|*.mod;*.emp" );
wxFileDialog FileDlg( this, _( "Create a footprint file for PcbNew" ),
path, wxEmptyString,
msg,
......
......@@ -532,12 +532,7 @@ void EDA_BASE_FRAME::CopyVersionInfoToClipboard( wxCommandEvent& event )
tmp << wxT( "OFF\n" );
#endif
tmp << wxT( " USE_BOOST_POLYGON_LIBRARY=" );
#ifdef USE_BOOST_POLYGON_LIBRARY
tmp << wxT( "ON\n" );
#else
tmp << wxT( "OFF\n" );
#endif
tmp << wxT( " USE_BOOST_POLYGON_LIBRARY" );
wxTheClipboard->SetData( new wxTextDataObject( tmp ) );
wxTheClipboard->Close();
......
......@@ -13,14 +13,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
###
# Sources
#
# NOTE: Many of the commented out ones are nested in *.cpp files for dialogs
###
if( USE_BOOST_POLYGON_LIBRARY )
set(PCBNEW_SRC_FILL_ZONE zones_convert_brd_items_to_polygons_with_Boost.cpp)
else( USE_BOOST_POLYGON_LIBRARY )
set(PCBNEW_SRC_FILL_ZONE zones_convert_brd_items_to_polygons_with_Kbool.cpp)
endif( USE_BOOST_POLYGON_LIBRARY )
set(PCBNEW_DIALOGS
dialogs/dialog_block_options_base.cpp
dialogs/dialog_cleaning_options_base.cpp
......@@ -100,7 +92,6 @@ set(PCBNEW_SRCS
controle.cpp
dimension.cpp
cross-probing.cpp
debug_kbool_key_file_fct.cpp
deltrack.cpp
${PCBNEW_DIALOGS}
dist.cpp
......@@ -185,7 +176,7 @@ set(PCBNEW_SRCS
trpiste.cpp
work.cpp
xchgmod.cpp
${PCBNEW_SRC_FILL_ZONE}
zones_convert_brd_items_to_polygons_with_Boost.cpp
zones_convert_to_polygons_aux_functions.cpp
zones_by_polygon.cpp
zones_by_polygon_fill_functions.cpp
......
......@@ -659,13 +659,7 @@ void CreateThermalReliefPadPolygon( std::vector<CPolyPt>& aCornerBuffer,
corners_buffer.push_back( corner );
// Now, add the 4 holes ( each is the pattern, rotated by 0, 90, 180 and 270 deg
// WARNING: problems with kbool if angle = 0 (in fact when angle < 200):
// bad filled polygon on some cases, when pads are on a same vertical line
// this seems a bug in kbool polygon (exists in 2.0 kbool version)
// aThermalRot = 450 (45.0 degrees orientation) seems work fine.
// aThermalRot = 0 with thermal shapes without angle < 90 deg has problems in rare
// circumstances.
// Note: with the 2 step build ( thermal shapes added after areas are built), 0 seems work
// aThermalRot = 450 (45.0 degrees orientation) work fine.
int angle_pad = aPad.m_Orient; // Pad orientation
int th_angle = aThermalRot;
......
/* file debug_kbool_key_file_fct.cpp
*/
#include <vector>
#include "fctsys.h"
#include "kicad_string.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "zones.h"
#include "PolyLine.h"
#include "debug_kbool_key_file_fct.h"
#if defined (CREATE_KBOOL_KEY_FILES) || (CREATE_KBOOL_KEY_FILES_FIRST_PASS)
// Helper class to handle a coordinate
struct kfcoord
{
int x, y;
};
static FILE* kdebugFile;
static char sDate_Time[256];
static vector <kfcoord> s_EntityCoordinates;
void CreateKeyFile()
{
wxString datetimestr;
wxDateTime datetime = wxDateTime::Now();
datetime.SetCountry( wxDateTime::Country_Default );
datetimestr = datetime.FormatISODate( )
+ wxT(" ")
+ datetime.FormatISOTime( );
strcpy(sDate_Time, TO_UTF8(datetimestr) );
kdebugFile = fopen( KEYFILE_FILENAME, "wt" );
if( kdebugFile )
{
fprintf( kdebugFile, "# KEY file for GDS-II postprocessing tool\n" );
fprintf( kdebugFile, "# File = %s\n", KEYFILE_FILENAME );
fprintf( kdebugFile, "# ====================================================================\n");
fprintf( kdebugFile, "\nHEADER 5; # version\n");
fprintf( kdebugFile, "BGNLIB;\n");
fprintf( kdebugFile, "LASTMOD {%s}; # last modification time\n",sDate_Time );
fprintf( kdebugFile, "LASTACC {%s}; # last access time\n",sDate_Time );
fprintf( kdebugFile, "LIBNAME trial;\n" );
fprintf( kdebugFile, "UNITS;\n# Internal Pcbnew units are in 0.0001 inch\n" );
fprintf( kdebugFile, "USERUNITS 1; PHYSUNITS 1;\n\n" );
}
else
{
wxMessageBox( wxT( "CreateKeyFile() cannot create output file" ) );
}
s_EntityCoordinates.clear();
}
void CloseKeyFile()
{
if( kdebugFile )
{
fprintf( kdebugFile, "\nENDLIB;\n" );
fclose( kdebugFile );
}
s_EntityCoordinates.clear();
}
const char* sCurrEntityName = NULL;
void OpenKeyFileEntity( const char* aName )
{
if( kdebugFile )
{
fprintf( kdebugFile, "\nBGNSTR; # Begin of structure\n" );
fprintf( kdebugFile, "CREATION {%s}; # creation time\n",sDate_Time);
fprintf( kdebugFile, "LASTMOD {%s}; # last modification time\n",sDate_Time);
fprintf( kdebugFile, "STRNAME %s;\n", aName );
}
sCurrEntityName = aName;
s_EntityCoordinates.clear();
}
void CloseKeyFileEntity()
{
if( kdebugFile )
fprintf( kdebugFile, "\nENDSTR %s;\n", sCurrEntityName );
}
/* start a polygon entity in key file
*/
void StartKeyFilePolygon( int aLayer)
{
s_EntityCoordinates.clear();
fprintf( kdebugFile, "\nBOUNDARY; LAYER %d; DATATYPE 0;\n", aLayer );
}
/* add a polygon corner to the current polygon entity in key file
*/
void AddKeyFilePointXY( int aXcoord, int aYcoord)
{
kfcoord coord;
coord.x = aXcoord;
coord.y = aYcoord;
s_EntityCoordinates.push_back( coord );
}
/* Close a polygon entity in key file
* write the entire polygon data to the file
*/
void EndKeyFilePolygon()
{
// Polygon must be closed: test for that and close it if needed
if( s_EntityCoordinates.size() )
{
if( s_EntityCoordinates.back().x != s_EntityCoordinates[0].x
|| s_EntityCoordinates.back().y != s_EntityCoordinates[0].y )
s_EntityCoordinates.push_back( s_EntityCoordinates[0] );
}
fprintf( kdebugFile, " XY %d;\n", s_EntityCoordinates.size() );
for( unsigned ii = 0; ii < s_EntityCoordinates.size(); ii ++ )
fprintf( kdebugFile, " X %d; Y %d;\n",
s_EntityCoordinates[ii].x, s_EntityCoordinates[ii].y );
fprintf( kdebugFile, "ENDEL;\n" );
s_EntityCoordinates.clear();
}
void CopyPolygonsFromFilledPolysListToKeyFile( ZONE_CONTAINER* aZone, int aLayer )
{
if( !kdebugFile )
return;
unsigned corners_count = aZone->m_FilledPolysList.size();
unsigned ic = 0;
while( ic < corners_count )
{
// write polygon:
StartKeyFilePolygon( aLayer );
for( ; ic < corners_count; ic++ )
{
CPolyPt* corner = &aZone->m_FilledPolysList[ic];
AddKeyFilePointXY( corner->x, corner->y );
if( corner->end_contour )
{
ic++;
break;
}
}
EndKeyFilePolygon();
}
}
#endif
/* debug_kbool_key_file_fct.h
*/
#ifndef _DEBUG_KBOOL_KEY_FILE_FCT_H_
#define _DEBUG_KBOOL_KEY_FILE_FCT_H_
/* These line must be uncommented only if you want to produce a file
* to debug kbool in zone filling algorithms
*/
//#define CREATE_KBOOL_KEY_FILES_FIRST_PASS 1
//#define CREATE_KBOOL_KEY_FILES 1
#if defined (CREATE_KBOOL_KEY_FILES) || (CREATE_KBOOL_KEY_FILES_FIRST_PASS)
// Allows (or not) 0 degree orientation thermal shapes, for kbool tests
//#define CREATE_KBOOL_KEY_FILES_WITH_0_DEG
#define KEYFILE_FILENAME "pcbnew_dbgfile.key"
/**
* Function CreateKeyFile
* open KEYFILE_FILENAME file
* and create header
*/
void CreateKeyFile();
/**
* Function CloseKeyFile
* close KEYFILE_FILENAME file
*/
void CloseKeyFile();
/* create header to start an entity description
*/
void OpenKeyFileEntity(const char * aName);
/* close the entity description
*/
void CloseKeyFileEntity();
/* polygon creations:
*/
void CopyPolygonsFromFilledPolysListToKeyFile( ZONE_CONTAINER* aZone, int aLayer);
void StartKeyFilePolygon( int aLayer);
void AddKeyFilePointXY( int aXcoord, int aYcoord);
void EndKeyFilePolygon();
#endif // CREATE_KBOOL_KEY_FILES
#endif // _DEBUG_KBOOL_KEY_FILE_FCT_H_
......@@ -6,8 +6,6 @@
#ifndef _POLYGONS_DEFS_H_
#define _POLYGONS_DEFS_H_
#ifdef USE_BOOST_POLYGON_LIBRARY
#include "boost/polygon/polygon.hpp"
// Define some types used here from boost::polygon
......@@ -20,6 +18,4 @@ typedef bpl::polygon_data<int> KPolygon;
typedef std::vector<KPolygon> KPolygonSet;
typedef bpl::point_data<int> KPolyPoint;
#endif // USE_BOOST_POLYGON_LIBRARY
#endif // #ifndef _POLYGONS_DEFS_H_
......@@ -125,14 +125,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
*/
s_Correction = 1.0 / cos( 3.14159265 / s_CircleToSegmentsCount );
/* Uses a kbool engine to add holes in the m_FilledPolysList polygon.
* Because this function is called just after creating the m_FilledPolysList,
* only one polygon is in list.
* (initial holes in zones are linked into outer contours by double overlapping segments).
* because after adding holes, many polygons could be exist in this list.
*/
// This polygon set is the area(s) to fill, with m_ZoneMinThickness/2
// This KPolygonSet is the area(s) to fill, with m_ZoneMinThickness/2
KPolygonSet polyset_zone_solid_areas;
int margin = m_ZoneMinThickness / 2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment