see changelog
This commit is contained in:
parent
ed0265cb77
commit
f85ade75d8
|
@ -3,6 +3,15 @@ Started 2007-June-11
|
|||
|
||||
Please add newer entries at the top, list the date and your name with
|
||||
email address.
|
||||
|
||||
2007-Dec-16 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
|
||||
================================================================================
|
||||
+pcbnew:
|
||||
Move Zone outlines added
|
||||
Zone outline DRC works (needs improvements)
|
||||
some bugs solved, but polyline.cpp still needs work.
|
||||
gendrill: code cleaning.
|
||||
|
||||
2007-Dec-14 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
|
||||
================================================================================
|
||||
+pcbnew:
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
#define MACHINE "PC"
|
||||
#define NB_CLES 16
|
||||
#define POSITION_LICENCE 50
|
||||
#define POSITION_CLE 250
|
||||
#define TAILLE_LICENCE 256
|
||||
|
|
@ -228,25 +228,40 @@ wxString FullFileName, ShortLibName, mask;
|
|||
|
||||
Update();
|
||||
mask = wxT("*") + LibExtBuffer;
|
||||
FullFileName = EDA_FileSelector( _("Libraries"),
|
||||
g_RealLibDirBuffer, /* Chemin par defaut */
|
||||
wxEmptyString, /* nom fichier par defaut */
|
||||
LibExtBuffer, /* extension par defaut */
|
||||
mask, /* Masque d'affichage */
|
||||
this,
|
||||
0,
|
||||
TRUE /* ne chage pas de repertoire courant */
|
||||
);
|
||||
if (FullFileName == wxEmptyString ) return;
|
||||
|
||||
ShortLibName = MakeReducedFileName(FullFileName,g_RealLibDirBuffer,LibExtBuffer);
|
||||
wxFileDialog FilesDialog(this, _("Library Files:"), g_RealLibDirBuffer,
|
||||
wxEmptyString, mask,
|
||||
wxFD_DEFAULT_STYLE | wxFD_MULTIPLE);
|
||||
|
||||
g_LibName_List.Insert(ShortLibName, ii);
|
||||
FilesDialog.ShowModal();
|
||||
wxArrayString Filenames;
|
||||
FilesDialog.GetFilenames(Filenames);
|
||||
|
||||
if ( Filenames.GetCount() == 0 )
|
||||
return;
|
||||
|
||||
for ( unsigned jj = 0; jj < Filenames.GetCount(); jj ++ )
|
||||
{
|
||||
FullFileName = Filenames[jj];
|
||||
ShortLibName = MakeReducedFileName(FullFileName,g_RealLibDirBuffer,LibExtBuffer);
|
||||
|
||||
//Add or insert new library name
|
||||
if ( g_LibName_List.Index(ShortLibName) == wxNOT_FOUND)
|
||||
{
|
||||
ListModIsModified = 1;
|
||||
g_LibName_List.Insert(ShortLibName, ii++);
|
||||
}
|
||||
else
|
||||
{
|
||||
wxString msg;
|
||||
msg << wxT("<") << ShortLibName << wxT("> : ") << _("Library already in use");
|
||||
DisplayError(this, msg);
|
||||
}
|
||||
}
|
||||
|
||||
g_UserLibDirBuffer = m_LibDirCtrl->GetValue();
|
||||
SetRealLibraryPath( wxT("modules") );
|
||||
listlib();
|
||||
ListModIsModified = 1;
|
||||
|
||||
m_Parent->BuildFootprintListBox();
|
||||
|
||||
|
@ -282,23 +297,37 @@ wxString FullFileName, ShortLibName, mask;
|
|||
|
||||
Update();
|
||||
mask = wxT("*") + g_EquivExtBuffer;
|
||||
FullFileName = EDA_FileSelector( _("Equiv"),
|
||||
g_RealLibDirBuffer, /* Chemin par defaut */
|
||||
wxEmptyString, /* nom fichier par defaut */
|
||||
g_EquivExtBuffer, /* extension par defaut */
|
||||
mask, /* Masque d'affichage */
|
||||
this,
|
||||
0,
|
||||
TRUE /* ne chage pas de repertoire courant */
|
||||
);
|
||||
|
||||
if (FullFileName == wxEmptyString ) return;
|
||||
wxFileDialog FilesDialog(this, _("Equiv Files:"), g_RealLibDirBuffer,
|
||||
wxEmptyString, mask,
|
||||
wxFD_DEFAULT_STYLE | wxFD_MULTIPLE);
|
||||
|
||||
ShortLibName = MakeReducedFileName(FullFileName,g_RealLibDirBuffer,g_EquivExtBuffer);
|
||||
FilesDialog.ShowModal();
|
||||
wxArrayString Filenames;
|
||||
FilesDialog.GetFilenames(Filenames);
|
||||
|
||||
g_ListName_Equ.Insert(ShortLibName, ii);
|
||||
if ( Filenames.GetCount() == 0 )
|
||||
return;
|
||||
|
||||
/* Mise a jour de l'affichage */
|
||||
for ( unsigned jj = 0; jj < Filenames.GetCount(); jj ++ )
|
||||
{
|
||||
FullFileName = Filenames[jj];
|
||||
ShortLibName = MakeReducedFileName(FullFileName,g_RealLibDirBuffer,g_EquivExtBuffer);
|
||||
|
||||
//Add or insert new equiv library name
|
||||
if ( g_ListName_Equ.Index(ShortLibName) == wxNOT_FOUND)
|
||||
{
|
||||
g_ListName_Equ.Insert(ShortLibName, ii++);
|
||||
}
|
||||
else
|
||||
{
|
||||
wxString msg;
|
||||
msg << wxT("<") << ShortLibName << wxT("> : ") << _("Library already in use");
|
||||
DisplayError(this, msg);
|
||||
}
|
||||
}
|
||||
|
||||
/* Update display list */
|
||||
g_UserLibDirBuffer = m_LibDirCtrl->GetValue();
|
||||
SetRealLibraryPath( wxT("modules") );
|
||||
listlib();
|
||||
|
|
|
@ -364,30 +364,37 @@ wxString FullLibName,ShortLibName, Mask;
|
|||
}
|
||||
|
||||
Mask = wxT("*") + g_LibExtBuffer;
|
||||
FullLibName = EDA_FileSelector( _("Library files:"),
|
||||
g_RealLibDirBuffer, /* Chemin par defaut */
|
||||
wxEmptyString, /* nom fichier par defaut */
|
||||
g_LibExtBuffer, /* extension par defaut */
|
||||
Mask, /* Masque d'affichage */
|
||||
this,
|
||||
wxFD_OPEN,
|
||||
TRUE
|
||||
);
|
||||
|
||||
if ( FullLibName.IsEmpty() ) return;
|
||||
wxFileDialog FilesDialog(this, _("Library files:"), g_RealLibDirBuffer,
|
||||
wxEmptyString, Mask,
|
||||
wxFD_DEFAULT_STYLE | wxFD_MULTIPLE);
|
||||
|
||||
ShortLibName = MakeReducedFileName(FullLibName,g_RealLibDirBuffer,g_LibExtBuffer);
|
||||
FilesDialog.ShowModal();
|
||||
wxArrayString Filenames;
|
||||
FilesDialog.GetFilenames(Filenames);
|
||||
|
||||
//Add or insert new library name
|
||||
if (FindLibrary(ShortLibName) == NULL)
|
||||
for ( unsigned jj = 0; jj < Filenames.GetCount(); jj ++ )
|
||||
{
|
||||
m_LibListChanged = TRUE;
|
||||
g_LibName_List.Insert(ShortLibName, ii);
|
||||
m_ListLibr->Clear();
|
||||
m_ListLibr->InsertItems(g_LibName_List, 0);
|
||||
}
|
||||
FullLibName = Filenames[jj];
|
||||
ShortLibName = MakeReducedFileName(FullLibName,g_RealLibDirBuffer,g_LibExtBuffer);
|
||||
if ( ShortLibName.IsEmpty() ) //Just in case...
|
||||
continue;
|
||||
//Add or insert new library name
|
||||
if (FindLibrary(ShortLibName) == NULL)
|
||||
{
|
||||
m_LibListChanged = TRUE;
|
||||
g_LibName_List.Insert(ShortLibName, ii);
|
||||
m_ListLibr->Clear();
|
||||
m_ListLibr->InsertItems(g_LibName_List, 0);
|
||||
}
|
||||
|
||||
else DisplayError(this, _("Library already in use"));
|
||||
else
|
||||
{
|
||||
wxString msg;
|
||||
msg << wxT("<") << ShortLibName << wxT("> : ") << _("Library already in use");
|
||||
DisplayError(this, msg);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -561,8 +561,8 @@ enum main_id {
|
|||
ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE,
|
||||
ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE,
|
||||
ID_POPUP_PCB_DELETE_ZONE_CUTOUT,
|
||||
ID_POPUP_ZONE_UNUSED2,
|
||||
ID_POPUP_ZONE_UNUSED3,
|
||||
ID_POPUP_PCB_MOVE_ZONE_OUTLINES,
|
||||
ID_POPUP_PCB_PLACE_ZONE_OUTLINES,
|
||||
ID_POPUP_ZONE_UNUSED4,
|
||||
|
||||
ID_POPUP_PCB_DELETE_MARKER,
|
||||
|
|
|
@ -554,13 +554,15 @@ public:
|
|||
bool IsNewCorner );
|
||||
|
||||
/**
|
||||
* Function End_Move_Zone_Corner
|
||||
* Terminates a move corner in a zone outline
|
||||
* Function End_Move_Zone_Corner_Or_Outlines
|
||||
* Terminates a move corner in a zone outline, or a move zone outlines
|
||||
* @param DC = current Device Context (can be NULL)
|
||||
* @param zone_container: the given zone
|
||||
*/
|
||||
void End_Move_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_container );
|
||||
void End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container );
|
||||
|
||||
/**
|
||||
* Function End_Move_Zone_Corner
|
||||
* Function End_Move_Zone_Corner_Or_Outlines
|
||||
* Remove the currently selected corner in a zone outline
|
||||
* the .m_CornerSelection is used as corner selection
|
||||
*/
|
||||
|
@ -577,7 +579,15 @@ public:
|
|||
*/
|
||||
void Delete_Zone_Contour( wxDC* DC, ZONE_CONTAINER* zone_container );
|
||||
|
||||
// Target handling
|
||||
/**
|
||||
* Function Start_Move_Zone_Outlines
|
||||
* Initialise parametres to move an existing zone outlines.
|
||||
* @param DC = current Device Context (can be NULL)
|
||||
* @param zone_container: the given zone to move
|
||||
*/
|
||||
void Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container );
|
||||
|
||||
// Target handling
|
||||
MIREPCB* Create_Mire( wxDC* DC );
|
||||
void Delete_Mire( MIREPCB* MirePcb, wxDC* DC );
|
||||
void StartMove_Mire( MIREPCB* MirePcb, wxDC* DC );
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
// Purpose:
|
||||
// Author: jean-pierre Charras
|
||||
// Modified by:
|
||||
// Created: 13/01/2008 17:26:27
|
||||
// Created: 13/01/2008 17:26:dialog_gendrill
|
||||
// RCS-ID:
|
||||
// Copyright: License GNU
|
||||
// Licence:
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Generated by DialogBlocks (unregistered), 13/01/2008 17:26:27
|
||||
// Generated by DialogBlocks (unregistered), 13/01/2008 17:26:dialog_gendrill
|
||||
|
||||
#ifndef _DIALOG_GENDRILL_H_
|
||||
#define _DIALOG_GENDRILL_H_
|
||||
|
@ -149,14 +149,15 @@ private:
|
|||
void InitDisplayParams(void);
|
||||
void SetParams(void);
|
||||
void GenDrillFiles( wxCommandEvent& event );
|
||||
void GenDrillMap( int format );
|
||||
void GenDrillMap( std::vector<DRILL_TOOL> & buffer, int format );
|
||||
void UpdatePrecisionOptions( wxCommandEvent& event );
|
||||
void UpdateConfig();
|
||||
int Plot_Drill_PcbMap( DRILL_TOOL* buffer, int format );
|
||||
void GenDrillReport();
|
||||
int Gen_Liste_Forets( DRILL_TOOL* buffer, bool print_header );
|
||||
int Create_Drill_File_EXCELLON( DRILL_TOOL* buffer );
|
||||
int Plot_Drill_PcbMap( std::vector<DRILL_TOOL> & buffer, int format );
|
||||
void GenDrillReport( std::vector<DRILL_TOOL> & buffer );
|
||||
int Gen_Liste_Forets( std::vector<DRILL_TOOL> & buffer, bool print_header );
|
||||
int Create_Drill_File_EXCELLON( std::vector<DRILL_TOOL> & buffer );
|
||||
void Init_Drill();
|
||||
int Gen_Liste_Tools( std::vector<DRILL_TOOL> & buffer, bool print_header );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -364,29 +364,34 @@ wxString mask = wxT("*");
|
|||
mask += LibExtBuffer;
|
||||
g_RealLibDirBuffer.Replace( wxT("\\"), wxT("/"));
|
||||
|
||||
fullfilename = EDA_FileSelector( _("library files:"),
|
||||
g_RealLibDirBuffer, /* Chemin par defaut */
|
||||
wxEmptyString, /* nom fichier par defaut */
|
||||
LibExtBuffer, /* extension par defaut */
|
||||
mask, /* Masque d'affichage */
|
||||
this,
|
||||
0,
|
||||
TRUE
|
||||
);
|
||||
wxFileDialog FilesDialog(this, _("Library Files:"), g_RealLibDirBuffer,
|
||||
wxEmptyString, mask,
|
||||
wxFD_DEFAULT_STYLE | wxFD_MULTIPLE);
|
||||
|
||||
if ( fullfilename.IsEmpty() ) return;
|
||||
FilesDialog.ShowModal();
|
||||
wxArrayString Filenames;
|
||||
FilesDialog.GetFilenames(Filenames);
|
||||
|
||||
ShortLibName =
|
||||
MakeReducedFileName(fullfilename, g_RealLibDirBuffer, LibExtBuffer);
|
||||
|
||||
//Add or insert new library name
|
||||
if ( g_LibName_List.Index(ShortLibName) == wxNOT_FOUND)
|
||||
for ( unsigned jj = 0; jj < Filenames.GetCount(); jj ++ )
|
||||
{
|
||||
m_LibModified = TRUE;
|
||||
g_LibName_List.Insert(ShortLibName, ii);
|
||||
m_ListLibr->Clear();
|
||||
m_ListLibr->InsertItems(g_LibName_List, 0);
|
||||
fullfilename = Filenames[jj];
|
||||
ShortLibName =
|
||||
MakeReducedFileName(fullfilename, g_RealLibDirBuffer, LibExtBuffer);
|
||||
|
||||
//Add or insert new library name
|
||||
if ( g_LibName_List.Index(ShortLibName) == wxNOT_FOUND)
|
||||
{
|
||||
m_LibModified = TRUE;
|
||||
g_LibName_List.Insert(ShortLibName, ii);
|
||||
m_ListLibr->Clear();
|
||||
m_ListLibr->InsertItems(g_LibName_List, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
wxString msg;
|
||||
msg << wxT("<") << ShortLibName << wxT("> : ") << _("Library already in use");
|
||||
DisplayError(this, msg);
|
||||
}
|
||||
}
|
||||
else DisplayError(this, _("Library exists! No Change"));
|
||||
}
|
||||
|
||||
|
|
|
@ -69,8 +69,12 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
case ID_POPUP_PCB_DELETE_EDGE_ZONE:
|
||||
case ID_POPUP_PCB_FILL_ALL_ZONES:
|
||||
case ID_POPUP_PCB_PLACE_ZONE_CORNER:
|
||||
case ID_POPUP_PCB_PLACE_ZONE_OUTLINES:
|
||||
case ID_POPUP_PCB_EDIT_ZONE_PARAMS:
|
||||
case ID_POPUP_PCB_DELETE_ZONE:
|
||||
case ID_POPUP_PCB_MOVE_ZONE_CORNER:
|
||||
case ID_POPUP_PCB_MOVE_ZONE_OUTLINES:
|
||||
case ID_POPUP_PCB_ADD_ZONE_CORNER:
|
||||
case ID_POPUP_PCB_DELETE_TRACKSEG:
|
||||
case ID_POPUP_PCB_DELETE_TRACK:
|
||||
case ID_POPUP_PCB_DELETE_TRACKNET:
|
||||
|
@ -488,6 +492,14 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
}
|
||||
|
||||
case ID_POPUP_PCB_MOVE_ZONE_OUTLINES:
|
||||
{
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
ZONE_CONTAINER * zone_cont = (ZONE_CONTAINER*)GetCurItem();
|
||||
Start_Move_Zone_Outlines(&dc, zone_cont);
|
||||
break;
|
||||
}
|
||||
|
||||
case ID_POPUP_PCB_ADD_ZONE_CORNER:
|
||||
{
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
|
@ -505,11 +517,12 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
}
|
||||
|
||||
case ID_POPUP_PCB_PLACE_ZONE_OUTLINES:
|
||||
case ID_POPUP_PCB_PLACE_ZONE_CORNER:
|
||||
{
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
ZONE_CONTAINER * zone_cont = (ZONE_CONTAINER*)GetCurItem();
|
||||
End_Move_Zone_Corner(&dc, zone_cont);
|
||||
End_Move_Zone_Corner_Or_Outlines(&dc, zone_cont);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "common.h"
|
||||
#include "plot_common.h"
|
||||
#include "trigo.h"
|
||||
|
@ -29,9 +33,16 @@
|
|||
class DRILL_TOOL
|
||||
{
|
||||
public:
|
||||
int m_Diameter;
|
||||
int m_TotalCount;
|
||||
int m_OvalCount;
|
||||
int m_Diameter;
|
||||
public:
|
||||
DRILL_TOOL( int diametre )
|
||||
{
|
||||
m_TotalCount = 0;
|
||||
m_OvalCount = 0;
|
||||
m_Diameter = diametre;
|
||||
}
|
||||
};
|
||||
|
||||
/* drill precision format */
|
||||
|
@ -63,16 +74,17 @@ static void PlotOvalDrillSymbol( const wxPoint& position,
|
|||
int format );
|
||||
|
||||
/* Local Variables : */
|
||||
static int s_DrillToolsCount; /* Nombre de forets a utiliser */
|
||||
static float conv_unit; /* coeff de conversion des unites drill / pcb */
|
||||
static int s_Unit_Drill_is_Inch = TRUE; /* INCH,LZ (2:4) */
|
||||
static int s_Zeros_Format = DECIMAL_FORMAT;
|
||||
static DrillPrecision s_Precision( 2, 4 );
|
||||
static float conv_unit; /* coeff de conversion des unites drill / pcb */
|
||||
static int s_Unit_Drill_is_Inch = TRUE; /* INCH,LZ (2:4) */
|
||||
static int s_Zeros_Format = DECIMAL_FORMAT;
|
||||
static DrillPrecision s_Precision( 2, 4 );
|
||||
|
||||
static bool DrillOriginIsAuxAxis; // Axis selection (main / auxiliary) for Drill Origin coordinates
|
||||
static wxPoint File_Drill_Offset; /* Offset des coord de percage pour le fichier généré */
|
||||
static bool Minimal = false;
|
||||
static bool Mirror = true;
|
||||
static bool DrillOriginIsAuxAxis; // Axis selection (main / auxiliary) for Drill Origin coordinates
|
||||
static wxPoint File_Drill_Offset; /* Offset des coord de percage pour le fichier généré */
|
||||
static bool Minimal = false;
|
||||
static bool Mirror = true;
|
||||
|
||||
static std::vector<DRILL_TOOL> s_ToolListBuffer;
|
||||
|
||||
// Keywords for read and write config
|
||||
#define ZerosFormatKey wxT( "DrillZerosFormat" )
|
||||
|
@ -83,16 +95,24 @@ static bool Mirror = true;
|
|||
#define UnitDrillInchKey wxT( "DrillUnit" )
|
||||
#define DrillOriginIsAuxAxisKey wxT( "DrillAuxAxis" )
|
||||
|
||||
#include "dialog_gendrill.cpp" // Dialog box for drill file generation
|
||||
#include "dialog_gendrill.cpp" // Dialog box for drill file generation
|
||||
|
||||
|
||||
/**********************************************/
|
||||
void WinEDA_DrillFrame::InitDisplayParams(void)
|
||||
/**********************************************/
|
||||
/* some param values initialisation before display dialog window
|
||||
*/
|
||||
/* Compare function used for sorting tools */
|
||||
static bool CmpDrillDiameterTool( const DRILL_TOOL& a, const DRILL_TOOL& b )
|
||||
{
|
||||
wxString msg;
|
||||
return a.m_Diameter < b.m_Diameter;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************/
|
||||
void WinEDA_DrillFrame::InitDisplayParams( void )
|
||||
/**********************************************/
|
||||
|
||||
/* some param values initialisation before display dialog window
|
||||
*/
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
if( s_Zeros_Format==DECIMAL_FORMAT )
|
||||
m_Choice_Precision->Enable( false );
|
||||
if( DrillOriginIsAuxAxis )
|
||||
|
@ -103,76 +123,86 @@ void WinEDA_DrillFrame::InitDisplayParams(void)
|
|||
if( s_Zeros_Format==DECIMAL_FORMAT )
|
||||
m_Choice_Precision->Enable( false );
|
||||
|
||||
msg = ReturnStringFromValue( g_UnitMetric, g_DesignSettings.m_ViaDrill, m_Parent->m_InternalUnits );
|
||||
msg += ReturnUnitSymbol( g_UnitMetric );
|
||||
m_ViaDrillValue->SetLabel(msg);
|
||||
msg = ReturnStringFromValue( g_UnitMetric,
|
||||
g_DesignSettings.m_ViaDrill,
|
||||
m_Parent->m_InternalUnits );
|
||||
msg += ReturnUnitSymbol( g_UnitMetric );
|
||||
m_ViaDrillValue->SetLabel( msg );
|
||||
|
||||
msg = ReturnStringFromValue( g_UnitMetric, g_DesignSettings.m_MicroViaDrill, m_Parent->m_InternalUnits );
|
||||
msg += ReturnUnitSymbol( g_UnitMetric );
|
||||
m_MicroViaDrillValue->SetLabel(msg);
|
||||
msg = ReturnStringFromValue( g_UnitMetric,
|
||||
g_DesignSettings.m_MicroViaDrill,
|
||||
m_Parent->m_InternalUnits );
|
||||
msg += ReturnUnitSymbol( g_UnitMetric );
|
||||
m_MicroViaDrillValue->SetLabel( msg );
|
||||
|
||||
msg.Empty();
|
||||
msg << g_HPGL_Pen_Num;
|
||||
m_PenNum->SetValue(msg);
|
||||
msg.Empty();
|
||||
msg << g_HPGL_Pen_Num;
|
||||
m_PenNum->SetValue( msg );
|
||||
|
||||
msg.Empty();
|
||||
msg << g_HPGL_Pen_Speed;
|
||||
m_PenSpeed->SetValue(msg);
|
||||
msg.Empty();
|
||||
msg << g_HPGL_Pen_Speed;
|
||||
m_PenSpeed->SetValue( msg );
|
||||
|
||||
// See if we have some buried vias or/and microvias, and display microvias drill value if so
|
||||
m_ThroughViasCount = 0;
|
||||
m_MicroViasCount = 0;
|
||||
m_BlindOrBuriedViasCount = 0;
|
||||
for ( TRACK * track = m_Parent->m_Pcb->m_Track; track != NULL; track = track->Next() )
|
||||
{
|
||||
if ( track->Type() != TYPEVIA ) continue;
|
||||
if ( track->Shape() == VIA_THROUGH )
|
||||
m_ThroughViasCount++;
|
||||
else if ( track->Shape() == VIA_MICROVIA )
|
||||
m_MicroViasCount++;
|
||||
else if ( track->Shape() == VIA_BLIND_BURIED )
|
||||
m_BlindOrBuriedViasCount++;
|
||||
}
|
||||
m_MicroViasDrillSizer->Enable(m_MicroViasCount);
|
||||
m_MicroViaDrillValue->Enable(m_MicroViasCount);
|
||||
// See if we have some buried vias or/and microvias, and display microvias drill value if so
|
||||
m_ThroughViasCount = 0;
|
||||
m_MicroViasCount = 0;
|
||||
m_BlindOrBuriedViasCount = 0;
|
||||
for( TRACK* track = m_Parent->m_Pcb->m_Track; track != NULL; track = track->Next() )
|
||||
{
|
||||
if( track->Type() != TYPEVIA )
|
||||
continue;
|
||||
if( track->Shape() == VIA_THROUGH )
|
||||
m_ThroughViasCount++;
|
||||
else if( track->Shape() == VIA_MICROVIA )
|
||||
m_MicroViasCount++;
|
||||
else if( track->Shape() == VIA_BLIND_BURIED )
|
||||
m_BlindOrBuriedViasCount++;
|
||||
}
|
||||
|
||||
/* Display statistics */
|
||||
// Pads holes cound:
|
||||
m_PadsHoleCount = 0;
|
||||
for ( MODULE * module = m_Parent->m_Pcb->m_Modules; module != NULL; module=module->Next() )
|
||||
{
|
||||
for ( D_PAD * pad = module->m_Pads; pad != NULL; pad = pad->Next() )
|
||||
{
|
||||
m_MicroViasDrillSizer->Enable( m_MicroViasCount );
|
||||
m_MicroViaDrillValue->Enable( m_MicroViasCount );
|
||||
|
||||
/* Display statistics */
|
||||
|
||||
// Pads holes cound:
|
||||
m_PadsHoleCount = 0;
|
||||
for( MODULE* module = m_Parent->m_Pcb->m_Modules; module != NULL; module = module->Next() )
|
||||
{
|
||||
for( D_PAD* pad = module->m_Pads; pad != NULL; pad = pad->Next() )
|
||||
{
|
||||
if( pad->m_DrillShape == PAD_CIRCLE )
|
||||
if( pad->m_Drill.x != 0) m_PadsHoleCount++;
|
||||
else
|
||||
if ( MIN( pad->m_Drill.x, pad->m_Drill.y ) != 0 ) m_PadsHoleCount++;
|
||||
}
|
||||
}
|
||||
msg = m_PadsCountInfoMsg->GetLabel();
|
||||
msg << wxT(" ") << m_PadsHoleCount;
|
||||
m_PadsCountInfoMsg->SetLabel(msg);
|
||||
if( pad->m_Drill.x != 0 )
|
||||
m_PadsHoleCount++;
|
||||
else
|
||||
if( MIN( pad->m_Drill.x, pad->m_Drill.y ) != 0 )
|
||||
m_PadsHoleCount++;
|
||||
}
|
||||
}
|
||||
|
||||
msg = m_ThroughViasInfoMsg->GetLabel();
|
||||
msg << wxT(" ") << m_ThroughViasCount;
|
||||
m_ThroughViasInfoMsg->SetLabel(msg);
|
||||
msg = m_PadsCountInfoMsg->GetLabel();
|
||||
msg << wxT( " " ) << m_PadsHoleCount;
|
||||
m_PadsCountInfoMsg->SetLabel( msg );
|
||||
|
||||
msg = m_MicroViasInfoMsg->GetLabel();
|
||||
msg << wxT(" ") << m_MicroViasCount;
|
||||
m_MicroViasInfoMsg->SetLabel(msg);
|
||||
msg = m_ThroughViasInfoMsg->GetLabel();
|
||||
msg << wxT( " " ) << m_ThroughViasCount;
|
||||
m_ThroughViasInfoMsg->SetLabel( msg );
|
||||
|
||||
msg = m_BuriedViasInfoMsg->GetLabel();
|
||||
msg << wxT(" ") << m_BlindOrBuriedViasCount;
|
||||
m_BuriedViasInfoMsg->SetLabel(msg);
|
||||
msg = m_MicroViasInfoMsg->GetLabel();
|
||||
msg << wxT( " " ) << m_MicroViasCount;
|
||||
m_MicroViasInfoMsg->SetLabel( msg );
|
||||
|
||||
msg = m_BuriedViasInfoMsg->GetLabel();
|
||||
msg << wxT( " " ) << m_BlindOrBuriedViasCount;
|
||||
m_BuriedViasInfoMsg->SetLabel( msg );
|
||||
}
|
||||
|
||||
|
||||
/**************************************/
|
||||
void WinEDA_DrillFrame::SetParams(void)
|
||||
void WinEDA_DrillFrame::SetParams( void )
|
||||
/**************************************/
|
||||
{
|
||||
wxString msg;
|
||||
long ltmp;
|
||||
wxString msg;
|
||||
long ltmp;
|
||||
|
||||
s_Unit_Drill_is_Inch = (m_Choice_Unit->GetSelection() == 0) ? FALSE : TRUE;
|
||||
Minimal = m_Check_Minimal->IsChecked();
|
||||
|
@ -181,11 +211,13 @@ void WinEDA_DrillFrame::SetParams(void)
|
|||
DrillOriginIsAuxAxis = m_Choice_Drill_Offset->GetSelection();
|
||||
|
||||
msg = m_PenSpeed->GetValue();
|
||||
if ( msg.ToLong(<mp) ) g_HPGL_Pen_Speed = ltmp;
|
||||
if( msg.ToLong( <mp ) )
|
||||
g_HPGL_Pen_Speed = ltmp;
|
||||
msg = m_PenNum->GetValue();
|
||||
|
||||
if ( msg.ToLong(<mp) ) g_HPGL_Pen_Num = ltmp;
|
||||
if( m_Choice_Drill_Offset->GetSelection() == 0 )
|
||||
if( msg.ToLong( <mp ) )
|
||||
g_HPGL_Pen_Num = ltmp;
|
||||
if( m_Choice_Drill_Offset->GetSelection() == 0 )
|
||||
File_Drill_Offset = wxPoint( 0, 0 );
|
||||
else
|
||||
File_Drill_Offset = m_Parent->m_Auxiliary_Axis_Position;
|
||||
|
@ -259,8 +291,9 @@ void WinEDA_DrillFrame::UpdateConfig()
|
|||
/*************************************************************/
|
||||
void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
|
||||
/*************************************************************/
|
||||
/* Calls the functions to create EXCELLOn drill files and/od drill map files
|
||||
*/
|
||||
|
||||
/* Calls the functions to create EXCELLON drill files and/od drill map files
|
||||
*/
|
||||
{
|
||||
wxString FullFileName, Mask( wxT( "*" ) ), Ext( wxT( ".drl" ) );
|
||||
int ii;
|
||||
|
@ -303,19 +336,20 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
|
|||
/* Init : */
|
||||
Affiche_1_Parametre( m_Parent, 0, _( "File" ), FullFileName, BLUE );
|
||||
|
||||
setlocale (LC_NUMERIC, "C"); // Use the standard notation for float numbers
|
||||
Init_Drill();
|
||||
setlocale( LC_NUMERIC, "C" ); // Use the standard notation for float numbers
|
||||
Init_Drill();
|
||||
|
||||
ii = Gen_Liste_Tools( s_ToolListBuffer, TRUE );
|
||||
|
||||
ii = Gen_Liste_Forets( (DRILL_TOOL*) adr_lowmem, TRUE );
|
||||
msg.Printf( wxT( "%d" ), ii );
|
||||
Affiche_1_Parametre( m_Parent, 30, _( "Tools" ), msg, BROWN );
|
||||
|
||||
ii = Create_Drill_File_EXCELLON( (DRILL_TOOL*) adr_lowmem );
|
||||
ii = Create_Drill_File_EXCELLON( s_ToolListBuffer );
|
||||
msg.Printf( wxT( "%d" ), ii );
|
||||
Affiche_1_Parametre( m_Parent, 45, _( "Drill" ), msg, GREEN );
|
||||
|
||||
Write_End_Of_File_Drill();
|
||||
setlocale (LC_NUMERIC, ""); // Revert to locale float notation
|
||||
setlocale( LC_NUMERIC, "" ); // Revert to locale float notation
|
||||
}
|
||||
|
||||
switch( m_Choice_Drill_Map->GetSelection() )
|
||||
|
@ -324,16 +358,16 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
case 1:
|
||||
GenDrillMap( PLOT_FORMAT_HPGL );
|
||||
GenDrillMap( s_ToolListBuffer, PLOT_FORMAT_HPGL );
|
||||
break;
|
||||
|
||||
case 2:
|
||||
GenDrillMap( PLOT_FORMAT_POST );
|
||||
GenDrillMap( s_ToolListBuffer, PLOT_FORMAT_POST );
|
||||
break;
|
||||
}
|
||||
|
||||
if( m_Choice_Drill_Report->GetSelection() > 0 )
|
||||
GenDrillReport();
|
||||
GenDrillReport( s_ToolListBuffer );
|
||||
|
||||
EndModal( 0 );
|
||||
}
|
||||
|
@ -361,29 +395,28 @@ void WinEDA_DrillFrame::UpdatePrecisionOptions( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
int WinEDA_DrillFrame::Create_Drill_File_EXCELLON( DRILL_TOOL* buffer )
|
||||
/***************************************************************/
|
||||
/**********************************************************************************/
|
||||
int WinEDA_DrillFrame::Create_Drill_File_EXCELLON( std::vector<DRILL_TOOL>& buffer )
|
||||
/**********************************************************************************/
|
||||
|
||||
/* Create the drill file in EXCELLON format
|
||||
* Return hole count
|
||||
* buffer: Drill tools list
|
||||
*/
|
||||
{
|
||||
DRILL_TOOL* foret;
|
||||
TRACK* pt_piste;
|
||||
D_PAD* pt_pad;
|
||||
MODULE* Module;
|
||||
int ii, diam, nb_trous;
|
||||
int diam, holes_count;
|
||||
int x0, y0, xf, yf, xc, yc;
|
||||
float xt, yt;
|
||||
char line[1024];
|
||||
|
||||
/* Create the pad drill list : */
|
||||
nb_trous = 0;
|
||||
holes_count = 0;
|
||||
|
||||
/* Read the hole file */
|
||||
for( ii = 0, foret = buffer; ii < s_DrillToolsCount; ii++, foret++ )
|
||||
for( unsigned ii = 0; ii < buffer.size(); ii++ )
|
||||
{
|
||||
sprintf( line, "T%d\n", ii + 1 ); fputs( line, dest );
|
||||
/* Read the via list */
|
||||
|
@ -397,7 +430,7 @@ int WinEDA_DrillFrame::Create_Drill_File_EXCELLON( DRILL_TOOL* buffer )
|
|||
if( via_drill == 0 )
|
||||
continue;
|
||||
|
||||
if( foret->m_Diameter != via_drill )
|
||||
if( buffer[ii].m_Diameter != via_drill )
|
||||
continue;
|
||||
|
||||
x0 = pt_piste->m_Start.x - File_Drill_Offset.x;
|
||||
|
@ -411,7 +444,6 @@ int WinEDA_DrillFrame::Create_Drill_File_EXCELLON( DRILL_TOOL* buffer )
|
|||
{
|
||||
Gen_Line_EXCELLON( line, xt, yt );
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
/* metric 3:3 */
|
||||
|
@ -419,7 +451,7 @@ int WinEDA_DrillFrame::Create_Drill_File_EXCELLON( DRILL_TOOL* buffer )
|
|||
}
|
||||
|
||||
fputs( line, dest );
|
||||
nb_trous++;
|
||||
holes_count++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -436,7 +468,7 @@ int WinEDA_DrillFrame::Create_Drill_File_EXCELLON( DRILL_TOOL* buffer )
|
|||
diam = pt_pad->m_Drill.x;
|
||||
if( diam == 0 )
|
||||
continue;
|
||||
if( diam != foret->m_Diameter )
|
||||
if( diam != buffer[ii].m_Diameter )
|
||||
continue;
|
||||
|
||||
/* Compute the hole coordinates: */
|
||||
|
@ -453,9 +485,13 @@ int WinEDA_DrillFrame::Create_Drill_File_EXCELLON( DRILL_TOOL* buffer )
|
|||
Gen_Line_EXCELLON( line, xt * 10, yt * 10 );
|
||||
|
||||
fputs( line, dest );
|
||||
nb_trous++;
|
||||
} /* ens analyse one module */
|
||||
} // End analyse module list
|
||||
holes_count++;
|
||||
}
|
||||
|
||||
/* ens analyse one module */
|
||||
}
|
||||
|
||||
// End analyse module list
|
||||
|
||||
|
||||
/* Read pad list and create Drill infos for oblong holes only: */
|
||||
|
@ -472,7 +508,7 @@ int WinEDA_DrillFrame::Create_Drill_File_EXCELLON( DRILL_TOOL* buffer )
|
|||
diam = MIN( pt_pad->m_Drill.x, pt_pad->m_Drill.y );
|
||||
if( diam == 0 )
|
||||
continue;
|
||||
if( diam != foret->m_Diameter )
|
||||
if( diam != buffer[ii].m_Diameter )
|
||||
continue;
|
||||
|
||||
/* Compute the hole coordinates: */
|
||||
|
@ -511,7 +547,7 @@ int WinEDA_DrillFrame::Create_Drill_File_EXCELLON( DRILL_TOOL* buffer )
|
|||
|
||||
fputs( line, dest );
|
||||
|
||||
fputs( "G85", dest ); // add the "G85" command
|
||||
fputs( "G85", dest ); // add the "G85" command
|
||||
|
||||
xt = float (xf) * conv_unit; yt = float (yf) * conv_unit;
|
||||
if( s_Unit_Drill_is_Inch )
|
||||
|
@ -519,12 +555,16 @@ int WinEDA_DrillFrame::Create_Drill_File_EXCELLON( DRILL_TOOL* buffer )
|
|||
else
|
||||
Gen_Line_EXCELLON( line, xt * 10, yt * 10 );
|
||||
fputs( "G05\n", dest );
|
||||
nb_trous++;
|
||||
} /* End Analyse pad list for the module */
|
||||
} /* End analyse modules for the current tool */
|
||||
holes_count++;
|
||||
}
|
||||
|
||||
/* End Analyse pad list for the module */
|
||||
}
|
||||
|
||||
/* End analyse modules for the current tool */
|
||||
}
|
||||
|
||||
return nb_trous;
|
||||
return holes_count;
|
||||
}
|
||||
|
||||
|
||||
|
@ -597,71 +637,60 @@ void Gen_Line_EXCELLON( char* line, float x, float y )
|
|||
sprintf( line, "X%sY%s\n", CONV_TO_UTF8( xs ), CONV_TO_UTF8( ys ) );
|
||||
break;
|
||||
}
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************/
|
||||
DRILL_TOOL* GetOrAddForet( DRILL_TOOL* buffer, int diameter )
|
||||
/***************************************************/
|
||||
/*************************************************************************/
|
||||
int GetOrAddForet( std::vector<DRILL_TOOL>& buffer, int diameter )
|
||||
/*************************************************************************/
|
||||
|
||||
/* Search the drill tool for the diameter "diameter"
|
||||
* Create a new one if not found
|
||||
* return the index in buffer
|
||||
*/
|
||||
{
|
||||
int ii;
|
||||
DRILL_TOOL* foret;
|
||||
unsigned ii;
|
||||
|
||||
if( diameter == 0 )
|
||||
return NULL;
|
||||
return -1;
|
||||
|
||||
/* Search for an existing tool: */
|
||||
for( ii = 0, foret = buffer; ii < s_DrillToolsCount; ii++, foret++ )
|
||||
for( ii = 0; ii < buffer.size(); ii++ )
|
||||
{
|
||||
if( foret->m_Diameter == diameter ) /* found */
|
||||
return foret;
|
||||
if( buffer[ii].m_Diameter == diameter ) /* found */
|
||||
return ii;
|
||||
}
|
||||
|
||||
/* No tool found, we must create a new one */
|
||||
s_DrillToolsCount++;
|
||||
foret->m_TotalCount = 0;
|
||||
foret->m_OvalCount = 0;
|
||||
foret->m_Diameter = diameter;
|
||||
return foret;
|
||||
DRILL_TOOL new_tool( diameter );
|
||||
buffer.push_back( new_tool );
|
||||
return buffer.size() - 1;
|
||||
}
|
||||
|
||||
|
||||
/* Sort function by drill value */
|
||||
int Sort_by_Drill_Value( void* foret1, void* foret2 )
|
||||
{
|
||||
return ( (DRILL_TOOL*) foret1 )->m_Diameter - ( (DRILL_TOOL*) foret2 )->m_Diameter;
|
||||
}
|
||||
/*********************************************************************************************/
|
||||
int WinEDA_DrillFrame::Gen_Liste_Tools( std::vector<DRILL_TOOL>& buffer, bool print_header )
|
||||
/*********************************************************************************************/
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
int WinEDA_DrillFrame::Gen_Liste_Forets( DRILL_TOOL* buffer, bool print_header )
|
||||
/*******************************************************************************/
|
||||
|
||||
/* Etablit la liste des forets de percage, dans l'ordre croissant des
|
||||
/* Etablit la liste des drill_tools de percage, dans l'ordre croissant des
|
||||
* diametres
|
||||
* Retourne:
|
||||
* Nombre de Forets
|
||||
*
|
||||
* Mise a jour: s_DrillToolsCount = nombre de forets differents
|
||||
* Genere une liste de s_DrillToolsCount structures DRILL_TOOL a partir de buffer
|
||||
* Fills the list of tools buffer
|
||||
*/
|
||||
{
|
||||
DRILL_TOOL* foret;
|
||||
D_PAD* pt_pad;
|
||||
MODULE* Module;
|
||||
int ii, diam;
|
||||
char line[1024];
|
||||
D_PAD* pt_pad;
|
||||
MODULE* Module;
|
||||
unsigned ii;
|
||||
int diam;
|
||||
char line[1024];
|
||||
|
||||
s_DrillToolsCount = 0; foret = buffer;
|
||||
buffer.clear();
|
||||
|
||||
/* Creates the via tools list*/
|
||||
TRACK* pt_piste = m_Parent->m_Pcb->m_Track;
|
||||
|
||||
/* Creates the via tools */
|
||||
TRACK* pt_piste = m_Parent->m_Pcb->m_Track;
|
||||
for( ; pt_piste != NULL; pt_piste = (TRACK*) pt_piste->Pnext )
|
||||
{
|
||||
if( pt_piste->Type() != TYPEVIA )
|
||||
|
@ -669,16 +698,17 @@ int WinEDA_DrillFrame::Gen_Liste_Forets( DRILL_TOOL* buffer, bool print_header )
|
|||
int via_drill = pt_piste->GetDrillValue();
|
||||
if( via_drill == 0 )
|
||||
continue;
|
||||
foret = GetOrAddForet( buffer, via_drill );
|
||||
if( foret )
|
||||
foret->m_TotalCount++;
|
||||
|
||||
ii = GetOrAddForet( buffer, via_drill );
|
||||
if ( ii >= 0 )
|
||||
buffer[ii].m_TotalCount++;
|
||||
}
|
||||
|
||||
/* Create the pad tools : */
|
||||
Module = m_Parent->m_Pcb->m_Modules;
|
||||
for( ; Module != NULL; Module = (MODULE*) Module->Pnext )
|
||||
{
|
||||
/* Examen des pastilles */
|
||||
/* See the pad list for hole sizes */
|
||||
pt_pad = (D_PAD*) Module->m_Pads;
|
||||
for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext )
|
||||
{
|
||||
|
@ -690,33 +720,30 @@ int WinEDA_DrillFrame::Gen_Liste_Forets( DRILL_TOOL* buffer, bool print_header )
|
|||
if( diam == 0 )
|
||||
continue;
|
||||
|
||||
foret = GetOrAddForet( buffer, diam );
|
||||
if( foret )
|
||||
{
|
||||
foret->m_TotalCount++;
|
||||
if( pt_pad->m_DrillShape == PAD_OVAL )
|
||||
foret->m_OvalCount++;
|
||||
}
|
||||
ii = GetOrAddForet( buffer, diam );
|
||||
if ( ii >= 0 )
|
||||
{
|
||||
buffer[ii].m_TotalCount++;
|
||||
if( pt_pad->m_DrillShape == PAD_OVAL )
|
||||
buffer[ii].m_OvalCount++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Fin examen 1 module */
|
||||
}
|
||||
|
||||
/* tri des forets par ordre de diametre croissant */
|
||||
qsort( buffer, s_DrillToolsCount, sizeof(DRILL_TOOL),
|
||||
( int( * ) ( const void*, const void* ) )Sort_by_Drill_Value );
|
||||
/* Sort drill_tools by increasing size */
|
||||
sort( buffer.begin(), buffer.end(), CmpDrillDiameterTool );
|
||||
|
||||
/* Generation de la section liste des outils */
|
||||
/* Write the tool list in excellon file */
|
||||
if( print_header )
|
||||
{
|
||||
for( ii = 0, foret = (DRILL_TOOL*) buffer; ii < s_DrillToolsCount; ii++, foret++ )
|
||||
for( ii = 0; ii < buffer.size(); ii++ )
|
||||
{
|
||||
if( s_Unit_Drill_is_Inch ) /* does it need T01, T02 or is T1,T2 ok?*/
|
||||
if( s_Unit_Drill_is_Inch ) /* does it need T01, T02 or is T1,T2 ok?*/
|
||||
sprintf( line, "T%dC%.3f\n", ii + 1,
|
||||
float (foret->m_Diameter) * conv_unit );
|
||||
float (buffer[ii].m_Diameter) * conv_unit );
|
||||
else
|
||||
sprintf( line, "T%dC%.3f\n", ii + 1,
|
||||
float (foret->m_Diameter) * conv_unit * 10.0 );
|
||||
float (buffer[ii].m_Diameter) * conv_unit * 10.0 );
|
||||
|
||||
fputs( line, dest );
|
||||
}
|
||||
|
@ -732,7 +759,7 @@ int WinEDA_DrillFrame::Gen_Liste_Forets( DRILL_TOOL* buffer, bool print_header )
|
|||
fputs( "M71\n", dest ); /* M71 = metric mode */
|
||||
}
|
||||
|
||||
return s_DrillToolsCount;
|
||||
return buffer.size();
|
||||
}
|
||||
|
||||
|
||||
|
@ -794,16 +821,16 @@ void Write_End_Of_File_Drill()
|
|||
}
|
||||
|
||||
|
||||
/***********************************************/
|
||||
void WinEDA_DrillFrame::GenDrillMap( int format )
|
||||
/***********************************************/
|
||||
/**********************************************************************************/
|
||||
void WinEDA_DrillFrame::GenDrillMap( std::vector<DRILL_TOOL>& buffer, int format )
|
||||
/**********************************************************************************/
|
||||
|
||||
/* Genere le plan de percage (Drill map) format HPGL ou POSTSCRIPT
|
||||
*/
|
||||
{
|
||||
int ii, x, y;
|
||||
unsigned ii;
|
||||
int x, y;
|
||||
int plotX, plotY, TextWidth;
|
||||
DRILL_TOOL* foret;
|
||||
int intervalle = 0, CharSize = 0;
|
||||
EDA_BaseStruct* PtStruct;
|
||||
int old_g_PlotOrient = g_PlotOrient;
|
||||
|
@ -852,7 +879,7 @@ void WinEDA_DrillFrame::GenDrillMap( int format )
|
|||
if( FullFileName.IsEmpty() )
|
||||
return;
|
||||
|
||||
setlocale (LC_NUMERIC, "C"); // Use the standard notation for float numbers
|
||||
setlocale( LC_NUMERIC, "C" ); // Use the standard notation for float numbers
|
||||
g_PlotOrient = 0;
|
||||
/* calcul des dimensions et centre du PCB */
|
||||
m_Parent->m_Pcb->ComputeBoundaryBox();
|
||||
|
@ -908,8 +935,8 @@ void WinEDA_DrillFrame::GenDrillMap( int format )
|
|||
m_Parent->MsgPanel->EraseMsgBox();
|
||||
Affiche_1_Parametre( m_Parent, 0, _( "File" ), FullFileName, BLUE );
|
||||
|
||||
/* Calcul de la liste des diametres de percage (liste des forets) */
|
||||
ii = Gen_Liste_Forets( (DRILL_TOOL*) adr_lowmem, FALSE );
|
||||
/* Calcul de la liste des diametres de percage (liste des drill_tools) */
|
||||
ii = Gen_Liste_Tools( s_ToolListBuffer, FALSE );
|
||||
msg.Printf( wxT( "%d" ), ii );
|
||||
Affiche_1_Parametre( m_Parent, 48, _( "Tools" ), msg, BROWN );
|
||||
|
||||
|
@ -961,7 +988,7 @@ void WinEDA_DrillFrame::GenDrillMap( int format )
|
|||
PlotMirePcb( (MIREPCB*) PtStruct, format, EDGE_LAYER );
|
||||
break;
|
||||
|
||||
case TYPEMARKER: // do not draw
|
||||
case TYPEMARKER: // do not draw
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -978,7 +1005,7 @@ void WinEDA_DrillFrame::GenDrillMap( int format )
|
|||
fputs( line, dest );
|
||||
}
|
||||
|
||||
ii = Plot_Drill_PcbMap( (DRILL_TOOL*) adr_lowmem, format );
|
||||
ii = Plot_Drill_PcbMap( s_ToolListBuffer, format );
|
||||
msg.Printf( wxT( "%d" ), ii );
|
||||
Affiche_1_Parametre( m_Parent, 64, _( "Drill" ), msg, GREEN );
|
||||
|
||||
|
@ -1056,13 +1083,13 @@ void WinEDA_DrillFrame::GenDrillMap( int format )
|
|||
}
|
||||
|
||||
|
||||
for( ii = 0, foret = (DRILL_TOOL*) adr_lowmem; ii < s_DrillToolsCount; ii++, foret++ )
|
||||
for( ii = 0; ii < buffer.size(); ii++ )
|
||||
{
|
||||
int plot_diam;
|
||||
if( foret->m_TotalCount == 0 )
|
||||
if( buffer[ii].m_TotalCount == 0 )
|
||||
continue;
|
||||
|
||||
plot_diam = (int) (foret->m_Diameter);
|
||||
plot_diam = (int) (buffer[ii].m_Diameter);
|
||||
x = plotX; y = plotY;
|
||||
x = -g_PlotOffset.x + (int) (x * fTextScale);
|
||||
y = g_PlotOffset.y - (int) (y * fTextScale);
|
||||
|
@ -1090,31 +1117,31 @@ void WinEDA_DrillFrame::GenDrillMap( int format )
|
|||
sprintf( line, "PU %d, %d; LB%2.3f\" / %2.2fmm ",
|
||||
x + (int) (intervalle * CharScale * fTextScale),
|
||||
y - (int) (CharSize / 2 * CharScale * fTextScale),
|
||||
float (foret->m_Diameter) * 0.0001,
|
||||
float (foret->m_Diameter) * 0.00254 );
|
||||
float (buffer[ii].m_Diameter) * 0.0001,
|
||||
float (buffer[ii].m_Diameter) * 0.00254 );
|
||||
else
|
||||
sprintf( line, "PU %d, %d; LB%2.2fmm / %2.3f\" ",
|
||||
x + (int) (intervalle * CharScale * fTextScale),
|
||||
y - (int) (CharSize / 2 * CharScale * fTextScale),
|
||||
float (foret->m_Diameter) * 0.00254,
|
||||
float (foret->m_Diameter) * 0.0001 );
|
||||
float (buffer[ii].m_Diameter) * 0.00254,
|
||||
float (buffer[ii].m_Diameter) * 0.0001 );
|
||||
fputs( line, dest );
|
||||
|
||||
// Now list how many holes and ovals are associated with each drill.
|
||||
if( ( foret->m_TotalCount == 1 ) && ( foret->m_OvalCount == 0 ) )
|
||||
if( ( buffer[ii].m_TotalCount == 1 ) && ( buffer[ii].m_OvalCount == 0 ) )
|
||||
sprintf( line, "(1 hole)\n" );
|
||||
else if( foret->m_TotalCount == 1 ) // && ( foret->m_OvalCount == 1 )
|
||||
else if( buffer[ii].m_TotalCount == 1 ) // && ( buffer[ii]m_OvalCount == 1 )
|
||||
sprintf( line, "(1 hole) (with 1 oblong)\n" );
|
||||
else if( foret->m_OvalCount == 0 )
|
||||
else if( buffer[ii].m_OvalCount == 0 )
|
||||
sprintf( line, "(%d holes)\n",
|
||||
foret->m_TotalCount );
|
||||
else if( foret->m_OvalCount == 1 )
|
||||
buffer[ii].m_TotalCount );
|
||||
else if( buffer[ii].m_OvalCount == 1 )
|
||||
sprintf( line, "(%d holes) (with 1 oblong)\n",
|
||||
foret->m_TotalCount );
|
||||
else // if ( foret->m_OvalCount > 1 )
|
||||
buffer[ii].m_TotalCount );
|
||||
else // if ( buffer[ii]m_OvalCount > 1 )
|
||||
sprintf( line, "(%d holes) (with %d oblongs)\n",
|
||||
foret->m_TotalCount,
|
||||
foret->m_OvalCount );
|
||||
buffer[ii].m_TotalCount,
|
||||
buffer[ii].m_OvalCount );
|
||||
fputs( line, dest );
|
||||
fputs( "\03;\n", dest );
|
||||
break;
|
||||
|
@ -1125,29 +1152,29 @@ void WinEDA_DrillFrame::GenDrillMap( int format )
|
|||
// and then its diameter in the other Drill Unit.
|
||||
if( s_Unit_Drill_is_Inch )
|
||||
sprintf( line, "%2.3f\" / %2.2fmm ",
|
||||
float (foret->m_Diameter) * 0.0001,
|
||||
float (foret->m_Diameter) * 0.00254 );
|
||||
float (buffer[ii].m_Diameter) * 0.0001,
|
||||
float (buffer[ii].m_Diameter) * 0.00254 );
|
||||
else
|
||||
sprintf( line, "%2.2fmm / %2.3f\" ",
|
||||
float (foret->m_Diameter) * 0.00254,
|
||||
float (foret->m_Diameter) * 0.0001 );
|
||||
float (buffer[ii].m_Diameter) * 0.00254,
|
||||
float (buffer[ii].m_Diameter) * 0.0001 );
|
||||
msg = CONV_FROM_UTF8( line );
|
||||
|
||||
// Now list how many holes and ovals are associated with each drill.
|
||||
if( ( foret->m_TotalCount == 1 ) && ( foret->m_OvalCount == 0 ) )
|
||||
if( ( buffer[ii].m_TotalCount == 1 ) && ( buffer[ii].m_OvalCount == 0 ) )
|
||||
sprintf( line, "(1 hole)" );
|
||||
else if( foret->m_TotalCount == 1 ) // && ( foret->m_OvalCount == 1 )
|
||||
else if( buffer[ii].m_TotalCount == 1 ) // && ( buffer[ii]m_OvalCount == 1 )
|
||||
sprintf( line, "(1 hole) (with 1 oblong)" );
|
||||
else if( foret->m_OvalCount == 0 )
|
||||
else if( buffer[ii].m_OvalCount == 0 )
|
||||
sprintf( line, "(%d holes)",
|
||||
foret->m_TotalCount );
|
||||
else if( foret->m_OvalCount == 1 )
|
||||
buffer[ii].m_TotalCount );
|
||||
else if( buffer[ii].m_OvalCount == 1 )
|
||||
sprintf( line, "(%d holes) (with 1 oblong)",
|
||||
foret->m_TotalCount );
|
||||
else // if ( foret->m_OvalCount > 1 )
|
||||
buffer[ii].m_TotalCount );
|
||||
else // if ( buffer[ii]m_OvalCount > 1 )
|
||||
sprintf( line, "(%d holes) (with %d oblongs)",
|
||||
foret->m_TotalCount,
|
||||
foret->m_OvalCount );
|
||||
buffer[ii].m_TotalCount,
|
||||
buffer[ii].m_OvalCount );
|
||||
msg += CONV_FROM_UTF8( line );
|
||||
Plot_1_texte( format, msg, 0, TextWidth,
|
||||
x, y,
|
||||
|
@ -1160,7 +1187,6 @@ void WinEDA_DrillFrame::GenDrillMap( int format )
|
|||
plotY += intervalle;
|
||||
}
|
||||
|
||||
|
||||
switch( format )
|
||||
{
|
||||
case PLOT_FORMAT_HPGL:
|
||||
|
@ -1172,15 +1198,15 @@ void WinEDA_DrillFrame::GenDrillMap( int format )
|
|||
break;
|
||||
}
|
||||
|
||||
setlocale (LC_NUMERIC, ""); // Revert to local notation for float numbers
|
||||
setlocale( LC_NUMERIC, "" ); // Revert to local notation for float numbers
|
||||
|
||||
g_PlotOrient = old_g_PlotOrient;
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************/
|
||||
int WinEDA_DrillFrame::Plot_Drill_PcbMap( DRILL_TOOL* buffer, int format )
|
||||
/*********************************************************************/
|
||||
/****************************************************************************************/
|
||||
int WinEDA_DrillFrame::Plot_Drill_PcbMap( std::vector<DRILL_TOOL>& buffer, int format )
|
||||
/****************************************************************************************/
|
||||
|
||||
/** Creates the drill map file in HPGL or POSTSCRIPT format
|
||||
* @return drill count
|
||||
|
@ -1188,18 +1214,18 @@ int WinEDA_DrillFrame::Plot_Drill_PcbMap( DRILL_TOOL* buffer, int format )
|
|||
* @param format = ouput format (hpgl / ps)
|
||||
*/
|
||||
{
|
||||
DRILL_TOOL* foret;
|
||||
TRACK* pt_piste;
|
||||
D_PAD* pt_pad;
|
||||
MODULE* Module;
|
||||
int shape_id, diam, nb_trous;
|
||||
wxPoint pos;
|
||||
wxSize size;
|
||||
TRACK* pt_piste;
|
||||
D_PAD* pt_pad;
|
||||
MODULE* Module;
|
||||
unsigned shape_id;
|
||||
int diam, holes_count;
|
||||
wxPoint pos;
|
||||
wxSize size;
|
||||
|
||||
nb_trous = 0;
|
||||
holes_count = 0;
|
||||
|
||||
/* create the drill list */
|
||||
if( s_DrillToolsCount > 13 )
|
||||
if( buffer.size() > 13 )
|
||||
{
|
||||
DisplayInfo( this,
|
||||
_(
|
||||
|
@ -1207,8 +1233,8 @@ int WinEDA_DrillFrame::Plot_Drill_PcbMap( DRILL_TOOL* buffer, int format )
|
|||
10 );
|
||||
}
|
||||
|
||||
// Plot the drill map:
|
||||
for( shape_id = 0, foret = (DRILL_TOOL*) buffer; shape_id < s_DrillToolsCount; shape_id++, foret++ )
|
||||
// Plot the drill map:
|
||||
for( shape_id = 0; shape_id < buffer.size(); shape_id++ )
|
||||
{
|
||||
/* create the via drill map */
|
||||
{
|
||||
|
@ -1218,12 +1244,12 @@ int WinEDA_DrillFrame::Plot_Drill_PcbMap( DRILL_TOOL* buffer, int format )
|
|||
if( pt_piste->Type() != TYPEVIA )
|
||||
continue;
|
||||
int via_drill = pt_piste->GetDrillValue();
|
||||
if( via_drill != foret->m_Diameter )
|
||||
continue;
|
||||
if( via_drill != buffer[shape_id].m_Diameter )
|
||||
continue;
|
||||
pos = pt_piste->m_Start;
|
||||
PlotDrillSymbol( pos, via_drill, shape_id, format );
|
||||
|
||||
nb_trous++;
|
||||
holes_count++;
|
||||
}
|
||||
}
|
||||
/* create the pad drill map: */
|
||||
|
@ -1236,7 +1262,7 @@ int WinEDA_DrillFrame::Plot_Drill_PcbMap( DRILL_TOOL* buffer, int format )
|
|||
{
|
||||
case PAD_CIRCLE:
|
||||
diam = pt_pad->m_Drill.x;
|
||||
if( diam != foret->m_Diameter )
|
||||
if( diam != buffer[shape_id].m_Diameter )
|
||||
continue;
|
||||
PlotDrillSymbol( pt_pad->m_Pos, diam, shape_id, format );
|
||||
break;
|
||||
|
@ -1245,24 +1271,24 @@ int WinEDA_DrillFrame::Plot_Drill_PcbMap( DRILL_TOOL* buffer, int format )
|
|||
if( pt_pad->m_DrillShape != PAD_OVAL )
|
||||
continue;
|
||||
diam = MIN( pt_pad->m_Drill.x, pt_pad->m_Drill.y );
|
||||
if( diam != foret->m_Diameter )
|
||||
if( diam != buffer[shape_id].m_Diameter )
|
||||
continue;
|
||||
PlotOvalDrillSymbol( pt_pad->m_Pos, pt_pad->m_Drill, pt_pad->m_Orient, format );
|
||||
break;
|
||||
}
|
||||
|
||||
nb_trous++;
|
||||
holes_count++;
|
||||
}
|
||||
|
||||
/* Fin examen 1 module */
|
||||
}
|
||||
|
||||
/* Fin 1 passe de foret */
|
||||
/* Fin 1 passe de drill_tool */
|
||||
}
|
||||
|
||||
/* fin analyse des trous de modules */
|
||||
|
||||
return nb_trous;
|
||||
return holes_count;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1445,6 +1471,7 @@ void PlotDrillSymbol( const wxPoint& position, int diametre, int num_forme, int
|
|||
/*********************************************************************************************/
|
||||
void PlotOvalDrillSymbol( const wxPoint& position, const wxSize& size, int orient, int format )
|
||||
/*********************************************************************************************/
|
||||
|
||||
/* Draws an oblong hole.
|
||||
* because functions to draw oblong shapes exist to draw oblong pads, Use they.
|
||||
*/
|
||||
|
@ -1462,18 +1489,17 @@ void PlotOvalDrillSymbol( const wxPoint& position, const wxSize& size, int orien
|
|||
}
|
||||
|
||||
|
||||
/*******************************************/
|
||||
void WinEDA_DrillFrame::GenDrillReport()
|
||||
/*******************************************/
|
||||
/***************************************************************************/
|
||||
void WinEDA_DrillFrame::GenDrillReport( std::vector<DRILL_TOOL>& buffer )
|
||||
/***************************************************************************/
|
||||
|
||||
/*
|
||||
* Create a list of drill values and drill count
|
||||
*/
|
||||
{
|
||||
wxString FileName, Mask( wxT( "*" ) ), Ext( wxT( ".rpt" ) );
|
||||
int ii, TotalHoleCount;
|
||||
unsigned ii, TotalHoleCount;
|
||||
char line[1024];
|
||||
DRILL_TOOL* foret;
|
||||
wxString msg;
|
||||
|
||||
FileName = m_Parent->m_CurrentScreen->m_FileName;
|
||||
|
@ -1504,7 +1530,7 @@ void WinEDA_DrillFrame::GenDrillReport()
|
|||
Affiche_1_Parametre( m_Parent, 0, _( "File" ), FileName, BLUE );
|
||||
|
||||
/* Determine the list of the different drill diameters. */
|
||||
ii = Gen_Liste_Forets( (DRILL_TOOL*) adr_lowmem, FALSE );
|
||||
ii = Gen_Liste_Tools( buffer, FALSE );
|
||||
msg.Printf( wxT( "%d" ), ii );
|
||||
Affiche_1_Parametre( m_Parent, 30, _( "Tools" ), msg, BROWN );
|
||||
|
||||
|
@ -1520,7 +1546,7 @@ void WinEDA_DrillFrame::GenDrillReport()
|
|||
|
||||
TotalHoleCount = 0;
|
||||
|
||||
for( ii = 0, foret = (DRILL_TOOL*) adr_lowmem; ii < s_DrillToolsCount; ii++, foret++ )
|
||||
for( ii = 0; ii < buffer.size(); ii++ )
|
||||
{
|
||||
// List the tool number assigned to each drill,
|
||||
// then its diameter in the selected Drill Unit,
|
||||
|
@ -1528,37 +1554,39 @@ void WinEDA_DrillFrame::GenDrillReport()
|
|||
if( s_Unit_Drill_is_Inch )
|
||||
sprintf( line, "T%d %2.3f\" %2.2fmm ",
|
||||
ii + 1,
|
||||
float (foret->m_Diameter) * 0.0001,
|
||||
float (foret->m_Diameter) * 0.00254 );
|
||||
float (buffer[ii].m_Diameter) * 0.0001,
|
||||
float (buffer[ii].m_Diameter) * 0.00254 );
|
||||
else
|
||||
sprintf( line, "T%d %2.2fmm %2.3f\" ",
|
||||
ii + 1,
|
||||
float (foret->m_Diameter) * 0.00254,
|
||||
float (foret->m_Diameter) * 0.0001 );
|
||||
float (buffer[ii].m_Diameter) * 0.00254,
|
||||
float (buffer[ii].m_Diameter) * 0.0001 );
|
||||
fputs( line, dest );
|
||||
|
||||
// Now list how many holes and ovals are associated with each drill.
|
||||
if( ( foret->m_TotalCount == 1 ) && ( foret->m_OvalCount == 0 ) )
|
||||
if( ( buffer[ii].m_TotalCount == 1 ) && ( buffer[ii].m_OvalCount == 0 ) )
|
||||
sprintf( line, "(1 hole)\n" );
|
||||
else if( foret->m_TotalCount == 1 )
|
||||
else if( buffer[ii].m_TotalCount == 1 )
|
||||
sprintf( line, "(1 hole) (with 1 oblong)\n" );
|
||||
else if( foret->m_OvalCount == 0 )
|
||||
else if( buffer[ii].m_OvalCount == 0 )
|
||||
sprintf( line, "(%d holes)\n",
|
||||
foret->m_TotalCount );
|
||||
else if( foret->m_OvalCount == 1 )
|
||||
buffer[ii].m_TotalCount );
|
||||
else if( buffer[ii].m_OvalCount == 1 )
|
||||
sprintf( line, "(%d holes) (with 1 oblong)\n",
|
||||
foret->m_TotalCount );
|
||||
else // if ( foret->m_OvalCount > 1 )
|
||||
buffer[ii].m_TotalCount );
|
||||
else // if ( buffer[ii]m_OvalCount > 1 )
|
||||
sprintf( line, "(%d holes) (with %d oblongs)\n",
|
||||
foret->m_TotalCount,
|
||||
foret->m_OvalCount );
|
||||
buffer[ii].m_TotalCount,
|
||||
buffer[ii].m_OvalCount );
|
||||
fputs( line, dest );
|
||||
|
||||
TotalHoleCount += foret->m_TotalCount;
|
||||
TotalHoleCount += buffer[ii].m_TotalCount;
|
||||
}
|
||||
|
||||
msg.Printf( wxT( "%d" ), TotalHoleCount );
|
||||
Affiche_1_Parametre( m_Parent, 45, _( "Drill" ), msg, GREEN );
|
||||
|
||||
|
||||
sprintf( line, "\ntotal holes count %d\n", TotalHoleCount );
|
||||
fputs( line, dest );
|
||||
|
||||
fclose( dest );
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
|
|||
switch( DrawStruct->Type() )
|
||||
{
|
||||
case TYPEZONE_CONTAINER:
|
||||
End_Move_Zone_Corner( DC, (ZONE_CONTAINER *) DrawStruct );
|
||||
End_Move_Zone_Corner_Or_Outlines( DC, (ZONE_CONTAINER *) DrawStruct );
|
||||
exit = true;
|
||||
break;
|
||||
|
||||
|
|
|
@ -644,8 +644,12 @@ void WinEDA_PcbFrame::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu
|
|||
{
|
||||
if( edge_zone->m_Flags )
|
||||
{
|
||||
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_CORNER,
|
||||
_( "Place Corner" ), apply_xpm );
|
||||
if( (edge_zone->m_Flags & IN_EDIT ) )
|
||||
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_CORNER,
|
||||
_( "Place Corner" ), apply_xpm );
|
||||
else
|
||||
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_OUTLINES,
|
||||
_( "Place Zone" ), apply_xpm );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -677,9 +681,13 @@ void WinEDA_PcbFrame::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu
|
|||
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_FILL_ZONE,
|
||||
_( "Fill Zone" ), fill_zone_xpm );
|
||||
|
||||
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_MOVE_ZONE_OUTLINES,
|
||||
_( "Move Zone" ), move_xpm );
|
||||
|
||||
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_EDIT_ZONE_PARAMS,
|
||||
_( "Edit Zone Params" ), edit_xpm );
|
||||
|
||||
zones_menu->AppendSeparator();
|
||||
if ( index >= 0 && edge_zone->m_Poly->IsCutoutContour( edge_zone->m_CornerSelection ) )
|
||||
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CUTOUT,
|
||||
_( "Delete Cutout" ), delete_xpm );
|
||||
|
|
|
@ -32,15 +32,15 @@ using namespace std;
|
|||
|
||||
#include "protos.h"
|
||||
|
||||
/* Local functions */
|
||||
bool verbose = false; // false if zone outline diags mst not be shown
|
||||
|
||||
// Outline creation:
|
||||
static void Abort_Zone_Create_Outline( WinEDA_DrawPanel* Panel, wxDC* DC );
|
||||
static void Show_New_Zone_Edge_While_Move_Mouse( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
|
||||
|
||||
// Corner moving
|
||||
static void Abort_Zone_Move_Corner( WinEDA_DrawPanel* Panel, wxDC* DC );
|
||||
static void Show_Zone_Corner_While_Move_Mouse( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
|
||||
static void Abort_Zone_Move_Corner_Or_Outlines( WinEDA_DrawPanel* Panel, wxDC* DC );
|
||||
static void Show_Zone_Corner_Or_Outline_While_Move_Mouse( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
|
||||
|
||||
/* Local variables */
|
||||
static bool Zone_45_Only = FALSE;
|
||||
|
@ -104,9 +104,9 @@ void WinEDA_PcbFrame::Add_Zone_Cutout( wxDC* DC, ZONE_CONTAINER* zone_container
|
|||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/**********************************************************************************/
|
||||
void WinEDA_PcbFrame::Delete_Zone_Fill( wxDC* DC, SEGZONE* aZone, long aTimestamp )
|
||||
/******************************************************************************/
|
||||
/**********************************************************************************/
|
||||
|
||||
/** Function Delete_Zone_Fill
|
||||
* Remove the zone fillig which include the segment aZone, or the zone which have the given time stamp.
|
||||
|
@ -254,7 +254,35 @@ void WinEDA_PcbFrame::Start_Move_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_con
|
|||
/**
|
||||
* Function Start_Move_Zone_Corner
|
||||
* Initialise parametres to move an existing corner of a zone.
|
||||
* if IsNewCorner is true, the Abort_Zone_Move_Corner will remove this corner, if called
|
||||
* if IsNewCorner is true, the Abort_Zone_Move_Corner_Or_Outlines will remove this corner, if called
|
||||
*/
|
||||
{
|
||||
/* Show the Net */
|
||||
if( g_HightLigt_Status && DC)
|
||||
{
|
||||
Hight_Light( DC ); // Remove old hightlight selection
|
||||
}
|
||||
|
||||
g_HightLigth_NetCode = s_NetcodeSelection = zone_container->GetNet();
|
||||
if ( DC ) Hight_Light( DC );
|
||||
|
||||
zone_container->m_Flags = IN_EDIT;
|
||||
DrawPanel->ManageCurseur = Show_Zone_Corner_Or_Outline_While_Move_Mouse;
|
||||
DrawPanel->ForceCloseManageCurseur = Abort_Zone_Move_Corner_Or_Outlines;
|
||||
s_CornerInitialPosition.x = zone_container->m_Poly->GetX( corner_id );
|
||||
s_CornerInitialPosition.y = zone_container->m_Poly->GetY( corner_id );
|
||||
s_CornerIsNew = IsNewCorner;
|
||||
s_AddCutoutToCurrentZone = false;
|
||||
s_CurrentZone = NULL;
|
||||
}
|
||||
|
||||
/*******************************************************************************************************/
|
||||
void WinEDA_PcbFrame::Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container )
|
||||
/*******************************************************************************************************/
|
||||
|
||||
/**
|
||||
* Function Start_Move_Zone_Outlines
|
||||
* Initialise parametres to move an existing zone outlines.
|
||||
*/
|
||||
{
|
||||
/* Show the Net */
|
||||
|
@ -266,30 +294,33 @@ void WinEDA_PcbFrame::Start_Move_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_con
|
|||
g_HightLigth_NetCode = s_NetcodeSelection = zone_container->GetNet();
|
||||
Hight_Light( DC );
|
||||
|
||||
zone_container->m_Flags = IN_EDIT;
|
||||
DrawPanel->ManageCurseur = Show_Zone_Corner_While_Move_Mouse;
|
||||
DrawPanel->ForceCloseManageCurseur = Abort_Zone_Move_Corner;
|
||||
s_CornerInitialPosition.x = zone_container->m_Poly->GetX( corner_id );
|
||||
s_CornerInitialPosition.y = zone_container->m_Poly->GetY( corner_id );
|
||||
s_CornerIsNew = IsNewCorner;
|
||||
zone_container->m_Flags = IS_MOVED;
|
||||
DrawPanel->ManageCurseur = Show_Zone_Corner_Or_Outline_While_Move_Mouse;
|
||||
DrawPanel->ForceCloseManageCurseur = Abort_Zone_Move_Corner_Or_Outlines;
|
||||
s_CornerInitialPosition.x = zone_container->m_Poly->GetX( 0 );
|
||||
s_CornerInitialPosition.y = zone_container->m_Poly->GetY( 0 );
|
||||
s_CornerIsNew = false;
|
||||
s_AddCutoutToCurrentZone = false;
|
||||
s_CurrentZone = NULL;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************************/
|
||||
void WinEDA_PcbFrame::End_Move_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_container )
|
||||
/****************************************************************************************/
|
||||
/*************************************************************************************************/
|
||||
void WinEDA_PcbFrame::End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container )
|
||||
/*************************************************************************************************/
|
||||
|
||||
/**
|
||||
* Function End_Move_Zone_Corner
|
||||
* Terminates a move corner in a zone outline
|
||||
* Function End_Move_Zone_Corner_Or_Outlines
|
||||
* Terminates a move corner in a zone outline, or a move zone outlines
|
||||
* @param DC = current Device Context (can be NULL)
|
||||
* @param zone_container: the given zone
|
||||
*/
|
||||
{
|
||||
zone_container->m_Flags = 0;
|
||||
DrawPanel->ManageCurseur = NULL;
|
||||
DrawPanel->ForceCloseManageCurseur = NULL;
|
||||
zone_container->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
|
||||
if ( DC )
|
||||
zone_container->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
|
||||
GetScreen()->SetModify();
|
||||
s_AddCutoutToCurrentZone = false;
|
||||
s_CurrentZone = NULL;
|
||||
|
@ -304,15 +335,15 @@ void WinEDA_PcbFrame::End_Move_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_conta
|
|||
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
|
||||
{
|
||||
ZONE_CONTAINER* edge_zone = m_Pcb->GetArea(ii);
|
||||
if( layer == edge_zone->GetLayer() )
|
||||
if( layer == edge_zone->GetLayer() && DC)
|
||||
edge_zone->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
|
||||
}
|
||||
|
||||
m_Pcb->AreaPolygonModified( zone_container, true, false );
|
||||
m_Pcb->AreaPolygonModified( zone_container, true, verbose );
|
||||
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
|
||||
{
|
||||
ZONE_CONTAINER* edge_zone = m_Pcb->GetArea(ii);
|
||||
if( layer == edge_zone->GetLayer() )
|
||||
if( layer == edge_zone->GetLayer() && DC)
|
||||
edge_zone->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
|
||||
}
|
||||
|
||||
|
@ -359,7 +390,7 @@ void WinEDA_PcbFrame::Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER * zone_contai
|
|||
zone_container->m_Poly->DeleteCorner(zone_container->m_CornerSelection);
|
||||
|
||||
// modify zones outlines accordiing to the new zone_container shape
|
||||
m_Pcb->AreaPolygonModified( zone_container, true, false );
|
||||
m_Pcb->AreaPolygonModified( zone_container, true, verbose );
|
||||
if ( DC )
|
||||
{
|
||||
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
|
||||
|
@ -380,12 +411,12 @@ void WinEDA_PcbFrame::Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER * zone_contai
|
|||
}
|
||||
|
||||
|
||||
/**************************************************************/
|
||||
void Abort_Zone_Move_Corner( WinEDA_DrawPanel* Panel, wxDC* DC )
|
||||
/**************************************************************/
|
||||
/**************************************************************************/
|
||||
void Abort_Zone_Move_Corner_Or_Outlines( WinEDA_DrawPanel* Panel, wxDC* DC )
|
||||
/**************************************************************************/
|
||||
|
||||
/**
|
||||
* Function Abort_Zone_Move_Corner
|
||||
* Function Abort_Zone_Move_Corner_Or_Outlines
|
||||
* cancels the Begin_Zone state if at least one EDGE_ZONE has been created.
|
||||
*/
|
||||
{
|
||||
|
@ -394,15 +425,25 @@ void Abort_Zone_Move_Corner( WinEDA_DrawPanel* Panel, wxDC* DC )
|
|||
|
||||
zone_container->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR );
|
||||
|
||||
if( s_CornerIsNew )
|
||||
{
|
||||
zone_container->m_Poly->DeleteCorner( zone_container->m_CornerSelection );
|
||||
}
|
||||
else
|
||||
{
|
||||
wxPoint pos = s_CornerInitialPosition;
|
||||
zone_container->m_Poly->MoveCorner( zone_container->m_CornerSelection, pos.x, pos.y );
|
||||
}
|
||||
if ( zone_container->m_Flags == IS_MOVED )
|
||||
{
|
||||
wxPoint offset;
|
||||
offset.x = s_CornerInitialPosition.x - zone_container->m_Poly->GetX( 0 );
|
||||
offset.y = s_CornerInitialPosition.y - zone_container->m_Poly->GetY( 0 );
|
||||
zone_container->Move(offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
if( s_CornerIsNew )
|
||||
{
|
||||
zone_container->m_Poly->DeleteCorner( zone_container->m_CornerSelection );
|
||||
}
|
||||
else
|
||||
{
|
||||
wxPoint pos = s_CornerInitialPosition;
|
||||
zone_container->m_Poly->MoveCorner( zone_container->m_CornerSelection, pos.x, pos.y );
|
||||
}
|
||||
}
|
||||
zone_container->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR );
|
||||
|
||||
Panel->ManageCurseur = NULL;
|
||||
|
@ -414,9 +455,9 @@ void Abort_Zone_Move_Corner( WinEDA_DrawPanel* Panel, wxDC* DC )
|
|||
}
|
||||
|
||||
|
||||
/**************************************************************************************/
|
||||
void Show_Zone_Corner_While_Move_Mouse( WinEDA_DrawPanel* Panel, wxDC* DC, bool erase )
|
||||
/**************************************************************************************/
|
||||
/*************************************************************************************************/
|
||||
void Show_Zone_Corner_Or_Outline_While_Move_Mouse( WinEDA_DrawPanel* Panel, wxDC* DC, bool erase )
|
||||
/*************************************************************************************************/
|
||||
|
||||
/* Redraws the zone outline when moving a corner according to the cursor position
|
||||
*/
|
||||
|
@ -430,7 +471,16 @@ void Show_Zone_Corner_While_Move_Mouse( WinEDA_DrawPanel* Panel, wxDC* DC, bool
|
|||
}
|
||||
|
||||
wxPoint pos = pcbframe->GetScreen()->m_Curseur;
|
||||
zone_container->m_Poly->MoveCorner( zone_container->m_CornerSelection, pos.x, pos.y );
|
||||
if( zone_container->m_Flags == IS_MOVED )
|
||||
{
|
||||
wxPoint offset;
|
||||
offset.x = pos.x - zone_container->m_Poly->GetX( 0 );
|
||||
offset.y = pos.y - zone_container->m_Poly->GetY( 0 );
|
||||
zone_container->Move(offset);
|
||||
}
|
||||
else
|
||||
zone_container->m_Poly->MoveCorner( zone_container->m_CornerSelection, pos.x, pos.y );
|
||||
|
||||
zone_container->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR );
|
||||
}
|
||||
|
||||
|
@ -649,7 +699,7 @@ void WinEDA_PcbFrame::End_Zone( wxDC* DC )
|
|||
SetCurItem( NULL ); // This outine can be deleted when merging outlines
|
||||
|
||||
// Combine zones if possible :
|
||||
m_Pcb->AreaPolygonModified( new_zone_container, true, false );
|
||||
m_Pcb->AreaPolygonModified( new_zone_container, true, verbose );
|
||||
|
||||
// Redraw the real edge zone :
|
||||
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
|
||||
|
@ -760,7 +810,7 @@ void WinEDA_PcbFrame::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container
|
|||
zone_container->m_GridFillValue = g_GridRoutingSize;
|
||||
|
||||
// Combine zones if possible :
|
||||
m_Pcb->AreaPolygonModified( zone_container, true, false );
|
||||
m_Pcb->AreaPolygonModified( zone_container, true, verbose );
|
||||
|
||||
// Redraw the real new zone outlines:
|
||||
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
|
||||
|
|
|
@ -183,10 +183,10 @@ int BOARD::TestAreaPolygon( ZONE_CONTAINER* CurrArea )
|
|||
if( ret )
|
||||
{
|
||||
// intersection between non-adjacent sides
|
||||
bInt = TRUE;
|
||||
bInt = true;
|
||||
if( style != CPolyLine::STRAIGHT || style2 != CPolyLine::STRAIGHT )
|
||||
{
|
||||
bArcInt = TRUE;
|
||||
bArcInt = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -219,8 +219,8 @@ int BOARD::TestAreaPolygon( ZONE_CONTAINER* CurrArea )
|
|||
* Function ClipAreaPolygon
|
||||
* Process an area that has been modified, by clipping its polygon against itself.
|
||||
* This may change the number and order of copper areas in the net.
|
||||
* @param bMessageBoxInt == TRUE, shows message when clipping occurs.
|
||||
* @param bMessageBoxArc == TRUE, shows message when clipping can't be done due to arcs.
|
||||
* @param bMessageBoxInt == true, shows message when clipping occurs.
|
||||
* @param bMessageBoxArc == true, shows message when clipping can't be done due to arcs.
|
||||
* @return:
|
||||
* -1 if arcs intersect other sides, so polygon can't be clipped
|
||||
* 0 if no intersecting sides
|
||||
|
@ -230,7 +230,7 @@ int BOARD::TestAreaPolygon( ZONE_CONTAINER* CurrArea )
|
|||
int BOARD::ClipAreaPolygon( ZONE_CONTAINER* CurrArea,
|
||||
bool bMessageBoxArc, bool bMessageBoxInt, bool bRetainArcs )
|
||||
{
|
||||
CPolyLine* p = CurrArea->m_Poly;
|
||||
CPolyLine* curr_polygon = CurrArea->m_Poly;
|
||||
int test = TestAreaPolygon( CurrArea ); // this sets utility2 flag
|
||||
|
||||
if( test == -1 && !bRetainArcs )
|
||||
|
@ -241,7 +241,7 @@ int BOARD::ClipAreaPolygon( ZONE_CONTAINER* CurrArea,
|
|||
if( bMessageBoxArc && bDontShowSelfIntersectionArcsWarning == false )
|
||||
{
|
||||
wxString str;
|
||||
str.Printf( wxT( "Area %X of net \"%s\" has arcs intersecting other sides.\n" ),
|
||||
str.Printf( wxT( "Area %8.8X of net \"%s\" has arcs intersecting other sides.\n" ),
|
||||
CurrArea->m_TimeStamp, CurrArea->m_Netname.GetData() );
|
||||
str += wxT( "This may cause problems with other editing operations,\n" );
|
||||
str += wxT( "such as adding cutouts. It can't be fixed automatically.\n" );
|
||||
|
@ -265,7 +265,7 @@ int BOARD::ClipAreaPolygon( ZONE_CONTAINER* CurrArea,
|
|||
if( bMessageBoxInt && bDontShowSelfIntersectionWarning == false )
|
||||
{
|
||||
wxString str;
|
||||
str.Printf( wxT( "Area %d of net \"%s\" is self-intersecting and will be clipped.\n" ),
|
||||
str.Printf( wxT( "Area %8.8X of net \"%s\" is self-intersecting and will be clipped.\n" ),
|
||||
CurrArea->m_TimeStamp, CurrArea->m_Netname.GetData() );
|
||||
str += wxT( "This may result in splitting the area.\n" );
|
||||
str += wxT( "If the area is complex, this may take a few seconds." );
|
||||
|
@ -279,25 +279,26 @@ int BOARD::ClipAreaPolygon( ZONE_CONTAINER* CurrArea,
|
|||
//** if( test == 1 )
|
||||
{
|
||||
std::vector<CPolyLine*> * pa = new std::vector<CPolyLine*>;
|
||||
p->Undraw();
|
||||
curr_polygon->Undraw();
|
||||
int n_poly = CurrArea->m_Poly->NormalizeWithGpc( pa, bRetainArcs );
|
||||
if( n_poly > 1 ) // i.e if clippinf has created some polygons, we must add these new copper areas
|
||||
if( n_poly > 1 ) // i.e if clipping has created some polygons, we must add these new copper areas
|
||||
{
|
||||
ZONE_CONTAINER* NewArea;
|
||||
for( int ip = 1; ip < n_poly; ip++ )
|
||||
{
|
||||
// create new copper area and copy poly into it
|
||||
CPolyLine* new_p = (*pa)[ip - 1];
|
||||
CurrArea = AddArea( CurrArea->GetNet(), CurrArea->GetLayer(), 0, 0, 0 );
|
||||
NewArea = AddArea( CurrArea->GetNet(), CurrArea->GetLayer(), 0, 0, 0 );
|
||||
|
||||
// remove the poly that was automatically created for the new area
|
||||
// and replace it with a poly from NormalizeWithGpc
|
||||
delete CurrArea->m_Poly;
|
||||
CurrArea->m_Poly = new_p;
|
||||
CurrArea->m_Poly->Draw();
|
||||
CurrArea->utility = 1;
|
||||
delete NewArea->m_Poly;
|
||||
NewArea->m_Poly = new_p;
|
||||
NewArea->m_Poly->Draw();
|
||||
NewArea->utility = 1;
|
||||
}
|
||||
}
|
||||
p->Draw();
|
||||
curr_polygon->Draw();
|
||||
delete pa;
|
||||
}
|
||||
return test;
|
||||
|
@ -309,7 +310,7 @@ int BOARD::ClipAreaPolygon( ZONE_CONTAINER* CurrArea,
|
|||
* itself and the polygons for any other areas on the same net.
|
||||
* This may change the number and order of copper areas in the net.
|
||||
* @param modified_area = area to test
|
||||
* @param bMessageBox : if TRUE, shows message boxes when clipping occurs.
|
||||
* @param bMessageBox : if true, shows message boxes when clipping occurs.
|
||||
* @return :
|
||||
* -1 if arcs intersect other sides, so polygon can't be clipped
|
||||
* 0 if no intersecting sides
|
||||
|
@ -328,11 +329,11 @@ int BOARD::AreaPolygonModified( ZONE_CONTAINER* modified_area,
|
|||
// now see if we need to clip against other areas
|
||||
bool bCheckAllAreas = false;
|
||||
if( test == 1 )
|
||||
bCheckAllAreas = TRUE;
|
||||
bCheckAllAreas = true;
|
||||
else
|
||||
bCheckAllAreas = TestAreaIntersections( modified_area );
|
||||
if( bCheckAllAreas )
|
||||
CombineAllAreasInNet( modified_area->GetNet(), bMessageBoxInt, TRUE );
|
||||
CombineAllAreasInNet( modified_area->GetNet(), bMessageBoxInt, true );
|
||||
|
||||
return test;
|
||||
}
|
||||
|
@ -400,7 +401,7 @@ int BOARD::CombineAllAreasInNet( int aNetCode, bool bMessageBox, bool bUseUtilit
|
|||
|
||||
// bDontShowIntersectionWarning = dlg.bDontShowBoxState;
|
||||
}
|
||||
mod_ia1 = TRUE;
|
||||
mod_ia1 = true;
|
||||
}
|
||||
else if( ret == 2 )
|
||||
{
|
||||
|
@ -508,12 +509,33 @@ bool BOARD::TestAreaIntersections( ZONE_CONTAINER* area_to_test )
|
|||
int n_int = FindSegmentIntersections( xi1, yi1, xf1, yf1, style1,
|
||||
xi2, yi2, xf2, yf2, style2 );
|
||||
if( n_int )
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If a contour is inside an other contour, no segments intersects, but the zones can be combined
|
||||
// test a corner inside an outline (only one corner is enought)
|
||||
/* for( int ic2 = 0; ic2 < poly2->GetNumCorners(); ic2++ )
|
||||
{
|
||||
int x = poly2->GetX( ic2 );
|
||||
int y = poly2->GetY( ic2 );
|
||||
if( poly1->TestPointInside( x, y ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for( int ic1 = 0; ic1 < poly1->GetNumCorners(); ic1++ )
|
||||
{
|
||||
int x = poly1->GetX( ic1 );
|
||||
int y = poly1->GetY( ic1 );
|
||||
if( poly2->TestPointInside( x, y ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
*/ }
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -594,9 +616,9 @@ int BOARD::TestAreaIntersection( ZONE_CONTAINER* area_ref, ZONE_CONTAINER* area_
|
|||
xi2, yi2, xf2, yf2, style2 );
|
||||
if( n_int )
|
||||
{
|
||||
bInt = TRUE;
|
||||
bInt = true;
|
||||
if( style1 != CPolyLine::STRAIGHT || style2 != CPolyLine::STRAIGHT )
|
||||
bArcInt = TRUE;
|
||||
bArcInt = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -614,7 +636,32 @@ int BOARD::TestAreaIntersection( ZONE_CONTAINER* area_ref, ZONE_CONTAINER* area_
|
|||
}
|
||||
|
||||
if( !bInt )
|
||||
return 0;
|
||||
{
|
||||
/* if( bArcInt ) return 0;
|
||||
|
||||
// If a contour is inside an other contour, no segments intersects, but the zones can be combined
|
||||
// test a corner inside an outline (only one corner is enought)
|
||||
for( int ic2 = 0; ic2 < poly2->GetNumCorners(); ic2++ )
|
||||
{
|
||||
int x = poly2->GetX( ic2 );
|
||||
int y = poly2->GetY( ic2 );
|
||||
if( poly1->TestPointInside( x, y ) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
for( int ic1 = 0; ic1 < poly1->GetNumCorners(); ic1++ )
|
||||
{
|
||||
int x = poly1->GetX( ic1 );
|
||||
int y = poly1->GetY( ic1 );
|
||||
if( poly2->TestPointInside( x, y ) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
*/ return 0;
|
||||
}
|
||||
if( bArcInt )
|
||||
return 2;
|
||||
return 1;
|
||||
|
|
|
@ -10,6 +10,9 @@ using namespace std;
|
|||
#include <math.h>
|
||||
#include <vector>
|
||||
|
||||
#include "fctsys.h"
|
||||
|
||||
|
||||
#include "PolyLine.h"
|
||||
|
||||
#define to_int(x) (int)round((x))
|
||||
|
@ -83,8 +86,7 @@ int CPolyLine::NormalizeWithGpc( std::vector<CPolyLine*> * pa, bool bRetainArcs
|
|||
{
|
||||
// next external contour, create new poly
|
||||
CPolyLine * poly = new CPolyLine;
|
||||
pa->SetSize(n_ext_cont); // put in array
|
||||
(*pa)[n_ext_cont-1] = poly;
|
||||
pa->push_back(poly); // put in array
|
||||
for( int i=0; i<m_gpc_poly->contour[ic].num_vertices; i++ )
|
||||
{
|
||||
int x = to_int(((m_gpc_poly->contour)[ic].vertex)[i].x);
|
||||
|
@ -136,7 +138,7 @@ int CPolyLine::NormalizeWithGpc( std::vector<CPolyLine*> * pa, bool bRetainArcs
|
|||
}
|
||||
}
|
||||
if( !ext_poly )
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
for( int i=0; i<m_gpc_poly->contour[ic].num_vertices; i++ )
|
||||
{
|
||||
int x = to_int(((m_gpc_poly->contour)[ic].vertex)[i].x);
|
||||
|
@ -422,7 +424,7 @@ int CPolyLine::MakeGpcPoly( int icontour, std::vector<CArc> * arc_array )
|
|||
}
|
||||
}
|
||||
if( n_vertices != ivtx )
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
// add vertex_list to gpc
|
||||
gpc_add_contour( gpc, g_v_list, 0 );
|
||||
// now clip m_gpc_poly with gpc, put new poly into result
|
||||
|
@ -641,7 +643,7 @@ void CPolyLine::AppendCorner( int x, int y, int style, bool bDraw )
|
|||
else if( style == CPolyLine::ARC_CCW )
|
||||
dl_type = DL_ARC_CCW;
|
||||
else
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
if( bDraw )
|
||||
Draw();
|
||||
}
|
||||
|
@ -651,7 +653,7 @@ void CPolyLine::AppendCorner( int x, int y, int style, bool bDraw )
|
|||
void CPolyLine::Close( int style, bool bDraw )
|
||||
{
|
||||
if( GetClosed() )
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
Undraw();
|
||||
side_style[corner.size()-1] = style;
|
||||
corner[corner.size()-1].end_contour = TRUE;
|
||||
|
@ -720,7 +722,7 @@ void CPolyLine::RemoveContour( int icont )
|
|||
if( icont == 0 && GetNumContours() == 1 )
|
||||
{
|
||||
// remove the only contour
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
}
|
||||
else if( icont == GetNumContours()-1 )
|
||||
{
|
||||
|
@ -919,7 +921,7 @@ int CPolyLine::GetContourStart( int icont )
|
|||
return i+1;
|
||||
}
|
||||
}
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -941,7 +943,7 @@ int CPolyLine::GetContourEnd( int icont )
|
|||
ncont++;
|
||||
}
|
||||
}
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1062,7 +1064,7 @@ void CPolyLine::Hatch()
|
|||
else if( layer < (LAY_TOP_COPPER+16) )
|
||||
offset = 7*spacing/8;
|
||||
else
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
min_a += offset;
|
||||
|
||||
// now calculate and draw hatch lines
|
||||
|
@ -1104,20 +1106,20 @@ void CPolyLine::Hatch()
|
|||
xx[npts] = (int)x;
|
||||
yy[npts] = (int)y;
|
||||
npts++;
|
||||
ASSERT( npts<MAXPTS ); // overflow
|
||||
wxASSERT( npts<MAXPTS ); // overflow
|
||||
}
|
||||
if( ok == 2 )
|
||||
{
|
||||
xx[npts] = (int)x2;
|
||||
yy[npts] = (int)y2;
|
||||
npts++;
|
||||
ASSERT( npts<MAXPTS ); // overflow
|
||||
wxASSERT( npts<MAXPTS ); // overflow
|
||||
}
|
||||
}
|
||||
nloops++;
|
||||
a += PCBU_PER_MIL/100;
|
||||
} while( npts%2 != 0 && nloops < 3 );
|
||||
ASSERT( npts%2==0 ); // odd number of intersection points, error
|
||||
wxASSERT( npts%2==0 ); // odd number of intersection points, error
|
||||
|
||||
// sort points in order of descending x (if more than 2)
|
||||
if( npts>2 )
|
||||
|
@ -1177,7 +1179,7 @@ bool CPolyLine::TestPointInside( int x, int y )
|
|||
{
|
||||
enum { MAXPTS = 100 };
|
||||
if( !GetClosed() )
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
|
||||
// define line passing through (x,y), with slope = 2/3;
|
||||
// get intersection points
|
||||
|
@ -1216,21 +1218,21 @@ bool CPolyLine::TestPointInside( int x, int y )
|
|||
xx[npts] = (int)x;
|
||||
yy[npts] = (int)y;
|
||||
npts++;
|
||||
ASSERT( npts<MAXPTS ); // overflow
|
||||
wxASSERT( npts<MAXPTS ); // overflow
|
||||
}
|
||||
if( ok == 2 )
|
||||
{
|
||||
xx[npts] = (int)x2;
|
||||
yy[npts] = (int)y2;
|
||||
npts++;
|
||||
ASSERT( npts<MAXPTS ); // overflow
|
||||
wxASSERT( npts<MAXPTS ); // overflow
|
||||
}
|
||||
}
|
||||
}
|
||||
nloops++;
|
||||
a += PCBU_PER_MIL/100;
|
||||
} while( npts%2 != 0 && nloops < 3 );
|
||||
ASSERT( npts%2==0 ); // odd number of intersection points, error
|
||||
wxASSERT( npts%2==0 ); // odd number of intersection points, error
|
||||
|
||||
// count intersection points to right of (x,y), if odd (x,y) is inside polyline
|
||||
int ncount = 0;
|
||||
|
@ -1256,7 +1258,7 @@ bool CPolyLine::TestPointInsideContour( int icont, int x, int y )
|
|||
|
||||
enum { MAXPTS = 100 };
|
||||
if( !GetClosed() )
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
|
||||
// define line passing through (x,y), with slope = 2/3;
|
||||
// get intersection points
|
||||
|
@ -1293,20 +1295,20 @@ bool CPolyLine::TestPointInsideContour( int icont, int x, int y )
|
|||
xx[npts] = (int)x;
|
||||
yy[npts] = (int)y;
|
||||
npts++;
|
||||
ASSERT( npts<MAXPTS ); // overflow
|
||||
wxASSERT( npts<MAXPTS ); // overflow
|
||||
}
|
||||
if( ok == 2 )
|
||||
{
|
||||
xx[npts] = (int)x2;
|
||||
yy[npts] = (int)y2;
|
||||
npts++;
|
||||
ASSERT( npts<MAXPTS ); // overflow
|
||||
wxASSERT( npts<MAXPTS ); // overflow
|
||||
}
|
||||
}
|
||||
nloops++;
|
||||
a += PCBU_PER_MIL/100;
|
||||
} while( npts%2 != 0 && nloops < 3 );
|
||||
ASSERT( npts%2==0 ); // odd number of intersection points, error
|
||||
wxASSERT( npts%2==0 ); // odd number of intersection points, error
|
||||
|
||||
// count intersection points to right of (x,y), if odd (x,y) is inside polyline
|
||||
int ncount = 0;
|
||||
|
@ -1328,9 +1330,9 @@ bool CPolyLine::TestPointInsideContour( int icont, int x, int y )
|
|||
int CPolyLine::TestIntersection( CPolyLine * poly )
|
||||
{
|
||||
if( !GetClosed() )
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
if( !poly->GetClosed() )
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
for( int ic=0; ic<GetNumContours(); ic++ )
|
||||
{
|
||||
int istart = GetContourStart(ic);
|
||||
|
|
|
@ -36,6 +36,4 @@
|
|||
|
||||
#define TRACE printf
|
||||
|
||||
#define ASSERT(x) // todo : change to wxASSERT, under wxWidgets
|
||||
|
||||
#endif // ifndef DEFS_MACROS_H
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
|
||||
#include <math.h>
|
||||
|
||||
#include "fctsys.h"
|
||||
|
||||
|
||||
#include "php_polygon_vertex.h"
|
||||
#include "php_polygon.h"
|
||||
|
||||
|
@ -427,9 +430,9 @@ BOOL polygon::ints( vertex * p1, vertex * p2, vertex * q1, vertex * q2,
|
|||
double tua = ((tx4-tx3)*(ty1-ty3)-(ty4-ty3)*(tx1-tx3))/td;
|
||||
double tub = ((tx2-tx1)*(ty1-ty3)-(ty2-ty1)*(tx1-tx3))/td;
|
||||
if( abs(tua)<=eps || abs(1.0-tua)<=eps || abs(tub)<=eps || abs(1.0-tub)<=eps )
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
else if( (tua > 0 && tua < 1) && (tub > 0 && tub < 1) )
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
TRACE( " perturb:\n new s = (%f,%f) to (%f,%f)\n new c = (%f,%f) to (%f,%f)\n new ua = %.17f, ub = %.17f\n",
|
||||
tx1, ty1, tx2, ty2, tx3, ty3, tx4, ty4, tua, tub );
|
||||
}
|
||||
|
@ -650,7 +653,7 @@ BOOL polygon::isInside( vertex * v )
|
|||
{
|
||||
//** modified for testing
|
||||
if( v->isIntersect() )
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
int winding_number = 0;
|
||||
int winding_number2 = 0;
|
||||
int winding_number3 = 0;
|
||||
|
@ -689,7 +692,7 @@ BOOL polygon::isInside( vertex * v )
|
|||
if( winding_number%2 != winding_number2%2
|
||||
|| winding_number3%2 != winding_number4%2
|
||||
|| winding_number%2 != winding_number3%2 )
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
if( winding_number%2 == 0 ) // Check even or odd
|
||||
return FALSE; // even == outside
|
||||
else
|
||||
|
@ -780,9 +783,9 @@ polygon * polygon::boolean( polygon * polyB, int oper )
|
|||
s = s->Next();
|
||||
} while( s->id() != polyB->m_first->id() );
|
||||
if( n_ints != n_polyB_ints )
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
if( n_ints%2 != 0 )
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
//** end test
|
||||
|
||||
/*
|
||||
|
@ -817,7 +820,7 @@ polygon * polygon::boolean( polygon * polyB, int oper )
|
|||
s = m_first;
|
||||
//** testing
|
||||
if( s->isIntersect() )
|
||||
ASSERT(0);
|
||||
wxASSERT(0);
|
||||
//** end test
|
||||
BOOL entry;
|
||||
if (polyB->isInside(s)) // if we are already inside
|
||||
|
|
Loading…
Reference in New Issue