Commit 7edce2fa authored by Garth Corral's avatar Garth Corral

Merge trunk @ 5266

parents a0e0958c 1aec1f59
...@@ -273,20 +273,15 @@ if( USE_OSX_MAGNIFY_EVENT ) ...@@ -273,20 +273,15 @@ if( USE_OSX_MAGNIFY_EVENT )
endif() endif()
# Allow user to override the default settings for adding images to menu items. By default # By default images in menu items are enabled on all platforms except OSX.
# images in menu items are enabled on all platforms except OSX. This can be over ridden by if( NOT APPLE )
# defining -DUSE_IMAGES_IN_MENUS=ON/OFF to force the preferred behavior. set( USE_IMAGES_IN_MENUS ON CACHE BOOL "Enable images in menus" )
if( NOT DEFINED USE_IMAGES_IN_MENUS )
if( NOT APPLE )
set( USE_IMAGES_IN_MENUS ON )
endif()
else() else()
if( USE_IMAGES_IN_MENUS ) set( USE_IMAGES_IN_MENUS OFF CACHE BOOL "Enable images in menus" )
set( USE_IMAGES_IN_MENUS ON )
endif()
endif() endif()
# KIFACE_SUFFIX is the file extension used for top level program modules which # KIFACE_SUFFIX is the file extension used for top level program modules which
# implement the KIFACE interface. A valid suffix starts with a period '.'. # implement the KIFACE interface. A valid suffix starts with a period '.'.
......
...@@ -130,10 +130,10 @@ In order to have a working Kicad installtion, you need ...@@ -130,10 +130,10 @@ In order to have a working Kicad installtion, you need
- documentation and translations (they are not included in sources) - documentation and translations (they are not included in sources)
product branch: product branch:
bzr branch lp:kicad kicad_src bzr branch https://code.launchpad.net/~kicad-product-committers/kicad kicad_src
Stable branch: Stable branch:
bzr branch lp:kicad/stable kicad_src bzr branch https://code.launchpad.net/~kicad-product-committers/kicad/stable kicad_src
Components and Footprints libraries Components and Footprints libraries
all (schematic libs, 3D shapes ...) but new footprints libraries (use Download zip tool) all (schematic libs, 3D shapes ...) but new footprints libraries (use Download zip tool)
......
...@@ -14,7 +14,7 @@ boost libraries will be downloaded the first time you build Kicad. ...@@ -14,7 +14,7 @@ boost libraries will be downloaded the first time you build Kicad.
CMake CMake
===== =====
KiCad uses CMake to generate the build files specific for the target platform KiCad uses CMake (version 2.12 or later) to generate the build files specific for the target platform
specified by the developer. This document attempts to define some of the more specified by the developer. This document attempts to define some of the more
common CMake and KiCad build configuration settings. You can use CMake either common CMake and KiCad build configuration settings. You can use CMake either
by the command CMake on or the graphical version ccmake. This document only by the command CMake on or the graphical version ccmake. This document only
...@@ -78,24 +78,6 @@ the wxWidgets library. If you wish to use a custom built wxWidgets library, ...@@ -78,24 +78,6 @@ the wxWidgets library. If you wish to use a custom built wxWidgets library,
set wxWidgets_ROOT_DIR to the correct path. set wxWidgets_ROOT_DIR to the correct path.
wxWidgets_USE_DEBUG (ON/OFF)
----------------------------
Default: OFF
When creating a debug build of KiCad, it is often useful to link against the
debug build of the wxWidgets. To use the debug build of wxWidgets, set
wxWidgets_USE_DEBUG to ON.
wxWidgets_USE_UNICODE (ON/OFF)
------------------------------
Default: ON (wxWidgets 2.9 or later), OFF (older versions)
If your platform supports Unicode and you wish to build KiCad with Unicode
support, set wxWidgets_USE_UNICODE to ON. Please note as of the 2.9 branch
this option is not required.
KiCad Specific Options KiCad Specific Options
====================== ======================
...@@ -114,17 +96,6 @@ WARNING: The KiCad developers strongly advise you to build the bundled copy of ...@@ -114,17 +96,6 @@ WARNING: The KiCad developers strongly advise you to build the bundled copy of
the Boost library, as it is known to work with KiCad. Other versions may the Boost library, as it is known to work with KiCad. Other versions may
contain bugs that may result in KiCad errors. contain bugs that may result in KiCad errors.
USE_WX_GRAPHICS_CONTEXT (ON/OFF)
--------------------------------
Default: OFF
This option is *Experimental*. It enables advanced drawing library code using
wxGraphicsContext and should only be used for testing purposes. Under Windows,
a very recent version of mingw is needed. It also requires wxWidgets to be
built with the --enable-graphics_ctx configuration switch.
USE_IMAGES_IN_MENUS (ON/OFF) USE_IMAGES_IN_MENUS (ON/OFF)
---------------------------- ----------------------------
Default: OFF for OSX, ON for other platforms. Default: OFF for OSX, ON for other platforms.
...@@ -147,20 +118,11 @@ to avoid download and building the dependencies multiple times. ...@@ -147,20 +118,11 @@ to avoid download and building the dependencies multiple times.
KICAD_USER_CONFIG_DIR (PATH) KICAD_USER_CONFIG_DIR (PATH)
---------------------------- ----------------------------
Default: Home directory (Unix-based systems), Application data directory (Windows) Default: ~/.config (Unix-based systems), Application data directory (Windows)
This option specifies where to store user-specific configuration information. This option specifies where to store user-specific configuration information.
KICAD_KEEPCASE (ON/OFF)
-----------------------
Default: ON
If this is OFF, component names are automatically converted to uppercase meaning
they are case insensitive. If it is ON, component names are not changed and
are therefore case sensitive.
USE_WX_OVERLAY (ON/OFF) USE_WX_OVERLAY (ON/OFF)
----------------------- -----------------------
Default: ON for OSX, OFF for other platforms. Default: ON for OSX, OFF for other platforms.
...@@ -192,7 +154,7 @@ KICAD_SCRIPTING_WXPYTHON (ON/OFF) ...@@ -192,7 +154,7 @@ KICAD_SCRIPTING_WXPYTHON (ON/OFF)
Default: OFF Default: OFF
This option enables or disables building wxPython support into the KiCad This option enables or disables building wxPython support into the KiCad
scripting support. Currently only Pcbnew is supported. This option requires scripting support. Currently only Pcbnew has scripting support. This option requires
SWIG, Python, and wxPython to be installed on the system. SWIG, Python, and wxPython to be installed on the system.
......
...@@ -103,16 +103,16 @@ install the wxWidgets library into MinGW then enter the following commands: ...@@ -103,16 +103,16 @@ install the wxWidgets library into MinGW then enter the following commands:
#mkdir Release #mkdir Release
#cd Release #cd Release
#../configure --with-opengl #../configure --enable-monolithic=no --enable-shared=yes --with-opengl
#make #make
If you want to install wxWidgets in MinGW then enter the following commands: If you want to install wxWidgets in MinGW then enter the following commands:
#mkdir Release #mkdir Release
#cd Release #cd Release
#../configure --prefix=/mingw --enable-monolithic=no --disable-shared --with-opengl #../configure --prefix=/mingw --enable-monolithic=no --enable-shared=yes --with-opengl
#make && make install #make && make install
wxWidgets will be statically linked to Kicad, which avoid issus with wxWidgets dlls wxWidgets cannot be statically linked to Kicad.
Download the KiCad Source Code Download the KiCad Source Code
------------------------------ ------------------------------
...@@ -126,16 +126,19 @@ Launchpad repository has two branches for KiCad sources: ...@@ -126,16 +126,19 @@ Launchpad repository has two branches for KiCad sources:
near a stable state) near a stable state)
To download the testing branch: To download the testing branch:
#bzr branch lp:kicad kicad_testing #bzr branch https://code.launchpad.net/~kicad-product-committers/kicad kicad_testing
To download the stable branch: To download the stable branch:
#bzr branch lp:kicad/stable kicad_stable #bzr branch https://code.launchpad.net/~kicad-product-committers/kicad/stable kicad_stable
To download the component and footprint libraries To download the component and footprint libraries:
#bzr branch lp:~kicad-lib-committers/kicad/library kicad_libraries (This branch is a bzr/launchpad import of the Git repository
at https://github.com/KiCad/kicad-library.git.
It has schematic parts and 3D models in it.)
#bzr branch https://code.launchpad.net/~kicad-product-committers/kicad/library kicad_libraries
To download the documentation and translation files: To download the documentation and translation files:
#bzr branch lp:~kicad-developers/kicad/doc kicad_doc #bzr branch https://code.launchpad.net/~kicad-developers/kicad/doc kicad_doc
Create Makefiles with CMake Create Makefiles with CMake
--------------------------- ---------------------------
...@@ -219,7 +222,7 @@ Building the Developer Documentation ...@@ -219,7 +222,7 @@ Building the Developer Documentation
------------------------------------ ------------------------------------
To build the HTML developer documentation, run the following commands: To build the HTML developer documentation, run the following commands:
#cd <kicadSource>/build/debug #cd <kicadSource>/build/release
#make doxygen-docs #make doxygen-docs
The documentation will be created in the <kicadSouce>/Documentation/html The documentation will be created in the <kicadSouce>/Documentation/html
......
...@@ -50,13 +50,15 @@ ...@@ -50,13 +50,15 @@
#define KEYWORD_LAST_INPUT_FILE wxT( "Last_input" ) #define KEYWORD_LAST_INPUT_FILE wxT( "Last_input" )
#define KEYWORD_LAST_OUTPUT_FILE wxT( "Last_output" ) #define KEYWORD_LAST_OUTPUT_FILE wxT( "Last_output" )
#define KEYWORD_LAST_FORMAT wxT( "Last_format" ) #define KEYWORD_LAST_FORMAT wxT( "Last_format" )
#define KEYWORD_LAST_MODLAYER wxT( "Last_modlayer" )
#define KEYWORD_BINARY_THRESHOLD wxT( "Threshold" ) #define KEYWORD_BINARY_THRESHOLD wxT( "Threshold" )
#define KEYWORD_BW_NEGATIVE wxT( "Negative_choice" ) #define KEYWORD_BW_NEGATIVE wxT( "Negative_choice" )
#define DEFAULT_DPI 300 // Default resolution in Bit per inches #define DEFAULT_DPI 300 // Default resolution in Bit per inches
extern int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile, extern int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile,
OUTPUT_FMT_ID aFormat, int aDpi_X, int aDpi_Y ); OUTPUT_FMT_ID aFormat, int aDpi_X, int aDpi_Y,
BMP2CMP_MOD_LAYER aModLayer );
/** /**
* Class BM2CMP_FRAME_BASE * Class BM2CMP_FRAME_BASE
...@@ -138,6 +140,7 @@ private: ...@@ -138,6 +140,7 @@ private:
void NegateGreyscaleImage( ); void NegateGreyscaleImage( );
void ExportFile( FILE* aOutfile, OUTPUT_FMT_ID aFormat ); void ExportFile( FILE* aOutfile, OUTPUT_FMT_ID aFormat );
void updateImageInfo(); void updateImageInfo();
void OnFormatChange( wxCommandEvent& event );
}; };
...@@ -169,6 +172,19 @@ BM2CMP_FRAME::BM2CMP_FRAME( KIWAY* aKiway, wxWindow* aParent ) : ...@@ -169,6 +172,19 @@ BM2CMP_FRAME::BM2CMP_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_radioBoxFormat->SetSelection( tmp ); m_radioBoxFormat->SetSelection( tmp );
} }
if( tmp == PCBNEW_KICAD_MOD )
m_radio_PCBLayer->Enable( true );
else
m_radio_PCBLayer->Enable( false );
if( m_config->Read( KEYWORD_LAST_MODLAYER, &tmp ) )
{
if( (unsigned) tmp > MOD_LYR_FINAL ) // Out of range
m_radio_PCBLayer->SetSelection( MOD_LYR_FSILKS );
else
m_radio_PCBLayer->SetSelection( tmp );
}
// Give an icon // Give an icon
wxIcon icon; wxIcon icon;
icon.CopyFromBitmap( KiBitmap( icon_bitmap2component_xpm ) ); icon.CopyFromBitmap( KiBitmap( icon_bitmap2component_xpm ) );
...@@ -204,6 +220,7 @@ BM2CMP_FRAME::~BM2CMP_FRAME() ...@@ -204,6 +220,7 @@ BM2CMP_FRAME::~BM2CMP_FRAME()
m_config->Write( KEYWORD_BINARY_THRESHOLD, m_sliderThreshold->GetValue() ); m_config->Write( KEYWORD_BINARY_THRESHOLD, m_sliderThreshold->GetValue() );
m_config->Write( KEYWORD_BW_NEGATIVE, m_rbOptions->GetSelection() ); m_config->Write( KEYWORD_BW_NEGATIVE, m_rbOptions->GetSelection() );
m_config->Write( KEYWORD_LAST_FORMAT, m_radioBoxFormat->GetSelection() ); m_config->Write( KEYWORD_LAST_FORMAT, m_radioBoxFormat->GetSelection() );
m_config->Write( KEYWORD_LAST_MODLAYER, m_radio_PCBLayer->GetSelection() );
delete m_config; delete m_config;
...@@ -628,7 +645,14 @@ void BM2CMP_FRAME::ExportFile( FILE* aOutfile, OUTPUT_FMT_ID aFormat ) ...@@ -628,7 +645,14 @@ void BM2CMP_FRAME::ExportFile( FILE* aOutfile, OUTPUT_FMT_ID aFormat )
} }
} }
bitmap2component( potrace_bitmap, aOutfile, aFormat, m_imageDPI.x, m_imageDPI.y ); // choices of m_radio_PCBLayer are expected to be in same order as
// BMP2CMP_MOD_LAYER. See bitmap2component.h
BMP2CMP_MOD_LAYER modLayer = MOD_LYR_FSILKS;
if( aFormat == PCBNEW_KICAD_MOD )
modLayer = (BMP2CMP_MOD_LAYER) m_radio_PCBLayer->GetSelection();
bitmap2component( potrace_bitmap, aOutfile, aFormat, m_imageDPI.x, m_imageDPI.y, modLayer );
} }
...@@ -711,3 +735,12 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits ) ...@@ -711,3 +735,12 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
return start_common( aCtlBits ); return start_common( aCtlBits );
} }
void BM2CMP_FRAME::OnFormatChange( wxCommandEvent& event )
{
if( m_radioBoxFormat->GetSelection() == PCBNEW_KICAD_MOD )
m_radio_PCBLayer->Enable( true );
else
m_radio_PCBLayer->Enable( false );
event.Skip();
}
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 6 2013) // C++ code generated with wxFormBuilder (version Jun 5 2014)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -16,22 +16,22 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS ...@@ -16,22 +16,22 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS
wxBoxSizer* bMainSizer; wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxHORIZONTAL ); bMainSizer = new wxBoxSizer( wxHORIZONTAL );
m_notebook1 = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); m_Notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_InitialPicturePanel = new wxScrolledWindow( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); m_InitialPicturePanel = new wxScrolledWindow( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
m_InitialPicturePanel->SetScrollRate( 5, 5 ); m_InitialPicturePanel->SetScrollRate( 5, 5 );
m_InitialPicturePanel->SetMinSize( wxSize( 400,300 ) ); m_InitialPicturePanel->SetMinSize( wxSize( 400,300 ) );
m_notebook1->AddPage( m_InitialPicturePanel, _("Original Picture"), true ); m_Notebook->AddPage( m_InitialPicturePanel, _("Original Picture"), true );
m_GreyscalePicturePanel = new wxScrolledWindow( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); m_GreyscalePicturePanel = new wxScrolledWindow( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
m_GreyscalePicturePanel->SetScrollRate( 5, 5 ); m_GreyscalePicturePanel->SetScrollRate( 5, 5 );
m_GreyscalePicturePanel->SetMinSize( wxSize( 400,300 ) ); m_GreyscalePicturePanel->SetMinSize( wxSize( 400,300 ) );
m_notebook1->AddPage( m_GreyscalePicturePanel, _("Greyscale Picture"), false ); m_Notebook->AddPage( m_GreyscalePicturePanel, _("Greyscale Picture"), false );
m_BNPicturePanel = new wxScrolledWindow( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); m_BNPicturePanel = new wxScrolledWindow( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
m_BNPicturePanel->SetScrollRate( 5, 5 ); m_BNPicturePanel->SetScrollRate( 5, 5 );
m_notebook1->AddPage( m_BNPicturePanel, _("Black&&White Picture"), false ); m_Notebook->AddPage( m_BNPicturePanel, _("Black&&White Picture"), false );
bMainSizer->Add( m_notebook1, 1, wxEXPAND, 5 ); bMainSizer->Add( m_Notebook, 1, wxEXPAND, 5 );
m_panelRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panelRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* brightSizer; wxBoxSizer* brightSizer;
...@@ -147,6 +147,14 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS ...@@ -147,6 +147,14 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS
brightSizer->Add( m_sliderThreshold, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); brightSizer->Add( m_sliderThreshold, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxString m_radio_PCBLayerChoices[] = { _("Front silk screen"), _("Front solder mask"), _("User layer Eco1"), _("User Layer Eco2") };
int m_radio_PCBLayerNChoices = sizeof( m_radio_PCBLayerChoices ) / sizeof( wxString );
m_radio_PCBLayer = new wxRadioBox( m_panelRight, wxID_ANY, _("Board Layer for Outline:"), wxDefaultPosition, wxDefaultSize, m_radio_PCBLayerNChoices, m_radio_PCBLayerChoices, 1, wxRA_SPECIFY_COLS );
m_radio_PCBLayer->SetSelection( 0 );
m_radio_PCBLayer->SetToolTip( _("Choose the board layer to place the outline.\nThe 2 invisible fields reference and value and always placed on the silk screen layer.") );
brightSizer->Add( m_radio_PCBLayer, 0, wxALL|wxEXPAND, 5 );
m_panelRight->SetSizer( brightSizer ); m_panelRight->SetSizer( brightSizer );
m_panelRight->Layout(); m_panelRight->Layout();
...@@ -168,6 +176,7 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS ...@@ -168,6 +176,7 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS
m_DPIValueY->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnResolutionChange ), NULL, this ); m_DPIValueY->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnResolutionChange ), NULL, this );
m_buttonLoad->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnLoadFile ), NULL, this ); m_buttonLoad->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnLoadFile ), NULL, this );
m_buttonExport->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnExport ), NULL, this ); m_buttonExport->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnExport ), NULL, this );
m_radioBoxFormat->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnFormatChange ), NULL, this );
m_rbOptions->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnOptionsSelection ), NULL, this ); m_rbOptions->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnOptionsSelection ), NULL, this );
m_sliderThreshold->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( BM2CMP_FRAME_BASE::OnThresholdChange ), NULL, this ); m_sliderThreshold->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( BM2CMP_FRAME_BASE::OnThresholdChange ), NULL, this );
} }
...@@ -184,6 +193,7 @@ BM2CMP_FRAME_BASE::~BM2CMP_FRAME_BASE() ...@@ -184,6 +193,7 @@ BM2CMP_FRAME_BASE::~BM2CMP_FRAME_BASE()
m_DPIValueY->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnResolutionChange ), NULL, this ); m_DPIValueY->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnResolutionChange ), NULL, this );
m_buttonLoad->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnLoadFile ), NULL, this ); m_buttonLoad->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnLoadFile ), NULL, this );
m_buttonExport->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnExport ), NULL, this ); m_buttonExport->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnExport ), NULL, this );
m_radioBoxFormat->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnFormatChange ), NULL, this );
m_rbOptions->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnOptionsSelection ), NULL, this ); m_rbOptions->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnOptionsSelection ), NULL, this );
m_sliderThreshold->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( BM2CMP_FRAME_BASE::OnThresholdChange ), NULL, this ); m_sliderThreshold->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( BM2CMP_FRAME_BASE::OnThresholdChange ), NULL, this );
......
This diff is collapsed.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 6 2013) // C++ code generated with wxFormBuilder (version Jun 5 2014)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -46,7 +46,7 @@ class BM2CMP_FRAME_BASE : public KIWAY_PLAYER ...@@ -46,7 +46,7 @@ class BM2CMP_FRAME_BASE : public KIWAY_PLAYER
private: private:
protected: protected:
wxNotebook* m_notebook1; wxNotebook* m_Notebook;
wxScrolledWindow* m_InitialPicturePanel; wxScrolledWindow* m_InitialPicturePanel;
wxScrolledWindow* m_GreyscalePicturePanel; wxScrolledWindow* m_GreyscalePicturePanel;
wxScrolledWindow* m_BNPicturePanel; wxScrolledWindow* m_BNPicturePanel;
...@@ -72,6 +72,7 @@ class BM2CMP_FRAME_BASE : public KIWAY_PLAYER ...@@ -72,6 +72,7 @@ class BM2CMP_FRAME_BASE : public KIWAY_PLAYER
wxRadioBox* m_rbOptions; wxRadioBox* m_rbOptions;
wxStaticText* m_ThresholdText; wxStaticText* m_ThresholdText;
wxSlider* m_sliderThreshold; wxSlider* m_sliderThreshold;
wxRadioBox* m_radio_PCBLayer;
wxStatusBar* m_statusBar; wxStatusBar* m_statusBar;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
...@@ -81,13 +82,14 @@ class BM2CMP_FRAME_BASE : public KIWAY_PLAYER ...@@ -81,13 +82,14 @@ class BM2CMP_FRAME_BASE : public KIWAY_PLAYER
virtual void UpdatePPITextValueY( wxMouseEvent& event ) { event.Skip(); } virtual void UpdatePPITextValueY( wxMouseEvent& event ) { event.Skip(); }
virtual void OnLoadFile( wxCommandEvent& event ) { event.Skip(); } virtual void OnLoadFile( wxCommandEvent& event ) { event.Skip(); }
virtual void OnExport( wxCommandEvent& event ) { event.Skip(); } virtual void OnExport( wxCommandEvent& event ) { event.Skip(); }
virtual void OnFormatChange( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOptionsSelection( wxCommandEvent& event ) { event.Skip(); } virtual void OnOptionsSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void OnThresholdChange( wxScrollEvent& event ) { event.Skip(); } virtual void OnThresholdChange( wxScrollEvent& event ) { event.Skip(); }
public: public:
BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Bitmap to Component Converter"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 527,470 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL ); BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Bitmap to Component Converter"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 733,634 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
~BM2CMP_FRAME_BASE(); ~BM2CMP_FRAME_BASE();
......
...@@ -86,7 +86,7 @@ public: ...@@ -86,7 +86,7 @@ public:
* Creates the output file specified by m_Outfile, * Creates the output file specified by m_Outfile,
* depending on file format given by m_Format * depending on file format given by m_Format
*/ */
void CreateOutputFile(); void CreateOutputFile( BMP2CMP_MOD_LAYER aModLayer = (BMP2CMP_MOD_LAYER) 0 );
private: private:
...@@ -94,7 +94,7 @@ private: ...@@ -94,7 +94,7 @@ private:
* Function OuputFileHeader * Function OuputFileHeader
* write to file the header depending on file format * write to file the header depending on file format
*/ */
void OuputFileHeader(); void OuputFileHeader( const char * aBrdLayerName );
/** /**
* Function OuputFileEnd * Function OuputFileEnd
...@@ -103,12 +103,18 @@ private: ...@@ -103,12 +103,18 @@ private:
void OuputFileEnd(); void OuputFileEnd();
/**
* @return the board layer name depending on the board layer selected
* @param aChoice = the choice (MOD_LYR_FSILKS to MOD_LYR_FINAL)
*/
const char * getBrdLayerName( BMP2CMP_MOD_LAYER aChoice );
/** /**
* Function OuputOnePolygon * Function OuputOnePolygon
* write one polygon to output file. * write one polygon to output file.
* Polygon coordinates are expected scaled by the polugon extraction function * Polygon coordinates are expected scaled by the polugon extraction function
*/ */
void OuputOnePolygon( KPolygon & aPolygon ); void OuputOnePolygon( KPolygon & aPolygon, const char * aBrdLayerName );
}; };
...@@ -133,7 +139,8 @@ BITMAPCONV_INFO::BITMAPCONV_INFO() ...@@ -133,7 +139,8 @@ BITMAPCONV_INFO::BITMAPCONV_INFO()
int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile, int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile,
OUTPUT_FMT_ID aFormat, int aDpi_X, int aDpi_Y ) OUTPUT_FMT_ID aFormat, int aDpi_X, int aDpi_Y,
BMP2CMP_MOD_LAYER aModLayer )
{ {
potrace_param_t* param; potrace_param_t* param;
potrace_state_t* st; potrace_state_t* st;
...@@ -189,7 +196,7 @@ int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile, ...@@ -189,7 +196,7 @@ int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile,
info.m_Format = PCBNEW_KICAD_MOD; info.m_Format = PCBNEW_KICAD_MOD;
info.m_ScaleX = 1e6 * 25.4 / aDpi_X; // the conversion scale from PPI to UI info.m_ScaleX = 1e6 * 25.4 / aDpi_X; // the conversion scale from PPI to UI
info.m_ScaleY = 1e6 * 25.4 / aDpi_Y; // Y axis is top to bottom in modedit info.m_ScaleY = 1e6 * 25.4 / aDpi_Y; // Y axis is top to bottom in modedit
info.CreateOutputFile(); info.CreateOutputFile( aModLayer );
break; break;
default: default:
...@@ -204,8 +211,33 @@ int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile, ...@@ -204,8 +211,33 @@ int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile,
return 0; return 0;
} }
const char* BITMAPCONV_INFO::getBrdLayerName( BMP2CMP_MOD_LAYER aChoice )
{
const char * layerName = "F.SilkS";
switch( aChoice )
{
case MOD_LYR_FSOLDERMASK:
layerName = "F.Mask";
break;
case MOD_LYR_ECO1:
layerName = "Eco1.User";
break;
case MOD_LYR_ECO2:
layerName = "Eco2.User";
break;
case MOD_LYR_FSILKS:
default: // case MOD_LYR_FSILKS only unless there is a bug
break;
}
return layerName;
}
void BITMAPCONV_INFO::OuputFileHeader() void BITMAPCONV_INFO::OuputFileHeader( const char * aBrdLayerName )
{ {
int Ypos = (int) ( m_PixmapHeight / 2 * m_ScaleY ); int Ypos = (int) ( m_PixmapHeight / 2 * m_ScaleY );
int fieldSize; // fields text size = 60 mils int fieldSize; // fields text size = 60 mils
...@@ -225,11 +257,10 @@ void BITMAPCONV_INFO::OuputFileHeader() ...@@ -225,11 +257,10 @@ void BITMAPCONV_INFO::OuputFileHeader()
// fields text thickness = 1.5 / 5 = 0.3mm // fields text thickness = 1.5 / 5 = 0.3mm
fprintf( m_Outfile, "(module %s (layer F.Cu)\n (at 0 0)\n", fprintf( m_Outfile, "(module %s (layer F.Cu)\n (at 0 0)\n",
m_CmpName ); m_CmpName );
fprintf( m_Outfile, " (fp_text reference \"G***\" (at 0 0) (layer F.SilkS) hide\n" fprintf( m_Outfile, " (fp_text reference \"G***\" (at 0 0) (layer %s) hide\n"
" (effects (font (thickness 0.3)))\n )\n" ); " (effects (font (thickness 0.3)))\n )\n", aBrdLayerName );
fprintf( m_Outfile, " (fp_text value \"%s\" (at 0.75 0) (layer F.SilkS) hide\n" fprintf( m_Outfile, " (fp_text value \"%s\" (at 0.75 0) (layer %s) hide\n"
" (effects (font (thickness 0.3)))\n )\n", " (effects (font (thickness 0.3)))\n )\n", m_CmpName, aBrdLayerName );
m_CmpName );
break; break;
case KICAD_LOGO: case KICAD_LOGO:
...@@ -283,7 +314,7 @@ void BITMAPCONV_INFO::OuputFileEnd() ...@@ -283,7 +314,7 @@ void BITMAPCONV_INFO::OuputFileEnd()
* write one polygon to output file. * write one polygon to output file.
* Polygon coordinates are expected scaled by the polygon extraction function * Polygon coordinates are expected scaled by the polygon extraction function
*/ */
void BITMAPCONV_INFO::OuputOnePolygon( KPolygon & aPolygon ) void BITMAPCONV_INFO::OuputOnePolygon( KPolygon & aPolygon, const char * aBrdLayerName )
{ {
unsigned ii, jj; unsigned ii, jj;
KPolyPoint currpoint; KPolyPoint currpoint;
...@@ -338,7 +369,9 @@ void BITMAPCONV_INFO::OuputOnePolygon( KPolygon & aPolygon ) ...@@ -338,7 +369,9 @@ void BITMAPCONV_INFO::OuputOnePolygon( KPolygon & aPolygon )
// Close polygon // Close polygon
fprintf( m_Outfile, " (xy %f %f) )", fprintf( m_Outfile, " (xy %f %f) )",
(startpoint.x() - offsetX) / 1e6, (startpoint.y() - offsetY) / 1e6 ); (startpoint.x() - offsetX) / 1e6, (startpoint.y() - offsetY) / 1e6 );
fprintf( m_Outfile, "(layer F.SilkS) (width %f)\n )\n", width );
fprintf( m_Outfile, "(layer %s) (width %f)\n )\n", aBrdLayerName, width );
} }
break; break;
...@@ -383,7 +416,7 @@ void BITMAPCONV_INFO::OuputOnePolygon( KPolygon & aPolygon ) ...@@ -383,7 +416,7 @@ void BITMAPCONV_INFO::OuputOnePolygon( KPolygon & aPolygon )
} }
void BITMAPCONV_INFO::CreateOutputFile() void BITMAPCONV_INFO::CreateOutputFile( BMP2CMP_MOD_LAYER aModLayer )
{ {
KPolyPoint currpoint; KPolyPoint currpoint;
...@@ -400,7 +433,10 @@ void BITMAPCONV_INFO::CreateOutputFile() ...@@ -400,7 +433,10 @@ void BITMAPCONV_INFO::CreateOutputFile()
setlocale( LC_NUMERIC, "C" ); // Switch the locale to standard C setlocale( LC_NUMERIC, "C" ); // Switch the locale to standard C
OuputFileHeader(); // The layer name has meaning only for .kicad_mod files.
// For these files the header creates 2 invisible texts: value and ref
// (needed but not usefull) on silk screen layer
OuputFileHeader( getBrdLayerName( MOD_LYR_FSILKS ) );
bool main_outline = true; bool main_outline = true;
...@@ -477,7 +513,7 @@ void BITMAPCONV_INFO::CreateOutputFile() ...@@ -477,7 +513,7 @@ void BITMAPCONV_INFO::CreateOutputFile()
for( unsigned ii = 0; ii < polyset_areas.size(); ii++ ) for( unsigned ii = 0; ii < polyset_areas.size(); ii++ )
{ {
KPolygon& poly = polyset_areas[ii]; KPolygon& poly = polyset_areas[ii];
OuputOnePolygon(poly ); OuputOnePolygon(poly, getBrdLayerName( aModLayer ) );
} }
polyset_areas.clear(); polyset_areas.clear();
......
...@@ -35,4 +35,13 @@ enum OUTPUT_FMT_ID ...@@ -35,4 +35,13 @@ enum OUTPUT_FMT_ID
FINAL_FMT = KICAD_LOGO FINAL_FMT = KICAD_LOGO
}; };
enum BMP2CMP_MOD_LAYER
{
MOD_LYR_FSILKS = 0,
MOD_LYR_FSOLDERMASK,
MOD_LYR_ECO1,
MOD_LYR_ECO2,
MOD_LYR_FINAL = MOD_LYR_ECO2
};
#endif // BITMAP2COMPONENT_H #endif // BITMAP2COMPONENT_H
...@@ -47,7 +47,6 @@ COMPONENTS_LISTBOX::~COMPONENTS_LISTBOX() ...@@ -47,7 +47,6 @@ COMPONENTS_LISTBOX::~COMPONENTS_LISTBOX()
BEGIN_EVENT_TABLE( COMPONENTS_LISTBOX, ITEMS_LISTBOX_BASE ) BEGIN_EVENT_TABLE( COMPONENTS_LISTBOX, ITEMS_LISTBOX_BASE )
EVT_SIZE( ITEMS_LISTBOX_BASE::OnSize )
EVT_CHAR( COMPONENTS_LISTBOX::OnChar ) EVT_CHAR( COMPONENTS_LISTBOX::OnChar )
EVT_LIST_ITEM_SELECTED( ID_CVPCB_COMPONENT_LIST, COMPONENTS_LISTBOX::OnSelectComponent ) EVT_LIST_ITEM_SELECTED( ID_CVPCB_COMPONENT_LIST, COMPONENTS_LISTBOX::OnSelectComponent )
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -72,14 +71,19 @@ void COMPONENTS_LISTBOX::SetString( unsigned linecount, const wxString& text ) ...@@ -72,14 +71,19 @@ void COMPONENTS_LISTBOX::SetString( unsigned linecount, const wxString& text )
linecount = m_ComponentList.Count() - 1; linecount = m_ComponentList.Count() - 1;
if( m_ComponentList.Count() > 0 ) if( m_ComponentList.Count() > 0 )
{
m_ComponentList[linecount] = text; m_ComponentList[linecount] = text;
UpdateWidth( linecount );
}
} }
void COMPONENTS_LISTBOX::AppendLine( const wxString& text ) void COMPONENTS_LISTBOX::AppendLine( const wxString& text )
{ {
m_ComponentList.Add( text ); m_ComponentList.Add( text );
SetItemCount( m_ComponentList.Count() ); int lines = m_ComponentList.Count();
SetItemCount( lines );
UpdateWidth( lines - 1 );
} }
......
...@@ -67,6 +67,7 @@ void FOOTPRINTS_LISTBOX::SetString( unsigned linecount, const wxString& text ) ...@@ -67,6 +67,7 @@ void FOOTPRINTS_LISTBOX::SetString( unsigned linecount, const wxString& text )
linecount = count - 1; linecount = count - 1;
m_footprintList[linecount] = text; m_footprintList[linecount] = text;
} }
UpdateWidth( linecount );
} }
...@@ -90,7 +91,9 @@ wxString FOOTPRINTS_LISTBOX::GetSelectedFootprint() ...@@ -90,7 +91,9 @@ wxString FOOTPRINTS_LISTBOX::GetSelectedFootprint()
void FOOTPRINTS_LISTBOX::AppendLine( const wxString& text ) void FOOTPRINTS_LISTBOX::AppendLine( const wxString& text )
{ {
m_footprintList.Add( text ); m_footprintList.Add( text );
SetItemCount( m_footprintList.Count() ); int lines = m_footprintList.Count();
SetItemCount( lines );
UpdateWidth( lines - 1 );
} }
...@@ -179,24 +182,12 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a ...@@ -179,24 +182,12 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a
SetItemCount( m_footprintList.GetCount() ); SetItemCount( m_footprintList.GetCount() );
SetSelection( selection, true ); SetSelection( selection, true );
RefreshItems( 0L, m_footprintList.GetCount()-1 ); RefreshItems( 0L, m_footprintList.GetCount()-1 );
UpdateWidth();
#if defined (__WXGTK__ ) //&& wxMINOR_VERSION == 8
// @bug On GTK and wxWidgets 2.8.x, this will assert in debug builds because the
// column parameter is -1. This was the only way to prevent GTK3 from
// ellipsizing long strings down to a few characters. It still doesn't set
// the scroll bars correctly (too short) but it's better than any of the
// other alternatives. If someone knows how to fix this, please do.
SetColumnWidth( -1, wxLIST_AUTOSIZE );
#else
SetColumnWidth( 0, wxLIST_AUTOSIZE );
#endif
} }
} }
BEGIN_EVENT_TABLE( FOOTPRINTS_LISTBOX, ITEMS_LISTBOX_BASE ) BEGIN_EVENT_TABLE( FOOTPRINTS_LISTBOX, ITEMS_LISTBOX_BASE )
EVT_SIZE( ITEMS_LISTBOX_BASE::OnSize )
EVT_CHAR( FOOTPRINTS_LISTBOX::OnChar ) EVT_CHAR( FOOTPRINTS_LISTBOX::OnChar )
EVT_LIST_ITEM_SELECTED( ID_CVPCB_FOOTPRINT_LIST, FOOTPRINTS_LISTBOX::OnLeftClick ) EVT_LIST_ITEM_SELECTED( ID_CVPCB_FOOTPRINT_LIST, FOOTPRINTS_LISTBOX::OnLeftClick )
EVT_LIST_ITEM_ACTIVATED( ID_CVPCB_FOOTPRINT_LIST, FOOTPRINTS_LISTBOX::OnLeftDClick ) EVT_LIST_ITEM_ACTIVATED( ID_CVPCB_FOOTPRINT_LIST, FOOTPRINTS_LISTBOX::OnLeftDClick )
......
...@@ -66,6 +66,7 @@ void LIBRARY_LISTBOX::SetString( unsigned linecount, const wxString& text ) ...@@ -66,6 +66,7 @@ void LIBRARY_LISTBOX::SetString( unsigned linecount, const wxString& text )
if( linecount >= count ) if( linecount >= count )
linecount = count - 1; linecount = count - 1;
m_libraryList[linecount] = text; m_libraryList[linecount] = text;
UpdateWidth( linecount );
} }
} }
...@@ -87,7 +88,9 @@ wxString LIBRARY_LISTBOX::GetSelectedLibrary() ...@@ -87,7 +88,9 @@ wxString LIBRARY_LISTBOX::GetSelectedLibrary()
void LIBRARY_LISTBOX::AppendLine( const wxString& text ) void LIBRARY_LISTBOX::AppendLine( const wxString& text )
{ {
m_libraryList.Add( text ); m_libraryList.Add( text );
SetItemCount( m_libraryList.Count() ); int lines = m_libraryList.Count();
SetItemCount( lines );
UpdateWidth( lines - 1 );
} }
...@@ -129,23 +132,12 @@ void LIBRARY_LISTBOX::SetLibraryList( const wxArrayString& aList ) ...@@ -129,23 +132,12 @@ void LIBRARY_LISTBOX::SetLibraryList( const wxArrayString& aList )
if( m_libraryList.Count() ) if( m_libraryList.Count() )
{ {
RefreshItems( 0L, m_libraryList.Count()-1 ); RefreshItems( 0L, m_libraryList.Count()-1 );
UpdateWidth();
#if defined (__WXGTK__ ) && wxMINOR_VERSION == 8
// @bug On GTK and wxWidgets 2.8.x, this will assert in debug builds because the
// column parameter is -1. This was the only way to prevent GTK3 from
// ellipsizing long strings down to a few characters. It still doesn't set
// the scroll bars correctly (too short) but it's better than any of the
// other alternatives. If someone knows how to fix this, please do.
SetColumnWidth( -1, wxLIST_AUTOSIZE );
#else
SetColumnWidth( 0, wxLIST_AUTOSIZE );
#endif
} }
} }
BEGIN_EVENT_TABLE( LIBRARY_LISTBOX, ITEMS_LISTBOX_BASE ) BEGIN_EVENT_TABLE( LIBRARY_LISTBOX, ITEMS_LISTBOX_BASE )
EVT_SIZE( ITEMS_LISTBOX_BASE::OnSize )
EVT_CHAR( LIBRARY_LISTBOX::OnChar ) EVT_CHAR( LIBRARY_LISTBOX::OnChar )
EVT_LIST_ITEM_SELECTED( ID_CVPCB_LIBRARY_LIST, LIBRARY_LISTBOX::OnSelectLibrary ) EVT_LIST_ITEM_SELECTED( ID_CVPCB_LIBRARY_LIST, LIBRARY_LISTBOX::OnSelectLibrary )
END_EVENT_TABLE() END_EVENT_TABLE()
......
...@@ -445,6 +445,10 @@ bool CVPCB_MAINFRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, i ...@@ -445,6 +445,10 @@ bool CVPCB_MAINFRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, i
UpdateTitle(); UpdateTitle();
// Resize the components list box. This is needed in case the
// contents have shrunk compared to the previous netlist.
m_compListBox->UpdateWidth();
// OSX need it since some objects are "rebuild" just make aware AUI // OSX need it since some objects are "rebuild" just make aware AUI
// Fixes #1258081 // Fixes #1258081
m_auimgr.Update(); m_auimgr.Update();
...@@ -949,17 +953,7 @@ void CVPCB_MAINFRAME::BuildCmpListBox() ...@@ -949,17 +953,7 @@ void CVPCB_MAINFRAME::BuildCmpListBox()
m_compListBox->SetItemCount( m_compListBox->m_ComponentList.Count() ); m_compListBox->SetItemCount( m_compListBox->m_ComponentList.Count() );
m_compListBox->SetSelection( 0, true ); m_compListBox->SetSelection( 0, true );
m_compListBox->RefreshItems( 0L, m_compListBox->m_ComponentList.Count()-1 ); m_compListBox->RefreshItems( 0L, m_compListBox->m_ComponentList.Count()-1 );
m_compListBox->UpdateWidth();
#if defined (__WXGTK__ )
// @bug On GTK and wxWidgets 2.8.x, this will assert in debug builds because the
// column parameter is -1. This was the only way to prevent GTK3 from
// ellipsizing long strings down to a few characters. It still doesn't set
// the scroll bars correctly (too short) but it's better than any of the
// other alternatives. If someone knows how to fix this, please do.
m_compListBox->SetColumnWidth( -1, wxLIST_AUTOSIZE );
#else
m_compListBox->SetColumnWidth( 0, wxLIST_AUTOSIZE );
#endif
} }
} }
......
...@@ -50,9 +50,23 @@ public: ...@@ -50,9 +50,23 @@ public:
~ITEMS_LISTBOX_BASE(); ~ITEMS_LISTBOX_BASE();
int GetSelection(); int GetSelection();
void OnSize( wxSizeEvent& event );
virtual CVPCB_MAINFRAME* GetParent() const; virtual CVPCB_MAINFRAME* GetParent() const;
/* Function UpdateWidth
*
* Update the width of the column based on its contents.
*
* @param aLine is the line to calculate the width from. If positive, the
* width will only be increased if needed. If negative, we start from
* scratch and all lines are considered, i.e., the column may be shrunk.
*/
void UpdateWidth( int aLine = -1 );
private:
void UpdateLineWidth( unsigned aLine );
int columnWidth;
}; };
......
...@@ -44,10 +44,9 @@ ...@@ -44,10 +44,9 @@
ITEMS_LISTBOX_BASE::ITEMS_LISTBOX_BASE( CVPCB_MAINFRAME* aParent, wxWindowID aId, ITEMS_LISTBOX_BASE::ITEMS_LISTBOX_BASE( CVPCB_MAINFRAME* aParent, wxWindowID aId,
const wxPoint& aLocation, const wxSize& aSize, const wxPoint& aLocation, const wxSize& aSize,
long aStyle) : long aStyle) :
wxListView( aParent, aId, aLocation, aSize, LISTB_STYLE | aStyle ) wxListView( aParent, aId, aLocation, aSize, LISTB_STYLE | aStyle ), columnWidth(0)
{ {
InsertColumn( 0, wxEmptyString ); InsertColumn( 0, wxEmptyString );
SetColumnWidth( 0, wxLIST_AUTOSIZE );
} }
...@@ -56,17 +55,47 @@ ITEMS_LISTBOX_BASE::~ITEMS_LISTBOX_BASE() ...@@ -56,17 +55,47 @@ ITEMS_LISTBOX_BASE::~ITEMS_LISTBOX_BASE()
} }
/* void ITEMS_LISTBOX_BASE::UpdateWidth( int aLine )
* Adjust the column width to the entire available window width
*/
void ITEMS_LISTBOX_BASE::OnSize( wxSizeEvent& event )
{ {
wxSize size = GetClientSize(); // Less than zero: recalculate width of all items.
int width = 0; if( aLine < 0 )
{
columnWidth = 0;
for( int ii = 0; ii < GetItemCount(); ii++ )
{
UpdateLineWidth( (unsigned)ii );
}
}
// Zero or above: update from a single line.
else
{
if( aLine < GetItemCount() )
UpdateLineWidth( (unsigned)aLine );
}
}
SetColumnWidth( 0, std::max( width, size.x ) );
event.Skip(); /*
* Calculate the width of the given line, and increase the column width
* if needed. This is effectively the wxListCtrl code for autosizing.
* NB. it relies on the caller checking the given line number is valid.
*/
void ITEMS_LISTBOX_BASE::UpdateLineWidth( unsigned aLine )
{
wxClientDC dc( this );
wxCoord w;
int newWidth = 10; // Value of AUTOSIZE_COL_MARGIN from wxWidgets source.
dc.SetFont( GetFont() );
dc.GetTextExtent( GetItemText( aLine, 0 ) + " ", &w, NULL );
newWidth += w;
if( newWidth > columnWidth )
{
columnWidth = newWidth;
SetColumnWidth( 0, columnWidth );
}
} }
......
...@@ -413,9 +413,11 @@ void LIB_PART::Plot( PLOTTER* aPlotter, int aUnit, int aConvert, ...@@ -413,9 +413,11 @@ void LIB_PART::Plot( PLOTTER* aPlotter, int aUnit, int aConvert,
aPlotter->SetColor( GetLayerColor( LAYER_DEVICE ) ); aPlotter->SetColor( GetLayerColor( LAYER_DEVICE ) );
bool fill = aPlotter->GetColorMode(); bool fill = aPlotter->GetColorMode();
// draw background for filled items using background option
// Solid lines will be drawn after the background
BOOST_FOREACH( LIB_ITEM& item, drawings ) BOOST_FOREACH( LIB_ITEM& item, drawings )
{ {
// Lib Fields not are plotted here, because this plot function // Lib Fields are not plotted here, because this plot function
// is used to plot schematic items, which have they own fields // is used to plot schematic items, which have they own fields
if( item.Type() == LIB_FIELD_T ) if( item.Type() == LIB_FIELD_T )
continue; continue;
...@@ -426,7 +428,25 @@ void LIB_PART::Plot( PLOTTER* aPlotter, int aUnit, int aConvert, ...@@ -426,7 +428,25 @@ void LIB_PART::Plot( PLOTTER* aPlotter, int aUnit, int aConvert,
if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) ) if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
continue; continue;
item.Plot( aPlotter, aOffset, fill, aTransform ); if( item.m_Fill == FILLED_WITH_BG_BODYCOLOR )
item.Plot( aPlotter, aOffset, fill, aTransform );
}
// Not filled items and filled shapes are now plotted
// (plot only items which are not already plotted)
BOOST_FOREACH( LIB_ITEM& item, drawings )
{
if( item.Type() == LIB_FIELD_T )
continue;
if( aUnit && item.m_Unit && ( item.m_Unit != aUnit ) )
continue;
if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
continue;
if( item.m_Fill != FILLED_WITH_BG_BODYCOLOR )
item.Plot( aPlotter, aOffset, fill, aTransform );
} }
} }
......
...@@ -37,7 +37,6 @@ DIALOG_LABEL_EDITOR_BASE::DIALOG_LABEL_EDITOR_BASE( wxWindow* parent, wxWindowID ...@@ -37,7 +37,6 @@ DIALOG_LABEL_EDITOR_BASE::DIALOG_LABEL_EDITOR_BASE( wxWindow* parent, wxWindowID
bSizeText->Add( m_textLabelSingleLine, 0, wxEXPAND|wxLEFT, 3 ); bSizeText->Add( m_textLabelSingleLine, 0, wxEXPAND|wxLEFT, 3 );
m_textLabelMultiLine = new wxTextCtrl( this, wxID_VALUEMULTI, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_PROCESS_ENTER ); m_textLabelMultiLine = new wxTextCtrl( this, wxID_VALUEMULTI, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_PROCESS_ENTER );
m_textLabelMultiLine->SetMaxLength( 0 );
m_textLabelMultiLine->SetMinSize( wxSize( -1,60 ) ); m_textLabelMultiLine->SetMinSize( wxSize( -1,60 ) );
bSizeText->Add( m_textLabelMultiLine, 1, wxEXPAND|wxLEFT, 3 ); bSizeText->Add( m_textLabelMultiLine, 1, wxEXPAND|wxLEFT, 3 );
......
...@@ -327,7 +327,7 @@ ...@@ -327,7 +327,7 @@
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength"></property>
<property name="min_size"></property> <property name="min_size"></property>
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size">-1,60</property> <property name="minimum_size">-1,60</property>
......
...@@ -80,7 +80,6 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin ...@@ -80,7 +80,6 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
bSizerMessages->Add( m_titleMessages, 0, wxRIGHT|wxLEFT, 5 ); bSizerMessages->Add( m_titleMessages, 0, wxRIGHT|wxLEFT, 5 );
m_MessagesList = new wxTextCtrl( m_PanelERC, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY ); m_MessagesList = new wxTextCtrl( m_PanelERC, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
m_MessagesList->SetMaxLength( 0 );
bSizerMessages->Add( m_MessagesList, 1, wxEXPAND|wxLEFT, 5 ); bSizerMessages->Add( m_MessagesList, 1, wxEXPAND|wxLEFT, 5 );
......
...@@ -1032,7 +1032,7 @@ ...@@ -1032,7 +1032,7 @@
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength"></property>
<property name="min_size"></property> <property name="min_size"></property>
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size">-1,-1</property> <property name="minimum_size">-1,-1</property>
......
...@@ -146,7 +146,6 @@ DIALOG_PLOT_SCHEMATIC_BASE::DIALOG_PLOT_SCHEMATIC_BASE( wxWindow* parent, wxWind ...@@ -146,7 +146,6 @@ DIALOG_PLOT_SCHEMATIC_BASE::DIALOG_PLOT_SCHEMATIC_BASE( wxWindow* parent, wxWind
bSizer4->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); bSizer4->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_MessagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); m_MessagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
m_MessagesBox->SetMaxLength( 0 );
m_MessagesBox->SetMinSize( wxSize( -1,80 ) ); m_MessagesBox->SetMinSize( wxSize( -1,80 ) );
bSizer4->Add( m_MessagesBox, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); bSizer4->Add( m_MessagesBox, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
......
...@@ -1799,7 +1799,7 @@ ...@@ -1799,7 +1799,7 @@
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength"></property>
<property name="min_size"></property> <property name="min_size"></property>
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size">-1,80</property> <property name="minimum_size">-1,80</property>
......
=== added file 'patches/wxwidgets-3.0.2_macosx_yosemite_webview_webkit.mm.patch' === modified file 'patches/wxwidgets-3.0.2_macosx_yosemite.patch'
--- patches/wxwidgets-3.0.2_macosx_yosemite_webview_webkit.mm.patch 1970-01-01 00:00:00 +0000 --- patches/wxwidgets-3.0.2_macosx_yosemite.patch 2014-11-04 19:24:22 +0000
+++ patches/wxwidgets-3.0.2_macosx_yosemite_webview_webkit.mm.patch 2014-10-29 18:17:55 +0000 +++ patches/wxwidgets-3.0.2_macosx_yosemite.patch 2014-11-12 01:54:50 +0000
@@ -0,0 +1,11 @@ @@ -1,15 +1,11 @@
-=== added file 'patches/wxwidgets-3.0.2_macosx_yosemite_webview_webkit.mm.patch'
---- patches/wxwidgets-3.0.2_macosx_yosemite_webview_webkit.mm.patch 1970-01-01 00:00:00 +0000
-+++ patches/wxwidgets-3.0.2_macosx_yosemite_webview_webkit.mm.patch 2014-10-29 18:17:55 +0000
-@@ -0,0 +1,11 @@
-+--- src/osx/webview_webkit.mm.orig 2014-09-16 07:27:52.000000000 -0600
-++++ src/osx/webview_webkit.mm 2014-09-16 07:28:12.000000000 -0600
-+@@ -28,7 +28,7 @@
-+ #include "wx/hashmap.h"
-+ #include "wx/filesys.h"
-+
-+-#include <WebKit/WebKit.h>
-++#include <WebKit/WebKitLegacy.h>
-+ #include <WebKit/HIWebView.h>
-+ #include <WebKit/CarbonUtils.h>
-+
+--- src/osx/webview_webkit.mm.orig 2014-09-16 07:27:52.000000000 -0600 +--- src/osx/webview_webkit.mm.orig 2014-09-16 07:27:52.000000000 -0600
++++ src/osx/webview_webkit.mm 2014-09-16 07:28:12.000000000 -0600 ++++ src/osx/webview_webkit.mm 2014-09-16 07:28:12.000000000 -0600
+@@ -28,7 +28,7 @@ +@@ -28,7 +28,7 @@
...@@ -13,3 +28,4 @@ ...@@ -13,3 +28,4 @@
+ #include <WebKit/HIWebView.h> + #include <WebKit/HIWebView.h>
+ #include <WebKit/CarbonUtils.h> + #include <WebKit/CarbonUtils.h>
+ +
...@@ -1140,7 +1140,6 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow ...@@ -1140,7 +1140,6 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
bMiddleSizerAtt->Add( m_staticTextAttMsg, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); bMiddleSizerAtt->Add( m_staticTextAttMsg, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_Attenuator_Messages = new wxTextCtrl( m_panelAttenuators, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY ); m_Attenuator_Messages = new wxTextCtrl( m_panelAttenuators, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
m_Attenuator_Messages->SetMaxLength( 0 );
bMiddleSizerAtt->Add( m_Attenuator_Messages, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); bMiddleSizerAtt->Add( m_Attenuator_Messages, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
......
...@@ -16799,7 +16799,7 @@ ...@@ -16799,7 +16799,7 @@
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength"></property>
<property name="min_size"></property> <property name="min_size"></property>
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
...@@ -87,7 +87,6 @@ DIALOG_EXCHANGE_MODULE_BASE::DIALOG_EXCHANGE_MODULE_BASE( wxWindow* parent, wxWi ...@@ -87,7 +87,6 @@ DIALOG_EXCHANGE_MODULE_BASE::DIALOG_EXCHANGE_MODULE_BASE( wxWindow* parent, wxWi
bMainSizer->Add( m_staticTextMsg, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); bMainSizer->Add( m_staticTextMsg, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_WinMessages = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY ); m_WinMessages = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
m_WinMessages->SetMaxLength( 0 );
m_WinMessages->SetMinSize( wxSize( 450,300 ) ); m_WinMessages->SetMinSize( wxSize( 450,300 ) );
bMainSizer->Add( m_WinMessages, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); bMainSizer->Add( m_WinMessages, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
......
...@@ -1219,7 +1219,7 @@ ...@@ -1219,7 +1219,7 @@
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength"></property>
<property name="min_size"></property> <property name="min_size"></property>
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size">450,300</property> <property name="minimum_size">450,300</property>
......
...@@ -26,7 +26,6 @@ DIALOG_PCB_TEXT_PROPERTIES_BASE::DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* pare ...@@ -26,7 +26,6 @@ DIALOG_PCB_TEXT_PROPERTIES_BASE::DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* pare
bSizer9->Add( m_TextLabel, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); bSizer9->Add( m_TextLabel, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_TextContentCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); m_TextContentCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
m_TextContentCtrl->SetMaxLength( 0 );
m_TextContentCtrl->SetToolTip( _("Enter the text placed on selected layer.") ); m_TextContentCtrl->SetToolTip( _("Enter the text placed on selected layer.") );
m_TextContentCtrl->SetMinSize( wxSize( 400,60 ) ); m_TextContentCtrl->SetMinSize( wxSize( 400,60 ) );
......
...@@ -218,7 +218,7 @@ ...@@ -218,7 +218,7 @@
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength"></property>
<property name="min_size"></property> <property name="min_size"></property>
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size">400,60</property> <property name="minimum_size">400,60</property>
......
This diff is collapsed.
/******************************************************************************* /*******************************************************************************
* * * *
* Author : Angus Johnson * * Author : Angus Johnson *
* Version : 6.1.3a * * Version : 6.2.1 *
* Date : 22 January 2014 * * Date : 31 October 2014 *
* Website : http://www.angusj.com * * Website : http://www.angusj.com *
* Copyright : Angus Johnson 2010-2014 * * Copyright : Angus Johnson 2010-2014 *
* * * *
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#ifndef clipper_hpp #ifndef clipper_hpp
#define clipper_hpp #define clipper_hpp
#define CLIPPER_VERSION "6.1.3" #define CLIPPER_VERSION "6.2.0"
//use_int32: When enabled 32bit ints are used instead of 64bit ints. This //use_int32: When enabled 32bit ints are used instead of 64bit ints. This
//improve performance but coordinate values are limited to the range +/- 46340 //improve performance but coordinate values are limited to the range +/- 46340
...@@ -46,9 +46,8 @@ ...@@ -46,9 +46,8 @@
//use_lines: Enables line clipping. Adds a very minor cost to performance. //use_lines: Enables line clipping. Adds a very minor cost to performance.
//#define use_lines //#define use_lines
//use_deprecated: Enables support for the obsolete OffsetPaths() function //use_deprecated: Enables temporary support for the obsolete functions
//which has been replace with the ClipperOffset class. //#define use_deprecated
#define use_deprecated
#include <vector> #include <vector>
#include <set> #include <set>
...@@ -57,6 +56,7 @@ ...@@ -57,6 +56,7 @@
#include <cstdlib> #include <cstdlib>
#include <ostream> #include <ostream>
#include <functional> #include <functional>
#include <queue>
namespace ClipperLib { namespace ClipperLib {
...@@ -69,11 +69,16 @@ enum PolyType { ptSubject, ptClip }; ...@@ -69,11 +69,16 @@ enum PolyType { ptSubject, ptClip };
enum PolyFillType { pftEvenOdd, pftNonZero, pftPositive, pftNegative }; enum PolyFillType { pftEvenOdd, pftNonZero, pftPositive, pftNegative };
#ifdef use_int32 #ifdef use_int32
typedef int cInt; typedef int cInt;
typedef unsigned int cUInt; static cInt const loRange = 0x7FFF;
static cInt const hiRange = 0x7FFF;
#else #else
typedef signed long long cInt; typedef signed long long cInt;
typedef unsigned long long cUInt; static cInt const loRange = 0x3FFFFFFF;
static cInt const hiRange = 0x3FFFFFFFFFFFFFFFLL;
typedef signed long long long64; //used by Int128 class
typedef unsigned long long ulong64;
#endif #endif
struct IntPoint { struct IntPoint {
...@@ -117,15 +122,12 @@ struct DoublePoint ...@@ -117,15 +122,12 @@ struct DoublePoint
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#ifdef use_xyz #ifdef use_xyz
typedef void (*TZFillCallback)(IntPoint& z1, IntPoint& z2, IntPoint& pt); typedef void (*ZFillCallback)(IntPoint& e1bot, IntPoint& e1top, IntPoint& e2bot, IntPoint& e2top, IntPoint& pt);
#endif #endif
enum InitOptions {ioReverseSolution = 1, ioStrictlySimple = 2, ioPreserveCollinear = 4}; enum InitOptions {ioReverseSolution = 1, ioStrictlySimple = 2, ioPreserveCollinear = 4};
enum JoinType {jtSquare, jtRound, jtMiter}; enum JoinType {jtSquare, jtRound, jtMiter};
enum EndType {etClosedPolygon, etClosedLine, etOpenButt, etOpenSquare, etOpenRound}; enum EndType {etClosedPolygon, etClosedLine, etOpenButt, etOpenSquare, etOpenRound};
#ifdef use_deprecated
enum EndType_ {etClosed, etButt = 2, etSquare, etRound};
#endif
class PolyNode; class PolyNode;
typedef std::vector< PolyNode* > PolyNodes; typedef std::vector< PolyNode* > PolyNodes;
...@@ -134,6 +136,7 @@ class PolyNode ...@@ -134,6 +136,7 @@ class PolyNode
{ {
public: public:
PolyNode(); PolyNode();
virtual ~PolyNode(){};
Path Contour; Path Contour;
PolyNodes Childs; PolyNodes Childs;
PolyNode* Parent; PolyNode* Parent;
...@@ -168,11 +171,6 @@ bool Orientation(const Path &poly); ...@@ -168,11 +171,6 @@ bool Orientation(const Path &poly);
double Area(const Path &poly); double Area(const Path &poly);
int PointInPolygon(const IntPoint &pt, const Path &path); int PointInPolygon(const IntPoint &pt, const Path &path);
#ifdef use_deprecated
void OffsetPaths(const Paths &in_polys, Paths &out_polys,
double delta, JoinType jointype, EndType_ endtype, double limit = 0);
#endif
void SimplifyPolygon(const Path &in_poly, Paths &out_polys, PolyFillType fillType = pftEvenOdd); void SimplifyPolygon(const Path &in_poly, Paths &out_polys, PolyFillType fillType = pftEvenOdd);
void SimplifyPolygons(const Paths &in_polys, Paths &out_polys, PolyFillType fillType = pftEvenOdd); void SimplifyPolygons(const Paths &in_polys, Paths &out_polys, PolyFillType fillType = pftEvenOdd);
void SimplifyPolygons(Paths &polys, PolyFillType fillType = pftEvenOdd); void SimplifyPolygons(Paths &polys, PolyFillType fillType = pftEvenOdd);
...@@ -183,8 +181,7 @@ void CleanPolygons(const Paths& in_polys, Paths& out_polys, double distance = 1. ...@@ -183,8 +181,7 @@ void CleanPolygons(const Paths& in_polys, Paths& out_polys, double distance = 1.
void CleanPolygons(Paths& polys, double distance = 1.415); void CleanPolygons(Paths& polys, double distance = 1.415);
void MinkowskiSum(const Path& pattern, const Path& path, Paths& solution, bool pathIsClosed); void MinkowskiSum(const Path& pattern, const Path& path, Paths& solution, bool pathIsClosed);
void MinkowskiSum(const Path& pattern, const Paths& paths, void MinkowskiSum(const Path& pattern, const Paths& paths, Paths& solution, bool pathIsClosed);
Paths& solution, PolyFillType pathFillType, bool pathIsClosed);
void MinkowskiDiff(const Path& poly1, const Path& poly2, Paths& solution); void MinkowskiDiff(const Path& poly1, const Path& poly2, Paths& solution);
void PolyTreeToPaths(const PolyTree& polytree, Paths& paths); void PolyTreeToPaths(const PolyTree& polytree, Paths& paths);
...@@ -202,7 +199,7 @@ enum EdgeSide { esLeft = 1, esRight = 2}; ...@@ -202,7 +199,7 @@ enum EdgeSide { esLeft = 1, esRight = 2};
//forward declarations (for stuff used internally) ... //forward declarations (for stuff used internally) ...
struct TEdge; struct TEdge;
struct IntersectNode; struct IntersectNode;
struct LocalMinima; struct LocalMinimum;
struct Scanbeam; struct Scanbeam;
struct OutPt; struct OutPt;
struct OutRec; struct OutRec;
...@@ -213,7 +210,6 @@ typedef std::vector < TEdge* > EdgeList; ...@@ -213,7 +210,6 @@ typedef std::vector < TEdge* > EdgeList;
typedef std::vector < Join* > JoinList; typedef std::vector < Join* > JoinList;
typedef std::vector < IntersectNode* > IntersectList; typedef std::vector < IntersectNode* > IntersectList;
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
//ClipperBase is the ancestor to the Clipper class. It should not be //ClipperBase is the ancestor to the Clipper class. It should not be
...@@ -236,12 +232,14 @@ protected: ...@@ -236,12 +232,14 @@ protected:
void PopLocalMinima(); void PopLocalMinima();
virtual void Reset(); virtual void Reset();
TEdge* ProcessBound(TEdge* E, bool IsClockwise); TEdge* ProcessBound(TEdge* E, bool IsClockwise);
void InsertLocalMinima(LocalMinima *newLm);
void DoMinimaLML(TEdge* E1, TEdge* E2, bool IsClosed); void DoMinimaLML(TEdge* E1, TEdge* E2, bool IsClosed);
TEdge* DescendToMin(TEdge *&E); TEdge* DescendToMin(TEdge *&E);
void AscendToMax(TEdge *&E, bool Appending, bool IsClosed); void AscendToMax(TEdge *&E, bool Appending, bool IsClosed);
LocalMinima *m_CurrentLM;
LocalMinima *m_MinimaList; typedef std::vector<LocalMinimum> MinimaList;
MinimaList::iterator m_CurrentLM;
MinimaList m_MinimaList;
bool m_UseFullRange; bool m_UseFullRange;
EdgeList m_edges; EdgeList m_edges;
bool m_PreserveCollinear; bool m_PreserveCollinear;
...@@ -268,7 +266,7 @@ public: ...@@ -268,7 +266,7 @@ public:
void StrictlySimple(bool value) {m_StrictSimple = value;}; void StrictlySimple(bool value) {m_StrictSimple = value;};
//set the callback function for z value filling on intersections (otherwise Z is 0) //set the callback function for z value filling on intersections (otherwise Z is 0)
#ifdef use_xyz #ifdef use_xyz
void ZFillFunction(TZFillCallback zFillFunc); void ZFillFunction(ZFillCallback zFillFunc);
#endif #endif
protected: protected:
void Reset(); void Reset();
...@@ -279,7 +277,8 @@ private: ...@@ -279,7 +277,8 @@ private:
JoinList m_GhostJoins; JoinList m_GhostJoins;
IntersectList m_IntersectList; IntersectList m_IntersectList;
ClipType m_ClipType; ClipType m_ClipType;
std::set< cInt, std::greater<cInt> > m_Scanbeam; typedef std::priority_queue<cInt> ScanbeamList;
ScanbeamList m_Scanbeam;
TEdge *m_ActiveEdges; TEdge *m_ActiveEdges;
TEdge *m_SortedEdges; TEdge *m_SortedEdges;
bool m_ExecuteLocked; bool m_ExecuteLocked;
...@@ -289,7 +288,7 @@ private: ...@@ -289,7 +288,7 @@ private:
bool m_UsingPolyTree; bool m_UsingPolyTree;
bool m_StrictSimple; bool m_StrictSimple;
#ifdef use_xyz #ifdef use_xyz
TZFillCallback m_ZFill; //custom callback ZFillCallback m_ZFill; //custom callback
#endif #endif
void SetWindingCount(TEdge& edge); void SetWindingCount(TEdge& edge);
bool IsEvenOddFillType(const TEdge& edge) const; bool IsEvenOddFillType(const TEdge& edge) const;
...@@ -308,21 +307,19 @@ private: ...@@ -308,21 +307,19 @@ private:
bool IsTopHorz(const cInt XPos); bool IsTopHorz(const cInt XPos);
void SwapPositionsInAEL(TEdge *edge1, TEdge *edge2); void SwapPositionsInAEL(TEdge *edge1, TEdge *edge2);
void DoMaxima(TEdge *e); void DoMaxima(TEdge *e);
void PrepareHorzJoins(TEdge* horzEdge, bool isTopOfScanbeam);
void ProcessHorizontals(bool IsTopOfScanbeam); void ProcessHorizontals(bool IsTopOfScanbeam);
void ProcessHorizontal(TEdge *horzEdge, bool isTopOfScanbeam); void ProcessHorizontal(TEdge *horzEdge, bool isTopOfScanbeam);
void AddLocalMaxPoly(TEdge *e1, TEdge *e2, const IntPoint &pt); void AddLocalMaxPoly(TEdge *e1, TEdge *e2, const IntPoint &pt);
OutPt* AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &pt); OutPt* AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &pt);
OutRec* GetOutRec(int idx); OutRec* GetOutRec(int idx);
void AppendPolygon(TEdge *e1, TEdge *e2); void AppendPolygon(TEdge *e1, TEdge *e2);
void IntersectEdges(TEdge *e1, TEdge *e2, void IntersectEdges(TEdge *e1, TEdge *e2, IntPoint &pt);
const IntPoint &pt, bool protect = false);
OutRec* CreateOutRec(); OutRec* CreateOutRec();
OutPt* AddOutPt(TEdge *e, const IntPoint &pt); OutPt* AddOutPt(TEdge *e, const IntPoint &pt);
void DisposeAllOutRecs(); void DisposeAllOutRecs();
void DisposeOutRec(PolyOutList::size_type index); void DisposeOutRec(PolyOutList::size_type index);
bool ProcessIntersections(const cInt botY, const cInt topY); bool ProcessIntersections(const cInt topY);
void BuildIntersectList(const cInt botY, const cInt topY); void BuildIntersectList(const cInt topY);
void ProcessIntersectList(); void ProcessIntersectList();
void ProcessEdgesAtTopOfScanbeam(const cInt topY); void ProcessEdgesAtTopOfScanbeam(const cInt topY);
void BuildResult(Paths& polys); void BuildResult(Paths& polys);
...@@ -344,7 +341,7 @@ private: ...@@ -344,7 +341,7 @@ private:
void FixupFirstLefts1(OutRec* OldOutRec, OutRec* NewOutRec); void FixupFirstLefts1(OutRec* OldOutRec, OutRec* NewOutRec);
void FixupFirstLefts2(OutRec* OldOutRec, OutRec* NewOutRec); void FixupFirstLefts2(OutRec* OldOutRec, OutRec* NewOutRec);
#ifdef use_xyz #ifdef use_xyz
void SetZ(IntPoint& pt, TEdge& e); void SetZ(IntPoint& pt, TEdge& e1, TEdge& e2);
#endif #endif
}; };
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
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