Commit 7fd24c7f authored by jean-pierre charras's avatar jean-pierre charras

Very minor fixes.

parent 4ff3a78d
......@@ -279,7 +279,7 @@ void PCB_EDIT_FRAME::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb )
GetScreen()->SetCrossHairPosition( current + Module->m_Pos -
Module->m_BoundaryBox.GetPosition() );
Ymax_size = max( Ymax_size, Module->m_BoundaryBox.GetHeight() );
Ymax_size = std::max( Ymax_size, Module->m_BoundaryBox.GetHeight() );
PlaceModule( Module, NULL, true );
......
......@@ -661,8 +661,8 @@ void CreateThermalReliefPadPolygon( std::vector<CPolyPt>& aCornerBuffer,
if( aCopperThickness < 0 )
aCopperThickness = 0;
copper_thickness.x = min( dx, aCopperThickness );
copper_thickness.y = min( dy, aCopperThickness );
copper_thickness.x = std::min( dx, aCopperThickness );
copper_thickness.y = std::min( dy, aCopperThickness );
switch( aPad.GetShape() )
{
......
......@@ -116,7 +116,7 @@ int BOARD_CONNECTED_ITEM::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const
if( aItem )
{
int hisClearance = aItem->GetClearance();
return max( hisClearance, myClearance );
return std::max( hisClearance, myClearance );
}
return myClearance;
......
......@@ -348,7 +348,7 @@ int D_PAD::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const
if( aItem )
{
int hisClearance = aItem->GetClearance();
return max( hisClearance, clearance );
return std::max( hisClearance, clearance );
}
// Return the specific clearance.
......
......@@ -618,9 +618,9 @@ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo )
{
ReturnStringPadName( buffer );
int numpad_len = buffer.Len();
numpad_len = MAX( numpad_len, MIN_CHAR_COUNT );
numpad_len = std::max( numpad_len, MIN_CHAR_COUNT );
tsize = min( AreaSize.y, AreaSize.x / numpad_len );
tsize = std::min( AreaSize.y, AreaSize.x / numpad_len );
#define CHAR_SIZE_MIN 5
if( aDC->LogicalToDeviceXRel( tsize ) >= CHAR_SIZE_MIN ) // Not drawable when size too small.
......@@ -638,7 +638,7 @@ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo )
return;
shortname_len = MAX( shortname_len, MIN_CHAR_COUNT );
tsize = min( AreaSize.y, AreaSize.x / shortname_len );
tsize = std::min( AreaSize.y, AreaSize.x / shortname_len );
if( aDC->LogicalToDeviceXRel( tsize ) >= CHAR_SIZE_MIN ) // Not drawable in size too small.
{
......
......@@ -245,8 +245,8 @@ void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const
void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel,
wxDC* DC, int aDrawMode, const wxPoint& offset )
{
static vector <char> CornersTypeBuffer;
static vector <wxPoint> CornersBuffer;
static std::vector <char> CornersTypeBuffer;
static std::vector <wxPoint> CornersBuffer;
// outline_mode is false to show filled polys,
// and true to show polygons outlines only (test and debug purposes)
......@@ -615,7 +615,7 @@ int ZONE_CONTAINER::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const
if( aItem )
{
int hisClearance = aItem->GetClearance( NULL );
myClearance = max( hisClearance, myClearance );
myClearance = std::max( hisClearance, myClearance );
}
return myClearance;
......
......@@ -274,24 +274,6 @@ public:
*/
void AddClearanceAreasPolygonsToPolysList( BOARD* aPcb );
/**
* Function CopyPolygonsFromBoolengineToFilledPolysList
* Copy (Add) polygons created by kbool (after Do_Operation) to m_FilledPolysList
* @param aBoolengine = the kbool engine used in Do_Operation
* @return the corner count
*/
int CopyPolygonsFromBoolengineToFilledPolysList( Bool_Engine* aBoolengine );
/**
* Function CopyPolygonsFromFilledPolysListToBoolengine
* Copy (Add) polygons created by kbool (after Do_Operation) to m_FilledPolysList
* @param aBoolengine = kbool engine
* @param aGroup = group in kbool engine (GROUP_A or GROUP_B only)
* @return the corner count
*/
int CopyPolygonsFromFilledPolysListToBoolengine( Bool_Engine* aBoolengine,
GroupType aGroup = GROUP_A );
/**
* Function HitTestForCorner
* tests if the given wxPoint near a corner
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 30 2011)
// C++ code generated with wxFormBuilder (version Apr 10 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_design_rules_aux_helper_class.h"
#include "dialog_design_rules_base.h"
///////////////////////////////////////////////////////////////////////////
......@@ -86,8 +84,10 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
buttonBoxSizer->Add( m_moveUpButton, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
sbSizerUpper->Add( buttonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 );
bpanelNetClassesSizer->Add( sbSizerUpper, 1, wxRIGHT|wxLEFT|wxEXPAND, 5 );
wxStaticBoxSizer* sbSizerNetSelectMain;
......@@ -104,6 +104,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
leftNetSelectBoxSizer->Add( m_leftListCtrl, 1, wxEXPAND|wxTOP, 5 );
sbSizerNetSelectMain->Add( leftNetSelectBoxSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bmiddleSizerNetSelect;
......@@ -129,6 +130,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
bmiddleSizerNetSelect->Add( m_buttonRightSelAll, 0, wxALIGN_BOTTOM|wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
sbSizerNetSelectMain->Add( bmiddleSizerNetSelect, 0, wxALIGN_CENTER_VERTICAL, 5 );
wxBoxSizer* rghtNetSelectBoxSizer;
......@@ -142,14 +144,17 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
rghtNetSelectBoxSizer->Add( m_rightListCtrl, 1, wxEXPAND|wxTOP, 5 );
sbSizerNetSelectMain->Add( rghtNetSelectBoxSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
bpanelNetClassesSizer->Add( sbSizerNetSelectMain, 2, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_panelNetClassesEditor->SetSizer( bpanelNetClassesSizer );
m_panelNetClassesEditor->Layout();
bpanelNetClassesSizer->Fit( m_panelNetClassesEditor );
m_DRnotebook->AddPage( m_panelNetClassesEditor, _("Net Classes Editor"), true );
m_DRnotebook->AddPage( m_panelNetClassesEditor, _("Net Classes Editor"), false );
m_panelGolbalDesignRules = new wxPanel( m_DRnotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
wxBoxSizer* bpanelGlobRulesSizer;
bpanelGlobRulesSizer = new wxBoxSizer( wxVERTICAL );
......@@ -162,7 +167,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
wxString m_OptViaTypeChoices[] = { _("Through via"), _("Blind or buried via") };
int m_OptViaTypeNChoices = sizeof( m_OptViaTypeChoices ) / sizeof( wxString );
m_OptViaType = new wxRadioBox( m_panelGolbalDesignRules, wxID_ANY, _("Default Via Type"), wxDefaultPosition, wxDefaultSize, m_OptViaTypeNChoices, m_OptViaTypeChoices, 1, wxRA_SPECIFY_COLS );
m_OptViaType = new wxRadioBox( m_panelGolbalDesignRules, wxID_ANY, _("Default Via Type:"), wxDefaultPosition, wxDefaultSize, m_OptViaTypeNChoices, m_OptViaTypeChoices, 1, wxRA_SPECIFY_COLS );
m_OptViaType->SetSelection( 0 );
m_OptViaType->SetToolTip( _("Select the current via type.\nTrough via is the usual selection") );
......@@ -176,6 +181,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
sbViasOptionSizer->Add( m_AllowMicroViaCtrl, 0, wxALL|wxEXPAND, 5 );
bDesignRulesUpperSizer->Add( sbViasOptionSizer, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
wxStaticBoxSizer* sbMinSizesSizer;
......@@ -224,16 +230,19 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_SetMicroViasMinDrillCtrl->SetMaxLength( 6 );
fgMinValuesSizer->Add( m_SetMicroViasMinDrillCtrl, 0, wxEXPAND|wxALL, 5 );
sbMinSizesSizer->Add( fgMinValuesSizer, 0, wxEXPAND, 5 );
bDesignRulesUpperSizer->Add( sbMinSizesSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
bpanelGlobRulesSizer->Add( bDesignRulesUpperSizer, 0, wxEXPAND, 5 );
m_staticline1 = new wxStaticLine( m_panelGolbalDesignRules, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bpanelGlobRulesSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_staticTextInfo = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Specific via diameters and track widths, which \ncan be used to replace default Netclass values \non demand, for arbitrary via or track segments."), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextInfo = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Specific via diameters and track widths, which \ncan be used to replace default Netclass values \non demand, for arbitrary vias or track segments."), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextInfo->Wrap( -1 );
bpanelGlobRulesSizer->Add( m_staticTextInfo, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
......@@ -287,6 +296,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_gridViaSizeList->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
sViaSizeBox->Add( m_gridViaSizeList, 0, wxALL|wxEXPAND, 5 );
bDesignRulesLowerSizer->Add( sViaSizeBox, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 );
wxStaticBoxSizer* sbTracksListSizer;
......@@ -347,14 +357,17 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_gridTrackWidthList->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
sbTracksListSizer->Add( m_gridTrackWidthList, 0, wxALL|wxEXPAND, 5 );
bDesignRulesLowerSizer->Add( sbTracksListSizer, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 );
bpanelGlobRulesSizer->Add( bDesignRulesLowerSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_panelGolbalDesignRules->SetSizer( bpanelGlobRulesSizer );
m_panelGolbalDesignRules->Layout();
bpanelGlobRulesSizer->Fit( m_panelGolbalDesignRules );
m_DRnotebook->AddPage( m_panelGolbalDesignRules, _("Global Design Rules"), false );
m_DRnotebook->AddPage( m_panelGolbalDesignRules, _("Global Design Rules"), true );
bMainSizer->Add( m_DRnotebook, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
......@@ -376,10 +389,13 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonCancel, 0, wxALL|wxEXPAND, 5 );
sbSizer2->Add( bSizerButtons, 0, 0, 5 );
bMainSizer->Add( sbSizer2, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
this->SetSizer( bMainSizer );
this->Layout();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 30 2011)
// C++ code generated with wxFormBuilder (version Apr 10 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -11,8 +11,7 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class NETS_LIST_CTRL;
#include "dialog_design_rules_aux_helper_class.h"
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
......@@ -51,7 +50,7 @@ class DIALOG_DESIGN_RULES_BASE : public wxDialog
wxID_ADD_NETCLASS = 1000,
wxID_REMOVE_NETCLASS,
ID_LEFT_TO_RIGHT_COPY,
ID_RIGHT_TO_LEFT_COPY,
ID_RIGHT_TO_LEFT_COPY
};
wxNotebook* m_DRnotebook;
......
......@@ -5,7 +5,8 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2011 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 2009 Dick Hollenbeck, dick@softplc.com
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
......
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_drc.h
// Author: jean-pierre Charras
// Licence: GPL
/////////////////////////////////////////////////////////////////////////////
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2011 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 2009 Dick Hollenbeck, dick@softplc.com
* Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _DIALOG_DRC_H_
#define _DIALOG_DRC_H_
......@@ -18,25 +38,15 @@
#include <class_board.h>
#include <dialog_drc_base.h>
#include <dialog_drclistbox.h>
// forward declarations
class DRCLISTBOX;
class BOARD_DESIGN_SETTINGS;
//end forward declarations
// outside @end control identifiers since wxFormBuilder knows not DRCLISTBOX
#define ID_DRCLISTCTRL 14000
#define ID_POPUP_UNCONNECTED_A 14001
#define ID_POPUP_UNCONNECTED_B 14002
#define ID_POPUP_MARKERS_A 14003
#define ID_POPUP_MARKERS_B 14004
/*!
* DrcDialog class declaration
*/
......@@ -126,266 +136,5 @@ private:
int m_UnconnectedCount;
};
/**
* Class DRC_LIST_MARKERS
* is an implementation of the interface named DRC_ITEM_LIST which uses
* a BOARD instance to fulfill the interface. No ownership is taken of the
* BOARD.
*/
class DRC_LIST_MARKERS : public DRC_ITEM_LIST
{
BOARD* m_board;
public:
DRC_LIST_MARKERS( BOARD* aBoard ) :
m_board(aBoard)
{
}
/* no destructor since we do not own anything to delete, not even the BOARD.
~DRC_LIST_MARKERS() {}
*/
//-----<Interface DRC_ITEM_LIST>---------------------------------------
void DeleteAllItems()
{
m_board->DeleteMARKERs();
}
const DRC_ITEM* GetItem( int aIndex )
{
const MARKER_PCB* marker = m_board->GetMARKER( aIndex );
if( marker )
return &marker->GetReporter();
return NULL;
}
void DeleteItem( int aIndex )
{
MARKER_PCB* marker = m_board->GetMARKER( aIndex );
if( marker )
m_board->Delete( marker );
}
/**
* Function GetCount
* returns the number of items in the list.
*/
int GetCount()
{
return m_board->GetMARKERCount();
}
//-----</Interface DRC_ITEM_LIST>--------------------------------------
};
/**
* Class DRC_LIST_UNCONNECTED
* is an implementation of the interface named DRC_ITEM_LIST which uses
* a vector of pointers to DRC_ITEMs to fulfill the interface. No ownership is taken of the
* vector, which will reside in class DRC
*/
class DRC_LIST_UNCONNECTED : public DRC_ITEM_LIST
{
DRC_LIST* m_vector;
public:
DRC_LIST_UNCONNECTED( DRC_LIST* aList ) :
m_vector(aList)
{
}
/* no destructor since we do not own anything to delete, not even the BOARD.
~DRC_LIST_UNCONNECTED() {}
*/
//-----<Interface DRC_ITEM_LIST>---------------------------------------
void DeleteAllItems()
{
if( m_vector )
{
for( unsigned i=0; i<m_vector->size(); ++i )
delete (*m_vector)[i];
m_vector->clear();
}
}
const DRC_ITEM* GetItem( int aIndex )
{
if( m_vector && (unsigned)aIndex < m_vector->size() )
{
const DRC_ITEM* item = (*m_vector)[aIndex];
return item;
}
return NULL;
}
void DeleteItem( int aIndex )
{
if( m_vector && (unsigned)aIndex < m_vector->size() )
{
delete (*m_vector)[aIndex];
m_vector->erase( m_vector->begin()+aIndex );
}
}
/**
* Function GetCount
* returns the number of items in the list.
*/
int GetCount()
{
if( m_vector )
{
return m_vector->size();
}
return 0;
}
//-----</Interface DRC_ITEM_LIST>--------------------------------------
};
/**
* Class DRCLISTBOX
* is used to display a DRC_ITEM_LIST.
*/
class DRCLISTBOX : public wxHtmlListBox
{
private:
DRC_ITEM_LIST* m_list; ///< wxHtmlListBox does not own the list, I do
public:
DRCLISTBOX( wxWindow* parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = 0, const wxString choices[] = NULL, int unused = 0)
: wxHtmlListBox( parent, id, pos, size, style )
{
m_list = 0;
}
~DRCLISTBOX()
{
delete m_list; // I own it, I destroy it.
}
/**
* Function SetList
* sets the DRC_ITEM_LIST for this listbox. Ownership of the DRC_ITEM_LIST is
* transfered to this DRCLISTBOX.
* @param aList The DRC_ITEM_LIST* containing the DRC_ITEMs which will be
* displayed in the wxHtmlListBox
*/
void SetList( DRC_ITEM_LIST* aList )
{
delete m_list;
m_list = aList;
SetItemCount( aList->GetCount() );
Refresh();
}
/**
* Function GetItem
* returns a requested DRC_ITEM* or NULL.
*/
const DRC_ITEM* GetItem( int aIndex )
{
if( m_list )
{
return m_list->GetItem( aIndex );
}
return NULL;
}
/**
* Function OnGetItem
* returns the html text associated with the DRC_ITEM given by index 'n'.
* @param n An index into the list.
* @return wxString - the simple html text to show in the listbox.
*/
wxString OnGetItem( size_t n ) const
{
if( m_list )
{
const DRC_ITEM* item = m_list->GetItem( (int) n );
if( item )
return item->ShowHtml();
}
return wxString();
}
/**
* Function OnGetItem
* returns the html text associated with the given index 'n'.
* @param n An index into the list.
* @return wxString - the simple html text to show in the listbox.
*/
wxString OnGetItemMarkup( size_t n ) const
{
return OnGetItem( n );
}
/**
* Function DeleteElement
* will delete one of the items in the list.
* @param aIndex The index into the list to delete.
*/
void DeleteItem( int aIndex )
{
if( m_list )
{
int selection = GetSelection();
m_list->DeleteItem( aIndex );
int count = m_list->GetCount();
SetItemCount( count );
// if old selection >= new count
if( selection >= count )
SetSelection( count-1 ); // -1 is "no selection"
Refresh();
}
}
/**
* Function DeleteAllItems
* deletes all items in the list.
*/
void DeleteAllItems()
{
if( m_list )
{
m_list->DeleteAllItems();
SetItemCount(0);
SetSelection( -1 ); // -1 is no selection
Refresh();
}
}
};
#endif // _DIALOG_DRC_H_
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// C++ code generated with wxFormBuilder (version Apr 10 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_drc.h"
#include "dialog_drc_base.h"
///////////////////////////////////////////////////////////////////////////
......@@ -69,13 +67,13 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
m_SetMicroViakMinSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgMinValuesSizer->Add( m_SetMicroViakMinSizeCtrl, 0, wxALL|wxEXPAND, 5 );
bSizer7->Add( fgMinValuesSizer, 1, wxEXPAND, 5 );
wxStaticBoxSizer* ReportFileSizer;
ReportFileSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Create Report File") ), wxHORIZONTAL );
m_CreateRptCtrl = new wxCheckBox( this, ID_CHECKBOX_RPT_FILE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_CreateRptCtrl->SetToolTip( _("Enable writing report to this file") );
ReportFileSizer->Add( m_CreateRptCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
......@@ -89,10 +87,13 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
m_BrowseButton = new wxButton( this, ID_BUTTON_BROWSE_RPT_FILE, _("..."), wxDefaultPosition, wxSize( 50,-1 ), 0 );
ReportFileSizer->Add( m_BrowseButton, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
bSizer7->Add( ReportFileSizer, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
sbSizerOptions->Add( bSizer7, 1, wxEXPAND, 5 );
m_CommandSizer->Add( sbSizerOptions, 1, 0, 5 );
wxBoxSizer* bSizerMessages;
......@@ -105,7 +106,8 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
m_Messages = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxTE_MULTILINE|wxTE_READONLY );
m_Messages->SetMinSize( wxSize( 220,-1 ) );
bSizerMessages->Add( m_Messages, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
bSizerMessages->Add( m_Messages, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_CommandSizer->Add( bSizerMessages, 1, wxEXPAND, 5 );
......@@ -129,12 +131,14 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
bSizer11->Add( m_DeleteAllButton, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 );
m_DeleteCurrentMarkerButton = new wxButton( this, wxID_ANY, _("Delete Current Marker"), wxDefaultPosition, wxDefaultSize, 0 );
m_DeleteCurrentMarkerButton->SetToolTip( _("Delete the marker selected in the listBox below") );
m_DeleteCurrentMarkerButton->SetToolTip( _("Delete the marker selected in the list box below") );
bSizer11->Add( m_DeleteCurrentMarkerButton, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 5 );
m_CommandSizer->Add( bSizer11, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_MainSizer->Add( m_CommandSizer, 0, wxALL|wxEXPAND, 5 );
m_staticTextErrMsg = new wxStaticText( this, wxID_ANY, _("Error Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
......@@ -152,6 +156,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
bSizeClearanceBox->Add( m_ClearanceListBox, 1, wxALL|wxEXPAND, 5 );
m_panelClearanceListBox->SetSizer( bSizeClearanceBox );
m_panelClearanceListBox->Layout();
bSizeClearanceBox->Fit( m_panelClearanceListBox );
......@@ -165,6 +170,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
bSizerUnconnectedBox->Add( m_UnconnectedListBox, 1, wxALL|wxEXPAND, 5 );
m_panelUnconnectedBox->SetSizer( bSizerUnconnectedBox );
m_panelUnconnectedBox->Layout();
bSizerUnconnectedBox->Fit( m_panelUnconnectedBox );
......@@ -178,8 +184,10 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize();
m_MainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 );
this->SetSizer( m_MainSizer );
this->Layout();
m_MainSizer->Fit( this );
......@@ -214,4 +222,5 @@ DIALOG_DRC_CONTROL_BASE::~DIALOG_DRC_CONTROL_BASE()
m_UnconnectedListBox->Disconnect( wxEVT_RIGHT_UP, wxMouseEventHandler( DIALOG_DRC_CONTROL_BASE::OnRightUpUnconnected ), NULL, this );
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnCancelClick ), NULL, this );
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnOkClick ), NULL, this );
}
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 10 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_drc_base__
#define __dialog_drc_base__
#ifndef __DIALOG_DRC_BASE_H__
#define __DIALOG_DRC_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DRCLISTBOX;
#include "dialog_drclistbox.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
......@@ -70,18 +70,18 @@ class DIALOG_DRC_CONTROL_BASE : public wxDialog
wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, overide them in your derived class
virtual void OnReportCheckBoxClicked( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonBrowseRptFileClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnStartdrcClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnListUnconnectedClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnDeleteAllClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnDeleteOneClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnLeftDClickClearance( wxMouseEvent& event ){ event.Skip(); }
virtual void OnRightUpClearance( wxMouseEvent& event ){ event.Skip(); }
virtual void OnLeftDClickUnconnected( wxMouseEvent& event ){ event.Skip(); }
virtual void OnRightUpUnconnected( wxMouseEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnReportCheckBoxClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonBrowseRptFileClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnStartdrcClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnListUnconnectedClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDeleteAllClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDeleteOneClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnLeftDClickClearance( wxMouseEvent& event ) { event.Skip(); }
virtual void OnRightUpClearance( wxMouseEvent& event ) { event.Skip(); }
virtual void OnLeftDClickUnconnected( wxMouseEvent& event ) { event.Skip(); }
virtual void OnRightUpUnconnected( wxMouseEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
public:
......@@ -93,9 +93,10 @@ class DIALOG_DRC_CONTROL_BASE : public wxDialog
wxTextCtrl* m_RptFilenameCtrl;
DRCLISTBOX* m_ClearanceListBox;
DRCLISTBOX* m_UnconnectedListBox;
DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("DRC Control"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_DRC_CONTROL_BASE();
};
#endif //__dialog_drc_base__
#endif //__DIALOG_DRC_BASE_H__
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Dick Hollenbeck, dick@softplc.com
* Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _DIALOG_DRCLISTBOX_H_
#define _DIALOG_DRCLISTBOX_H_
#include <wx/htmllbox.h>
#include <fctsys.h>
#include <pcbnew.h>
#include <class_drawpanel.h>
#include <wxstruct.h>
#include <drc_stuff.h>
#include <class_marker_pcb.h>
#include <class_board.h>
#include <dialog_drc_base.h>
// outside @end control identifiers since wxFormBuilder knows not DRCLISTBOX
#define ID_DRCLISTCTRL 14000
#define ID_POPUP_UNCONNECTED_A 14001
#define ID_POPUP_UNCONNECTED_B 14002
#define ID_POPUP_MARKERS_A 14003
#define ID_POPUP_MARKERS_B 14004
/**
* Class DRC_LIST_MARKERS
* is an implementation of the interface named DRC_ITEM_LIST which uses
* a BOARD instance to fulfill the interface. No ownership is taken of the
* BOARD.
*/
class DRC_LIST_MARKERS : public DRC_ITEM_LIST
{
BOARD* m_board;
public:
DRC_LIST_MARKERS( BOARD* aBoard ) :
m_board(aBoard)
{
}
/* no destructor since we do not own anything to delete, not even the BOARD.
~DRC_LIST_MARKERS() {}
*/
//-----<Interface DRC_ITEM_LIST>---------------------------------------
void DeleteAllItems()
{
m_board->DeleteMARKERs();
}
const DRC_ITEM* GetItem( int aIndex )
{
const MARKER_PCB* marker = m_board->GetMARKER( aIndex );
if( marker )
return &marker->GetReporter();
return NULL;
}
void DeleteItem( int aIndex )
{
MARKER_PCB* marker = m_board->GetMARKER( aIndex );
if( marker )
m_board->Delete( marker );
}
/**
* Function GetCount
* returns the number of items in the list.
*/
int GetCount()
{
return m_board->GetMARKERCount();
}
//-----</Interface DRC_ITEM_LIST>--------------------------------------
};
/**
* Class DRC_LIST_UNCONNECTED
* is an implementation of the interface named DRC_ITEM_LIST which uses
* a vector of pointers to DRC_ITEMs to fulfill the interface. No ownership is taken of the
* vector, which will reside in class DRC
*/
class DRC_LIST_UNCONNECTED : public DRC_ITEM_LIST
{
DRC_LIST* m_vector;
public:
DRC_LIST_UNCONNECTED( DRC_LIST* aList ) :
m_vector(aList)
{
}
/* no destructor since we do not own anything to delete, not even the BOARD.
~DRC_LIST_UNCONNECTED() {}
*/
//-----<Interface DRC_ITEM_LIST>---------------------------------------
void DeleteAllItems()
{
if( m_vector )
{
for( unsigned i=0; i<m_vector->size(); ++i )
delete (*m_vector)[i];
m_vector->clear();
}
}
const DRC_ITEM* GetItem( int aIndex )
{
if( m_vector && (unsigned)aIndex < m_vector->size() )
{
const DRC_ITEM* item = (*m_vector)[aIndex];
return item;
}
return NULL;
}
void DeleteItem( int aIndex )
{
if( m_vector && (unsigned)aIndex < m_vector->size() )
{
delete (*m_vector)[aIndex];
m_vector->erase( m_vector->begin()+aIndex );
}
}
/**
* Function GetCount
* returns the number of items in the list.
*/
int GetCount()
{
if( m_vector )
{
return m_vector->size();
}
return 0;
}
//-----</Interface DRC_ITEM_LIST>--------------------------------------
};
/**
* Class DRCLISTBOX
* is used to display a DRC_ITEM_LIST.
*/
class DRCLISTBOX : public wxHtmlListBox
{
private:
DRC_ITEM_LIST* m_list; ///< wxHtmlListBox does not own the list, I do
public:
DRCLISTBOX( wxWindow* parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = 0, const wxString choices[] = NULL, int unused = 0)
: wxHtmlListBox( parent, id, pos, size, style )
{
m_list = 0;
}
~DRCLISTBOX()
{
delete m_list; // I own it, I destroy it.
}
/**
* Function SetList
* sets the DRC_ITEM_LIST for this listbox. Ownership of the DRC_ITEM_LIST is
* transfered to this DRCLISTBOX.
* @param aList The DRC_ITEM_LIST* containing the DRC_ITEMs which will be
* displayed in the wxHtmlListBox
*/
void SetList( DRC_ITEM_LIST* aList )
{
delete m_list;
m_list = aList;
SetItemCount( aList->GetCount() );
Refresh();
}
/**
* Function GetItem
* returns a requested DRC_ITEM* or NULL.
*/
const DRC_ITEM* GetItem( int aIndex )
{
if( m_list )
{
return m_list->GetItem( aIndex );
}
return NULL;
}
/**
* Function OnGetItem
* returns the html text associated with the DRC_ITEM given by index 'n'.
* @param n An index into the list.
* @return wxString - the simple html text to show in the listbox.
*/
wxString OnGetItem( size_t n ) const
{
if( m_list )
{
const DRC_ITEM* item = m_list->GetItem( (int) n );
if( item )
return item->ShowHtml();
}
return wxString();
}
/**
* Function OnGetItem
* returns the html text associated with the given index 'n'.
* @param n An index into the list.
* @return wxString - the simple html text to show in the listbox.
*/
wxString OnGetItemMarkup( size_t n ) const
{
return OnGetItem( n );
}
/**
* Function DeleteElement
* will delete one of the items in the list.
* @param aIndex The index into the list to delete.
*/
void DeleteItem( int aIndex )
{
if( m_list )
{
int selection = GetSelection();
m_list->DeleteItem( aIndex );
int count = m_list->GetCount();
SetItemCount( count );
// if old selection >= new count
if( selection >= count )
SetSelection( count-1 ); // -1 is "no selection"
Refresh();
}
}
/**
* Function DeleteAllItems
* deletes all items in the list.
*/
void DeleteAllItems()
{
if( m_list )
{
m_list->DeleteAllItems();
SetItemCount(0);
SetSelection( -1 ); // -1 is no selection
Refresh();
}
}
};
#endif // _DIALOG_DRCLISTBOX_H_
......@@ -67,10 +67,11 @@ bool DIALOG_FIND::warpMouse = true;
DIALOG_FIND::DIALOG_FIND( PCB_BASE_FRAME* aParent ) : DIALOG_FIND_BASE( aParent )
{
parent = aParent;
SetFocus();
GetSizer()->SetSizeHints( this );
m_SearchTextCtrl->AppendText( prevSearchString );
m_SearchTextCtrl->SetFocus();
m_SearchTextCtrl->SetSelection( -1, -1 );
m_NoMouseWarpCheckBox->SetValue( !warpMouse );
itemCount = markerCount = 0;
......
......@@ -97,7 +97,7 @@
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer3</property>
<property name="name">bSizerLeft</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
......@@ -370,7 +370,7 @@
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer4</property>
<property name="name">bSizerRight</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
......
......@@ -120,7 +120,7 @@ void DIALOG_GLOBAL_MODULES_FIELDS_EDITION::OnOKClick( wxCommandEvent& event )
m_brdSettings->m_ModuleTextWidth = ReturnValueFromTextCtrl( *m_TicknessValue );
// clip m_ModuleTextWidth to the 1/4 of min size, to keep it always readable
int minsize = min( m_brdSettings->m_ModuleTextSize.x,
int minsize = std::min( m_brdSettings->m_ModuleTextSize.x,
m_brdSettings->m_ModuleTextSize.y ) / 4;
if( m_brdSettings->m_ModuleTextWidth > minsize )
m_brdSettings->m_ModuleTextWidth = minsize;
......
......@@ -323,10 +323,10 @@ bool PCB_EDIT_FRAME::Add45DegreeSegment( wxDC* aDC )
dy1 = curTrack->m_End.y - curTrack->m_Start.y;
// Segments should have a min length.
if( max( abs( dx0 ), abs( dy0 ) ) < ( segm_step_45 * 2 ) )
if( std::max( abs( dx0 ), abs( dy0 ) ) < ( segm_step_45 * 2 ) )
return false;
if( max( abs( dx1 ), abs( dy1 ) ) < ( segm_step_45 * 2 ) )
if( std::max( abs( dx1 ), abs( dy1 ) ) < ( segm_step_45 * 2 ) )
return false;
// Create a new segment and connect it with the previous 2 segments.
......@@ -851,7 +851,7 @@ void CalculateSegmentEndPoint( const wxPoint& aPosition, int ox, int oy, int* fx
break;
case 45:
deltax = min( deltax, deltay );
deltax = std::min( deltax, deltay );
deltay = deltax;
// Recalculate the signs for deltax and deltaY.
......@@ -946,7 +946,7 @@ void ComputeBreakPoint( TRACK* track, int SegmentCount, wxPoint end )
break;
case 45:
iDx = min( iDx, iDy );
iDx = std::min( iDx, iDy );
iDy = iDx;
// Recalculate the signs for deltax and deltaY.
......
......@@ -128,7 +128,7 @@ void Build_Holes_List( BOARD* aPcb,
new_hole.m_Tool_Reference = -1; // Flag is: Not initialized
new_hole.m_Hole_Orient = pad->GetOrientation();
new_hole.m_Hole_Shape = 0; // hole shape: round
new_hole.m_Hole_Diameter = min( pad->GetDrillSize().x, pad->GetDrillSize().y );
new_hole.m_Hole_Diameter = std::min( pad->GetDrillSize().x, pad->GetDrillSize().y );
new_hole.m_Hole_Size.x = new_hole.m_Hole_Size.y = new_hole.m_Hole_Diameter;
if( pad->GetDrillShape() != PAD_CIRCLE )
......
......@@ -317,7 +317,7 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
if( GetBoard()->GetCopperLayerCount() < 2 ) // Single layer
ll = LAYER_N_BACK;
else if( ll == LAYER_N_FRONT )
ll = max( LAYER_N_BACK, GetBoard()->GetCopperLayerCount() - 2 );
ll = std::max( LAYER_N_BACK, GetBoard()->GetCopperLayerCount() - 2 );
else
ll--;
......
......@@ -59,7 +59,7 @@ static bool Join( wxPoint* res, wxPoint a0, wxPoint a1, wxPoint b0, wxPoint b1 )
t = ((double) b1.y * b0.x - (double) b1.x * b0.y ) / denom;
t = min( max( t, 0.0 ), 1.0 );
t = std::min( std::max( t, 0.0 ), 1.0 );
res->x = KiROUND( a0.x + t * a1.x );
res->y = KiROUND( a0.y + t * a1.y );
......@@ -83,7 +83,7 @@ bool Project( wxPoint* res, wxPoint on_grid, const TRACK* track )
double( on_grid.y - track->m_Start.y ) * vec.y;
t /= (double) vec.x * vec.x + (double) vec.y * vec.y;
t = min( max( t, 0.0 ), 1.0 );
t = std::min( std::max( t, 0.0 ), 1.0 );
res->x = KiROUND( track->m_Start.x + t * vec.x );
res->y = KiROUND( track->m_Start.y + t * vec.y );
......
......@@ -48,6 +48,7 @@
#include <pcb_parser.h>
using namespace std;
double PCB_PARSER::parseDouble() throw( IO_ERROR )
{
......
......@@ -300,7 +300,7 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
int diameter;
if( drillShapeOpt == PRINT_PARAMETERS::SMALL_DRILL_SHAPE )
diameter = min( SMALL_DRILL, pt_trace->GetDrillValue() );
diameter = std::min( SMALL_DRILL, pt_trace->GetDrillValue() );
else
diameter = pt_trace->GetDrillValue();
......@@ -349,8 +349,8 @@ static void Print_Module( EDA_DRAW_PANEL* aPanel, wxDC* aDC, MODULE* aModule,
case PRINT_PARAMETERS::SMALL_DRILL_SHAPE:
{
wxSize sz( min( SMALL_DRILL, pad->GetDrillSize().x ),
min( SMALL_DRILL, pad->GetDrillSize().y ) );
wxSize sz( std::min( SMALL_DRILL, pad->GetDrillSize().x ),
std::min( SMALL_DRILL, pad->GetDrillSize().y ) );
pad->SetDrillSize( sz );
}
......
......@@ -304,7 +304,7 @@ void PCB_BASE_FRAME::DrawGeneralRatsnest( wxDC* aDC, int aNetcode )
* @return last subratsnest id in use
*/
static int tst_links_between_blocks( NETINFO_ITEM* aNetinfo,
vector<RATSNEST_ITEM>& aRatsnestBuffer )
std::vector<RATSNEST_ITEM>& aRatsnestBuffer )
{
int subratsnest_id, min_id;
RATSNEST_ITEM* link, * best_link;
......
......@@ -135,9 +135,10 @@ int ZONE_CONTAINER::Fill_Zone_Areas_With_Segments()
int istart, iend; // index od the starting and the endif corner of one filled area in m_FilledPolysList
int margin = m_ZoneMinThickness * 2 / 10;
margin = max (2, margin);
int minwidth = Mils2iu( 2 );
margin = std::max ( minwidth, margin );
int step = m_ZoneMinThickness - margin;
step = max(step, 2);
step = std::max( step, minwidth );
// Read all filled areas in m_FilledPolysList
m_FillSegmList.clear();
......
......@@ -174,7 +174,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
* Note also the "local" clearance is used for clearance between non copper items
* or items like texts on copper layers
*/
int zone_clearance = max( m_ZoneClearance, GetClearance() );
int zone_clearance = std::max( m_ZoneClearance, GetClearance() );
zone_clearance += margin;
/* store holes (i.e. tracks and pads areas as polygons outlines)
......@@ -187,7 +187,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
EDA_RECT item_boundingbox;
EDA_RECT zone_boundingbox = GetBoundingBox();
int biggest_clearance = aPcb->GetBiggestClearanceValue();
biggest_clearance = max( biggest_clearance, zone_clearance );
biggest_clearance = std::max( biggest_clearance, zone_clearance );
zone_boundingbox.Inflate( biggest_clearance );
/*
......@@ -244,7 +244,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
if( item_boundingbox.Intersects( zone_boundingbox ) )
{
int clearance = max( zone_clearance, item_clearance );
int clearance = std::max( zone_clearance, item_clearance );
pad->TransformShapeWithClearanceToPolygon( cornerBufferPolysToSubstract,
clearance,
s_CircleToSegmentsCount,
......@@ -291,7 +291,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
if( item_boundingbox.Intersects( zone_boundingbox ) )
{
int clearance = max( zone_clearance, item_clearance );
int clearance = std::max( zone_clearance, item_clearance );
track->TransformShapeWithClearanceToPolygon( cornerBufferPolysToSubstract,
clearance,
s_CircleToSegmentsCount,
......
......@@ -66,7 +66,7 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector<CPolyPt>& aCornerBuffe
EDA_RECT item_boundingbox;
EDA_RECT zone_boundingbox = aZone->GetBoundingBox();
int biggest_clearance = aPcb->GetBiggestClearanceValue();
biggest_clearance = max( biggest_clearance, zone_clearance );
biggest_clearance = std::max( biggest_clearance, zone_clearance );
zone_boundingbox.Inflate( biggest_clearance );
// half size of the pen used to draw/plot zones outlines
......@@ -109,8 +109,8 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector<CPolyPt>& aCornerBuffe
if( copperThickness < 0 )
copperThickness = 0;
startpoint.x = min( pad->GetSize().x, copperThickness );
startpoint.y = min( pad->GetSize().y, copperThickness );
startpoint.x = std::min( pad->GetSize().x, copperThickness );
startpoint.y = std::min( pad->GetSize().y, copperThickness );
startpoint.x /= 2;
startpoint.y /= 2;
......
......@@ -174,8 +174,8 @@ int SaveCopyOfZones( PICKED_ITEMS_LIST& aPickList, BOARD* aPcb, int aNetCode, in
* @param aPcb = the Board
*
* aAuxiliaryList is a list of pickers updated by zone algorithms:
* In this list are put zone taht were added or deleted during the zone combine process
* aPickList :is a list of zone that can be modified (changed or deleted, or not modified)
* This list cointains zones which were added or deleted during the zones combine process
* aPickList :is a list of zones that can be modified (changed or deleted, or not modified)
* >> if the picked zone is not changed, it is removed from list
* >> if the picked zone was deleted (i.e. not found in boad list), the picker is modified:
* - its status becomes UR_DELETED
......@@ -187,7 +187,8 @@ int SaveCopyOfZones( PICKED_ITEMS_LIST& aPickList, BOARD* aPcb, int aNetCode, in
* After aPickList is cleaned, the aAuxiliaryList is read
* All pickers flagged UR_NEW are moved to aPickList
* (the corresponding zones are zone that were created by the zone combine process, mainly when adding cutaout areas)
* At the end of the update process the aAuxiliaryList must be void, because all pickers created by the combine process
* At the end of the update process the aAuxiliaryList must be void,
* because all pickers created by the combine process
* must have been removed (removed for new and deleted zones, or moved in aPickList.)
* If not an error is set.
*/
......
......@@ -23,15 +23,6 @@
#include <polygons_defs.h>
// inflection modes for DS_LINE and DS_LINE_VERTEX, used in math_for_graphics.cpp
/*enum {
IM_NONE = 0,
IM_90_45,
IM_45_90,
IM_90
};
*/
class CRect
{
public:
......@@ -58,18 +49,6 @@ public:
}
};
/*
class CArc
{
public:
enum { ARC_STEPS = 16 }; // arc approximation step is 16 segm / 90 degres
int style;
int xi, yi, xf, yf;
int n_steps; // number of straight-line segments in gpc_poly
bool bFound;
};
*/
class CPolyPt : public wxPoint
{
public:
......
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