Commit 44743723 authored by charras's avatar charras

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

removed GPC library due to its unacceptable license. Using the great and powerfull kbool library insteed
parent e3b63f83
......@@ -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)
......
# 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
......@@ -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>
================================================================================
......
......@@ -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 );
}
......
/************************************************************************/
/* 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 units 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 units internes de la valeur val exprime 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);
}
/****************************************************/
/* 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 );
}
......@@ -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)
......@@ -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
......
......@@ -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)
......@@ -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
;
......
This diff is collapsed.
......@@ -329,6 +329,8 @@ public:
~WinEDA_PcbFrame();
void GetKicadAbout( wxCommandEvent& event );
// Configurations:
void InstallConfigFrame( const wxPoint& pos );
void Process_Config( wxCommandEvent& event );
......
No preview for this file type
This diff is collapsed.
......@@ -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
......
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
......
......@@ -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)
......
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
......
......@@ -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:
......
......@@ -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 );
}
This diff is collapsed.
set(POLYGON_SRCS
GenericPolygonClipperLibrary.cpp
math_for_graphics.cpp
php_polygon.cpp
php_polygon_vertex.cpp
PolyLine.cpp)
add_library(polygon ${POLYGON_SRCS})
This diff is collapsed.
/*
===========================================================================
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
===========================================================================
*/
Generic Polygon Clipper (gpc) Revision History
==============================================
v2.32 17th Dec 2004
---------------------
Fixed occasional memory leak occurring when processing some
degenerate polygon arrangements.
Added explicit type casting to memory allocator in support of
increased code portability.
v2.31 4th Jun 1999
---------------------
Separated edge merging measure based on a user-defined GPC_EPSILON
value from general numeric equality testing and ordering, which now
uses direct arithmetic comparison rather an EPSILON based proximity
test.
Fixed problem with numerical equality test during construction of
local minima and scanbeam tables, leading to occasional crash.
Fixed hole array memory leak in gpc_add_contour.
Fixed uninitialised hole field bug in gpc_polygon_clip result.
v2.30 11th Apr 1999
---------------------
Major re-write.
Minor API change: additional 'hole' array field added to gpc_polygon
datatype to indicate which constituent contours are internal holes,
and which form external boundaries.
Minor API change: additional 'hole' argument to gpc_add_contour
to indicate whether the new contour is a hole or external contour.
Minor API change: additional parameter to gpc_read_polygon and
gpc_write_polygon to indicate whether or not to read or write
contour hole flags.
Fixed NULL pointer bug in add/merge left/right operations.
Fixed numerical problem in intersection table generation.
Fixed zero byte malloc problem.
Fixed problem producing occasional 2 vertex contours.
Added bounding box test optimisations.
Simplified edge bundle creation, detection of scanbeam internal
edge intersections and tristrip scanbeam boundary code.
Renamed 'class' variable to be C++ friendly.
v2.22 17th Oct 1998
---------------------
Re-implemented edge interpolation and intersection calculations
to improve numerical robustness.
Simplified setting of GPC_EPSILON.
v2.21 19th Aug 1998
---------------------
Fixed problem causing occasional incorrect output when processing
self-intersecting polygons (bow-ties etc).
Removed bug which may lead to non-generation of uppermost triangle
in tristrip output.
v2.20 26th May 1998
---------------------
Major re-write.
Added exclusive-or polygon set operation.
Replaced table-based processing of edge intersections with
rule-based system.
Replaced two-pass approach to scanbeam interior processing with
single pass method.
v2.10a 14th May 1998
---------------------
Minor bug-fixes to counter some v2.10 reliability problems.
v2.10 11th May 1998
---------------------
Major re-write.
Incorporated edge bundle processing of AET to overcome coincident
edge problems present in previous releases.
Replaced Vatti's method for processing scanbeam interior regions
with an adapted version of the scanbeam boundary processing
algorithm.
v2.02 16th Apr 1998 (unreleased)
----------------------------------
Fixed internal minimum vertex duplication in gpc_polygon_clip
result.
Improved line intersection code discourage superfluous
intersections near line ends.
Removed limited precision number formatting in gpc_write_polygon.
Modification to allow subject or clip polygon to be reused as the
result in gpc_polygon_clip without memory leakage.
v2.01 23rd Feb 1998
---------------------
Removed bug causing duplicated vertices in output polygon.
Fixed scanbeam table index overrun problem.
v2.00 25th Nov 1997
---------------------
Major re-write.
Replaced temporary horizontal edge work-around (using tilting)
with true horizontal edge handling.
Trapezoidal output replaced by tristrips.
gpc_op constants now feature a `GPC_' prefix.
Data structures now passed by reference to gpc functions.
Replaced AET search by proxy addressing in polygon table.
Eliminated most (all?) coincident vertex / edge crashes.
v1.02 18th Oct 1997 (unreleased)
----------------------------------
Significantly reduced number of mallocs in build_lmt.
Scanbeam table now built using heapsort rather than insertion
sort.
v1.01 12th Oct 1997
---------------------
Fixed memory leak during output polygon build in
gpc_clip_polygon.
Removed superfluous logfile debug code.
Commented out malloc counts.
Added missing horizontal edge tilt-correction code in
gpc_clip_polygon.
v1.00 8th Oct 1997
--------------------
First release.
This diff is collapsed.
This diff is collapsed.
// PolyLine.h ... definition of CPolyLine class
//
// A polyline contains one or more contours, where each contour
// is defined by a list of corners and side-styles
// There may be multiple contours in a polyline.
// The last contour may be open or closed, any others must be closed.
// All of the corners and side-styles are concatenated into 2 arrays,
// separated by setting the end_contour flag of the last corner of
// each contour.
//
// When used for copper areas, the first contour is the outer edge
// of the area, subsequent ones are "holes" in the copper.
#ifndef POLYLINE2KICAD_H
#define POLYLINE2KICAD_H
#define PCBU_PER_MIL 10
#define NM_PER_MIL 10 // 25400
#include "pad_shapes.h"
class CRect {
public:
int left, right, top, bottom;
};
class CPoint {
public:
int x, y;
public:
CPoint(void) { x = y = 0;};
CPoint(int i, int j) { x = i; y = j;};
};
#endif // #ifndef POLYLINE2KICAD_H
/**********************/
/* Some usual defines */
/**********************/
#ifndef DEFS_MACROS_H
#define DEFS_MACROS_H
#ifndef BOOL
#define BOOL bool
#endif
#ifndef FALSE
#define FALSE false
#endif
#ifndef TRUE
#define TRUE true
#endif
#ifndef NULL
#define NULL 0
#endif
#ifndef abs
#define abs(x) (((x) >=0) ? (x) : (-(x)))
#endif
#ifndef min
#define min(x,y) (((x) <= (y)) ? (x) : (y))
#endif
#ifndef max
#define max(x,y) (((x) >= (y)) ? (x) : (y))
#endif
#define TRACE printf
#endif // ifndef DEFS_MACROS_H
PROJECT( kbool )
SUBDIRS( src samples )
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*! \file ../include/../graphlst.h
\author Probably Klaas Holwerda
Copyright: 2001-2004 (C) Probably Klaas Holwerda
Licence: wxWidgets Licence
RCS-ID: $Id: graphlst.h,v 1.1 2005/05/24 19:13:37 titato Exp $
*/
/* @@(#) $Source: /cvsroot/wxart2d/wxArt2D/modules/../include/graphlst.h,v $ $Revision: 1.1 $ $Date: 2005/05/24 19:13:37 $ */
/*
Program GRAPHLST.H
Purpose Implements a list of graphs (header)
Last Update 11-03-1996
*/
#ifndef GRAPHLIST_H
#define GRAPHLIST_H
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface
#endif
#include "../include/booleng.h"
#include "../include/_lnk_itr.h"
#include "../include/graph.h"
class Debug_driver;
class A2DKBOOLDLLEXP GraphList: public DL_List<void*>
{
protected:
Bool_Engine* _GC;
public:
GraphList(Bool_Engine* GC);
GraphList( GraphList* other );
~GraphList();
void MakeOneGraph(Graph *total);
void Prepare(Graph *total);
void MakeRings();
void Correction();
void Simplify( double marge);
void Smoothen( double marge);
void Merge();
void Boolean(BOOL_OP operation, int intersectionRunsMax );
void WriteGraphs();
void WriteGraphsKEY( Bool_Engine* GC );
protected:
void Renumber();
void UnMarkAll();
};
#endif
#ifndef __A2D_KBOOLMOD_H__
#define __A2D_KBOOLMOD_H__
#include "../include/booleng.h"
#include "../include/graph.h"
#include "../include/graphlst.h"
#include "../include/line.h"
#include "../include/link.h"
#include "../include/lpoint.h"
#include "../include/node.h"
#include "../include/record.h"
#include "../include/scanbeam.h"
#endif
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
/*! \file ../include/../lpoint.h
\author Probably Klaas Holwerda
Copyright: 2001-2004 (C) Probably Klaas Holwerda
Licence: wxWidgets Licence
RCS-ID: $Id: lpoint.h,v 1.1 2005/05/24 19:13:37 titato Exp $
*/
/* @@(#) $Source: /cvsroot/wxart2d/wxArt2D/modules/../include/lpoint.h,v $ $Revision: 1.1 $ $Date: 2005/05/24 19:13:37 $ */
/*
Program LPOINT.H
Purpose Definition of GDSII pointtype structure
Last Update 12-12-1995
*/
#ifndef LPOINT_H
#define LPOINT_H
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface
#endif
#include "../include/booleng.h"
class A2DKBOOLDLLEXP LPoint
{
public:
LPoint();
LPoint(B_INT const ,B_INT const);
LPoint(LPoint* const);
void Set(const B_INT,const B_INT);
void Set(const LPoint &);
LPoint GetPoint();
B_INT GetX();
B_INT GetY();
void SetX(B_INT);
void SetY(B_INT);
bool Equal(const LPoint a_point, B_INT Marge );
bool Equal(const B_INT,const B_INT , B_INT Marge);
bool ShorterThan(const LPoint a_point, B_INT marge);
bool ShorterThan(const B_INT X, const B_INT Y, B_INT);
LPoint &operator=(const LPoint &);
LPoint &operator+(const LPoint &);
LPoint &operator-(const LPoint &);
LPoint &operator*(int);
LPoint &operator/(int);
int operator==(const LPoint &) const;
int operator!=(const LPoint &) const;
protected:
B_INT _x;
B_INT _y;
};
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*! \file kbool/include/kbool/valuesvc.h
\author Probably Klaas Holwerda
Copyright: 2001-2004 (C) Probably Klaas Holwerda
Licence: wxWidgets Licence
RCS-ID: $Id: valuesvc.h,v 1.1 2005/05/24 19:13:37 titato Exp $
*/
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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