Commit e9ebdf25 authored by Maciej Suminski's avatar Maciej Suminski

Upstream merge.

parents 04b4f236 3bddb98d

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

include/boost
downloads-by-cmake
common/netlist_keywords.* common/netlist_keywords.*
common/netlist_lexer.h common/netlist_lexer.h
common/pcb_plot_params_lexer.h common/pcb_plot_params_lexer.h
...@@ -12,7 +14,6 @@ pcbnew/dialogs/dialog_freeroute_exchange_help_html.h ...@@ -12,7 +14,6 @@ pcbnew/dialogs/dialog_freeroute_exchange_help_html.h
pcbnew/pcb_plot_params_keywords.cpp pcbnew/pcb_plot_params_keywords.cpp
pcbnew/pcb_plot_params_lexer.h pcbnew/pcb_plot_params_lexer.h
Makefile Makefile
CMakeFiles
CMakeCache.txt CMakeCache.txt
auto_renamed_to_cpp auto_renamed_to_cpp
Testing Testing
...@@ -20,7 +21,6 @@ version.h ...@@ -20,7 +21,6 @@ version.h
config.h config.h
install_manifest.txt install_manifest.txt
Documentation/doxygen Documentation/doxygen
*.cmake
*.bak *.bak
common/pcb_plot_params_keywords.cpp common/pcb_plot_params_keywords.cpp
include/pcb_plot_params_lexer.h include/pcb_plot_params_lexer.h
......
...@@ -60,15 +60,15 @@ void S3D_MASTER::Set_Object_Coords( std::vector< S3D_VERTEX >& aVertices ) ...@@ -60,15 +60,15 @@ void S3D_MASTER::Set_Object_Coords( std::vector< S3D_VERTEX >& aVertices )
aVertices[ii].y *= m_MatScale.y; aVertices[ii].y *= m_MatScale.y;
aVertices[ii].z *= m_MatScale.z; aVertices[ii].z *= m_MatScale.z;
/* adjust rotation */ // adjust rotation
if( m_MatRotation.x ) if( m_MatRotation.x )
RotatePoint( &aVertices[ii].y, &aVertices[ii].z, (int) (m_MatRotation.x * 10) ); RotatePoint( &aVertices[ii].y, &aVertices[ii].z, m_MatRotation.x * 10 );
if( m_MatRotation.y ) if( m_MatRotation.y )
RotatePoint( &aVertices[ii].z, &aVertices[ii].x, (int) (m_MatRotation.y * 10) ); RotatePoint( &aVertices[ii].z, &aVertices[ii].x, m_MatRotation.y * 10 );
if( m_MatRotation.z ) if( m_MatRotation.z )
RotatePoint( &aVertices[ii].x, &aVertices[ii].y, (int) (m_MatRotation.z * 10) ); RotatePoint( &aVertices[ii].x, &aVertices[ii].y, m_MatRotation.z * 10 );
/* adjust offset position (offset is given in UNIT 3D (0.1 inch) */ /* adjust offset position (offset is given in UNIT 3D (0.1 inch) */
#define SCALE_3D_CONV ((IU_PER_MILS * 1000) / UNITS3D_TO_UNITSPCB) #define SCALE_3D_CONV ((IU_PER_MILS * 1000) / UNITS3D_TO_UNITSPCB)
......
...@@ -30,15 +30,8 @@ ...@@ -30,15 +30,8 @@
#ifndef _3D_CANVAS_H_ #ifndef _3D_CANVAS_H_
#define _3D_CANVAS_H_ #define _3D_CANVAS_H_
#include <wxBasePcbFrame.h> // for m_auimanager member.
#include <layers_id_colors_and_visibility.h> // Layers id definitions
#include <PolyLine.h> // for CPolyPt
#if !wxUSE_GLCANVAS
#error Please set wxUSE_GLCANVAS to 1 in setup.h.
#endif
#include <wx/glcanvas.h> #include <wx/glcanvas.h>
#include <wxBasePcbFrame.h> // for m_auimanager member.
#ifdef __WXMAC__ #ifdef __WXMAC__
# ifdef __DARWIN__ # ifdef __DARWIN__
...@@ -53,10 +46,6 @@ ...@@ -53,10 +46,6 @@
#include <3d_struct.h> #include <3d_struct.h>
class BOARD_DESIGN_SETTINGS; class BOARD_DESIGN_SETTINGS;
class TRACK;
class TEXTE_PCB;
class DRAWSEGMENT;
class ZONE_CONTAINER;
class EDA_3D_FRAME; class EDA_3D_FRAME;
class S3D_VERTEX; class S3D_VERTEX;
class SEGVIA; class SEGVIA;
...@@ -100,7 +89,8 @@ public: ...@@ -100,7 +89,8 @@ public:
/** /**
* Function CreateDrawGL_List * Function CreateDrawGL_List
* creates the OpenGL draw list items. * Prepares the parameters of the OpenGL draw list
* creates the OpenGL draw list items (board, grid ...
*/ */
GLuint CreateDrawGL_List(); GLuint CreateDrawGL_List();
void InitGL(); void InitGL();
...@@ -111,47 +101,16 @@ public: ...@@ -111,47 +101,16 @@ public:
m_draw3dOffset.y = aPosY; m_draw3dOffset.y = aPosY;
} }
void DrawGrid( double aGriSizeMM );
/**
* Function Draw3D_Track
* @param aTrack = the aTrack to draw
*/
void Draw3D_Track( TRACK* aTrack );
/** /**
* Function Draw3D_Via * Function BuildBoard3DView
* draws 3D via as a cylinder and filled circles. * Called by CreateDrawGL_List()
* Fills the OpenGL draw list with board items draw list.
*/ */
void Draw3D_Via( SEGVIA* via ); void BuildBoard3DView();
/** void DrawGrid( double aGriSizeMM );
* Function Draw3D_DrawSegment void Draw3DViaHole( SEGVIA * aVia );
* draws a 3D segment (line, arc or circle). void Draw3DPadHole( D_PAD * aPad );
*/
void Draw3D_DrawSegment( DRAWSEGMENT* segment );
/**
* Function Draw3D_Zone
* draw all solid areas in aZone
* @param aZone = the zone to draw
*/
void Draw3D_Zone( ZONE_CONTAINER* aZone );
/**
* Function Draw3D_DrawText
* draws 3D segments to create text objects.
* When DrawGraphicText is called to draw a text to an OpenGL DC
* it calls Draw3dTextSegm to each segment to draw.
* 2 parameters used by Draw3D_FilledSegment are not handled by DrawGraphicText
* but are used in Draw3D_FilledSegment().
* they are 2 local variables. This is an ugly, but trivial code.
* Using DrawGraphicText to draw all texts ensure texts have the same shape
* in all contexts
*/
void Draw3D_DrawText( TEXTE_PCB* text );
//int Get3DLayerEnable(int act_layer);
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
......
This diff is collapsed.
...@@ -70,7 +70,7 @@ static inline void SetNormalZneg() ...@@ -70,7 +70,7 @@ static inline void SetNormalZneg()
* from Z position = aZpos to aZpos + aHeight * from Z position = aZpos to aZpos + aHeight
* Used to create the vertical sides of 3D horizontal shapes with thickness. * Used to create the vertical sides of 3D horizontal shapes with thickness.
*/ */
static void Draw3D_VerticalPolygonalCylinder( const std::vector<CPolyPt>& aPolysList, static void Draw3D_VerticalPolygonalCylinder( const CPOLYGONS_LIST& aPolysList,
int aHeight, int aZpos, int aHeight, int aZpos,
bool aInside, double aBiuTo3DUnits ) bool aInside, double aBiuTo3DUnits )
{ {
...@@ -96,23 +96,23 @@ static void Draw3D_VerticalPolygonalCylinder( const std::vector<CPolyPt>& aPolys ...@@ -96,23 +96,23 @@ static void Draw3D_VerticalPolygonalCylinder( const std::vector<CPolyPt>& aPolys
// Draw the vertical polygonal side // Draw the vertical polygonal side
int startContour = 0; int startContour = 0;
for( unsigned ii = 0; ii < aPolysList.size(); ii++ ) for( unsigned ii = 0; ii < aPolysList.GetCornersCount(); ii++ )
{ {
unsigned jj = ii + 1; unsigned jj = ii + 1;
if( aPolysList[ii].end_contour || jj >= aPolysList.size() ) if( aPolysList.IsEndContour( ii ) || jj >= aPolysList.GetCornersCount() )
{ {
jj = startContour; jj = startContour;
startContour = ii + 1; startContour = ii + 1;
} }
// Build the 4 vertices of each GL_QUAD // Build the 4 vertices of each GL_QUAD
coords[0].x = aPolysList[ii].x; coords[0].x = aPolysList.GetX( ii );
coords[0].y = -aPolysList[ii].y; coords[0].y = -aPolysList.GetY( ii );
coords[1].x = coords[0].x; coords[1].x = coords[0].x;
coords[1].y = coords[0].y; // only z change coords[1].y = coords[0].y; // only z change
coords[2].x = aPolysList[jj].x; coords[2].x = aPolysList.GetX( jj );
coords[2].y = -aPolysList[jj].y; coords[2].y = -aPolysList.GetY( jj );
coords[3].x = coords[2].x; coords[3].x = coords[2].x;
coords[3].y = coords[2].y; // only z change coords[3].y = coords[2].y; // only z change
...@@ -142,7 +142,7 @@ void SetGLColor( EDA_COLOR_T color ) ...@@ -142,7 +142,7 @@ void SetGLColor( EDA_COLOR_T color )
* The top side is located at aZpos + aThickness / 2 * The top side is located at aZpos + aThickness / 2
* The bottom side is located at aZpos - aThickness / 2 * The bottom side is located at aZpos - aThickness / 2
*/ */
void Draw3D_SolidHorizontalPolyPolygons( const std::vector<CPolyPt>& aPolysList, void Draw3D_SolidHorizontalPolyPolygons( const CPOLYGONS_LIST& aPolysList,
int aZpos, int aThickness, double aBiuTo3DUnits ) int aZpos, int aThickness, double aBiuTo3DUnits )
{ {
GLUtesselator* tess = gluNewTess(); GLUtesselator* tess = gluNewTess();
...@@ -164,13 +164,13 @@ void Draw3D_SolidHorizontalPolyPolygons( const std::vector<CPolyPt>& aPolysList, ...@@ -164,13 +164,13 @@ void Draw3D_SolidHorizontalPolyPolygons( const std::vector<CPolyPt>& aPolysList,
// gluTessProperty(tess, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_ODD); // gluTessProperty(tess, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_ODD);
// Draw solid areas contained in this list // Draw solid areas contained in this list
std::vector<CPolyPt> polylist = aPolysList; // temporary copy for gluTessVertex CPOLYGONS_LIST polylist = aPolysList; // temporary copy for gluTessVertex
for( int side = 0; side < 2; side++ ) for( int side = 0; side < 2; side++ )
{ {
int startContour = 1; int startContour = 1;
for( unsigned ii = 0; ii < polylist.size(); ii++ ) for( unsigned ii = 0; ii < polylist.GetCornersCount(); ii++ )
{ {
if( startContour == 1 ) if( startContour == 1 )
{ {
...@@ -179,15 +179,15 @@ void Draw3D_SolidHorizontalPolyPolygons( const std::vector<CPolyPt>& aPolysList, ...@@ -179,15 +179,15 @@ void Draw3D_SolidHorizontalPolyPolygons( const std::vector<CPolyPt>& aPolysList,
startContour = 0; startContour = 0;
} }
v_data[0] = polylist[ii].x * aBiuTo3DUnits; v_data[0] = polylist.GetX( ii ) * aBiuTo3DUnits;
v_data[1] = -polylist[ii].y * aBiuTo3DUnits; v_data[1] = -polylist.GetY( ii ) * aBiuTo3DUnits;
// gluTessVertex store pointers on data, not data, so do not store // gluTessVertex store pointers on data, not data, so do not store
// different corners values in a temporary variable // different corners values in a temporary variable
// but send pointer on each CPolyPt value in polylist // but send pointer on each CPolyPt value in polylist
// before calling gluDeleteTess // before calling gluDeleteTess
gluTessVertex( tess, v_data, &polylist[ii] ); gluTessVertex( tess, v_data, &polylist[ii] );
if( polylist[ii].end_contour == 1 ) if( polylist.IsEndContour( ii ) )
{ {
gluTessEndContour( tess ); gluTessEndContour( tess );
gluTessEndPolygon( tess ); gluTessEndPolygon( tess );
...@@ -220,11 +220,11 @@ void Draw3D_SolidHorizontalPolyPolygons( const std::vector<CPolyPt>& aPolysList, ...@@ -220,11 +220,11 @@ void Draw3D_SolidHorizontalPolyPolygons( const std::vector<CPolyPt>& aPolysList,
* The first polygon is the main polygon, others are holes * The first polygon is the main polygon, others are holes
* See Draw3D_SolidHorizontalPolyPolygons for more info * See Draw3D_SolidHorizontalPolyPolygons for more info
*/ */
void Draw3D_SolidHorizontalPolygonWithHoles( const std::vector<CPolyPt>& aPolysList, void Draw3D_SolidHorizontalPolygonWithHoles( const CPOLYGONS_LIST& aPolysList,
int aZpos, int aThickness, int aZpos, int aThickness,
double aBiuTo3DUnits ) double aBiuTo3DUnits )
{ {
std::vector<CPolyPt> polygon; CPOLYGONS_LIST polygon;
ConvertPolysListWithHolesToOnePolygon( aPolysList, polygon ); ConvertPolysListWithHolesToOnePolygon( aPolysList, polygon );
Draw3D_SolidHorizontalPolyPolygons( polygon, aZpos, aThickness, aBiuTo3DUnits ); Draw3D_SolidHorizontalPolyPolygons( polygon, aZpos, aThickness, aBiuTo3DUnits );
...@@ -241,7 +241,7 @@ void Draw3D_ZaxisCylinder( wxPoint aCenterPos, int aRadius, ...@@ -241,7 +241,7 @@ void Draw3D_ZaxisCylinder( wxPoint aCenterPos, int aRadius,
int aZpos, double aBiuTo3DUnits ) int aZpos, double aBiuTo3DUnits )
{ {
const int slice = SEGM_PER_CIRCLE; const int slice = SEGM_PER_CIRCLE;
std::vector <CPolyPt> outer_cornerBuffer; CPOLYGONS_LIST outer_cornerBuffer;
TransformCircleToPolygon( outer_cornerBuffer, aCenterPos, TransformCircleToPolygon( outer_cornerBuffer, aCenterPos,
aRadius + (aThickness / 2), slice ); aRadius + (aThickness / 2), slice );
...@@ -249,7 +249,7 @@ void Draw3D_ZaxisCylinder( wxPoint aCenterPos, int aRadius, ...@@ -249,7 +249,7 @@ void Draw3D_ZaxisCylinder( wxPoint aCenterPos, int aRadius,
std::vector<S3D_VERTEX> coords; std::vector<S3D_VERTEX> coords;
coords.resize( 4 ); coords.resize( 4 );
std::vector <CPolyPt> inner_cornerBuffer; CPOLYGONS_LIST inner_cornerBuffer;
if( aThickness ) // build the the vertical inner polygon (hole) if( aThickness ) // build the the vertical inner polygon (hole)
TransformCircleToPolygon( inner_cornerBuffer, aCenterPos, TransformCircleToPolygon( inner_cornerBuffer, aCenterPos,
aRadius - (aThickness / 2), slice ); aRadius - (aThickness / 2), slice );
...@@ -269,9 +269,8 @@ void Draw3D_ZaxisCylinder( wxPoint aCenterPos, int aRadius, ...@@ -269,9 +269,8 @@ void Draw3D_ZaxisCylinder( wxPoint aCenterPos, int aRadius,
{ {
// draw top (front) and bottom (back) horizontal sides (rings) // draw top (front) and bottom (back) horizontal sides (rings)
SetNormalZpos(); SetNormalZpos();
outer_cornerBuffer.insert( outer_cornerBuffer.end(), outer_cornerBuffer.Append( inner_cornerBuffer );
inner_cornerBuffer.begin(), inner_cornerBuffer.end() ); CPOLYGONS_LIST polygon;
std::vector<CPolyPt> polygon;
ConvertPolysListWithHolesToOnePolygon( outer_cornerBuffer, polygon ); ConvertPolysListWithHolesToOnePolygon( outer_cornerBuffer, polygon );
// draw top (front) horizontal ring // draw top (front) horizontal ring
...@@ -303,7 +302,7 @@ void Draw3D_ZaxisOblongCylinder( wxPoint aAxis1Pos, wxPoint aAxis2Pos, ...@@ -303,7 +302,7 @@ void Draw3D_ZaxisOblongCylinder( wxPoint aAxis1Pos, wxPoint aAxis2Pos,
const int slice = SEGM_PER_CIRCLE; const int slice = SEGM_PER_CIRCLE;
// Build the points to approximate oblong cylinder by segments // Build the points to approximate oblong cylinder by segments
std::vector <CPolyPt> outer_cornerBuffer; CPOLYGONS_LIST outer_cornerBuffer;
int segm_width = (aRadius * 2) + aThickness; int segm_width = (aRadius * 2) + aThickness;
TransformRoundedEndsSegmentToPolygon( outer_cornerBuffer, aAxis1Pos, TransformRoundedEndsSegmentToPolygon( outer_cornerBuffer, aAxis1Pos,
...@@ -316,7 +315,7 @@ void Draw3D_ZaxisOblongCylinder( wxPoint aAxis1Pos, wxPoint aAxis2Pos, ...@@ -316,7 +315,7 @@ void Draw3D_ZaxisOblongCylinder( wxPoint aAxis1Pos, wxPoint aAxis2Pos,
if( aThickness ) if( aThickness )
{ {
std::vector <CPolyPt> inner_cornerBuffer; CPOLYGONS_LIST inner_cornerBuffer;
segm_width = aRadius * 2; segm_width = aRadius * 2;
TransformRoundedEndsSegmentToPolygon( inner_cornerBuffer, aAxis1Pos, TransformRoundedEndsSegmentToPolygon( inner_cornerBuffer, aAxis1Pos,
aAxis2Pos, slice, segm_width ); aAxis2Pos, slice, segm_width );
...@@ -328,11 +327,9 @@ void Draw3D_ZaxisOblongCylinder( wxPoint aAxis1Pos, wxPoint aAxis2Pos, ...@@ -328,11 +327,9 @@ void Draw3D_ZaxisOblongCylinder( wxPoint aAxis1Pos, wxPoint aAxis2Pos,
// Build the horizontal full polygon shape // Build the horizontal full polygon shape
// (outer polygon shape - inner polygon shape) // (outer polygon shape - inner polygon shape)
outer_cornerBuffer.insert( outer_cornerBuffer.end(), outer_cornerBuffer.Append( inner_cornerBuffer );
inner_cornerBuffer.begin(),
inner_cornerBuffer.end() );
std::vector<CPolyPt> polygon; CPOLYGONS_LIST polygon;
ConvertPolysListWithHolesToOnePolygon( outer_cornerBuffer, polygon ); ConvertPolysListWithHolesToOnePolygon( outer_cornerBuffer, polygon );
// draw top (front) horizontal side (ring) // draw top (front) horizontal side (ring)
...@@ -360,7 +357,7 @@ void Draw3D_ZaxisOblongCylinder( wxPoint aAxis1Pos, wxPoint aAxis2Pos, ...@@ -360,7 +357,7 @@ void Draw3D_ZaxisOblongCylinder( wxPoint aAxis1Pos, wxPoint aAxis2Pos,
void Draw3D_SolidSegment( const wxPoint& aStart, const wxPoint& aEnd, void Draw3D_SolidSegment( const wxPoint& aStart, const wxPoint& aEnd,
int aWidth, int aThickness, int aZpos, double aBiuTo3DUnits ) int aWidth, int aThickness, int aZpos, double aBiuTo3DUnits )
{ {
std::vector <CPolyPt> cornerBuffer; CPOLYGONS_LIST cornerBuffer;
const int slice = SEGM_PER_CIRCLE; const int slice = SEGM_PER_CIRCLE;
TransformRoundedEndsSegmentToPolygon( cornerBuffer, aStart, aEnd, slice, aWidth ); TransformRoundedEndsSegmentToPolygon( cornerBuffer, aStart, aEnd, slice, aWidth );
...@@ -370,17 +367,16 @@ void Draw3D_SolidSegment( const wxPoint& aStart, const wxPoint& aEnd, ...@@ -370,17 +367,16 @@ void Draw3D_SolidSegment( const wxPoint& aStart, const wxPoint& aEnd,
void Draw3D_ArcSegment( const wxPoint& aCenterPos, const wxPoint& aStartPoint, void Draw3D_ArcSegment( const wxPoint& aCenterPos, const wxPoint& aStartPoint,
int aArcAngle, int aWidth, int aThickness, double aArcAngle, int aWidth, int aThickness,
int aZpos, double aBiuTo3DUnits ) int aZpos, double aBiuTo3DUnits )
{ {
const int slice = SEGM_PER_CIRCLE; const int slice = SEGM_PER_CIRCLE;
std::vector <CPolyPt> cornerBuffer; CPOLYGONS_LIST cornerBuffer;
TransformArcToPolygon( cornerBuffer, aCenterPos, aStartPoint, aArcAngle, TransformArcToPolygon( cornerBuffer, aCenterPos, aStartPoint, aArcAngle,
slice, aWidth ); slice, aWidth );
Draw3D_SolidHorizontalPolyPolygons( cornerBuffer, aZpos, aThickness, aBiuTo3DUnits ); Draw3D_SolidHorizontalPolyPolygons( cornerBuffer, aZpos, aThickness, aBiuTo3DUnits );
} }
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
* The top side is located at aZpos + aThickness / 2 * The top side is located at aZpos + aThickness / 2
* The bottom side is located at aZpos - aThickness / 2 * The bottom side is located at aZpos - aThickness / 2
*/ */
void Draw3D_SolidHorizontalPolyPolygons( const std::vector<CPolyPt>& aPolysList, void Draw3D_SolidHorizontalPolyPolygons( const CPOLYGONS_LIST& aPolysList,
int aZpos, int aThickness, double aBiuTo3DUnits ); int aZpos, int aThickness, double aBiuTo3DUnits );
/** draw the solid polygon found in aPolysList /** draw the solid polygon found in aPolysList
...@@ -55,7 +55,7 @@ void Draw3D_SolidHorizontalPolyPolygons( const std::vector<CPolyPt>& aPolysLi ...@@ -55,7 +55,7 @@ void Draw3D_SolidHorizontalPolyPolygons( const std::vector<CPolyPt>& aPolysLi
* The top side is located at aZpos + aThickness / 2 * The top side is located at aZpos + aThickness / 2
* The bottom side is located at aZpos - aThickness / 2 * The bottom side is located at aZpos - aThickness / 2
*/ */
void Draw3D_SolidHorizontalPolygonWithHoles( const std::vector<CPolyPt>& aPolysList, void Draw3D_SolidHorizontalPolygonWithHoles( const CPOLYGONS_LIST& aPolysList,
int aZpos, int aThickness, double aBiuTo3DUnits ); int aZpos, int aThickness, double aBiuTo3DUnits );
/** draw a thick segment using 3D primitives, in a XY plane /** draw a thick segment using 3D primitives, in a XY plane
...@@ -85,7 +85,7 @@ void Draw3D_SolidSegment( const wxPoint& aStart, const wxPoint& aEnd, ...@@ -85,7 +85,7 @@ void Draw3D_SolidSegment( const wxPoint& aStart, const wxPoint& aEnd,
* @param aBiuTo3DUnits = board internal units to 3D units scaling value * @param aBiuTo3DUnits = board internal units to 3D units scaling value
*/ */
void Draw3D_ArcSegment( const wxPoint& aCenterPos, const wxPoint& aStartPoint, void Draw3D_ArcSegment( const wxPoint& aCenterPos, const wxPoint& aStartPoint,
int aArcAngle, int aWidth, int aThickness, double aArcAngle, int aWidth, int aThickness,
int aZpos, double aBiuTo3DUnits ); int aZpos, double aBiuTo3DUnits );
......
...@@ -51,10 +51,12 @@ static const wxString keyShowAxis( wxT( "ShowAxis" ) ); ...@@ -51,10 +51,12 @@ static const wxString keyShowAxis( wxT( "ShowAxis" ) );
static const wxString keyShowZones( wxT( "ShowZones" ) ); static const wxString keyShowZones( wxT( "ShowZones" ) );
static const wxString keyShowFootprints( wxT( "ShowFootprints" ) ); static const wxString keyShowFootprints( wxT( "ShowFootprints" ) );
static const wxString keyShowCopperThickness( wxT( "ShowCopperThickness" ) ); static const wxString keyShowCopperThickness( wxT( "ShowCopperThickness" ) );
static const wxString keyShowCommetsLayer( wxT( "ShowCommetsLayer" ) ); static const wxString keyShowAdhesiveLayers( wxT( "ShowAdhesiveLayers" ) );
static const wxString keyShowDrawingsLayer( wxT( "ShowDrawingsLayer" ) ); static const wxString keyShowSilkScreenLayers( wxT( "ShowSilkScreenLayers" ) );
static const wxString keyShowEco1Layer( wxT( "ShowEco1Layer" ) ); static const wxString keyShowSolderMaskLayers( wxT( "ShowSolderMasLayers" ) );
static const wxString keyShowEco2Layer( wxT( "ShowEco2Layer" ) ); static const wxString keyShowSolderPasteLayers( wxT( "ShowSolderPasteLayers" ) );
static const wxString keyShowCommentsLayer( wxT( "ShowCommentsLayers" ) );
static const wxString keyShowEcoLayers( wxT( "ShowEcoLayers" ) );
BEGIN_EVENT_TABLE( EDA_3D_FRAME, wxFrame ) BEGIN_EVENT_TABLE( EDA_3D_FRAME, wxFrame )
EVT_ACTIVATE( EDA_3D_FRAME::OnActivate ) EVT_ACTIVATE( EDA_3D_FRAME::OnActivate )
...@@ -62,6 +64,7 @@ EVT_ACTIVATE( EDA_3D_FRAME::OnActivate ) ...@@ -62,6 +64,7 @@ EVT_ACTIVATE( EDA_3D_FRAME::OnActivate )
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, EDA_3D_FRAME::Process_Zoom ) EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, EDA_3D_FRAME::Process_Zoom )
EVT_TOOL_RANGE( ID_START_COMMAND_3D, ID_END_COMMAND_3D, EVT_TOOL_RANGE( ID_START_COMMAND_3D, ID_END_COMMAND_3D,
EDA_3D_FRAME::Process_Special_Functions ) EDA_3D_FRAME::Process_Special_Functions )
EVT_TOOL( ID_TOOL_SET_VISIBLE_ITEMS, EDA_3D_FRAME::Process_Special_Functions )
EVT_MENU( wxID_EXIT, EDA_3D_FRAME::Exit3DFrame ) EVT_MENU( wxID_EXIT, EDA_3D_FRAME::Exit3DFrame )
EVT_MENU( ID_MENU_SCREENCOPY_PNG, EDA_3D_FRAME::Process_Special_Functions ) EVT_MENU( ID_MENU_SCREENCOPY_PNG, EDA_3D_FRAME::Process_Special_Functions )
EVT_MENU( ID_MENU_SCREENCOPY_JPEG, EDA_3D_FRAME::Process_Special_Functions ) EVT_MENU( ID_MENU_SCREENCOPY_JPEG, EDA_3D_FRAME::Process_Special_Functions )
...@@ -97,7 +100,7 @@ END_EVENT_TABLE() EDA_3D_FRAME::EDA_3D_FRAME( PCB_BASE_FRAME* parent, ...@@ -97,7 +100,7 @@ END_EVENT_TABLE() EDA_3D_FRAME::EDA_3D_FRAME( PCB_BASE_FRAME* parent,
CreateStatusBar( 5 ); CreateStatusBar( 5 );
SetStatusWidths( 5, dims ); SetStatusWidths( 5, dims );
ReCreateMenuBar(); CreateMenuBar();
ReCreateHToolbar(); ReCreateHToolbar();
// ReCreateAuxiliaryToolbar(); // ReCreateAuxiliaryToolbar();
...@@ -170,12 +173,13 @@ void EDA_3D_FRAME::GetSettings() ...@@ -170,12 +173,13 @@ void EDA_3D_FRAME::GetSettings()
&prms.m_DrawFlags[prms.FL_USE_COPPER_THICKNESS], &prms.m_DrawFlags[prms.FL_USE_COPPER_THICKNESS],
false ); false );
config->Read( keyShowZones, &prms.m_DrawFlags[prms.FL_ZONE], true ); config->Read( keyShowZones, &prms.m_DrawFlags[prms.FL_ZONE], true );
config->Read( keyShowCommetsLayer, &prms.m_DrawFlags[prms.FL_COMMENTS], true ); config->Read( keyShowAdhesiveLayers, &prms.m_DrawFlags[prms.FL_ADHESIVE], true );
config->Read( keyShowDrawingsLayer, &prms.m_DrawFlags[prms.FL_DRAWINGS], true ); config->Read( keyShowSilkScreenLayers, &prms.m_DrawFlags[prms.FL_SILKSCREEN], true );
config->Read( keyShowEco1Layer, &prms.m_DrawFlags[prms.FL_ECO1], true ); config->Read( keyShowSolderMaskLayers, &prms.m_DrawFlags[prms.FL_SOLDERMASK], true );
config->Read( keyShowEco2Layer, &prms.m_DrawFlags[prms.FL_ECO2], true ); config->Read( keyShowSolderPasteLayers, &prms.m_DrawFlags[prms.FL_SOLDERPASTE], true );
config->Read( keyShowCommentsLayer, &prms.m_DrawFlags[prms.FL_COMMENTS], true );
config->Read( keyShowEcoLayers, &prms.m_DrawFlags[prms.FL_ECO], true );
} }
} }
...@@ -195,10 +199,12 @@ void EDA_3D_FRAME::SaveSettings() ...@@ -195,10 +199,12 @@ void EDA_3D_FRAME::SaveSettings()
config->Write( keyShowFootprints, prms.m_DrawFlags[prms.FL_MODULE] ); config->Write( keyShowFootprints, prms.m_DrawFlags[prms.FL_MODULE] );
config->Write( keyShowCopperThickness, prms.m_DrawFlags[prms.FL_USE_COPPER_THICKNESS] ); config->Write( keyShowCopperThickness, prms.m_DrawFlags[prms.FL_USE_COPPER_THICKNESS] );
config->Write( keyShowZones, prms.m_DrawFlags[prms.FL_ZONE] ); config->Write( keyShowZones, prms.m_DrawFlags[prms.FL_ZONE] );
config->Write( keyShowCommetsLayer, prms.m_DrawFlags[prms.FL_COMMENTS] ); config->Write( keyShowAdhesiveLayers, prms.m_DrawFlags[prms.FL_ADHESIVE] );
config->Write( keyShowDrawingsLayer, prms.m_DrawFlags[prms.FL_DRAWINGS] ); config->Write( keyShowSilkScreenLayers, prms.m_DrawFlags[prms.FL_SILKSCREEN] );
config->Write( keyShowEco1Layer, prms.m_DrawFlags[prms.FL_ECO1] ); config->Write( keyShowSolderMaskLayers, prms.m_DrawFlags[prms.FL_SOLDERMASK] );
config->Write( keyShowEco2Layer, prms.m_DrawFlags[prms.FL_ECO2] ); config->Write( keyShowSolderPasteLayers, prms.m_DrawFlags[prms.FL_SOLDERPASTE] );
config->Write( keyShowCommentsLayer, prms.m_DrawFlags[prms.FL_COMMENTS] );
config->Write( keyShowEcoLayers, prms.m_DrawFlags[prms.FL_ECO] );
if( IsIconized() ) if( IsIconized() )
return; return;
...@@ -286,6 +292,10 @@ void EDA_3D_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -286,6 +292,10 @@ void EDA_3D_FRAME::Process_Special_Functions( wxCommandEvent& event )
switch( id ) switch( id )
{ {
case ID_TOOL_SET_VISIBLE_ITEMS:
Install_3D_ViewOptionDialog( event );
break;
case ID_RELOAD3D_BOARD: case ID_RELOAD3D_BOARD:
NewDisplay(); NewDisplay();
return; return;
...@@ -365,23 +375,33 @@ void EDA_3D_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -365,23 +375,33 @@ void EDA_3D_FRAME::Process_Special_Functions( wxCommandEvent& event )
NewDisplay(); NewDisplay();
return; return;
case ID_MENU3D_COMMENTS_ONOFF: case ID_MENU3D_ADHESIVE_ONOFF:
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_COMMENTS] = isChecked; g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ADHESIVE] = isChecked;
NewDisplay(); NewDisplay();
return; return;
case ID_MENU3D_DRAWINGS_ONOFF: case ID_MENU3D_SILKSCREEN_ONOFF:
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_DRAWINGS] = isChecked; g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SILKSCREEN] = isChecked;
NewDisplay(); NewDisplay();
return; return;
case ID_MENU3D_ECO1_ONOFF: case ID_MENU3D_SOLDER_MASK_ONOFF:
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ECO1] = isChecked; g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SOLDERMASK] = isChecked;
NewDisplay();
return;
case ID_MENU3D_SOLDER_PASTE_ONOFF:
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SOLDERPASTE] = isChecked;
NewDisplay();
return;
case ID_MENU3D_COMMENTS_ONOFF:
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_COMMENTS] = isChecked;
NewDisplay(); NewDisplay();
return; return;
case ID_MENU3D_ECO2_ONOFF: case ID_MENU3D_ECO_ONOFF:
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ECO2] = isChecked; g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ECO] = isChecked;
NewDisplay(); NewDisplay();
return; return;
......
...@@ -63,6 +63,12 @@ void EDA_3D_FRAME::ReCreateHToolbar() ...@@ -63,6 +63,12 @@ void EDA_3D_FRAME::ReCreateHToolbar()
#endif #endif
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_TOOL_SET_VISIBLE_ITEMS, wxEmptyString,
KiBitmap( read_setup_xpm ),
_( "Set display options, and some layers visibility" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ),
_( "Zoom in" ) ); _( "Zoom in" ) );
...@@ -130,15 +136,8 @@ void EDA_3D_FRAME::ReCreateVToolbar() ...@@ -130,15 +136,8 @@ void EDA_3D_FRAME::ReCreateVToolbar()
} }
void EDA_3D_FRAME::ReCreateMenuBar() void EDA_3D_FRAME::CreateMenuBar()
{ {
bool full_options = true;
// If called from the display frame of CvPcb, only some options are relevant
if( Parent()->GetName() == wxT( "CmpFrame" ) ) {
full_options = false;
}
wxMenuBar* menuBar = new wxMenuBar; wxMenuBar* menuBar = new wxMenuBar;
wxMenu* fileMenu = new wxMenu; wxMenu* fileMenu = new wxMenu;
wxMenu* prefsMenu = new wxMenu; wxMenu* prefsMenu = new wxMenu;
...@@ -153,6 +152,7 @@ void EDA_3D_FRAME::ReCreateMenuBar() ...@@ -153,6 +152,7 @@ void EDA_3D_FRAME::ReCreateMenuBar()
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
fileMenu->Append( ID_TOOL_SCREENCOPY_TOCLIBBOARD, _( "Copy 3D Image to Clipboard" ) ); fileMenu->Append( ID_TOOL_SCREENCOPY_TOCLIBBOARD, _( "Copy 3D Image to Clipboard" ) );
#endif #endif
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
fileMenu->Append( wxID_EXIT, _( "&Exit" ) ); fileMenu->Append( wxID_EXIT, _( "&Exit" ) );
...@@ -166,21 +166,6 @@ void EDA_3D_FRAME::ReCreateMenuBar() ...@@ -166,21 +166,6 @@ void EDA_3D_FRAME::ReCreateMenuBar()
_( "Show 3D &Axis" ), KiBitmap( axis3d_front_xpm ), wxITEM_CHECK ); _( "Show 3D &Axis" ), KiBitmap( axis3d_front_xpm ), wxITEM_CHECK );
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_AXIS]); item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_AXIS]);
if( full_options )
{
item = AddMenuItem( prefsMenu, ID_MENU3D_USE_COPPER_THICKNESS,
_( "Show Copper Thickness" ), KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_USE_COPPER_THICKNESS]);
item = AddMenuItem( prefsMenu, ID_MENU3D_MODULE_ONOFF,
_( "Show 3D F&ootprints" ), KiBitmap( shape_3d_xpm ), wxITEM_CHECK );
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_MODULE]);
item = AddMenuItem( prefsMenu, ID_MENU3D_ZONE_ONOFF,
_( "Show Zone &Filling" ), KiBitmap( add_zone_xpm ), wxITEM_CHECK );
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ZONE]);
// Creates grid menu // Creates grid menu
wxMenu * gridlistMenu = new wxMenu; wxMenu * gridlistMenu = new wxMenu;
item = AddMenuItem( prefsMenu, gridlistMenu, ID_MENU3D_GRID, item = AddMenuItem( prefsMenu, gridlistMenu, ID_MENU3D_GRID,
...@@ -193,27 +178,74 @@ void EDA_3D_FRAME::ReCreateMenuBar() ...@@ -193,27 +178,74 @@ void EDA_3D_FRAME::ReCreateMenuBar()
gridlistMenu->Append( ID_MENU3D_GRID_2P5_MM, _( "3D Grid 2.5 mm" ), wxEmptyString, true ); gridlistMenu->Append( ID_MENU3D_GRID_2P5_MM, _( "3D Grid 2.5 mm" ), wxEmptyString, true );
gridlistMenu->Append( ID_MENU3D_GRID_1_MM, _( "3D Grid 1 mm" ), wxEmptyString, true ); gridlistMenu->Append( ID_MENU3D_GRID_1_MM, _( "3D Grid 1 mm" ), wxEmptyString, true );
item = AddMenuItem( prefsMenu, ID_MENU3D_COMMENTS_ONOFF, item = AddMenuItem( prefsMenu, ID_MENU3D_USE_COPPER_THICKNESS,
_( "Show &Comments Layer" ), KiBitmap( edit_sheet_xpm ), wxITEM_CHECK ); _( "Show Copper Thickness" ), KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_COMMENTS]);
item = AddMenuItem( prefsMenu, ID_MENU3D_DRAWINGS_ONOFF, item = AddMenuItem( prefsMenu, ID_MENU3D_MODULE_ONOFF,
_( "Show &Drawings Layer" ), KiBitmap( add_polygon_xpm ), wxITEM_CHECK ); _( "Show 3D F&ootprints" ), KiBitmap( shape_3d_xpm ), wxITEM_CHECK );
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_DRAWINGS]);
item = AddMenuItem( prefsMenu, ID_MENU3D_ECO1_ONOFF, item = AddMenuItem( prefsMenu, ID_MENU3D_ZONE_ONOFF,
_( "Show Eco&1 Layer" ), KiBitmap( tools_xpm ), wxITEM_CHECK ); _( "Show Zone &Filling" ), KiBitmap( add_zone_xpm ), wxITEM_CHECK );
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ECO1]);
item = AddMenuItem( prefsMenu, ID_MENU3D_ECO2_ONOFF, item = AddMenuItem( prefsMenu, ID_MENU3D_ADHESIVE_ONOFF,
_( "Show Eco&2 Layer" ), KiBitmap( tools_xpm ), wxITEM_CHECK ); _( "Show &Adhesive Layers" ), KiBitmap( tools_xpm ), wxITEM_CHECK );
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ECO2]); item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ADHESIVE]);
} item = AddMenuItem( prefsMenu, ID_MENU3D_SILKSCREEN_ONOFF,
_( "Show &Silkscreen Layer" ), KiBitmap( add_text_xpm ), wxITEM_CHECK );
item = AddMenuItem( prefsMenu, ID_MENU3D_SOLDER_MASK_ONOFF,
_( "Show Solder &Mask Layers" ), KiBitmap( pads_mask_layers_xpm ), wxITEM_CHECK );
item = AddMenuItem( prefsMenu, ID_MENU3D_SOLDER_PASTE_ONOFF,
_( "Show Solder &Paste Layers" ), KiBitmap( pads_mask_layers_xpm ), wxITEM_CHECK );
item = AddMenuItem( prefsMenu, ID_MENU3D_COMMENTS_ONOFF,
_( "Show &Comments and Drawings Layer" ), KiBitmap( edit_sheet_xpm ), wxITEM_CHECK );
item = AddMenuItem( prefsMenu, ID_MENU3D_ECO_ONOFF,
_( "Show &Eco Layers" ), KiBitmap( edit_sheet_xpm ), wxITEM_CHECK );
SetMenuBarOptionsState();
SetMenuBar( menuBar ); SetMenuBar( menuBar );
} }
void EDA_3D_FRAME::SetMenuBarOptionsState()
{
wxMenuBar* menuBar = GetMenuBar();
if( menuBar == NULL )
return;
wxMenuItem* item;
// Set the state of toggle menus according to the current display options
item = menuBar->FindItem( ID_MENU3D_USE_COPPER_THICKNESS );
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_USE_COPPER_THICKNESS]);
item = menuBar->FindItem( ID_MENU3D_MODULE_ONOFF );
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_MODULE]);
item = menuBar->FindItem( ID_MENU3D_ZONE_ONOFF );
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ZONE]);
item = menuBar->FindItem( ID_MENU3D_ADHESIVE_ONOFF );
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ADHESIVE]);
item = menuBar->FindItem( ID_MENU3D_SILKSCREEN_ONOFF );
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SILKSCREEN]);
item = menuBar->FindItem( ID_MENU3D_SOLDER_MASK_ONOFF );
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SOLDERMASK]);
item = menuBar->FindItem( ID_MENU3D_SOLDER_PASTE_ONOFF );
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SOLDERPASTE]);
item = menuBar->FindItem( ID_MENU3D_COMMENTS_ONOFF );
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_COMMENTS]);
item = menuBar->FindItem( ID_MENU3D_ECO_ONOFF );
item->Check(g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ECO]);
}
void EDA_3D_FRAME::SetToolbars() void EDA_3D_FRAME::SetToolbars()
{ {
......
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
#define __3D_VIEWER_H__ #define __3D_VIEWER_H__
#include <wxBasePcbFrame.h> // for m_auimanager member. #include <wxBasePcbFrame.h> // for m_auimanager member.
#include <layers_id_colors_and_visibility.h> // Layers id definitions
#include <PolyLine.h> // fot CPolyPt
#if !wxUSE_GLCANVAS #if !wxUSE_GLCANVAS
#error Please set wxUSE_GLCANVAS to 1 in setup.h. #error Please set wxUSE_GLCANVAS to 1 in setup.h.
...@@ -117,9 +115,12 @@ private: ...@@ -117,9 +115,12 @@ private:
void On3DGridSelection( wxCommandEvent& event ); void On3DGridSelection( wxCommandEvent& event );
void Process_Zoom( wxCommandEvent& event ); void Process_Zoom( wxCommandEvent& event );
void OnActivate( wxActivateEvent& event ); void OnActivate( wxActivateEvent& event );
void Install_3D_ViewOptionDialog( wxCommandEvent& event );
// initialisation // initialisation
void ReCreateMenuBar(); void CreateMenuBar();
void SetMenuBarOptionsState(); // Set the state of toggle menus according
// to the current display options
void ReCreateHToolbar(); void ReCreateHToolbar();
void ReCreateVToolbar(); void ReCreateVToolbar();
void SetToolbars(); void SetToolbars();
......
...@@ -33,12 +33,16 @@ enum id_3dview_frm ...@@ -33,12 +33,16 @@ enum id_3dview_frm
ID_MENU3D_AXIS_ONOFF, ID_MENU3D_AXIS_ONOFF,
ID_MENU3D_MODULE_ONOFF, ID_MENU3D_MODULE_ONOFF,
ID_MENU3D_ZONE_ONOFF, ID_MENU3D_ZONE_ONOFF,
ID_MENU3D_DRAWINGS_ONOFF, ID_MENU3D_ADHESIVE_ONOFF,
ID_MENU3D_SILKSCREEN_ONOFF,
ID_MENU3D_SOLDER_PASTE_ONOFF,
ID_MENU3D_SOLDER_MASK_ONOFF,
ID_MENU3D_COMMENTS_ONOFF, ID_MENU3D_COMMENTS_ONOFF,
ID_MENU3D_ECO1_ONOFF, ID_MENU3D_ECO_ONOFF,
ID_MENU3D_ECO2_ONOFF,
ID_END_COMMAND_3D, ID_END_COMMAND_3D,
ID_TOOL_SET_VISIBLE_ITEMS,
ID_MENU3D_GRID, ID_MENU3D_GRID,
ID_MENU3D_GRID_NOGRID, ID_MENU3D_GRID_NOGRID,
ID_MENU3D_GRID_10_MM, ID_MENU3D_GRID_10_MM,
......
...@@ -9,6 +9,8 @@ include_directories( ...@@ -9,6 +9,8 @@ include_directories(
) )
set(3D-VIEWER_SRCS set(3D-VIEWER_SRCS
dialogs/dialog_3D_view_option_base.cpp
dialogs/dialog_3D_view_option.cpp
3d_aux.cpp 3d_aux.cpp
3d_canvas.cpp 3d_canvas.cpp
3d_class.cpp 3d_class.cpp
......
#include "dialog_3D_view_option_base.h"
#include <3d_viewer.h>
#include <info3d_visu.h>
class DIALOG_3D_VIEW_OPTIONS : public DIALOG_3D_VIEW_OPTIONS_BASE
{
public:
DIALOG_3D_VIEW_OPTIONS( EDA_3D_FRAME* parent );
private:
EDA_3D_FRAME* m_parent;
void initDialog();
// Event functions:
void OnShowAllClick( wxCommandEvent& event );
void OnShowNoneClick( wxCommandEvent& event );
void OnOKClick( wxCommandEvent& event );
};
void EDA_3D_FRAME::Install_3D_ViewOptionDialog( wxCommandEvent& event )
{
DIALOG_3D_VIEW_OPTIONS dlg( this );
if( dlg.ShowModal() == wxID_OK )
{
SetMenuBarOptionsState();
NewDisplay();
}
}
DIALOG_3D_VIEW_OPTIONS::DIALOG_3D_VIEW_OPTIONS( EDA_3D_FRAME* parent )
:DIALOG_3D_VIEW_OPTIONS_BASE( parent )
{
m_parent = parent;
initDialog();
Layout();
GetSizer()->SetSizeHints(this);
Centre();
}
void DIALOG_3D_VIEW_OPTIONS::initDialog()
{
m_bitmapCuThickness->SetBitmap( KiBitmap( use_3D_copper_thickness_xpm ) );
m_bitmap3Dshapes->SetBitmap( KiBitmap( shape_3d_xpm ) );
m_bitmapAreas->SetBitmap( KiBitmap( add_zone_xpm ) );
m_bitmapSilkscreen->SetBitmap( KiBitmap( add_text_xpm ) );
m_bitmapSolderMask->SetBitmap( KiBitmap( pads_mask_layers_xpm ) );
m_bitmapSolderPaste->SetBitmap( KiBitmap( pads_mask_layers_xpm ) );
m_bitmapAdhesive->SetBitmap( KiBitmap( tools_xpm ) );
m_bitmapComments->SetBitmap( KiBitmap( edit_sheet_xpm ) );
m_bitmapECO->SetBitmap( KiBitmap( edit_sheet_xpm ) );
// Check/uncheck checkboxes
m_checkBoxCuThickness->SetValue(
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_USE_COPPER_THICKNESS] );
m_checkBox3Dshapes->SetValue(
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_MODULE] );
m_checkBoxAreas->SetValue(
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ZONE] );
m_checkBoxSilkscreen->SetValue(
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SILKSCREEN] );
m_checkBoxSolderMask->SetValue(
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SOLDERMASK] );
m_checkBoxSolderpaste->SetValue(
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SOLDERPASTE] );
m_checkBoxAdhesive->SetValue(
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ADHESIVE] );
m_checkBoxComments->SetValue(
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_COMMENTS] );
m_checkBoxECO->SetValue(
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ECO] );
}
void DIALOG_3D_VIEW_OPTIONS::OnShowAllClick( wxCommandEvent& event )
{
bool state = true;
m_checkBoxCuThickness->SetValue( state );
m_checkBox3Dshapes->SetValue( state );
m_checkBoxAreas->SetValue( state );
m_checkBoxSilkscreen->SetValue( state );
m_checkBoxSolderMask->SetValue( state );
m_checkBoxSolderpaste->SetValue( state );
m_checkBoxAdhesive->SetValue( state );
m_checkBoxComments->SetValue( state );
m_checkBoxECO->SetValue( state );
}
void DIALOG_3D_VIEW_OPTIONS::OnShowNoneClick( wxCommandEvent& event )
{
bool state = false;
m_checkBoxCuThickness->SetValue( state );
m_checkBox3Dshapes->SetValue( state );
m_checkBoxAreas->SetValue( state );
m_checkBoxSilkscreen->SetValue( state );
m_checkBoxSolderMask->SetValue( state );
m_checkBoxSolderpaste->SetValue( state );
m_checkBoxAdhesive->SetValue( state );
m_checkBoxComments->SetValue( state );
m_checkBoxECO->SetValue( state );
}
void DIALOG_3D_VIEW_OPTIONS::OnOKClick( wxCommandEvent& event )
{
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_USE_COPPER_THICKNESS] =
m_checkBoxCuThickness->GetValue();
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_MODULE] =
m_checkBox3Dshapes->GetValue();
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ZONE] =
m_checkBoxAreas->GetValue();
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SILKSCREEN] =
m_checkBoxSilkscreen->GetValue();
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SOLDERMASK] =
m_checkBoxSolderMask->GetValue();
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_SOLDERPASTE] =
m_checkBoxSolderpaste->GetValue();
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ADHESIVE] =
m_checkBoxAdhesive->GetValue();
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_COMMENTS] =
m_checkBoxComments->GetValue();
g_Parm_3D_Visu.m_DrawFlags[g_Parm_3D_Visu.FL_ECO] =
m_checkBoxECO->GetValue();
EndModal( wxID_OK );
}
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_3D_view_option_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerLeft;
bSizerLeft = new wxBoxSizer( wxHORIZONTAL );
wxFlexGridSizer* fgSizeShowOpts;
fgSizeShowOpts = new wxFlexGridSizer( 9, 2, 0, 0 );
fgSizeShowOpts->SetFlexibleDirection( wxBOTH );
fgSizeShowOpts->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_bitmapCuThickness = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmapCuThickness, 0, wxALL, 5 );
m_checkBoxCuThickness = new wxCheckBox( this, wxID_ANY, _("Show copper thickness"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxCuThickness, 0, wxALL, 5 );
m_bitmap3Dshapes = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmap3Dshapes, 0, wxALL, 5 );
m_checkBox3Dshapes = new wxCheckBox( this, wxID_ANY, _("Show component 3D shapes"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBox3Dshapes, 0, wxALL, 5 );
m_bitmapAreas = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmapAreas, 0, wxALL, 5 );
m_checkBoxAreas = new wxCheckBox( this, wxID_ANY, _("Show filled areas in zones"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxAreas, 0, wxALL, 5 );
m_bitmapSilkscreen = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmapSilkscreen, 0, wxALL, 5 );
m_checkBoxSilkscreen = new wxCheckBox( this, wxID_ANY, _("Show silkscreen layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxSilkscreen, 0, wxALL, 5 );
m_bitmapSolderMask = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmapSolderMask, 0, wxALL, 5 );
m_checkBoxSolderMask = new wxCheckBox( this, wxID_ANY, _("Show solder mask layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxSolderMask, 0, wxALL, 5 );
m_bitmapSolderPaste = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmapSolderPaste, 0, wxALL, 5 );
m_checkBoxSolderpaste = new wxCheckBox( this, wxID_ANY, _("Show solder paste layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxSolderpaste, 0, wxALL, 5 );
m_bitmapAdhesive = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmapAdhesive, 0, wxALL, 5 );
m_checkBoxAdhesive = new wxCheckBox( this, wxID_ANY, _("Show adhesive layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxAdhesive, 0, wxALL, 5 );
m_bitmapComments = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmapComments, 0, wxALL, 5 );
m_checkBoxComments = new wxCheckBox( this, wxID_ANY, _("Show comments and drawings Layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxComments, 0, wxALL, 5 );
m_bitmapECO = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_bitmapECO, 0, wxALL, 5 );
m_checkBoxECO = new wxCheckBox( this, wxID_ANY, _("Show ECOs layers"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizeShowOpts->Add( m_checkBoxECO, 0, wxALL, 5 );
bSizerLeft->Add( fgSizeShowOpts, 1, wxEXPAND, 5 );
wxBoxSizer* bSizerRight;
bSizerRight = new wxBoxSizer( wxVERTICAL );
m_buttonShowAll = new wxButton( this, wxID_ANY, _("Show All"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerRight->Add( m_buttonShowAll, 0, wxALL, 5 );
m_buttonShowNone = new wxButton( this, wxID_ANY, _("Show None"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerRight->Add( m_buttonShowNone, 0, wxALL, 5 );
bSizerLeft->Add( bSizerRight, 0, wxALIGN_CENTER_VERTICAL, 5 );
bSizerMain->Add( bSizerLeft, 1, wxEXPAND, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerMain->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK );
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
bSizerMain->Add( m_sdbSizer, 0, wxALIGN_RIGHT, 5 );
this->SetSizer( bSizerMain );
this->Layout();
this->Centre( wxBOTH );
// Connect Events
m_buttonShowAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnShowAllClick ), NULL, this );
m_buttonShowNone->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnShowNoneClick ), NULL, this );
m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnCancelClick ), NULL, this );
m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnOKClick ), NULL, this );
}
DIALOG_3D_VIEW_OPTIONS_BASE::~DIALOG_3D_VIEW_OPTIONS_BASE()
{
// Disconnect Events
m_buttonShowAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnShowAllClick ), NULL, this );
m_buttonShowNone->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnShowNoneClick ), NULL, this );
m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnCancelClick ), NULL, this );
m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnOKClick ), NULL, this );
}
This source diff could not be displayed because it is too large. You can view the blob instead.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_3D_VIEW_OPTION_BASE_H__
#define __DIALOG_3D_VIEW_OPTION_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
#include "dialog_shim.h"
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/statbmp.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/checkbox.h>
#include <wx/sizer.h>
#include <wx/button.h>
#include <wx/statline.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_3D_VIEW_OPTIONS_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_3D_VIEW_OPTIONS_BASE : public DIALOG_SHIM
{
private:
protected:
wxStaticBitmap* m_bitmapCuThickness;
wxCheckBox* m_checkBoxCuThickness;
wxStaticBitmap* m_bitmap3Dshapes;
wxCheckBox* m_checkBox3Dshapes;
wxStaticBitmap* m_bitmapAreas;
wxCheckBox* m_checkBoxAreas;
wxStaticBitmap* m_bitmapSilkscreen;
wxCheckBox* m_checkBoxSilkscreen;
wxStaticBitmap* m_bitmapSolderMask;
wxCheckBox* m_checkBoxSolderMask;
wxStaticBitmap* m_bitmapSolderPaste;
wxCheckBox* m_checkBoxSolderpaste;
wxStaticBitmap* m_bitmapAdhesive;
wxCheckBox* m_checkBoxAdhesive;
wxStaticBitmap* m_bitmapComments;
wxCheckBox* m_checkBoxComments;
wxStaticBitmap* m_bitmapECO;
wxCheckBox* m_checkBoxECO;
wxButton* m_buttonShowAll;
wxButton* m_buttonShowNone;
wxStaticLine* m_staticline1;
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnShowAllClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnShowNoneClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOKClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("3D Display Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 340,344 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_3D_VIEW_OPTIONS_BASE();
};
#endif //__DIALOG_3D_VIEW_OPTION_BASE_H__
...@@ -39,9 +39,9 @@ ...@@ -39,9 +39,9 @@
// Thickness of copper // Thickness of copper
// TODO: define the actual copper thickness by user // TODO: define the actual copper thickness by user
#define COPPER_THICKNESS (int)(0.035 * IU_PER_MM) // for 35 u #define COPPER_THICKNESS KiROUND( 0.035 * IU_PER_MM ) // for 35 µm
#define TECH_LAYER_THICKNESS (int)(0.04 * IU_PER_MM) #define TECH_LAYER_THICKNESS KiROUND( 0.04 * IU_PER_MM )
#define EPOXY_THICKNESS (int)(1.6 * IU_PER_MM) // for 1.6 mm #define EPOXY_THICKNESS KiROUND( 1.6 * IU_PER_MM ) // for 1.6 mm
/* INFO3D_VISU in an helper class to store parameters like scaling factors, /* INFO3D_VISU in an helper class to store parameters like scaling factors,
......
...@@ -68,7 +68,8 @@ class INFO3D_VISU ...@@ -68,7 +68,8 @@ class INFO3D_VISU
public: public:
enum DISPLAY3D_FLG { enum DISPLAY3D_FLG {
FL_AXIS=0, FL_MODULE, FL_ZONE, FL_AXIS=0, FL_MODULE, FL_ZONE,
FL_COMMENTS, FL_DRAWINGS, FL_ECO1, FL_ECO2, FL_ADHESIVE, FL_SILKSCREEN, FL_SOLDERMASK, FL_SOLDERPASTE,
FL_COMMENTS, FL_ECO,
FL_GRID, FL_GRID,
FL_USE_COPPER_THICKNESS, FL_USE_COPPER_THICKNESS,
FL_LAST FL_LAST
...@@ -123,7 +124,7 @@ public: INFO3D_VISU(); ...@@ -123,7 +124,7 @@ public: INFO3D_VISU();
*/ */
int GetLayerZcoordBIU( int aLayerId ) int GetLayerZcoordBIU( int aLayerId )
{ {
return (int) (m_LayerZcoord[aLayerId] / m_BiuTo3Dunits ); return KiROUND( m_LayerZcoord[aLayerId] / m_BiuTo3Dunits );
} }
/** /**
...@@ -137,7 +138,7 @@ public: INFO3D_VISU(); ...@@ -137,7 +138,7 @@ public: INFO3D_VISU();
int GetCopperThicknessBIU() const int GetCopperThicknessBIU() const
{ {
return m_DrawFlags[FL_USE_COPPER_THICKNESS] ? return m_DrawFlags[FL_USE_COPPER_THICKNESS] ?
(int) (m_CopperThickness / m_BiuTo3Dunits ) KiROUND( m_CopperThickness / m_BiuTo3Dunits )
: 0; : 0;
} }
...@@ -147,7 +148,7 @@ public: INFO3D_VISU(); ...@@ -147,7 +148,7 @@ public: INFO3D_VISU();
*/ */
int GetEpoxyThicknessBIU() const int GetEpoxyThicknessBIU() const
{ {
return (int) (m_EpoxyThickness / m_BiuTo3Dunits ); return KiROUND( m_EpoxyThickness / m_BiuTo3Dunits );
} }
/** /**
...@@ -160,7 +161,7 @@ public: INFO3D_VISU(); ...@@ -160,7 +161,7 @@ public: INFO3D_VISU();
int GetNonCopperLayerThicknessBIU() const int GetNonCopperLayerThicknessBIU() const
{ {
return m_DrawFlags[FL_USE_COPPER_THICKNESS] ? return m_DrawFlags[FL_USE_COPPER_THICKNESS] ?
(int) (m_NonCopperLayerThickness / m_BiuTo3Dunits ) KiROUND( m_NonCopperLayerThickness / m_BiuTo3Dunits )
: 0; : 0;
} }
......
project(kicad) project(kicad)
# The minimum CMake version requirement could be different under unix, OSX, or Windows cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
if(WIN32) # because of http://public.kitware.com/Bug/view.php?id=10395
cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR) # win32 and win64
elseif(APPLE)
cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR) # OSX
else()
cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR) # Linux, Unix, and everything else.
endif()
# Path to local CMake modules. # Path to local CMake modules.
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
...@@ -251,6 +245,12 @@ mark_as_advanced(KICAD_BIN ...@@ -251,6 +245,12 @@ mark_as_advanced(KICAD_BIN
include(Functions) include(Functions)
include( ExternalProject )
# All CMake downloads go here, up in the source tree, not in the build dir where they
# would have to be downloaded over and over again.
set( DOWNLOAD_DIR ${PROJECT_SOURCE_DIR}/downloads-by-cmake )
#================================================ #================================================
# Find libraries that are needed to build KiCad. # Find libraries that are needed to build KiCad.
#================================================ #================================================
...@@ -279,14 +279,11 @@ find_package(Cairo 1.8.1 QUIET) ...@@ -279,14 +279,11 @@ find_package(Cairo 1.8.1 QUIET)
check_find_package_result(CAIRO_FOUND "Cairo") check_find_package_result(CAIRO_FOUND "Cairo")
endif(KICAD_GAL) endif(KICAD_GAL)
###################### ##########################
# Find Boost library # # Download Boost library #
###################### ##########################
# kicad now includes needed boost files. include( download_boost )
# the two next lines can be uncommented to use the native boost lib.
# but this is not a good idea
#find_package(Boost 1.36 QUIET)
#check_find_package_result(Boost_FOUND "Boost")
########################## ##########################
# Find wxWidgets library # # Find wxWidgets library #
...@@ -381,9 +378,9 @@ set(INC_AFTER ...@@ -381,9 +378,9 @@ set(INC_AFTER
# 'CMakeLists.txt' files to process # 'CMakeLists.txt' files to process
#================================================ #================================================
############ ############################
# Binaries # # Binaries (CMake targets) #
############ ############################
add_subdirectory(bitmaps_png) add_subdirectory(bitmaps_png)
add_subdirectory(common) add_subdirectory(common)
...@@ -402,6 +399,18 @@ add_subdirectory(tools) ...@@ -402,6 +399,18 @@ add_subdirectory(tools)
#add_subdirectory(new) #add_subdirectory(new)
# Make all libs and executables depend on ExternalProject_Add( boost ),
# except perhaps bitmap lib
add_dependencies( pcbnew boost )
add_dependencies( eeschema boost )
add_dependencies( cvpcb boost )
add_dependencies( common boost )
add_dependencies( pcbcommon boost )
add_dependencies( 3d-viewer boost )
add_dependencies( pcad2kicadpcb boost )
add_dependencies( polygon boost )
############# #############
# Resources # # Resources #
############# #############
......
...@@ -23,7 +23,10 @@ ...@@ -23,7 +23,10 @@
# Function make_lexer # Function make_lexer
# is a standard way to invoke TokenList2DsnLexer.cmake # is a standard way to invoke TokenList2DsnLexer.cmake.
# Extra arguments are treated as source files which depend on the generated
# outHeaderFile
function( make_lexer inputFile outHeaderFile outCppFile enum ) function( make_lexer inputFile outHeaderFile outCppFile enum )
add_custom_command( add_custom_command(
OUTPUT ${outHeaderFile} OUTPUT ${outHeaderFile}
...@@ -41,5 +44,14 @@ function( make_lexer inputFile outHeaderFile outCppFile enum ) ...@@ -41,5 +44,14 @@ function( make_lexer inputFile outHeaderFile outCppFile enum )
${outCppFile} from ${outCppFile} from
${inputFile}" ${inputFile}"
) )
# extra_args, if any, are treated as source files (typically headers) which
# are known to depend on the generated outHeader.
foreach( extra_arg ${ARGN} )
set_source_files_properties( ${extra_arg}
PROPERTIES OBJECT_DEPENDS ${outHeaderFile}
)
endforeach()
endfunction() endfunction()
# This program source code file is part of KICAD, a free EDA CAD application.
#
# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
# Copyright (C) 2013 Kicad Developers, see AUTHORS.txt for contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, you may find one here:
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# or you may search the http://www.gnu.org website for the version 2 license,
# or you may write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
# Download and patch boost headers to a particular version.
# Assumes include( ExternalProject ) was done inline previous to this file.
set( BOOST_RELEASE 1.53.0 )
set( BOOST_MD5 a00d22605d5dbcfb4c9936a9b35bc4c2 ) # re-calc this on every RELEASE change
string( REGEX REPLACE "\\." "_" BOOST_VERS "${BOOST_RELEASE}" )
set( PREFIX ${DOWNLOAD_DIR}/boost_${BOOST_VERS} )
# <SOURCE_DIR> = ${PREFIX}/src/boost
# There is a Bazaar 'boost scratch repo' in <SOURCE_DIR>/boost and after committing pristine
# download, the patch is applied. This lets you regenerate a new patch at any time
# easily, simply by editing the working tree in <SOURCE_DIR> and doing "bzr diff" in there.
# include only the headers in the repo.
# repo = "${headers}/../.bzr" = "<SOURCE_DIR>/.bzr"
set( headers ${PREFIX}/src/boost/boost )
ExternalProject_Add( boost
PREFIX ${PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL http://downloads.sourceforge.net/project/boost/boost/${BOOST_RELEASE}/boost_${BOOST_VERS}.tar.bz2
URL_MD5 ${BOOST_MD5}
# The patch command executes with the working directory set to <SOURCE_DIR>
PATCH_COMMAND bzr patch -p0 ${PROJECT_SOURCE_DIR}/patches/boost.patch
CONFIGURE_COMMAND ""
# remove then re-copy into the include/boost directory during next two steps:
BUILD_COMMAND ${CMAKE_COMMAND} -E remove_directory ${PROJECT_SOURCE_DIR}/include/boost
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${headers} ${PROJECT_SOURCE_DIR}/include/boost
)
ExternalProject_Add_Step( boost bzr_commit_boost
COMMAND bzr ci -q -m pristine <SOURCE_DIR>
COMMENT "committing pristine boost files to 'boost scratch repo'"
DEPENDERS patch
)
ExternalProject_Add_Step( boost bzr_add_boost
# add only the headers to the scratch repo, repo = "../.bzr" from ${headers}
COMMAND bzr add -q ${headers}
COMMENT "adding pristine boost files to 'boost scratch repo'"
DEPENDERS bzr_commit_boost
)
ExternalProject_Add_Step( boost bzr_init_boost
COMMAND bzr init -q <SOURCE_DIR>
COMMENT "creating 'boost scratch repo' specifically for boost to track boost patches"
DEPENDERS bzr_add_boost
DEPENDEES download
)
This diff is collapsed.
Here is the proposed copyright message to be added to all source files
at their top. There is one line that represents the main copyright holder.
But in the future, the respective author of any newly coded module would be
listed as the main copyright holder. Additional workers who might earn a
partial copyright holder status of the respective module are simply left in the
change_log.txt file, see the 2nd Copyright line below.
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 1992-2010 <Creator>
* Copyright (C) 1992-2010 Kicad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
...@@ -359,6 +359,7 @@ set( BMAPS_MID ...@@ -359,6 +359,7 @@ set( BMAPS_MID
module_full_list module_full_list
module_options module_options
module_pin_filtered_list module_pin_filtered_list
module_library_list
module_ratsnest module_ratsnest
module module
modview_icon modview_icon
...@@ -752,4 +753,3 @@ endforeach() ...@@ -752,4 +753,3 @@ endforeach()
#add_library( bitmaps SHARED ${CPP_LIST} ) #add_library( bitmaps SHARED ${CPP_LIST} )
add_library( bitmaps STATIC ${CPP_LIST} ) add_library( bitmaps STATIC ${CPP_LIST} )
/* Do not modify this file, it was automatically generated by the
* PNG2cpp CMake script, using a *.png file as input.
*/
#include <bitmaps.h>
static const unsigned char png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
0xce, 0x00, 0x00, 0x00, 0x04, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08, 0x08, 0x7c, 0x08, 0x64,
0x88, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0d, 0xd7, 0x00, 0x00, 0x0d,
0xd7, 0x01, 0x42, 0x28, 0x9b, 0x78, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6f,
0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x6e, 0x6b, 0x73, 0x63,
0x61, 0x70, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x9b, 0xee, 0x3c, 0x1a, 0x00, 0x00, 0x03, 0xd2, 0x49,
0x44, 0x41, 0x54, 0x48, 0x89, 0xbd, 0x96, 0x5d, 0x48, 0x5b, 0x67, 0x18, 0xc7, 0x7f, 0xe7, 0x23,
0x59, 0xac, 0x4e, 0x4f, 0xac, 0x46, 0x11, 0xa9, 0xab, 0x8d, 0xd2, 0xb1, 0xd1, 0x3b, 0xc7, 0x7a,
0xb1, 0x3a, 0xb5, 0x89, 0x66, 0xcd, 0x56, 0x99, 0x05, 0xe9, 0x10, 0xec, 0xcd, 0xae, 0xa4, 0x20,
0x82, 0xd7, 0xcd, 0x95, 0x17, 0xdd, 0xc5, 0x7a, 0xd1, 0x1b, 0x19, 0x42, 0x07, 0x19, 0x63, 0x5e,
0x18, 0xd3, 0xe9, 0x9c, 0x69, 0xbb, 0xd4, 0x8e, 0xa2, 0xb8, 0x0d, 0xc3, 0xb4, 0x91, 0x96, 0x39,
0x1b, 0x2b, 0x82, 0x2c, 0xad, 0xd6, 0x99, 0x35, 0xc6, 0xe4, 0x9c, 0x5d, 0xd8, 0x9c, 0x26, 0x26,
0xa9, 0x1f, 0x17, 0xfd, 0x43, 0xe0, 0x7d, 0xce, 0xef, 0x79, 0xde, 0x7f, 0xde, 0xf7, 0x9c, 0xf3,
0xbc, 0x47, 0xd0, 0x34, 0x8d, 0x37, 0x21, 0x39, 0x35, 0xf8, 0xdc, 0x69, 0x7f, 0xb4, 0xa5, 0x8a,
0xc7, 0x93, 0xb1, 0x41, 0x50, 0x57, 0x86, 0x47, 0x7d, 0x55, 0x00, 0x6d, 0x4e, 0xdb, 0x6c, 0x4c,
0x15, 0xad, 0x3a, 0x13, 0xb5, 0x27, 0x43, 0x23, 0xbe, 0x5a, 0x80, 0xd6, 0x73, 0xf6, 0xd0, 0xb6,
0x26, 0x56, 0x64, 0xab, 0xcb, 0x6a, 0xb4, 0xa5, 0x8a, 0xc7, 0x07, 0xdf, 0xbf, 0x23, 0x1b, 0x04,
0x15, 0x80, 0xf3, 0x7f, 0xda, 0x8f, 0x25, 0x59, 0x54, 0x95, 0x4e, 0xba, 0xdf, 0xf3, 0xcb, 0x46,
0x61, 0x67, 0x07, 0x2e, 0xcc, 0x36, 0xd5, 0xbc, 0xaa, 0x93, 0x8e, 0x79, 0x4f, 0xf9, 0xf4, 0x79,
0x52, 0xeb, 0xb2, 0x1a, 0x01, 0xdc, 0x5e, 0x7f, 0x87, 0xe1, 0x35, 0x2b, 0x9f, 0x16, 0xff, 0x9d,
0xb1, 0xfc, 0x89, 0x8d, 0x2a, 0xbc, 0xcf, 0x4e, 0x70, 0xbe, 0xf8, 0xaf, 0x0c, 0x36, 0xb2, 0x6e,
0x65, 0xe8, 0x9f, 0x13, 0xb4, 0x96, 0x64, 0xd6, 0x01, 0x08, 0x9a, 0xa6, 0xd1, 0xd6, 0xd6, 0x36,
0x1b, 0x8d, 0x46, 0x4f, 0xa2, 0x25, 0xe4, 0xd2, 0x23, 0x22, 0x8d, 0x36, 0x07, 0x23, 0x63, 0x63,
0xfc, 0xbb, 0xa5, 0x21, 0x8a, 0x62, 0x1c, 0x00, 0x2d, 0x21, 0x2b, 0x26, 0x11, 0x9b, 0xad, 0x99,
0x5b, 0xb7, 0xc6, 0x79, 0xf6, 0xe2, 0x15, 0x53, 0x55, 0x55, 0x3e, 0x7a, 0x44, 0xa0, 0xb1, 0xc9,
0xce, 0x9d, 0xdb, 0x3e, 0x9d, 0xc9, 0xb2, 0x1c, 0xde, 0xd8, 0xd8, 0x38, 0xee, 0xf7, 0xfb, 0xa3,
0x22, 0x40, 0x2c, 0x16, 0xb3, 0xba, 0xdd, 0x6e, 0x59, 0x12, 0x25, 0xda, 0x4b, 0xe6, 0xb9, 0xff,
0xcb, 0x28, 0x9d, 0xe5, 0x8f, 0x00, 0xf0, 0x78, 0x3c, 0xb2, 0xc7, 0xe3, 0x91, 0x25, 0x51, 0xe2,
0x62, 0xe9, 0x43, 0x26, 0xef, 0x8e, 0xf1, 0x85, 0xe5, 0x61, 0x1a, 0x03, 0xb8, 0x64, 0x79, 0xc0,
0xcc, 0xaf, 0x63, 0x74, 0x5a, 0x82, 0x3a, 0x03, 0xcc, 0x8a, 0xa2, 0x98, 0xd2, 0xb6, 0xce, 0x68,
0x34, 0x02, 0xd0, 0x54, 0xb4, 0x84, 0xc3, 0xfc, 0x18, 0x80, 0xeb, 0xa1, 0x1a, 0xfd, 0x3a, 0x80,
0x5d, 0x79, 0x8c, 0xf3, 0xe5, 0x96, 0x5e, 0x0f, 0xd5, 0xa6, 0xb1, 0xb3, 0xca, 0x12, 0x67, 0x95,
0x25, 0x00, 0xbe, 0x0e, 0xbd, 0x9b, 0xc6, 0x32, 0xee, 0x51, 0x69, 0x71, 0x11, 0x17, 0x1e, 0x34,
0xeb, 0x71, 0x89, 0x52, 0xb0, 0x2f, 0x56, 0xa2, 0xbc, 0xcd, 0x67, 0xb3, 0x8e, 0xac, 0x6c, 0xb7,
0x91, 0x10, 0x0c, 0x06, 0xf9, 0xe6, 0x86, 0x9b, 0x78, 0x3c, 0xae, 0x43, 0x49, 0x92, 0xf4, 0xf1,
0xeb, 0xd8, 0x0d, 0xf7, 0xf7, 0x24, 0x12, 0x89, 0xac, 0x2c, 0x29, 0x11, 0x40, 0xd3, 0x34, 0xa1,
0xbf, 0xbf, 0x9f, 0x81, 0x81, 0x01, 0x8c, 0x46, 0xa3, 0xfe, 0x4b, 0x2d, 0x10, 0x45, 0x31, 0x27,
0x93, 0x24, 0x29, 0x27, 0x4b, 0x5b, 0x91, 0x20, 0x08, 0xaa, 0xcb, 0xe5, 0xa2, 0xab, 0xab, 0x8b,
0x8e, 0x8e, 0x0e, 0xf2, 0xf2, 0xf2, 0x32, 0x12, 0x77, 0xab, 0xbb, 0xbb, 0x9b, 0xb9, 0xb9, 0xb9,
0xd7, 0xe6, 0x6c, 0x6f, 0x6f, 0xbf, 0x05, 0xdc, 0x04, 0xce, 0xe8, 0xf7, 0x68, 0x7a, 0x7a, 0x9a,
0x8a, 0x8a, 0x0a, 0x4c, 0x26, 0xd3, 0x9e, 0x26, 0xb1, 0x58, 0x8c, 0x99, 0x99, 0x19, 0x7a, 0x7b,
0x7b, 0xa9, 0xab, 0xab, 0xcb, 0x99, 0x17, 0x08, 0x04, 0xe8, 0xeb, 0xeb, 0xfb, 0xa8, 0xa1, 0xa1,
0xc1, 0x24, 0x03, 0xa8, 0xaa, 0x2a, 0x4d, 0x4e, 0x4e, 0xd2, 0xd3, 0xd3, 0x83, 0x20, 0x08, 0x7b,
0x1a, 0x25, 0xa5, 0x28, 0x0a, 0x65, 0x65, 0x65, 0x39, 0xb9, 0xd9, 0x6c, 0xd6, 0xc7, 0x32, 0x80,
0x28, 0x8a, 0x09, 0x97, 0xcb, 0x65, 0xc8, 0xcf, 0xcf, 0xdf, 0xb7, 0x49, 0xaa, 0xae, 0xde, 0xbf,
0x4a, 0x9e, 0x21, 0x8f, 0xcb, 0x1f, 0x5c, 0xce, 0x99, 0x93, 0xf6, 0x78, 0x7f, 0x79, 0xa9, 0x83,
0xe5, 0xd5, 0xa7, 0x7a, 0x6c, 0x29, 0x2e, 0xe4, 0xdb, 0xef, 0x7e, 0xd0, 0xd9, 0x6a, 0x78, 0x2d,
0xeb, 0x24, 0x43, 0xf3, 0x43, 0x28, 0x26, 0x65, 0xff, 0x46, 0xab, 0xe1, 0x35, 0xbc, 0xa7, 0x7c,
0x18, 0xc5, 0x9d, 0xa6, 0xea, 0x08, 0xb4, 0xe8, 0x6c, 0x79, 0xf5, 0x29, 0xc9, 0xc6, 0x19, 0x49,
0xc8, 0xb4, 0xfe, 0xf6, 0x61, 0xce, 0x49, 0xf7, 0x34, 0x02, 0xf0, 0xae, 0xd5, 0xe0, 0x0d, 0x57,
0x67, 0x6d, 0x8e, 0x37, 0xd7, 0x6a, 0x18, 0x0e, 0x57, 0xe3, 0x3c, 0xba, 0x78, 0x20, 0x13, 0xdd,
0xc8, 0x60, 0x30, 0xac, 0xb4, 0xb7, 0xb7, 0x57, 0x69, 0x6a, 0x42, 0xf2, 0x86, 0xab, 0xb1, 0x35,
0xb7, 0xe0, 0x19, 0xff, 0x19, 0xd0, 0x70, 0x3a, 0x9d, 0xc9, 0x37, 0x51, 0xf2, 0x84, 0xab, 0xb1,
0xd9, 0x9a, 0xf9, 0xd1, 0x37, 0x0e, 0x44, 0x0e, 0x64, 0x24, 0x02, 0xc8, 0xb2, 0x5c, 0x1b, 0x89,
0x44, 0x0a, 0x80, 0x78, 0x87, 0x25, 0xc8, 0xef, 0x77, 0x47, 0xf5, 0xe6, 0x18, 0x89, 0x44, 0x0a,
0x5e, 0x32, 0x3a, 0x2d, 0x41, 0xfe, 0xb8, 0xf7, 0x13, 0x17, 0x2d, 0xf3, 0x87, 0x5b, 0xd1, 0xe0,
0xe0, 0x60, 0x02, 0x48, 0x9c, 0xfb, 0xa4, 0x85, 0xc6, 0xa2, 0x27, 0xb4, 0x98, 0x43, 0xc0, 0x4e,
0x73, 0xf4, 0xfb, 0xfd, 0x51, 0x00, 0x87, 0xc3, 0x81, 0xdd, 0x1c, 0xc2, 0x6e, 0x0e, 0xb1, 0x19,
0x97, 0xf9, 0x8a, 0xf4, 0xb3, 0xed, 0xf9, 0xd6, 0x73, 0xa6, 0x96, 0xa7, 0x00, 0xa8, 0x2c, 0xac,
0xa4, 0xb2, 0xb0, 0x32, 0xd3, 0x28, 0x29, 0x83, 0xa0, 0xae, 0xa4, 0x9e, 0x8e, 0x46, 0x31, 0xb1,
0x9a, 0x3a, 0x76, 0x04, 0x5a, 0x52, 0x5e, 0x9a, 0xff, 0xd2, 0x26, 0x9a, 0x5a, 0x9e, 0xe2, 0xf4,
0xc0, 0x69, 0x00, 0xae, 0xd4, 0x5f, 0xc1, 0xf5, 0xb1, 0x2b, 0xb7, 0xd1, 0xee, 0x73, 0x3e, 0x55,
0xde, 0x51, 0x5f, 0x79, 0x72, 0xdc, 0xd0, 0xd0, 0x60, 0x02, 0x5e, 0x24, 0xe3, 0x6b, 0x2d, 0xd7,
0x58, 0x8f, 0xae, 0xeb, 0xb9, 0xd6, 0x62, 0x2b, 0xbb, 0x95, 0xf1, 0xd4, 0x1d, 0x44, 0x8b, 0x8b,
0x8b, 0x14, 0x14, 0x14, 0x60, 0xc2, 0x44, 0x39, 0xfa, 0xff, 0x60, 0x73, 0x73, 0x93, 0xc0, 0x52,
0x80, 0x85, 0x85, 0x05, 0xfd, 0x9a, 0x70, 0xd8, 0xcf, 0xad, 0xfa, 0xfa, 0x7a, 0x1f, 0x70, 0x66,
0x1f, 0xa9, 0xf7, 0x26, 0x26, 0x26, 0xec, 0x87, 0x36, 0x3a, 0xa8, 0xc4, 0x37, 0xe2, 0x02, 0xfc,
0x0f, 0xfd, 0x66, 0x6b, 0x49, 0xc9, 0xd5, 0xed, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
0x44, 0xae, 0x42, 0x60, 0x82
};
const BITMAP_OPAQUE module_library_list_xpm[1] = {{ png, sizeof( png ), "module_library_list_xpm" }};
//EOF
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="26"
width="26"
version="1.1"
viewBox="0 0 26 26"
id="svg2"
inkscape:version="0.48.4 r9939"
sodipodi:docname="module_filtered_list.svg">
<metadata
id="metadata56">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs54" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1015"
id="namedview52"
showgrid="true"
inkscape:zoom="13.906434"
inkscape:cx="19.918756"
inkscape:cy="24.624712"
inkscape:window-x="-4"
inkscape:window-y="-4"
inkscape:window-maximized="1"
inkscape:current-layer="svg2"
inkscape:snap-to-guides="false"
inkscape:snap-grids="false">
<inkscape:grid
type="xygrid"
id="grid3033"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<rect
transform="matrix(0,-1,1,0,0,0)"
height="21.994465"
width="12.99073"
y="1.5596062"
x="-17.520231"
id="rect8"
style="fill:#ffffff;stroke:#484848;stroke-width:0.99127513000000000;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
d="m 1.5927632,8.9410802 a 2.0341261,1.8090857 0 1 1 0.012585,3.6181538"
id="path10"
inkscape:connector-curvature="0"
style="fill:none;stroke:#484848;stroke-width:0.99127518999999997;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
transform="matrix(0,-1,1,0,0,0)"
height="3.9761357"
width="5.9874525"
y="3.5188339"
x="-20.502354"
id="rect30"
style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
d="m 5.5071146,16.522119 a 0.98526485,0.92342205 0 0 1 0,1.846844 0.98526485,0.92342205 0 1 1 0,-1.846844 z"
id="path32"
inkscape:connector-curvature="0"
style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
transform="matrix(0,-1,1,0,0,0)"
height="3.9761357"
width="5.9874525"
y="10.507601"
x="-20.513519"
id="rect30-5"
style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
d="m 12.495882,16.533284 a 0.98526485,0.92342205 0 0 1 0,1.846845 0.98526485,0.92342205 0 1 1 0,-1.846845 z"
id="path32-4"
inkscape:connector-curvature="0"
style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
transform="matrix(0,-1,1,0,0,0)"
height="3.9761357"
width="5.9874525"
y="17.499128"
x="-20.488094"
id="rect30-2"
style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
d="m 19.487408,16.507861 a 0.98526485,0.92342205 0 0 1 0,1.846844 0.98526485,0.92342205 0 1 1 0,-1.846844 z"
id="path32-0"
inkscape:connector-curvature="0"
style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
transform="matrix(0,-1,1,0,0,0)"
height="3.9761357"
width="5.9874525"
y="3.5339792"
x="-7.5303874"
id="rect30-1"
style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
d="m 5.5222603,3.5501532 a 0.98526485,0.92342205 0 0 1 0,1.8468441 0.98526485,0.92342205 0 1 1 0,-1.8468441 z"
id="path32-3"
inkscape:connector-curvature="0"
style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
transform="matrix(0,-1,1,0,0,0)"
height="3.9761357"
width="5.9874525"
y="10.522747"
x="-7.5415525"
id="rect30-5-6"
style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
d="m 12.511028,3.5613187 a 0.98526485,0.92342205 0 0 1 0,1.8468441 0.98526485,0.92342205 0 1 1 0,-1.8468441 z"
id="path32-4-0"
inkscape:connector-curvature="0"
style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
transform="matrix(0,-1,1,0,0,0)"
height="3.9761357"
width="5.9874525"
y="17.514275"
x="-7.516129"
id="rect30-2-8"
style="fill:#ff7800;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
d="m 19.502554,3.535895 a 0.98526485,0.92342205 0 0 1 0,1.8468441 0.98526485,0.92342205 0 1 1 0,-1.8468441 z"
id="path32-0-4"
inkscape:connector-curvature="0"
style="fill:#ffede0;stroke:#484848;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="0.95373797"
height="13.958503"
width="11.03963"
y="10.016949"
x="13.978938"
id="rect42"
style="fill:#3e3e3e" />
<rect
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="rect3003"
width="8.413372"
height="11.649284"
x="15.316651"
y="11.114803" />
<path
style="fill:none;stroke:#008000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
d="m 17.97729,13.415897 0,7.119007 3.523549,0"
id="path3005"
inkscape:connector-curvature="0" />
</svg>
...@@ -48,6 +48,12 @@ set(COMMON_ABOUT_DLG_SRCS ...@@ -48,6 +48,12 @@ set(COMMON_ABOUT_DLG_SRCS
dialogs/dialog_page_settings_base.cpp dialogs/dialog_page_settings_base.cpp
) )
if(KICAD_GOST)
set( TITLE_BLOCK_SHAPES title_block_shapes_gost )
else()
set( TITLE_BLOCK_SHAPES title_block_shapes )
endif()
set(COMMON_SRCS set(COMMON_SRCS
${COMMON_ABOUT_DLG_SRCS} ${COMMON_ABOUT_DLG_SRCS}
base_struct.cpp base_struct.cpp
...@@ -98,6 +104,7 @@ set(COMMON_SRCS ...@@ -98,6 +104,7 @@ set(COMMON_SRCS
richio.cpp richio.cpp
selcolor.cpp selcolor.cpp
string.cpp string.cpp
${TITLE_BLOCK_SHAPES}.cpp
trigo.cpp trigo.cpp
wildcards_and_files_ext.cpp wildcards_and_files_ext.cpp
worksheet.cpp worksheet.cpp
...@@ -147,9 +154,9 @@ set(PCB_COMMON_SRCS ...@@ -147,9 +154,9 @@ set(PCB_COMMON_SRCS
../pcbnew/class_zone_settings.cpp ../pcbnew/class_zone_settings.cpp
../pcbnew/classpcb.cpp ../pcbnew/classpcb.cpp
../pcbnew/collectors.cpp ../pcbnew/collectors.cpp
../pcbnew/netlist_reader_common.cpp ../pcbnew/netlist_reader.cpp
../pcbnew/netlist_reader_firstformat.cpp ../pcbnew/legacy_netlist_reader.cpp
../pcbnew/netlist_reader_kicad.cpp ../pcbnew/kicad_netlist_reader.cpp
../pcbnew/sel_layer.cpp ../pcbnew/sel_layer.cpp
../pcbnew/pcb_plot_params.cpp ../pcbnew/pcb_plot_params.cpp
../pcbnew/io_mgr.cpp ../pcbnew/io_mgr.cpp
...@@ -179,13 +186,15 @@ set_source_files_properties( ${PCB_COMMON_SRCS} PROPERTIES ...@@ -179,13 +186,15 @@ set_source_files_properties( ${PCB_COMMON_SRCS} PROPERTIES
add_library(pcbcommon STATIC ${PCB_COMMON_SRCS}) add_library(pcbcommon STATIC ${PCB_COMMON_SRCS})
# auto-generate netlist_lexer.h and netlist_keywords.cpp # auto-generate netlist_lexer.h and netlist_keywords.cpp
make_lexer( make_lexer(
${CMAKE_CURRENT_SOURCE_DIR}/netlist.keywords ${CMAKE_CURRENT_SOURCE_DIR}/netlist.keywords
${PROJECT_SOURCE_DIR}/include/netlist_lexer.h ${PROJECT_SOURCE_DIR}/include/netlist_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/netlist_keywords.cpp ${CMAKE_CURRENT_SOURCE_DIR}/netlist_keywords.cpp
NL_T NL_T
# Pass header file with dependency on *_lexer.h as extra_arg
${CMAKE_PROJECT_SOURCE_DIR}/pcbnew/netlist_reader.h
) )
# auto-generate pcb_plot_params_lexer.h and pcb_plot_params_keywords.cpp # auto-generate pcb_plot_params_lexer.h and pcb_plot_params_keywords.cpp
...@@ -194,17 +203,25 @@ make_lexer( ...@@ -194,17 +203,25 @@ make_lexer(
${PROJECT_SOURCE_DIR}/include/pcb_plot_params_lexer.h ${PROJECT_SOURCE_DIR}/include/pcb_plot_params_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params_keywords.cpp ${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params_keywords.cpp
PCBPLOTPARAMS_T PCBPLOTPARAMS_T
# Pass header file with dependency on *_lexer.h as extra_arg
${PROJECT_SOURCE_DIR}/pcbnew/pcb_plot_params.h
) )
# auto-generate pcbnew_sexpr.h and pcbnew_sexpr.cpp # auto-generate pcbnew_sexpr.h and pcbnew_sexpr.cpp
make_lexer( ${CMAKE_CURRENT_SOURCE_DIR}/pcb.keywords make_lexer(
${CMAKE_CURRENT_SOURCE_DIR}/pcb.keywords
${PROJECT_SOURCE_DIR}/include/pcb_lexer.h ${PROJECT_SOURCE_DIR}/include/pcb_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/pcb_keywords.cpp ${CMAKE_CURRENT_SOURCE_DIR}/pcb_keywords.cpp
PCB_KEYS_T PCB_KEYS_T
# Pass header file with dependency on *_lexer.h as extra_arg
${PROJECT_SOURCE_DIR}/pcbnew/pcb_parser.h
) )
# auto-generate pcbnew s-expression footprint library table code. # auto-generate pcbnew s-expression footprint library table code.
make_lexer( ${CMAKE_CURRENT_SOURCE_DIR}/fp_lib_table.keywords make_lexer(
${CMAKE_CURRENT_SOURCE_DIR}/fp_lib_table.keywords
${PROJECT_SOURCE_DIR}/include/fp_lib_table_lexer.h ${PROJECT_SOURCE_DIR}/include/fp_lib_table_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/fp_lib_table_keywords.cpp ${CMAKE_CURRENT_SOURCE_DIR}/fp_lib_table_keywords.cpp
FP_LIB_TABLE_T FP_LIB_TABLE_T
......
...@@ -67,7 +67,7 @@ int LAYER_BOX_SELECTOR::GetChoice() ...@@ -67,7 +67,7 @@ int LAYER_BOX_SELECTOR::GetChoice()
// Get Current Layer // Get Current Layer
LAYER_NUM LAYER_BOX_SELECTOR::GetLayerSelection() const LAYER_NUM LAYER_BOX_SELECTOR::GetLayerSelection() const
{ {
return (LAYER_NUM)((unsigned long) GetClientData( GetSelection() ) ); return (LAYER_NUM)(intptr_t) GetClientData( GetSelection() );
} }
......
...@@ -62,7 +62,8 @@ const wxString PAGE_INFO::Custom( wxT( "User" ) ); ...@@ -62,7 +62,8 @@ const wxString PAGE_INFO::Custom( wxT( "User" ) );
// local readability macro for millimeter wxSize // local readability macro for millimeter wxSize
#define MMsize( x, y ) wxSize( Mm2mils( x ), Mm2mils( y ) ) #define MMsize( x, y ) wxSize( Mm2mils( x ), Mm2mils( y ) )
// All MUST be defined as landscape. If IsGOST() is true, A4 is dynamically rotated later. // All MUST be defined as landscape.
// If IsGOST() is true, A4 is dynamically rotated later.
const PAGE_INFO PAGE_INFO::pageA4( MMsize( 297, 210 ), wxT( "A4" ), wxPAPER_A4 ); const PAGE_INFO PAGE_INFO::pageA4( MMsize( 297, 210 ), wxT( "A4" ), wxPAPER_A4 );
const PAGE_INFO PAGE_INFO::pageA3( MMsize( 420, 297 ), wxT( "A3" ), wxPAPER_A3 ); const PAGE_INFO PAGE_INFO::pageA3( MMsize( 420, 297 ), wxT( "A3" ), wxPAPER_A3 );
const PAGE_INFO PAGE_INFO::pageA2( MMsize( 594, 420 ), wxT( "A2" ), wxPAPER_A2 ); const PAGE_INFO PAGE_INFO::pageA2( MMsize( 594, 420 ), wxT( "A2" ), wxPAPER_A2 );
...@@ -139,7 +140,7 @@ void PAGE_INFO::setMargins() ...@@ -139,7 +140,7 @@ void PAGE_INFO::setMargins()
m_left_margin = m_left_margin =
m_right_margin = m_right_margin =
m_top_margin = m_top_margin =
m_bottom_margin = 400; // Units = mils m_bottom_margin = Mm2mils( 10 );
} }
} }
...@@ -327,8 +328,8 @@ void PAGE_INFO::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aContro ...@@ -327,8 +328,8 @@ void PAGE_INFO::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aContro
// Internally, the page size is in mils // Internally, the page size is in mils
if( GetType() == PAGE_INFO::Custom ) if( GetType() == PAGE_INFO::Custom )
aFormatter->Print( 0, " %g %g", aFormatter->Print( 0, " %g %g",
GetCustomWidthMils() * 25.4 / 1000.0, GetWidthMils() * 25.4 / 1000.0,
GetCustomHeightMils() * 25.4 / 1000.0 ); GetHeightMils() * 25.4 / 1000.0 );
if( !IsCustom() && IsPortrait() ) if( !IsCustom() && IsPortrait() )
aFormatter->Print( 0, " portrait" ); aFormatter->Print( 0, " portrait" );
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <base_struct.h> #include <base_struct.h>
#include <common.h> #include <common.h>
#include <plot_common.h> #include <plot_common.h>
#include <worksheet.h>
#include <macros.h> #include <macros.h>
#include <class_base_screen.h> #include <class_base_screen.h>
#include <drawtxt.h> #include <drawtxt.h>
...@@ -111,33 +110,29 @@ double PLOTTER::userToDeviceSize( double size ) ...@@ -111,33 +110,29 @@ double PLOTTER::userToDeviceSize( double size )
/** /**
* Generic fallback: arc rendered as a polyline * Generic fallback: arc rendered as a polyline
*/ */
void PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int radius, void PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int radius,
FILL_T fill, int width ) FILL_T fill, int width )
{ {
wxPoint start, end; wxPoint start, end;
const int delta = 50; // increment (in 0.1 degrees) to draw circles const int delta = 50; // increment (in 0.1 degrees) to draw circles
double alpha;
if( StAngle > EndAngle ) if( StAngle > EndAngle )
EXCHG( StAngle, EndAngle ); EXCHG( StAngle, EndAngle );
SetCurrentLineWidth( width ); SetCurrentLineWidth( width );
/* Please NOTE the different sign due to Y-axis flip */ /* Please NOTE the different sign due to Y-axis flip */
alpha = DEG2RAD( StAngle / 10.0 ); start.x = centre.x + KiROUND( cosdecideg( radius, -StAngle ) );
start.x = centre.x + (int) ( radius * cos( -alpha ) ); start.y = centre.y + KiROUND( sindecideg( radius, -StAngle ) );
start.y = centre.y + (int) ( radius * sin( -alpha ) );
MoveTo( start ); MoveTo( start );
for( int ii = StAngle + delta; ii < EndAngle; ii += delta ) for( int ii = StAngle + delta; ii < EndAngle; ii += delta )
{ {
alpha = DEG2RAD( ii / 10.0 ); end.x = centre.x + KiROUND( cosdecideg( radius, -ii ) );
end.x = centre.x + (int) ( radius * cos( -alpha ) ); end.y = centre.y + KiROUND( sindecideg( radius, -ii ) );
end.y = centre.y + (int) ( radius * sin( -alpha ) );
LineTo( end ); LineTo( end );
} }
alpha = DEG2RAD( EndAngle / 10.0 ); end.x = centre.x + KiROUND( cosdecideg( radius, -EndAngle ) );
end.x = centre.x + (int) ( radius * cos( -alpha ) ); end.y = centre.y + KiROUND( sindecideg( radius, -EndAngle ) );
end.y = centre.y + (int) ( radius * sin( -alpha ) );
FinishTo( end ); FinishTo( end );
} }
...@@ -380,24 +375,23 @@ void PLOTTER::segmentAsOval( const wxPoint& start, const wxPoint& end, int width ...@@ -380,24 +375,23 @@ void PLOTTER::segmentAsOval( const wxPoint& start, const wxPoint& end, int width
{ {
wxPoint center( (start.x + end.x) / 2, (start.y + end.y) / 2 ); wxPoint center( (start.x + end.x) / 2, (start.y + end.y) / 2 );
wxSize size( end.x - start.x, end.y - start.y ); wxSize size( end.x - start.x, end.y - start.y );
int orient; double orient;
if( size.y == 0 ) if( size.y == 0 )
orient = 0; orient = 0;
else if( size.x == 0 ) else if( size.x == 0 )
orient = 900; orient = 900;
else else
orient = -(int) ( RAD2DEG( atan2( (double)size.y, (double)size.x ) ) * 10.0 ); orient = -ArcTangente( size.y, size.x );
size.x = (int) sqrt( ( (double) size.x * size.x ) size.x = KiROUND( EuclideanNorm( size ) ) + width;
+ ( (double) size.y * size.y ) ) + width;
size.y = width; size.y = width;
FlashPadOval( center, size, orient, tracemode ); FlashPadOval( center, size, orient, tracemode );
} }
void PLOTTER::sketchOval( const wxPoint& pos, const wxSize& aSize, int orient, void PLOTTER::sketchOval( const wxPoint& pos, const wxSize& aSize, double orient,
int width ) int width )
{ {
SetCurrentLineWidth( width ); SetCurrentLineWidth( width );
...@@ -408,9 +402,7 @@ void PLOTTER::sketchOval( const wxPoint& pos, const wxSize& aSize, int orient, ...@@ -408,9 +402,7 @@ void PLOTTER::sketchOval( const wxPoint& pos, const wxSize& aSize, int orient,
if( size.x > size.y ) if( size.x > size.y )
{ {
EXCHG( size.x, size.y ); EXCHG( size.x, size.y );
orient += 900; orient = AddAngles( orient, 900 );
if( orient >= 3600 )
orient -= 3600;
} }
deltaxy = size.y - size.x; /* distance between centers of the oval */ deltaxy = size.y - size.x; /* distance between centers of the oval */
...@@ -470,8 +462,8 @@ void PLOTTER::ThickSegment( const wxPoint& start, const wxPoint& end, int width, ...@@ -470,8 +462,8 @@ void PLOTTER::ThickSegment( const wxPoint& start, const wxPoint& end, int width,
} }
void PLOTTER::ThickArc( const wxPoint& centre, int StAngle, int EndAngle, int radius, void PLOTTER::ThickArc( const wxPoint& centre, double StAngle, double EndAngle,
int width, EDA_DRAW_MODE_T tracemode ) int radius, int width, EDA_DRAW_MODE_T tracemode )
{ {
switch( tracemode ) switch( tracemode )
{ {
......
...@@ -48,22 +48,20 @@ ...@@ -48,22 +48,20 @@
* application class. * application class.
*/ */
wxString g_ProductName = wxT( "KiCad E.D.A. " );
bool g_ShowPageLimits = true; bool g_ShowPageLimits = true;
wxString g_UserLibDirBuffer; wxString g_UserLibDirBuffer;
EDA_UNITS_T g_UserUnit; EDA_UNITS_T g_UserUnit;
EDA_COLOR_T g_GhostColor; EDA_COLOR_T g_GhostColor;
#if defined(KICAD_GOST)
static const bool s_gost = true;
#else
static const bool s_gost = false;
#endif
bool IsGOST() bool IsGOST()
{ {
return s_gost; #if defined(KICAD_GOST)
return true;
#else
return false;
#endif
} }
...@@ -289,31 +287,6 @@ wxArrayString* wxStringSplit( wxString aString, wxChar aSplitter ) ...@@ -289,31 +287,6 @@ wxArrayString* wxStringSplit( wxString aString, wxChar aSplitter )
} }
/*
* Return the string date "day month year" like "23 jun 2005"
*/
wxString GenDate()
{
static const wxString mois[12] =
{
wxT( "jan" ), wxT( "feb" ), wxT( "mar" ), wxT( "apr" ), wxT( "may" ), wxT( "jun" ),
wxT( "jul" ), wxT( "aug" ), wxT( "sep" ), wxT( "oct" ), wxT( "nov" ), wxT( "dec" )
};
time_t buftime;
struct tm* Date;
wxString string_date;
time( &buftime );
Date = gmtime( &buftime );
string_date.Printf( wxT( "%d %s %d" ), Date->tm_mday,
GetChars( mois[Date->tm_mon] ),
Date->tm_year + 1900 );
return string_date;
}
int ProcessExecute( const wxString& aCommandLine, int aFlags, wxProcess *callback ) int ProcessExecute( const wxString& aCommandLine, int aFlags, wxProcess *callback )
{ {
return wxExecute( aCommandLine, aFlags, callback ); return wxExecute( aCommandLine, aFlags, callback );
...@@ -357,3 +330,15 @@ double RoundTo0( double x, double precision ) ...@@ -357,3 +330,15 @@ double RoundTo0( double x, double precision )
return (double) ix / precision; return (double) ix / precision;
} }
wxString FormatDateLong( const wxDateTime &aDate )
{
/* GetInfo was introduced only on wx 2.9; for portability reason an
* hardcoded format is used on wx 2.8 */
#if wxCHECK_VERSION( 2, 9, 0 )
return aDate.Format( wxLocale::GetInfo( wxLOCALE_LONG_DATE_FMT ) );
#else
return aDate.Format( wxT("%d %b %Y") );
#endif
}
...@@ -389,7 +389,7 @@ void DXF_PLOTTER::ThickSegment( const wxPoint& aStart, const wxPoint& aEnd, int ...@@ -389,7 +389,7 @@ void DXF_PLOTTER::ThickSegment( const wxPoint& aStart, const wxPoint& aEnd, int
/** Plot an arc in DXF format /** Plot an arc in DXF format
* Filling is not supported * Filling is not supported
*/ */
void DXF_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int radius, void DXF_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int radius,
FILL_T fill, int width ) FILL_T fill, int width )
{ {
wxASSERT( outputFile ); wxASSERT( outputFile );
...@@ -412,7 +412,7 @@ void DXF_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int rad ...@@ -412,7 +412,7 @@ void DXF_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int rad
/** /**
* DXF oval pad: always done in sketch mode * DXF oval pad: always done in sketch mode
*/ */
void DXF_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int orient, void DXF_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, double orient,
EDA_DRAW_MODE_T trace_mode ) EDA_DRAW_MODE_T trace_mode )
{ {
wxASSERT( outputFile ); wxASSERT( outputFile );
...@@ -423,9 +423,7 @@ void DXF_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int ori ...@@ -423,9 +423,7 @@ void DXF_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int ori
if( size.x > size.y ) if( size.x > size.y )
{ {
EXCHG( size.x, size.y ); EXCHG( size.x, size.y );
orient += 900; orient = AddAngles( orient, 900 );
if( orient >= 3600 )
orient -= 3600;
} }
sketchOval( pos, size, orient, -1 ); sketchOval( pos, size, orient, -1 );
} }
...@@ -447,7 +445,7 @@ void DXF_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre, ...@@ -447,7 +445,7 @@ void DXF_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre,
* DXF rectangular pad: alwayd done in sketch mode * DXF rectangular pad: alwayd done in sketch mode
*/ */
void DXF_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& padsize, void DXF_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& padsize,
int orient, EDA_DRAW_MODE_T trace_mode ) double orient, EDA_DRAW_MODE_T trace_mode )
{ {
wxASSERT( outputFile ); wxASSERT( outputFile );
wxSize size; wxSize size;
...@@ -515,7 +513,7 @@ void DXF_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& padsize, ...@@ -515,7 +513,7 @@ void DXF_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& padsize,
* DXF trapezoidal pad: only sketch mode is supported * DXF trapezoidal pad: only sketch mode is supported
*/ */
void DXF_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners, void DXF_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode ) double aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
{ {
wxASSERT( outputFile ); wxASSERT( outputFile );
wxPoint coord[4]; /* coord actual corners of a trapezoidal trace */ wxPoint coord[4]; /* coord actual corners of a trapezoidal trace */
...@@ -557,7 +555,7 @@ bool containsNonAsciiChars( const wxString& string ) ...@@ -557,7 +555,7 @@ bool containsNonAsciiChars( const wxString& string )
void DXF_PLOTTER::Text( const wxPoint& aPos, void DXF_PLOTTER::Text( const wxPoint& aPos,
enum EDA_COLOR_T aColor, enum EDA_COLOR_T aColor,
const wxString& aText, const wxString& aText,
int aOrient, double aOrient,
const wxSize& aSize, const wxSize& aSize,
enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_HJUSTIFY_T aH_justify,
enum EDA_TEXT_VJUSTIFY_T aV_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify,
......
...@@ -183,7 +183,7 @@ void GERBER_PLOTTER::selectAperture( const wxSize& size, ...@@ -183,7 +183,7 @@ void GERBER_PLOTTER::selectAperture( const wxSize& size,
|| ( currentAperture->Type != type ) || ( currentAperture->Type != type )
|| ( currentAperture->Size != size ) ) || ( currentAperture->Size != size ) )
{ {
/* Pick an existing aperture or create a new one */ // Pick an existing aperture or create a new one
currentAperture = getAperture( size, type ); currentAperture = getAperture( size, type );
fprintf( outputFile, "G54D%d*\n", currentAperture->DCode ); fprintf( outputFile, "G54D%d*\n", currentAperture->DCode );
} }
...@@ -198,32 +198,39 @@ void GERBER_PLOTTER::writeApertureList() ...@@ -198,32 +198,39 @@ void GERBER_PLOTTER::writeApertureList()
wxASSERT( outputFile ); wxASSERT( outputFile );
char cbuf[1024]; char cbuf[1024];
/* Init : */ // Init
for( std::vector<APERTURE>::iterator tool = apertures.begin(); for( std::vector<APERTURE>::iterator tool = apertures.begin();
tool != apertures.end(); tool++ ) tool != apertures.end(); tool++ )
{ {
const double fscale = 0.0001f * plotScale const double fscale = 0.0001f * plotScale
* iuPerDeviceUnit ; // For 3.4 format * iuPerDeviceUnit ;
char* text = cbuf + sprintf( cbuf, "%%ADD%d", tool->DCode ); char* text = cbuf + sprintf( cbuf, "%%ADD%d", tool->DCode );
/* Please note: the Gerber specs for mass parameters say that
exponential syntax is *not* allowed and the decimal point should
also be always inserted. So the %g format is ruled out, but %f is fine
(the # modifier forces the decimal point). Sadly the %f formatter
can't remove trailing zeros but thats not a problem, since nothing
forbid it (the file is only slightly longer) */
switch( tool->Type ) switch( tool->Type )
{ {
case APERTURE::Circle: case APERTURE::Circle:
sprintf( text, "C,%g*%%\n", tool->Size.x * fscale ); sprintf( text, "C,%#f*%%\n", tool->Size.x * fscale );
break; break;
case APERTURE::Rect: case APERTURE::Rect:
sprintf( text, "R,%gX%g*%%\n", sprintf( text, "R,%#fX%#f*%%\n",
tool->Size.x * fscale, tool->Size.x * fscale,
tool->Size.y * fscale ); tool->Size.y * fscale );
break; break;
case APERTURE::Plotting: case APERTURE::Plotting:
sprintf( text, "C,%g*%%\n", tool->Size.x * fscale ); sprintf( text, "C,%#f*%%\n", tool->Size.x * fscale );
break; break;
case APERTURE::Oval: case APERTURE::Oval:
sprintf( text, "O,%gX%g*%%\n", sprintf( text, "O,%#fX%#f*%%\n",
tool->Size.x * fscale, tool->Size.x * fscale,
tool->Size.y * fscale ); tool->Size.y * fscale );
break; break;
...@@ -282,17 +289,17 @@ void GERBER_PLOTTER::Circle( const wxPoint& aCenter, int aDiameter, FILL_T aFill ...@@ -282,17 +289,17 @@ void GERBER_PLOTTER::Circle( const wxPoint& aCenter, int aDiameter, FILL_T aFill
} }
void GERBER_PLOTTER::Arc( const wxPoint& aCenter, int aStAngle, int aEndAngle, void GERBER_PLOTTER::Arc( const wxPoint& aCenter, double aStAngle, double aEndAngle,
int aRadius, FILL_T aFill, int aWidth ) int aRadius, FILL_T aFill, int aWidth )
{ {
wxASSERT( outputFile ); wxASSERT( outputFile );
wxPoint start, end; wxPoint start, end;
start.x = aCenter.x + KiROUND( aRadius*cos( DEG2RAD( aStAngle/10.0 ) ) ); start.x = aCenter.x + KiROUND( cosdecideg( aRadius, aStAngle ) );
start.y = aCenter.y - KiROUND( aRadius*sin( DEG2RAD( aStAngle/10.0 ) ) ); start.y = aCenter.y - KiROUND( sindecideg( aRadius, aStAngle ) );
SetCurrentLineWidth( aWidth ); SetCurrentLineWidth( aWidth );
MoveTo( start ); MoveTo( start );
end.x = aCenter.x + KiROUND( aRadius*cos( DEG2RAD( aEndAngle/10.0 ) ) ); end.x = aCenter.x + KiROUND( cosdecideg( aRadius, aEndAngle ) );
end.y = aCenter.y - KiROUND( aRadius*sin( DEG2RAD( aEndAngle/10.0 ) ) ); end.y = aCenter.y - KiROUND( sindecideg( aRadius, aEndAngle ) );
DPOINT devEnd = userToDeviceCoordinates( end ); DPOINT devEnd = userToDeviceCoordinates( end );
DPOINT devCenter = userToDeviceCoordinates( aCenter ) DPOINT devCenter = userToDeviceCoordinates( aCenter )
- userToDeviceCoordinates( start ); - userToDeviceCoordinates( start );
...@@ -370,7 +377,7 @@ void GERBER_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre, ...@@ -370,7 +377,7 @@ void GERBER_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre,
/** /**
* Filled oval flashes are handled as aperture in the 90 degree positions only * Filled oval flashes are handled as aperture in the 90 degree positions only
*/ */
void GERBER_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int orient, void GERBER_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, double orient,
EDA_DRAW_MODE_T trace_mode ) EDA_DRAW_MODE_T trace_mode )
{ {
wxASSERT( outputFile ); wxASSERT( outputFile );
...@@ -427,17 +434,17 @@ void GERBER_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int ...@@ -427,17 +434,17 @@ void GERBER_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int
* Filled rect flashes are handled as aperture in the 90 degree positions only * Filled rect flashes are handled as aperture in the 90 degree positions only
*/ */
void GERBER_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& aSize, void GERBER_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& aSize,
int orient, EDA_DRAW_MODE_T trace_mode ) double orient, EDA_DRAW_MODE_T trace_mode )
{ {
wxASSERT( outputFile ); wxASSERT( outputFile );
wxSize size( aSize ); wxSize size( aSize );
/* Plot as flashed. */ // Plot as an aperture flash
switch( orient ) switch( int( orient ) )
{ {
case 900: case 900:
case 2700: /* rotation of 90 degrees or 270 swaps dimensions */ case 2700: // rotation of 90 degrees or 270 swaps sizes
EXCHG( size.x, size.y ); EXCHG( size.x, size.y );
// Pass through // Pass through
...@@ -494,7 +501,7 @@ void GERBER_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& aSize, ...@@ -494,7 +501,7 @@ void GERBER_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& aSize,
* they require aperture macros * they require aperture macros
*/ */
void GERBER_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint* aCorners, void GERBER_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint* aCorners,
int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode ) double aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
{ {
// XXX to do: use an aperture macro to declare the pad // XXX to do: use an aperture macro to declare the pad
......
...@@ -381,7 +381,7 @@ void HPGL_PLOTTER::ThickSegment( const wxPoint& start, const wxPoint& end, ...@@ -381,7 +381,7 @@ void HPGL_PLOTTER::ThickSegment( const wxPoint& start, const wxPoint& end,
* PU PY x, y; PD start_arc_X AA, start_arc_Y, angle, NbSegm; PU; * PU PY x, y; PD start_arc_X AA, start_arc_Y, angle, NbSegm; PU;
* Or PU PY x, y; PD start_arc_X AA, start_arc_Y, angle, PU; * Or PU PY x, y; PD start_arc_X AA, start_arc_Y, angle, PU;
*/ */
void HPGL_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int radius, void HPGL_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int radius,
FILL_T fill, int width ) FILL_T fill, int width )
{ {
wxASSERT( outputFile ); wxASSERT( outputFile );
...@@ -401,8 +401,8 @@ void HPGL_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int ra ...@@ -401,8 +401,8 @@ void HPGL_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int ra
// Calculate start point, // Calculate start point,
wxPoint cmap; wxPoint cmap;
cmap.x = int( centre.x + ( radius * cos( DEG2RAD( StAngle / 10.0 ) ) ) ); cmap.x = centre.x + KiROUND( cosdecideg( radius, StAngle ) );
cmap.y = int( centre.y - ( radius * sin( DEG2RAD( StAngle / 10.0 ) ) ) ); cmap.y = centre.y - KiROUND( sindecideg( radius, StAngle ) );
DPOINT cmap_dev = userToDeviceCoordinates( cmap ); DPOINT cmap_dev = userToDeviceCoordinates( cmap );
fprintf( outputFile, fprintf( outputFile,
...@@ -419,7 +419,7 @@ void HPGL_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int ra ...@@ -419,7 +419,7 @@ void HPGL_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int ra
/* Plot oval pad. /* Plot oval pad.
*/ */
void HPGL_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int orient, void HPGL_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, double orient,
EDA_DRAW_MODE_T trace_mode ) EDA_DRAW_MODE_T trace_mode )
{ {
wxASSERT( outputFile ); wxASSERT( outputFile );
...@@ -431,10 +431,8 @@ void HPGL_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int or ...@@ -431,10 +431,8 @@ void HPGL_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int or
*/ */
if( size.x > size.y ) if( size.x > size.y )
{ {
EXCHG( size.x, size.y ); orient += 900; EXCHG( size.x, size.y );
orient = AddAngles( orient, 900 );
if( orient >= 3600 )
orient -= 3600;
} }
deltaxy = size.y - size.x; // distance between centers of the oval deltaxy = size.y - size.x; // distance between centers of the oval
...@@ -501,7 +499,7 @@ void HPGL_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre, ...@@ -501,7 +499,7 @@ void HPGL_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre,
void HPGL_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& padsize, void HPGL_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& padsize,
int orient, EDA_DRAW_MODE_T trace_mode ) double orient, EDA_DRAW_MODE_T trace_mode )
{ {
wxASSERT( outputFile ); wxASSERT( outputFile );
wxSize size; wxSize size;
...@@ -618,7 +616,7 @@ void HPGL_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& padsize, ...@@ -618,7 +616,7 @@ void HPGL_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& padsize,
void HPGL_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint* aCorners, void HPGL_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint* aCorners,
int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode ) double aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
{ {
wxASSERT( outputFile ); wxASSERT( outputFile );
wxPoint polygone[4]; // coordinates of corners relatives to the pad wxPoint polygone[4]; // coordinates of corners relatives to the pad
......
...@@ -201,7 +201,7 @@ void PDF_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T aFill, int wi ...@@ -201,7 +201,7 @@ void PDF_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T aFill, int wi
* The PDF engine can't directly plot arcs, it uses the base emulation. * The PDF engine can't directly plot arcs, it uses the base emulation.
* So no filled arcs (not a great loss... ) * So no filled arcs (not a great loss... )
*/ */
void PDF_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int radius, void PDF_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int radius,
FILL_T fill, int width ) FILL_T fill, int width )
{ {
wxASSERT( workFile ); wxASSERT( workFile );
...@@ -219,23 +219,20 @@ void PDF_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int rad ...@@ -219,23 +219,20 @@ void PDF_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int rad
SetCurrentLineWidth( width ); SetCurrentLineWidth( width );
// Usual trig arc plotting routine... // Usual trig arc plotting routine...
double alpha = DEG2RAD( StAngle / 10.0 ); start.x = centre.x + KiROUND( cosdecideg( radius, -StAngle ) );
start.x = centre.x + (int) ( radius * cos( -alpha ) ); start.y = centre.y + KiROUND( sindecideg( radius, -StAngle ) );
start.y = centre.y + (int) ( radius * sin( -alpha ) );
DPOINT pos_dev = userToDeviceCoordinates( start ); DPOINT pos_dev = userToDeviceCoordinates( start );
fprintf( workFile, "%g %g m ", pos_dev.x, pos_dev.y ); fprintf( workFile, "%g %g m ", pos_dev.x, pos_dev.y );
for( int ii = StAngle + delta; ii < EndAngle; ii += delta ) for( int ii = StAngle + delta; ii < EndAngle; ii += delta )
{ {
alpha = DEG2RAD( ii / 10.0 ); end.x = centre.x + KiROUND( cosdecideg( radius, -ii ) );
end.x = centre.x + (int) ( radius * cos( -alpha ) ); end.y = centre.y + KiROUND( sindecideg( radius, -ii ) );
end.y = centre.y + (int) ( radius * sin( -alpha ) );
pos_dev = userToDeviceCoordinates( end ); pos_dev = userToDeviceCoordinates( end );
fprintf( workFile, "%g %g l ", pos_dev.x, pos_dev.y ); fprintf( workFile, "%g %g l ", pos_dev.x, pos_dev.y );
} }
alpha = DEG2RAD( EndAngle / 10.0 ); end.x = centre.x + KiROUND( cosdecideg( radius, -EndAngle ) );
end.x = centre.x + (int) ( radius * cos( -alpha ) ); end.y = centre.y + KiROUND( sindecideg( radius, -EndAngle ) );
end.y = centre.y + (int) ( radius * sin( -alpha ) );
pos_dev = userToDeviceCoordinates( end ); pos_dev = userToDeviceCoordinates( end );
fprintf( workFile, "%g %g l ", pos_dev.x, pos_dev.y ); fprintf( workFile, "%g %g l ", pos_dev.x, pos_dev.y );
...@@ -738,7 +735,7 @@ bool PDF_PLOTTER::EndPlot() ...@@ -738,7 +735,7 @@ bool PDF_PLOTTER::EndPlot()
void PDF_PLOTTER::Text( const wxPoint& aPos, void PDF_PLOTTER::Text( const wxPoint& aPos,
enum EDA_COLOR_T aColor, enum EDA_COLOR_T aColor,
const wxString& aText, const wxString& aText,
int aOrient, double aOrient,
const wxSize& aSize, const wxSize& aSize,
enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_HJUSTIFY_T aH_justify,
enum EDA_TEXT_VJUSTIFY_T aV_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify,
......
...@@ -64,7 +64,7 @@ void PSLIKE_PLOTTER::SetColor( EDA_COLOR_T color ) ...@@ -64,7 +64,7 @@ void PSLIKE_PLOTTER::SetColor( EDA_COLOR_T color )
} }
void PSLIKE_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int orient, void PSLIKE_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, double orient,
EDA_DRAW_MODE_T modetrace ) EDA_DRAW_MODE_T modetrace )
{ {
wxASSERT( outputFile ); wxASSERT( outputFile );
...@@ -75,9 +75,7 @@ void PSLIKE_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int ...@@ -75,9 +75,7 @@ void PSLIKE_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int
if( size.x > size.y ) if( size.x > size.y )
{ {
EXCHG( size.x, size.y ); EXCHG( size.x, size.y );
orient += 900; orient = AddAngles( orient, 900 );
if( orient >= 3600 )
orient -= 3600;
} }
delta = size.y - size.x; delta = size.y - size.x;
...@@ -117,7 +115,7 @@ void PSLIKE_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre, ...@@ -117,7 +115,7 @@ void PSLIKE_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre,
void PSLIKE_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& aSize, void PSLIKE_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& aSize,
int orient, EDA_DRAW_MODE_T trace_mode ) double orient, EDA_DRAW_MODE_T trace_mode )
{ {
static std::vector< wxPoint > cornerList; static std::vector< wxPoint > cornerList;
wxSize size( aSize ); wxSize size( aSize );
...@@ -161,7 +159,7 @@ void PSLIKE_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& aSize, ...@@ -161,7 +159,7 @@ void PSLIKE_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& aSize,
void PSLIKE_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners, void PSLIKE_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode ) double aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
{ {
static std::vector< wxPoint > cornerList; static std::vector< wxPoint > cornerList;
cornerList.clear(); cornerList.clear();
...@@ -345,11 +343,6 @@ void PSLIKE_PLOTTER::computeTextParameters( const wxPoint& aPos, ...@@ -345,11 +343,6 @@ void PSLIKE_PLOTTER::computeTextParameters( const wxPoint& aPos,
double *ctm_f, double *ctm_f,
double *heightFactor ) double *heightFactor )
{ {
// These are for the rotation matrix
double alpha = DEG2RAD( aOrient / 10.0 );
double sinalpha = sin( alpha );
double cosalpha = cos( alpha );
// Compute the starting position (compensated for alignment) // Compute the starting position (compensated for alignment)
wxPoint start_pos = aPos; wxPoint start_pos = aPos;
...@@ -399,6 +392,10 @@ void PSLIKE_PLOTTER::computeTextParameters( const wxPoint& aPos, ...@@ -399,6 +392,10 @@ void PSLIKE_PLOTTER::computeTextParameters( const wxPoint& aPos,
*wideningFactor = sz_dev.y / sz_dev.x; *wideningFactor = sz_dev.y / sz_dev.x;
// The CTM transformation matrix // The CTM transformation matrix
double alpha = DECIDEG2RAD( aOrient );
double sinalpha = sin( alpha );
double cosalpha = cos( alpha );
*ctm_a = cosalpha; *ctm_a = cosalpha;
*ctm_b = sinalpha; *ctm_b = sinalpha;
*ctm_c = -sinalpha; *ctm_c = -sinalpha;
...@@ -474,8 +471,8 @@ void PS_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T fill, int widt ...@@ -474,8 +471,8 @@ void PS_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T fill, int widt
} }
void PS_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int radius, void PS_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle,
FILL_T fill, int width ) int radius, FILL_T fill, int width )
{ {
wxASSERT( outputFile ); wxASSERT( outputFile );
if( radius <= 0 ) if( radius <= 0 )
...@@ -808,7 +805,7 @@ bool PS_PLOTTER::EndPlot() ...@@ -808,7 +805,7 @@ bool PS_PLOTTER::EndPlot()
void PS_PLOTTER::Text( const wxPoint& aPos, void PS_PLOTTER::Text( const wxPoint& aPos,
enum EDA_COLOR_T aColor, enum EDA_COLOR_T aColor,
const wxString& aText, const wxString& aText,
int aOrient, double aOrient,
const wxSize& aSize, const wxSize& aSize,
enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_HJUSTIFY_T aH_justify,
enum EDA_TEXT_VJUSTIFY_T aV_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify,
......
...@@ -99,6 +99,65 @@ ...@@ -99,6 +99,65 @@
#include <macros.h> #include <macros.h>
#include <kicad_string.h> #include <kicad_string.h>
/**
* Function XmlEsc
* translates '<' to "&lt;", '>' to "&gt;" and so on, according to the spec:
* http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping
* May be moved to a library if needed generally, but not expecting that.
*/
static wxString XmlEsc( const wxString& aStr, bool isAttribute = false )
{
wxString escaped;
escaped.reserve( aStr.length() );
for( wxString::const_iterator it = aStr.begin(); it != aStr.end(); ++it )
{
const wxChar c = *it;
switch( c )
{
case wxS( '<' ):
escaped.append( wxS( "&lt;" ) );
break;
case wxS( '>' ):
escaped.append( wxS( "&gt;" ) );
break;
case wxS( '&' ):
escaped.append( wxS( "&amp;" ) );
break;
case wxS( '\r' ):
escaped.append( wxS( "&#xD;" ) );
break;
default:
if( isAttribute )
{
switch( c )
{
case wxS( '"' ):
escaped.append( wxS( "&quot;" ) );
break;
case wxS( '\t' ):
escaped.append( wxS( "&#x9;" ) );
break;
case wxS( '\n' ):
escaped.append( wxS( "&#xA;" ));
break;
default:
escaped.append(c);
}
}
else
escaped.append(c);
}
}
return escaped;
}
SVG_PLOTTER::SVG_PLOTTER() SVG_PLOTTER::SVG_PLOTTER()
{ {
m_graphics_changed = true; m_graphics_changed = true;
...@@ -262,7 +321,7 @@ void SVG_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T fill, int wid ...@@ -262,7 +321,7 @@ void SVG_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T fill, int wid
} }
void SVG_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int radius, void SVG_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int radius,
FILL_T fill, int width ) FILL_T fill, int width )
{ {
/* Draws an arc of a circle, centred on (xc,yc), with starting point /* Draws an arc of a circle, centred on (xc,yc), with starting point
...@@ -288,7 +347,7 @@ void SVG_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int rad ...@@ -288,7 +347,7 @@ void SVG_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int rad
if( !plotMirror ) if( !plotMirror )
{ {
int tmp = StAngle; double tmp = StAngle;
StAngle = -EndAngle; StAngle = -EndAngle;
EndAngle = -tmp; EndAngle = -tmp;
} }
...@@ -302,12 +361,12 @@ void SVG_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int rad ...@@ -302,12 +361,12 @@ void SVG_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int rad
start += centre_dev; start += centre_dev;
end += centre_dev; end += centre_dev;
double theta1 = StAngle * M_PI / 1800.0; double theta1 = DECIDEG2RAD( StAngle );
if( theta1 < 0 ) if( theta1 < 0 )
theta1 = theta1 + M_PI * 2; theta1 = theta1 + M_PI * 2;
double theta2 = EndAngle * M_PI / 1800.0; double theta2 = DECIDEG2RAD( EndAngle );
if( theta2 < 0 ) if( theta2 < 0 )
theta2 = theta2 + M_PI * 2; theta2 = theta2 + M_PI * 2;
...@@ -460,10 +519,10 @@ bool SVG_PLOTTER::StartPlot() ...@@ -460,10 +519,10 @@ bool SVG_PLOTTER::StartPlot()
fprintf( outputFile, fprintf( outputFile,
"<title>SVG Picture created as %s date %s </title>\n", "<title>SVG Picture created as %s date %s </title>\n",
TO_UTF8( wxFileName( filename ).GetFullName() ), date_buf ); TO_UTF8( XmlEsc( wxFileName( filename ).GetFullName() ) ), date_buf );
// End of header // End of header
fprintf( outputFile, " <desc>Picture generated by %s </desc>\n", fprintf( outputFile, " <desc>Picture generated by %s </desc>\n",
TO_UTF8( creator ) ); TO_UTF8( XmlEsc( creator ) ) );
// output the pen and brush color (RVB values in hex) and opacity // output the pen and brush color (RVB values in hex) and opacity
double opacity = 1.0; // 0.0 (transparent to 1.0 (solid) double opacity = 1.0; // 0.0 (transparent to 1.0 (solid)
...@@ -491,7 +550,7 @@ bool SVG_PLOTTER::EndPlot() ...@@ -491,7 +550,7 @@ bool SVG_PLOTTER::EndPlot()
void SVG_PLOTTER::Text( const wxPoint& aPos, void SVG_PLOTTER::Text( const wxPoint& aPos,
enum EDA_COLOR_T aColor, enum EDA_COLOR_T aColor,
const wxString& aText, const wxString& aText,
int aOrient, double aOrient,
const wxSize& aSize, const wxSize& aSize,
enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_HJUSTIFY_T aH_justify,
enum EDA_TEXT_VJUSTIFY_T aV_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify,
......
This diff is collapsed.
...@@ -29,8 +29,10 @@ ...@@ -29,8 +29,10 @@
#include <fctsys.h> #include <fctsys.h>
#include <trigo.h> #include <trigo.h>
#include <macros.h> #include <macros.h>
#include <common.h>
#include <convert_basic_shapes_to_polygon.h> #include <convert_basic_shapes_to_polygon.h>
/** /**
* Function TransformCircleToPolygon * Function TransformCircleToPolygon
* convert a circle to a polygon, using multiple straight lines * convert a circle to a polygon, using multiple straight lines
...@@ -41,7 +43,7 @@ ...@@ -41,7 +43,7 @@
* Note: the polygon is inside the circle, so if you want to have the polygon * Note: the polygon is inside the circle, so if you want to have the polygon
* outside the circle, you should give aRadius calculated with a corrrection factor * outside the circle, you should give aRadius calculated with a corrrection factor
*/ */
void TransformCircleToPolygon( std::vector <CPolyPt>& aCornerBuffer, void TransformCircleToPolygon( CPOLYGONS_LIST& aCornerBuffer,
wxPoint aCenter, int aRadius, wxPoint aCenter, int aRadius,
int aCircleToSegmentsCount ) int aCircleToSegmentsCount )
{ {
...@@ -57,10 +59,10 @@ void TransformCircleToPolygon( std::vector <CPolyPt>& aCornerBuffer, ...@@ -57,10 +59,10 @@ void TransformCircleToPolygon( std::vector <CPolyPt>& aCornerBuffer,
RotatePoint( &corner_position.x, &corner_position.y, angle ); RotatePoint( &corner_position.x, &corner_position.y, angle );
corner_position += aCenter; corner_position += aCenter;
CPolyPt polypoint( corner_position.x, corner_position.y ); CPolyPt polypoint( corner_position.x, corner_position.y );
aCornerBuffer.push_back( polypoint ); aCornerBuffer.Append( polypoint );
} }
aCornerBuffer.back().end_contour = true; aCornerBuffer.CloseLastContour();
} }
...@@ -76,7 +78,7 @@ void TransformCircleToPolygon( std::vector <CPolyPt>& aCornerBuffer, ...@@ -76,7 +78,7 @@ void TransformCircleToPolygon( std::vector <CPolyPt>& aCornerBuffer,
* Note: the polygon is inside the arc ends, so if you want to have the polygon * Note: the polygon is inside the arc ends, so if you want to have the polygon
* outside the circle, you should give aStart and aEnd calculated with a correction factor * outside the circle, you should give aStart and aEnd calculated with a correction factor
*/ */
void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer, void TransformRoundedEndsSegmentToPolygon( CPOLYGONS_LIST& aCornerBuffer,
wxPoint aStart, wxPoint aEnd, wxPoint aStart, wxPoint aEnd,
int aCircleToSegmentsCount, int aCircleToSegmentsCount,
int aWidth ) int aWidth )
...@@ -85,7 +87,6 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer, ...@@ -85,7 +87,6 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer,
wxPoint endp = aEnd - aStart; // end point coordinate for the same segment starting at (0,0) wxPoint endp = aEnd - aStart; // end point coordinate for the same segment starting at (0,0)
wxPoint startp = aStart; wxPoint startp = aStart;
wxPoint corner; wxPoint corner;
int seg_len;
CPolyPt polypoint; CPolyPt polypoint;
// normalize the position in order to have endp.x >= 0; // normalize the position in order to have endp.x >= 0;
...@@ -95,8 +96,8 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer, ...@@ -95,8 +96,8 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer,
startp = aEnd; startp = aEnd;
} }
int delta_angle = ArcTangente( endp.y, endp.x ); // delta_angle is in 0.1 degrees double delta_angle = ArcTangente( endp.y, endp.x ); // delta_angle is in 0.1 degrees
seg_len = (int) sqrt( ( (double) endp.y * endp.y ) + ( (double) endp.x * endp.x ) ); int seg_len = KiROUND( EuclideanNorm( endp ) );
int delta = 3600 / aCircleToSegmentsCount; // rot angle in 0.1 degree int delta = 3600 / aCircleToSegmentsCount; // rot angle in 0.1 degree
...@@ -111,7 +112,7 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer, ...@@ -111,7 +112,7 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer,
corner += startp; corner += startp;
polypoint.x = corner.x; polypoint.x = corner.x;
polypoint.y = corner.y; polypoint.y = corner.y;
aCornerBuffer.push_back( polypoint ); aCornerBuffer.Append( polypoint );
} }
// Finish arc: // Finish arc:
...@@ -120,7 +121,7 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer, ...@@ -120,7 +121,7 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer,
corner += startp; corner += startp;
polypoint.x = corner.x; polypoint.x = corner.x;
polypoint.y = corner.y; polypoint.y = corner.y;
aCornerBuffer.push_back( polypoint ); aCornerBuffer.Append( polypoint );
// add left rounded end: // add left rounded end:
for( int ii = 0; ii < 1800; ii += delta ) for( int ii = 0; ii < 1800; ii += delta )
...@@ -131,7 +132,7 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer, ...@@ -131,7 +132,7 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer,
corner += startp; corner += startp;
polypoint.x = corner.x; polypoint.x = corner.x;
polypoint.y = corner.y; polypoint.y = corner.y;
aCornerBuffer.push_back( polypoint ); aCornerBuffer.Append( polypoint );
} }
// Finish arc: // Finish arc:
...@@ -140,9 +141,9 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer, ...@@ -140,9 +141,9 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer,
corner += startp; corner += startp;
polypoint.x = corner.x; polypoint.x = corner.x;
polypoint.y = corner.y; polypoint.y = corner.y;
aCornerBuffer.push_back( polypoint ); aCornerBuffer.Append( polypoint );
aCornerBuffer.back().end_contour = true; aCornerBuffer.CloseLastContour();
} }
...@@ -157,8 +158,8 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer, ...@@ -157,8 +158,8 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer,
* @param aCircleToSegmentsCount = the number of segments to approximate a circle * @param aCircleToSegmentsCount = the number of segments to approximate a circle
* @param aWidth = width (thickness) of the line * @param aWidth = width (thickness) of the line
*/ */
void TransformArcToPolygon( std::vector <CPolyPt>& aCornerBuffer, void TransformArcToPolygon( CPOLYGONS_LIST& aCornerBuffer,
wxPoint aCentre, wxPoint aStart, int aArcAngle, wxPoint aCentre, wxPoint aStart, double aArcAngle,
int aCircleToSegmentsCount, int aWidth ) int aCircleToSegmentsCount, int aWidth )
{ {
wxPoint arc_start, arc_end; wxPoint arc_start, arc_end;
...@@ -192,5 +193,69 @@ void TransformArcToPolygon( std::vector <CPolyPt>& aCornerBuffer, ...@@ -192,5 +193,69 @@ void TransformArcToPolygon( std::vector <CPolyPt>& aCornerBuffer,
if( curr_end != arc_end ) if( curr_end != arc_end )
TransformRoundedEndsSegmentToPolygon( aCornerBuffer, TransformRoundedEndsSegmentToPolygon( aCornerBuffer,
curr_end, arc_end, aCircleToSegmentsCount, aWidth ); curr_end, arc_end,
aCircleToSegmentsCount, aWidth );
}
/**
* Function TransformRingToPolygon
* Creates a polygon from a ring
* Convert arcs to multiple straight segments
* @param aCornerBuffer = a buffer to store the polygon
* @param aCentre = centre of the arc or circle
* @param aRadius = radius of the circle
* @param aCircleToSegmentsCount = the number of segments to approximate a circle
* @param aWidth = width (thickness) of the ring
*/
void TransformRingToPolygon( CPOLYGONS_LIST& aCornerBuffer,
wxPoint aCentre, int aRadius,
int aCircleToSegmentsCount, int aWidth )
{
int delta = 3600 / aCircleToSegmentsCount; // rotate angle in 0.1 degree
// Compute the corners posituions and creates poly
wxPoint curr_point;
int inner_radius = aRadius - ( aWidth / 2 );
int outer_radius = inner_radius + aWidth;
CPolyPt polycorner;
// Draw the inner circle of the ring
for( int ii = 0; ii < 3600; ii += delta )
{
curr_point.x = inner_radius;
curr_point.y = 0;
RotatePoint( &curr_point, ii );
curr_point += aCentre;
polycorner.x = curr_point.x;
polycorner.y = curr_point.y;
aCornerBuffer.Append( polycorner );
}
// Draw the last point of inner circle
polycorner.x = aCentre.x + inner_radius;
polycorner.y = aCentre.y;
aCornerBuffer.Append( polycorner );
// Draw the outer circle of the ring
for( int ii = 0; ii < 3600; ii += delta )
{
curr_point.x = outer_radius;
curr_point.y = 0;
RotatePoint( &curr_point, -ii );
curr_point += aCentre;
polycorner.x = curr_point.x;
polycorner.y = curr_point.y;
aCornerBuffer.Append( polycorner );
}
// Draw the last point of outer circle
polycorner.x = aCentre.x + outer_radius;
polycorner.y = aCentre.y;
aCornerBuffer.Append( polycorner );
// Close the polygon
polycorner.x = aCentre.x + inner_radius;
polycorner.end_contour = true;
aCornerBuffer.Append( polycorner );
} }
...@@ -71,8 +71,8 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame ) ...@@ -71,8 +71,8 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
wxRect DrawArea; wxRect DrawArea;
BASE_SCREEN* screen = aFrame->GetCanvas()->GetScreen(); BASE_SCREEN* screen = aFrame->GetCanvas()->GetScreen();
/* scale is the ratio resolution/internal units */ // scale is the ratio resolution/internal units
float scale = 82.0 / 1000.0 / (double) screen->MilsToIuScalar(); double scale = 82.0 / 1000.0 / (double) screen->MilsToIuScalar();
if( screen->IsBlockActive() ) if( screen->IsBlockActive() )
{ {
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <general.h> #include <general.h>
#endif #endif
#include <worksheet.h>
#include <dialog_page_settings.h> #include <dialog_page_settings.h>
...@@ -181,6 +182,7 @@ void DIALOG_PAGES_SETTINGS::initDialog() ...@@ -181,6 +182,7 @@ void DIALOG_PAGES_SETTINGS::initDialog()
} }
m_TextRevision->SetValue( m_tb.GetRevision() ); m_TextRevision->SetValue( m_tb.GetRevision() );
m_TextDate->SetValue( m_tb.GetDate() );
m_TextTitle->SetValue( m_tb.GetTitle() ); m_TextTitle->SetValue( m_tb.GetTitle() );
m_TextCompany->SetValue( m_tb.GetCompany() ); m_TextCompany->SetValue( m_tb.GetCompany() );
m_TextComment1->SetValue( m_tb.GetComment1() ); m_TextComment1->SetValue( m_tb.GetComment1() );
...@@ -190,6 +192,7 @@ void DIALOG_PAGES_SETTINGS::initDialog() ...@@ -190,6 +192,7 @@ void DIALOG_PAGES_SETTINGS::initDialog()
#ifndef EESCHEMA #ifndef EESCHEMA
m_RevisionExport->Show( false ); m_RevisionExport->Show( false );
m_DateExport->Show( false );
m_TitleExport->Show( false ); m_TitleExport->Show( false );
m_CompanyExport->Show( false ); m_CompanyExport->Show( false );
m_Comment1Export->Show( false ); m_Comment1Export->Show( false );
...@@ -309,6 +312,17 @@ void DIALOG_PAGES_SETTINGS::OnRevisionTextUpdated( wxCommandEvent& event ) ...@@ -309,6 +312,17 @@ void DIALOG_PAGES_SETTINGS::OnRevisionTextUpdated( wxCommandEvent& event )
} }
void DIALOG_PAGES_SETTINGS::OnDateTextUpdated( wxCommandEvent& event )
{
if( m_initialized && m_TextDate->IsModified() )
{
GetPageLayoutInfoFromDialog();
m_tb.SetDate( m_TextDate->GetValue() );
UpdatePageLayoutExample();
}
}
void DIALOG_PAGES_SETTINGS::OnTitleTextUpdated( wxCommandEvent& event ) void DIALOG_PAGES_SETTINGS::OnTitleTextUpdated( wxCommandEvent& event )
{ {
if( m_initialized && m_TextTitle->IsModified() ) if( m_initialized && m_TextTitle->IsModified() )
...@@ -374,6 +388,10 @@ void DIALOG_PAGES_SETTINGS::OnComment4TextUpdated( wxCommandEvent& event ) ...@@ -374,6 +388,10 @@ void DIALOG_PAGES_SETTINGS::OnComment4TextUpdated( wxCommandEvent& event )
} }
} }
void DIALOG_PAGES_SETTINGS::OnDateApplyClick( wxCommandEvent& event )
{
m_TextDate->SetValue( FormatDateLong( m_PickDate->GetValue() ) );
}
void DIALOG_PAGES_SETTINGS::SavePageSettings( wxCommandEvent& event ) void DIALOG_PAGES_SETTINGS::SavePageSettings( wxCommandEvent& event )
{ {
...@@ -470,6 +488,7 @@ limits\n%.1f - %.1f %s!\nSelect another custom paper size?" ), ...@@ -470,6 +488,7 @@ limits\n%.1f - %.1f %s!\nSelect another custom paper size?" ),
m_Parent->SetPageSettings( m_pageInfo ); m_Parent->SetPageSettings( m_pageInfo );
m_tb.SetRevision( m_TextRevision->GetValue() ); m_tb.SetRevision( m_TextRevision->GetValue() );
m_tb.SetDate( m_TextDate->GetValue() );
m_tb.SetCompany( m_TextCompany->GetValue() ); m_tb.SetCompany( m_TextCompany->GetValue() );
m_tb.SetTitle( m_TextTitle->GetValue() ); m_tb.SetTitle( m_TextTitle->GetValue() );
m_tb.SetComment1( m_TextComment1->GetValue() ); m_tb.SetComment1( m_TextComment1->GetValue() );
...@@ -497,6 +516,9 @@ limits\n%.1f - %.1f %s!\nSelect another custom paper size?" ), ...@@ -497,6 +516,9 @@ limits\n%.1f - %.1f %s!\nSelect another custom paper size?" ),
if( m_RevisionExport->IsChecked() ) if( m_RevisionExport->IsChecked() )
tb2.SetRevision( m_tb.GetRevision() ); tb2.SetRevision( m_tb.GetRevision() );
if( m_DateExport->IsChecked() )
tb2.SetDate( m_tb.GetDate() );
if( m_TitleExport->IsChecked() ) if( m_TitleExport->IsChecked() )
tb2.SetTitle( m_tb.GetTitle() ); tb2.SetTitle( m_tb.GetTitle() );
...@@ -577,10 +599,6 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample() ...@@ -577,10 +599,6 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()
if( m_page_bitmap->IsOk() ) if( m_page_bitmap->IsOk() )
{ {
// Save current clip box and temporary expand it.
EDA_RECT save_clip_box = *m_Parent->GetCanvas()->GetClipBox();
m_Parent->GetCanvas()->SetClipBox( EDA_RECT( wxPoint( 0, 0 ),
wxSize( INT_MAX / 2, INT_MAX / 2 ) ) );
// Calculate layout preview scale. // Calculate layout preview scale.
int appScale = m_Screen->MilsToIuScalar(); int appScale = m_Screen->MilsToIuScalar();
...@@ -588,7 +606,7 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample() ...@@ -588,7 +606,7 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()
double scaleH = (double) lyHeight / clamped_layout_size.y / appScale; double scaleH = (double) lyHeight / clamped_layout_size.y / appScale;
// Prepare DC. // Prepare DC.
wxSize example_size( lyWidth, lyHeight ); wxSize example_size( lyWidth + 1, lyHeight + 1 );
wxMemoryDC memDC; wxMemoryDC memDC;
memDC.SelectObject( *m_page_bitmap ); memDC.SelectObject( *m_page_bitmap );
memDC.SetClippingRegion( wxPoint( 0, 0 ), example_size ); memDC.SetClippingRegion( wxPoint( 0, 0 ), example_size );
...@@ -598,35 +616,33 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample() ...@@ -598,35 +616,33 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()
// Get logical page size and margins. // Get logical page size and margins.
PAGE_INFO pageDUMMY; PAGE_INFO pageDUMMY;
pageDUMMY.SetWidthMils( clamped_layout_size.x );
pageDUMMY.SetHeightMils( clamped_layout_size.y );
wxSize dummySize = pageDUMMY.GetSizeMils();
wxPoint pointLeftTop( pageDUMMY.GetLeftMarginMils(), pageDUMMY.GetTopMarginMils() );
wxPoint pointRightBottom( pageDUMMY.GetRightMarginMils(), pageDUMMY.GetBottomMarginMils() );
// Get page type // Get page type
int idx = m_paperSizeComboBox->GetSelection(); int idx = m_paperSizeComboBox->GetSelection();
if( idx < 0 ) if( idx < 0 )
idx = 0; idx = 0;
wxString paperType = m_pageFmt[idx].Left( m_pageFmt[idx].Index( wxT( " " ) ) ); wxString pageFmtName = m_pageFmt[idx].BeforeFirst( ' ' );
bool portrait = clamped_layout_size.x < clamped_layout_size.y;
pageDUMMY.SetType( pageFmtName, portrait );
if( m_customFmt )
{
pageDUMMY.SetWidthMils( clamped_layout_size.x );
pageDUMMY.SetHeightMils( clamped_layout_size.y );
}
// Draw layout preview. // Draw layout preview.
wxString emptyString; wxString emptyString;
GRResetPenAndBrush( ( wxDC* ) &memDC ); GRResetPenAndBrush( &memDC );
m_Parent->TraceWorkSheet( (wxDC*) &memDC, dummySize, pointLeftTop, pointRightBottom, DrawPageLayout( &memDC, NULL, pageDUMMY,
paperType, emptyString, m_tb, m_Screen->m_NumberOfScreens, emptyString, emptyString,
m_Screen->m_ScreenNumber, 1, appScale, LIGHTGRAY, RED ); m_tb, m_Screen->m_NumberOfScreens,
m_Screen->m_ScreenNumber, 1, appScale, DARKGRAY, RED );
memDC.SelectObject( wxNullBitmap ); memDC.SelectObject( wxNullBitmap );
m_PageLayoutExampleBitmap->SetBitmap( *m_page_bitmap ); m_PageLayoutExampleBitmap->SetBitmap( *m_page_bitmap );
// Restore current clip box.
m_Parent->GetCanvas()->SetClipBox( save_clip_box );
// Refresh the dialog. // Refresh the dialog.
Layout(); Layout();
Refresh(); Refresh();
...@@ -672,7 +688,6 @@ void DIALOG_PAGES_SETTINGS::GetPageLayoutInfoFromDialog() ...@@ -672,7 +688,6 @@ void DIALOG_PAGES_SETTINGS::GetPageLayoutInfoFromDialog()
&PAGE_INFO::C, &PAGE_INFO::C,
&PAGE_INFO::D, &PAGE_INFO::D,
&PAGE_INFO::E, &PAGE_INFO::E,
//&PAGE_INFO::GERBER,
&PAGE_INFO::USLetter, &PAGE_INFO::USLetter,
&PAGE_INFO::USLegal, &PAGE_INFO::USLegal,
&PAGE_INFO::USLedger, &PAGE_INFO::USLedger,
......
...@@ -79,6 +79,9 @@ private: ...@@ -79,6 +79,9 @@ private:
/// exEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXTCTRL_REVISION /// exEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXTCTRL_REVISION
void OnRevisionTextUpdated( wxCommandEvent& event ); void OnRevisionTextUpdated( wxCommandEvent& event );
/// exEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXTCTRL_DATE
void OnDateTextUpdated( wxCommandEvent& event );
/// exEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXTCTRL_TITLE /// exEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXTCTRL_TITLE
void OnTitleTextUpdated( wxCommandEvent& event ); void OnTitleTextUpdated( wxCommandEvent& event );
...@@ -97,6 +100,9 @@ private: ...@@ -97,6 +100,9 @@ private:
/// exEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXTCTRL_COMMENT4 /// exEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXTCTRL_COMMENT4
void OnComment4TextUpdated( wxCommandEvent& event ); void OnComment4TextUpdated( wxCommandEvent& event );
/// Handle button click for setting the date from the picker
virtual void OnDateApplyClick( wxCommandEvent& event );
void SetCurrentPageSizeSelection( const wxString& aPaperSize ); void SetCurrentPageSizeSelection( const wxString& aPaperSize );
void SavePageSettings( wxCommandEvent& event ); void SavePageSettings( wxCommandEvent& event );
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 10 2012) // C++ code generated with wxFormBuilder (version Oct 8 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
#include <wx/intl.h> #include <wx/intl.h>
class DIALOG_SHIM;
#include "dialog_shim.h" #include "dialog_shim.h"
#include <wx/string.h> #include <wx/string.h>
#include <wx/stattext.h> #include <wx/stattext.h>
...@@ -18,39 +20,44 @@ ...@@ -18,39 +20,44 @@
#include <wx/font.h> #include <wx/font.h>
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/statline.h>
#include <wx/choice.h> #include <wx/choice.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/valtext.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/statbox.h> #include <wx/valtext.h>
#include <wx/bitmap.h> #include <wx/bitmap.h>
#include <wx/image.h> #include <wx/image.h>
#include <wx/icon.h> #include <wx/icon.h>
#include <wx/statbmp.h> #include <wx/statbmp.h>
#include <wx/checkbox.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/datectrl.h>
#include <wx/dateevt.h>
#include <wx/checkbox.h>
#include <wx/dialog.h> #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#define ID_CHICE_PAGE_SIZE 1000 #define ID_CHICE_PAGE_SIZE 1000
#define ID_CHOICE_PAGE_ORIENTATION 1001 #define ID_CHOICE_PAGE_ORIENTATION 1001
#define ID_TEXTCTRL_USER_PAGE_SIZE_X 1002 #define ID_TEXTCTRL_USER_PAGE_SIZE_Y 1002
#define ID_TEXTCTRL_USER_PAGE_SIZE_Y 1003 #define ID_TEXTCTRL_USER_PAGE_SIZE_X 1003
#define ID_PAGE_LAYOUT_EXAMPLE_SIZER 1004 #define ID_TEXTCTRL_DATE 1004
#define ID_TEXTCTRL_REVISION 1005 #define ID_BTN_APPLY_DATE 1005
#define ID_CHECKBOX_REVISION 1006 #define ID_PICKER_DATE 1006
#define ID_TEXTCTRL_TITLE 1007 #define ID_CHECKBOX_DATE 1007
#define ID_TEXTCTRL_COMPANY 1008 #define ID_TEXTCTRL_REVISION 1008
#define ID_CHECKBOX_COMPANY 1009 #define ID_CHECKBOX_REVISION 1009
#define ID_TEXTCTRL_COMMENT1 1010 #define ID_TEXTCTRL_TITLE 1010
#define ID_CHECKBOX_COMMENT1 1011 #define ID_TEXTCTRL_COMPANY 1011
#define ID_TEXTCTRL_COMMENT2 1012 #define ID_CHECKBOX_COMPANY 1012
#define ID_CHECKBOX_COMMENT2 1013 #define ID_TEXTCTRL_COMMENT1 1013
#define ID_TEXTCTRL_COMMENT3 1014 #define ID_CHECKBOX_COMMENT1 1014
#define ID_CHECKBOX_COMMENT3 1015 #define ID_TEXTCTRL_COMMENT2 1015
#define ID_TEXTCTRL_COMMENT4 1016 #define ID_CHECKBOX_COMMENT2 1016
#define ID_CHECKBOX_COMMENT4 1017 #define ID_TEXTCTRL_COMMENT3 1017
#define ID_CHECKBOX_COMMENT3 1018
#define ID_TEXTCTRL_COMMENT4 1019
#define ID_CHECKBOX_COMMENT4 1020
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_PAGES_SETTINGS_BASE /// Class DIALOG_PAGES_SETTINGS_BASE
...@@ -60,27 +67,48 @@ class DIALOG_PAGES_SETTINGS_BASE : public DIALOG_SHIM ...@@ -60,27 +67,48 @@ class DIALOG_PAGES_SETTINGS_BASE : public DIALOG_SHIM
private: private:
protected: protected:
wxStaticText* m_staticText5; wxStaticText* m_staticTextPaper;
wxStaticLine* m_staticline2;
wxStaticText* m_staticTextSize;
wxChoice* m_paperSizeComboBox; wxChoice* m_paperSizeComboBox;
wxStaticText* m_staticText6; wxStaticText* m_staticTextOrient;
wxChoice* m_orientationComboBox; wxChoice* m_orientationComboBox;
wxTextCtrl* m_TextUserSizeX; wxStaticText* m_staticTextCustSize;
wxStaticText* m_staticTextHeight;
wxTextCtrl* m_TextUserSizeY; wxTextCtrl* m_TextUserSizeY;
wxStaticText* m_staticTextWidth;
wxTextCtrl* m_TextUserSizeX;
wxStaticText* m_staticTextPreview;
wxStaticBitmap* m_PageLayoutExampleBitmap; wxStaticBitmap* m_PageLayoutExampleBitmap;
wxStaticLine* m_staticline1;
wxStaticText* m_staticTexttbprm;
wxStaticLine* m_staticline3;
wxStaticText* m_TextSheetCount; wxStaticText* m_TextSheetCount;
wxStaticText* m_TextSheetNumber; wxStaticText* m_TextSheetNumber;
wxStaticText* m_staticTextDate;
wxTextCtrl* m_TextDate;
wxButton* m_ApplyDate;
wxDatePickerCtrl* m_PickDate;
wxCheckBox* m_DateExport;
wxStaticText* m_staticTextRev;
wxTextCtrl* m_TextRevision; wxTextCtrl* m_TextRevision;
wxCheckBox* m_RevisionExport; wxCheckBox* m_RevisionExport;
wxStaticText* m_staticTextTitle;
wxTextCtrl* m_TextTitle; wxTextCtrl* m_TextTitle;
wxCheckBox* m_TitleExport; wxCheckBox* m_TitleExport;
wxStaticText* m_staticText13;
wxTextCtrl* m_TextCompany; wxTextCtrl* m_TextCompany;
wxCheckBox* m_CompanyExport; wxCheckBox* m_CompanyExport;
wxStaticText* m_staticTextComment1;
wxTextCtrl* m_TextComment1; wxTextCtrl* m_TextComment1;
wxCheckBox* m_Comment1Export; wxCheckBox* m_Comment1Export;
wxStaticText* m_staticTextComment2;
wxTextCtrl* m_TextComment2; wxTextCtrl* m_TextComment2;
wxCheckBox* m_Comment2Export; wxCheckBox* m_Comment2Export;
wxStaticText* m_staticTextComment3;
wxTextCtrl* m_TextComment3; wxTextCtrl* m_TextComment3;
wxCheckBox* m_Comment3Export; wxCheckBox* m_Comment3Export;
wxStaticText* m_staticTextComment4;
wxTextCtrl* m_TextComment4; wxTextCtrl* m_TextComment4;
wxCheckBox* m_Comment4Export; wxCheckBox* m_Comment4Export;
wxStdDialogButtonSizer* m_sdbSizer1; wxStdDialogButtonSizer* m_sdbSizer1;
...@@ -91,8 +119,10 @@ class DIALOG_PAGES_SETTINGS_BASE : public DIALOG_SHIM ...@@ -91,8 +119,10 @@ class DIALOG_PAGES_SETTINGS_BASE : public DIALOG_SHIM
virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); } virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); }
virtual void OnPaperSizeChoice( wxCommandEvent& event ) { event.Skip(); } virtual void OnPaperSizeChoice( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPageOrientationChoice( wxCommandEvent& event ) { event.Skip(); } virtual void OnPageOrientationChoice( wxCommandEvent& event ) { event.Skip(); }
virtual void OnUserPageSizeXTextUpdated( wxCommandEvent& event ) { event.Skip(); }
virtual void OnUserPageSizeYTextUpdated( wxCommandEvent& event ) { event.Skip(); } virtual void OnUserPageSizeYTextUpdated( wxCommandEvent& event ) { event.Skip(); }
virtual void OnUserPageSizeXTextUpdated( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDateTextUpdated( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDateApplyClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRevisionTextUpdated( wxCommandEvent& event ) { event.Skip(); } virtual void OnRevisionTextUpdated( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTitleTextUpdated( wxCommandEvent& event ) { event.Skip(); } virtual void OnTitleTextUpdated( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCheckboxTitleClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnCheckboxTitleClick( wxCommandEvent& event ) { event.Skip(); }
...@@ -107,7 +137,7 @@ class DIALOG_PAGES_SETTINGS_BASE : public DIALOG_SHIM ...@@ -107,7 +137,7 @@ class DIALOG_PAGES_SETTINGS_BASE : public DIALOG_SHIM
public: public:
DIALOG_PAGES_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Page Settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 748,495 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_PAGES_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Page Settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 748,464 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PAGES_SETTINGS_BASE(); ~DIALOG_PAGES_SETTINGS_BASE();
}; };
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/** /**
* @file displlst.cpp * @file displlst.cpp
*/ */
...@@ -25,23 +49,22 @@ EDA_LIST_DIALOG::EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitl ...@@ -25,23 +49,22 @@ EDA_LIST_DIALOG::EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitl
column.SetId( i ); column.SetId( i );
column.SetText( aItemHeaders.Item( i ) ); column.SetText( aItemHeaders.Item( i ) );
column.SetWidth( 300 / aItemHeaders.Count() ); column.SetWidth( 300 / aItemHeaders.Count() );
EDA_LIST_DIALOG_BASE::m_listBox->InsertColumn( i, column ); m_listBox->InsertColumn( i, column );
} }
InsertItems( aItemList, 0 ); InsertItems( aItemList, 0 );
if( m_sortList )
sortList();
if( !aRefText.IsEmpty() ) // try to select the item matching aRefText if( !aRefText.IsEmpty() ) // try to select the item matching aRefText
{ {
for( unsigned ii = 0; ii < aItemList.size(); ii++ ) for( unsigned ii = 0; ii < aItemList.size(); ii++ )
{
if( aItemList[ii][0] == aRefText ) if( aItemList[ii][0] == aRefText )
{ {
m_listBox->SetItemState( ii, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED ); m_listBox->SetItemState( ii, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
break; break;
} }
} }
}
if( m_callBackFct == NULL ) if( m_callBackFct == NULL )
{ {
...@@ -85,12 +108,25 @@ void EDA_LIST_DIALOG::textChangeInFilterBox( wxCommandEvent& event ) ...@@ -85,12 +108,25 @@ void EDA_LIST_DIALOG::textChangeInFilterBox( wxCommandEvent& event )
sortList(); sortList();
} }
wxString EDA_LIST_DIALOG::GetTextSelection()
wxString EDA_LIST_DIALOG::GetTextSelection( int aColumn )
{ {
wxCHECK_MSG( aColumn < m_listBox->GetColumnCount(), wxEmptyString,
wxT( "Invalid list control column." ) );
wxListItem info;
wxString text;
long item = -1; long item = -1;
item = m_listBox->GetNextItem( item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED ); item = m_listBox->GetNextItem( item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
wxString text = m_listBox->GetItemText( item );
return text; info.m_mask = wxLIST_MASK_TEXT;
info.m_itemId = item;
info.m_col = aColumn;
if( !m_listBox->GetItem( info ) )
return wxEmptyString;
return info.m_text;
} }
...@@ -107,18 +143,26 @@ void EDA_LIST_DIALOG::Append( const wxArrayString& itemList ) ...@@ -107,18 +143,26 @@ void EDA_LIST_DIALOG::Append( const wxArrayString& itemList )
} }
} }
void EDA_LIST_DIALOG::InsertItems( const std::vector<wxArrayString>& itemList,
int position ) void EDA_LIST_DIALOG::InsertItems( const std::vector< wxArrayString >& itemList, int position )
{ {
for( unsigned i = 0; i < itemList.size(); i++ ) for( unsigned row = 0; row < itemList.size(); row++ )
{ {
long itemIndex = m_listBox->InsertItem( position+i, itemList[i].Item( 0 ) ); wxASSERT( (int) itemList[row].GetCount() == m_listBox->GetColumnCount() );
m_listBox->SetItemData( itemIndex, (long) &( itemList[i].Item( 0 ) ) );
// Adding the next columns content for( unsigned col = 0; col < itemList[row].GetCount(); col++ )
for( unsigned j = 1; j < itemList[i].GetCount(); j++ ) {
long itemIndex;
if( col == 0 )
{
itemIndex = m_listBox->InsertItem( row+position, itemList[row].Item( col ) );
m_listBox->SetItemData( itemIndex, (long) &itemList[row].Item( col ) );
}
else
{ {
m_listBox->SetItem( itemIndex, j, itemList[i].Item( j ) ); m_listBox->SetItem( itemIndex, col, itemList[row].Item( col ) );
}
} }
} }
...@@ -174,6 +218,7 @@ static int wxCALLBACK MyCompareFunction( long aItem1, long aItem2, long aSortDat ...@@ -174,6 +218,7 @@ static int wxCALLBACK MyCompareFunction( long aItem1, long aItem2, long aSortDat
return StrNumCmp( *component1Name, *component2Name, INT_MAX, true ); return StrNumCmp( *component1Name, *component2Name, INT_MAX, true );
} }
void EDA_LIST_DIALOG::sortList() void EDA_LIST_DIALOG::sortList()
{ {
m_listBox->SortItems( MyCompareFunction, 0 ); m_listBox->SortItems( MyCompareFunction, 0 );
......
...@@ -174,7 +174,8 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* aParent, ...@@ -174,7 +174,8 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* aParent,
EDA_DRAW_FRAME::~EDA_DRAW_FRAME() EDA_DRAW_FRAME::~EDA_DRAW_FRAME()
{ {
SAFE_DELETE( m_currentScreen ); delete m_currentScreen;
m_currentScreen = NULL;
m_auimgr.UnInit(); m_auimgr.UnInit();
} }
......
...@@ -266,7 +266,7 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel, ...@@ -266,7 +266,7 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
const wxPoint& aPos, const wxPoint& aPos,
EDA_COLOR_T aColor, EDA_COLOR_T aColor,
const wxString& aText, const wxString& aText,
int aOrient, double aOrient,
const wxSize& aSize, const wxSize& aSize,
enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_HJUSTIFY_T aH_justify,
enum EDA_TEXT_VJUSTIFY_T aV_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify,
...@@ -566,7 +566,7 @@ void DrawGraphicHaloText( EDA_DRAW_PANEL * aPanel, ...@@ -566,7 +566,7 @@ void DrawGraphicHaloText( EDA_DRAW_PANEL * aPanel,
enum EDA_COLOR_T aColor1, enum EDA_COLOR_T aColor1,
enum EDA_COLOR_T aColor2, enum EDA_COLOR_T aColor2,
const wxString &aText, const wxString &aText,
int aOrient, double aOrient,
const wxSize &aSize, const wxSize &aSize,
enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_HJUSTIFY_T aH_justify,
enum EDA_TEXT_VJUSTIFY_T aV_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify,
...@@ -611,7 +611,7 @@ void DrawGraphicHaloText( EDA_DRAW_PANEL * aPanel, ...@@ -611,7 +611,7 @@ void DrawGraphicHaloText( EDA_DRAW_PANEL * aPanel,
void PLOTTER::Text( const wxPoint& aPos, void PLOTTER::Text( const wxPoint& aPos,
enum EDA_COLOR_T aColor, enum EDA_COLOR_T aColor,
const wxString& aText, const wxString& aText,
int aOrient, double aOrient,
const wxSize& aSize, const wxSize& aSize,
enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_HJUSTIFY_T aH_justify,
enum EDA_TEXT_VJUSTIFY_T aV_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify,
......
This diff is collapsed.
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <class_board_item.h> #include <class_board_item.h>
#elif defined( EESCHEMA ) #elif defined( EESCHEMA )
#include <sch_item_struct.h> #include <sch_item_struct.h>
#elif defined( GERBVIEW )
#else #else
#error "Cannot resolve units formatting due to no definition of EESCHEMA or PCBNEW." #error "Cannot resolve units formatting due to no definition of EESCHEMA or PCBNEW."
#endif #endif
...@@ -325,10 +326,12 @@ bool EDA_TEXT::IsDefaultFormatting() const ...@@ -325,10 +326,12 @@ bool EDA_TEXT::IsDefaultFormatting() const
&& ( m_MultilineAllowed == false ) ); && ( m_MultilineAllowed == false ) );
} }
void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControlBits ) const void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControlBits ) const
throw( IO_ERROR ) throw( IO_ERROR )
{ {
#ifndef GERBVIEW // Gerbview does not use EDA_TEXT::Format
// and does not define FMT_IU, used here
// however this function should exist
if( !IsDefaultFormatting() ) if( !IsDefaultFormatting() )
{ {
aFormatter->Print( aNestLevel+1, "(effects" ); aFormatter->Print( aNestLevel+1, "(effects" );
...@@ -381,4 +384,5 @@ void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl ...@@ -381,4 +384,5 @@ void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl
aFormatter->Print( 0, ")\n" ); aFormatter->Print( 0, ")\n" );
} }
#endif
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -55,6 +55,7 @@ LAYER_MSK g_TabAllCopperLayerMask[NB_COPPER_LAYERS] = { ...@@ -55,6 +55,7 @@ LAYER_MSK g_TabAllCopperLayerMask[NB_COPPER_LAYERS] = {
DISPLAY_OPTIONS DisplayOpt; // Display options for board items DISPLAY_OPTIONS DisplayOpt; // Display options for board items
// This will be always be 450 or 900 (by UI design) at the moment
int g_RotationAngle; int g_RotationAngle;
int g_AnchorColor = BLUE; int g_AnchorColor = BLUE;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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