Commit 4f29440f authored by Cirilo Bernardo's avatar Cirilo Bernardo Committed by jean-pierre charras

add patch from Cirilo Bernardo (about IDF export) , and minor fixes.

parents dc259223 f7ca6e4b
......@@ -59,7 +59,7 @@ void S3D_MATERIAL::SetMaterial()
void S3D_MASTER::Copy( S3D_MASTER* pattern )
{
m_Shape3DName = pattern->m_Shape3DName;
SetShape3DName( pattern->GetShape3DName() );
m_MatScale = pattern->m_MatScale;
m_MatRotation = pattern->m_MatRotation;
m_MatPosition = pattern->m_MatPosition;
......@@ -74,6 +74,7 @@ S3D_MASTER::S3D_MASTER( EDA_ITEM* aParent ) :
m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0;
m_3D_Drawings = NULL;
m_Materials = NULL;
m_ShapeType = FILE3D_NONE;
}
......@@ -96,6 +97,45 @@ S3D_MASTER:: ~S3D_MASTER()
}
bool S3D_MASTER::Is3DType( enum FILE3D_TYPE aShapeType )
{
// type 'none' is not valid and will always return false
if( aShapeType == FILE3D_NONE )
return false;
// no one is interested if we have no file
if( m_Shape3DName.empty() )
return false;
if( aShapeType == m_ShapeType )
return true;
return false;
}
void S3D_MASTER::SetShape3DName( const wxString& aShapeName )
{
m_ShapeType = FILE3D_NONE;
m_Shape3DName = aShapeName;
if( m_Shape3DName.empty() )
return;
wxFileName fn = m_Shape3DName;
wxString ext = fn.GetExt();
if( ext == wxT( "wrl" ) || ext == wxT( "x3d" ) )
m_ShapeType = FILE3D_VRML;
else if( ext == wxT( "idf" ) )
m_ShapeType = FILE3D_IDF;
else
m_ShapeType = FILE3D_UNKNOWN;
return;
}
STRUCT_3D_SHAPE::STRUCT_3D_SHAPE( EDA_ITEM* aParent ) :
EDA_ITEM( aParent, NOT_USED )
{
......
......@@ -857,7 +857,7 @@ void MODULE::ReadAndInsert3DComponentShape( EDA_3D_CANVAS* glcanvas )
for( ; struct3D != NULL; struct3D = struct3D->Next() )
{
if( !struct3D->m_Shape3DName.IsEmpty() )
if( struct3D->Is3DType( S3D_MASTER::FILE3D_VRML ) )
struct3D->ReadData();
}
......
......@@ -92,13 +92,24 @@ public:
class S3D_MASTER : public EDA_ITEM
{
public:
wxString m_Shape3DName; /* 3D shape name in 3D library */
S3D_VERTEX m_MatScale;
S3D_VERTEX m_MatRotation;
S3D_VERTEX m_MatPosition;
STRUCT_3D_SHAPE* m_3D_Drawings;
S3D_MATERIAL* m_Materials;
enum FILE3D_TYPE
{
FILE3D_NONE = 0,
FILE3D_VRML,
FILE3D_IDF,
FILE3D_UNKNOWN
};
private:
wxString m_Shape3DName; /* 3D shape name in 3D library */
FILE3D_TYPE m_ShapeType;
public:
S3D_MASTER( EDA_ITEM* aParent );
~S3D_MASTER();
......@@ -120,6 +131,20 @@ public:
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif
/**
* Function Is3DType
* returns true if the argument matches the type of model referred to
* by m_Shape3DName
*/
bool Is3DType( enum FILE3D_TYPE aShapeType );
const wxString& GetShape3DName( void )
{
return m_Shape3DName;
}
void SetShape3DName( const wxString& aShapeName );
};
......
......@@ -171,10 +171,11 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" )
endif()
# quiet GCC 4.8.1 while in boost
# quiet GCC while in boost
if( GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8 )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs" )
endif()
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-strict-aliasing" )
if( APPLE )
set( KICAD_BUILD_STATIC ON)
......@@ -185,7 +186,7 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
if( NOT CMAKE_CXX_COMPILER )
EXEC_PROGRAM( wx-config ARGS --cc OUTPUT_VARIABLE CMAKE_C_COMPILER )
endif( NOT CMAKE_CXX_COMPILER )
if( NOT CMAKE_CXX_COMPILER )
EXEC_PROGRAM( wx-config ARGS --cxx OUTPUT_VARIABLE CMAKE_CXX_COMPILER )
endif( NOT CMAKE_CXX_COMPILER )
......@@ -291,7 +292,7 @@ add_definitions(-DWX_COMPATIBILITY)
find_package( OpenGL QUIET )
check_find_package_result( OPENGL_FOUND "OpenGL" )
if ( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
if ( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
#set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so;.dylib;.dll")
......@@ -322,7 +323,7 @@ if ( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
include( download_cairo )
set( CAIRO_INCLUDE_DIR "${CAIRO_ROOT}/include/cairo")
set( CAIRO_LIBRARY "${CAIRO_ROOT}/lib/libcairo.a")
endif( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC)
......
......@@ -6,7 +6,7 @@
#endif
#ifndef KICAD_BUILD_VERSION
# define KICAD_BUILD_VERSION "(2013-jul-14)"
# define KICAD_BUILD_VERSION "(2014-jan-25)"
#endif
/**
......
......@@ -97,4 +97,5 @@ const wxString PSFileWildcard( _( "PostScript files (.ps)|*.ps" ) );
const wxString ReportFileWildcard = _( "Report files (*.rpt)|*.rpt" );
const wxString FootprintPlaceFileWildcard = _( "Footprint place files (*.pos)|*.pos" );
const wxString Shapes3DFileWildcard( _( "Vrml and x3d files (*.wrl *.x3d)|*.wrl;*.x3d" ) );
const wxString IDF3DFileWildcard( _( "IDFv3 component files (*.idf)|*.idf" ) );
const wxString TextWildcard( _( "Text files (*.txt)|*.txt" ) );
This source diff could not be displayed because it is too large. You can view the blob instead.
(export (version D)
(design
(source F:/kicad-launchpad/testing/demos/complex_hierarchy/complex_hierarchy.sch)
(date "09/01/2014 08:56:21")
(tool "eeschema (2014-01-08 BZR 4616)-product"))
(date "25/01/2014 08:31:41")
(tool "eeschema (2014-01-22 BZR 4630)-product"))
(components
(comp (ref C10)
(value 10uF)
......
update=09/01/2014 08:59:03
update=25/01/2014 08:37:41
version=1
last_client=kicad
[cvpcb]
version=1
NetITyp=0
NetIExt=.net
PkgIExt=.pkg
NetDir=
LibDir=
NetType=0
NetIExt=net
[cvpcb/libraries]
EquName1=devcms
[eeschema]
version=1
LibDir=F:\\kicad\\share\\library
NetFmt=1
HPGLSpd=20
HPGLDm=15
HPGLNum=1
offX_A4=0
offY_A4=0
offX_A3=0
offY_A3=0
offX_A2=0
offY_A2=0
offX_A1=0
offY_A1=0
offX_A0=0
offY_A0=0
offX_A=0
offY_A=0
offX_B=0
offY_B=0
offX_C=0
offY_C=0
offX_D=0
offY_D=0
offX_E=0
offY_E=0
PageLayoutDescrFile=
SubpartIdSeparator=0
SubpartFirstId=65
LibDir=F:/kicad/share/library
NetFmtName=
RptD_X=0
RptD_Y=100
RptLab=1
SimCmd=
UseNetN=0
LabSize=60
PrintMonochrome=1
ShowSheetReferenceAndTitleBlock=1
[eeschema/libraries]
LibName1=power
LibName2=device
......@@ -57,32 +28,25 @@ LibName7=interface
LibName8=special
[pcbnew]
version=1
PadDrlX=320
PadDimH=600
PadDimV=600
BoardThickness=630
TxtPcbV=800
TxtPcbH=600
TxtModV=600
TxtModH=600
TxtModW=120
VEgarde=100
DrawLar=150
EdgeLar=150
TxtLar=120
MSegLar=150
PageLayoutDescrFile=
LastNetListRead=
UseCmpFile=1
PadDrill=0.8128
PadDrillOvalY=0.8128
PadSizeH=2.286
PadSizeV=2.286
PcbTextSizeV=2
PcbTextSizeH=2
PcbTextThickness=0.3
ModuleTextSizeV=1
ModuleTextSizeH=1
ModuleTextSizeThickness=0.2
SolderMaskClearance=0.254
SolderMaskMinWidth=0
DrawSegmentWidth=0.3
BoardOutlineThickness=0.09999999999999999
ModuleOutlineThickness=0.2
[pcbnew/libraries]
LibDir=
LibName1=sockets
LibName2=connect
LibName3=discret
LibName4=pin_array
LibName5=divers
LibName6=libcms
LibName7=display
LibName8=valves
LibName9=led
LibName10=dip_sockets
[general]
version=1
update=10/01/2014 20:45:48
update=24/01/2014 13:22:43
last_client=eeschema
[general]
version=1
[cvpcb]
version=1
NetIExt=net
[cvpcb/libraries]
EquName1=devcms
[pcbnew]
version=1
PageLayoutDescrFile=
LastNetListRead=
UseCmpFile=1
PadDrill=0.000000000000
PadDrillOvalY=0.000000000000
PadSizeH=0.406400000000
PadSizeV=1.270000000000
PcbTextSizeV=2.032000000000
PcbTextSizeH=1.524000000000
PcbTextThickness=0.304800000000
ModuleTextSizeV=1.524000000000
ModuleTextSizeH=1.524000000000
ModuleTextSizeThickness=0.304800000000
SolderMaskClearance=0.200000000000
SolderMaskMinWidth=0.000000000000
DrawSegmentWidth=0.381000000000
BoardOutlineThickness=0.381000000000
ModuleOutlineThickness=0.152400000000
PadDrill=0
PadDrillOvalY=0
PadSizeH=0.4064
PadSizeV=1.27
PcbTextSizeV=2.032
PcbTextSizeH=1.524
PcbTextThickness=0.3048
ModuleTextSizeV=1.524
ModuleTextSizeH=1.524
ModuleTextSizeThickness=0.3048
SolderMaskClearance=0.2
SolderMaskMinWidth=0
DrawSegmentWidth=0.381
BoardOutlineThickness=0.381
ModuleOutlineThickness=0.1524
[pcbnew/libraries]
LibDir=
LibName1=sockets
LibName2=dip_sockets
LibName3=connect
LibName4=discret
LibName5=pin_array
LibName6=divers
LibName7=libcms
LibName8=display
LibName9=valves
[general]
version=1
[eeschema]
version=1
PageLayoutDescrFile=
......@@ -51,24 +48,9 @@ LibName4=conn
LibName5=linear
LibName6=regul
LibName7=74xx
LibName8=cmos4000
LibName9=adc-dac
LibName10=memory
LibName11=xilinx
LibName12=special
LibName13=microcontrollers
LibName14=dsp
LibName15=microchip
LibName16=analog_switches
LibName17=motorola
LibName18=texas
LibName19=intel
LibName20=audio
LibName21=interface
LibName22=digital-audio
LibName23=philips
LibName24=display
LibName25=cypress
LibName26=siliconi
LibName27=contrib
LibName28=valves
LibName8=adc-dac
LibName9=memory
LibName10=xilinx
LibName11=special
LibName12=microcontrollers
LibName13=motorola
EESchema Schematic File Version 2 date 27/11/2009 11:46:34
EESchema Schematic File Version 2
LIBS:power
LIBS:device
LIBS:transistors
......@@ -6,31 +6,17 @@ LIBS:conn
LIBS:linear
LIBS:regul
LIBS:74xx
LIBS:cmos4000
LIBS:adc-dac
LIBS:memory
LIBS:xilinx
LIBS:special
LIBS:microcontrollers
LIBS:dsp
LIBS:microchip
LIBS:analog_switches
LIBS:motorola
LIBS:texas
LIBS:intel
LIBS:audio
LIBS:interface
LIBS:digital-audio
LIBS:philips
LIBS:display
LIBS:cypress
LIBS:siliconi
LIBS:contrib
LIBS:valves
LIBS:kit-dev-coldfire-xilinx_5213-cache
EELAYER 23 0
EELAYER 24 0
EELAYER END
$Descr A4 11700 8267
$Descr A4 11693 8268
encoding utf-8
Sheet 3 3
Title "Dev kit coldfire 5213"
Date "8 feb 2008"
......@@ -377,6 +363,8 @@ U 1 1 480DCF5A
P 3500 4100
F 0 "#PWR0105" H 3500 4100 30 0001 C CNN
F 1 "GND" H 3500 4030 30 0001 C CNN
F 2 "" H 3500 4100 60 0001 C CNN
F 3 "" H 3500 4100 60 0001 C CNN
1 3500 4100
0 1 1 0
$EndComp
......@@ -386,6 +374,8 @@ U 1 1 4791D619
P 10850 3900
F 0 "#PWR0106" H 10850 3860 30 0001 C CNN
F 1 "+3,3V" H 10850 4010 30 0000 C CNN
F 2 "" H 10850 3900 60 0001 C CNN
F 3 "" H 10850 3900 60 0001 C CNN
1 10850 3900
1 0 0 -1
$EndComp
......@@ -395,6 +385,8 @@ U 1 1 4791D59D
P 10450 3900
F 0 "R64" V 10530 3900 50 0000 C CNN
F 1 "3,3" V 10450 3900 50 0000 C CNN
F 2 "" H 10450 3900 60 0001 C CNN
F 3 "" H 10450 3900 60 0001 C CNN
1 10450 3900
0 1 1 0
$EndComp
......@@ -428,6 +420,8 @@ U 1 1 470F3BF2
P 3450 1250
F 0 "#PWR0107" H 3450 1250 30 0001 C CNN
F 1 "GND" H 3450 1180 30 0001 C CNN
F 2 "" H 3450 1250 60 0001 C CNN
F 3 "" H 3450 1250 60 0001 C CNN
1 3450 1250
1 0 0 -1
$EndComp
......@@ -476,6 +470,8 @@ U 1 1 46A76EB2
P 6600 1250
F 0 "P3" H 6600 1400 50 0000 C CNN
F 1 "CONN_2X2" H 6610 1120 40 0000 C CNN
F 2 "" H 6600 1250 60 0001 C CNN
F 3 "" H 6600 1250 60 0001 C CNN
1 6600 1250
-1 0 0 -1
$EndComp
......@@ -485,6 +481,8 @@ U 1 1 470F38BE
P 4550 4100
F 0 "U9" H 4600 4150 70 0000 C CNN
F 1 "XCR3256-TQ144" H 4550 500 60 0000 C CNN
F 2 "" H 4550 4100 60 0001 C CNN
F 3 "" H 4550 4100 60 0001 C CNN
1 4550 4100
1 0 0 -1
$EndComp
......@@ -584,6 +582,8 @@ U 1 1 46ADE620
P 9600 4000
F 0 "#PWR0108" H 9600 4000 30 0001 C CNN
F 1 "GND" H 9600 3930 30 0001 C CNN
F 2 "" H 9600 4000 60 0001 C CNN
F 3 "" H 9600 4000 60 0001 C CNN
1 9600 4000
0 -1 -1 0
$EndComp
......@@ -593,6 +593,8 @@ U 1 1 46ADE61B
P 9600 2100
F 0 "#PWR0109" H 9600 2100 30 0001 C CNN
F 1 "GND" H 9600 2030 30 0001 C CNN
F 2 "" H 9600 2100 60 0001 C CNN
F 3 "" H 9600 2100 60 0001 C CNN
1 9600 2100
0 -1 -1 0
$EndComp
......@@ -660,6 +662,8 @@ U 1 1 46ADE55A
P 9200 3050
F 0 "P4" H 9250 3100 60 0000 C CNN
F 1 "CONN_20X2" V 9200 3050 50 0000 C CNN
F 2 "" H 9200 3050 60 0001 C CNN
F 3 "" H 9200 3050 60 0001 C CNN
1 9200 3050
1 0 0 -1
$EndComp
......@@ -699,6 +703,8 @@ U 1 1 46A76BD3
P 2750 1300
F 0 "#PWR0110" H 2750 1260 30 0001 C CNN
F 1 "+3,3V" V 2750 1500 30 0000 C CNN
F 2 "" H 2750 1300 60 0001 C CNN
F 3 "" H 2750 1300 60 0001 C CNN
1 2750 1300
0 1 1 0
$EndComp
......@@ -708,6 +714,8 @@ U 1 1 46A76BD2
P 3550 650
F 0 "#PWR0111" H 3550 610 30 0001 C CNN
F 1 "+3,3V" H 3550 760 30 0000 C CNN
F 2 "" H 3550 650 60 0001 C CNN
F 3 "" H 3550 650 60 0001 C CNN
1 3550 650
1 0 0 -1
$EndComp
......@@ -717,6 +725,8 @@ U 1 1 46A76BCA
P 3300 650
F 0 "R57" V 3380 650 50 0000 C CNN
F 1 "4K7" V 3300 650 50 0000 C CNN
F 2 "" H 3300 650 60 0001 C CNN
F 3 "" H 3300 650 60 0001 C CNN
1 3300 650
0 1 1 0
$EndComp
......@@ -728,6 +738,8 @@ U 1 1 46A76BC5
P 9500 4950
F 0 "#PWR0112" H 9500 4950 40 0001 C CNN
F 1 "GND" H 9500 4880 40 0001 C CNN
F 2 "" H 9500 4950 60 0001 C CNN
F 3 "" H 9500 4950 60 0001 C CNN
1 9500 4950
0 -1 -1 0
$EndComp
......@@ -737,6 +749,8 @@ U 1 1 46A76BC4
P 9300 4950
F 0 "D8" H 9300 5050 50 0000 C CNN
F 1 "LED" H 9300 4850 50 0000 C CNN
F 2 "" H 9300 4950 60 0001 C CNN
F 3 "" H 9300 4950 60 0001 C CNN
1 9300 4950
1 0 0 -1
$EndComp
......@@ -746,6 +760,8 @@ U 1 1 46A76BC3
P 8800 4950
F 0 "R62" V 8880 4950 50 0000 C CNN
F 1 "1K" V 8800 4950 50 0000 C CNN
F 2 "" H 8800 4950 60 0001 C CNN
F 3 "" H 8800 4950 60 0001 C CNN
1 8800 4950
0 -1 -1 0
$EndComp
......@@ -755,6 +771,8 @@ U 1 1 46A76BC1
P 7650 6650
F 0 "#PWR0113" H 7650 6650 30 0001 C CNN
F 1 "GND" H 7650 6580 30 0001 C CNN
F 2 "" H 7650 6650 60 0001 C CNN
F 3 "" H 7650 6650 60 0001 C CNN
1 7650 6650
1 0 0 -1
$EndComp
......@@ -764,6 +782,8 @@ U 1 1 46A76BBF
P 7650 6050
F 0 "#PWR0114" H 7650 6010 30 0001 C CNN
F 1 "+3,3V" H 7650 6160 30 0000 C CNN
F 2 "" H 7650 6050 60 0001 C CNN
F 3 "" H 7650 6050 60 0001 C CNN
1 7650 6050
1 0 0 -1
$EndComp
......@@ -773,6 +793,8 @@ U 1 1 46A76BBC
P 10650 6350
F 0 "C61" H 10700 6450 50 0000 L CNN
F 1 "100nF" H 10650 6250 50 0000 L CNN
F 2 "" H 10650 6350 60 0001 C CNN
F 3 "" H 10650 6350 60 0001 C CNN
1 10650 6350
1 0 0 -1
$EndComp
......@@ -782,6 +804,8 @@ U 1 1 46A76BBB
P 10350 6350
F 0 "C60" H 10400 6450 50 0000 L CNN
F 1 "100nF" H 10350 6250 50 0000 L CNN
F 2 "" H 10350 6350 60 0001 C CNN
F 3 "" H 10350 6350 60 0001 C CNN
1 10350 6350
1 0 0 -1
$EndComp
......@@ -791,6 +815,8 @@ U 1 1 46A76BBA
P 10050 6350
F 0 "C59" H 10100 6450 50 0000 L CNN
F 1 "100nF" H 10050 6250 50 0000 L CNN
F 2 "" H 10050 6350 60 0001 C CNN
F 3 "" H 10050 6350 60 0001 C CNN
1 10050 6350
1 0 0 -1
$EndComp
......@@ -800,6 +826,8 @@ U 1 1 46A76BB5
P 8550 6350
F 0 "C54" H 8600 6450 50 0000 L CNN
F 1 "100nF" H 8550 6250 50 0000 L CNN
F 2 "" H 8550 6350 60 0001 C CNN
F 3 "" H 8550 6350 60 0001 C CNN
1 8550 6350
1 0 0 -1
$EndComp
......@@ -809,6 +837,8 @@ U 1 1 46A76BB4
P 8250 6350
F 0 "C53" H 8300 6450 50 0000 L CNN
F 1 "100nF" H 8250 6250 50 0000 L CNN
F 2 "" H 8250 6350 60 0001 C CNN
F 3 "" H 8250 6350 60 0001 C CNN
1 8250 6350
1 0 0 -1
$EndComp
......@@ -818,6 +848,8 @@ U 1 1 46A76BB3
P 7950 6350
F 0 "C52" H 8000 6450 50 0000 L CNN
F 1 "100nF" H 7950 6250 50 0000 L CNN
F 2 "" H 7950 6350 60 0001 C CNN
F 3 "" H 7950 6350 60 0001 C CNN
1 7950 6350
1 0 0 -1
$EndComp
......@@ -827,6 +859,8 @@ U 1 1 46A76BB2
P 7650 6350
F 0 "C51" H 7700 6450 50 0000 L CNN
F 1 "100nF" H 7650 6250 50 0000 L CNN
F 2 "" H 7650 6350 60 0001 C CNN
F 3 "" H 7650 6350 60 0001 C CNN
1 7650 6350
1 0 0 -1
$EndComp
......@@ -836,6 +870,8 @@ U 1 1 46A76BB1
P 9750 6350
F 0 "C58" H 9800 6450 50 0000 L CNN
F 1 "100nF" H 9750 6250 50 0000 L CNN
F 2 "" H 9750 6350 60 0001 C CNN
F 3 "" H 9750 6350 60 0001 C CNN
1 9750 6350
1 0 0 -1
$EndComp
......@@ -845,6 +881,8 @@ U 1 1 46A76BB0
P 9450 6350
F 0 "C57" H 9500 6450 50 0000 L CNN
F 1 "100nF" H 9450 6250 50 0000 L CNN
F 2 "" H 9450 6350 60 0001 C CNN
F 3 "" H 9450 6350 60 0001 C CNN
1 9450 6350
1 0 0 -1
$EndComp
......@@ -854,6 +892,8 @@ U 1 1 46A76BAF
P 9150 6350
F 0 "C56" H 9200 6450 50 0000 L CNN
F 1 "100nF" H 9150 6250 50 0000 L CNN
F 2 "" H 9150 6350 60 0001 C CNN
F 3 "" H 9150 6350 60 0001 C CNN
1 9150 6350
1 0 0 -1
$EndComp
......@@ -863,6 +903,8 @@ U 1 1 46A76BAE
P 8850 6350
F 0 "C55" H 8900 6450 50 0000 L CNN
F 1 "100nF" H 8850 6250 50 0000 L CNN
F 2 "" H 8850 6350 60 0001 C CNN
F 3 "" H 8850 6350 60 0001 C CNN
1 8850 6350
1 0 0 -1
$EndComp
......@@ -876,6 +918,8 @@ U 1 1 46A76BA9
P 9500 5250
F 0 "#PWR0115" H 9500 5250 40 0001 C CNN
F 1 "GND" H 9500 5180 40 0001 C CNN
F 2 "" H 9500 5250 60 0001 C CNN
F 3 "" H 9500 5250 60 0001 C CNN
1 9500 5250
0 -1 -1 0
$EndComp
......@@ -885,6 +929,8 @@ U 1 1 46A76BA8
P 9300 5250
F 0 "D9" H 9300 5350 50 0000 C CNN
F 1 "LED" H 9300 5150 50 0000 C CNN
F 2 "" H 9300 5250 60 0001 C CNN
F 3 "" H 9300 5250 60 0001 C CNN
1 9300 5250
1 0 0 -1
$EndComp
......@@ -894,6 +940,8 @@ U 1 1 46A76BA7
P 8800 5250
F 0 "R63" V 8880 5250 50 0000 C CNN
F 1 "1K" V 8800 5250 50 0000 C CNN
F 2 "" H 8800 5250 60 0001 C CNN
F 3 "" H 8800 5250 60 0001 C CNN
1 8800 5250
0 -1 -1 0
$EndComp
......@@ -909,6 +957,8 @@ U 1 1 46A76BA6
P 2350 1050
F 0 "P1" V 2300 1050 60 0000 C CNN
F 1 "CONN_6" V 2400 1050 60 0000 C CNN
F 2 "" H 2350 1050 60 0001 C CNN
F 3 "" H 2350 1050 60 0001 C CNN
1 2350 1050
-1 0 0 1
$EndComp
......@@ -918,6 +968,8 @@ U 1 1 46A76BA5
P 2700 1200
F 0 "#PWR0116" H 2700 1200 40 0001 C CNN
F 1 "GND" H 2700 1130 40 0001 C CNN
F 2 "" H 2700 1200 60 0001 C CNN
F 3 "" H 2700 1200 60 0001 C CNN
1 2700 1200
0 -1 -1 0
$EndComp
......
......@@ -94,6 +94,7 @@ extern const wxString SVGFileWildcard;
extern const wxString ReportFileWildcard;
extern const wxString FootprintPlaceFileWildcard;
extern const wxString Shapes3DFileWildcard;
extern const wxString IDF3DFileWildcard;
extern const wxString DocModulesFileName;
extern const wxString LegacyFootprintLibPathWildcard;
extern const wxString KiCadFootprintLibFileWildcard;
......
......@@ -36,15 +36,12 @@
#include <bezier_curves.h>
#include <class_drawpanel.h>
#include <class_pcb_screen.h>
#include <kicad_string.h>
#include <colors_selection.h>
#include <trigo.h>
#include <richio.h>
#include <pcbcommon.h>
#include <msgpanel.h>
#include <pcbnew.h>
#include <math_for_graphics.h>
#include <class_board.h>
#include <class_module.h>
......
......@@ -146,7 +146,7 @@ MODULE::MODULE( const MODULE& aModule ) :
// Copy auxiliary data: 3D_Drawings info
for( S3D_MASTER* item = aModule.m_3D_Drawings; item; item = item->Next() )
{
if( item->m_Shape3DName.IsEmpty() ) // do not copy empty shapes.
if( item->GetShape3DName().IsEmpty() ) // do not copy empty shapes.
continue;
S3D_MASTER* t3d = m_3D_Drawings;
......@@ -270,12 +270,12 @@ void MODULE::Copy( MODULE* aModule )
for( S3D_MASTER* item = aModule->m_3D_Drawings; item; item = item->Next() )
{
if( item->m_Shape3DName.IsEmpty() ) // do not copy empty shapes.
if( item->GetShape3DName().IsEmpty() ) // do not copy empty shapes.
continue;
S3D_MASTER* t3d = m_3D_Drawings;
if( t3d && t3d->m_Shape3DName.IsEmpty() ) // The first entry can
if( t3d && t3d->GetShape3DName().IsEmpty() ) // The first entry can
{ // exist, but is empty : use it.
t3d->Copy( item );
}
......@@ -530,9 +530,9 @@ void MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
// Search the first active 3D shape in list
for( S3D_MASTER* struct3D = m_3D_Drawings; struct3D; struct3D = struct3D->Next() )
{
if( !struct3D->m_Shape3DName.IsEmpty() )
if( !struct3D->GetShape3DName().IsEmpty() )
{
msg = struct3D->m_Shape3DName;
msg = struct3D->GetShape3DName();
break;
}
}
......
......@@ -249,12 +249,12 @@ void DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties()
while( draw3D )
{
if( !draw3D->m_Shape3DName.IsEmpty() )
if( !draw3D->GetShape3DName().IsEmpty() )
{
S3D_MASTER* draw3DCopy = new S3D_MASTER( NULL );
draw3DCopy->Copy( draw3D );
m_Shapes3D_list.push_back( draw3DCopy );
m_3D_ShapeNameListBox->Append( draw3DCopy->m_Shape3DName );
m_3D_ShapeNameListBox->Append( draw3DCopy->GetShape3DName() );
}
draw3D = (S3D_MASTER*) draw3D->Next();
}
......@@ -428,11 +428,16 @@ void DIALOG_MODULE_BOARD_EDITOR::Browse3DLib( wxCommandEvent& event )
fullpath.Replace( wxT( "/" ), wxT( "\\" ) );
#endif
wxString fileFilters;
fileFilters = wxGetTranslation( Shapes3DFileWildcard );
fileFilters += wxChar( '|' );
fileFilters += wxGetTranslation( IDF3DFileWildcard );
fullfilename = EDA_FileSelector( _( "3D Shape:" ),
fullpath,
wxEmptyString,
wxEmptyString,
wxGetTranslation( Shapes3DFileWildcard ),
wxGetTranslation( fileFilters ),
this,
wxFD_OPEN,
true
......@@ -474,7 +479,7 @@ void DIALOG_MODULE_BOARD_EDITOR::Browse3DLib( wxCommandEvent& event )
// Store filename in Unix notation
shortfilename.Replace( wxT( "\\" ), wxT( "/" ) );
#endif
new3DShape->m_Shape3DName = shortfilename;
new3DShape->SetShape3DName( shortfilename );
m_Shapes3D_list.push_back( new3DShape );
m_3D_ShapeNameListBox->Append( shortfilename );
......@@ -606,7 +611,7 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
{
S3D_MASTER* draw3DCopy = m_Shapes3D_list[ii];
if( draw3DCopy->m_Shape3DName.IsEmpty() )
if( draw3DCopy->GetShape3DName().IsEmpty() )
continue;
if( draw3D == NULL )
......@@ -615,7 +620,7 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
m_CurrentModule->Models().Append( draw3D );
}
draw3D->m_Shape3DName = draw3DCopy->m_Shape3DName;
draw3D->SetShape3DName( draw3DCopy->GetShape3DName() );
draw3D->m_MatScale = draw3DCopy->m_MatScale;
draw3D->m_MatRotation = draw3DCopy->m_MatRotation;
draw3D->m_MatPosition = draw3DCopy->m_MatPosition;
......
......@@ -98,12 +98,12 @@ void DIALOG_MODULE_MODULE_EDITOR::initModeditProperties()
while( draw3D )
{
if( !draw3D->m_Shape3DName.IsEmpty() )
if( !draw3D->GetShape3DName().IsEmpty() )
{
S3D_MASTER* draw3DCopy = new S3D_MASTER(NULL);
draw3DCopy->Copy( draw3D );
m_shapes3D_list.push_back( draw3DCopy );
m_3D_ShapeNameListBox->Append( draw3DCopy->m_Shape3DName );
m_3D_ShapeNameListBox->Append( draw3DCopy->GetShape3DName() );
}
draw3D = (S3D_MASTER*) draw3D->Next();
}
......@@ -292,11 +292,16 @@ void DIALOG_MODULE_MODULE_EDITOR::BrowseAndAdd3DLib( wxCommandEvent& event )
fullpath.Replace( wxT( "/" ), wxT( "\\" ) );
#endif
wxString fileFilters;
fileFilters = wxGetTranslation( Shapes3DFileWildcard );
fileFilters += wxChar( '|' );
fileFilters += wxGetTranslation( IDF3DFileWildcard );
fullfilename = EDA_FileSelector( _( "3D Shape:" ),
fullpath,
wxEmptyString,
wxEmptyString,
wxGetTranslation( Shapes3DFileWildcard ),
wxGetTranslation( fileFilters ),
this,
wxFD_OPEN,
true
......@@ -339,7 +344,7 @@ void DIALOG_MODULE_MODULE_EDITOR::BrowseAndAdd3DLib( wxCommandEvent& event )
shortfilename.Replace( wxT( "\\" ), wxT( "/" ) );
#endif
new3DShape->m_Shape3DName = shortfilename;
new3DShape->SetShape3DName( shortfilename );
m_shapes3D_list.push_back( new3DShape );
m_3D_ShapeNameListBox->Append( shortfilename );
......@@ -439,7 +444,7 @@ void DIALOG_MODULE_MODULE_EDITOR::OnOkClick( wxCommandEvent& event )
{
S3D_MASTER* draw3DCopy = m_shapes3D_list[ii];
if( draw3DCopy->m_Shape3DName.IsEmpty() )
if( draw3DCopy->GetShape3DName().IsEmpty() )
continue;
if( draw3D == NULL )
......@@ -448,7 +453,7 @@ void DIALOG_MODULE_MODULE_EDITOR::OnOkClick( wxCommandEvent& event )
m_currentModule->Models().Append( draw3D );
}
draw3D->m_Shape3DName = draw3DCopy->m_Shape3DName;
draw3D->SetShape3DName( draw3DCopy->GetShape3DName() );
draw3D->m_MatScale = draw3DCopy->m_MatScale;
draw3D->m_MatRotation = draw3DCopy->m_MatRotation;
draw3D->m_MatPosition = draw3DCopy->m_MatPosition;
......
......@@ -64,21 +64,21 @@ public:
SetFocus();
m_idfThouOpt = false;
m_config->Read( OPTKEY_IDF_THOU, &m_idfThouOpt );
m_chkThou->SetValue( m_idfThouOpt );
m_rbUnitSelection->SetSelection( m_idfThouOpt ? 1 : 0 );
GetSizer()->SetSizeHints( this );
Centre();
}
~DIALOG_EXPORT_IDF3()
{
m_idfThouOpt = m_chkThou->GetValue();
m_idfThouOpt = m_rbUnitSelection->GetSelection() == 1;
m_config->Write( OPTKEY_IDF_THOU, m_idfThouOpt );
}
bool GetThouOption()
{
return m_chkThou->GetValue();
return m_rbUnitSelection->GetSelection() == 1;
}
wxFilePickerCtrl* FilePicker()
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// C++ code generated with wxFormBuilder (version Nov 6 2013)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -16,17 +16,22 @@ DIALOG_EXPORT_IDF3_BASE::DIALOG_EXPORT_IDF3_BASE( wxWindow* parent, wxWindowID i
wxBoxSizer* bSizerIDFFile;
bSizerIDFFile = new wxBoxSizer( wxVERTICAL );
m_txtBrdFile = new wxStaticText( this, wxID_ANY, wxT("IDF Board file"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerIDFFile->SetMinSize( wxSize( 500,-1 ) );
m_txtBrdFile = new wxStaticText( this, wxID_ANY, _("IDF board file"), wxDefaultPosition, wxDefaultSize, 0 );
m_txtBrdFile->Wrap( -1 );
bSizerIDFFile->Add( m_txtBrdFile, 0, wxALL, 5 );
bSizerIDFFile->Add( m_txtBrdFile, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_filePickerIDF = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, wxT("Select a board file"), wxT("*.emn"), wxDefaultPosition, wxDefaultSize, wxFLP_OVERWRITE_PROMPT|wxFLP_SAVE|wxFLP_USE_TEXTCTRL );
m_filePickerIDF->SetMinSize( wxSize( 420,30 ) );
m_filePickerIDF = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, _("Select an IDF export filename"), wxT("*.emn"), wxDefaultPosition, wxSize( 450,-1 ), wxFLP_OVERWRITE_PROMPT|wxFLP_SAVE|wxFLP_USE_TEXTCTRL );
bSizerIDFFile->Add( m_filePickerIDF, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerIDFFile->Add( m_filePickerIDF, 0, wxALL, 5 );
wxString m_rbUnitSelectionChoices[] = { _("Millimeters"), _("Mils") };
int m_rbUnitSelectionNChoices = sizeof( m_rbUnitSelectionChoices ) / sizeof( wxString );
m_rbUnitSelection = new wxRadioBox( this, wxID_ANY, _("IDF File Units"), wxDefaultPosition, wxDefaultSize, m_rbUnitSelectionNChoices, m_rbUnitSelectionChoices, 1, wxRA_SPECIFY_COLS );
m_rbUnitSelection->SetSelection( 0 );
bSizerIDFFile->Add( m_rbUnitSelection, 0, wxALL, 5 );
m_chkThou = new wxCheckBox( this, wxID_ANY, wxT("unit: THOU"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerIDFFile->Add( m_chkThou, 0, wxALL, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerIDFFile->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
......@@ -35,7 +40,7 @@ DIALOG_EXPORT_IDF3_BASE::DIALOG_EXPORT_IDF3_BASE( wxWindow* parent, wxWindowID i
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize();
bSizerIDFFile->Add( m_sdbSizer1, 1, wxEXPAND, 5 );
bSizerIDFFile->Add( m_sdbSizer1, 0, wxALIGN_RIGHT, 5 );
this->SetSizer( bSizerIDFFile );
......
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// C++ code generated with wxFormBuilder (version Nov 6 2013)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -10,6 +10,7 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
#include "dialog_shim.h"
......@@ -20,7 +21,8 @@ class DIALOG_SHIM;
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/filepicker.h>
#include <wx/checkbox.h>
#include <wx/radiobox.h>
#include <wx/statline.h>
#include <wx/sizer.h>
#include <wx/button.h>
#include <wx/dialog.h>
......@@ -37,14 +39,15 @@ class DIALOG_EXPORT_IDF3_BASE : public DIALOG_SHIM
protected:
wxStaticText* m_txtBrdFile;
wxFilePickerCtrl* m_filePickerIDF;
wxCheckBox* m_chkThou;
wxRadioBox* m_rbUnitSelection;
wxStaticLine* m_staticline1;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
public:
DIALOG_EXPORT_IDF3_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Export IDFv3"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 458,177 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_EXPORT_IDF3_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Export IDFv3"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 424,191 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_EXPORT_IDF3_BASE();
};
......
......@@ -34,6 +34,7 @@
#include <class_module.h>
#include <class_edge_mod.h>
#include <idf.h>
#include <3d_struct.h>
// assumed default graphical line thickness: 10000 IU == 0.1mm
#define LINE_WIDTH (100000)
......@@ -316,8 +317,50 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule,
}
}
// TODO
// add to the library item list
// add any valid models to the library item list
std::string refdes;
for( S3D_MASTER* modfile = aModule->Models(); modfile != 0; modfile = modfile->Next() )
{
if( !modfile->Is3DType( S3D_MASTER::FILE3D_IDF ) )
continue;
double rotz = modfile->m_MatRotation.z + aModule->GetOrientation()/10.0;
double locx = modfile->m_MatPosition.x;
double locy = modfile->m_MatPosition.y;
double locz = modfile->m_MatPosition.z;
bool top = ( aModule->GetLayer() == LAYER_N_BACK ) ? false : true;
refdes = TO_UTF8( aModule->GetReference() );
if( top )
{
locy = -locy;
RotatePoint( &locx, &locy, aModule->GetOrientation() );
locy = -locy;
}
if( !top )
{
RotatePoint( &locx, &locy, aModule->GetOrientation() );
locy = -locy;
rotz = 180.0 - rotz;
if( rotz >= 360.0 )
while( rotz >= 360.0 ) rotz -= 360.0;
if( rotz <= -360.0 )
while( rotz <= -360.0 ) rotz += 360.0;
}
locx += aModule->GetPosition().x * scale + dx;
locy += -aModule->GetPosition().y * scale + dy;
aIDFBoard.PlaceComponent(modfile->GetShape3DName(), refdes, locx, locy, locz, rotz, top);
}
return;
}
......@@ -332,14 +375,12 @@ bool Export_IDF3( BOARD* aPcb, const wxString& aFullFileName, double aUseThou )
SetLocaleTo_C_standard();
// NOTE:
// XXX We may enclose all this in a TRY .. CATCH block
idfBoard.Setup( aPcb->GetFileName(), aFullFileName, aUseThou,
aPcb->GetDesignSettings().GetBoardThickness() );
// set up the global offsets
EDA_RECT bbox = aPcb->ComputeBoundingBox( true );
idfBoard.SetOffset( bbox.Centre().x * idfBoard.GetScale(),
idfBoard.SetOffset( -bbox.Centre().x * idfBoard.GetScale(),
bbox.Centre().y * idfBoard.GetScale() );
// Export the board outline
......
......@@ -1151,18 +1151,18 @@ static void export_vrml_module( MODEL_VRML& aModel, BOARD* aPcb, MODULE* aModule
// Export the object VRML model(s)
for( S3D_MASTER* vrmlm = aModule->Models(); vrmlm != 0; vrmlm = vrmlm->Next() )
{
wxString fname = vrmlm->m_Shape3DName;
if( fname.IsEmpty() )
if( !vrmlm->Is3DType( S3D_MASTER::FILE3D_VRML ) )
continue;
wxString fname = vrmlm->GetShape3DName();
if( !wxFileName::FileExists( fname ) )
{
wxFileName fn = fname;
fname = wxGetApp().FindLibraryPath( fn );
if( fname.IsEmpty() ) // keep "short" name if full filemane not found
fname = vrmlm->m_Shape3DName;
if( fname.IsEmpty() ) // keep "short" name if full filename not found
fname = vrmlm->GetShape3DName();
}
fname.Replace( wxT( "\\" ), wxT( "/" ) );
......
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