7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-19 08:31:48 +00:00

removed GPC library due to its unacceptable license. Using the great and powerfull kbool library insteed

This commit is contained in:
charras 2008-05-30 18:06:21 +00:00
parent e3b63f8380
commit 44743723d1
75 changed files with 16768 additions and 6800 deletions

View File

@ -101,6 +101,7 @@ add_subdirectory(gerbview)
add_subdirectory(kicad)
add_subdirectory(pcbnew)
add_subdirectory(polygon)
add_subdirectory(polygon/kbool/src)
# Resources.
add_subdirectory(demos)
add_subdirectory(internat)

View File

@ -1,10 +1,6 @@
# Generate a static library target named "libbitmaps.a"
# Copy the *.xmp files to *.cpp, on change only.
# Compile those *.cpp files and put them into the library, then done.
OBJECTS = \
3d.o\
Add_Arc.o\
@ -287,5 +283,88 @@ OBJECTS = \
Zoom_Page.o\
Zoom_Selected.o\
Zoom_Select.o\
zoom.o
zoom.o\
axis3d_back.o\
axis3d_bottom.o\
axis3d_front.o\
axis3d_left.o\
axis3d_right.o\
axis3d_top.o\
axis3d.o\
import3d.o\
rotate-x.o\
rotate+x.o\
rotate-y.o\
rotate+y.o\
rotate-z.o\
rotate+z.o\
zoomoins3d.o\
zoompage3d.o\
zoomplus3d.o\
zoomrefr3d.o\
Lang_Catalan.o\
Lang_chinese.o\
Lang_Default.o\
Lang_De.o\
Lang_En.o\
Lang_Es.o\
Lang_Fr.o\
Lang_Hu.o\
Lang_It.o\
Lang_Ko.o\
Lang_Nl.o\
Lang_Pl.o\
Lang_Pt.o\
Lang_Ru.o\
Lang_Sl.o\
Language.o\
delete_association.o\
module_filtered_list.o\
module_full_list.o\
Break_Bus.o\
cvpcb.o\
Delete_Bus.o\
Delete_Connection.o\
Delete_GLabel.o\
Delete_Pinsheet.o\
Delete_Pin.o\
Delete_Sheet.o\
Edit_Comp_Footprint.o\
Edit_Component.o\
Edit_Comp_Ref.o\
Edit_Comp_Value.o\
Edit_Part.o\
Edit_Sheet.o\
Enter_Sheet.o\
GLabel2Label.o\
GLabel2Text.o\
GL_Change.o\
Hidden_Pin.o\
Hierarchy_cursor.o\
Hierarchy_Nav.o\
Label2GLabel.o\
Label2Text.o\
Leave_Sheet.o\
libedit_icon.o\
libedit.o\
Lib_next.o\
Lib_previous.o\
library_browse.o\
Lines90.o\
Move_GLabel.o\
Move_Pinsheet.o\
Move_Sheet.o\
new_component.o\
Normal.o\
Options_Pinsheet.o\
Options_Pin.o\
part_properties.o\
pin2pin.o\
Pin_Name_to.o\
Pin_Number_to.o\
Pin_Size_to.o\
Pin_to.o\
Resize_Sheet.o\
Rotate_GLabel.o\
Rotate_Pin.o\
viewlibs_icon.o

View File

@ -5,6 +5,14 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2008-May-30 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+pcbnew
removed GPC library due to its unacceptable (and stupid) license
using the powerfull kbool library insteed (see polygon/kbool)
+all:
minor changes
2008-May-22 UPDATE Martin Kajdas <kajdas@cox.com>
================================================================================

View File

@ -244,7 +244,7 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
void WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& event )
/**********************************************************/
{
Print_Kicad_Infos( this, m_AboutTitle );
Print_Kicad_Infos( this, m_AboutTitle, wxEmptyString );
}

View File

@ -1,106 +0,0 @@
/************************************************************************/
/* MODULE edamenu.cpp */
/************************************************************************/
/****************************/
/* INCLUDES SYSTEMES */
/****************************/
#include "fctsys.h"
#include "wxstruct.h"
#include "gr_basic.h"
#include "macros.h"
#include "common.h"
#include "worksheet.h"
/* Pour imprimer / lire en unites utilisateur ( INCHES / MM ) */
/* Retourne la valeur en inch ou mm de la valeur val en unités internes
*/
double To_User_Unit(bool is_metric, int val,int internal_unit_value)
{
double value;
if (is_metric)
value = (double) (val) * 25.4 / internal_unit_value;
else value = (double) (val) / internal_unit_value;
return value;
}
/* Retourne la valeur en unités internes de la valeur val exprimée en inch ou mm
*/
int From_User_Unit(bool is_metric, double val,int internal_unit_value)
{
double value;
if (is_metric) value = val * internal_unit_value / 25.4 ;
else value = val * internal_unit_value;
return (int) round(value);
}
/**********************/
wxString GenDate()
/**********************/
/* Retourne la chaine de caractere donnant la date */
{
static char * mois[12] =
{
"jan", "feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"
};
time_t buftime;
struct tm * Date;
wxString string_date;
char Line[1024];
time(&buftime);
Date = gmtime(&buftime);
sprintf(Line,"%d %s %d", Date->tm_mday,
mois[Date->tm_mon],
Date->tm_year + 1900);
string_date = Line;
return(string_date);
}
/***********************************/
void * MyMalloc (size_t nb_octets)
/***********************************/
/* Routine d'allocation memoire */
{
void * pt_mem;
char txt[60];
if (nb_octets == 0)
{
DisplayError(NULL, "Allocate 0 bytes !!");
return(NULL);
}
pt_mem = malloc(nb_octets);
if (pt_mem == NULL)
{
sprintf(txt,"Out of memory: allocation %d bytes", nb_octets);
DisplayError(NULL, txt);
}
return(pt_mem);
}
/************************************/
void * MyZMalloc (size_t nb_octets)
/************************************/
/* Routine d'allocation memoire, avec remise a zero de la zone allouee */
{
void * pt_mem = MyMalloc (nb_octets);
if ( pt_mem) memset(pt_mem, 0, nb_octets);
return(pt_mem);
}
/*******************************/
void MyFree (void * pt_mem)
/*******************************/
{
if( pt_mem ) free(pt_mem);
}

View File

@ -1,7 +1,7 @@
/****************************************************/
/* Display a generic info about kikac (copyright..) */
/* Common tp CVPCB, EESCHEMA, PCBNEW and GERBVIEW */
/****************************************************/
/****************************************************/
/* Display a generic info about kikac (copyright..) */
/* Common tp CVPCB, EESCHEMA, PCBNEW and GERBVIEW */
/****************************************************/
#include "fctsys.h"
#include "gr_basic.h"
@ -14,53 +14,52 @@
// Import:
extern wxString g_Main_Title;
/* Program title strings used in about dialog. They are kept hear to make
/* Program title strings used in about dialog. They are kept here to make
* it easy to update the copyright dates. */
wxString g_KicadAboutTitle = wxT("** KICAD (jul 2000 .. 2008) **");
wxString g_CvpcbAboutTitle = wxT("** CVPCB (sept 1992 .. 2008) **");
wxString g_EeschemaAboutTitle = wxT("** EESCHEMA (sept 1994 .. 2008) **");
wxString g_PcbnewAboutTitle = wxT("** PCBNEW (sept 1992 .. 2008) **");
wxString g_GerbviewAboutTitle = wxT("** GERBVIEW (jul 2001 .. 2008) **");
wxString g_KicadAboutTitle = wxT( "** KICAD (jul 2000 .. 2008) **" );
wxString g_CvpcbAboutTitle = wxT( "** CVPCB (sept 1992 .. 2008) **" );
wxString g_EeschemaAboutTitle = wxT( "** EESCHEMA (sept 1994 .. 2008) **" );
wxString g_PcbnewAboutTitle = wxT( "** PCBNEW (sept 1992 .. 2008) **" );
wxString g_GerbviewAboutTitle = wxT( "** GERBVIEW (jul 2001 .. 2008) **" );
// Routines Locales
/*******************************************/
void Print_Kicad_Infos(wxWindow * frame, const wxString& title)
/*******************************************/
/**************************************************************/
void Print_Kicad_Infos( wxWindow* frame, const wxString& title,
const wxString& aExtra_infos )
/**************************************************************/
{
wxString AboutCaption = wxT("About ");
wxString AboutCaption = wxT( "About " );
wxString Msg = title;
Msg << wxT("\n\n") << _("Build Version:") << wxT("\n") ;
Msg << wxT( "\n\n" ) << _( "Build Version:" ) << wxT( "\n" );
Msg << g_Main_Title << wxT(" ") << GetBuildVersion();
Msg << g_Main_Title << wxT( " " ) << GetBuildVersion();
#if wxUSE_UNICODE
Msg << wxT(" - Unicode version");
Msg << wxT( " - Unicode version" );
#else
Msg << wxT(" - Ansi version");
Msg << wxT( " - Ansi version" );
#endif
#ifdef KICAD_PYTHON
Msg << wxT("\n");
Msg << wxT( "python : " );
Msg << wxString::FromAscii( PyHandler::GetInstance()->GetVersion() );
Msg << wxT( "\n" );
Msg << wxT( "python : " );
Msg << wxString::FromAscii( PyHandler::GetInstance()->GetVersion() );
#endif
Msg << wxT("\n\n") << _("Author:");
Msg << wxT(" JP CHARRAS\n\n") << _("Based on wxWidgets ");
Msg << wxMAJOR_VERSION << wxT(".") <<
wxMINOR_VERSION << wxT(".") << wxRELEASE_NUMBER;
if( wxSUBRELEASE_NUMBER )
Msg << wxT(".") << wxSUBRELEASE_NUMBER;
Msg << _("\n\nGPL License");
Msg << _("\n\nAuthor's sites:\n");
Msg << wxT("http://iut-tice.ujf-grenoble.fr/kicad/\n");
Msg << wxT("http://www.gipsa-lab.inpg.fr/realise_au_lis/kicad/");
Msg << _("\n\nInternational wiki:\n");
Msg << wxT("http://kicad.sourceforge.net/\n");
Msg << wxT( "\n\n" ) << _( "Author:" );
Msg << wxT( " JP CHARRAS\n\n" ) << _( "Based on wxWidgets " );
Msg << wxMAJOR_VERSION << wxT( "." ) <<
wxMINOR_VERSION << wxT( "." ) << wxRELEASE_NUMBER;
if( wxSUBRELEASE_NUMBER )
Msg << wxT( "." ) << wxSUBRELEASE_NUMBER;
Msg << _( "\n\nGPL License" );
Msg << _( "\n\nAuthor's sites:\n" );
Msg << wxT( "http://iut-tice.ujf-grenoble.fr/kicad/\n" );
Msg << wxT( "http://www.gipsa-lab.inpg.fr/realise_au_lis/kicad/" );
Msg << _( "\n\nInternational wiki:\n" );
Msg << wxT( "http://kicad.sourceforge.net/\n" );
Msg << aExtra_infos;
AboutCaption << g_Main_Title << wxT(" ") << GetBuildVersion();
AboutCaption << g_Main_Title << wxT( " " ) << GetBuildVersion();
wxMessageBox(Msg, AboutCaption, wxICON_INFORMATION, frame);
wxMessageBox( Msg, AboutCaption, wxICON_INFORMATION, frame );
}

View File

@ -71,7 +71,7 @@ endif(APPLE)
add_executable(cvpcb WIN32 MACOSX_BUNDLE ${CVPCB_SRCS} ${CVPCB_EXTRA_SRCS} ${CVPCB_RESOURCES})
target_link_libraries(cvpcb 3d-viewer common polygon bitmaps ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES})
target_link_libraries(cvpcb 3d-viewer common polygon kbool bitmaps ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES})
install(TARGETS cvpcb RUNTIME DESTINATION ${KICAD_BIN}
COMPONENT binary)

View File

@ -3,10 +3,12 @@ OBJSUFF = o
EXTRACPPFLAGS += -DCVPCB -fno-strict-aliasing\
-I./ -I../cvpcb -I../include -Ibitmaps\
-I../pcbnew -I../3d-viewer\
-I../polygon
-I../pcbnew -I../3d-viewer -I ../polygon
EXTRALIBS = ../common/common.a ../bitmaps/libbitmaps.a\
../polygon/lib_polygon.a\
../polygon/kbool/src/libkbool.a
EXTRALIBS = ../common/common.a ../bitmaps/libbitmaps.a ../polygon/lib_polygon.a
LIBVIEWER3D = ../3d-viewer/3d-viewer.a

View File

@ -73,7 +73,7 @@ endif(APPLE)
add_executable(gerbview WIN32 MACOSX_BUNDLE ${GERBVIEW_SRCS} ${GERBVIEW_EXTRA_SRCS} ${GERBVIEW_RESOURCES})
target_link_libraries(gerbview 3d-viewer common polygon bitmaps ${wxWidgets_LIBRARIES})
target_link_libraries(gerbview 3d-viewer common polygon kbool bitmaps ${wxWidgets_LIBRARIES})
install(TARGETS gerbview RUNTIME DESTINATION ${KICAD_BIN}
COMPONENT binary)

View File

@ -9,7 +9,7 @@ COMMON_GLOBL wxString g_BuildVersion
# include "config.h"
(wxT(KICAD_SVN_VERSION))
# else
(wxT("(20080429-r1010)"))
(wxT("(20080530-r1107)"))
# endif
#endif
;

View File

@ -48,10 +48,10 @@ enum pseudokeys {
#define EESCHEMA_EXE wxT( "eeschema" )
#define GERBVIEW_EXE wxT( "gerbview" )
#else
#define CVPCB_EXE wxT("cvpcb.app/Contents/MacOS/cvpcb")
#define PCBNEW_EXE wxT("pcbnew.app/Contents/MacOS/pcbnew")
#define EESCHEMA_EXE wxT("eeschema.app/Contents/MacOS/eeschema")
#define GERBVIEW_EXE wxT("gerbview.app/Contents/MacOS/gerbview")
#define CVPCB_EXE wxT( "cvpcb.app/Contents/MacOS/cvpcb" )
#define PCBNEW_EXE wxT( "pcbnew.app/Contents/MacOS/pcbnew" )
#define EESCHEMA_EXE wxT( "eeschema.app/Contents/MacOS/eeschema" )
#define GERBVIEW_EXE wxT( "gerbview.app/Contents/MacOS/gerbview" )
#endif
#endif
@ -97,7 +97,7 @@ public:
bool m_Setup; /* TRUE -> inscription en setup (registration base)*/
public:
PARAM_CFG_BASE( const wxChar * ident, const paramcfg_id type, const wxChar * group = NULL );
PARAM_CFG_BASE( const wxChar* ident, const paramcfg_id type, const wxChar* group = NULL );
~PARAM_CFG_BASE() { };
};
@ -109,12 +109,12 @@ public:
int m_Default; /* valeur par defaut */
public:
PARAM_CFG_INT( const wxChar * ident, int* ptparam,
PARAM_CFG_INT( const wxChar* ident, int* ptparam,
int default_val = 0, int min = INT_MINVAL, int max = INT_MAXVAL,
const wxChar * group = NULL );
PARAM_CFG_INT( bool Insetup, const wxChar * ident, int* ptparam,
const wxChar* group = NULL );
PARAM_CFG_INT( bool Insetup, const wxChar* ident, int* ptparam,
int default_val = 0, int min = INT_MINVAL, int max = INT_MAXVAL,
const wxChar * group = NULL );
const wxChar* group = NULL );
};
class PARAM_CFG_SETCOLOR : public PARAM_CFG_BASE
@ -124,10 +124,10 @@ public:
int m_Default; /* valeur par defaut */
public:
PARAM_CFG_SETCOLOR( const wxChar * ident, int* ptparam,
int default_val, const wxChar * group = NULL );
PARAM_CFG_SETCOLOR( bool Insetup, const wxChar * ident, int* ptparam,
int default_val, const wxChar * group = NULL );
PARAM_CFG_SETCOLOR( const wxChar* ident, int* ptparam,
int default_val, const wxChar* group = NULL );
PARAM_CFG_SETCOLOR( bool Insetup, const wxChar* ident, int* ptparam,
int default_val, const wxChar* group = NULL );
};
class PARAM_CFG_DOUBLE : public PARAM_CFG_BASE
@ -138,12 +138,12 @@ public:
double m_Min, m_Max; /* valeurs extremes du parametre */
public:
PARAM_CFG_DOUBLE( const wxChar * ident, double* ptparam,
PARAM_CFG_DOUBLE( const wxChar* ident, double* ptparam,
double default_val = 0.0, double min = 0.0, double max = 10000.0,
const wxChar * group = NULL );
PARAM_CFG_DOUBLE( bool Insetup, const wxChar * ident, double* ptparam,
const wxChar* group = NULL );
PARAM_CFG_DOUBLE( bool Insetup, const wxChar* ident, double* ptparam,
double default_val = 0.0, double min = 0.0, double max = 10000.0,
const wxChar * group = NULL );
const wxChar* group = NULL );
};
class PARAM_CFG_BOOL : public PARAM_CFG_BASE
@ -153,10 +153,10 @@ public:
int m_Default; /* valeur par defaut */
public:
PARAM_CFG_BOOL( const wxChar * ident, bool * ptparam,
int default_val = FALSE, const wxChar * group = NULL );
PARAM_CFG_BOOL( bool Insetup, const wxChar * ident, bool * ptparam,
int default_val = FALSE, const wxChar * group = NULL );
PARAM_CFG_BOOL( const wxChar* ident, bool* ptparam,
int default_val = FALSE, const wxChar* group = NULL );
PARAM_CFG_BOOL( bool Insetup, const wxChar* ident, bool* ptparam,
int default_val = FALSE, const wxChar* group = NULL );
};
@ -166,11 +166,11 @@ public:
wxString* m_Pt_param; /* pointeur sur le parametre a configurer */
public:
PARAM_CFG_WXSTRING( const wxChar * ident, wxString * ptparam, const wxChar * group = NULL );
PARAM_CFG_WXSTRING( bool Insetup,
const wxChar * ident,
wxString * ptparam,
const wxChar * group = NULL );
PARAM_CFG_WXSTRING( const wxChar* ident, wxString* ptparam, const wxChar* group = NULL );
PARAM_CFG_WXSTRING( bool Insetup,
const wxChar* ident,
wxString* ptparam,
const wxChar* group = NULL );
};
class PARAM_CFG_LIBNAME_LIST : public PARAM_CFG_BASE
@ -179,9 +179,9 @@ public:
wxArrayString* m_Pt_param; /* pointeur sur le parametre a configurer */
public:
PARAM_CFG_LIBNAME_LIST( const wxChar * ident,
wxArrayString * ptparam,
const wxChar * group = NULL );
PARAM_CFG_LIBNAME_LIST( const wxChar* ident,
wxArrayString* ptparam,
const wxChar* group = NULL );
};
@ -195,7 +195,7 @@ private:
wxListBox* m_List;
public:
WinEDA_TextFrame( wxWindow * parent, const wxString &title );
WinEDA_TextFrame( wxWindow* parent, const wxString& title );
void Append( const wxString& text );
private:
@ -221,24 +221,24 @@ public:
int m_BottomMargin;
public:
Ki_PageDescr( const wxSize &size, const wxPoint &offset, const wxString &name );
Ki_PageDescr( const wxSize& size, const wxPoint& offset, const wxString& name );
};
/* Standard page sizes in 1/1000 inch */
#if defined EDA_BASE
Ki_PageDescr g_Sheet_A4( wxSize( 11700, 8267 ), wxPoint( 0, 0 ), wxT( "A4" ) );
Ki_PageDescr g_Sheet_A3( wxSize( 16535, 11700 ), wxPoint( 0, 0 ), wxT( "A3" ) );
Ki_PageDescr g_Sheet_A2( wxSize( 23400, 16535 ), wxPoint( 0, 0 ), wxT( "A2" ) );
Ki_PageDescr g_Sheet_A1( wxSize( 33070, 23400 ), wxPoint( 0, 0 ), wxT( "A1" ) );
Ki_PageDescr g_Sheet_A0( wxSize( 46800, 33070 ), wxPoint( 0, 0 ), wxT( "A0" ) );
Ki_PageDescr g_Sheet_A( wxSize( 11000, 8500 ), wxPoint( 0, 0 ), wxT( "A" ) );
Ki_PageDescr g_Sheet_B( wxSize( 17000, 11000 ), wxPoint( 0, 0 ), wxT( "B" ) );
Ki_PageDescr g_Sheet_C( wxSize( 22000, 17000 ), wxPoint( 0, 0 ), wxT( "C" ) );
Ki_PageDescr g_Sheet_D( wxSize( 34000, 22000 ), wxPoint( 0, 0 ), wxT( "D" ) );
Ki_PageDescr g_Sheet_E( wxSize( 44000, 34000 ), wxPoint( 0, 0 ), wxT( "E" ) );
Ki_PageDescr g_Sheet_GERBER( wxSize( 32000, 32000 ), wxPoint( 0, 0 ), wxT( "GERBER" ) );
Ki_PageDescr g_Sheet_user( wxSize( 17000, 11000 ), wxPoint( 0, 0 ), wxT( "User" ) );
Ki_PageDescr g_Sheet_A4( wxSize( 11700, 8267 ), wxPoint( 0, 0 ), wxT( "A4" ) );
Ki_PageDescr g_Sheet_A3( wxSize( 16535, 11700 ), wxPoint( 0, 0 ), wxT( "A3" ) );
Ki_PageDescr g_Sheet_A2( wxSize( 23400, 16535 ), wxPoint( 0, 0 ), wxT( "A2" ) );
Ki_PageDescr g_Sheet_A1( wxSize( 33070, 23400 ), wxPoint( 0, 0 ), wxT( "A1" ) );
Ki_PageDescr g_Sheet_A0( wxSize( 46800, 33070 ), wxPoint( 0, 0 ), wxT( "A0" ) );
Ki_PageDescr g_Sheet_A( wxSize( 11000, 8500 ), wxPoint( 0, 0 ), wxT( "A" ) );
Ki_PageDescr g_Sheet_B( wxSize( 17000, 11000 ), wxPoint( 0, 0 ), wxT( "B" ) );
Ki_PageDescr g_Sheet_C( wxSize( 22000, 17000 ), wxPoint( 0, 0 ), wxT( "C" ) );
Ki_PageDescr g_Sheet_D( wxSize( 34000, 22000 ), wxPoint( 0, 0 ), wxT( "D" ) );
Ki_PageDescr g_Sheet_E( wxSize( 44000, 34000 ), wxPoint( 0, 0 ), wxT( "E" ) );
Ki_PageDescr g_Sheet_GERBER( wxSize( 32000, 32000 ), wxPoint( 0, 0 ), wxT( "GERBER" ) );
Ki_PageDescr g_Sheet_user( wxSize( 17000, 11000 ), wxPoint( 0, 0 ), wxT( "User" ) );
#else
extern Ki_PageDescr g_Sheet_A4;
@ -316,7 +316,7 @@ COMMON_GLOBL wxString g_EditorName;
// Gestion de la grille "utilisateur" (User Grid)
#ifdef EDA_BASE
wxRealPoint g_UserGrid( 0.01, 0.01 );
wxRealPoint g_UserGrid( 0.01, 0.01 );
int g_UserGrid_Unit = INCHES;
#else
@ -364,7 +364,7 @@ class WinEDA_DrawPanel;
* @param aPoint The point to output.
* @return wxString& - the input string
*/
wxString& operator << ( wxString& aString, const wxPoint& aPoint );
wxString& operator <<( wxString& aString, const wxPoint& aPoint );
/**
@ -374,10 +374,10 @@ wxString& operator << ( wxString& aString, const wxPoint& aPoint );
* @param aFlags The same args as allowed for wxExecute()
* @return bool - true if success, else false
*/
bool ProcessExecute( const wxString& aCommandLine, int aFlags = wxEXEC_ASYNC );
bool ProcessExecute( const wxString& aCommandLine, int aFlags = wxEXEC_ASYNC );
wxString ReturnPcbLayerName( int layer_number, bool is_filename = FALSE );
wxString ReturnPcbLayerName( int layer_number, bool is_filename = FALSE );
/* Return the name of the layer number "layer_number".
* if "is_filename" == TRUE, the name can be used for a file name
@ -431,19 +431,19 @@ void OpenFile( const wxString& file );
bool EDA_DirectorySelector( const wxString& Title, /* Titre de la fenetre */
wxString& Path, /* Chemin par defaut */
int flag, /* reserve */
wxWindow* Frame, /* parent frame */
const wxPoint& Pos );
wxString& Path, /* Chemin par defaut */
int flag, /* reserve */
wxWindow* Frame, /* parent frame */
const wxPoint& Pos );
wxString EDA_FileSelector( const wxString& Title, /* Window title */
const wxString& Path, /* default path */
const wxString& FileName, /* default filename */
const wxString& Ext, /* default extension */
const wxString& Mask, /* Display filename mask */
wxWindow* Frame, /* parent frame */
int flag, /* wxSAVE, wxOPEN ..*/
const bool keep_working_directory, /* true = do not change the C.W.D. */
wxString EDA_FileSelector( const wxString &Title, /* Window title */
const wxString &Path, /* default path */
const wxString &FileName, /* default filename */
const wxString &Ext, /* default extension */
const wxString &Mask, /* Display filename mask */
wxWindow * Frame, /* parent frame */
int flag, /* wxSAVE, wxOPEN ..*/
const bool keep_working_directory, /* true = do not change the C.W.D. */
const wxPoint& Pos = wxPoint( -1, -1 )
);
@ -461,8 +461,8 @@ wxString MakeFileName( const wxString& dir,
* retourne la chaine calculee */
wxString MakeReducedFileName( const wxString& fullfilename,
const wxString& default_path,
const wxString& default_ext );
const wxString& default_path,
const wxString& default_ext );
/* Calcule le nom "reduit" d'un file d'apres les chaines
* fullfilename = nom complet
@ -488,14 +488,14 @@ int ExecuteFile( wxWindow* frame, const wxString& ExecFile,
const wxString& param = wxEmptyString );
void AddDelimiterString( wxString& string );
void SetRealLibraryPath( const wxString& shortlibname );/* met a jour
* le chemin des librairies RealLibDirBuffer (global)
* a partir de UserLibDirBuffer (global):
* Si UserLibDirBuffer non vide RealLibDirBuffer = UserLibDirBuffer.
* Sinon si variable d'environnement KICAD definie (KICAD = chemin pour kicad),
* UserLibDirBuffer = <KICAD>/shortlibname;
* Sinon UserLibDirBuffer = <Chemin des binaires>../shortlibname/
*/
void SetRealLibraryPath( const wxString& shortlibname ); /* met a jour
* le chemin des librairies RealLibDirBuffer (global)
* a partir de UserLibDirBuffer (global):
* Si UserLibDirBuffer non vide RealLibDirBuffer = UserLibDirBuffer.
* Sinon si variable d'environnement KICAD definie (KICAD = chemin pour kicad),
* UserLibDirBuffer = <KICAD>/shortlibname;
* Sinon UserLibDirBuffer = <Chemin des binaires>../shortlibname/
*/
wxString FindKicadHelpPath();
/* Find absolute path for kicad/help (or kicad/help/<language>) */
@ -564,26 +564,28 @@ bool WildCompareString( const wxString& pattern, const wxString& string_t
bool case_sensitive = TRUE );
/* compare 2 noms de composants, selon regles usuelles
* ( Jokers * , ? , autoris<EFBFBD>s).
* ( Jokers * , ? , autorises).
* la chaine de reference est "pattern"
* si case_sensitive == TRUE (default), comparaison exacte
* retourne TRUE si match FALSE si differences */
char* to_point( char* Text );
/* convertit les , en . dans une chaine. utilis<EFBFBD> pour compenser la fct printf
/* convertit les , en . dans une chaine. utilise pour compenser la fct printf
* qui genere les flottants avec une virgule au lieu du point en mode international */
/****************/
/* infospgm.cpp */
/****************/
extern wxString g_KicadAboutTitle;
extern wxString g_CvpcbAboutTitle;
extern wxString g_EeschemaAboutTitle;
extern wxString g_PcbnewAboutTitle;
extern wxString g_GerbviewAboutTitle;
extern wxString g_KicadAboutTitle;
extern wxString g_CvpcbAboutTitle;
extern wxString g_EeschemaAboutTitle;
extern wxString g_PcbnewAboutTitle;
extern wxString g_GerbviewAboutTitle;
void Print_Kicad_Infos( wxWindow* frame, const wxString& title );
void Print_Kicad_Infos( wxWindow* frame,
const wxString& title,
const wxString& aExtra_infos );
/**************/
/* common.cpp */
@ -591,10 +593,10 @@ void Print_Kicad_Infos( wxWindow* frame, const wxString& title );
wxString GetBuildVersion(); /* Return the build date */
void Affiche_1_Parametre( WinEDA_DrawFrame* frame,
int pos_X,
const wxString& texte_H,
const wxString& texte_L,
int color );
int pos_X,
const wxString& texte_H,
const wxString& texte_L,
int color );
/*
* Routine d'affichage d'un parametre.
@ -608,16 +610,16 @@ void Affiche_1_Parametre( WinEDA_DrawFrame* frame,
* color = couleur d'affichage
*/
void AfficheDoc( WinEDA_DrawFrame* frame, const wxString& Doc, const wxString& KeyW );
void AfficheDoc( WinEDA_DrawFrame* frame, const wxString& Doc, const wxString& KeyW );
/* Routine d'affichage de la documentation associee a un composant */
int GetTimeStamp();
int GetTimeStamp();
/* Retoure une identification temporelle (Time stamp) differente a chaque appel */
int DisplayColorFrame( wxWindow* parent, int OldColor );
int GetCommandOptions( const int argc, const char** argv, const char* stringtst,
const char** optarg, int* optind );
int DisplayColorFrame( wxWindow* parent, int OldColor );
int GetCommandOptions( const int argc, const char** argv, const char* stringtst,
const char** optarg, int* optind );
const wxString& valeur_param( int valeur, wxString& buf_texte );
@ -628,28 +630,28 @@ const wxString& valeur_param( int valeur, wxString& buf_texte );
* suivie de " ou mm
*/
wxString ReturnUnitSymbol( int Units = g_UnitMetric );
int ReturnValueFromString( int Units, const wxString& TextValue, int Internal_Unit );
wxString ReturnStringFromValue( int Units, int Value, int Internal_Unit );
void AddUnitSymbol( wxStaticText& Stext, int Units = g_UnitMetric );
wxString ReturnUnitSymbol( int Units = g_UnitMetric );
int ReturnValueFromString( int Units, const wxString& TextValue, int Internal_Unit );
wxString ReturnStringFromValue( int Units, int Value, int Internal_Unit );
void AddUnitSymbol( wxStaticText& Stext, int Units = g_UnitMetric );
/* Add string " (mm):" or " ("):" to the static text Stext.
* Used in dialog boxes for entering values depending on selected units */
void PutValueInLocalUnits( wxTextCtrl& TextCtr, int Value, int Internal_Unit );
void PutValueInLocalUnits( wxTextCtrl& TextCtr, int Value, int Internal_Unit );
/* Convert the number Value in a string according to the internal units
* and the selected unit (g_UnitMetric) and put it in the wxTextCtrl TextCtrl */
int ReturnValueFromTextCtrl( const wxTextCtrl& TextCtr, int Internal_Unit );
int ReturnValueFromTextCtrl( const wxTextCtrl& TextCtr, int Internal_Unit );
/* Convert the Value in the wxTextCtrl TextCtrl in an integer,
* according to the internal units and the selected unit (g_UnitMetric) */
double To_User_Unit( bool is_metric, int val, int internal_unit_value );
int From_User_Unit( bool is_metric, double val, int internal_unit_value );
wxString GenDate();
void MyFree( void* pt_mem );
void* MyZMalloc( size_t nb_octets );
void* MyMalloc( size_t nb_octets );
double To_User_Unit( bool is_metric, int val, int internal_unit_value );
int From_User_Unit( bool is_metric, double val, int internal_unit_value );
wxString GenDate();
void MyFree( void* pt_mem );
void* MyZMalloc( size_t nb_octets );
void* MyMalloc( size_t nb_octets );
/****************/
@ -671,9 +673,9 @@ bool GetAssociatedDocument( wxFrame* frame, const wxString& LibPath,
/****************************/
/* get_component_dialog.cpp */
/****************************/
wxString GetComponentName( WinEDA_DrawFrame* frame,
wxArrayString& HistoryList, const wxString& Title,
wxString (* AuxTool)(WinEDA_DrawFrame* parent) );
wxString GetComponentName( WinEDA_DrawFrame * frame,
wxArrayString & HistoryList, const wxString &Title,
wxString (*AuxTool)( WinEDA_DrawFrame * parent ) );
/* Dialog frame to choose a component name */
void AddHistoryComponentName( wxArrayString& HistoryList, const wxString& Name );

View File

@ -329,6 +329,8 @@ public:
~WinEDA_PcbFrame();
void GetKicadAbout( wxCommandEvent& event );
// Configurations:
void InstallConfigFrame( const wxPoint& pos );
void Process_Config( wxCommandEvent& event );

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -27,6 +27,24 @@
// UnComment this to load subdirs files in the tree project
#define ADD_FILES_IN_SUBDIRS
// list of files extensions listed in the tree project window
// *.sch files are always allowed, do not add here
// Add extensions in a compatible regex format to see others files types
const wxChar * s_AllowedExtensionsToList[] =
{
wxT( "^.*\\.pro$" ),
wxT( "^.*\\.pdf$" ),
wxT( "^[^$].*\\.brd$" ),
wxT( "^.*\\.net$" ),
wxT( "^.*\\.txt$" ),
wxT( "^.*\\.pho$" ),
wxT( "^.*\\.odt$" ),
wxT( "^.*\\.sxw$" ),
wxT( "^.*\\.htm$" ),
wxT( "^.*\\.html$" ),
NULL // end of list
};
/******************************************************************/
WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent,
const wxPoint& pos,
@ -44,12 +62,10 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent,
* for a given file type.
*/
m_Filters.push_back( wxT( "^.*\\.sch$" ) ); // note: sch filter must be first because of a test in AddFile() below
m_Filters.push_back( wxT( "^.*\\.pro$" ) );
m_Filters.push_back( wxT( "^.*\\.pdf$" ) );
m_Filters.push_back( wxT( "^[^$].*\\.brd$" ) );
m_Filters.push_back( wxT( "^.*\\.net$" ) );
m_Filters.push_back( wxT( "^.*\\.txt$" ) );
m_Filters.push_back( wxT( "^.*\\.pho$" ) );
for ( int ii = 0; s_AllowedExtensionsToList[ii] != NULL; ii++ )
{
m_Filters.push_back( s_AllowedExtensionsToList[ii] );
}
m_Filters.push_back( wxT( "^no kicad files found" ) );
#ifdef KICAD_PYTHON

View File

@ -1,4 +1,4 @@
KICAD_SUBDIRS = common bitmaps 3d-viewer polygon eeschema eeschema/plugins pcbnew kicad cvpcb gerbview
KICAD_SUBDIRS = common bitmaps 3d-viewer polygon polygon/kbool/src eeschema eeschema/plugins pcbnew kicad cvpcb gerbview
KICAD_SUBDIRS_BIN = eeschema eeschema/plugins pcbnew cvpcb kicad gerbview
# How to invoke make:
MAKE = make -k -f makefile.g95

View File

@ -163,7 +163,7 @@ endif(APPLE)
add_executable(pcbnew WIN32 MACOSX_BUNDLE ${PCBNEW_SRCS} ${PCBNEW_EXTRA_SRCS} ${PCBNEW_RESOURCES})
target_link_libraries(pcbnew 3d-viewer common polygon bitmaps ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES} )
target_link_libraries(pcbnew 3d-viewer common polygon kbool bitmaps ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES} )
install(TARGETS pcbnew RUNTIME DESTINATION ${KICAD_BIN}
COMPONENT binary)

View File

@ -1,5 +1,8 @@
EXTRALIBS = ../common/common.a ../bitmaps/libbitmaps.a ../polygon/lib_polygon.a
EXTRALIBS = ../common/common.a ../bitmaps/libbitmaps.a\
../polygon/lib_polygon.a\
../polygon/kbool/src/libkbool.a
EXTRACPPFLAGS += -DPCBNEW -fno-strict-aliasing -I./ -Ibitmaps -I../include -I../share\
-I../pcbnew -I../3d-viewer -I../polygon

View File

@ -478,7 +478,7 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
wxMenu* via_mnu = new wxMenu();
ADD_MENUITEM_WITH_SUBMENU( PopMenu, via_mnu,
ID_POPUP_PCB_VIA_EDITING, _( "Edit Via" ), edit_xpm );
ID_POPUP_PCB_VIA_EDITING, _( "Edit Via Drill" ), edit_xpm );
ADD_MENUITEM( via_mnu, ID_POPUP_PCB_VIA_HOLE_TO_DEFAULT,
_( "Set via hole to Default" ), apply_xpm );
msg = _( "Set via hole to a specific value. This specfic value is currently" );
@ -486,7 +486,7 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
ADD_MENUITEM_WITH_HELP( via_mnu, ID_POPUP_PCB_VIA_HOLE_TO_VALUE,
_( "Set via hole to alt value" ), msg,
options_new_pad_xpm );
msg = _( "Set alt via hole value. This value is currently" );
msg = _( "Set a specific via hole value. This value is currently" );
msg << wxT(" ") << ReturnStringFromValue( g_UnitMetric, g_DesignSettings.m_ViaDrillCustomValue, m_InternalUnits );
ADD_MENUITEM_WITH_HELP( via_mnu, ID_POPUP_PCB_VIA_HOLE_ENTER_VALUE,
_( "Set the via hole alt value" ), msg, edit_xpm );
@ -559,18 +559,18 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
ADD_MENUITEM_WITH_SUBMENU( PopMenu, track_mnu,
ID_POPUP_PCB_EDIT_TRACK_MNU, _( "Change Width" ), width_track_xpm );
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_EDIT_TRACKSEG,
Track->Type()==TYPEVIA ? _( "Edit Via" ) : _( "Edit Segment" ), width_segment_xpm );
Track->Type()==TYPEVIA ? _( "Change Via Size" ) : _( "Change Segment Width" ), width_segment_xpm );
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_EDIT_TRACK,
_( "Edit Track" ), width_track_xpm );
_( "Change Track Width" ), width_track_xpm );
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_EDIT_NET,
_( "Edit Net" ), width_net_xpm );
_( "Change Net" ), width_net_xpm );
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_EDIT_ALL_VIAS_AND_TRACK_SIZE,
_( "Edit ALL Tracks and Vias" ), width_track_via_xpm );
_( "Change ALL Tracks and Vias" ), width_track_via_xpm );
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_EDIT_ALL_VIAS_SIZE,
_( "Edit ALL Vias (no track)" ), width_vias_xpm );
_( "Change ALL Vias (no track)" ), width_vias_xpm );
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_EDIT_ALL_TRACK_SIZE,
_( "Edit ALL Tracks (no via)" ), width_track_xpm );
_( "Change ALL Tracks (no via)" ), width_track_xpm );
}
// Delete control:

View File

@ -12,7 +12,7 @@
#include "protos.h"
#include "id.h"
#include "drc_stuff.h"
#include "kbool/include/booleng.h"
/*******************************/
/* class WinEDA_PcbFrame */
@ -99,7 +99,7 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
// Menu Help
EVT_MENU( ID_GENERAL_HELP, WinEDA_DrawFrame::GetKicadHelp )
EVT_MENU( ID_KICAD_ABOUT, WinEDA_DrawFrame::GetKicadAbout )
EVT_MENU( ID_KICAD_ABOUT, WinEDA_PcbFrame::GetKicadAbout )
// Menu 3D Frame
EVT_MENU( ID_MENU_PCB_SHOW_3D_FRAME, WinEDA_PcbFrame::Show3D_Frame )
@ -245,8 +245,9 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent,
ReCreateOptToolbar();
}
/************************************/
WinEDA_PcbFrame::~WinEDA_PcbFrame()
/************************************/
{
m_Parent->m_PcbFrame = NULL;
SetBaseScreen( ScreenPcb );
@ -566,3 +567,15 @@ void WinEDA_PcbFrame::SetToolbars()
DisplayUnitsMsg();
}
/***********************************************************/
void WinEDA_PcbFrame::GetKicadAbout( wxCommandEvent& event )
/**********************************************************/
{
wxString extra_message =
wxT("\nPcbnew uses the kbool library (boolean operations on sets of 2d polygons)\n");
extra_message << wxT("version ") << wxT(KBOOL_VERSION)
<< wxT("\nsee http://boolean.klaasholwerda.nl/bool.html\n");
Print_Kicad_Infos( this, m_AboutTitle, extra_message );
}

View File

@ -291,7 +291,7 @@ int BOARD::ClipAreaPolygon( ZONE_CONTAINER* CurrArea,
NewArea = AddArea( CurrArea->GetNet(), CurrArea->GetLayer(), 0, 0, 0 );
// remove the poly that was automatically created for the new area
// and replace it with a poly from NormalizeWithGpc
// and replace it with a poly from NormalizeWithKbool
delete NewArea->m_Poly;
NewArea->m_Poly = new_p;
NewArea->m_Poly->Draw();
@ -694,183 +694,109 @@ int BOARD::CombineAreas( ZONE_CONTAINER* area_ref, ZONE_CONTAINER* area_to_combi
#endif
// polygons intersect, combine them
CPolyLine* poly1 = area_ref->m_Poly;
CPolyLine* poly2 = area_to_combine->m_Poly;
std::vector<CArc> arc_array1;
std::vector<CArc> arc_array2;
bool keep_area_to_combine = false;
poly1->MakePolygonFromAreaOutlines( -1, &arc_array1 );
poly2->MakePolygonFromAreaOutlines( -1, &arc_array2 );
Bool_Engine* booleng = new Bool_Engine();
ArmBoolEng( booleng );
#ifdef USE_GPC_POLY_LIB
int n_ext_cont1 = 0;
for( int ic = 0; ic<poly1->GetGpcPoly()->num_contours; ic++ )
if( !( (poly1->GetGpcPoly()->hole)[ic] ) )
n_ext_cont1++;
area_ref->m_Poly->AddPolygonsToBoolEng( booleng, GROUP_A, -1, -1 );
area_to_combine->m_Poly->AddPolygonsToBoolEng( booleng, GROUP_B, -1, -1 );
booleng->Do_Operation( BOOL_OR );
int n_ext_cont2 = 0;
for( int ic = 0; ic<poly2->GetGpcPoly()->num_contours; ic++ )
if( !( (poly2->GetGpcPoly()->hole)[ic] ) )
n_ext_cont2++;
gpc_polygon* union_gpc = new gpc_polygon;
gpc_polygon_clip( GPC_UNION, poly1->GetGpcPoly(), poly2->GetGpcPoly(), union_gpc );
// get number of outside contours
int n_union_ext_cont = 0;
for( int ic = 0; ic<union_gpc->num_contours; ic++ )
if( !( (union_gpc->hole)[ic] ) )
n_union_ext_cont++;
// if no intersection, free new gpc and return
if( n_union_ext_cont == n_ext_cont1 + n_ext_cont2 )
// create area with external contour: Recreate only area edges, NOT holes
if( booleng->StartPolygonGet() )
{
gpc_free_polygon( union_gpc );
delete union_gpc;
return 0;
if( booleng->GetPolygonPointEdgeType() == KB_INSIDE_EDGE )
{
DisplayError( NULL, wxT( "BOARD::CombineAreas() error: unexpected hole descriptor" ) );
}
area_ref->m_Poly->RemoveAllContours();
// foreach point in the polygon
bool first = true;
while( booleng->PolygonHasMorePoints() )
{
int x = booleng->GetPolygonXPoint();
int y = booleng->GetPolygonYPoint();
if( first )
{
first = false;
area_ref->m_Poly->Start( area_ref->GetLayer(
), x, y, area_ref->m_Poly->GetHatchStyle() );
}
else
area_ref->m_Poly->AppendCorner( x, y );
}
booleng->EndPolygonGet();
area_ref->m_Poly->Close();
}
// intersection, replace area_ref->m_Poly with combined areas and remove area_to_combine
RemoveArea( area_to_combine );
area_ref->m_Poly->RemoveAllContours();
// create area with external contour
for( int ic = 0; ic<union_gpc->num_contours; ic++ )
// Recreate the area_to_combine if a second polygon exists
// if not exists , the first poly contains the 2 initial polygons
#if 0 // TestAreaIntersection must be called before combine areas, so
// 2 intersecting areas are expected, and only one outline contour after combining areas
else
{
if( !(union_gpc->hole)[ic] )
area_to_combine->m_Poly->RemoveAllContours();
keep_area_to_combine = true;
// create area with external contour: Recreate only area edges, NOT holes (todo..)
{
// external contour, replace this poly
for( int i = 0; i<union_gpc->contour[ic].num_vertices; i++ )
// foreach point in the polygon
bool first = true;
while( booleng->PolygonHasMorePoints() )
{
int x = (int) ( (union_gpc->contour)[ic].vertex )[i].x;
int y = (int) ( (union_gpc->contour)[ic].vertex )[i].y;
if( i==0 )
int x = booleng->GetPolygonXPoint();
int y = booleng->GetPolygonYPoint();
if( first )
{
area_ref->m_Poly->Start( area_ref->GetLayer(
), x, y, area_ref->m_Poly->GetHatchStyle() );
first = false;
area_to_combine->m_Poly->Start( area_ref->GetLayer(
), x, y, area_ref->m_Poly->GetHatchStyle() );
}
else
area_ref->m_Poly->AppendCorner( x, y );
area_to_combine->m_Poly->AppendCorner( x, y );
}
area_ref->m_Poly->Close();
booleng->EndPolygonGet();
area_to_combine->m_Poly->Close();
}
}
#endif
// add holes
for( int ic = 0; ic<union_gpc->num_contours; ic++ )
while( booleng->StartPolygonGet() )
{
if( (union_gpc->hole)[ic] )
if( booleng->GetPolygonPointEdgeType() != KB_INSIDE_EDGE )
{
// hole
for( int i = 0; i<union_gpc->contour[ic].num_vertices; i++ )
{
int x = (int) ( (union_gpc->contour)[ic].vertex )[i].x;
int y = (int) ( (union_gpc->contour)[ic].vertex )[i].y;
area_ref->m_Poly->AppendCorner( x, y );
}
area_ref->m_Poly->Close();
DisplayError( NULL,
wxT( "BOARD::CombineAreas() error: unexpected outside contour descriptor" ) );
continue;
}
while( booleng->PolygonHasMorePoints() )
{
int x = booleng->GetPolygonXPoint();
int y = booleng->GetPolygonYPoint();
area_ref->m_Poly->AppendCorner( x, y );
}
area_ref->m_Poly->Close();
booleng->EndPolygonGet();
}
if( !keep_area_to_combine )
RemoveArea( area_to_combine );
area_ref->utility = 1;
area_ref->m_Poly->RestoreArcs( &arc_array1 );
area_ref->m_Poly->RestoreArcs( &arc_array2 );
area_ref->m_Poly->Draw();
gpc_free_polygon( union_gpc );
delete union_gpc;
delete booleng;
return 1;
#endif
#ifdef USE_GPL_POLY_LIB
//@todo
#warning work in progress
wxString msg;
int n_ext_cont1 = poly1->GetPhpPoly()->m_cnt;
int n_ext_cont2 = poly2->GetPhpPoly()->m_cnt;
polygon* union_polygon = NULL;
union_polygon = poly1->GetPhpPoly()->boolean( poly2->GetPhpPoly(), A_OR_B );
if ( union_polygon == NULL )
return 0;
// get number of outside contours
int n_union_ext_cont = union_polygon->m_cnt;
msg.Printf(wxT("cnt res = %d, pts1,2 = %d,%d"), n_union_ext_cont , n_ext_cont1, n_ext_cont2);
wxMessageBox(msg);
// if no intersection, free new gpc and return
#if 0
if( n_union_ext_cont == n_ext_cont1 + n_ext_cont2 )
{
wxMessageBox(wxT("no change polys"));
delete union_polygon;
return 0;
}
#endif
wxMessageBox(wxT("merge areas"));
// intersection, replace area_ref->m_Poly with combined areas and remove area_to_combine
RemoveArea( area_to_combine );
area_ref->m_Poly->RemoveAllContours();
// create area with external contour
// for( int ic = 0; ic < union_polygon->m_cnt; ic++ )
{
// if( !(union_gpc->hole)[ic] ) // Recreate only area edges, NOT holes (todo..)
{
// external contour, replace this poly
vertex * curr_vertex = union_polygon->getFirst();
for( int ii = 0; ii < union_polygon->m_cnt; ii++ )
{
int x = (int) curr_vertex->X();
int y = (int) curr_vertex->Y();
msg.Printf(wxT("ii = %d, pts = %d,%d, wid = %d"), ii , x, y, curr_vertex->id());
wxMessageBox(msg);
if( ii==0 )
{
area_ref->m_Poly->Start( area_ref->GetLayer(
), x, y, area_ref->m_Poly->GetHatchStyle() );
}
else
area_ref->m_Poly->AppendCorner( x, y );
curr_vertex = curr_vertex->Next();
// if( curr_vertex->id() == union_polygon->getFirst()->id() ) break;
}
area_ref->m_Poly->Close();
}
}
// add holes
#if 0
for( int ic = 0; ic<union_gpc->num_contours; ic++ )
{
if( (union_gpc->hole)[ic] )
{
// hole
for( int i = 0; i<union_gpc->contour[ic].num_vertices; i++ )
{
int x = (int) ( (union_gpc->contour)[ic].vertex )[i].x;
int y = (int) ( (union_gpc->contour)[ic].vertex )[i].y;
area_ref->m_Poly->AppendCorner( x, y );
}
area_ref->m_Poly->Close();
}
}
#endif
area_ref->utility = 1;
area_ref->m_Poly->RestoreArcs( &arc_array1 );
area_ref->m_Poly->RestoreArcs( &arc_array2 );
area_ref->m_Poly->Draw();
delete union_polygon;
return 0;
#endif
}
@ -1098,31 +1024,32 @@ int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_E
* @return bool - false if DRC error or true if OK
*/
bool DRC::doEdgeZoneDrc( ZONE_CONTAINER * aArea, int aCornerIndex )
bool DRC::doEdgeZoneDrc( ZONE_CONTAINER* aArea, int aCornerIndex )
{
wxString str;
wxPoint start = aArea->GetCornerPosition(aCornerIndex);
wxPoint end;
// Search the end point of the edge starting at aCornerIndex
if( aArea->m_Poly->corner[aCornerIndex].end_contour == FALSE &&
aCornerIndex < (aArea->GetNumCorners() - 1) )
{
end = aArea->GetCornerPosition(aCornerIndex+1);
}
else // aCornerIndex is the last corner of an outline.
// the corresponding end point of the segment is the first corner of the outline
{
int ii = aCornerIndex-1;
end = aArea->GetCornerPosition(ii);
while ( ii >= 0 )
{
if ( aArea->m_Poly->corner[ii].end_contour )
break;
end = aArea->GetCornerPosition(ii);
ii--;
}
}
wxPoint start = aArea->GetCornerPosition( aCornerIndex );
wxPoint end;
// Search the end point of the edge starting at aCornerIndex
if( aArea->m_Poly->corner[aCornerIndex].end_contour == FALSE
&& aCornerIndex < (aArea->GetNumCorners() - 1) )
{
end = aArea->GetCornerPosition( aCornerIndex + 1 );
}
else // aCornerIndex is the last corner of an outline.
// the corresponding end point of the segment is the first corner of the outline
{
int ii = aCornerIndex - 1;
end = aArea->GetCornerPosition( ii );
while( ii >= 0 )
{
if( aArea->m_Poly->corner[ii].end_contour )
break;
end = aArea->GetCornerPosition( ii );
ii--;
}
}
// iterate through all areas
for( int ia2 = 0; ia2 < m_pcb->GetAreaCount(); ia2++ )
@ -1134,7 +1061,7 @@ bool DRC::doEdgeZoneDrc( ZONE_CONTAINER * aArea, int aCornerIndex )
continue;
// Test for same net
if( (aArea->GetNet() == Area_To_Test->GetNet()) && (aArea->GetNet() > 0) )
if( ( aArea->GetNet() == Area_To_Test->GetNet() ) && (aArea->GetNet() > 0) )
continue;
// test for ending line inside Area_To_Test
@ -1188,11 +1115,11 @@ bool DRC::doEdgeZoneDrc( ZONE_CONTAINER * aArea, int aCornerIndex )
m_currentMarker = fillMarker( aArea, wxPoint( x, y ),
COPPERAREA_CLOSE_TO_COPPERAREA,
m_currentMarker );
return false;
return false;
}
}
}
}
return true;
return true;
}

View File

@ -1,8 +1,5 @@
set(POLYGON_SRCS
GenericPolygonClipperLibrary.cpp
math_for_graphics.cpp
php_polygon.cpp
php_polygon_vertex.cpp
PolyLine.cpp)
add_library(polygon ${POLYGON_SRCS})

File diff suppressed because it is too large Load Diff

View File

@ -1,133 +0,0 @@
/*
===========================================================================
Project: Generic Polygon Clipper
A new algorithm for calculating the difference, intersection,
exclusive-or or union of arbitrary polygon sets.
File: gpc.h
Author: Alan Murta (email: gpc@cs.man.ac.uk)
Version: 2.32
Date: 17th December 2004
Copyright: (C) Advanced Interfaces Group,
University of Manchester.
This software is free for non-commercial use. It may be copied,
modified, and redistributed provided that this copyright notice
is preserved on all copies. The intellectual property rights of
the algorithms used reside with the University of Manchester
Advanced Interfaces Group.
You may not use this software, in whole or in part, in support
of any commercial product without the express consent of the
author.
There is no warranty or other guarantee of fitness of this
software for any purpose. It is provided solely "as is".
===========================================================================
*/
#ifndef __gpc_h
#define __gpc_h
#include <stdio.h>
/*
===========================================================================
Constants
===========================================================================
*/
/* Increase GPC_EPSILON to encourage merging of near coincident edges */
#define GPC_EPSILON (DBL_EPSILON)
#define GPC_VERSION "2.32"
/*
===========================================================================
Public Data Types
===========================================================================
*/
typedef enum /* Set operation type */
{
GPC_DIFF, /* Difference */
GPC_INT, /* Intersection */
GPC_XOR, /* Exclusive or */
GPC_UNION /* Union */
} gpc_op;
typedef struct /* Polygon vertex structure */
{
double x; /* Vertex x component */
double y; /* vertex y component */
} gpc_vertex;
typedef struct /* Vertex list structure */
{
int num_vertices; /* Number of vertices in list */
gpc_vertex *vertex; /* Vertex array pointer */
} gpc_vertex_list;
typedef struct /* Polygon set structure */
{
int num_contours; /* Number of contours in polygon */
int *hole; /* Hole / external contour flags */
gpc_vertex_list *contour; /* Contour array pointer */
} gpc_polygon;
typedef struct /* Tristrip set structure */
{
int num_strips; /* Number of tristrips */
gpc_vertex_list *strip; /* Tristrip array pointer */
} gpc_tristrip;
/*
===========================================================================
Public Function Prototypes
===========================================================================
*/
void gpc_read_polygon (FILE *infile_ptr,
int read_hole_flags,
gpc_polygon *polygon);
void gpc_write_polygon (FILE *outfile_ptr,
int write_hole_flags,
gpc_polygon *polygon);
void gpc_add_contour (gpc_polygon *polygon,
gpc_vertex_list *contour,
int hole);
void gpc_polygon_clip (gpc_op set_operation,
gpc_polygon *subject_polygon,
gpc_polygon *clip_polygon,
gpc_polygon *result_polygon);
void gpc_tristrip_clip (gpc_op set_operation,
gpc_polygon *subject_polygon,
gpc_polygon *clip_polygon,
gpc_tristrip *result_tristrip);
void gpc_polygon_to_tristrip (gpc_polygon *polygon,
gpc_tristrip *tristrip);
void gpc_free_polygon (gpc_polygon *polygon);
void gpc_free_tristrip (gpc_tristrip *tristrip);
#endif
/*
===========================================================================
End of file: gpc.h
===========================================================================
*/

Some files were not shown because too many files have changed in this diff Show More