Commit 27cf4ad0 authored by charras's avatar charras

pcbnew: addded zones in non copper areas and starting work to use polygons in...

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
parent 064fcf54
......@@ -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:
......
......@@ -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;
}
......
No preview for this file type
This diff is collapsed.
......@@ -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
......
......@@ -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)
......
......@@ -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
......
......@@ -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 )
......
This diff is collapsed.
......@@ -5,6 +5,8 @@
#ifndef CLASS_ZONE_H
#define CLASS_ZONE_H
#include <vector>
#include "PolyLine.h"
/************************/
......@@ -25,30 +27,38 @@ public:
PAD_IN_ZONE // pads are covered by copper
};
wxString m_Netname; // Net Name
CPolyLine* m_Poly; // outlines
int m_CornerSelection; // For corner moving, corner index to drag, or -1 if no selection
int m_ZoneClearance; // clearance value
int m_GridFillValue; // Grid used for filling
m_PadInZone m_PadOption; // see m_PadInZone
int utility, utility2; // flags used in polygon calculations
wxString m_Netname; // Net Name
CPolyLine* m_Poly; // outlines
int m_CornerSelection; // For corner moving, corner index to drag, or -1 if no selection
int m_ZoneClearance; // clearance value
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
int m_NetCode; // Net number for fast comparisons
public:
ZONE_CONTAINER( BOARD * parent );
ZONE_CONTAINER( BOARD* parent );
~ZONE_CONTAINER();
bool Save( FILE* aFile ) const;
int ReadDescr( FILE* aFile, int* aLineNum = NULL );
bool Save( FILE* aFile ) const;
int ReadDescr( FILE* aFile, int* aLineNum = NULL );
wxPoint& GetPosition()
{
static wxPoint pos;
return pos;
}
void UnLink( void )
{
};
......@@ -58,9 +68,9 @@ public:
* copy usefull data from the source.
* flags and linked list pointers are NOT copied
*/
void Copy( ZONE_CONTAINER* src );
void Copy( ZONE_CONTAINER* src );
void Display_Infos( WinEDA_DrawFrame* frame );
void Display_Infos( WinEDA_DrawFrame* frame );
/**
* Function Draw
......@@ -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();
......@@ -85,14 +110,26 @@ public:
* @param DC = current Device Context
* @param draw_mode = draw mode: OR, XOR ..
*/
void DrawWhileCreateOutline( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode = GR_OR );
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 );
void SetNet( int anet_code );
/**
* Function HitTest
......@@ -100,7 +137,15 @@ public:
* @param refPos A wxPoint to test
* @return bool - true if a hit, else false
*/
bool HitTest( const wxPoint& refPos );
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
......@@ -108,7 +153,7 @@ public:
* @return -1 if none, corner index in .corner <vector>
* @param refPos : A wxPoint to test
*/
int HitTestForCorner( const wxPoint& refPos );
int HitTestForCorner( const wxPoint& refPos );
/**
* Function HitTestForEdge
......@@ -116,7 +161,7 @@ public:
* @return -1 if none, or index of the starting corner in .corner <vector>
* @param refPos : A wxPoint to test
*/
int HitTestForEdge( const wxPoint& refPos );
int HitTestForEdge( const wxPoint& refPos );
/**
* Function HitTest (overlayed)
......@@ -124,7 +169,7 @@ public:
* @param refArea : the given EDA_Rect
* @return bool - true if a hit, else false
*/
bool HitTest( EDA_Rect& refArea );
bool HitTest( EDA_Rect& refArea );
/**
* Function Fill_Zone()
......@@ -137,7 +182,7 @@ public:
* @param verbose = true to show error messages
* @return error level (0 = no error)
*/
int Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose = TRUE );
int Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose = TRUE );
/* Geometric transformations: */
......@@ -146,14 +191,14 @@ public:
* Move the outlines
* @param offset = moving vector
*/
void Move( const wxPoint& offset );
void Move( const wxPoint& offset );
/**
* Function MoveEdge
* Move the outline Edge. m_CornerSelection is the start point of the outline edge
* @param offset = moving vector
*/
void MoveEdge( const wxPoint& offset );
void MoveEdge( const wxPoint& offset );
/**
* Function Rotate
......@@ -161,7 +206,7 @@ public:
* @param centre = rot centre
* @param angle = in 0.1 degree
*/
void Rotate( const wxPoint& centre, int angle );
void Rotate( const wxPoint& centre, int angle );
/**
* Function Mirror
......@@ -169,7 +214,7 @@ public:
* the layer is not changed
* @param mirror_ref = vertical axis position
*/
void Mirror( const wxPoint& mirror_ref );
void Mirror( const wxPoint& mirror_ref );
/**
* Function GetClass
......@@ -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 );
......
///////////////////////////////////////////////////////////////////////////
// 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()
{
}
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// 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__
......@@ -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();
......
......@@ -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,
......
......@@ -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;
......
......@@ -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\
......
......@@ -18,6 +18,7 @@
#include "trigo.h"
#include "cell.h"
#include "worksheet.h"
#include "zones.h"
#include "protos.h"
......
......@@ -8,6 +8,10 @@
#include <vector>
/* install function for DialogNonCopperZonesEditor dialog frame :*/
bool InstallDialogNonCopperZonesEditor(WinEDA_PcbFrame* aParent, ZONE_CONTAINER* aZone);
/***************/
/* PAD_CONNECT.CPP */
/***************/
......
......@@ -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.
......
/************************************************/
/* 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
This diff is collapsed.
This diff is collapsed.
......@@ -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 );
......
......@@ -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;
......
This diff is collapsed.
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment