Commit a1998410 authored by charras's avatar charras

Some enhancements and fixes. (see changelog)

parent cacb2225
...@@ -4,6 +4,15 @@ KiCad ChangeLog 2009 ...@@ -4,6 +4,15 @@ KiCad ChangeLog 2009
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2009-Dec-30 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++pcbnew
Added option to use some usual Gerber files extension, depending on the layer
Do not allow in plot menu to output files for non enabled layers.
++Kicad and Gerbview
Display Gerber files that use usual files extension (in tree project or dialog files)
(See http://en.wikipedia.org/wiki/Gerber_File)
2009-Dec-20 UPDATE Dick Hollenbeck <dick@softplc.com> 2009-Dec-20 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
++pcbnew ++pcbnew
......
...@@ -521,7 +521,7 @@ void WinEDA_DrawPanel::EraseScreen( wxDC* DC ) ...@@ -521,7 +521,7 @@ void WinEDA_DrawPanel::EraseScreen( wxDC* DC )
#ifndef WX_ZOOM #ifndef WX_ZOOM
GRSFilledRect( &m_ClipBox, DC, m_ClipBox.GetX(), m_ClipBox.GetY(), GRSFilledRect( &m_ClipBox, DC, m_ClipBox.GetX(), m_ClipBox.GetY(),
m_ClipBox.GetRight(), m_ClipBox.GetBottom(), m_ClipBox.GetRight(), m_ClipBox.GetBottom(),
g_DrawBgColor, g_DrawBgColor ); 0, g_DrawBgColor, g_DrawBgColor );
#else #else
EDA_Rect tmp = m_ClipBox; EDA_Rect tmp = m_ClipBox;
...@@ -534,7 +534,7 @@ void WinEDA_DrawPanel::EraseScreen( wxDC* DC ) ...@@ -534,7 +534,7 @@ void WinEDA_DrawPanel::EraseScreen( wxDC* DC )
GRSFilledRect( &m_ClipBox, DC, m_ClipBox.GetX(), m_ClipBox.GetY(), GRSFilledRect( &m_ClipBox, DC, m_ClipBox.GetX(), m_ClipBox.GetY(),
m_ClipBox.GetRight(), m_ClipBox.GetBottom(), m_ClipBox.GetRight(), m_ClipBox.GetBottom(),
g_DrawBgColor, g_DrawBgColor ); 0, g_DrawBgColor, g_DrawBgColor );
m_ClipBox = tmp; m_ClipBox = tmp;
#endif #endif
......
...@@ -60,15 +60,22 @@ static int PenMinWidth = 1; /* minimum pen width (must be> 0) ...@@ -60,15 +60,22 @@ static int PenMinWidth = 1; /* minimum pen width (must be> 0)
* (Useful for printing) */ * (Useful for printing) */
static bool ForceBlackPen; /* if true: draws in black instead of static bool ForceBlackPen; /* if true: draws in black instead of
* color for printing. */ * color for printing. */
static int xcliplo = 0, static int xcliplo = 0,
ycliplo = 0, ycliplo = 0,
xcliphi = 2000, xcliphi = 2000,
ycliphi = 2000; ycliphi = 2000;
static int lastcolor = -1; static int lastcolor = -1;
static int lastwidth = -1; static int lastwidth = -1;
static int s_Last_Pen_Style = -1; static int s_Last_Pen_Style = -1;
static wxDC* lastDC = NULL; static wxDC* lastDC = NULL;
/* Local functions: */
static void GRSRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
int x2, int y2, int Color );
static void GRSRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
int x2, int y2, int width, int Color );
/* /*
* Macro clipping the trace of a line: * Macro clipping the trace of a line:
* Line (x1, y1 x2, y2) is clipped to remain within * Line (x1, y1 x2, y2) is clipped to remain within
...@@ -362,9 +369,13 @@ void GRSetDrawMode( wxDC* DC, int draw_mode ) ...@@ -362,9 +369,13 @@ void GRSetDrawMode( wxDC* DC, int draw_mode )
if( draw_mode & GR_OR ) if( draw_mode & GR_OR )
#if defined(__WXMAC__) && (wxMAC_USE_CORE_GRAPHICS || wxCHECK_VERSION( 2, 9, 0 ) ) #if defined(__WXMAC__) && (wxMAC_USE_CORE_GRAPHICS || wxCHECK_VERSION( 2, 9, 0 ) )
DC->SetLogicalFunction( wxCOPY ); DC->SetLogicalFunction( wxCOPY );
#else #else
DC->SetLogicalFunction( wxOR ); DC->SetLogicalFunction( wxOR );
#endif #endif
else if( draw_mode & GR_XOR ) else if( draw_mode & GR_XOR )
...@@ -372,9 +383,13 @@ void GRSetDrawMode( wxDC* DC, int draw_mode ) ...@@ -372,9 +383,13 @@ void GRSetDrawMode( wxDC* DC, int draw_mode )
else if( draw_mode & GR_NXOR ) else if( draw_mode & GR_NXOR )
#if defined(__WXMAC__) && (wxMAC_USE_CORE_GRAPHICS || wxCHECK_VERSION( 2, 9, 0 ) ) #if defined(__WXMAC__) && (wxMAC_USE_CORE_GRAPHICS || wxCHECK_VERSION( 2, 9, 0 ) )
DC->SetLogicalFunction( wxXOR ); DC->SetLogicalFunction( wxXOR );
#else #else
DC->SetLogicalFunction( wxEQUIV ); DC->SetLogicalFunction( wxEQUIV );
#endif #endif
else else
...@@ -1397,7 +1412,7 @@ void GRArc( EDA_Rect* ClipBox, wxDC* DC, int xc, int yc, int StAngle, ...@@ -1397,7 +1412,7 @@ void GRArc( EDA_Rect* ClipBox, wxDC* DC, int xc, int yc, int StAngle,
GRSetColorPen( DC, Color ); GRSetColorPen( DC, Color );
GRSetBrush( DC, Color, FALSE ); GRSetBrush( DC, Color, FALSE );
DC->DrawArc( GRMapX( xc + x1 ), GRMapY( yc - y1 ), GRMapX( xc + x2 ), DC->DrawArc( GRMapX( xc + x1 ), GRMapY( yc - y1 ), GRMapX( xc + x2 ),
GRMapY( yc - y2 ), GRMapX( xc ), GRMapY( yc ) ); GRMapY( yc - y2 ), GRMapX( xc ), GRMapY( yc ) );
} }
...@@ -1422,13 +1437,9 @@ void GRArc( EDA_Rect* ClipBox, ...@@ -1422,13 +1437,9 @@ void GRArc( EDA_Rect* ClipBox,
/* /*
* Draw a rectangle in drawing space. * Draw a rectangle in drawing space.
*/ */
void GRRect( EDA_Rect* ClipBox, void GRRect( EDA_Rect* ClipBox, wxDC* DC,
wxDC* DC, int x1, int y1, int x2, int y2,
int x1, int Color )
int y1,
int x2,
int y2,
int Color )
{ {
x1 = GRMapX( x1 ); x1 = GRMapX( x1 );
y1 = GRMapY( y1 ); y1 = GRMapY( y1 );
...@@ -1438,18 +1449,25 @@ void GRRect( EDA_Rect* ClipBox, ...@@ -1438,18 +1449,25 @@ void GRRect( EDA_Rect* ClipBox,
GRSRect( ClipBox, DC, x1, y1, x2, y2, Color ); GRSRect( ClipBox, DC, x1, y1, x2, y2, Color );
} }
void GRRect( EDA_Rect* aClipBox, wxDC* aDC,
const EDA_Rect& aRect,
int aColor )
{
int x1 = GRMapX( aRect.GetX() );
int y1 = GRMapY( aRect.GetY() );
int x2 = GRMapX( aRect.GetRight() );
int y2 = GRMapY( aRect.GetBottom() );
GRSRect( aClipBox, aDC, x1, y1, x2, y2, aColor );
}
/* /*
* Draw a rectangle in drawing space. * Draw a rectangle (thick lines) in drawing space.
*/ */
void GRRect( EDA_Rect* ClipBox, void GRRect( EDA_Rect* ClipBox, wxDC* DC,
wxDC* DC, int x1, int y1, int x2, int y2,
int x1, int width, int Color )
int y1,
int x2,
int y2,
int width,
int Color )
{ {
x1 = GRMapX( x1 ); x1 = GRMapX( x1 );
y1 = GRMapY( y1 ); y1 = GRMapY( y1 );
...@@ -1460,6 +1478,20 @@ void GRRect( EDA_Rect* ClipBox, ...@@ -1460,6 +1478,20 @@ void GRRect( EDA_Rect* ClipBox,
GRSRect( ClipBox, DC, x1, y1, x2, y2, width, Color ); GRSRect( ClipBox, DC, x1, y1, x2, y2, width, Color );
} }
void GRRect( EDA_Rect* aClipBox, wxDC* aDC,
const EDA_Rect& aRect,
int aWidth, int aColor )
{
int x1 = GRMapX( aRect.GetX() );
int y1 = GRMapY( aRect.GetY() );
int x2 = GRMapX( aRect.GetRight() );
int y2 = GRMapY( aRect.GetBottom() );
int width = ZoomValue( aWidth );
GRSRect( aClipBox, aDC, x1, y1, x2, y2, width, aColor );
}
/* /*
* Draw a rectangle (filled with AreaColor) in drawing space. * Draw a rectangle (filled with AreaColor) in drawing space.
...@@ -1543,31 +1575,10 @@ void GRSRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2, ...@@ -1543,31 +1575,10 @@ void GRSRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
} }
/*
* Draw a filled rectangle in screen space.
*/
void GRSFilledRect( EDA_Rect* ClipBox,
wxDC* DC,
int x1,
int y1,
int x2,
int y2,
int Color,
int BgColor )
{
GRSFilledRect( ClipBox, DC, x1, y1, x2, y2, 0, Color, BgColor );
}
void GRSFilledRect( EDA_Rect* ClipBox, void GRSFilledRect( EDA_Rect* ClipBox, wxDC* DC,
wxDC* DC, int x1, int y1, int x2, int y2,
int x1, int width, int Color, int BgColor )
int y1,
int x2,
int y2,
int width,
int Color,
int BgColor )
{ {
if( x1 > x2 ) if( x1 > x2 )
EXCHG( x1, x2 ); EXCHG( x1, x2 );
...@@ -1635,11 +1646,11 @@ void ClipAndDrawFilledPoly( EDA_Rect* aClipBox, ...@@ -1635,11 +1646,11 @@ void ClipAndDrawFilledPoly( EDA_Rect* aClipBox,
clippedPolygon.clear(); clippedPolygon.clear();
for( int ii = 0; ii < n; ii++ ) for( int ii = 0; ii < n; ii++ )
inputPolygon.push_back( PointF( (REAL) aPoints[ii].x, inputPolygon.push_back( PointF( (REAL) aPoints[ii].x,
(REAL) aPoints[ii].y ) ); (REAL) aPoints[ii].y ) );
RectF window( (REAL) aClipBox->GetX(), (REAL) aClipBox->GetY(), RectF window( (REAL) aClipBox->GetX(), (REAL) aClipBox->GetY(),
(REAL) aClipBox->GetWidth(), (REAL) aClipBox->GetWidth(),
(REAL) aClipBox->GetHeight() ); (REAL) aClipBox->GetHeight() );
SutherlandHodgman sh( window ); SutherlandHodgman sh( window );
sh.Clip( inputPolygon, outputPolygon ); sh.Clip( inputPolygon, outputPolygon );
...@@ -1649,13 +1660,14 @@ void ClipAndDrawFilledPoly( EDA_Rect* aClipBox, ...@@ -1649,13 +1660,14 @@ void ClipAndDrawFilledPoly( EDA_Rect* aClipBox,
++cit ) ++cit )
{ {
clippedPolygon.push_back( wxPoint( wxRound( cit->X ), clippedPolygon.push_back( wxPoint( wxRound( cit->X ),
wxRound( cit->Y ) ) ); wxRound( cit->Y ) ) );
} }
if( clippedPolygon.size() ) if( clippedPolygon.size() )
aDC->DrawPolygon( clippedPolygon.size(), &clippedPolygon[0] ); aDC->DrawPolygon( clippedPolygon.size(), &clippedPolygon[0] );
} }
#endif #endif
......
...@@ -451,7 +451,7 @@ bool LIB_COMPONENT::Save( FILE* aFile ) ...@@ -451,7 +451,7 @@ bool LIB_COMPONENT::Save( FILE* aFile )
if( fprintf( aFile, "DEF" ) < 0 ) if( fprintf( aFile, "DEF" ) < 0 )
return false; return false;
if( ( value.m_Attributs & TEXT_NO_VISIBLE ) == 0 ) if( value.IsVisible() )
{ {
if( fprintf( aFile, " %s", CONV_TO_UTF8( value.m_Text ) ) < 0 ) if( fprintf( aFile, " %s", CONV_TO_UTF8( value.m_Text ) ) < 0 )
return false; return false;
...@@ -859,7 +859,7 @@ EDA_Rect LIB_COMPONENT::GetBoundaryBox( int aUnit, int aConvert ) ...@@ -859,7 +859,7 @@ EDA_Rect LIB_COMPONENT::GetBoundaryBox( int aUnit, int aConvert )
continue; continue;
if ( ( item.Type() == COMPONENT_FIELD_DRAW_TYPE ) if ( ( item.Type() == COMPONENT_FIELD_DRAW_TYPE )
&& ( ( ( LIB_TEXT& ) item ).m_Attributs & TEXT_NO_VISIBLE ) ) && !( ( LIB_FIELD& ) item ).IsVisible() )
continue; continue;
bBox.Merge( item.GetBoundingBox() ); bBox.Merge( item.GetBoundingBox() );
......
...@@ -84,9 +84,16 @@ public: ...@@ -84,9 +84,16 @@ public:
int aColor, int aDrawMode, void* aData, int aColor, int aDrawMode, void* aData,
const int aTransformMatrix[2][2] ); const int aTransformMatrix[2][2] );
/** Function IsVisible
* @return true is this field is visible, false if flagged invisible
*/
bool IsVisible()
{
return (m_Attributs & TEXT_NO_VISIBLE) == 0 ? true : false;
}
/** /**
* Return the bounding rectangle of the field text. * Return the bounding rectangle of the field text.
*
* @return Bounding rectangle. * @return Bounding rectangle.
*/ */
virtual EDA_Rect GetBoundingBox(); virtual EDA_Rect GetBoundingBox();
......
...@@ -67,6 +67,14 @@ public: ...@@ -67,6 +67,14 @@ public:
*/ */
int GetPenSize( ); int GetPenSize( );
/** Function IsVisible
* @return true is this field is visible, false if flagged invisible
*/
bool IsVisible()
{
return (m_Attributs & TEXT_NO_VISIBLE) == 0 ? true : false;
}
/** /**
* Function Draw * Function Draw
*/ */
......
...@@ -205,8 +205,7 @@ void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -205,8 +205,7 @@ void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
SCH_FIELD* field = GetField( REFERENCE ); SCH_FIELD* field = GetField( REFERENCE );
if( ( ( field->m_Attributs & TEXT_NO_VISIBLE ) == 0 ) if( field->IsVisible() && !( field->m_Flags & IS_MOVED ) )
&& !( field->m_Flags & IS_MOVED ) )
{ {
if( Entry->GetPartCount() > 1 ) if( Entry->GetPartCount() > 1 )
{ {
...@@ -236,23 +235,20 @@ void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -236,23 +235,20 @@ void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
{ {
EDA_Rect BoundaryBox; EDA_Rect BoundaryBox;
BoundaryBox = GetBoundaryBox(); BoundaryBox = GetBoundaryBox();
int x1 = BoundaryBox.GetX(); GRRect( &panel->m_ClipBox, DC, BoundaryBox, BROWN );
int y1 = BoundaryBox.GetY(); #if 1
int x2 = BoundaryBox.GetRight(); if( GetField( REFERENCE )->IsVisible() )
int y2 = BoundaryBox.GetBottom(); {
GRRect( &panel->m_ClipBox, DC, x1, y1, x2, y2, BROWN ); BoundaryBox = GetField( REFERENCE )->GetBoundaryBox();
BoundaryBox = GetField( REFERENCE )->GetBoundaryBox(); GRRect( &panel->m_ClipBox, DC, BoundaryBox, BROWN );
x1 = BoundaryBox.GetX(); }
y1 = BoundaryBox.GetY();
x2 = BoundaryBox.GetRight(); if( GetField( VALUE )->IsVisible() )
y2 = BoundaryBox.GetBottom(); {
GRRect( &panel->m_ClipBox, DC, x1, y1, x2, y2, BROWN ); BoundaryBox = GetField( VALUE )->GetBoundaryBox();
BoundaryBox = GetField( VALUE )->GetBoundaryBox(); GRRect( &panel->m_ClipBox, DC, BoundaryBox, BROWN );
x1 = BoundaryBox.GetX(); }
y1 = BoundaryBox.GetY(); #endif
x2 = BoundaryBox.GetRight();
y2 = BoundaryBox.GetBottom();
GRRect( &panel->m_ClipBox, DC, x1, y1, x2, y2, BROWN );
} }
#endif #endif
} }
...@@ -530,7 +526,13 @@ LIB_PIN* SCH_COMPONENT::GetPin( const wxString& number ) ...@@ -530,7 +526,13 @@ LIB_PIN* SCH_COMPONENT::GetPin( const wxString& number )
return Entry->GetPin( number, m_Multi, m_Convert ); return Entry->GetPin( number, m_Multi, m_Convert );
} }
/**
* Function GetBoundaryBox
* returns the orthogonal, bounding box of this object for display purposes.
* This box should be an enclosing perimeter for graphic items and pins.
* this include only fields defined in library
* use GetBoundingBox() to include fields in schematic
*/
EDA_Rect SCH_COMPONENT::GetBoundaryBox() const EDA_Rect SCH_COMPONENT::GetBoundaryBox() const
{ {
LIB_COMPONENT* Entry = CMP_LIBRARY::FindLibraryComponent( m_ChipName ); LIB_COMPONENT* Entry = CMP_LIBRARY::FindLibraryComponent( m_ChipName );
...@@ -1064,6 +1066,13 @@ bool SCH_COMPONENT::Save( FILE* f ) const ...@@ -1064,6 +1066,13 @@ bool SCH_COMPONENT::Save( FILE* f ) const
} }
/**
* Function GetBoundingBox
* returns the orthogonal, bounding box of this object for display purposes.
* This box should be an enclosing perimeter for visible components of this
* object, and the units should be in the pcb or schematic coordinate system.
* It is OK to overestimate the size by a few counts.
*/
EDA_Rect SCH_COMPONENT::GetBoundingBox() EDA_Rect SCH_COMPONENT::GetBoundingBox()
{ {
const int PADDING = 40; const int PADDING = 40;
...@@ -1074,11 +1083,13 @@ EDA_Rect SCH_COMPONENT::GetBoundingBox() ...@@ -1074,11 +1083,13 @@ EDA_Rect SCH_COMPONENT::GetBoundingBox()
// Include BoundingBoxes of fields // Include BoundingBoxes of fields
for( int ii = 0; ii < GetFieldCount(); ii++ ) for( int ii = 0; ii < GetFieldCount(); ii++ )
{ {
if( ! GetField( ii )->IsVisible() )
continue;
bbox.Merge( GetField( ii )->GetBoundaryBox() ); bbox.Merge( GetField( ii )->GetBoundaryBox() );
} }
// ... add padding // ... add padding
bbox.Inflate( PADDING, PADDING ); bbox.Inflate( PADDING );
return bbox; return bbox;
} }
......
...@@ -209,6 +209,13 @@ public: ...@@ -209,6 +209,13 @@ public:
*/ */
void SetTimeStamp( long aNewTimeStamp); void SetTimeStamp( long aNewTimeStamp);
/**
* Function GetBoundaryBox
* returns the orthogonal, bounding box of this object for display purposes.
* This box should be an enclosing perimeter for graphic items and pins.
* this include only fields defined in library
* use GetBoundingBox() to include fields in schematic
*/
EDA_Rect GetBoundaryBox() const; EDA_Rect GetBoundaryBox() const;
/** /**
......
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
/* Used for EDA_BaseStruct, .m_Select member */ /* Used for EDA_BaseStruct, .m_Select member */
#define IS_SELECTED 1 #define IS_SELECTED 1
#define TEXT_NO_VISIBLE 1
//#define GR_DEFAULT_DRAWMODE GR_COPY //#define GR_DEFAULT_DRAWMODE GR_COPY
#define GR_DEFAULT_DRAWMODE GR_COPY #define GR_DEFAULT_DRAWMODE GR_COPY
......
...@@ -417,7 +417,6 @@ bool IsItemInBox( EDA_Rect& aBox, SCH_ITEM* DrawStruct ) ...@@ -417,7 +417,6 @@ bool IsItemInBox( EDA_Rect& aBox, SCH_ITEM* DrawStruct )
case TYPE_SCH_TEXT: case TYPE_SCH_TEXT:
case TYPE_SCH_HIERLABEL: case TYPE_SCH_HIERLABEL:
case TYPE_SCH_GLOBALLABEL: case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_COMPONENT:
case DRAW_SHEET_STRUCT_TYPE: case DRAW_SHEET_STRUCT_TYPE:
case TYPE_SCH_MARKER: case TYPE_SCH_MARKER:
BoundaryBox = DrawStruct->GetBoundingBox(); BoundaryBox = DrawStruct->GetBoundingBox();
...@@ -425,6 +424,14 @@ bool IsItemInBox( EDA_Rect& aBox, SCH_ITEM* DrawStruct ) ...@@ -425,6 +424,14 @@ bool IsItemInBox( EDA_Rect& aBox, SCH_ITEM* DrawStruct )
return true; return true;
break; break;
case TYPE_SCH_COMPONENT:
// Use a more restrictive area than GetBoundingBox()
// Area is restricted to the body area, excludint fields outside this area
BoundaryBox = ((SCH_COMPONENT*)DrawStruct)->GetBoundaryBox();
if( aBox.Intersects( BoundaryBox ) )
return true;
break;
case DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE: case DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE:
break; break;
......
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
#ifndef PROGRAM_H #ifndef PROGRAM_H
#define PROGRAM_H #define PROGRAM_H
#define HIGHLIGHT_COLOR WHITE
#define TEXT_NO_VISIBLE 1
#include "wxEeschemaStruct.h" #include "wxEeschemaStruct.h"
#include "macros.h" #include "macros.h"
#include "base_struct.h" #include "base_struct.h"
...@@ -17,9 +20,6 @@ ...@@ -17,9 +20,6 @@
#include "class_text-label.h" #include "class_text-label.h"
#include "class_schematic_items.h" #include "class_schematic_items.h"
#define HIGHLIGHT_COLOR WHITE
#define TEXT_NO_VISIBLE 1
/* Rotation, mirror of graphic items in components bodies are handled by a /* Rotation, mirror of graphic items in components bodies are handled by a
* transform matrix. The default matix is useful to draw lib entries with * transform matrix. The default matix is useful to draw lib entries with
......
...@@ -110,9 +110,14 @@ bool WinEDA_GerberFrame::LoadOneGerberFile( const wxString& FullFileName, ...@@ -110,9 +110,14 @@ bool WinEDA_GerberFrame::LoadOneGerberFile( const wxString& FullFileName,
{ {
wxString current_path = filename.GetPath(); wxString current_path = filename.GetPath();
/* Standard gerber filetypes */ /* Standard gerber filetypes
filetypes += _( "Gerber files (.gbr .gbx .lgr .ger .pho)| \ * (See http://en.wikipedia.org/wiki/Gerber_File)
.gbr;*.GBR;*.gbx;*.GBX;*.lgr;*.LGR;*.ger;*.GER;*.pho;*.PHO|" ); * the .pho extension is the default used in Pcbnew
*/
filetypes = _( "Gerber files (.gb* .gt* .lgr .ger .pho)" );
filetypes << wxT("|");
filetypes += wxT("*.gb*;*.GB*;.gt*;.GT*;.gko;.GKO;*.GPB;*.gpb;*.lgr;*.LGR;*.ger;*.GER;*.pho;*.PHO" );
filetypes << wxT("|");
/* Special gerber filetypes */ /* Special gerber filetypes */
filetypes += _( "Top layer (*.GTL)|*.GTL;*.gtl|" ); filetypes += _( "Top layer (*.GTL)|*.GTL;*.gtl|" );
......
...@@ -175,15 +175,15 @@ public: ...@@ -175,15 +175,15 @@ public:
bool Inside( int x, int y ) { return Inside( wxPoint( x, y ) ); } bool Inside( int x, int y ) { return Inside( wxPoint( x, y ) ); }
wxSize GetSize() { return m_Size; } wxSize GetSize() { return m_Size; }
int GetX() { return m_Pos.x; } int GetX() const { return m_Pos.x; }
int GetY() { return m_Pos.y; } int GetY() const { return m_Pos.y; }
wxPoint GetOrigin() { return m_Pos; } wxPoint GetOrigin() { return m_Pos; }
wxPoint GetPosition() { return m_Pos; } wxPoint GetPosition() { return m_Pos; }
wxPoint GetEnd() { return wxPoint( GetRight(), GetBottom() ); } wxPoint GetEnd() const { return wxPoint( GetRight(), GetBottom() ); }
int GetWidth() { return m_Size.x; } int GetWidth() const { return m_Size.x; }
int GetHeight() { return m_Size.y; } int GetHeight() const { return m_Size.y; }
int GetRight() { return m_Pos.x + m_Size.x; } int GetRight() const { return m_Pos.x + m_Size.x; }
int GetBottom() { return m_Pos.y + m_Size.y; } int GetBottom() const { return m_Pos.y + m_Size.y; }
void SetOrigin( const wxPoint& pos ) { m_Pos = pos; } void SetOrigin( const wxPoint& pos ) { m_Pos = pos; }
void SetOrigin( int x, int y ) { m_Pos.x = x; m_Pos.y = y; } void SetOrigin( int x, int y ) { m_Pos.x = x; m_Pos.y = y; }
void SetSize( const wxSize& size ) { m_Size = size; } void SetSize( const wxSize& size ) { m_Size = size; }
......
...@@ -58,6 +58,10 @@ void GRForceBlackPen( bool flagforce ); ...@@ -58,6 +58,10 @@ void GRForceBlackPen( bool flagforce );
bool GetGRForceBlackPenState( void ); bool GetGRForceBlackPenState( void );
void SetPenMinWidth( int minwidth ); void SetPenMinWidth( int minwidth );
void GRSPutPixel( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int color );
void GRSFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
int x2, int y2, int width, int Color, int BgColor );
void GRLine( EDA_Rect* aClipBox, wxDC* aDC, wxPoint aStart, wxPoint aEnd, void GRLine( EDA_Rect* aClipBox, wxDC* aDC, wxPoint aStart, wxPoint aEnd,
int aWidth, int aColor ); int aWidth, int aColor );
void GRLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, void GRLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2,
...@@ -205,24 +209,19 @@ void GRSetColor( int Color ); ...@@ -205,24 +209,19 @@ void GRSetColor( int Color );
void GRSetDefaultPalette(); void GRSetDefaultPalette();
int GRGetColor(); int GRGetColor();
void GRPutPixel( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int color ); void GRPutPixel( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int color );
void GRSPutPixel( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int color );
int GRGetPixel( wxDC* DC, int x, int y ); int GRGetPixel( wxDC* DC, int x, int y );
void GRFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, void GRFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
int x2, int y2, int Color, int BgColor ); int x2, int y2, int Color, int BgColor );
void GRFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, void GRFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
int x2, int y2, int width, int Color, int BgColor ); int x2, int y2, int width, int Color, int BgColor );
void GRSFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
int x2, int y2, int Color, int BgColor );
void GRSFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
int x2, int y2, int width, int Color, int BgColor );
void GRRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, void GRRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
int x2, int y2, int Color ); int x2, int y2, int Color );
void GRRect( EDA_Rect* ClipBox, wxDC* DC,const EDA_Rect& aRect,
int Color );
void GRRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, void GRRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
int x2, int y2, int width, int Color ); int x2, int y2, int width, int Color );
void GRSRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, void GRRect( EDA_Rect* aClipBox, wxDC* aDC,const EDA_Rect& aRect,
int x2, int y2, int Color ); int aWidth, int aColor );
void GRSRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
int x2, int y2, int width, int Color );
#endif /* define GR_BASIC */ #endif /* define GR_BASIC */
No preview for this file type
This diff is collapsed.
...@@ -40,8 +40,11 @@ const wxChar* s_AllowedExtensionsToList[] = ...@@ -40,8 +40,11 @@ const wxChar* s_AllowedExtensionsToList[] =
wxT( "^[^$].*\\.brd$" ), wxT( "^[^$].*\\.brd$" ),
wxT( "^.*\\.net$" ), wxT( "^.*\\.net$" ),
wxT( "^.*\\.txt$" ), wxT( "^.*\\.txt$" ),
wxT( "^.*\\.pho$" ), wxT( "^.*\\.pho$" ), // Gerber file
wxT( "^.*\\.gbr$" ), wxT( "^.*\\.gbr$" ), // Gerber file
wxT( "^.*\\.gb[alops]$" ), // Gerber back (or bottom) layer file
wxT( "^.*\\.gt[alops]$" ), // Gerber front (or top) layer file
wxT( "^.*\\.g[0-9]{1,2}$" ), // Gerber inner layer file
wxT( "^.*\\.odt$" ), wxT( "^.*\\.odt$" ),
wxT( "^.*\\.sxw$" ), wxT( "^.*\\.sxw$" ),
wxT( "^.*\\.htm$" ), wxT( "^.*\\.htm$" ),
......
This diff is collapsed.
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