Commit ba25d20f authored by raburton's avatar raburton

set eol-style native on new files

parent 521f428c
/****************************************************************/ /****************************************************************/
/* class ZONE_SETTING used to handle zones parameters in dialogs */ /* class ZONE_SETTING used to handle zones parameters in dialogs */
/****************************************************************/ /****************************************************************/
#ifndef ZONE_SETTING_H #ifndef ZONE_SETTING_H
#define ZONE_SETTING_H #define ZONE_SETTING_H
#ifndef eda_global #ifndef eda_global
#define eda_global extern #define eda_global extern
#endif #endif
/*************************************************/ /*************************************************/
/* Class ZONE_SETTING to handle zones parameters */ /* Class ZONE_SETTING to handle zones parameters */
/*************************************************/ /*************************************************/
class ZONE_SETTING class ZONE_SETTING
{ {
public: public:
int m_GridFillValue; // Grid value for filling zone by segments, 0 to used polygons to fill int m_GridFillValue; // Grid value for filling zone by segments, 0 to used polygons to fill
int m_ZoneClearance; // Clearance value int m_ZoneClearance; // Clearance value
int m_NetcodeSelection; // Net code selection for the current zone int m_NetcodeSelection; // Net code selection for the current zone
int m_CurrentZone_Layer; // Layer used to create the current zone int m_CurrentZone_Layer; // Layer used to create the current zone
int m_Zone_HatchingStyle; // Option to show the zone area (outlines only, short hatches or full hatches int m_Zone_HatchingStyle; // Option to show the zone area (outlines only, short hatches or full hatches
int m_ArcToSegmentsCount; /* Option to select number of segments to approximate a circle int m_ArcToSegmentsCount; /* Option to select number of segments to approximate a circle
* 16 or 32 segments */ * 16 or 32 segments */
int m_FilledAreasShowMode; // Used to select draw options for filled areas in a zone (currently normal =0, sketch = 1) int m_FilledAreasShowMode; // Used to select draw options for filled areas in a zone (currently normal =0, sketch = 1)
long m_ThermalReliefGapValue; // tickness of the gap in thermal reliefs long m_ThermalReliefGapValue; // tickness of the gap in thermal reliefs
long m_ThermalReliefCopperBridgeValue; // tickness of the copper bridge in thermal reliefs long m_ThermalReliefCopperBridgeValue; // tickness of the copper bridge in thermal reliefs
int m_Zone_Pad_Options; // How pads are covered by copper in zone int m_Zone_Pad_Options; // How pads are covered by copper in zone
public: public:
ZONE_SETTING( void ); ZONE_SETTING( void );
/** function ImportSetting /** function ImportSetting
* copy settings from a given zone * copy settings from a given zone
* @param aSource: the given zone * @param aSource: the given zone
*/ */
void ImportSetting( const ZONE_CONTAINER& aSource ); void ImportSetting( const ZONE_CONTAINER& aSource );
/** function ExportSetting /** function ExportSetting
* copy settings to a given zone * copy settings to a given zone
* @param aTarget: the given zone * @param aTarget: the given zone
*/ */
void ExportSetting( ZONE_CONTAINER& aTarget ); void ExportSetting( ZONE_CONTAINER& aTarget );
}; };
#endif // ifndef ZONE_SETTING_H #endif // ifndef ZONE_SETTING_H
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: dialog_copper_zones.cpp // Name: dialog_copper_zones.cpp
// Author: jean-pierre Charras // Author: jean-pierre Charras
// Created: 09/oct/2008 // Created: 09/oct/2008
/// Licence: GNU License /// Licence: GNU License
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#if defined (__GNUG__) && !defined (NO_GCC_PRAGMA) #if defined (__GNUG__) && !defined (NO_GCC_PRAGMA)
#pragma implementation "zones.h" #pragma implementation "zones.h"
#endif #endif
// For compilers that support precompilation, includes "wx/wx.h". // For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h" #include "wx/wxprec.h"
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#pragma hdrstop #pragma hdrstop
#endif #endif
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/wx.h" #include "wx/wx.h"
#endif #endif
#include "fctsys.h" #include "fctsys.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "common.h" #include "common.h"
#include "PolyLine.h" #include "PolyLine.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "trigo.h" #include "trigo.h"
#include "autorout.h" #include "autorout.h"
#include "zones.h" #include "zones.h"
#include "dialog_copper_zones.h" #include "dialog_copper_zones.h"
/************************************************************************************************/ /************************************************************************************************/
dialog_copper_zone::dialog_copper_zone( WinEDA_PcbFrame* parent, ZONE_SETTING* zone_setting ) : dialog_copper_zone::dialog_copper_zone( WinEDA_PcbFrame* parent, ZONE_SETTING* zone_setting ) :
dialog_copper_zone_base( parent ) dialog_copper_zone_base( parent )
/************************************************************************************************/ /************************************************************************************************/
{ {
m_Parent = parent; m_Parent = parent;
m_Zone_Setting = zone_setting; m_Zone_Setting = zone_setting;
m_NetSorting = 1; // 0 = alphabetic sort, 1 = pad count sort m_NetSorting = 1; // 0 = alphabetic sort, 1 = pad count sort
if( m_Parent->m_Parent->m_EDA_Config ) if( m_Parent->m_Parent->m_EDA_Config )
{ {
m_NetSorting = m_Parent->m_Parent->m_EDA_Config->Read( ZONE_NET_SORT_OPTION_KEY, 1l ); m_NetSorting = m_Parent->m_Parent->m_EDA_Config->Read( ZONE_NET_SORT_OPTION_KEY, 1l );
} }
SetReturnCode( ZONE_ABORT ); // Will be changed on buttons click SetReturnCode( ZONE_ABORT ); // Will be changed on buttons click
} }
/*****************************************************************/ /*****************************************************************/
void dialog_copper_zone::OnInitDialog( wxInitDialogEvent& event ) void dialog_copper_zone::OnInitDialog( wxInitDialogEvent& event )
/*****************************************************************/ /*****************************************************************/
// Initialise all dialog options and values in wxTextCtrl // Initialise all dialog options and values in wxTextCtrl
{ {
BOARD* board = m_Parent->m_Pcb; BOARD* board = m_Parent->m_Pcb;
SetFont( *g_DialogFont ); SetFont( *g_DialogFont );
SetFocus(); // Required under wxGTK if we want to demiss the dialog with the ESC key SetFocus(); // Required under wxGTK if we want to demiss the dialog with the ESC key
wxString msg = _( "Zone clearance value:" ) + ReturnUnitSymbol( g_UnitMetric ); wxString msg = _( "Zone clearance value:" ) + ReturnUnitSymbol( g_UnitMetric );
m_ClearanceValueTitle->SetLabel( msg ); m_ClearanceValueTitle->SetLabel( msg );
msg = _( "Grid :" ) + ReturnUnitSymbol( g_UnitMetric ); msg = _( "Grid :" ) + ReturnUnitSymbol( g_UnitMetric );
m_GridCtrl->SetLabel( msg ); m_GridCtrl->SetLabel( msg );
msg = ReturnStringFromValue( g_UnitMetric, msg = ReturnStringFromValue( g_UnitMetric,
m_Zone_Setting->m_ZoneClearance, m_Zone_Setting->m_ZoneClearance,
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
m_ZoneClearanceCtrl->SetValue( msg ); m_ZoneClearanceCtrl->SetValue( msg );
if( g_Zone_45_Only ) if( g_Zone_45_Only )
m_OrientEdgesOpt->SetSelection( 1 ); m_OrientEdgesOpt->SetSelection( 1 );
static const int GridList[4] = { 25, 50, 100, 250 }; static const int GridList[4] = { 25, 50, 100, 250 };
int selection = 0; int selection = 0;
int grid_routing = m_Zone_Setting->m_GridFillValue; int grid_routing = m_Zone_Setting->m_GridFillValue;
for( unsigned ii = 0; ii < 4; ii++ ) for( unsigned ii = 0; ii < 4; ii++ )
{ {
msg = ReturnStringFromValue( g_UnitMetric, msg = ReturnStringFromValue( g_UnitMetric,
GridList[ii], GridList[ii],
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
m_GridCtrl->SetString( ii, msg ); m_GridCtrl->SetString( ii, msg );
if( grid_routing == GridList[ii] ) if( grid_routing == GridList[ii] )
selection = ii; selection = ii;
} }
if( grid_routing == 0 ) // No Grid: fill with polygons if( grid_routing == 0 ) // No Grid: fill with polygons
selection = 4; selection = 4;
m_GridCtrl->SetSelection( selection ); m_GridCtrl->SetSelection( selection );
msg = ReturnStringFromValue( g_UnitMetric, msg = ReturnStringFromValue( g_UnitMetric,
m_Zone_Setting->m_ZoneClearance, m_Zone_Setting->m_ZoneClearance,
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
m_ZoneClearanceCtrl->SetValue( msg ); m_ZoneClearanceCtrl->SetValue( msg );
switch( m_Zone_Setting->m_Zone_Pad_Options ) switch( m_Zone_Setting->m_Zone_Pad_Options )
{ {
case PAD_NOT_IN_ZONE: // Pads are not covered case PAD_NOT_IN_ZONE: // Pads are not covered
m_PadInZoneOpt->SetSelection( 2 ); m_PadInZoneOpt->SetSelection( 2 );
break; break;
case THERMAL_PAD: // Use thermal relief for pads case THERMAL_PAD: // Use thermal relief for pads
m_PadInZoneOpt->SetSelection( 1 ); m_PadInZoneOpt->SetSelection( 1 );
break; break;
case PAD_IN_ZONE: // pads are covered by copper case PAD_IN_ZONE: // pads are covered by copper
m_PadInZoneOpt->SetSelection( 0 ); m_PadInZoneOpt->SetSelection( 0 );
break; break;
} }
if( m_Zone_Setting->m_FilledAreasShowMode == 1 ) if( m_Zone_Setting->m_FilledAreasShowMode == 1 )
m_ShowFilledAreasInSketchOpt->SetValue( true ); m_ShowFilledAreasInSketchOpt->SetValue( true );
if( m_Zone_Setting->m_Zone_Pad_Options != THERMAL_PAD ) if( m_Zone_Setting->m_Zone_Pad_Options != THERMAL_PAD )
{ {
m_AntipadSizeValue->Enable( false ); m_AntipadSizeValue->Enable( false );
m_CopperWidthValue->Enable( false ); m_CopperWidthValue->Enable( false );
} }
else else
{ {
m_AntipadSizeValue->Enable( true ); m_AntipadSizeValue->Enable( true );
m_CopperWidthValue->Enable( true ); m_CopperWidthValue->Enable( true );
} }
AddUnitSymbol( *m_AntipadSizeText, g_UnitMetric ); AddUnitSymbol( *m_AntipadSizeText, g_UnitMetric );
AddUnitSymbol( *m_CopperBridgeWidthText, g_UnitMetric ); AddUnitSymbol( *m_CopperBridgeWidthText, g_UnitMetric );
PutValueInLocalUnits( *m_AntipadSizeValue, PutValueInLocalUnits( *m_AntipadSizeValue,
m_Zone_Setting->m_ThermalReliefGapValue, m_Zone_Setting->m_ThermalReliefGapValue,
PCB_INTERNAL_UNIT ); PCB_INTERNAL_UNIT );
PutValueInLocalUnits( *m_CopperWidthValue, PutValueInLocalUnits( *m_CopperWidthValue,
m_Zone_Setting->m_ThermalReliefCopperBridgeValue, m_Zone_Setting->m_ThermalReliefCopperBridgeValue,
PCB_INTERNAL_UNIT ); PCB_INTERNAL_UNIT );
switch( m_Zone_Setting->m_Zone_HatchingStyle ) switch( m_Zone_Setting->m_Zone_HatchingStyle )
{ {
case CPolyLine::NO_HATCH: case CPolyLine::NO_HATCH:
m_OutlineAppearanceCtrl->SetSelection( 0 ); m_OutlineAppearanceCtrl->SetSelection( 0 );
break; break;
case CPolyLine::DIAGONAL_EDGE: case CPolyLine::DIAGONAL_EDGE:
m_OutlineAppearanceCtrl->SetSelection( 1 ); m_OutlineAppearanceCtrl->SetSelection( 1 );
break; break;
case CPolyLine::DIAGONAL_FULL: case CPolyLine::DIAGONAL_FULL:
m_OutlineAppearanceCtrl->SetSelection( 2 ); m_OutlineAppearanceCtrl->SetSelection( 2 );
break; break;
} }
m_ArcApproximationOpt->SetSelection( m_Zone_Setting->m_ArcToSegmentsCount == 32 ? 1 : 0 ); m_ArcApproximationOpt->SetSelection( m_Zone_Setting->m_ArcToSegmentsCount == 32 ? 1 : 0 );
/* build copper layers list */ /* build copper layers list */
int layer_cnt = board->GetCopperLayerCount(); int layer_cnt = board->GetCopperLayerCount();
for( int ii = 0; ii < board->GetCopperLayerCount(); ii++ ) for( int ii = 0; ii < board->GetCopperLayerCount(); ii++ )
{ {
int layer_number = COPPER_LAYER_N; int layer_number = COPPER_LAYER_N;
if( layer_cnt <= 1 || ii < layer_cnt - 1 ) if( layer_cnt <= 1 || ii < layer_cnt - 1 )
layer_number = ii; layer_number = ii;
else if( ii == layer_cnt - 1 ) else if( ii == layer_cnt - 1 )
layer_number = LAYER_CMP_N; layer_number = LAYER_CMP_N;
m_LayerId[ii] = layer_number; m_LayerId[ii] = layer_number;
msg = board->GetLayerName( layer_number ).Trim(); msg = board->GetLayerName( layer_number ).Trim();
m_LayerSelectionCtrl->InsertItems( 1, &msg, ii ); m_LayerSelectionCtrl->InsertItems( 1, &msg, ii );
if( m_Zone_Setting->m_CurrentZone_Layer == layer_number ) if( m_Zone_Setting->m_CurrentZone_Layer == layer_number )
m_LayerSelectionCtrl->SetSelection( ii ); m_LayerSelectionCtrl->SetSelection( ii );
} }
m_NetSortingOption->SetSelection( m_NetSorting ); m_NetSortingOption->SetSelection( m_NetSorting );
wxString NetNameFilter; wxString NetNameFilter;
if( m_Parent->m_Parent->m_EDA_Config ) if( m_Parent->m_Parent->m_EDA_Config )
{ {
NetNameFilter = NetNameFilter =
m_Parent->m_Parent->m_EDA_Config->Read( ZONE_NET_FILTER_STRING_KEY, wxT( "N_0*" ) ); m_Parent->m_Parent->m_EDA_Config->Read( ZONE_NET_FILTER_STRING_KEY, wxT( "N_0*" ) );
} }
m_NetNameFilter->SetValue( NetNameFilter ); m_NetNameFilter->SetValue( NetNameFilter );
wxArrayString ListNetName; wxArrayString ListNetName;
m_Parent->m_Pcb->ReturnSortedNetnamesList( m_Parent->m_Pcb->ReturnSortedNetnamesList(
ListNetName, ListNetName,
m_NetSorting == m_NetSorting ==
0 ? BOARD::ALPHA_SORT : BOARD::PAD_CNT_SORT ); 0 ? BOARD::ALPHA_SORT : BOARD::PAD_CNT_SORT );
if( m_NetSorting != 0 ) if( m_NetSorting != 0 )
{ {
wxString Filter = m_NetNameFilter->GetValue(); wxString Filter = m_NetNameFilter->GetValue();
for( unsigned ii = 0; ii < ListNetName.GetCount(); ii++ ) for( unsigned ii = 0; ii < ListNetName.GetCount(); ii++ )
{ {
if( ListNetName[ii].Matches( Filter.GetData() ) ) if( ListNetName[ii].Matches( Filter.GetData() ) )
{ {
ListNetName.RemoveAt( ii ); ListNetName.RemoveAt( ii );
ii--; ii--;
} }
} }
} }
m_ListNetNameSelection->InsertItems( ListNetName, 0 ); m_ListNetNameSelection->InsertItems( ListNetName, 0 );
// Select net: // Select net:
int net_select = m_Zone_Setting->m_NetcodeSelection; int net_select = m_Zone_Setting->m_NetcodeSelection;
if( net_select > 0 ) if( net_select > 0 )
{ {
EQUIPOT* equipot = m_Parent->m_Pcb->FindNet( net_select ); EQUIPOT* equipot = m_Parent->m_Pcb->FindNet( net_select );
if( equipot ) // Search net in list and select it if( equipot ) // Search net in list and select it
{ {
for( unsigned ii = 0; ii < ListNetName.GetCount(); ii++ ) for( unsigned ii = 0; ii < ListNetName.GetCount(); ii++ )
{ {
if( ListNetName[ii] == equipot->m_Netname ) if( ListNetName[ii] == equipot->m_Netname )
{ {
m_ListNetNameSelection->SetSelection( ii ); m_ListNetNameSelection->SetSelection( ii );
m_ListNetNameSelection->EnsureVisible( ii ); m_ListNetNameSelection->EnsureVisible( ii );
break; break;
} }
} }
} }
} }
if( GetSizer() ) if( GetSizer() )
{ {
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
} }
Center(); Center();
} }
/********************************************************************/ /********************************************************************/
void dialog_copper_zone::OnButtonCancelClick( wxCommandEvent& event ) void dialog_copper_zone::OnButtonCancelClick( wxCommandEvent& event )
/********************************************************************/ /********************************************************************/
{ {
EndModal( ZONE_ABORT ); EndModal( ZONE_ABORT );
} }
/********************************************************************************************/ /********************************************************************************************/
bool dialog_copper_zone::AcceptOptions( bool aPromptForErrors, bool aUseExportableSetupOnly ) bool dialog_copper_zone::AcceptOptions( bool aPromptForErrors, bool aUseExportableSetupOnly )
/********************************************************************************************/ /********************************************************************************************/
/** Function dialog_copper_zone::AcceptOptions( /** Function dialog_copper_zone::AcceptOptions(
* @return false if incorrect options, true if Ok. * @return false if incorrect options, true if Ok.
* @param aPromptForErrors = true to prompt user on incorrectparams * @param aPromptForErrors = true to prompt user on incorrectparams
* @param aUseExportableSetupOnly = true to use exportable parametres only (used to export this setup to other zones) * @param aUseExportableSetupOnly = true to use exportable parametres only (used to export this setup to other zones)
*/ */
{ {
switch( m_PadInZoneOpt->GetSelection() ) switch( m_PadInZoneOpt->GetSelection() )
{ {
case 2: case 2:
m_Zone_Setting->m_Zone_Pad_Options = PAD_NOT_IN_ZONE; // Pads are not covered m_Zone_Setting->m_Zone_Pad_Options = PAD_NOT_IN_ZONE; // Pads are not covered
break; break;
case 1: case 1:
m_Zone_Setting->m_Zone_Pad_Options = THERMAL_PAD; // Use thermal relief for pads m_Zone_Setting->m_Zone_Pad_Options = THERMAL_PAD; // Use thermal relief for pads
break; break;
case 0: case 0:
m_Zone_Setting->m_Zone_Pad_Options = PAD_IN_ZONE; // pads are covered by copper m_Zone_Setting->m_Zone_Pad_Options = PAD_IN_ZONE; // pads are covered by copper
break; break;
} }
switch( m_OutlineAppearanceCtrl->GetSelection() ) switch( m_OutlineAppearanceCtrl->GetSelection() )
{ {
case 0: case 0:
m_Zone_Setting->m_Zone_HatchingStyle = CPolyLine::NO_HATCH; m_Zone_Setting->m_Zone_HatchingStyle = CPolyLine::NO_HATCH;
break; break;
case 1: case 1:
m_Zone_Setting->m_Zone_HatchingStyle = CPolyLine::DIAGONAL_EDGE; m_Zone_Setting->m_Zone_HatchingStyle = CPolyLine::DIAGONAL_EDGE;
break; break;
case 2: case 2:
m_Zone_Setting->m_Zone_HatchingStyle = CPolyLine::DIAGONAL_FULL; m_Zone_Setting->m_Zone_HatchingStyle = CPolyLine::DIAGONAL_FULL;
break; break;
} }
m_Zone_Setting->m_ArcToSegmentsCount = m_ArcApproximationOpt->GetSelection() == 1 ? 32 : 16; m_Zone_Setting->m_ArcToSegmentsCount = m_ArcApproximationOpt->GetSelection() == 1 ? 32 : 16;
if( m_Parent->m_Parent->m_EDA_Config ) if( m_Parent->m_Parent->m_EDA_Config )
{ {
m_Parent->m_Parent->m_EDA_Config->Write( ZONE_NET_OUTLINES_HATCH_OPTION_KEY, m_Parent->m_Parent->m_EDA_Config->Write( ZONE_NET_OUTLINES_HATCH_OPTION_KEY,
(long) m_Zone_Setting->m_Zone_HatchingStyle ); (long) m_Zone_Setting->m_Zone_HatchingStyle );
} }
switch( m_GridCtrl->GetSelection() ) switch( m_GridCtrl->GetSelection() )
{ {
case 0: case 0:
m_Zone_Setting->m_GridFillValue = 25; m_Zone_Setting->m_GridFillValue = 25;
break; break;
case 1: case 1:
m_Zone_Setting->m_GridFillValue = 50; m_Zone_Setting->m_GridFillValue = 50;
break; break;
default: default:
case 2: case 2:
m_Zone_Setting->m_GridFillValue = 100; m_Zone_Setting->m_GridFillValue = 100;
break; break;
case 3: case 3:
m_Zone_Setting->m_GridFillValue = 250; m_Zone_Setting->m_GridFillValue = 250;
break; break;
case 4: case 4:
m_Zone_Setting->m_GridFillValue = 0; m_Zone_Setting->m_GridFillValue = 0;
#if 0 // I hope this feature works fine ( JP Charras) #if 0 // I hope this feature works fine ( JP Charras)
DisplayInfo( this, wxT( DisplayInfo( this, wxT(
"You are using No grid for filling zones\nThis is currently in development and for tests only.\n Do not use for production" ) ); "You are using No grid for filling zones\nThis is currently in development and for tests only.\n Do not use for production" ) );
#endif #endif
break; break;
} }
wxString txtvalue = m_ZoneClearanceCtrl->GetValue(); wxString txtvalue = m_ZoneClearanceCtrl->GetValue();
m_Zone_Setting->m_ZoneClearance = m_Zone_Setting->m_ZoneClearance =
ReturnValueFromString( g_UnitMetric, txtvalue, m_Parent->m_InternalUnits ); ReturnValueFromString( g_UnitMetric, txtvalue, m_Parent->m_InternalUnits );
if( m_OrientEdgesOpt->GetSelection() == 0 ) if( m_OrientEdgesOpt->GetSelection() == 0 )
g_Zone_45_Only = FALSE; g_Zone_45_Only = FALSE;
else else
g_Zone_45_Only = TRUE; g_Zone_45_Only = TRUE;
m_Zone_Setting->m_FilledAreasShowMode = m_ShowFilledAreasInSketchOpt->IsChecked() ? 1 : 0; m_Zone_Setting->m_FilledAreasShowMode = m_ShowFilledAreasInSketchOpt->IsChecked() ? 1 : 0;
m_Zone_Setting->m_ThermalReliefGapValue = ReturnValueFromTextCtrl( *m_AntipadSizeValue, m_Zone_Setting->m_ThermalReliefGapValue = ReturnValueFromTextCtrl( *m_AntipadSizeValue,
PCB_INTERNAL_UNIT ); PCB_INTERNAL_UNIT );
m_Zone_Setting->m_ThermalReliefCopperBridgeValue = ReturnValueFromTextCtrl( m_Zone_Setting->m_ThermalReliefCopperBridgeValue = ReturnValueFromTextCtrl(
*m_CopperWidthValue, *m_CopperWidthValue,
PCB_INTERNAL_UNIT ); PCB_INTERNAL_UNIT );
m_Parent->m_Parent->m_EDA_Config->Write( ZONE_THERMAL_RELIEF_GAP_STRING_KEY, m_Parent->m_Parent->m_EDA_Config->Write( ZONE_THERMAL_RELIEF_GAP_STRING_KEY,
(long) m_Zone_Setting->m_ThermalReliefGapValue ); (long) m_Zone_Setting->m_ThermalReliefGapValue );
m_Parent->m_Parent->m_EDA_Config->Write( m_Parent->m_Parent->m_EDA_Config->Write(
ZONE_THERMAL_RELIEF_COPPER_WIDTH_STRING_KEY, ZONE_THERMAL_RELIEF_COPPER_WIDTH_STRING_KEY,
(long) m_Zone_Setting-> (long) m_Zone_Setting->
m_ThermalReliefCopperBridgeValue ); m_ThermalReliefCopperBridgeValue );
// If we use only exportable to others zones parameters, exit here: // If we use only exportable to others zones parameters, exit here:
if( aUseExportableSetupOnly ) if( aUseExportableSetupOnly )
return true; return true;
/* Get the layer selection for this zone */ /* Get the layer selection for this zone */
int ii = m_LayerSelectionCtrl->GetSelection(); int ii = m_LayerSelectionCtrl->GetSelection();
if( ii < 0 && aPromptForErrors ) if( ii < 0 && aPromptForErrors )
{ {
DisplayError( this, _( "Error : you must choose a layer" ) ); DisplayError( this, _( "Error : you must choose a layer" ) );
return false; return false;
} }
m_Zone_Setting->m_CurrentZone_Layer = m_LayerId[ii]; m_Zone_Setting->m_CurrentZone_Layer = m_LayerId[ii];
/* Get the net name selection for this zone */ /* Get the net name selection for this zone */
ii = m_ListNetNameSelection->GetSelection(); ii = m_ListNetNameSelection->GetSelection();
if( ii < 0 && aPromptForErrors ) if( ii < 0 && aPromptForErrors )
{ {
DisplayError( this, _( "Error : you must choose a net name" ) ); DisplayError( this, _( "Error : you must choose a net name" ) );
return false; return false;
} }
wxString net_name = m_ListNetNameSelection->GetString( ii ); wxString net_name = m_ListNetNameSelection->GetString( ii );
/* Search net_code for this net */ /* Search net_code for this net */
EQUIPOT* net; EQUIPOT* net;
g_Zone_Default_Setting.m_NetcodeSelection = 0; g_Zone_Default_Setting.m_NetcodeSelection = 0;
for( net = m_Parent->m_Pcb->m_Equipots; net; net = net->Next() ) for( net = m_Parent->m_Pcb->m_Equipots; net; net = net->Next() )
{ {
if( net->m_Netname == net_name ) if( net->m_Netname == net_name )
{ {
g_Zone_Default_Setting.m_NetcodeSelection = net->GetNet(); g_Zone_Default_Setting.m_NetcodeSelection = net->GetNet();
break; break;
} }
} }
return true; return true;
} }
/***************************************************************************/ /***************************************************************************/
void dialog_copper_zone::OnNetSortingOptionSelected( wxCommandEvent& event ) void dialog_copper_zone::OnNetSortingOptionSelected( wxCommandEvent& event )
/***************************************************************************/ /***************************************************************************/
{ {
wxArrayString ListNetName; wxArrayString ListNetName;
m_NetSorting = m_NetSortingOption->GetSelection(); m_NetSorting = m_NetSortingOption->GetSelection();
m_Parent->m_Pcb->ReturnSortedNetnamesList( m_Parent->m_Pcb->ReturnSortedNetnamesList(
ListNetName, ListNetName,
m_NetSorting == m_NetSorting ==
0 ? BOARD::ALPHA_SORT : BOARD::PAD_CNT_SORT ); 0 ? BOARD::ALPHA_SORT : BOARD::PAD_CNT_SORT );
if( m_NetSorting != 0 ) if( m_NetSorting != 0 )
{ {
wxString Filter = m_NetNameFilter->GetValue(); wxString Filter = m_NetNameFilter->GetValue();
for( unsigned ii = 0; ii < ListNetName.GetCount(); ii++ ) for( unsigned ii = 0; ii < ListNetName.GetCount(); ii++ )
{ {
if( ListNetName[ii].Matches( Filter.GetData() ) ) if( ListNetName[ii].Matches( Filter.GetData() ) )
{ {
ListNetName.RemoveAt( ii ); ListNetName.RemoveAt( ii );
ii--; ii--;
} }
} }
} }
m_ListNetNameSelection->Clear(); m_ListNetNameSelection->Clear();
m_ListNetNameSelection->InsertItems( ListNetName, 0 ); m_ListNetNameSelection->InsertItems( ListNetName, 0 );
if( m_Parent->m_Parent->m_EDA_Config ) if( m_Parent->m_Parent->m_EDA_Config )
{ {
m_Parent->m_Parent->m_EDA_Config->Write( ZONE_NET_SORT_OPTION_KEY, (long) m_NetSorting ); m_Parent->m_Parent->m_EDA_Config->Write( ZONE_NET_SORT_OPTION_KEY, (long) m_NetSorting );
m_Parent->m_Parent->m_EDA_Config->Write( ZONE_NET_FILTER_STRING_KEY, m_Parent->m_Parent->m_EDA_Config->Write( ZONE_NET_FILTER_STRING_KEY,
m_NetNameFilter->GetValue() ); m_NetNameFilter->GetValue() );
} }
// Select and isplay current zone net name in listbox: // Select and isplay current zone net name in listbox:
int net_select = m_Zone_Setting->m_NetcodeSelection; int net_select = m_Zone_Setting->m_NetcodeSelection;
if( net_select > 0 ) if( net_select > 0 )
{ {
EQUIPOT* equipot = m_Parent->m_Pcb->FindNet( net_select ); EQUIPOT* equipot = m_Parent->m_Pcb->FindNet( net_select );
if( equipot ) // Search net in list and select it if( equipot ) // Search net in list and select it
{ {
for( unsigned ii = 0; ii < ListNetName.GetCount(); ii++ ) for( unsigned ii = 0; ii < ListNetName.GetCount(); ii++ )
{ {
if( ListNetName[ii] == equipot->m_Netname ) if( ListNetName[ii] == equipot->m_Netname )
{ {
m_ListNetNameSelection->SetSelection( ii ); m_ListNetNameSelection->SetSelection( ii );
m_ListNetNameSelection->EnsureVisible( ii ); m_ListNetNameSelection->EnsureVisible( ii );
break; break;
} }
} }
} }
} }
} }
/*****************************************************************/ /*****************************************************************/
void dialog_copper_zone::OnButtonOkClick( wxCommandEvent& event ) void dialog_copper_zone::OnButtonOkClick( wxCommandEvent& event )
/*****************************************************************/ /*****************************************************************/
{ {
if( AcceptOptions( true ) ) if( AcceptOptions( true ) )
EndModal( ZONE_OK ); EndModal( ZONE_OK );
} }
/******************************************************************************/ /******************************************************************************/
void dialog_copper_zone::ExportSetupToOtherCopperZones( wxCommandEvent& event ) void dialog_copper_zone::ExportSetupToOtherCopperZones( wxCommandEvent& event )
/******************************************************************************/ /******************************************************************************/
{ {
if( !AcceptOptions( true, true ) ) if( !AcceptOptions( true, true ) )
return; return;
// Export settings ( but layer ) to others zones: // Export settings ( but layer ) to others zones:
BOARD* pcb = m_Parent->m_Pcb; BOARD* pcb = m_Parent->m_Pcb;
for( int ii = 0; ii < pcb->GetAreaCount(); ii++ ) for( int ii = 0; ii < pcb->GetAreaCount(); ii++ )
{ {
ZONE_CONTAINER* zone = pcb->GetArea( ii ); ZONE_CONTAINER* zone = pcb->GetArea( ii );
int zone_layer = zone->GetLayer(); int zone_layer = zone->GetLayer();
m_Zone_Setting->ExportSetting( *zone ); m_Zone_Setting->ExportSetting( *zone );
zone->SetLayer( zone_layer ); zone->SetLayer( zone_layer );
m_Parent->GetScreen()->SetModify(); m_Parent->GetScreen()->SetModify();
} }
} }
/******************************************************************/ /******************************************************************/
void dialog_copper_zone::OnPadsInZoneClick( wxCommandEvent& event ) void dialog_copper_zone::OnPadsInZoneClick( wxCommandEvent& event )
/******************************************************************/ /******************************************************************/
{ {
switch( m_PadInZoneOpt->GetSelection() ) switch( m_PadInZoneOpt->GetSelection() )
{ {
default: default:
m_AntipadSizeValue->Enable( false ); m_AntipadSizeValue->Enable( false );
m_CopperWidthValue->Enable( false ); m_CopperWidthValue->Enable( false );
break; break;
case 1: case 1:
m_AntipadSizeValue->Enable( true ); m_AntipadSizeValue->Enable( true );
m_CopperWidthValue->Enable( true ); m_CopperWidthValue->Enable( true );
break; break;
} }
} }
/* dialog_copper_zones.h */ /* dialog_copper_zones.h */
#ifndef DIALOG_COPPER_ZONES #ifndef DIALOG_COPPER_ZONES
#define DIALOG_COPPER_ZONES #define DIALOG_COPPER_ZONES
#include "dialog_copper_zones_base.h" #include "dialog_copper_zones_base.h"
/* here is the derivated class from dialog_copper_zone_frame created by wxFormBuilder /* here is the derivated class from dialog_copper_zone_frame created by wxFormBuilder
*/ */
class dialog_copper_zone: public dialog_copper_zone_base class dialog_copper_zone: public dialog_copper_zone_base
{ {
public: public:
WinEDA_PcbFrame* m_Parent; WinEDA_PcbFrame* m_Parent;
ZONE_SETTING * m_Zone_Setting; ZONE_SETTING * m_Zone_Setting;
long m_NetSorting; long m_NetSorting;
int m_LayerId[LAYER_COUNT]; // Handle the real layer number from layer name position in m_LayerSelectionCtrl int m_LayerId[LAYER_COUNT]; // Handle the real layer number from layer name position in m_LayerSelectionCtrl
public: public:
dialog_copper_zone( WinEDA_PcbFrame* parent, ZONE_SETTING * zone_setting); dialog_copper_zone( WinEDA_PcbFrame* parent, ZONE_SETTING * zone_setting);
void OnInitDialog( wxInitDialogEvent& event ); void OnInitDialog( wxInitDialogEvent& event );
void OnButtonOkClick( wxCommandEvent& event ); void OnButtonOkClick( wxCommandEvent& event );
void OnButtonCancelClick( wxCommandEvent& event ); void OnButtonCancelClick( wxCommandEvent& event );
bool AcceptOptions(bool aPromptForErrors, bool aUseExportableSetupOnly = false); bool AcceptOptions(bool aPromptForErrors, bool aUseExportableSetupOnly = false);
void OnNetSortingOptionSelected( wxCommandEvent& event ); void OnNetSortingOptionSelected( wxCommandEvent& event );
void ExportSetupToOtherCopperZones( wxCommandEvent& event ); void ExportSetupToOtherCopperZones( wxCommandEvent& event );
void OnPadsInZoneClick( wxCommandEvent& event ); void OnPadsInZoneClick( wxCommandEvent& event );
}; };
#endif // #ifndef DIALOG_COPPER_ZONES #endif // #ifndef DIALOG_COPPER_ZONES
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#include "dialog_copper_zones_base.h" #include "dialog_copper_zones_base.h"
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE( dialog_copper_zone_base, wxDialog ) BEGIN_EVENT_TABLE( dialog_copper_zone_base, wxDialog )
EVT_INIT_DIALOG( dialog_copper_zone_base::_wxFB_OnInitDialog ) EVT_INIT_DIALOG( dialog_copper_zone_base::_wxFB_OnInitDialog )
EVT_RADIOBOX( wxID_PADS_IN_ZONE_OPTIONS, dialog_copper_zone_base::_wxFB_OnPadsInZoneClick ) EVT_RADIOBOX( wxID_PADS_IN_ZONE_OPTIONS, dialog_copper_zone_base::_wxFB_OnPadsInZoneClick )
EVT_BUTTON( wxID_BUTTON_EXPORT, dialog_copper_zone_base::_wxFB_ExportSetupToOtherCopperZones ) EVT_BUTTON( wxID_BUTTON_EXPORT, dialog_copper_zone_base::_wxFB_ExportSetupToOtherCopperZones )
EVT_BUTTON( wxID_OK, dialog_copper_zone_base::_wxFB_OnButtonOkClick ) EVT_BUTTON( wxID_OK, dialog_copper_zone_base::_wxFB_OnButtonOkClick )
EVT_BUTTON( wxID_CANCEL, dialog_copper_zone_base::_wxFB_OnButtonCancelClick ) EVT_BUTTON( wxID_CANCEL, dialog_copper_zone_base::_wxFB_OnButtonCancelClick )
EVT_RADIOBOX( ID_NET_SORTING_OPTION, dialog_copper_zone_base::_wxFB_OnNetSortingOptionSelected ) EVT_RADIOBOX( ID_NET_SORTING_OPTION, dialog_copper_zone_base::_wxFB_OnNetSortingOptionSelected )
END_EVENT_TABLE() END_EVENT_TABLE()
dialog_copper_zone_base::dialog_copper_zone_base( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) dialog_copper_zone_base::dialog_copper_zone_base( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{ {
this->SetSizeHints( wxDefaultSize, wxDefaultSize ); this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* m_MainBoxSize; wxBoxSizer* m_MainBoxSize;
m_MainBoxSize = new wxBoxSizer( wxVERTICAL ); m_MainBoxSize = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* m_OptionsBoxSizer; wxBoxSizer* m_OptionsBoxSizer;
m_OptionsBoxSizer = new wxBoxSizer( wxHORIZONTAL ); m_OptionsBoxSizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* m_ExportableSetupSizer; wxStaticBoxSizer* m_ExportableSetupSizer;
m_ExportableSetupSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Zone Setup:") ), wxHORIZONTAL ); m_ExportableSetupSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Zone Setup:") ), wxHORIZONTAL );
wxBoxSizer* m_LeftBoxSizer; wxBoxSizer* m_LeftBoxSizer;
m_LeftBoxSizer = new wxBoxSizer( wxVERTICAL ); m_LeftBoxSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* m_FillOptionsBox; wxStaticBoxSizer* m_FillOptionsBox;
m_FillOptionsBox = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Zone Fill Options:") ), wxVERTICAL ); m_FillOptionsBox = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Zone Fill Options:") ), wxVERTICAL );
wxString m_GridCtrlChoices[] = { _("0.00000"), _("0.00000"), _("0.00000"), _("0.00000"), _("No grid (For tests only!)") }; wxString m_GridCtrlChoices[] = { _("0.00000"), _("0.00000"), _("0.00000"), _("0.00000"), _("No grid (For tests only!)") };
int m_GridCtrlNChoices = sizeof( m_GridCtrlChoices ) / sizeof( wxString ); int m_GridCtrlNChoices = sizeof( m_GridCtrlChoices ) / sizeof( wxString );
m_GridCtrl = new wxRadioBox( this, ID_RADIOBOX_GRID_SELECTION, _("Grid Size for Filling:"), wxDefaultPosition, wxDefaultSize, m_GridCtrlNChoices, m_GridCtrlChoices, 1, wxRA_SPECIFY_COLS ); m_GridCtrl = new wxRadioBox( this, ID_RADIOBOX_GRID_SELECTION, _("Grid Size for Filling:"), wxDefaultPosition, wxDefaultSize, m_GridCtrlNChoices, m_GridCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_GridCtrl->SetSelection( 4 ); m_GridCtrl->SetSelection( 4 );
m_FillOptionsBox->Add( m_GridCtrl, 0, wxALL|wxEXPAND, 5 ); m_FillOptionsBox->Add( m_GridCtrl, 0, wxALL|wxEXPAND, 5 );
wxString m_PadInZoneOptChoices[] = { _("Include pads"), _("Thermal relief"), _("Exclude pads") }; wxString m_PadInZoneOptChoices[] = { _("Include pads"), _("Thermal relief"), _("Exclude pads") };
int m_PadInZoneOptNChoices = sizeof( m_PadInZoneOptChoices ) / sizeof( wxString ); int m_PadInZoneOptNChoices = sizeof( m_PadInZoneOptChoices ) / sizeof( wxString );
m_PadInZoneOpt = new wxRadioBox( this, wxID_PADS_IN_ZONE_OPTIONS, _("Pad in Zone:"), wxDefaultPosition, wxDefaultSize, m_PadInZoneOptNChoices, m_PadInZoneOptChoices, 1, wxRA_SPECIFY_COLS ); m_PadInZoneOpt = new wxRadioBox( this, wxID_PADS_IN_ZONE_OPTIONS, _("Pad in Zone:"), wxDefaultPosition, wxDefaultSize, m_PadInZoneOptNChoices, m_PadInZoneOptChoices, 1, wxRA_SPECIFY_COLS );
m_PadInZoneOpt->SetSelection( 1 ); m_PadInZoneOpt->SetSelection( 1 );
m_FillOptionsBox->Add( m_PadInZoneOpt, 0, wxALL|wxEXPAND, 5 ); m_FillOptionsBox->Add( m_PadInZoneOpt, 0, wxALL|wxEXPAND, 5 );
wxStaticBoxSizer* m_ThermalShapesParamsSizer; wxStaticBoxSizer* m_ThermalShapesParamsSizer;
m_ThermalShapesParamsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Thermal Reliefs Parameters") ), wxVERTICAL ); m_ThermalShapesParamsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Thermal Reliefs Parameters") ), wxVERTICAL );
m_AntipadSizeText = new wxStaticText( this, wxID_ANY, _("Antipad Size"), wxDefaultPosition, wxDefaultSize, 0 ); m_AntipadSizeText = new wxStaticText( this, wxID_ANY, _("Antipad Size"), wxDefaultPosition, wxDefaultSize, 0 );
m_AntipadSizeText->Wrap( -1 ); m_AntipadSizeText->Wrap( -1 );
m_ThermalShapesParamsSizer->Add( m_AntipadSizeText, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_ThermalShapesParamsSizer->Add( m_AntipadSizeText, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_AntipadSizeValue = new wxTextCtrl( this, wxID_ANTIPAD_SIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_AntipadSizeValue = new wxTextCtrl( this, wxID_ANTIPAD_SIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_AntipadSizeValue->SetToolTip( _("Define the gap around the pad") ); m_AntipadSizeValue->SetToolTip( _("Define the gap around the pad") );
m_ThermalShapesParamsSizer->Add( m_AntipadSizeValue, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); m_ThermalShapesParamsSizer->Add( m_AntipadSizeValue, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_CopperBridgeWidthText = new wxStaticText( this, wxID_ANY, _("Copper Width"), wxDefaultPosition, wxDefaultSize, 0 ); m_CopperBridgeWidthText = new wxStaticText( this, wxID_ANY, _("Copper Width"), wxDefaultPosition, wxDefaultSize, 0 );
m_CopperBridgeWidthText->Wrap( -1 ); m_CopperBridgeWidthText->Wrap( -1 );
m_ThermalShapesParamsSizer->Add( m_CopperBridgeWidthText, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_ThermalShapesParamsSizer->Add( m_CopperBridgeWidthText, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_CopperWidthValue = new wxTextCtrl( this, wxID_COPPER_BRIDGE_VALUE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_CopperWidthValue = new wxTextCtrl( this, wxID_COPPER_BRIDGE_VALUE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_CopperWidthValue->SetToolTip( _("Define the tickness of copper in thermal reliefs") ); m_CopperWidthValue->SetToolTip( _("Define the tickness of copper in thermal reliefs") );
m_ThermalShapesParamsSizer->Add( m_CopperWidthValue, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); m_ThermalShapesParamsSizer->Add( m_CopperWidthValue, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_FillOptionsBox->Add( m_ThermalShapesParamsSizer, 0, wxEXPAND, 5 ); m_FillOptionsBox->Add( m_ThermalShapesParamsSizer, 0, wxEXPAND, 5 );
m_LeftBoxSizer->Add( m_FillOptionsBox, 1, wxEXPAND, 5 ); m_LeftBoxSizer->Add( m_FillOptionsBox, 1, wxEXPAND, 5 );
m_ExportableSetupSizer->Add( m_LeftBoxSizer, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); m_ExportableSetupSizer->Add( m_LeftBoxSizer, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
m_ExportableSetupSizer->Add( 5, 5, 0, wxEXPAND, 5 ); m_ExportableSetupSizer->Add( 5, 5, 0, wxEXPAND, 5 );
wxBoxSizer* m_MiddleBox; wxBoxSizer* m_MiddleBox;
m_MiddleBox = new wxBoxSizer( wxVERTICAL ); m_MiddleBox = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* m_MiddleBoxSizer; wxBoxSizer* m_MiddleBoxSizer;
m_MiddleBoxSizer = new wxBoxSizer( wxVERTICAL ); m_MiddleBoxSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* m_OutilinesBoxOpt; wxStaticBoxSizer* m_OutilinesBoxOpt;
m_OutilinesBoxOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Outlines Options:") ), wxVERTICAL ); m_OutilinesBoxOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Outlines Options:") ), wxVERTICAL );
wxString m_OrientEdgesOptChoices[] = { _("Any"), _("H , V and 45 deg") }; wxString m_OrientEdgesOptChoices[] = { _("Any"), _("H , V and 45 deg") };
int m_OrientEdgesOptNChoices = sizeof( m_OrientEdgesOptChoices ) / sizeof( wxString ); int m_OrientEdgesOptNChoices = sizeof( m_OrientEdgesOptChoices ) / sizeof( wxString );
m_OrientEdgesOpt = new wxRadioBox( this, wxID_ANY, _("Zone edges orient:"), wxDefaultPosition, wxDefaultSize, m_OrientEdgesOptNChoices, m_OrientEdgesOptChoices, 1, wxRA_SPECIFY_COLS ); m_OrientEdgesOpt = new wxRadioBox( this, wxID_ANY, _("Zone edges orient:"), wxDefaultPosition, wxDefaultSize, m_OrientEdgesOptNChoices, m_OrientEdgesOptChoices, 1, wxRA_SPECIFY_COLS );
m_OrientEdgesOpt->SetSelection( 0 ); m_OrientEdgesOpt->SetSelection( 0 );
m_OutilinesBoxOpt->Add( m_OrientEdgesOpt, 0, wxALL|wxEXPAND, 5 ); m_OutilinesBoxOpt->Add( m_OrientEdgesOpt, 0, wxALL|wxEXPAND, 5 );
wxString m_OutlineAppearanceCtrlChoices[] = { _("Line"), _("Hatched outline"), _("Full hatched") }; wxString m_OutlineAppearanceCtrlChoices[] = { _("Line"), _("Hatched outline"), _("Full hatched") };
int m_OutlineAppearanceCtrlNChoices = sizeof( m_OutlineAppearanceCtrlChoices ) / sizeof( wxString ); int m_OutlineAppearanceCtrlNChoices = sizeof( m_OutlineAppearanceCtrlChoices ) / sizeof( wxString );
m_OutlineAppearanceCtrl = new wxRadioBox( this, ID_RADIOBOX_OUTLINES_OPTION, _("Outlines Appearance"), wxDefaultPosition, wxDefaultSize, m_OutlineAppearanceCtrlNChoices, m_OutlineAppearanceCtrlChoices, 1, wxRA_SPECIFY_COLS ); m_OutlineAppearanceCtrl = new wxRadioBox( this, ID_RADIOBOX_OUTLINES_OPTION, _("Outlines Appearance"), wxDefaultPosition, wxDefaultSize, m_OutlineAppearanceCtrlNChoices, m_OutlineAppearanceCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_OutlineAppearanceCtrl->SetSelection( 1 ); m_OutlineAppearanceCtrl->SetSelection( 1 );
m_OutlineAppearanceCtrl->SetToolTip( _("Choose how a zone outline is displayed\n- Single line\n- Short hatching\n- Full zone area hatched") ); m_OutlineAppearanceCtrl->SetToolTip( _("Choose how a zone outline is displayed\n- Single line\n- Short hatching\n- Full zone area hatched") );
m_OutilinesBoxOpt->Add( m_OutlineAppearanceCtrl, 0, wxALL|wxEXPAND, 5 ); m_OutilinesBoxOpt->Add( m_OutlineAppearanceCtrl, 0, wxALL|wxEXPAND, 5 );
wxString m_ArcApproximationOptChoices[] = { _("16 segments / 360 deg"), _("32 segments / 360 deg") }; wxString m_ArcApproximationOptChoices[] = { _("16 segments / 360 deg"), _("32 segments / 360 deg") };
int m_ArcApproximationOptNChoices = sizeof( m_ArcApproximationOptChoices ) / sizeof( wxString ); int m_ArcApproximationOptNChoices = sizeof( m_ArcApproximationOptChoices ) / sizeof( wxString );
m_ArcApproximationOpt = new wxRadioBox( this, wxID_ARC_APPROX, _("Arcs Approximation:"), wxDefaultPosition, wxDefaultSize, m_ArcApproximationOptNChoices, m_ArcApproximationOptChoices, 1, wxRA_SPECIFY_COLS ); m_ArcApproximationOpt = new wxRadioBox( this, wxID_ARC_APPROX, _("Arcs Approximation:"), wxDefaultPosition, wxDefaultSize, m_ArcApproximationOptNChoices, m_ArcApproximationOptChoices, 1, wxRA_SPECIFY_COLS );
m_ArcApproximationOpt->SetSelection( 1 ); m_ArcApproximationOpt->SetSelection( 1 );
m_ArcApproximationOpt->SetToolTip( _("Number of segments to approximate a circle in filling calculations.\n16 segment is faster to calculate and when redraw screen.\n32 segment give a better quality") ); m_ArcApproximationOpt->SetToolTip( _("Number of segments to approximate a circle in filling calculations.\n16 segment is faster to calculate and when redraw screen.\n32 segment give a better quality") );
m_OutilinesBoxOpt->Add( m_ArcApproximationOpt, 0, wxALL|wxEXPAND, 5 ); m_OutilinesBoxOpt->Add( m_ArcApproximationOpt, 0, wxALL|wxEXPAND, 5 );
wxStaticBoxSizer* m_OthersOptionsSizer; wxStaticBoxSizer* m_OthersOptionsSizer;
m_OthersOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Others Options:") ), wxVERTICAL ); m_OthersOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Others Options:") ), wxVERTICAL );
m_ShowFilledAreasInSketchOpt = new wxCheckBox( this, wxID_ANY, _("Show filled areas in sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); m_ShowFilledAreasInSketchOpt = new wxCheckBox( this, wxID_ANY, _("Show filled areas in sketch mode"), wxDefaultPosition, wxDefaultSize, 0 );
m_ShowFilledAreasInSketchOpt->SetToolTip( _("If enabled, filled areas in is this zone will be displayed as non filled polygons.\nIf disabled, filled areas in is this zone will be displayed as \"solid\" areas (normal mode).") ); m_ShowFilledAreasInSketchOpt->SetToolTip( _("If enabled, filled areas in is this zone will be displayed as non filled polygons.\nIf disabled, filled areas in is this zone will be displayed as \"solid\" areas (normal mode).") );
m_OthersOptionsSizer->Add( m_ShowFilledAreasInSketchOpt, 0, wxALL, 5 ); m_OthersOptionsSizer->Add( m_ShowFilledAreasInSketchOpt, 0, wxALL, 5 );
m_ClearanceValueTitle = new wxStaticText( this, wxID_ANY, _("Zone clearance value (mm):"), wxDefaultPosition, wxDefaultSize, 0 ); m_ClearanceValueTitle = new wxStaticText( this, wxID_ANY, _("Zone clearance value (mm):"), wxDefaultPosition, wxDefaultSize, 0 );
m_ClearanceValueTitle->Wrap( -1 ); m_ClearanceValueTitle->Wrap( -1 );
m_OthersOptionsSizer->Add( m_ClearanceValueTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_OthersOptionsSizer->Add( m_ClearanceValueTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ZoneClearanceCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_ZoneClearanceCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_OthersOptionsSizer->Add( m_ZoneClearanceCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_OthersOptionsSizer->Add( m_ZoneClearanceCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_OutilinesBoxOpt->Add( m_OthersOptionsSizer, 1, wxEXPAND, 5 ); m_OutilinesBoxOpt->Add( m_OthersOptionsSizer, 1, wxEXPAND, 5 );
m_MiddleBoxSizer->Add( m_OutilinesBoxOpt, 1, wxEXPAND, 5 ); m_MiddleBoxSizer->Add( m_OutilinesBoxOpt, 1, wxEXPAND, 5 );
m_ExportSetupButton = new wxButton( this, wxID_BUTTON_EXPORT, _("Export to others zones"), wxDefaultPosition, wxDefaultSize, 0 ); m_ExportSetupButton = new wxButton( this, wxID_BUTTON_EXPORT, _("Export to others zones"), wxDefaultPosition, wxDefaultSize, 0 );
m_ExportSetupButton->SetToolTip( _("Export this zone setup to all others copper zones") ); m_ExportSetupButton->SetToolTip( _("Export this zone setup to all others copper zones") );
m_MiddleBoxSizer->Add( m_ExportSetupButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_MiddleBoxSizer->Add( m_ExportSetupButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_MiddleBox->Add( m_MiddleBoxSizer, 0, 0, 5 ); m_MiddleBox->Add( m_MiddleBoxSizer, 0, 0, 5 );
m_ExportableSetupSizer->Add( m_MiddleBox, 1, wxEXPAND, 5 ); m_ExportableSetupSizer->Add( m_MiddleBox, 1, wxEXPAND, 5 );
m_OptionsBoxSizer->Add( m_ExportableSetupSizer, 1, wxEXPAND, 5 ); m_OptionsBoxSizer->Add( m_ExportableSetupSizer, 1, wxEXPAND, 5 );
m_OptionsBoxSizer->Add( 0, 0, 0, wxEXPAND, 5 ); m_OptionsBoxSizer->Add( 0, 0, 0, wxEXPAND, 5 );
wxBoxSizer* m_RightBoxSizer; wxBoxSizer* m_RightBoxSizer;
m_RightBoxSizer = new wxBoxSizer( wxVERTICAL ); m_RightBoxSizer = new wxBoxSizer( wxVERTICAL );
m_OkButton = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 ); m_OkButton = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 );
m_OkButton->SetDefault(); m_OkButton->SetDefault();
m_RightBoxSizer->Add( m_OkButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_RightBoxSizer->Add( m_OkButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_ButtonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); m_ButtonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
m_RightBoxSizer->Add( m_ButtonCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_RightBoxSizer->Add( m_ButtonCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_RightBoxSizer->Add( 5, 20, 0, wxEXPAND, 5 ); m_RightBoxSizer->Add( 5, 20, 0, wxEXPAND, 5 );
wxStaticBoxSizer* m_NetSortOptSizer; wxStaticBoxSizer* m_NetSortOptSizer;
m_NetSortOptSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Nets Display Options:") ), wxVERTICAL ); m_NetSortOptSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Nets Display Options:") ), wxVERTICAL );
wxString m_NetSortingOptionChoices[] = { _("Alphabetic"), _("Advanced") }; wxString m_NetSortingOptionChoices[] = { _("Alphabetic"), _("Advanced") };
int m_NetSortingOptionNChoices = sizeof( m_NetSortingOptionChoices ) / sizeof( wxString ); int m_NetSortingOptionNChoices = sizeof( m_NetSortingOptionChoices ) / sizeof( wxString );
m_NetSortingOption = new wxRadioBox( this, ID_NET_SORTING_OPTION, _("Net sorting:"), wxDefaultPosition, wxDefaultSize, m_NetSortingOptionNChoices, m_NetSortingOptionChoices, 1, wxRA_SPECIFY_COLS ); m_NetSortingOption = new wxRadioBox( this, ID_NET_SORTING_OPTION, _("Net sorting:"), wxDefaultPosition, wxDefaultSize, m_NetSortingOptionNChoices, m_NetSortingOptionChoices, 1, wxRA_SPECIFY_COLS );
m_NetSortingOption->SetSelection( 1 ); m_NetSortingOption->SetSelection( 1 );
m_NetSortingOption->SetToolTip( _("Nets can be sorted:\nBy alphabetic order\nBy number of pads in the net (advanced)") ); m_NetSortingOption->SetToolTip( _("Nets can be sorted:\nBy alphabetic order\nBy number of pads in the net (advanced)") );
m_NetSortOptSizer->Add( m_NetSortingOption, 0, wxALL|wxEXPAND, 5 ); m_NetSortOptSizer->Add( m_NetSortingOption, 0, wxALL|wxEXPAND, 5 );
m_staticText5 = new wxStaticText( this, wxID_ANY, _("Filter"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText5 = new wxStaticText( this, wxID_ANY, _("Filter"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText5->Wrap( -1 ); m_staticText5->Wrap( -1 );
m_NetSortOptSizer->Add( m_staticText5, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_NetSortOptSizer->Add( m_staticText5, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_NetNameFilter = new wxTextCtrl( this, ID_TEXTCTRL_NETNAMES_FILTER, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_NetNameFilter = new wxTextCtrl( this, ID_TEXTCTRL_NETNAMES_FILTER, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_NetSortOptSizer->Add( m_NetNameFilter, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_NetSortOptSizer->Add( m_NetNameFilter, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_RightBoxSizer->Add( m_NetSortOptSizer, 1, wxEXPAND, 5 ); m_RightBoxSizer->Add( m_NetSortOptSizer, 1, wxEXPAND, 5 );
m_OptionsBoxSizer->Add( m_RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_OptionsBoxSizer->Add( m_RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_MainBoxSize->Add( m_OptionsBoxSizer, 0, 0, 5 ); m_MainBoxSize->Add( m_OptionsBoxSizer, 0, 0, 5 );
wxBoxSizer* m_NetAndLayersLiastBoxSizer; wxBoxSizer* m_NetAndLayersLiastBoxSizer;
m_NetAndLayersLiastBoxSizer = new wxBoxSizer( wxVERTICAL ); m_NetAndLayersLiastBoxSizer = new wxBoxSizer( wxVERTICAL );
m_staticText2 = new wxStaticText( this, wxID_ANY, _("Net:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText2 = new wxStaticText( this, wxID_ANY, _("Net:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText2->Wrap( -1 ); m_staticText2->Wrap( -1 );
m_NetAndLayersLiastBoxSizer->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_NetAndLayersLiastBoxSizer->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ListNetNameSelection = new wxListBox( this, ID_NETNAME_SELECTION, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); m_ListNetNameSelection = new wxListBox( this, ID_NETNAME_SELECTION, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_NetAndLayersLiastBoxSizer->Add( m_ListNetNameSelection, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_NetAndLayersLiastBoxSizer->Add( m_ListNetNameSelection, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticText3 = new wxStaticText( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText3 = new wxStaticText( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 ); m_staticText3->Wrap( -1 );
m_NetAndLayersLiastBoxSizer->Add( m_staticText3, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_NetAndLayersLiastBoxSizer->Add( m_staticText3, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_LayerSelectionCtrl = new wxListBox( this, ID_LAYER_CHOICE, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); m_LayerSelectionCtrl = new wxListBox( this, ID_LAYER_CHOICE, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_NetAndLayersLiastBoxSizer->Add( m_LayerSelectionCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_NetAndLayersLiastBoxSizer->Add( m_LayerSelectionCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_MainBoxSize->Add( m_NetAndLayersLiastBoxSizer, 0, wxEXPAND, 5 ); m_MainBoxSize->Add( m_NetAndLayersLiastBoxSizer, 0, wxEXPAND, 5 );
this->SetSizer( m_MainBoxSize ); this->SetSizer( m_MainBoxSize );
this->Layout(); this->Layout();
} }
dialog_copper_zone_base::~dialog_copper_zone_base() dialog_copper_zone_base::~dialog_copper_zone_base()
{ {
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_copper_zones_base__ #ifndef __dialog_copper_zones_base__
#define __dialog_copper_zones_base__ #define __dialog_copper_zones_base__
#include <wx/intl.h> #include <wx/intl.h>
#include <wx/string.h> #include <wx/string.h>
#include <wx/radiobox.h> #include <wx/radiobox.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
#include <wx/font.h> #include <wx/font.h>
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/statbox.h> #include <wx/statbox.h>
#include <wx/checkbox.h> #include <wx/checkbox.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/listbox.h> #include <wx/listbox.h>
#include <wx/dialog.h> #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class dialog_copper_zone_base /// Class dialog_copper_zone_base
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class dialog_copper_zone_base : public wxDialog class dialog_copper_zone_base : public wxDialog
{ {
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
private: private:
// Private event handlers // Private event handlers
void _wxFB_OnInitDialog( wxInitDialogEvent& event ){ OnInitDialog( event ); } void _wxFB_OnInitDialog( wxInitDialogEvent& event ){ OnInitDialog( event ); }
void _wxFB_OnPadsInZoneClick( wxCommandEvent& event ){ OnPadsInZoneClick( event ); } void _wxFB_OnPadsInZoneClick( wxCommandEvent& event ){ OnPadsInZoneClick( event ); }
void _wxFB_ExportSetupToOtherCopperZones( wxCommandEvent& event ){ ExportSetupToOtherCopperZones( event ); } void _wxFB_ExportSetupToOtherCopperZones( wxCommandEvent& event ){ ExportSetupToOtherCopperZones( event ); }
void _wxFB_OnButtonOkClick( wxCommandEvent& event ){ OnButtonOkClick( event ); } void _wxFB_OnButtonOkClick( wxCommandEvent& event ){ OnButtonOkClick( event ); }
void _wxFB_OnButtonCancelClick( wxCommandEvent& event ){ OnButtonCancelClick( event ); } void _wxFB_OnButtonCancelClick( wxCommandEvent& event ){ OnButtonCancelClick( event ); }
void _wxFB_OnNetSortingOptionSelected( wxCommandEvent& event ){ OnNetSortingOptionSelected( event ); } void _wxFB_OnNetSortingOptionSelected( wxCommandEvent& event ){ OnNetSortingOptionSelected( event ); }
protected: protected:
enum enum
{ {
ID_RADIOBOX_GRID_SELECTION = 1000, ID_RADIOBOX_GRID_SELECTION = 1000,
wxID_PADS_IN_ZONE_OPTIONS, wxID_PADS_IN_ZONE_OPTIONS,
wxID_ANTIPAD_SIZE, wxID_ANTIPAD_SIZE,
wxID_COPPER_BRIDGE_VALUE, wxID_COPPER_BRIDGE_VALUE,
ID_RADIOBOX_OUTLINES_OPTION, ID_RADIOBOX_OUTLINES_OPTION,
wxID_ARC_APPROX, wxID_ARC_APPROX,
wxID_BUTTON_EXPORT, wxID_BUTTON_EXPORT,
ID_NET_SORTING_OPTION, ID_NET_SORTING_OPTION,
ID_TEXTCTRL_NETNAMES_FILTER, ID_TEXTCTRL_NETNAMES_FILTER,
ID_NETNAME_SELECTION, ID_NETNAME_SELECTION,
ID_LAYER_CHOICE, ID_LAYER_CHOICE,
}; };
wxRadioBox* m_GridCtrl; wxRadioBox* m_GridCtrl;
wxRadioBox* m_PadInZoneOpt; wxRadioBox* m_PadInZoneOpt;
wxStaticText* m_AntipadSizeText; wxStaticText* m_AntipadSizeText;
wxTextCtrl* m_AntipadSizeValue; wxTextCtrl* m_AntipadSizeValue;
wxStaticText* m_CopperBridgeWidthText; wxStaticText* m_CopperBridgeWidthText;
wxTextCtrl* m_CopperWidthValue; wxTextCtrl* m_CopperWidthValue;
wxRadioBox* m_OrientEdgesOpt; wxRadioBox* m_OrientEdgesOpt;
wxRadioBox* m_OutlineAppearanceCtrl; wxRadioBox* m_OutlineAppearanceCtrl;
wxRadioBox* m_ArcApproximationOpt; wxRadioBox* m_ArcApproximationOpt;
wxCheckBox* m_ShowFilledAreasInSketchOpt; wxCheckBox* m_ShowFilledAreasInSketchOpt;
wxStaticText* m_ClearanceValueTitle; wxStaticText* m_ClearanceValueTitle;
wxTextCtrl* m_ZoneClearanceCtrl; wxTextCtrl* m_ZoneClearanceCtrl;
wxButton* m_ExportSetupButton; wxButton* m_ExportSetupButton;
wxButton* m_OkButton; wxButton* m_OkButton;
wxButton* m_ButtonCancel; wxButton* m_ButtonCancel;
wxRadioBox* m_NetSortingOption; wxRadioBox* m_NetSortingOption;
wxStaticText* m_staticText5; wxStaticText* m_staticText5;
wxTextCtrl* m_NetNameFilter; wxTextCtrl* m_NetNameFilter;
wxStaticText* m_staticText2; wxStaticText* m_staticText2;
wxListBox* m_ListNetNameSelection; wxListBox* m_ListNetNameSelection;
wxStaticText* m_staticText3; wxStaticText* m_staticText3;
wxListBox* m_LayerSelectionCtrl; wxListBox* m_LayerSelectionCtrl;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnInitDialog( wxInitDialogEvent& event ){ event.Skip(); } virtual void OnInitDialog( wxInitDialogEvent& event ){ event.Skip(); }
virtual void OnPadsInZoneClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnPadsInZoneClick( wxCommandEvent& event ){ event.Skip(); }
virtual void ExportSetupToOtherCopperZones( wxCommandEvent& event ){ event.Skip(); } virtual void ExportSetupToOtherCopperZones( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonOkClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnButtonOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancelClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnButtonCancelClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnNetSortingOptionSelected( wxCommandEvent& event ){ event.Skip(); } virtual void OnNetSortingOptionSelected( wxCommandEvent& event ){ event.Skip(); }
public: public:
dialog_copper_zone_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Fill Zones Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 545,493 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); dialog_copper_zone_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Fill Zones Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 545,493 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~dialog_copper_zone_base(); ~dialog_copper_zone_base();
}; };
#endif //__dialog_copper_zones_base__ #endif //__dialog_copper_zones_base__
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#include "dialog_non_copper_zones_properties_base.h" #include "dialog_non_copper_zones_properties_base.h"
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE( DialogNonCopperZonesPropertiesBase, wxDialog ) BEGIN_EVENT_TABLE( DialogNonCopperZonesPropertiesBase, wxDialog )
EVT_INIT_DIALOG( DialogNonCopperZonesPropertiesBase::_wxFB_InitDialog ) EVT_INIT_DIALOG( DialogNonCopperZonesPropertiesBase::_wxFB_InitDialog )
EVT_BUTTON( wxID_OK, DialogNonCopperZonesPropertiesBase::_wxFB_OnOkClick ) EVT_BUTTON( wxID_OK, DialogNonCopperZonesPropertiesBase::_wxFB_OnOkClick )
EVT_BUTTON( wxID_CANCEL, DialogNonCopperZonesPropertiesBase::_wxFB_OnCancelClick ) EVT_BUTTON( wxID_CANCEL, DialogNonCopperZonesPropertiesBase::_wxFB_OnCancelClick )
END_EVENT_TABLE() END_EVENT_TABLE()
DialogNonCopperZonesPropertiesBase::DialogNonCopperZonesPropertiesBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) DialogNonCopperZonesPropertiesBase::DialogNonCopperZonesPropertiesBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{ {
this->SetSizeHints( wxDefaultSize, wxDefaultSize ); this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* m_MainSizer; wxBoxSizer* m_MainSizer;
m_MainSizer = new wxBoxSizer( wxVERTICAL ); m_MainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* m_UpperSizer; wxBoxSizer* m_UpperSizer;
m_UpperSizer = new wxBoxSizer( wxHORIZONTAL ); m_UpperSizer = new wxBoxSizer( wxHORIZONTAL );
wxString m_OutlineAppearanceCtrlChoices[] = { _("Line"), _("Hatched Outline"), _("Full Hatched") }; wxString m_OutlineAppearanceCtrlChoices[] = { _("Line"), _("Hatched Outline"), _("Full Hatched") };
int m_OutlineAppearanceCtrlNChoices = sizeof( m_OutlineAppearanceCtrlChoices ) / sizeof( wxString ); int m_OutlineAppearanceCtrlNChoices = sizeof( m_OutlineAppearanceCtrlChoices ) / sizeof( wxString );
m_OutlineAppearanceCtrl = new wxRadioBox( this, wxID_ANY, _("Outlines Appearence"), wxDefaultPosition, wxDefaultSize, m_OutlineAppearanceCtrlNChoices, m_OutlineAppearanceCtrlChoices, 1, wxRA_SPECIFY_COLS ); m_OutlineAppearanceCtrl = new wxRadioBox( this, wxID_ANY, _("Outlines Appearence"), wxDefaultPosition, wxDefaultSize, m_OutlineAppearanceCtrlNChoices, m_OutlineAppearanceCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_OutlineAppearanceCtrl->SetSelection( 1 ); m_OutlineAppearanceCtrl->SetSelection( 1 );
m_UpperSizer->Add( m_OutlineAppearanceCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); m_UpperSizer->Add( m_OutlineAppearanceCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
wxString m_OrientEdgesOptChoices[] = { _("Any"), _("H, V and 45 deg") }; wxString m_OrientEdgesOptChoices[] = { _("Any"), _("H, V and 45 deg") };
int m_OrientEdgesOptNChoices = sizeof( m_OrientEdgesOptChoices ) / sizeof( wxString ); int m_OrientEdgesOptNChoices = sizeof( m_OrientEdgesOptChoices ) / sizeof( wxString );
m_OrientEdgesOpt = new wxRadioBox( this, wxID_ANY, _("Zone Edges Orient"), wxDefaultPosition, wxDefaultSize, m_OrientEdgesOptNChoices, m_OrientEdgesOptChoices, 1, wxRA_SPECIFY_COLS ); m_OrientEdgesOpt = new wxRadioBox( this, wxID_ANY, _("Zone Edges Orient"), wxDefaultPosition, wxDefaultSize, m_OrientEdgesOptNChoices, m_OrientEdgesOptChoices, 1, wxRA_SPECIFY_COLS );
m_OrientEdgesOpt->SetSelection( 0 ); m_OrientEdgesOpt->SetSelection( 0 );
m_UpperSizer->Add( m_OrientEdgesOpt, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); m_UpperSizer->Add( m_OrientEdgesOpt, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
wxBoxSizer* m_ButtonsSizer; wxBoxSizer* m_ButtonsSizer;
m_ButtonsSizer = new wxBoxSizer( wxVERTICAL ); m_ButtonsSizer = new wxBoxSizer( wxVERTICAL );
m_buttonOk = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonOk = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonOk->SetDefault(); m_buttonOk->SetDefault();
m_ButtonsSizer->Add( m_buttonOk, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_ButtonsSizer->Add( m_buttonOk, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
m_ButtonsSizer->Add( m_buttonCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_ButtonsSizer->Add( m_buttonCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_UpperSizer->Add( m_ButtonsSizer, 1, wxALIGN_CENTER_VERTICAL, 5 ); m_UpperSizer->Add( m_ButtonsSizer, 1, wxALIGN_CENTER_VERTICAL, 5 );
m_MainSizer->Add( m_UpperSizer, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); m_MainSizer->Add( m_UpperSizer, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 );
m_staticTextLayerSelection = new wxStaticText( this, wxID_ANY, _("Layer selection:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextLayerSelection = new wxStaticText( this, wxID_ANY, _("Layer selection:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextLayerSelection->Wrap( -1 ); m_staticTextLayerSelection->Wrap( -1 );
m_MainSizer->Add( m_staticTextLayerSelection, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_MainSizer->Add( m_staticTextLayerSelection, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_LayerSelectionCtrl = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); m_LayerSelectionCtrl = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_MainSizer->Add( m_LayerSelectionCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_MainSizer->Add( m_LayerSelectionCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
this->SetSizer( m_MainSizer ); this->SetSizer( m_MainSizer );
this->Layout(); this->Layout();
this->Centre( wxBOTH ); this->Centre( wxBOTH );
} }
DialogNonCopperZonesPropertiesBase::~DialogNonCopperZonesPropertiesBase() DialogNonCopperZonesPropertiesBase::~DialogNonCopperZonesPropertiesBase()
{ {
} }
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project> <wxFormBuilder_Project>
<FileVersion major="1" minor="9" /> <FileVersion major="1" minor="9" />
<object class="Project" expanded="1"> <object class="Project" expanded="1">
<property name="class_decoration"></property> <property name="class_decoration"></property>
<property name="code_generation">C++</property> <property name="code_generation">C++</property>
<property name="disconnect_events">1</property> <property name="disconnect_events">1</property>
<property name="encoding">UTF-8</property> <property name="encoding">UTF-8</property>
<property name="event_generation">table</property> <property name="event_generation">table</property>
<property name="file">dialog_non_copper_zones_properties_base</property> <property name="file">dialog_non_copper_zones_properties_base</property>
<property name="first_id">1000</property> <property name="first_id">1000</property>
<property name="help_provider">none</property> <property name="help_provider">none</property>
<property name="internationalize">1</property> <property name="internationalize">1</property>
<property name="name">dialog_non_copper_zones_properties_base</property> <property name="name">dialog_non_copper_zones_properties_base</property>
<property name="namespace"></property> <property name="namespace"></property>
<property name="path">.</property> <property name="path">.</property>
<property name="precompiled_header"></property> <property name="precompiled_header"></property>
<property name="relative_path">1</property> <property name="relative_path">1</property>
<property name="use_enum">1</property> <property name="use_enum">1</property>
<property name="use_microsoft_bom">0</property> <property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1"> <object class="Dialog" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="center">wxBOTH</property> <property name="center">wxBOTH</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="extra_style"></property> <property name="extra_style"></property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">DialogNonCopperZonesPropertiesBase</property> <property name="name">DialogNonCopperZonesPropertiesBase</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size">366,221</property> <property name="size">366,221</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property> <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="title">Non Copper Zones Properties</property> <property name="title">Non Copper Zones Properties</property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style">wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER</property> <property name="window_style">wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER</property>
<event name="OnActivate"></event> <event name="OnActivate"></event>
<event name="OnActivateApp"></event> <event name="OnActivateApp"></event>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnClose"></event> <event name="OnClose"></event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnHibernate"></event> <event name="OnHibernate"></event>
<event name="OnIconize"></event> <event name="OnIconize"></event>
<event name="OnIdle"></event> <event name="OnIdle"></event>
<event name="OnInitDialog">InitDialog</event> <event name="OnInitDialog">InitDialog</event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
<event name="OnKeyUp"></event> <event name="OnKeyUp"></event>
<event name="OnKillFocus"></event> <event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event> <event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event> <event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event> <event name="OnLeftDown"></event>
<event name="OnLeftUp"></event> <event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event> <event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event> <event name="OnMiddleUp"></event>
<event name="OnMotion"></event> <event name="OnMotion"></event>
<event name="OnMouseEvents"></event> <event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event> <event name="OnMouseWheel"></event>
<event name="OnPaint"></event> <event name="OnPaint"></event>
<event name="OnRightDClick"></event> <event name="OnRightDClick"></event>
<event name="OnRightDown"></event> <event name="OnRightDown"></event>
<event name="OnRightUp"></event> <event name="OnRightUp"></event>
<event name="OnSetFocus"></event> <event name="OnSetFocus"></event>
<event name="OnSize"></event> <event name="OnSize"></event>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_MainSizer</property> <property name="name">m_MainSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxALIGN_CENTER_HORIZONTAL</property> <property name="flag">wxEXPAND|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_UpperSizer</property> <property name="name">m_UpperSizer</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property> <property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxRadioBox" expanded="1"> <object class="wxRadioBox" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="choices">&quot;Line&quot; &quot;Hatched Outline&quot; &quot;Full Hatched&quot;</property> <property name="choices">&quot;Line&quot; &quot;Hatched Outline&quot; &quot;Full Hatched&quot;</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Outlines Appearence</property> <property name="label">Outlines Appearence</property>
<property name="majorDimension">1</property> <property name="majorDimension">1</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_OutlineAppearanceCtrl</property> <property name="name">m_OutlineAppearanceCtrl</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="selection">1</property> <property name="selection">1</property>
<property name="size"></property> <property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property> <property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
<event name="OnKeyUp"></event> <event name="OnKeyUp"></event>
<event name="OnKillFocus"></event> <event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event> <event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event> <event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event> <event name="OnLeftDown"></event>
<event name="OnLeftUp"></event> <event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event> <event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event> <event name="OnMiddleUp"></event>
<event name="OnMotion"></event> <event name="OnMotion"></event>
<event name="OnMouseEvents"></event> <event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event> <event name="OnMouseWheel"></event>
<event name="OnPaint"></event> <event name="OnPaint"></event>
<event name="OnRadioBox"></event> <event name="OnRadioBox"></event>
<event name="OnRightDClick"></event> <event name="OnRightDClick"></event>
<event name="OnRightDown"></event> <event name="OnRightDown"></event>
<event name="OnRightUp"></event> <event name="OnRightUp"></event>
<event name="OnSetFocus"></event> <event name="OnSetFocus"></event>
<event name="OnSize"></event> <event name="OnSize"></event>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property> <property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxRadioBox" expanded="1"> <object class="wxRadioBox" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="choices">&quot;Any&quot; &quot;H, V and 45 deg&quot;</property> <property name="choices">&quot;Any&quot; &quot;H, V and 45 deg&quot;</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Zone Edges Orient</property> <property name="label">Zone Edges Orient</property>
<property name="majorDimension">1</property> <property name="majorDimension">1</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_OrientEdgesOpt</property> <property name="name">m_OrientEdgesOpt</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="selection">0</property> <property name="selection">0</property>
<property name="size"></property> <property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property> <property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
<event name="OnKeyUp"></event> <event name="OnKeyUp"></event>
<event name="OnKillFocus"></event> <event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event> <event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event> <event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event> <event name="OnLeftDown"></event>
<event name="OnLeftUp"></event> <event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event> <event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event> <event name="OnMiddleUp"></event>
<event name="OnMotion"></event> <event name="OnMotion"></event>
<event name="OnMouseEvents"></event> <event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event> <event name="OnMouseWheel"></event>
<event name="OnPaint"></event> <event name="OnPaint"></event>
<event name="OnRadioBox"></event> <event name="OnRadioBox"></event>
<event name="OnRightDClick"></event> <event name="OnRightDClick"></event>
<event name="OnRightDown"></event> <event name="OnRightDown"></event>
<event name="OnRightUp"></event> <event name="OnRightUp"></event>
<event name="OnSetFocus"></event> <event name="OnSetFocus"></event>
<event name="OnSize"></event> <event name="OnSize"></event>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property> <property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_ButtonsSizer</property> <property name="name">m_ButtonsSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property> <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="default">1</property> <property name="default">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_OK</property> <property name="id">wxID_OK</property>
<property name="label">OK</property> <property name="label">OK</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_buttonOk</property> <property name="name">m_buttonOk</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnButtonClick">OnOkClick</event> <event name="OnButtonClick">OnOkClick</event>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
<event name="OnKeyUp"></event> <event name="OnKeyUp"></event>
<event name="OnKillFocus"></event> <event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event> <event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event> <event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event> <event name="OnLeftDown"></event>
<event name="OnLeftUp"></event> <event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event> <event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event> <event name="OnMiddleUp"></event>
<event name="OnMotion"></event> <event name="OnMotion"></event>
<event name="OnMouseEvents"></event> <event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event> <event name="OnMouseWheel"></event>
<event name="OnPaint"></event> <event name="OnPaint"></event>
<event name="OnRightDClick"></event> <event name="OnRightDClick"></event>
<event name="OnRightDown"></event> <event name="OnRightDown"></event>
<event name="OnRightUp"></event> <event name="OnRightUp"></event>
<event name="OnSetFocus"></event> <event name="OnSetFocus"></event>
<event name="OnSize"></event> <event name="OnSize"></event>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property> <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="default">0</property> <property name="default">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_CANCEL</property> <property name="id">wxID_CANCEL</property>
<property name="label">Cancel</property> <property name="label">Cancel</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_buttonCancel</property> <property name="name">m_buttonCancel</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnButtonClick">OnCancelClick</event> <event name="OnButtonClick">OnCancelClick</event>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
<event name="OnKeyUp"></event> <event name="OnKeyUp"></event>
<event name="OnKillFocus"></event> <event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event> <event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event> <event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event> <event name="OnLeftDown"></event>
<event name="OnLeftUp"></event> <event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event> <event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event> <event name="OnMiddleUp"></event>
<event name="OnMotion"></event> <event name="OnMotion"></event>
<event name="OnMouseEvents"></event> <event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event> <event name="OnMouseWheel"></event>
<event name="OnPaint"></event> <event name="OnPaint"></event>
<event name="OnRightDClick"></event> <event name="OnRightDClick"></event>
<event name="OnRightDown"></event> <event name="OnRightDown"></event>
<event name="OnRightUp"></event> <event name="OnRightUp"></event>
<event name="OnSetFocus"></event> <event name="OnSetFocus"></event>
<event name="OnSize"></event> <event name="OnSize"></event>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
</object> </object>
</object> </object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property> <property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Layer selection:</property> <property name="label">Layer selection:</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_staticTextLayerSelection</property> <property name="name">m_staticTextLayerSelection</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<property name="wrap">-1</property> <property name="wrap">-1</property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
<event name="OnKeyUp"></event> <event name="OnKeyUp"></event>
<event name="OnKillFocus"></event> <event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event> <event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event> <event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event> <event name="OnLeftDown"></event>
<event name="OnLeftUp"></event> <event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event> <event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event> <event name="OnMiddleUp"></event>
<event name="OnMotion"></event> <event name="OnMotion"></event>
<event name="OnMouseEvents"></event> <event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event> <event name="OnMouseWheel"></event>
<event name="OnPaint"></event> <event name="OnPaint"></event>
<event name="OnRightDClick"></event> <event name="OnRightDClick"></event>
<event name="OnRightDown"></event> <event name="OnRightDown"></event>
<event name="OnRightUp"></event> <event name="OnRightUp"></event>
<event name="OnSetFocus"></event> <event name="OnSetFocus"></event>
<event name="OnSize"></event> <event name="OnSize"></event>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property> <property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxListBox" expanded="1"> <object class="wxListBox" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="choices"></property> <property name="choices"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_LayerSelectionCtrl</property> <property name="name">m_LayerSelectionCtrl</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
<event name="OnKeyUp"></event> <event name="OnKeyUp"></event>
<event name="OnKillFocus"></event> <event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event> <event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event> <event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event> <event name="OnLeftDown"></event>
<event name="OnLeftUp"></event> <event name="OnLeftUp"></event>
<event name="OnListBox"></event> <event name="OnListBox"></event>
<event name="OnListBoxDClick"></event> <event name="OnListBoxDClick"></event>
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event> <event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event> <event name="OnMiddleUp"></event>
<event name="OnMotion"></event> <event name="OnMotion"></event>
<event name="OnMouseEvents"></event> <event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event> <event name="OnMouseWheel"></event>
<event name="OnPaint"></event> <event name="OnPaint"></event>
<event name="OnRightDClick"></event> <event name="OnRightDClick"></event>
<event name="OnRightDown"></event> <event name="OnRightDown"></event>
<event name="OnRightUp"></event> <event name="OnRightUp"></event>
<event name="OnSetFocus"></event> <event name="OnSetFocus"></event>
<event name="OnSize"></event> <event name="OnSize"></event>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
</object> </object>
</object> </object>
</object> </object>
</wxFormBuilder_Project> </wxFormBuilder_Project>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_non_copper_zones_properties_base__ #ifndef __dialog_non_copper_zones_properties_base__
#define __dialog_non_copper_zones_properties_base__ #define __dialog_non_copper_zones_properties_base__
#include <wx/intl.h> #include <wx/intl.h>
#include <wx/string.h> #include <wx/string.h>
#include <wx/radiobox.h> #include <wx/radiobox.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
#include <wx/font.h> #include <wx/font.h>
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/listbox.h> #include <wx/listbox.h>
#include <wx/dialog.h> #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DialogNonCopperZonesPropertiesBase /// Class DialogNonCopperZonesPropertiesBase
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DialogNonCopperZonesPropertiesBase : public wxDialog class DialogNonCopperZonesPropertiesBase : public wxDialog
{ {
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
private: private:
// Private event handlers // Private event handlers
void _wxFB_InitDialog( wxInitDialogEvent& event ){ InitDialog( event ); } void _wxFB_InitDialog( wxInitDialogEvent& event ){ InitDialog( event ); }
void _wxFB_OnOkClick( wxCommandEvent& event ){ OnOkClick( event ); } void _wxFB_OnOkClick( wxCommandEvent& event ){ OnOkClick( event ); }
void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); } void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); }
protected: protected:
wxRadioBox* m_OutlineAppearanceCtrl; wxRadioBox* m_OutlineAppearanceCtrl;
wxRadioBox* m_OrientEdgesOpt; wxRadioBox* m_OrientEdgesOpt;
wxButton* m_buttonOk; wxButton* m_buttonOk;
wxButton* m_buttonCancel; wxButton* m_buttonCancel;
wxStaticText* m_staticTextLayerSelection; wxStaticText* m_staticTextLayerSelection;
wxListBox* m_LayerSelectionCtrl; wxListBox* m_LayerSelectionCtrl;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void InitDialog( wxInitDialogEvent& event ){ event.Skip(); } virtual void InitDialog( wxInitDialogEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
public: public:
DialogNonCopperZonesPropertiesBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Non Copper Zones Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 366,221 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER ); DialogNonCopperZonesPropertiesBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Non Copper Zones Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 366,221 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER );
~DialogNonCopperZonesPropertiesBase(); ~DialogNonCopperZonesPropertiesBase();
}; };
#endif //__dialog_non_copper_zones_properties_base__ #endif //__dialog_non_copper_zones_properties_base__
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: zones_polygons_insulated_copper_islands.cpp // Name: zones_polygons_insulated_copper_islands.cpp
// Licence: GPL License // Licence: GPL License
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/wx.h" #include "wx/wx.h"
#endif #endif
// For compilers that support precompilation, includes "wx/wx.h". // For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h" #include "wx/wxprec.h"
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#pragma hdrstop #pragma hdrstop
#endif #endif
using namespace std; using namespace std;
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "PolyLine.h" #include "PolyLine.h"
#include "zones.h" #include "zones.h"
static void CalculateSubAreaBoundaryBox( EDA_Rect& aBbox, static void CalculateSubAreaBoundaryBox( EDA_Rect& aBbox,
std::vector <CPolyPt> aPolysList, std::vector <CPolyPt> aPolysList,
int aIndexStart, int aIndexStart,
int aIndexEnd ); int aIndexEnd );
/* Local variables */ /* Local variables */
std::vector <wxPoint> s_ListPoints; // list of coordinates of pads and vias on this layer and on this net. std::vector <wxPoint> s_ListPoints; // list of coordinates of pads and vias on this layer and on this net.
/***************************************************************************************/ /***************************************************************************************/
void ZONE_CONTAINER::Test_For_Copper_Island_And_Remove_Insulated_Islands( BOARD* aPcb ) void ZONE_CONTAINER::Test_For_Copper_Island_And_Remove_Insulated_Islands( BOARD* aPcb )
/***************************************************************************************/ /***************************************************************************************/
/** /**
* Function Test_For_Copper_Island_And_Remove__Insulated_Islands * Function Test_For_Copper_Island_And_Remove__Insulated_Islands
* Remove insulated copper islands found in m_FilledPolysList. * Remove insulated copper islands found in m_FilledPolysList.
* @param aPcb = the board to analyse * @param aPcb = the board to analyse
*/ */
{ {
if( m_FilledPolysList.size() == 0 ) if( m_FilledPolysList.size() == 0 )
return; return;
// Build the list: // Build the list:
s_ListPoints.clear(); s_ListPoints.clear();
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() ) for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
{ {
for( D_PAD* pad = module->m_Pads; pad != NULL; pad = pad->Next() ) for( D_PAD* pad = module->m_Pads; pad != NULL; pad = pad->Next() )
{ {
if( !pad->IsOnLayer( GetLayer() ) ) if( !pad->IsOnLayer( GetLayer() ) )
continue; continue;
if( pad->GetNet() != GetNet() ) if( pad->GetNet() != GetNet() )
continue; continue;
s_ListPoints.push_back( pad->m_Pos ); s_ListPoints.push_back( pad->m_Pos );
} }
} }
for( TRACK* track = aPcb->m_Track; track; track = track->Next() ) for( TRACK* track = aPcb->m_Track; track; track = track->Next() )
{ {
if( !track->IsOnLayer( GetLayer() ) ) if( !track->IsOnLayer( GetLayer() ) )
continue; continue;
if( track->GetNet() != GetNet() ) if( track->GetNet() != GetNet() )
continue; continue;
s_ListPoints.push_back( track->m_Start ); s_ListPoints.push_back( track->m_Start );
if( track->Type() != TYPEVIA ) if( track->Type() != TYPEVIA )
s_ListPoints.push_back( track->m_End ); s_ListPoints.push_back( track->m_End );
} }
// test if a point is inside // test if a point is inside
unsigned indexstart = 0, indexend; unsigned indexstart = 0, indexend;
bool connected = false; bool connected = false;
for( indexend = 0; indexend < m_FilledPolysList.size(); indexend++ ) for( indexend = 0; indexend < m_FilledPolysList.size(); indexend++ )
{ {
if( m_FilledPolysList[indexend].end_contour ) // end of area found if( m_FilledPolysList[indexend].end_contour ) // end of area found
{ {
EDA_Rect bbox; EDA_Rect bbox;
CalculateSubAreaBoundaryBox( bbox, m_FilledPolysList, indexstart, indexend ); CalculateSubAreaBoundaryBox( bbox, m_FilledPolysList, indexstart, indexend );
for( unsigned ic = 0; ic < s_ListPoints.size(); ic++ ) for( unsigned ic = 0; ic < s_ListPoints.size(); ic++ )
{ {
wxPoint pos = s_ListPoints[ic]; wxPoint pos = s_ListPoints[ic];
if( !bbox.Inside( pos ) ) if( !bbox.Inside( pos ) )
continue; continue;
if( TestPointInsidePolygon( m_FilledPolysList, indexstart, indexend, pos.x, pos.y ) ) if( TestPointInsidePolygon( m_FilledPolysList, indexstart, indexend, pos.x, pos.y ) )
{ {
connected = true; connected = true;
break; break;
} }
} }
if( connected ) // this polygon is connected: analyse next polygon if( connected ) // this polygon is connected: analyse next polygon
{ {
indexstart = indexend + 1; // indexstart points the first point of the next polygon indexstart = indexend + 1; // indexstart points the first point of the next polygon
connected = false; connected = false;
} }
else // Not connected: remove this polygon else // Not connected: remove this polygon
{ {
m_FilledPolysList.erase( m_FilledPolysList.erase(
m_FilledPolysList.begin() + indexstart, m_FilledPolysList.begin() + indexstart,
m_FilledPolysList.begin() + indexend + 1 ); m_FilledPolysList.begin() + indexend + 1 );
indexend = indexstart; /* indexstart points the first point of the next polygon indexend = indexstart; /* indexstart points the first point of the next polygon
* because the current poly is removed */ * because the current poly is removed */
} }
} }
} }
} }
/******************************************************************/ /******************************************************************/
void CalculateSubAreaBoundaryBox( EDA_Rect& aBbox, void CalculateSubAreaBoundaryBox( EDA_Rect& aBbox,
std::vector <CPolyPt> aPolysList, std::vector <CPolyPt> aPolysList,
int aIndexStart, int aIndexStart,
int aIndexEnd ) int aIndexEnd )
/******************************************************************/ /******************************************************************/
/** function CalculateSubAreaBoundaryBox /** function CalculateSubAreaBoundaryBox
* Calculates the bounding box of a polygon stored in a vector <CPolyPt> * Calculates the bounding box of a polygon stored in a vector <CPolyPt>
* @param aBbox = EDA_Rect to init as bounding box * @param aBbox = EDA_Rect to init as bounding box
* @param aPolysList = set of CPolyPt that are the corners of one or more polygons * @param aPolysList = set of CPolyPt that are the corners of one or more polygons
* @param aIndexStart = index of the first corner of a polygon in aPolysList * @param aIndexStart = index of the first corner of a polygon in aPolysList
* @param aIndexEnd = index of the last corner of a polygon in aPolysList * @param aIndexEnd = index of the last corner of a polygon in aPolysList
*/ */
{ {
CPolyPt start_point, end_point; CPolyPt start_point, end_point;
start_point = aPolysList[aIndexStart]; start_point = aPolysList[aIndexStart];
end_point = start_point; end_point = start_point;
for( int ii = aIndexStart; ii <= aIndexEnd; ii++ ) for( int ii = aIndexStart; ii <= aIndexEnd; ii++ )
{ {
CPolyPt ptst = aPolysList[ii]; CPolyPt ptst = aPolysList[ii];
if( start_point.x > ptst.x ) if( start_point.x > ptst.x )
start_point.x = ptst.x; start_point.x = ptst.x;
if( start_point.y > ptst.y ) if( start_point.y > ptst.y )
start_point.y = ptst.y; start_point.y = ptst.y;
if( end_point.x < ptst.x ) if( end_point.x < ptst.x )
end_point.x = ptst.x; end_point.x = ptst.x;
if( end_point.y < ptst.y ) if( end_point.y < ptst.y )
end_point.y = ptst.y; end_point.y = ptst.y;
} }
aBbox.SetOrigin( start_point.x, start_point.y ); aBbox.SetOrigin( start_point.x, start_point.y );
aBbox.SetEnd( wxPoint( end_point.x, end_point.y ) ); aBbox.SetEnd( wxPoint( end_point.x, end_point.y ) );
} }
/*! \file kbool/include/kbool/statusb.h /*! \file kbool/include/kbool/statusb.h
\author Probably Klaas Holwerda \author Probably Klaas Holwerda
Copyright: 2001-2004 (C) Probably Klaas Holwerda Copyright: 2001-2004 (C) Probably Klaas Holwerda
Licence: wxWidgets Licence Licence: wxWidgets Licence
RCS-ID: $Id: statusb.h,v 1.2 2006/12/15 21:00:06 titato Exp $ RCS-ID: $Id: statusb.h,v 1.2 2006/12/15 21:00:06 titato Exp $
*/ */
/* @@(#) $Source: /cvsroot/wxart2d/wxArt2D/thirdparty/kbool/include/kbool/statusb.h,v $ $Revision: 1.2 $ $Date: 2006/12/15 21:00:06 $ */ /* @@(#) $Source: /cvsroot/wxart2d/wxArt2D/thirdparty/kbool/include/kbool/statusb.h,v $ $Revision: 1.2 $ $Date: 2006/12/15 21:00:06 $ */
/* /*
Program STATUSB.H Program STATUSB.H
Purpose Controls the statusbar of the application (header) Purpose Controls the statusbar of the application (header)
This statusbar is a typical Windows statusbar This statusbar is a typical Windows statusbar
For porting to another platform there must be a StatusBar class For porting to another platform there must be a StatusBar class
derived from this. derived from this.
User interface element (See documentation for more details User interface element (See documentation for more details
about the functions needed in this class) about the functions needed in this class)
*/ */
#ifndef STATUSB_H #ifndef STATUSB_H
#define STATUSB_H #define STATUSB_H
#include <time.h> #include <time.h>
// abstract base class for own statusbar inherite from it // abstract base class for own statusbar inherite from it
class A2DKBOOLDLLEXP StatusBar class A2DKBOOLDLLEXP StatusBar
{ {
public: public:
// constructor & destructor // constructor & destructor
StatusBar(){}; StatusBar(){};
~StatusBar(){}; ~StatusBar(){};
virtual void SetXY( double = 0.0, double = 0.0 ) = 0; virtual void SetXY( double = 0.0, double = 0.0 ) = 0;
virtual void ResetCoord() = 0; virtual void ResetCoord() = 0;
virtual void SetFile( char* = 0 ) = 0; virtual void SetFile( char* = 0 ) = 0;
virtual void SetProcess( char* = 0 ) = 0; virtual void SetProcess( char* = 0 ) = 0;
virtual void SetTime( time_t seconds = 0 ) = 0; virtual void SetTime( time_t seconds = 0 ) = 0;
virtual void SetRecording( int status = 0 ) = 0; virtual void SetRecording( int status = 0 ) = 0;
virtual void SetZoom( float factor = 1 ) = 0; virtual void SetZoom( float factor = 1 ) = 0;
virtual void Reset() = 0; virtual void Reset() = 0;
void StartDTimer(); void StartDTimer();
void EndDTimer(); void EndDTimer();
int GetDTimerOn(); int GetDTimerOn();
time_t GetDTimer(); time_t GetDTimer();
protected: protected:
int timer; int timer;
time_t oldtime; time_t oldtime;
time_t curtime; time_t curtime;
}; };
#endif #endif
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: polygon_test_point_inside.cpp // Name: polygon_test_point_inside.cpp
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#include <math.h> #include <math.h>
#include <vector> #include <vector>
#include "PolyLine.h" #include "PolyLine.h"
using namespace std; using namespace std;
/* this algo uses the the Jordan curve theorem to find if a point is inside or outside a polygon: /* this algo uses the the Jordan curve theorem to find if a point is inside or outside a polygon:
* It run a semi-infinite line horizontally (increasing x, fixed y) * It run a semi-infinite line horizontally (increasing x, fixed y)
* out from the test point, and count how many edges it crosses. * out from the test point, and count how many edges it crosses.
* At each crossing, the ray switches between inside and outside. * At each crossing, the ray switches between inside and outside.
* If odd count, the test point is inside the polygon * If odd count, the test point is inside the polygon
* This is called the Jordan curve theorem, or sometimes referred to as the "even-odd" test. * This is called the Jordan curve theorem, or sometimes referred to as the "even-odd" test.
*/ */
/* 2 versions are given. /* 2 versions are given.
* the second version is GPL (currently used) * the second version is GPL (currently used)
* the first version is for explanations and tests (used to test the second version) * the first version is for explanations and tests (used to test the second version)
* both use the same algorithm. * both use the same algorithm.
*/ */
#if 0 #if 0
/* This text and the algorithm come from http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html /* This text and the algorithm come from http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
* *
* PNPOLY - Point Inclusion in Polygon Test * PNPOLY - Point Inclusion in Polygon Test
* W. Randolph Franklin (WRF) * W. Randolph Franklin (WRF)
* *
* Table of Contents * Table of Contents
* *
* 1. The C Code <#The C Code> * 1. The C Code <#The C Code>
* 2. The Method <#The Method> * 2. The Method <#The Method>
* 3. Originality <#Originality> * 3. Originality <#Originality>
* 4. The Inequality Tests are Tricky <#The Inequality Tests are Tricky> * 4. The Inequality Tests are Tricky <#The Inequality Tests are Tricky>
* 5. C Semantics <#C Semantics> * 5. C Semantics <#C Semantics>
* 6. Point on a (Boundary) Edge <#Point on an Edge> * 6. Point on a (Boundary) Edge <#Point on an Edge>
* 7. Multiple Components and Holes <#Listing the Vertices> * 7. Multiple Components and Holes <#Listing the Vertices>
* 8. Testing Which One of Many Polygons Contains the Point <#Testing a * 8. Testing Which One of Many Polygons Contains the Point <#Testing a
* Point Against Many Polygons> * Point Against Many Polygons>
* 9. Explanation of /"for (i = 0, j = nvert-1; i < nvert; j = i++)"/ * 9. Explanation of /"for (i = 0, j = nvert-1; i < nvert; j = i++)"/
* <#Explanation> * <#Explanation>
* 10. Fortran Code for the Point in Polygon Test <#Fortran Code for the * 10. Fortran Code for the Point in Polygon Test <#Fortran Code for the
* Point in Polygon Test> * Point in Polygon Test>
* 11. Converting the Code to All Integers <#Converting the Code to All * 11. Converting the Code to All Integers <#Converting the Code to All
* Integers> * Integers>
* 12. License to Use <#License to Use> * 12. License to Use <#License to Use>
* *
* The C Code * The C Code
* *
* Here is the code, for reference. Excluding lines with only braces, there * Here is the code, for reference. Excluding lines with only braces, there
* are only /7 lines/ of code. * are only /7 lines/ of code.
* *
* int pnpoly(int nvert, float *vertx, float *verty, float ref_pointX, float ref_pointY) * int pnpoly(int nvert, float *vertx, float *verty, float ref_pointX, float ref_pointY)
* { * {
* int i, j, c = 0; * int i, j, c = 0;
* for (i = 0, j = nvert-1; i < nvert; j = i++) { * for (i = 0, j = nvert-1; i < nvert; j = i++) {
* if ( ((verty[i]>ref_pointY) != (verty[j]>ref_pointY)) && * if ( ((verty[i]>ref_pointY) != (verty[j]>ref_pointY)) &&
* (ref_pointX < (vertx[j]-vertx[i]) * (ref_pointY-verty[i]) / (verty[j]-verty[i]) + vertx[i]) ) * (ref_pointX < (vertx[j]-vertx[i]) * (ref_pointY-verty[i]) / (verty[j]-verty[i]) + vertx[i]) )
* c = !c; * c = !c;
* } * }
* return c; * return c;
* } * }
* *
* Argument Meaning * Argument Meaning
* nvert Number of vertices in the polygon. Whether to repeat the first * nvert Number of vertices in the polygon. Whether to repeat the first
* vertex at the end is discussed below. * vertex at the end is discussed below.
* vertx, verty Arrays containing the x- and y-coordinates of the * vertx, verty Arrays containing the x- and y-coordinates of the
* polygon's vertices. * polygon's vertices.
* ref_pointX, ref_pointY X- and y-coordinate of the test point. * ref_pointX, ref_pointY X- and y-coordinate of the test point.
* *
* *
* The Method * The Method
* *
* I run a semi-infinite ray horizontally (increasing x, fixed y) out from * I run a semi-infinite ray horizontally (increasing x, fixed y) out from
* the test point, and count how many edges it crosses. At each crossing, * the test point, and count how many edges it crosses. At each crossing,
* the ray switches between inside and outside. This is called the /Jordan * the ray switches between inside and outside. This is called the /Jordan
* curve theorem/. * curve theorem/.
* *
* The case of the ray going thru a vertex is handled correctly via a * The case of the ray going thru a vertex is handled correctly via a
* careful selection of inequalities. Don't mess with this code unless * careful selection of inequalities. Don't mess with this code unless
* you're familiar with the idea of /Simulation of Simplicity/. This * you're familiar with the idea of /Simulation of Simplicity/. This
* pretends to shift the ray infinitesimally to one side so that it either * pretends to shift the ray infinitesimally to one side so that it either
* clearly intersects, or clearly doesn't touch. Since this is merely a * clearly intersects, or clearly doesn't touch. Since this is merely a
* conceptual, infinitesimal, shift, it never creates an intersection that * conceptual, infinitesimal, shift, it never creates an intersection that
* didn't exist before, and never destroys an intersection that clearly * didn't exist before, and never destroys an intersection that clearly
* existed before. * existed before.
* *
* The ray is tested against each edge thus: * The ray is tested against each edge thus:
* *
* 1. Is the point in the half-plane below the extended edge? and * 1. Is the point in the half-plane below the extended edge? and
* 2. Is the point's X coordinate within the edge's X-range? * 2. Is the point's X coordinate within the edge's X-range?
* *
* Handling endpoints here is tricky. * Handling endpoints here is tricky.
* *
* *
* Originality * Originality
* *
* I make no claim to having invented the idea. However in 1970, I did * I make no claim to having invented the idea. However in 1970, I did
* produce the Fortran code given below on my own, and include it in a * produce the Fortran code given below on my own, and include it in a
* package of cartographic SW publicly-distributed by David Douglas, Dept * package of cartographic SW publicly-distributed by David Douglas, Dept
* of Geography, Simon Fraser U and U of Ottawa. * of Geography, Simon Fraser U and U of Ottawa.
* *
* Earlier implementations of point-in-polygon testing presumably exist, * Earlier implementations of point-in-polygon testing presumably exist,
* tho the code might never have been released. Pointers to prior art, * tho the code might never have been released. Pointers to prior art,
* especially publicly available code, are welcome. One early publication, * especially publicly available code, are welcome. One early publication,
* which doesn't handle the point on an edge, and has a typo, is this: * which doesn't handle the point on an edge, and has a typo, is this:
* *
* M Shimrat, "Algorithm 112, Position of Point Relative to Polygon", * M Shimrat, "Algorithm 112, Position of Point Relative to Polygon",
* /Comm. ACM/ 5(8), Aug 1962, p 434. * /Comm. ACM/ 5(8), Aug 1962, p 434.
* *
* A well-written recent summary is this: * A well-written recent summary is this:
* *
* E Haines, /Point in Polygon Strategies/, * E Haines, /Point in Polygon Strategies/,
* http://www.acm.org/pubs/tog/editors/erich/ptinpoly/, 1994. * http://www.acm.org/pubs/tog/editors/erich/ptinpoly/, 1994.
* *
* *
* The Inequality Tests are Tricky * The Inequality Tests are Tricky
* *
* If translating the program to another language, be sure to get the * If translating the program to another language, be sure to get the
* inequalities in the conditional correct. They were carefully chosen to * inequalities in the conditional correct. They were carefully chosen to
* make the program work correctly when the point is vertically below a vertex. * make the program work correctly when the point is vertically below a vertex.
* *
* Several people have thought that my program was wrong, when really * Several people have thought that my program was wrong, when really
* /they/ had gotten the inequalities wrong. * /they/ had gotten the inequalities wrong.
* *
* *
* C Semantics * C Semantics
* *
* My code uses the fact that, in the C language, when executing the code * My code uses the fact that, in the C language, when executing the code
|a&&b|, if |a| is false, then |b| must not be evaluated. If your |a&&b|, if |a| is false, then |b| must not be evaluated. If your
* compiler doesn't do this, then it's not implementing C, and you will get * compiler doesn't do this, then it's not implementing C, and you will get
* a divide-by-zero, i.a., when the test point is vertically in line with a * a divide-by-zero, i.a., when the test point is vertically in line with a
* vertical edge. When translating this code to another language with * vertical edge. When translating this code to another language with
* different semantics, then you must implement this test explicitly. * different semantics, then you must implement this test explicitly.
* *
* *
* Point on a (Boundary) Edge * Point on a (Boundary) Edge
* *
* PNPOLY partitions the plane into points inside the polygon and points * PNPOLY partitions the plane into points inside the polygon and points
* outside the polygon. Points that are on the boundary are classified as * outside the polygon. Points that are on the boundary are classified as
* either inside or outside. * either inside or outside.
* *
* 1. * 1.
* *
* Any particular point is always classified consistently the same * Any particular point is always classified consistently the same
* way. In the following figure, consider what PNPOLY would say when * way. In the following figure, consider what PNPOLY would say when
* the red point, /P/, is tested against the two triangles, /T_L / * the red point, /P/, is tested against the two triangles, /T_L /
* and /T_R /. Depending on internal roundoff errors, PNPOLY may say * and /T_R /. Depending on internal roundoff errors, PNPOLY may say
* that /P/ is in /T_L / or in /T_R /. However it will always give * that /P/ is in /T_L / or in /T_R /. However it will always give
* the same answer when /P/ is tested against those triangles. That * the same answer when /P/ is tested against those triangles. That
* is, if PNPOLY finds that /P/ is in /T_L /, then it will find that * is, if PNPOLY finds that /P/ is in /T_L /, then it will find that
* /P/ is not /T_R /. If PNPOLY finds that /P/ is not in /T_L /, then * /P/ is not /T_R /. If PNPOLY finds that /P/ is not in /T_L /, then
* it will find that /P/ is in /T_R /. * it will find that /P/ is in /T_R /.
* *
* 2. If you want to know when a point is exactly on the boundary, you * 2. If you want to know when a point is exactly on the boundary, you
* need another program. This is only one of many functions that * need another program. This is only one of many functions that
* PNPOLY lacks; it also doesn't predict tomorrow's weather. You are * PNPOLY lacks; it also doesn't predict tomorrow's weather. You are
* free to extend PNPOLY's source code. * free to extend PNPOLY's source code.
* *
* 3. The first reason for this is the numerical analysis position that * 3. The first reason for this is the numerical analysis position that
* you should not be testing exact equality unless your input is * you should not be testing exact equality unless your input is
* exact. Even then, computational roundoff error would often make * exact. Even then, computational roundoff error would often make
* the result wrong. * the result wrong.
* *
* 4. The second reason is that, if you partition a region of the plane * 4. The second reason is that, if you partition a region of the plane
* into polygons, i.e., form a planar graph, then PNPOLY will locate * into polygons, i.e., form a planar graph, then PNPOLY will locate
* each point into exactly one polygon. In other words, PNPOLY * each point into exactly one polygon. In other words, PNPOLY
* considers each polygon to be topologically a semi-open set. This * considers each polygon to be topologically a semi-open set. This
* makes things simpler, i.e., causes fewer special cases, if you use * makes things simpler, i.e., causes fewer special cases, if you use
* PNPOLY as part of a larger system. Examples of this include * PNPOLY as part of a larger system. Examples of this include
* locating a point in a planar graph, and intersecting two planar * locating a point in a planar graph, and intersecting two planar
* graphs. * graphs.
* *
* *
* Explanation of /"for (i = 0, j = nvert-1; i < nvert; j = i++)"/ * Explanation of /"for (i = 0, j = nvert-1; i < nvert; j = i++)"/
* *
* The intention is to execute the loop for each i from 0 to nvert-1. For * The intention is to execute the loop for each i from 0 to nvert-1. For
* each iteration, j is i-1. However that wraps, so if i=0 then j=nvert-1. * each iteration, j is i-1. However that wraps, so if i=0 then j=nvert-1.
* Therefore the current edge runs between verts j and i, and the loop is * Therefore the current edge runs between verts j and i, and the loop is
* done once per edge. In detail: * done once per edge. In detail:
* *
* 1. Start by setting i and j: * 1. Start by setting i and j:
* i = 0 * i = 0
* j = nvert-1 * j = nvert-1
* 2. If i<nvert is false then exit the loop. * 2. If i<nvert is false then exit the loop.
* 3. Do the loop body. * 3. Do the loop body.
* 4. Set j=i and then * 4. Set j=i and then
* add 1 to i and then * add 1 to i and then
* 5. Go back to step 2. * 5. Go back to step 2.
* *
* *
* *
* Converting the Code to All Integers * Converting the Code to All Integers
* *
* If you want to convert the code from floats to integers, consider these * If you want to convert the code from floats to integers, consider these
* issues. * issues.
* *
* 1. On many current processors floats are at least as fast as ints. * 1. On many current processors floats are at least as fast as ints.
* 2. If you move the denominator over to the other side of the * 2. If you move the denominator over to the other side of the
* inequality, remember that, when the denominator is negative, the * inequality, remember that, when the denominator is negative, the
* inequality will flip. * inequality will flip.
* 3. If coordinates are large enough, the multiplication will silently * 3. If coordinates are large enough, the multiplication will silently
* overflow. * overflow.
* *
* *
* License to Use * License to Use
* Copyright (c) 1970-2003, Wm. Randolph Franklin * Copyright (c) 1970-2003, Wm. Randolph Franklin
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the * copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including * "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish, * without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to * distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to * permit persons to whom the Software is furnished to do so, subject to
* the following conditions: * the following conditions:
* *
* 1. Redistributions of source code must retain the above copyright * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimers. * notice, this list of conditions and the following disclaimers.
* 2. Redistributions in binary form must reproduce the above copyright * 2. Redistributions in binary form must reproduce the above copyright
* notice in the documentation and/or other materials provided with * notice in the documentation and/or other materials provided with
* the distribution. * the distribution.
* 3. The name of W. Randolph Franklin may not be used to endorse or * 3. The name of W. Randolph Franklin may not be used to endorse or
* promote products derived from this Software without specific prior * promote products derived from this Software without specific prior
* written permission. * written permission.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* *
* Copyright © 1994-2006, W Randolph Franklin (WRF) * Copyright © 1994-2006, W Randolph Franklin (WRF)
* <http://wrfranklin.org/> You may use my material for non-profit research * <http://wrfranklin.org/> You may use my material for non-profit research
* and education, provided that you credit me, and link back to my home page. * and education, provided that you credit me, and link back to my home page.
* http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html, * http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html,
* 05/20/2008 20:36:42 * 05/20/2008 20:36:42
*/ */
bool TestPointInsidePolygon( std::vector <CPolyPt> aPolysList, bool TestPointInsidePolygon( std::vector <CPolyPt> aPolysList,
int istart, int istart,
int iend, int iend,
int refx, int refx,
int refy ) int refy )
/** Function TestPointInsidePolygon /** Function TestPointInsidePolygon
* test if a point is inside or outside a polygon. * test if a point is inside or outside a polygon.
* @param aPolysList: the list of polygons * @param aPolysList: the list of polygons
* @param istart: the starting point of a given polygon in m_FilledPolysList. * @param istart: the starting point of a given polygon in m_FilledPolysList.
* @param iend: the ending point of the polygon in m_FilledPolysList. * @param iend: the ending point of the polygon in m_FilledPolysList.
* @param refx, refy: the point coordinate to test * @param refx, refy: the point coordinate to test
* @return true if the point is inside, false for outside * @return true if the point is inside, false for outside
*/ */
{ {
double ref_pointX = refx; double ref_pointX = refx;
double ref_pointY = refy; double ref_pointY = refy;
bool inside = false; bool inside = false;
for( int ii = istart, jj = iend; ii <= iend; jj = ii++ ) for( int ii = istart, jj = iend; ii <= iend; jj = ii++ )
{ {
double seg_startX, seg_startY; // starting point for the segment to test double seg_startX, seg_startY; // starting point for the segment to test
seg_startX = aPolysList[ii].x; seg_startX = aPolysList[ii].x;
seg_startY = aPolysList[ii].y; seg_startY = aPolysList[ii].y;
double seg_endX, seg_endY; // ending point for the segment to test double seg_endX, seg_endY; // ending point for the segment to test
seg_endX = aPolysList[jj].x; seg_endX = aPolysList[jj].x;
seg_endY = aPolysList[jj].y; seg_endY = aPolysList[jj].y;
if( ( ( seg_startY > ref_pointY ) != (seg_endY > ref_pointY ) ) if( ( ( seg_startY > ref_pointY ) != (seg_endY > ref_pointY ) )
&& (ref_pointX < && (ref_pointX <
(seg_endX - (seg_endX -
seg_startX) * (ref_pointY - seg_startY) / (seg_endY - seg_startY) + seg_startX) ) seg_startX) * (ref_pointY - seg_startY) / (seg_endY - seg_startY) + seg_startX) )
inside = not inside; inside = not inside;
} }
return inside; return inside;
} }
#else #else
bool TestPointInsidePolygon( std::vector <CPolyPt> aPolysList, bool TestPointInsidePolygon( std::vector <CPolyPt> aPolysList,
int istart, int istart,
int iend, int iend,
int refx, int refx,
int refy ) int refy )
/** Function TestPointInsidePolygon /** Function TestPointInsidePolygon
* test if a point is inside or outside a polygon. * test if a point is inside or outside a polygon.
* if a point is on a outline segment, it is considered outside the polygon * if a point is on a outline segment, it is considered outside the polygon
* the polygon must have only lines (not arcs) for outlines. * the polygon must have only lines (not arcs) for outlines.
* Use TestPointInside or TestPointInsideContour for more complex polygons * Use TestPointInside or TestPointInsideContour for more complex polygons
* @param aPolysList: the list of polygons * @param aPolysList: the list of polygons
* @param istart: the starting point of a given polygon in m_FilledPolysList. * @param istart: the starting point of a given polygon in m_FilledPolysList.
* @param iend: the ending point of the polygon in m_FilledPolysList. * @param iend: the ending point of the polygon in m_FilledPolysList.
* @param refx,refy: the point coordinate to test * @param refx,refy: the point coordinate to test
* @return true if the point is inside, false for outside * @return true if the point is inside, false for outside
*/ */
{ {
#define OUTSIDE_IF_ON_SIDE 0 // = 1 if we consider point on a side outside the polygon #define OUTSIDE_IF_ON_SIDE 0 // = 1 if we consider point on a side outside the polygon
// define line passing through (x,y), with slope = 0 (horizontal line) // define line passing through (x,y), with slope = 0 (horizontal line)
// get intersection points // get intersection points
// count intersection points to right of (x,y), if odd (x,y) is inside polyline // count intersection points to right of (x,y), if odd (x,y) is inside polyline
int xx, yy; int xx, yy;
double slope = 0; // Using an horizontal line. double slope = 0; // Using an horizontal line.
double a = refy - slope * refx; double a = refy - slope * refx;
int ics, ice; int ics, ice;
bool inside = false; bool inside = false;
// find all intersection points of line with polyline sides // find all intersection points of line with polyline sides
for( ics = istart, ice = iend; ics <= iend; ice = ics++ ) for( ics = istart, ice = iend; ics <= iend; ice = ics++ )
{ {
double intersectx1, intersecty1, intersectx2, intersecty2; double intersectx1, intersecty1, intersectx2, intersecty2;
int ok; int ok;
ok = FindLineSegmentIntersection( a, slope, ok = FindLineSegmentIntersection( a, slope,
aPolysList[ics].x, aPolysList[ics].y, aPolysList[ics].x, aPolysList[ics].y,
aPolysList[ice].x, aPolysList[ice].y, aPolysList[ice].x, aPolysList[ice].y,
CPolyLine::STRAIGHT, CPolyLine::STRAIGHT,
&intersectx1, &intersecty1, &intersectx1, &intersecty1,
&intersectx2, &intersecty2 ); &intersectx2, &intersecty2 );
/* FindLineSegmentIntersection() returns 0, 1 or 2 coordinates (ok = 0, 1, 2) /* FindLineSegmentIntersection() returns 0, 1 or 2 coordinates (ok = 0, 1, 2)
* for straight line segments, only 0 or 1 are possible * for straight line segments, only 0 or 1 are possible
* (2 intersections points are possible only with arcs * (2 intersections points are possible only with arcs
*/ */
if( ok ) // Intersection found if( ok ) // Intersection found
{ {
xx = (int) intersectx1; xx = (int) intersectx1;
yy = (int) intersecty1; yy = (int) intersecty1;
/* if the intersection point is on the start point of the current segment, /* if the intersection point is on the start point of the current segment,
* do not count it, * do not count it,
* because it was already counted, as ending point of the previous segment * because it was already counted, as ending point of the previous segment
*/ */
if( xx == aPolysList[ics].x && yy == aPolysList[ics].y ) if( xx == aPolysList[ics].x && yy == aPolysList[ics].y )
continue; continue;
#if OUTSIDE_IF_ON_SIDE #if OUTSIDE_IF_ON_SIDE
if( xx == refx && yy == refy ) if( xx == refx && yy == refy )
return false; // (x,y) is on a side, call it outside return false; // (x,y) is on a side, call it outside
else else
#endif #endif
if( xx > refx ) if( xx > refx )
inside = not inside; inside = not inside;
} }
} }
return inside; return inside;
} }
#endif #endif
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: polygon_test_point_inside.h // Name: polygon_test_point_inside.h
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
using namespace std; using namespace std;
/** Function TestPointInsidePolygon /** Function TestPointInsidePolygon
* test if a point is inside or outside a polygon. * test if a point is inside or outside a polygon.
* @param aPolysList: the list of polygons * @param aPolysList: the list of polygons
* @param istart: the starting point of a given polygon in m_FilledPolysList. * @param istart: the starting point of a given polygon in m_FilledPolysList.
* @param iend: the ending point of the polygon in m_FilledPolysList. * @param iend: the ending point of the polygon in m_FilledPolysList.
* @param refx, refy: the point coordinate to test * @param refx, refy: the point coordinate to test
* @return true if the point is inside, false for outside * @return true if the point is inside, false for outside
*/ */
bool TestPointInsidePolygon( std::vector <CPolyPt> aPolysList, bool TestPointInsidePolygon( std::vector <CPolyPt> aPolysList,
int istart, int istart,
int iend, int iend,
int refx, int refx,
int refy); int refy);
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