pcbnew: addded zones in non copper areas and starting work to use polygons in zone fill algos in not copper areas

work in progress: see changelog
This commit is contained in:
charras 2008-09-26 19:51:36 +00:00
parent 064fcf5491
commit 27cf4ad0ad
27 changed files with 2633 additions and 1481 deletions

View File

@ -5,6 +5,18 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2008-Sep-26 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+pcbnew:
Starting work to use polygons in zone fill algos.
Currently, use this to add zone on non copper layers (technical layers)
Only for eyes.
Plot outputs do not handle this.
Problems with holes in zones.
Also: first used of wxFormBuilder
2008-Sep-17 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+pcbnew:

View File

@ -727,42 +727,41 @@ wxPoint LibDrawPin::ReturnPinEndPoint()
int LibDrawPin::ReturnPinDrawOrient( int TransMat[2][2] )
/********************************************************/
/* Return the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT),
* according to its orientation,
* AND the matrix transform (rot, mirror) TransMat
/** Function ReturnPinDrawOrient
* Return the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT),
* according to its orientation and the matrix transform (rot, mirror) TransMat
* @param TransMat = transform matrix
*/
{
int orient;
int x1 = 0, y1 = 0;
int t1, t2;
wxPoint end; // position of a end pin starting at 0,0 according to its orientation, lenght = 1
switch( m_Orient )
{
case PIN_UP:
y1 = 1; break;
end.y = 1; break;
case PIN_DOWN:
y1 = -1; break;
end.y = -1; break;
case PIN_LEFT:
x1 = -1; break;
end.x = -1; break;
case PIN_RIGHT:
x1 = 1; break;
end.x = 1; break;
}
t1 = TransMat[0][0] * x1 + TransMat[0][1] * y1;
t2 = TransMat[1][0] * x1 + TransMat[1][1] * y1;
end = TransformCoordinate( TransMat, end ); // = pos of end point, accordint to the component orientation
orient = PIN_UP;
if( t1 == 0 )
if( end.x == 0 )
{
if( t2 > 0 )
if( end.y > 0 )
orient = PIN_DOWN;
}
else
{
orient = PIN_RIGHT;
if( t1 < 0 )
if( end.x < 0 )
orient = PIN_LEFT;
}

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -51,6 +51,8 @@ set(PCBNEW_SRCS
# dialog_graphic_items_options.cpp
# dialog_initpcb.cpp
# dialog_netlist.cpp
zones_non_copper_type_functions.cpp
dialog_non_copper_zones_properties.cpp
# dialog_pad_edit.cpp
dialog_setup_libs.cpp
dialog_orient_footprints.cpp

View File

@ -1063,6 +1063,24 @@ void BOARD::RedrawAreasOutlines(WinEDA_DrawPanel* panel, wxDC * aDC, int aDrawMo
}
}
/***********************************************************************************************/
void BOARD::RedrawFilledAreas(WinEDA_DrawPanel* panel, wxDC * aDC, int aDrawMode, int aLayer)
/***********************************************************************************************/
/**
* Function RedrawFilledAreas
* Redraw all areas outlines on layer aLayer ( redraw all if aLayer < 0 )
*/
{
if ( ! aDC ) return;
for( int ii = 0; ii < GetAreaCount(); ii++ )
{
ZONE_CONTAINER* edge_zone = GetArea(ii);
if( (aLayer < 0) || (aLayer == edge_zone->GetLayer()) )
edge_zone->DrawFilledArea( panel, aDC, aDrawMode );
}
}
#if defined(DEBUG)

View File

@ -366,6 +366,12 @@ public:
*/
void RedrawAreasOutlines(WinEDA_DrawPanel* panel, wxDC * aDC, int aDrawMode, int aLayer);
/**
* Function RedrawFilledAreas
* Redraw all filled areas on layer aLayer ( redraw all if aLayer < 0 )
*/
void RedrawFilledAreas(WinEDA_DrawPanel* panel, wxDC * aDC, int aDrawMode, int aLayer);
/**
* Function SetAreasNetCodesFromNetNames
* Set the .m_NetCode member of all copper areas, according to the area Net Name

View File

@ -149,7 +149,11 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
TimeStampText.Printf( wxT( "(%8.8X)" ), item->m_TimeStamp );
text << TimeStampText;
}
if( ((ZONE_CONTAINER*) item)->GetNet() >= 0 )
if ( !((ZONE_CONTAINER*) item)->IsOnCopperLayer() )
{
text << wxT( " [" ) << _("Not on copper layer") << wxT( "]" );
}
else if( ((ZONE_CONTAINER*) item)->GetNet() >= 0 )
{
net = aPcb->FindNet( ( (ZONE_CONTAINER*) item )->GetNet() );
if( net )

View File

@ -122,9 +122,11 @@ bool ZONE_CONTAINER::Save( FILE* aFile ) const
case PAD_IN_ZONE:
padoption = 'I';
break;
case THERMAL_PAD:
padoption = 'T';
break;
case PAD_NOT_IN_ZONE:
padoption = 'X';
break;
@ -157,7 +159,7 @@ int ZONE_CONTAINER::ReadDescr( FILE* aFile, int* aLineNum )
/** Function ReadDescr
* @param aFile = opened file
* @param aLineNum = pointer on a line number counter (can be NULL or missing)
* @return 0 if ok or NULL
* @return 1 if ok or 0
*/
{
char Line[1024], * text;
@ -182,7 +184,7 @@ int ZONE_CONTAINER::ReadDescr( FILE* aFile, int* aLineNum )
if( !has_corner )
m_Poly->Start( m_Layer, x, y, outline_hatch );
else
AppendCorner( wxPoint(x, y) );
AppendCorner( wxPoint( x, y ) );
has_corner = true;
if( flag )
m_Poly->Close();
@ -281,6 +283,9 @@ int ZONE_CONTAINER::ReadDescr( FILE* aFile, int* aLineNum )
}
}
if( !IsOnCopperLayer() )
SetNet( 0 );
return error ? 0 : 1;
}
@ -331,14 +336,14 @@ void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, con
int i_start_contour = 0;
for( int ic = 0; ic < GetNumCorners(); ic++ )
{
seg_start = GetCornerPosition(ic) + offset;
seg_start = GetCornerPosition( ic ) + offset;
if( m_Poly->corner[ic].end_contour == FALSE && ic < GetNumCorners() - 1 )
{
seg_end = GetCornerPosition(ic + 1) + offset;
seg_end = GetCornerPosition( ic + 1 ) + offset;
}
else
{
seg_end = GetCornerPosition(i_start_contour) + offset;
seg_end = GetCornerPosition( i_start_contour ) + offset;
i_start_contour = ic + 1;
}
GRLine( &panel->m_ClipBox, DC, seg_start.x, seg_start.y, seg_end.x, seg_end.y, 0, color );
@ -356,9 +361,97 @@ void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, con
}
EDA_Rect ZONE_CONTAINER::GetBoundingBox()
/************************************************************************************/
void ZONE_CONTAINER::DrawFilledArea( WinEDA_DrawPanel* panel,
wxDC* DC, int aDrawMode, const wxPoint& offset )
/************************************************************************************/
/**
* Function DrawDrawFilledArea
* Draws the filled area for this zone (polygon list .m_FilledPolysList)
* @param panel = current Draw Panel
* @param DC = current Device Context
* @param offset = Draw offset (usually wxPoint(0,0))
* @param aDrawMode = GR_OR, GR_XOR, GR_COPY ..
*/
{
const int PRELOAD = 500000;
static int* CornersBuffer = NULL;
static unsigned CornersBufferSize = 0;
if( DC == NULL )
return;
if( !DisplayOpt.DisplayZones )
return;
unsigned imax = m_FilledPolysList.size();
if( imax == 0 ) // Nothing to draw
return;
int curr_layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer;
int color = g_DesignSettings.m_LayerColor[m_Layer];
if( ( color & (ITEM_NOT_SHOW | HIGHT_LIGHT_FLAG) ) == ITEM_NOT_SHOW )
return;
GRSetDrawMode( DC, aDrawMode );
if( DisplayOpt.ContrastModeDisplay )
{
if( !IsOnLayer( curr_layer ) )
{
color &= ~MASKCOLOR;
color |= DARKDARKGRAY;
}
}
if( aDrawMode & GR_SURBRILL )
{
if( aDrawMode & GR_AND )
color &= ~HIGHT_LIGHT_FLAG;
else
color |= HIGHT_LIGHT_FLAG;
}
if( color & HIGHT_LIGHT_FLAG )
color = ColorRefs[color & MASKCOLOR].m_LightColor;
// draw the filled polygon
if( CornersBuffer == NULL )
{
CornersBufferSize = imax * 4;
CornersBuffer = (int*) MyMalloc( CornersBufferSize * sizeof(int) );
}
if( (imax * 4) > CornersBufferSize )
{
CornersBufferSize = imax * 4;
CornersBuffer = (int*) realloc( CornersBuffer, CornersBufferSize * sizeof(int) );
}
int corners_count = 0;
for( unsigned ic = 0, ii = 0; ic < imax; ic++ )
{
CPolyPt* corner = &m_FilledPolysList[ic];
CornersBuffer[ii++] = corner->x + offset.x;
CornersBuffer[ii++] = corner->y + offset.y;
corners_count++;
if( corner->end_contour )
{
GRPoly( &panel->m_ClipBox, DC, corners_count, CornersBuffer,
1, 0, color, color );
corners_count = 0;
ii = 0;
}
}
}
/****************************************/
EDA_Rect ZONE_CONTAINER::GetBoundingBox()
/****************************************/
{
const int PRELOAD = 0x7FFFFFFF; // Biggest integer (32 bits)
int ymax = -PRELOAD;
int ymin = PRELOAD;
@ -367,9 +460,9 @@ EDA_Rect ZONE_CONTAINER::GetBoundingBox()
int count = GetNumCorners();
for( int i=0; i<count; ++i )
for( int i = 0; i<count; ++i )
{
wxPoint corner = GetCornerPosition(i);
wxPoint corner = GetCornerPosition( i );
ymax = MAX( ymax, corner.y );
xmax = MAX( xmax, corner.x );
@ -377,7 +470,7 @@ EDA_Rect ZONE_CONTAINER::GetBoundingBox()
xmin = MIN( xmin, corner.x );
}
EDA_Rect ret( wxPoint(xmin,ymin), wxSize( xmax-xmin+1, ymax-ymin+1) );
EDA_Rect ret( wxPoint( xmin, ymin ), wxSize( xmax - xmin + 1, ymax - ymin + 1 ) );
return ret;
}
@ -386,6 +479,7 @@ EDA_Rect ZONE_CONTAINER::GetBoundingBox()
/**********************************************************************************************/
void ZONE_CONTAINER::DrawWhileCreateOutline( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode )
/***********************************************************************************************/
/**
* Function DrawWhileCreateOutline
* Draws the zone outline when ir is created.
@ -403,7 +497,7 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( WinEDA_DrawPanel* panel, wxDC* DC,
if( DC == NULL )
return;
int curr_layer = ((PCB_SCREEN*)panel->GetScreen())->m_Active_Layer;
int curr_layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer;
int color = g_DesignSettings.m_LayerColor[m_Layer] & MASKCOLOR;
if( DisplayOpt.ContrastModeDisplay )
@ -417,18 +511,18 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( WinEDA_DrawPanel* panel, wxDC* DC,
// draw the lines
wxPoint start_contour_pos = GetCornerPosition(0);
wxPoint start_contour_pos = GetCornerPosition( 0 );
for( int ic = 0; ic < GetNumCorners(); ic++ )
{
int xi = GetCornerPosition(ic).x;
int yi = GetCornerPosition(ic).y;
int xi = GetCornerPosition( ic ).x;
int yi = GetCornerPosition( ic ).y;
int xf, yf;
if( m_Poly->corner[ic].end_contour == FALSE && ic < GetNumCorners() - 1 )
{
is_close_segment = false;
xf = GetCornerPosition(ic + 1).x;
yf = GetCornerPosition(ic + 1).y;
if ( (m_Poly->corner[ic + 1].end_contour) || (ic == GetNumCorners() - 2) )
xf = GetCornerPosition( ic + 1 ).x;
yf = GetCornerPosition( ic + 1 ).y;
if( (m_Poly->corner[ic + 1].end_contour) || (ic == GetNumCorners() - 2) )
current_gr_mode = GR_XOR;
else
current_gr_mode = draw_mode;
@ -439,10 +533,10 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( WinEDA_DrawPanel* panel, wxDC* DC,
current_gr_mode = GR_XOR;
xf = start_contour_pos.x;
yf = start_contour_pos.y;
start_contour_pos = GetCornerPosition(ic + 1);
start_contour_pos = GetCornerPosition( ic + 1 );
}
GRSetDrawMode( DC, current_gr_mode );
if ( is_close_segment )
if( is_close_segment )
GRLine( &panel->m_ClipBox, DC, xi, yi, xf, yf, 0, WHITE );
else
GRLine( &panel->m_ClipBox, DC, xi, yi, xf, yf, 0, color );
@ -450,7 +544,6 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( WinEDA_DrawPanel* panel, wxDC* DC,
}
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
@ -609,6 +702,8 @@ void ZONE_CONTAINER::Display_Infos( WinEDA_DrawFrame* frame )
text_pos += 15;
if( IsOnCopperLayer() )
{
if( GetNet() >= 0 )
{
EQUIPOT* equipot = ( (WinEDA_PcbFrame*) frame )->m_Pcb->FindNet( GetNet() );
@ -626,6 +721,9 @@ void ZONE_CONTAINER::Display_Infos( WinEDA_DrawFrame* frame )
}
Affiche_1_Parametre( frame, text_pos, _( "NetName" ), msg, RED );
}
else
Affiche_1_Parametre( frame, text_pos, _( "Non Copper Zone" ), wxEmptyString, RED );
/* Display net code : (usefull in test or debug) */
text_pos += 18;
@ -657,12 +755,13 @@ void ZONE_CONTAINER::Move( const wxPoint& offset )
{
for( unsigned ii = 0; ii < m_Poly->corner.size(); ii++ )
{
SetCornerPosition(ii, GetCornerPosition(ii) + offset);
SetCornerPosition( ii, GetCornerPosition( ii ) + offset );
}
m_Poly->Hatch();
}
/**
* Function MoveEdge
* Move the outline Edge. m_CornerSelection is the start point of the outline edge
@ -673,17 +772,17 @@ void ZONE_CONTAINER::MoveEdge( const wxPoint& offset )
int ii = m_CornerSelection;
// Move the start point of the selected edge:
SetCornerPosition(ii, GetCornerPosition(ii) + offset);
SetCornerPosition( ii, GetCornerPosition( ii ) + offset );
// Move the end point of the selected edge:
if ( m_Poly->corner[ii].end_contour || ii == GetNumCorners() - 1)
if( m_Poly->corner[ii].end_contour || ii == GetNumCorners() - 1 )
{
int icont = m_Poly->GetContour( ii );
ii = m_Poly->GetContourStart( icont );
}
else
ii++;
SetCornerPosition(ii, GetCornerPosition(ii) + offset);
SetCornerPosition( ii, GetCornerPosition( ii ) + offset );
m_Poly->Hatch();
}

View File

@ -5,6 +5,8 @@
#ifndef CLASS_ZONE_H
#define CLASS_ZONE_H
#include <vector>
#include "PolyLine.h"
/************************/
@ -32,12 +34,18 @@ public:
int m_GridFillValue; // Grid used for filling
m_PadInZone m_PadOption; // see m_PadInZone
int utility, utility2; // flags used in polygon calculations
std::vector <CPolyPt> m_FilledPolysList; /* set of filled polygons used to draw a zone as a filled area.
* from outlines (m_Poly) but unlike m_Poly these filled polygons have no hole (they are all in one piece)
* In very simple cases m_FilledPolysList is same as m_Poly
* In less simple cases (when m_Poly has holes) m_FilledPolysList is a polygon equivalent to m_Poly, without holes
* In complex cases an ouline decribed by m_Poly can have many filled areas
*/
private:
int m_NetCode; // Net number for fast comparisons
public:
ZONE_CONTAINER( BOARD * parent );
ZONE_CONTAINER( BOARD* parent );
~ZONE_CONTAINER();
bool Save( FILE* aFile ) const;
@ -46,9 +54,11 @@ public:
wxPoint& GetPosition()
{
static wxPoint pos;
return pos;
}
void UnLink( void )
{
};
@ -70,8 +80,23 @@ public:
* @param offset = Draw offset (usually wxPoint(0,0))
* @param aDrawMode = GR_OR, GR_XOR, GR_COPY ..
*/
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset = ZeroOffset );
void Draw( WinEDA_DrawPanel* panel,
wxDC* DC,
int aDrawMode,
const wxPoint& offset = ZeroOffset );
/**
* Function DrawDrawFilledArea
* Draws the filled area for this zone (polygon list .m_FilledPolysList)
* @param panel = current Draw Panel
* @param DC = current Device Context
* @param offset = Draw offset (usually wxPoint(0,0))
* @param aDrawMode = GR_OR, GR_XOR, GR_COPY ..
*/
void DrawFilledArea( WinEDA_DrawPanel* panel,
wxDC* DC,
int aDrawMode,
const wxPoint& offset = ZeroOffset );
EDA_Rect GetBoundingBox();
@ -88,10 +113,22 @@ public:
void DrawWhileCreateOutline( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode = GR_OR );
/**
* Function IsOnCopperLayer
* @return true if this zone is on a copper layer, false if on a technical layer
*/
bool IsOnCopperLayer( void )
{
return ( GetLayer() < FIRST_NO_COPPER_LAYER ) ? true : false;
}
int GetNet( void ) const
{
return m_NetCode;
}
void SetNet( int anet_code );
/**
@ -102,6 +139,14 @@ public:
*/
bool HitTest( const wxPoint& refPos );
/** function BuildFilledPolysListData
* Build m_FilledPolysList data from real outlines (m_Poly)
* in order to have drawable (and plottable) filled polygons
* drawable filled polygons are polygons without hole
* @return number of polygons
*/
int BuildFilledPolysListData( void );
/**
* Function HitTestForCorner
* tests if the given wxPoint near a corner, or near the segment define by 2 corners.
@ -181,30 +226,35 @@ public:
return wxT( "ZONE_CONTAINER" );
}
/** Acces to m_Poly parameters
*/
int GetNumCorners(void)
int GetNumCorners( void )
{
return m_Poly->GetNumCorners();
}
void RemoveAllContours(void)
void RemoveAllContours( void )
{
m_Poly->RemoveAllContours();
}
wxPoint GetCornerPosition(int aCornerIndex)
wxPoint GetCornerPosition( int aCornerIndex )
{
return wxPoint(m_Poly->GetX(aCornerIndex), m_Poly->GetY(aCornerIndex));
return wxPoint( m_Poly->GetX( aCornerIndex ), m_Poly->GetY( aCornerIndex ) );
}
void SetCornerPosition(int aCornerIndex, wxPoint new_pos)
void SetCornerPosition( int aCornerIndex, wxPoint new_pos )
{
m_Poly->SetX(aCornerIndex, new_pos.x);
m_Poly->SetY(aCornerIndex, new_pos.y);
m_Poly->SetX( aCornerIndex, new_pos.x );
m_Poly->SetY( aCornerIndex, new_pos.y );
}
void AppendCorner( wxPoint position )
{
m_Poly->AppendCorner( position.x, position.y );

View File

@ -0,0 +1,69 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_non_copper_zones_properties.h"
///////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE( DialogNonCopperZonesProperties, wxDialog )
EVT_INIT_DIALOG( DialogNonCopperZonesProperties::_wxFB_InitDialog )
EVT_BUTTON( wxID_OK, DialogNonCopperZonesProperties::_wxFB_OnOkClick )
EVT_BUTTON( wxID_CANCEL, DialogNonCopperZonesProperties::_wxFB_OnCancelClick )
END_EVENT_TABLE()
DialogNonCopperZonesProperties::DialogNonCopperZonesProperties( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* m_MainSizer;
m_MainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* m_UpperSizer;
m_UpperSizer = new wxBoxSizer( wxHORIZONTAL );
wxString m_OutlineAppearanceCtrlChoices[] = { _("Line"), _("Hatched Outline"), _("Full Hatched") };
int m_OutlineAppearanceCtrlNChoices = sizeof( m_OutlineAppearanceCtrlChoices ) / sizeof( wxString );
m_OutlineAppearanceCtrl = new wxRadioBox( this, wxID_ANY, _("Outlines Appearence"), wxDefaultPosition, wxDefaultSize, m_OutlineAppearanceCtrlNChoices, m_OutlineAppearanceCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_OutlineAppearanceCtrl->SetSelection( 1 );
m_UpperSizer->Add( m_OutlineAppearanceCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
wxString m_OrientEdgesOptChoices[] = { _("Any"), _("H, V and 45 deg") };
int m_OrientEdgesOptNChoices = sizeof( m_OrientEdgesOptChoices ) / sizeof( wxString );
m_OrientEdgesOpt = new wxRadioBox( this, wxID_ANY, _("Zone Edges Orient"), wxDefaultPosition, wxDefaultSize, m_OrientEdgesOptNChoices, m_OrientEdgesOptChoices, 1, wxRA_SPECIFY_COLS );
m_OrientEdgesOpt->SetSelection( 0 );
m_UpperSizer->Add( m_OrientEdgesOpt, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
wxBoxSizer* m_ButtonsSizer;
m_ButtonsSizer = new wxBoxSizer( wxVERTICAL );
m_buttonOk = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonOk->SetDefault();
m_ButtonsSizer->Add( m_buttonOk, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
m_ButtonsSizer->Add( m_buttonCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_UpperSizer->Add( m_ButtonsSizer, 1, wxALIGN_CENTER_VERTICAL, 5 );
m_MainSizer->Add( m_UpperSizer, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 );
m_staticTextLayerSelection = new wxStaticText( this, wxID_ANY, _("Layer selection:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextLayerSelection->Wrap( -1 );
m_MainSizer->Add( m_staticTextLayerSelection, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_LayerSelectionCtrl = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_MainSizer->Add( m_LayerSelectionCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
this->SetSizer( m_MainSizer );
this->Layout();
this->Centre( wxBOTH );
}
DialogNonCopperZonesProperties::~DialogNonCopperZonesProperties()
{
}

View File

@ -0,0 +1,418 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="9" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">table</property>
<property name="file">dialog_non_copper_zones_properties</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">1</property>
<property name="name">dialog_non_copper_zones_properties</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="use_enum">1</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
<property name="bg"></property>
<property name="center">wxBOTH</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="extra_style"></property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">DialogNonCopperZonesProperties</property>
<property name="pos"></property>
<property name="size">366,221</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass"></property>
<property name="title">Non Copper Zones Properties</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER</property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnChar"></event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog">InitDialog</event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">m_MainSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">m_UpperSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxRadioBox" expanded="1">
<property name="bg"></property>
<property name="choices">&quot;Line&quot; &quot;Hatched Outline&quot; &quot;Full Hatched&quot;</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Outlines Appearence</property>
<property name="majorDimension">1</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_OutlineAppearanceCtrl</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="selection">1</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRadioBox"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxRadioBox" expanded="1">
<property name="bg"></property>
<property name="choices">&quot;Any&quot; &quot;H, V and 45 deg&quot;</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Zone Edges Orient</property>
<property name="majorDimension">1</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_OrientEdgesOpt</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="selection">0</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRadioBox"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">m_ButtonsSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="default">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_OK</property>
<property name="label">OK</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_buttonOk</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnOkClick</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_CANCEL</property>
<property name="label">Cancel</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_buttonCancel</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnCancelClick</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Layer selection:</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_staticTextLayerSelection</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxListBox" expanded="1">
<property name="bg"></property>
<property name="choices"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_LayerSelectionCtrl</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnListBox"></event>
<event name="OnListBoxDClick"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -0,0 +1,61 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_non_copper_zones_properties__
#define __dialog_non_copper_zones_properties__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/radiobox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/listbox.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DialogNonCopperZonesProperties
///////////////////////////////////////////////////////////////////////////////
class DialogNonCopperZonesProperties : public wxDialog
{
DECLARE_EVENT_TABLE()
private:
// Private event handlers
void _wxFB_InitDialog( wxInitDialogEvent& event ){ InitDialog( event ); }
void _wxFB_OnOkClick( wxCommandEvent& event ){ OnOkClick( event ); }
void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); }
protected:
wxRadioBox* m_OutlineAppearanceCtrl;
wxRadioBox* m_OrientEdgesOpt;
wxButton* m_buttonOk;
wxButton* m_buttonCancel;
wxStaticText* m_staticTextLayerSelection;
wxListBox* m_LayerSelectionCtrl;
// Virtual event handlers, overide them in your derived class
virtual void InitDialog( wxInitDialogEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
public:
DialogNonCopperZonesProperties( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Non Copper Zones Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 366,221 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER );
~DialogNonCopperZonesProperties();
};
#endif //__dialog_non_copper_zones_properties__

View File

@ -260,7 +260,7 @@ void WinEDA_ZoneFrame::CreateControls()
m_Parent->m_InternalUnits );
m_ZoneClearanceCtrl->SetValue( title );
if( Zone_45_Only )
if( g_Zone_45_Only )
m_OrientEdgesOpt->SetSelection( 1 );
static const int GridList[4] = { 25, 50, 100, 250 };
@ -297,7 +297,7 @@ void WinEDA_ZoneFrame::CreateControls()
m_FillOpt->SetSelection( 0 );
break;
}
s_Zone_Hatching = m_Zone_Container->m_Poly->GetHatchStyle();
g_Zone_Hatching = m_Zone_Container->m_Poly->GetHatchStyle();
}
else
@ -314,11 +314,11 @@ void WinEDA_ZoneFrame::CreateControls()
m_FillOpt->SetSelection( 0 );
break;
}
s_Zone_Hatching = m_Parent->m_Parent->m_EDA_Config->Read( ZONE_NET_OUTLINES_HATCH_OPTION_KEY,
g_Zone_Hatching = m_Parent->m_Parent->m_EDA_Config->Read( ZONE_NET_OUTLINES_HATCH_OPTION_KEY,
(long) CPolyLine::DIAGONAL_EDGE );
}
switch( s_Zone_Hatching )
switch( g_Zone_Hatching )
{
case CPolyLine::NO_HATCH:
m_OutlineAppearanceCtrl->SetSelection(0);
@ -485,21 +485,21 @@ bool WinEDA_ZoneFrame::AcceptOptions(bool aPromptForErrors)
switch( m_OutlineAppearanceCtrl->GetSelection() )
{
case 0:
s_Zone_Hatching = CPolyLine::NO_HATCH;
g_Zone_Hatching = CPolyLine::NO_HATCH;
break;
case 1:
s_Zone_Hatching = CPolyLine::DIAGONAL_EDGE;
g_Zone_Hatching = CPolyLine::DIAGONAL_EDGE;
break;
case 2:
s_Zone_Hatching = CPolyLine::DIAGONAL_FULL;
g_Zone_Hatching = CPolyLine::DIAGONAL_FULL;
break;
}
if( m_Parent->m_Parent->m_EDA_Config )
{
m_Parent->m_Parent->m_EDA_Config->Write( ZONE_NET_OUTLINES_HATCH_OPTION_KEY, (long)s_Zone_Hatching);
m_Parent->m_Parent->m_EDA_Config->Write( ZONE_NET_OUTLINES_HATCH_OPTION_KEY, (long)g_Zone_Hatching);
}
switch( m_GridCtrl->GetSelection() )
@ -526,9 +526,9 @@ bool WinEDA_ZoneFrame::AcceptOptions(bool aPromptForErrors)
g_DesignSettings.m_ZoneClearence =
ReturnValueFromString( g_UnitMetric, txtvalue, m_Parent->m_InternalUnits );
if( m_OrientEdgesOpt->GetSelection() == 0 )
Zone_45_Only = FALSE;
g_Zone_45_Only = FALSE;
else
Zone_45_Only = TRUE;
g_Zone_45_Only = TRUE;
/* Get the layer selection for this zone */
int ii = m_LayerSelectionCtrl->GetSelection();
@ -537,7 +537,7 @@ bool WinEDA_ZoneFrame::AcceptOptions(bool aPromptForErrors)
DisplayError( this, _( "Error : you must choose a layer" ) );
return false;
}
s_Zone_Layer = m_LayerId[ii];
g_CurrentZone_Layer = m_LayerId[ii];
/* Get the net name selection for this zone */
ii = m_ListNetNameSelection->GetSelection();

View File

@ -320,6 +320,8 @@ void DRC::testZones(bool adoTestFillSegments)
for( int ii = 0; ii < m_pcb->GetAreaCount(); ii++ )
{
ZONE_CONTAINER* Area_To_Test = m_pcb->GetArea( ii );
if( ! Area_To_Test->IsOnCopperLayer() )
continue;
if( Area_To_Test->GetNet() <= 0 )
{
m_currentMarker = fillMarker( Area_To_Test,

View File

@ -771,7 +771,7 @@ int WinEDA_PcbFrame::ReadPcbFile( FILE* File, bool Append )
wxBusyCursor dummy;
// Switch the locale to standard C (needed to print floating point numbers like 1.3)
// Switch the locale to standard C (needed to read floating point numbers like 1.3)
SetLocaleTo_C_standard( );
NbDraw = NbTrack = NbZone = NbMod = NbNets = -1;
@ -1010,6 +1010,13 @@ int WinEDA_PcbFrame::ReadPcbFile( FILE* File, bool Append )
BestZoom();
#ifdef PCBNEW
if( m_Pcb->m_ZoneDescriptorList.size() > 0 )
{ // Build filled areas
for( unsigned ia = 0; ia < m_Pcb->m_ZoneDescriptorList.size(); ia++ )
m_Pcb->m_ZoneDescriptorList[ia]->BuildFilledPolysListData( );
}
// Build connectivity info
Compile_Ratsnest( NULL, TRUE );
#endif
return 1;

View File

@ -20,6 +20,8 @@ OBJECTS= $(TARGET).o classpcb.o\
$(SPECCTRA_TOOLS)\
lay2plot.o\
dialog_freeroute_exchange.o\
dialog_non_copper_zones_properties.o\
zones_non_copper_type_functions.o\
modedit_undo_redo.o\
block_module_editor.o\
onrightclick.o\

View File

@ -18,6 +18,7 @@
#include "trigo.h"
#include "cell.h"
#include "worksheet.h"
#include "zones.h"
#include "protos.h"

View File

@ -8,6 +8,10 @@
#include <vector>
/* install function for DialogNonCopperZonesEditor dialog frame :*/
bool InstallDialogNonCopperZonesEditor(WinEDA_PcbFrame* aParent, ZONE_CONTAINER* aZone);
/***************/
/* PAD_CONNECT.CPP */
/***************/

View File

@ -173,7 +173,10 @@ void WinEDA_PcbFrame::Trace_Pcb( wxDC* DC, int mode )
// Areas must be drawn here only if not moved or dragged,
// because these areas are drawn by ManageCursor() in a specific manner
if ( (edge_zone->m_Flags & (IN_EDIT | IS_DRAGGED | IS_MOVED)) == 0 )
{
edge_zone->Draw( DrawPanel, DC, mode );
edge_zone->DrawFilledArea( DrawPanel, DC, mode );
}
}
// draw the BOARD's markers.

37
pcbnew/zones.h Normal file
View File

@ -0,0 +1,37 @@
/************************************************/
/* constants used in zone dialogs and functions */
/************************************************/
#ifndef ZONES_H
#define ZONES_H
#ifndef eda_global
#define eda_global extern
#endif
// keys used to store net sort option in config file :
#define ZONE_NET_OUTLINES_HATCH_OPTION_KEY wxT( "Zone_Ouline_Hatch_Opt" )
#define ZONE_NET_SORT_OPTION_KEY wxT( "Zone_NetSort_Opt" )
#define ZONE_NET_FILTER_STRING_KEY wxT( "Zone_Filter_Opt" )
enum zone_cmd {
ZONE_ABORT,
ZONE_OK
};
/************************************************/
/* variables used in zone dialogs and functions */
/************************************************/
eda_global bool g_Zone_45_Only
#ifdef MAIN
= FALSE
#endif
;
eda_global int g_CurrentZone_Layer; // Layer used to create the current zone
eda_global int g_Zone_Hatching; // Option to show the zone area (outlines only, short hatches or full hatches
#endif // ifndef ZONES_H

View File

@ -33,6 +33,8 @@ using namespace std;
#include "protos.h"
#include "zones.h"
bool verbose = false; // false if zone outline diags must not be shown
// Outline creation:
@ -46,25 +48,13 @@ static void Show_Zone_Corner_Or_Outline_While_Move_Mouse( WinEDA_DrawPanel* pane
bool erase );
/* Local variables */
static bool Zone_45_Only = FALSE;
static ZONE_CONTAINER::m_PadInZone s_Zone_Pad_Options = ZONE_CONTAINER::THERMAL_PAD;
static int s_Zone_Layer; // Layer used to create the current zone
static int s_Zone_Hatching; // Option to show the zone area (outlines only, short hatches or full hatches
static int s_NetcodeSelection; // Net code selection for the current zone
static wxPoint s_CornerInitialPosition; // Used to abort a move corner command
static bool s_CornerIsNew; // Used to abort a move corner command (if it is a new corner, it must be deleted)
static bool s_AddCutoutToCurrentZone; // if true, the next outline will be addes to s_CurrentZone
static ZONE_CONTAINER* s_CurrentZone; // if != NULL, these ZONE_CONTAINER params will be used for the next zone
static wxPoint s_CursorLastPosition; // in move zone outline, last cursor position. Used to calculate the move vector
// keys used to store net sort option in config file :
#define ZONE_NET_OUTLINES_HATCH_OPTION_KEY wxT( "Zone_Ouline_Hatch_Opt" )
#define ZONE_NET_SORT_OPTION_KEY wxT( "Zone_NetSort_Opt" )
#define ZONE_NET_FILTER_STRING_KEY wxT( "Zone_Filter_Opt" )
enum zone_cmd {
ZONE_ABORT,
ZONE_OK
};
#include "dialog_zones_by_polygon.cpp"
@ -228,7 +218,8 @@ void WinEDA_PcbFrame::Start_Move_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_con
* if IsNewCorner is true, the Abort_Zone_Move_Corner_Or_Outlines will remove this corner, if called
*/
{
/* Show the Net */
if( zone_container->IsOnCopperLayer() ) /* Show the Net */
{
if( g_HightLigt_Status && DC )
{
Hight_Light( DC ); // Remove old hightlight selection
@ -237,6 +228,7 @@ void WinEDA_PcbFrame::Start_Move_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_con
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;
@ -279,6 +271,8 @@ void WinEDA_PcbFrame::Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_c
*/
{
/* Show the Net */
if( zone_container->IsOnCopperLayer() ) /* Show the Net */
{
if( g_HightLigt_Status )
{
Hight_Light( DC ); // Remove old hightlight selection
@ -286,6 +280,7 @@ void WinEDA_PcbFrame::Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_c
g_HightLigth_NetCode = s_NetcodeSelection = zone_container->GetNet();
Hight_Light( DC );
}
zone_container->m_Flags = IS_MOVED;
DrawPanel->ManageCurseur = Show_Zone_Corner_Or_Outline_While_Move_Mouse;
@ -321,12 +316,7 @@ void WinEDA_PcbFrame::End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER
/* Combine zones if possible */
wxBusyCursor dummy;
// int layer = zone_container->GetLayer();
// m_Pcb->RedrawAreasOutlines( DrawPanel, DC, GR_XOR, layer );
m_Pcb->AreaPolygonModified( zone_container, true, verbose );
// m_Pcb->RedrawAreasOutlines( DrawPanel, DC, GR_OR, layer );
DrawPanel->Refresh();
@ -347,9 +337,12 @@ void WinEDA_PcbFrame::Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_contain
/*************************************************************************************/
/**
* Function End_Move_Zone_Corner
* Function Remove_Zone_Corner
* Remove the currently selected corner in a zone outline
* the .m_CornerSelection is used as corner selection
* @param DC = Current deice context (can be NULL )
* @param zone_container = the zone that contains the selected corner
* the member .m_CornerSelection is used as selected corner
*/
{
GetScreen()->SetModify();
@ -357,20 +350,32 @@ void WinEDA_PcbFrame::Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_contain
if( zone_container->m_Poly->GetNumCorners() <= 3 )
{
DrawPanel->PostDirtyRect( zone_container->GetBoundingBox() );
if( DC )
{
Delete_Zone_Fill( DC, NULL, zone_container->m_TimeStamp );
zone_container->DrawFilledArea( DrawPanel, DC, GR_XOR );
}
m_Pcb->Delete( zone_container );
return;
}
int layer = zone_container->GetLayer();
if( DC )
{
m_Pcb->RedrawAreasOutlines( DrawPanel, DC, GR_XOR, layer );
m_Pcb->RedrawFilledAreas( DrawPanel, DC, GR_XOR, layer );
}
zone_container->m_Poly->DeleteCorner( zone_container->m_CornerSelection );
// modify zones outlines according to the new zone_container shape
m_Pcb->AreaPolygonModified( zone_container, true, verbose );
if( DC )
{
m_Pcb->RedrawAreasOutlines( DrawPanel, DC, GR_OR, layer );
m_Pcb->RedrawFilledAreas( DrawPanel, DC, GR_OR, layer );
}
int ii = m_Pcb->GetAreaIndex( zone_container ); // test if zone_container exists
if( ii < 0 )
@ -506,28 +511,40 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
zone = m_Pcb->m_CurrentZoneContour;
if( zone->GetNumCorners() == 0 ) /* Start a new contour: init zone params (net and layer) */
{
if( s_CurrentZone == NULL )
if( s_CurrentZone == NULL ) // A new outline is created
{
int diag;
DrawPanel->m_IgnoreMouseEvents = TRUE;
zone->SetLayer( ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer );
if( zone->IsOnCopperLayer() )
{ // Put a zone on a copper layer
WinEDA_ZoneFrame* frame = new WinEDA_ZoneFrame( this );
int diag = frame->ShowModal();
diag = frame->ShowModal();
frame->Destroy();
}
else // Put a zone on a non copper layer (technical layer)
{
diag = InstallDialogNonCopperZonesEditor( this, zone );
s_NetcodeSelection = 0; // No net for non copper zones
}
DrawPanel->MouseToCursorSchema();
DrawPanel->m_IgnoreMouseEvents = FALSE;
if( diag == ZONE_ABORT )
return 0;
((PCB_SCREEN*)GetScreen())->m_Active_Layer = s_Zone_Layer; // Set by the dialog frame
( (PCB_SCREEN*) GetScreen() )->m_Active_Layer = g_CurrentZone_Layer; // Set by the dialog frame
}
else /* Start a new contour: init zone params (net and layer) from an existing zone */
{
((PCB_SCREEN*)GetScreen())->m_Active_Layer = s_Zone_Layer = s_CurrentZone->GetLayer();
s_Zone_Hatching = s_CurrentZone->m_Poly->GetHatchStyle();
( (PCB_SCREEN*) GetScreen() )->m_Active_Layer = g_CurrentZone_Layer =
s_CurrentZone->GetLayer();
g_Zone_Hatching = s_CurrentZone->m_Poly->GetHatchStyle();
}
/* Show the Net */
/* Show the Net for zones on copper layers */
if( g_CurrentZone_Layer < FIRST_NO_COPPER_LAYER )
{
if( g_HightLigt_Status && (g_HightLigth_NetCode != s_NetcodeSelection) )
{
Hight_Light( DC ); // Remove old hightlight selection
@ -537,7 +554,7 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
s_NetcodeSelection = s_CurrentZone->GetNet();
g_HightLigth_NetCode = s_NetcodeSelection;
Hight_Light( DC );
}
if( !s_AddCutoutToCurrentZone )
s_CurrentZone = NULL; // the zone is used only once
}
@ -546,17 +563,17 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
if( zone->GetNumCorners() == 0 )
{
zone->m_Flags = IS_NEW;
zone->SetLayer( s_Zone_Layer );
zone->SetLayer( g_CurrentZone_Layer );
zone->SetNet( s_NetcodeSelection );
zone->m_TimeStamp = GetTimeStamp();
zone->m_PadOption = s_Zone_Pad_Options;
zone->m_ZoneClearance = g_DesignSettings.m_ZoneClearence;
zone->m_GridFillValue = g_GridRoutingSize;
zone->m_Poly->Start( s_Zone_Layer,
zone->m_Poly->Start( g_CurrentZone_Layer,
GetScreen()->m_Curseur.x, GetScreen()->m_Curseur.y,
s_Zone_Hatching );
g_Zone_Hatching );
zone->AppendCorner( GetScreen()->m_Curseur );
if( Drc_On && m_drc->Drc( zone, 0 ) == BAD_DRC )
if( Drc_On && (m_drc->Drc( zone, 0 ) == BAD_DRC) && zone->IsOnCopperLayer() )
{
zone->m_Flags = 0;
zone->RemoveAllContours();
@ -582,7 +599,8 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
/* edge in progress : the current corner coordinate was set by Show_New_Edge_While_Move_Mouse */
if( zone->GetCornerPosition( ii - 1 ) != zone->GetCornerPosition( ii ) )
{
if( Drc_On && m_drc->Drc( zone, ii - 1 ) == OK_DRC ) // Ok, we can add a new corner
if( (Drc_On && m_drc->Drc( zone, ii - 1 ) == OK_DRC)
|| !zone->IsOnCopperLayer() ) // Ok, we can add a new corner
{
zone->AppendCorner( GetScreen()->m_Curseur );
SetCurItem( zone ); // calls Display_Infos().
@ -620,6 +638,8 @@ bool WinEDA_PcbFrame::End_Zone( wxDC* DC )
// Validate the current edge:
int icorner = zone->GetNumCorners() - 1;
if( zone->IsOnCopperLayer() )
{
if( Drc_On && m_drc->Drc( zone, icorner - 1 ) == BAD_DRC ) // we can't validate last edge
return false;
if( Drc_On && m_drc->Drc( zone, icorner ) == BAD_DRC ) // we can't validate the closing edge
@ -629,6 +649,7 @@ bool WinEDA_PcbFrame::End_Zone( wxDC* DC )
DrawPanel->MouseToCursorSchema();
return false;
}
}
zone->m_Flags = 0;
@ -640,6 +661,7 @@ bool WinEDA_PcbFrame::End_Zone( wxDC* DC )
// Undraw old drawings, because they can have important changes
int layer = zone->GetLayer();
m_Pcb->RedrawAreasOutlines( DrawPanel, DC, GR_XOR, layer );
m_Pcb->RedrawFilledAreas( DrawPanel, DC, GR_XOR, layer );
/* Put edges in list */
if( s_CurrentZone == NULL )
@ -670,6 +692,7 @@ bool WinEDA_PcbFrame::End_Zone( wxDC* DC )
// Redraw the real edge zone :
m_Pcb->RedrawAreasOutlines( DrawPanel, DC, GR_OR, layer );
m_Pcb->RedrawFilledAreas( DrawPanel, DC, GR_OR, layer );
int ii = m_Pcb->GetAreaIndex( zone ); // test if zone_container exists
if( ii < 0 )
@ -707,7 +730,7 @@ static void Show_New_Edge_While_Move_Mouse( WinEDA_DrawPanel* panel, wxDC* DC, b
}
/* Redraw the curent edge in its new position */
if( Zone_45_Only )
if( g_Zone_45_Only )
{
// calculate the new position as allowed
wxPoint StartPoint = zone->GetCornerPosition( icorner - 1 );
@ -730,11 +753,18 @@ void WinEDA_PcbFrame::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container
* Edit params (layer, clearance, ...) for a zone outline
*/
{
DrawPanel->m_IgnoreMouseEvents = TRUE;
WinEDA_ZoneFrame* frame = new WinEDA_ZoneFrame( this, zone_container );
int diag;
int diag = frame->ShowModal();
DrawPanel->m_IgnoreMouseEvents = TRUE;
if( zone_container->GetLayer() < FIRST_NO_COPPER_LAYER )
{ // edit a zone on a copper layer
WinEDA_ZoneFrame* frame = new WinEDA_ZoneFrame( this );
diag = frame->ShowModal();
frame->Destroy();
}
else // edit a zone on a non copper layer (technical layer)
diag = InstallDialogNonCopperZonesEditor( this, zone_container );
DrawPanel->MouseToCursorSchema();
DrawPanel->m_IgnoreMouseEvents = FALSE;
@ -748,12 +778,12 @@ void WinEDA_PcbFrame::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container
edge_zone->Draw( DrawPanel, DC, GR_XOR );
}
zone_container->SetLayer( s_Zone_Layer );
zone_container->SetLayer( g_CurrentZone_Layer );
zone_container->SetNet( s_NetcodeSelection );
EQUIPOT* net = m_Pcb->FindNet( s_NetcodeSelection );
if( net )
zone_container->m_Netname = net->m_Netname;
zone_container->m_Poly->SetHatch( s_Zone_Hatching );
zone_container->m_Poly->SetHatch( g_Zone_Hatching );
zone_container->m_PadOption = s_Zone_Pad_Options;
zone_container->m_ZoneClearance = g_DesignSettings.m_ZoneClearence;
zone_container->m_GridFillValue = g_GridRoutingSize;

View File

@ -0,0 +1,210 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "pcbnew.h"
#include "zones.h"
#include "dialog_non_copper_zones_properties.h"
/* Local functions */
/* Local variables */
/* Class DialogNonCopperZonesEditor
* Dialog editor for non copper zones properties
* Derived from DialogNonCopperZonesProperties, created by wxFormBuilder
*/
class DialogNonCopperZonesEditor : public DialogNonCopperZonesProperties
{
private:
WinEDA_PcbFrame* m_Parent;
ZONE_CONTAINER* m_Zone_Container;
private:
void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
void InitDialog( wxInitDialogEvent& event );
public:
DialogNonCopperZonesEditor( WinEDA_PcbFrame* parent,
ZONE_CONTAINER* zone_container );
~DialogNonCopperZonesEditor();
};
/*******************************************************************************************/
DialogNonCopperZonesEditor::DialogNonCopperZonesEditor( WinEDA_PcbFrame* parent,
ZONE_CONTAINER* zone_container ) :
DialogNonCopperZonesProperties( parent )
/*******************************************************************************************/
{
m_Parent = parent;
m_Zone_Container = zone_container;
SetFont( *g_DialogFont );
}
/********************************************************/
DialogNonCopperZonesEditor::~DialogNonCopperZonesEditor()
/********************************************************/
{
}
/* install function for DialogNonCopperZonesEditor dialog frame :*/
bool InstallDialogNonCopperZonesEditor(WinEDA_PcbFrame* aParent, ZONE_CONTAINER* aZone)
{
DialogNonCopperZonesEditor* frame = new DialogNonCopperZonesEditor( aParent, aZone );
bool diag = frame->ShowModal();
frame->Destroy();
return diag;
}
/********************************************************************/
void DialogNonCopperZonesEditor::InitDialog( wxInitDialogEvent& event )
/********************************************************************/
{
SetFocus();
SetReturnCode( ZONE_ABORT ); // Will be changed on buttons click
if( g_Zone_45_Only )
m_OrientEdgesOpt->SetSelection( 1 );
switch( g_Zone_Hatching )
{
case CPolyLine::NO_HATCH:
m_OutlineAppearanceCtrl->SetSelection( 0 );
break;
case CPolyLine::DIAGONAL_EDGE:
m_OutlineAppearanceCtrl->SetSelection( 1 );
break;
case CPolyLine::DIAGONAL_FULL:
m_OutlineAppearanceCtrl->SetSelection( 2 );
break;
}
for( int layer_number = FIRST_NO_COPPER_LAYER, ii = 0;
layer_number < LAST_NO_COPPER_LAYER - 1;
layer_number++, ii++ )
{
wxString msg;
msg = m_Parent->m_Pcb->GetLayerName( layer_number ).Trim();
m_LayerSelectionCtrl->InsertItems( 1, &msg, ii );
if( m_Zone_Container )
{
if( m_Zone_Container->GetLayer() == layer_number )
m_LayerSelectionCtrl->SetSelection( ii );
}
else
{
if( ( (PCB_SCREEN*) ( m_Parent->GetScreen() ) )->m_Active_Layer == layer_number )
m_LayerSelectionCtrl->SetSelection( ii );
}
}
/* the size of m_LayerSelectionCtrl has changed, so we must recall SetSizeHints() */
GetSizer()->SetSizeHints(this);
}
/******************************************************************/
void DialogNonCopperZonesEditor::OnOkClick( wxCommandEvent& event )
/******************************************************************/
{
switch( m_OutlineAppearanceCtrl->GetSelection() )
{
case 0:
g_Zone_Hatching = CPolyLine::NO_HATCH;
break;
case 1:
g_Zone_Hatching = CPolyLine::DIAGONAL_EDGE;
break;
case 2:
g_Zone_Hatching = CPolyLine::DIAGONAL_FULL;
break;
}
if( m_Parent->m_Parent->m_EDA_Config )
{
m_Parent->m_Parent->m_EDA_Config->Write( ZONE_NET_OUTLINES_HATCH_OPTION_KEY,
(long) g_Zone_Hatching );
}
if( m_OrientEdgesOpt->GetSelection() == 0 )
g_Zone_45_Only = FALSE;
else
g_Zone_45_Only = TRUE;
/* Get the layer selection for this zone */
int ii = m_LayerSelectionCtrl->GetSelection();
if( ii < 0 )
{
DisplayError( this, _( "Error : you must choose a layer" ) );
return;
}
g_CurrentZone_Layer = ii + FIRST_NO_COPPER_LAYER;
EndModal( ZONE_OK );
}
/**********************************************************************/
void DialogNonCopperZonesEditor::OnCancelClick( wxCommandEvent& event )
/**********************************************************************/
{
EndModal( ZONE_ABORT );
}
/***************************************************/
int ZONE_CONTAINER::BuildFilledPolysListData( void )
/***************************************************/
/** function BuildFilledPolysListData
* Build m_FilledPolysList data from real outlines (m_Poly)
* in order to have drawable (and plottable) filled polygons
* drawable filled polygons are polygons without hole
* @return number of polygons
* Currently useable only for non copper zones
*/
{
/* Currently only for non copper zones */
if ( IsOnCopperLayer() )
return 0;
m_FilledPolysList.clear();
/* convert outlines + holes to outlines without holes (adding extra segments if necessary)
* m_Poly data is expected normalized, i.e. NormalizeAreaOutlines was used after building this zone
*/
m_Poly->MakeKboolPoly( -1, -1, NULL, true );
int count = 0;
while( m_Poly->GetKboolEngine()->StartPolygonGet() )
{
CPolyPt corner(0,0,false);
while( m_Poly->GetKboolEngine()->PolygonHasMorePoints() )
{
corner.x = (int)m_Poly->GetKboolEngine()->GetPolygonXPoint();
corner.y = (int)m_Poly->GetKboolEngine()->GetPolygonYPoint();
corner.end_contour = false;
m_FilledPolysList.push_back(corner);
count ++;
}
corner.end_contour = true;
m_FilledPolysList.pop_back();
m_FilledPolysList.push_back(corner);
m_Poly->GetKboolEngine()->EndPolygonGet();
}
m_Poly->FreeKboolEngine();
return count;
}

View File

@ -328,6 +328,7 @@ int BOARD::AreaPolygonModified( ZONE_CONTAINER* modified_area,
return test;
// now see if we need to clip against other areas
int layer = modified_area->GetLayer();
bool bCheckAllAreas = false;
if( test == 1 )
bCheckAllAreas = true;
@ -336,6 +337,15 @@ int BOARD::AreaPolygonModified( ZONE_CONTAINER* modified_area,
if( bCheckAllAreas )
CombineAllAreasInNet( modified_area->GetNet(), bMessageBoxInt, true );
if ( layer >= FIRST_NO_COPPER_LAYER ) // Refill non copper zones on this layer
{
if( m_ZoneDescriptorList.size() > 0 )
{
for( unsigned ia = 0; ia < m_ZoneDescriptorList.size(); ia++ )
if( m_ZoneDescriptorList[ia]->GetLayer() == layer )
m_ZoneDescriptorList[ia]->BuildFilledPolysListData( );
}
}
return test;
}
@ -878,6 +888,9 @@ int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_E
for( int ia = 0; ia < GetAreaCount(); ia++ )
{
ZONE_CONTAINER* Area_Ref = GetArea( ia );
if ( ! Area_Ref->IsOnCopperLayer() )
continue;
if( aArea_To_Examine && (aArea_To_Examine != Area_Ref) )
continue;
for( int ia2 = 0; ia2 < GetAreaCount(); ia2++ )
@ -1026,6 +1039,9 @@ int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_E
bool DRC::doEdgeZoneDrc( ZONE_CONTAINER* aArea, int aCornerIndex )
{
if ( ! aArea->IsOnCopperLayer() ) // Cannot have a Drc error if not on copper layer
return true;
wxString str;
wxPoint start = aArea->GetCornerPosition( aCornerIndex );

View File

@ -250,9 +250,14 @@ int CPolyLine::AddPolygonsToBoolEng( Bool_Engine* aBooleng,
* @param aEnd_contour: ending contour number (-1 = all after aStart_contour)
* combining intersecting contours if possible
* @param arc_array : return corners computed from arcs approximations in arc_array
* @param aConvertHoles = mode for holes when a boolean operation is made
* true: holes are linked into outer contours by double overlapping segments
* false: holes are not linked: in this mode contours are added clockwise
* and polygons added counter clockwise are holes (default)
* @return error: 0 if Ok, 1 if error
*/
int CPolyLine::MakeKboolPoly( int aStart_contour, int aEnd_contour, std::vector<CArc> * arc_array )
int CPolyLine::MakeKboolPoly( int aStart_contour, int aEnd_contour, std::vector<CArc> * arc_array,
bool aConvertHoles )
{
if( m_Kbool_Poly_Engine )
{
@ -493,7 +498,7 @@ int CPolyLine::MakeKboolPoly( int aStart_contour, int aEnd_contour, std::vector<
booleng->Do_Operation( BOOL_OR );
}
// now copy result to m_gpc_poly
// now use result as new polygon (delete the old one if exists)
if( m_Kbool_Poly_Engine )
delete m_Kbool_Poly_Engine;
m_Kbool_Poly_Engine = booleng;

View File

@ -28,7 +28,7 @@
* @param aConvertHoles = mode for holes when a boolean operation is made
* true: holes are linked into outer contours by double overlapping segments
* false: holes are not linked: in this mode contours are added clockwise
* and polygons added counter clockwise are holes
* and polygons added counter clockwise are holes (default)
*/
void ArmBoolEng( Bool_Engine* aBooleng, bool aConvertHoles = false );
@ -199,11 +199,16 @@ public:
* @param aEnd_contour: ending contour number (-1 = all after aStart_contour)
* combining intersecting contours if possible
* @param arc_array : return data on arcs in arc_array
* @param aConvertHoles = mode for holes when a boolean operation is made
* true: holes are linked into outer contours by double overlapping segments
* false: holes are not linked: in this mode contours are added clockwise
* and polygons added counter clockwise are holes (default)
* @return error: 0 if Ok, 1 if error
*/
int MakeKboolPoly( int aStart_contour = -1,
int aEnd_contour = -1,
std::vector<CArc> * arc_array = NULL );
std::vector<CArc> * arc_array = NULL,
bool aConvertHoles = false);
/** Function NormalizeWithKbool
* Use the Kbool Library to clip contours: if outlines are crossing, the self-crossing polygon
@ -218,6 +223,16 @@ public:
*/
int NormalizeWithKbool( std::vector<CPolyLine*> * aExtraPolyList, bool bRetainArcs );
/** function GetKboolEngine
* @return the current used Kbool Engine (after normalization using kbool)
*/
Bool_Engine* GetKboolEngine( ) { return m_Kbool_Poly_Engine; }
/** function FreeKboolEngine
* delete the current used Kbool Engine (free memory after normalization using kbool)
*/
void FreeKboolEngine( ) { delete m_Kbool_Poly_Engine; m_Kbool_Poly_Engine = NULL; }
private:
int m_layer; // layer to draw on
int m_Width; // lines width when drawing. Provided but not really used

View File

@ -1,4 +1,4 @@
update=19/9/2008-05:53:18
update=23/9/2008-19:07:03
version=1
last_client=eeschema
[general]
@ -140,5 +140,6 @@ LibName24=display
LibName25=cypress
LibName26=siliconi
LibName27=opto
LibName28=contrib
LibName29=valves
LibName28=atmel
LibName29=contrib
LibName30=valves