Commit f7ca6e4b authored by jean-pierre charras's avatar jean-pierre charras

add patch from Cirilo Bernardo, and minor fixes.

parent dc259223
...@@ -59,7 +59,7 @@ void S3D_MATERIAL::SetMaterial() ...@@ -59,7 +59,7 @@ void S3D_MATERIAL::SetMaterial()
void S3D_MASTER::Copy( S3D_MASTER* pattern ) void S3D_MASTER::Copy( S3D_MASTER* pattern )
{ {
m_Shape3DName = pattern->m_Shape3DName; SetShape3DName( pattern->GetShape3DName() );
m_MatScale = pattern->m_MatScale; m_MatScale = pattern->m_MatScale;
m_MatRotation = pattern->m_MatRotation; m_MatRotation = pattern->m_MatRotation;
m_MatPosition = pattern->m_MatPosition; m_MatPosition = pattern->m_MatPosition;
...@@ -74,6 +74,7 @@ S3D_MASTER::S3D_MASTER( EDA_ITEM* aParent ) : ...@@ -74,6 +74,7 @@ S3D_MASTER::S3D_MASTER( EDA_ITEM* aParent ) :
m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0; m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0;
m_3D_Drawings = NULL; m_3D_Drawings = NULL;
m_Materials = NULL; m_Materials = NULL;
m_ShapeType = FILE3D_NONE;
} }
...@@ -96,6 +97,45 @@ S3D_MASTER:: ~S3D_MASTER() ...@@ -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 ) : STRUCT_3D_SHAPE::STRUCT_3D_SHAPE( EDA_ITEM* aParent ) :
EDA_ITEM( aParent, NOT_USED ) EDA_ITEM( aParent, NOT_USED )
{ {
......
...@@ -857,7 +857,7 @@ void MODULE::ReadAndInsert3DComponentShape( EDA_3D_CANVAS* glcanvas ) ...@@ -857,7 +857,7 @@ void MODULE::ReadAndInsert3DComponentShape( EDA_3D_CANVAS* glcanvas )
for( ; struct3D != NULL; struct3D = struct3D->Next() ) for( ; struct3D != NULL; struct3D = struct3D->Next() )
{ {
if( !struct3D->m_Shape3DName.IsEmpty() ) if( struct3D->Is3DType( S3D_MASTER::FILE3D_VRML ) )
struct3D->ReadData(); struct3D->ReadData();
} }
......
...@@ -92,13 +92,24 @@ public: ...@@ -92,13 +92,24 @@ public:
class S3D_MASTER : public EDA_ITEM class S3D_MASTER : public EDA_ITEM
{ {
public: public:
wxString m_Shape3DName; /* 3D shape name in 3D library */
S3D_VERTEX m_MatScale; S3D_VERTEX m_MatScale;
S3D_VERTEX m_MatRotation; S3D_VERTEX m_MatRotation;
S3D_VERTEX m_MatPosition; S3D_VERTEX m_MatPosition;
STRUCT_3D_SHAPE* m_3D_Drawings; STRUCT_3D_SHAPE* m_3D_Drawings;
S3D_MATERIAL* m_Materials; 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: public:
S3D_MASTER( EDA_ITEM* aParent ); S3D_MASTER( EDA_ITEM* aParent );
~S3D_MASTER(); ~S3D_MASTER();
...@@ -120,6 +131,20 @@ public: ...@@ -120,6 +131,20 @@ public:
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #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" ) ...@@ -171,10 +171,11 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" ) set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" )
endif() 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 ) 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" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs" )
endif() endif()
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-strict-aliasing" )
if( APPLE ) if( APPLE )
set( KICAD_BUILD_STATIC ON) set( KICAD_BUILD_STATIC ON)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#endif #endif
#ifndef KICAD_BUILD_VERSION #ifndef KICAD_BUILD_VERSION
# define KICAD_BUILD_VERSION "(2013-jul-14)" # define KICAD_BUILD_VERSION "(2014-jan-25)"
#endif #endif
/** /**
......
...@@ -97,4 +97,5 @@ const wxString PSFileWildcard( _( "PostScript files (.ps)|*.ps" ) ); ...@@ -97,4 +97,5 @@ const wxString PSFileWildcard( _( "PostScript files (.ps)|*.ps" ) );
const wxString ReportFileWildcard = _( "Report files (*.rpt)|*.rpt" ); const wxString ReportFileWildcard = _( "Report files (*.rpt)|*.rpt" );
const wxString FootprintPlaceFileWildcard = _( "Footprint place files (*.pos)|*.pos" ); const wxString FootprintPlaceFileWildcard = _( "Footprint place files (*.pos)|*.pos" );
const wxString Shapes3DFileWildcard( _( "Vrml and x3d files (*.wrl *.x3d)|*.wrl;*.x3d" ) ); 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" ) ); 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) (export (version D)
(design (design
(source F:/kicad-launchpad/testing/demos/complex_hierarchy/complex_hierarchy.sch) (source F:/kicad-launchpad/testing/demos/complex_hierarchy/complex_hierarchy.sch)
(date "09/01/2014 08:56:21") (date "25/01/2014 08:31:41")
(tool "eeschema (2014-01-08 BZR 4616)-product")) (tool "eeschema (2014-01-22 BZR 4630)-product"))
(components (components
(comp (ref C10) (comp (ref C10)
(value 10uF) (value 10uF)
......
update=09/01/2014 08:59:03 update=25/01/2014 08:37:41
version=1 version=1
last_client=kicad last_client=kicad
[cvpcb] [cvpcb]
version=1 version=1
NetITyp=0 NetIExt=net
NetIExt=.net
PkgIExt=.pkg
NetDir=
LibDir=
NetType=0
[cvpcb/libraries] [cvpcb/libraries]
EquName1=devcms EquName1=devcms
[eeschema] [eeschema]
version=1 version=1
LibDir=F:\\kicad\\share\\library PageLayoutDescrFile=
NetFmt=1 SubpartIdSeparator=0
HPGLSpd=20 SubpartFirstId=65
HPGLDm=15 LibDir=F:/kicad/share/library
HPGLNum=1 NetFmtName=
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
RptD_X=0 RptD_X=0
RptD_Y=100 RptD_Y=100
RptLab=1 RptLab=1
SimCmd=
UseNetN=0
LabSize=60 LabSize=60
PrintMonochrome=1
ShowSheetReferenceAndTitleBlock=1
[eeschema/libraries] [eeschema/libraries]
LibName1=power LibName1=power
LibName2=device LibName2=device
...@@ -57,32 +28,25 @@ LibName7=interface ...@@ -57,32 +28,25 @@ LibName7=interface
LibName8=special LibName8=special
[pcbnew] [pcbnew]
version=1 version=1
PadDrlX=320 PageLayoutDescrFile=
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
LastNetListRead= 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] [pcbnew/libraries]
LibDir= LibDir=
LibName1=sockets
LibName2=connect
LibName3=discret
LibName4=pin_array
LibName5=divers
LibName6=libcms
LibName7=display
LibName8=valves
LibName9=led
LibName10=dip_sockets
[general] [general]
version=1 version=1
update=10/01/2014 20:45:48 update=24/01/2014 13:22:43
last_client=eeschema last_client=eeschema
[general]
version=1
[cvpcb]
version=1
NetIExt=net
[cvpcb/libraries]
EquName1=devcms
[pcbnew] [pcbnew]
version=1 version=1
PageLayoutDescrFile=
LastNetListRead= LastNetListRead=
UseCmpFile=1 UseCmpFile=1
PadDrill=0.000000000000 PadDrill=0
PadDrillOvalY=0.000000000000 PadDrillOvalY=0
PadSizeH=0.406400000000 PadSizeH=0.4064
PadSizeV=1.270000000000 PadSizeV=1.27
PcbTextSizeV=2.032000000000 PcbTextSizeV=2.032
PcbTextSizeH=1.524000000000 PcbTextSizeH=1.524
PcbTextThickness=0.304800000000 PcbTextThickness=0.3048
ModuleTextSizeV=1.524000000000 ModuleTextSizeV=1.524
ModuleTextSizeH=1.524000000000 ModuleTextSizeH=1.524
ModuleTextSizeThickness=0.304800000000 ModuleTextSizeThickness=0.3048
SolderMaskClearance=0.200000000000 SolderMaskClearance=0.2
SolderMaskMinWidth=0.000000000000 SolderMaskMinWidth=0
DrawSegmentWidth=0.381000000000 DrawSegmentWidth=0.381
BoardOutlineThickness=0.381000000000 BoardOutlineThickness=0.381
ModuleOutlineThickness=0.152400000000 ModuleOutlineThickness=0.1524
[pcbnew/libraries] [pcbnew/libraries]
LibDir= 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] [eeschema]
version=1 version=1
PageLayoutDescrFile= PageLayoutDescrFile=
...@@ -51,24 +48,9 @@ LibName4=conn ...@@ -51,24 +48,9 @@ LibName4=conn
LibName5=linear LibName5=linear
LibName6=regul LibName6=regul
LibName7=74xx LibName7=74xx
LibName8=cmos4000 LibName8=adc-dac
LibName9=adc-dac LibName9=memory
LibName10=memory LibName10=xilinx
LibName11=xilinx LibName11=special
LibName12=special LibName12=microcontrollers
LibName13=microcontrollers LibName13=motorola
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
EESchema Schematic File Version 2 date 27/11/2009 11:46:34 EESchema Schematic File Version 2
LIBS:power LIBS:power
LIBS:device LIBS:device
LIBS:transistors LIBS:transistors
...@@ -6,31 +6,17 @@ LIBS:conn ...@@ -6,31 +6,17 @@ LIBS:conn
LIBS:linear LIBS:linear
LIBS:regul LIBS:regul
LIBS:74xx LIBS:74xx
LIBS:cmos4000
LIBS:adc-dac LIBS:adc-dac
LIBS:memory LIBS:memory
LIBS:xilinx LIBS:xilinx
LIBS:special LIBS:special
LIBS:microcontrollers LIBS:microcontrollers
LIBS:dsp
LIBS:microchip
LIBS:analog_switches
LIBS:motorola 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 LIBS:kit-dev-coldfire-xilinx_5213-cache
EELAYER 23 0 EELAYER 24 0
EELAYER END EELAYER END
$Descr A4 11700 8267 $Descr A4 11693 8268
encoding utf-8
Sheet 3 3 Sheet 3 3
Title "Dev kit coldfire 5213" Title "Dev kit coldfire 5213"
Date "8 feb 2008" Date "8 feb 2008"
...@@ -377,6 +363,8 @@ U 1 1 480DCF5A ...@@ -377,6 +363,8 @@ U 1 1 480DCF5A
P 3500 4100 P 3500 4100
F 0 "#PWR0105" H 3500 4100 30 0001 C CNN F 0 "#PWR0105" H 3500 4100 30 0001 C CNN
F 1 "GND" H 3500 4030 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 1 3500 4100
0 1 1 0 0 1 1 0
$EndComp $EndComp
...@@ -386,6 +374,8 @@ U 1 1 4791D619 ...@@ -386,6 +374,8 @@ U 1 1 4791D619
P 10850 3900 P 10850 3900
F 0 "#PWR0106" H 10850 3860 30 0001 C CNN F 0 "#PWR0106" H 10850 3860 30 0001 C CNN
F 1 "+3,3V" H 10850 4010 30 0000 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 10850 3900
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -395,6 +385,8 @@ U 1 1 4791D59D ...@@ -395,6 +385,8 @@ U 1 1 4791D59D
P 10450 3900 P 10450 3900
F 0 "R64" V 10530 3900 50 0000 C CNN F 0 "R64" V 10530 3900 50 0000 C CNN
F 1 "3,3" V 10450 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 1 10450 3900
0 1 1 0 0 1 1 0
$EndComp $EndComp
...@@ -428,6 +420,8 @@ U 1 1 470F3BF2 ...@@ -428,6 +420,8 @@ U 1 1 470F3BF2
P 3450 1250 P 3450 1250
F 0 "#PWR0107" H 3450 1250 30 0001 C CNN F 0 "#PWR0107" H 3450 1250 30 0001 C CNN
F 1 "GND" H 3450 1180 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 3450 1250
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -476,6 +470,8 @@ U 1 1 46A76EB2 ...@@ -476,6 +470,8 @@ U 1 1 46A76EB2
P 6600 1250 P 6600 1250
F 0 "P3" H 6600 1400 50 0000 C CNN F 0 "P3" H 6600 1400 50 0000 C CNN
F 1 "CONN_2X2" H 6610 1120 40 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 6600 1250
-1 0 0 -1 -1 0 0 -1
$EndComp $EndComp
...@@ -485,6 +481,8 @@ U 1 1 470F38BE ...@@ -485,6 +481,8 @@ U 1 1 470F38BE
P 4550 4100 P 4550 4100
F 0 "U9" H 4600 4150 70 0000 C CNN F 0 "U9" H 4600 4150 70 0000 C CNN
F 1 "XCR3256-TQ144" H 4550 500 60 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 4550 4100
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -584,6 +582,8 @@ U 1 1 46ADE620 ...@@ -584,6 +582,8 @@ U 1 1 46ADE620
P 9600 4000 P 9600 4000
F 0 "#PWR0108" H 9600 4000 30 0001 C CNN F 0 "#PWR0108" H 9600 4000 30 0001 C CNN
F 1 "GND" H 9600 3930 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 1 9600 4000
0 -1 -1 0 0 -1 -1 0
$EndComp $EndComp
...@@ -593,6 +593,8 @@ U 1 1 46ADE61B ...@@ -593,6 +593,8 @@ U 1 1 46ADE61B
P 9600 2100 P 9600 2100
F 0 "#PWR0109" H 9600 2100 30 0001 C CNN F 0 "#PWR0109" H 9600 2100 30 0001 C CNN
F 1 "GND" H 9600 2030 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 1 9600 2100
0 -1 -1 0 0 -1 -1 0
$EndComp $EndComp
...@@ -660,6 +662,8 @@ U 1 1 46ADE55A ...@@ -660,6 +662,8 @@ U 1 1 46ADE55A
P 9200 3050 P 9200 3050
F 0 "P4" H 9250 3100 60 0000 C CNN F 0 "P4" H 9250 3100 60 0000 C CNN
F 1 "CONN_20X2" V 9200 3050 50 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 9200 3050
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -699,6 +703,8 @@ U 1 1 46A76BD3 ...@@ -699,6 +703,8 @@ U 1 1 46A76BD3
P 2750 1300 P 2750 1300
F 0 "#PWR0110" H 2750 1260 30 0001 C CNN F 0 "#PWR0110" H 2750 1260 30 0001 C CNN
F 1 "+3,3V" V 2750 1500 30 0000 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 1 2750 1300
0 1 1 0 0 1 1 0
$EndComp $EndComp
...@@ -708,6 +714,8 @@ U 1 1 46A76BD2 ...@@ -708,6 +714,8 @@ U 1 1 46A76BD2
P 3550 650 P 3550 650
F 0 "#PWR0111" H 3550 610 30 0001 C CNN F 0 "#PWR0111" H 3550 610 30 0001 C CNN
F 1 "+3,3V" H 3550 760 30 0000 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 3550 650
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -717,6 +725,8 @@ U 1 1 46A76BCA ...@@ -717,6 +725,8 @@ U 1 1 46A76BCA
P 3300 650 P 3300 650
F 0 "R57" V 3380 650 50 0000 C CNN F 0 "R57" V 3380 650 50 0000 C CNN
F 1 "4K7" V 3300 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 1 3300 650
0 1 1 0 0 1 1 0
$EndComp $EndComp
...@@ -728,6 +738,8 @@ U 1 1 46A76BC5 ...@@ -728,6 +738,8 @@ U 1 1 46A76BC5
P 9500 4950 P 9500 4950
F 0 "#PWR0112" H 9500 4950 40 0001 C CNN F 0 "#PWR0112" H 9500 4950 40 0001 C CNN
F 1 "GND" H 9500 4880 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 1 9500 4950
0 -1 -1 0 0 -1 -1 0
$EndComp $EndComp
...@@ -737,6 +749,8 @@ U 1 1 46A76BC4 ...@@ -737,6 +749,8 @@ U 1 1 46A76BC4
P 9300 4950 P 9300 4950
F 0 "D8" H 9300 5050 50 0000 C CNN F 0 "D8" H 9300 5050 50 0000 C CNN
F 1 "LED" H 9300 4850 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 9300 4950
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -746,6 +760,8 @@ U 1 1 46A76BC3 ...@@ -746,6 +760,8 @@ U 1 1 46A76BC3
P 8800 4950 P 8800 4950
F 0 "R62" V 8880 4950 50 0000 C CNN F 0 "R62" V 8880 4950 50 0000 C CNN
F 1 "1K" V 8800 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 1 8800 4950
0 -1 -1 0 0 -1 -1 0
$EndComp $EndComp
...@@ -755,6 +771,8 @@ U 1 1 46A76BC1 ...@@ -755,6 +771,8 @@ U 1 1 46A76BC1
P 7650 6650 P 7650 6650
F 0 "#PWR0113" H 7650 6650 30 0001 C CNN F 0 "#PWR0113" H 7650 6650 30 0001 C CNN
F 1 "GND" H 7650 6580 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 7650 6650
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -764,6 +782,8 @@ U 1 1 46A76BBF ...@@ -764,6 +782,8 @@ U 1 1 46A76BBF
P 7650 6050 P 7650 6050
F 0 "#PWR0114" H 7650 6010 30 0001 C CNN F 0 "#PWR0114" H 7650 6010 30 0001 C CNN
F 1 "+3,3V" H 7650 6160 30 0000 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 7650 6050
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -773,6 +793,8 @@ U 1 1 46A76BBC ...@@ -773,6 +793,8 @@ U 1 1 46A76BBC
P 10650 6350 P 10650 6350
F 0 "C61" H 10700 6450 50 0000 L CNN F 0 "C61" H 10700 6450 50 0000 L CNN
F 1 "100nF" H 10650 6250 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 10650 6350
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -782,6 +804,8 @@ U 1 1 46A76BBB ...@@ -782,6 +804,8 @@ U 1 1 46A76BBB
P 10350 6350 P 10350 6350
F 0 "C60" H 10400 6450 50 0000 L CNN F 0 "C60" H 10400 6450 50 0000 L CNN
F 1 "100nF" H 10350 6250 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 10350 6350
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -791,6 +815,8 @@ U 1 1 46A76BBA ...@@ -791,6 +815,8 @@ U 1 1 46A76BBA
P 10050 6350 P 10050 6350
F 0 "C59" H 10100 6450 50 0000 L CNN F 0 "C59" H 10100 6450 50 0000 L CNN
F 1 "100nF" H 10050 6250 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 10050 6350
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -800,6 +826,8 @@ U 1 1 46A76BB5 ...@@ -800,6 +826,8 @@ U 1 1 46A76BB5
P 8550 6350 P 8550 6350
F 0 "C54" H 8600 6450 50 0000 L CNN F 0 "C54" H 8600 6450 50 0000 L CNN
F 1 "100nF" H 8550 6250 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 8550 6350
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -809,6 +837,8 @@ U 1 1 46A76BB4 ...@@ -809,6 +837,8 @@ U 1 1 46A76BB4
P 8250 6350 P 8250 6350
F 0 "C53" H 8300 6450 50 0000 L CNN F 0 "C53" H 8300 6450 50 0000 L CNN
F 1 "100nF" H 8250 6250 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 8250 6350
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -818,6 +848,8 @@ U 1 1 46A76BB3 ...@@ -818,6 +848,8 @@ U 1 1 46A76BB3
P 7950 6350 P 7950 6350
F 0 "C52" H 8000 6450 50 0000 L CNN F 0 "C52" H 8000 6450 50 0000 L CNN
F 1 "100nF" H 7950 6250 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 7950 6350
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -827,6 +859,8 @@ U 1 1 46A76BB2 ...@@ -827,6 +859,8 @@ U 1 1 46A76BB2
P 7650 6350 P 7650 6350
F 0 "C51" H 7700 6450 50 0000 L CNN F 0 "C51" H 7700 6450 50 0000 L CNN
F 1 "100nF" H 7650 6250 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 7650 6350
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -836,6 +870,8 @@ U 1 1 46A76BB1 ...@@ -836,6 +870,8 @@ U 1 1 46A76BB1
P 9750 6350 P 9750 6350
F 0 "C58" H 9800 6450 50 0000 L CNN F 0 "C58" H 9800 6450 50 0000 L CNN
F 1 "100nF" H 9750 6250 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 9750 6350
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -845,6 +881,8 @@ U 1 1 46A76BB0 ...@@ -845,6 +881,8 @@ U 1 1 46A76BB0
P 9450 6350 P 9450 6350
F 0 "C57" H 9500 6450 50 0000 L CNN F 0 "C57" H 9500 6450 50 0000 L CNN
F 1 "100nF" H 9450 6250 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 9450 6350
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -854,6 +892,8 @@ U 1 1 46A76BAF ...@@ -854,6 +892,8 @@ U 1 1 46A76BAF
P 9150 6350 P 9150 6350
F 0 "C56" H 9200 6450 50 0000 L CNN F 0 "C56" H 9200 6450 50 0000 L CNN
F 1 "100nF" H 9150 6250 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 9150 6350
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -863,6 +903,8 @@ U 1 1 46A76BAE ...@@ -863,6 +903,8 @@ U 1 1 46A76BAE
P 8850 6350 P 8850 6350
F 0 "C55" H 8900 6450 50 0000 L CNN F 0 "C55" H 8900 6450 50 0000 L CNN
F 1 "100nF" H 8850 6250 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 8850 6350
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -876,6 +918,8 @@ U 1 1 46A76BA9 ...@@ -876,6 +918,8 @@ U 1 1 46A76BA9
P 9500 5250 P 9500 5250
F 0 "#PWR0115" H 9500 5250 40 0001 C CNN F 0 "#PWR0115" H 9500 5250 40 0001 C CNN
F 1 "GND" H 9500 5180 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 1 9500 5250
0 -1 -1 0 0 -1 -1 0
$EndComp $EndComp
...@@ -885,6 +929,8 @@ U 1 1 46A76BA8 ...@@ -885,6 +929,8 @@ U 1 1 46A76BA8
P 9300 5250 P 9300 5250
F 0 "D9" H 9300 5350 50 0000 C CNN F 0 "D9" H 9300 5350 50 0000 C CNN
F 1 "LED" H 9300 5150 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 9300 5250
1 0 0 -1 1 0 0 -1
$EndComp $EndComp
...@@ -894,6 +940,8 @@ U 1 1 46A76BA7 ...@@ -894,6 +940,8 @@ U 1 1 46A76BA7
P 8800 5250 P 8800 5250
F 0 "R63" V 8880 5250 50 0000 C CNN F 0 "R63" V 8880 5250 50 0000 C CNN
F 1 "1K" V 8800 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 1 8800 5250
0 -1 -1 0 0 -1 -1 0
$EndComp $EndComp
...@@ -909,6 +957,8 @@ U 1 1 46A76BA6 ...@@ -909,6 +957,8 @@ U 1 1 46A76BA6
P 2350 1050 P 2350 1050
F 0 "P1" V 2300 1050 60 0000 C CNN F 0 "P1" V 2300 1050 60 0000 C CNN
F 1 "CONN_6" V 2400 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 2350 1050
-1 0 0 1 -1 0 0 1
$EndComp $EndComp
...@@ -918,6 +968,8 @@ U 1 1 46A76BA5 ...@@ -918,6 +968,8 @@ U 1 1 46A76BA5
P 2700 1200 P 2700 1200
F 0 "#PWR0116" H 2700 1200 40 0001 C CNN F 0 "#PWR0116" H 2700 1200 40 0001 C CNN
F 1 "GND" H 2700 1130 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 1 2700 1200
0 -1 -1 0 0 -1 -1 0
$EndComp $EndComp
......
...@@ -94,6 +94,7 @@ extern const wxString SVGFileWildcard; ...@@ -94,6 +94,7 @@ extern const wxString SVGFileWildcard;
extern const wxString ReportFileWildcard; extern const wxString ReportFileWildcard;
extern const wxString FootprintPlaceFileWildcard; extern const wxString FootprintPlaceFileWildcard;
extern const wxString Shapes3DFileWildcard; extern const wxString Shapes3DFileWildcard;
extern const wxString IDF3DFileWildcard;
extern const wxString DocModulesFileName; extern const wxString DocModulesFileName;
extern const wxString LegacyFootprintLibPathWildcard; extern const wxString LegacyFootprintLibPathWildcard;
extern const wxString KiCadFootprintLibFileWildcard; extern const wxString KiCadFootprintLibFileWildcard;
......
...@@ -36,15 +36,12 @@ ...@@ -36,15 +36,12 @@
#include <bezier_curves.h> #include <bezier_curves.h>
#include <class_drawpanel.h> #include <class_drawpanel.h>
#include <class_pcb_screen.h> #include <class_pcb_screen.h>
#include <kicad_string.h>
#include <colors_selection.h> #include <colors_selection.h>
#include <trigo.h> #include <trigo.h>
#include <richio.h>
#include <pcbcommon.h> #include <pcbcommon.h>
#include <msgpanel.h> #include <msgpanel.h>
#include <pcbnew.h> #include <pcbnew.h>
#include <math_for_graphics.h>
#include <class_board.h> #include <class_board.h>
#include <class_module.h> #include <class_module.h>
......
...@@ -146,7 +146,7 @@ MODULE::MODULE( const MODULE& aModule ) : ...@@ -146,7 +146,7 @@ MODULE::MODULE( const MODULE& aModule ) :
// Copy auxiliary data: 3D_Drawings info // Copy auxiliary data: 3D_Drawings info
for( S3D_MASTER* item = aModule.m_3D_Drawings; item; item = item->Next() ) 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; continue;
S3D_MASTER* t3d = m_3D_Drawings; S3D_MASTER* t3d = m_3D_Drawings;
...@@ -270,12 +270,12 @@ void MODULE::Copy( MODULE* aModule ) ...@@ -270,12 +270,12 @@ void MODULE::Copy( MODULE* aModule )
for( S3D_MASTER* item = aModule->m_3D_Drawings; item; item = item->Next() ) 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; continue;
S3D_MASTER* t3d = m_3D_Drawings; 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. { // exist, but is empty : use it.
t3d->Copy( item ); t3d->Copy( item );
} }
...@@ -530,9 +530,9 @@ void MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) ...@@ -530,9 +530,9 @@ void MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
// Search the first active 3D shape in list // Search the first active 3D shape in list
for( S3D_MASTER* struct3D = m_3D_Drawings; struct3D; struct3D = struct3D->Next() ) 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; break;
} }
} }
......
...@@ -249,12 +249,12 @@ void DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties() ...@@ -249,12 +249,12 @@ void DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties()
while( draw3D ) while( draw3D )
{ {
if( !draw3D->m_Shape3DName.IsEmpty() ) if( !draw3D->GetShape3DName().IsEmpty() )
{ {
S3D_MASTER* draw3DCopy = new S3D_MASTER( NULL ); S3D_MASTER* draw3DCopy = new S3D_MASTER( NULL );
draw3DCopy->Copy( draw3D ); draw3DCopy->Copy( draw3D );
m_Shapes3D_list.push_back( draw3DCopy ); m_Shapes3D_list.push_back( draw3DCopy );
m_3D_ShapeNameListBox->Append( draw3DCopy->m_Shape3DName ); m_3D_ShapeNameListBox->Append( draw3DCopy->GetShape3DName() );
} }
draw3D = (S3D_MASTER*) draw3D->Next(); draw3D = (S3D_MASTER*) draw3D->Next();
} }
...@@ -428,11 +428,16 @@ void DIALOG_MODULE_BOARD_EDITOR::Browse3DLib( wxCommandEvent& event ) ...@@ -428,11 +428,16 @@ void DIALOG_MODULE_BOARD_EDITOR::Browse3DLib( wxCommandEvent& event )
fullpath.Replace( wxT( "/" ), wxT( "\\" ) ); fullpath.Replace( wxT( "/" ), wxT( "\\" ) );
#endif #endif
wxString fileFilters;
fileFilters = wxGetTranslation( Shapes3DFileWildcard );
fileFilters += wxChar( '|' );
fileFilters += wxGetTranslation( IDF3DFileWildcard );
fullfilename = EDA_FileSelector( _( "3D Shape:" ), fullfilename = EDA_FileSelector( _( "3D Shape:" ),
fullpath, fullpath,
wxEmptyString, wxEmptyString,
wxEmptyString, wxEmptyString,
wxGetTranslation( Shapes3DFileWildcard ), wxGetTranslation( fileFilters ),
this, this,
wxFD_OPEN, wxFD_OPEN,
true true
...@@ -474,7 +479,7 @@ void DIALOG_MODULE_BOARD_EDITOR::Browse3DLib( wxCommandEvent& event ) ...@@ -474,7 +479,7 @@ void DIALOG_MODULE_BOARD_EDITOR::Browse3DLib( wxCommandEvent& event )
// Store filename in Unix notation // Store filename in Unix notation
shortfilename.Replace( wxT( "\\" ), wxT( "/" ) ); shortfilename.Replace( wxT( "\\" ), wxT( "/" ) );
#endif #endif
new3DShape->m_Shape3DName = shortfilename; new3DShape->SetShape3DName( shortfilename );
m_Shapes3D_list.push_back( new3DShape ); m_Shapes3D_list.push_back( new3DShape );
m_3D_ShapeNameListBox->Append( shortfilename ); m_3D_ShapeNameListBox->Append( shortfilename );
...@@ -606,7 +611,7 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event ) ...@@ -606,7 +611,7 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
{ {
S3D_MASTER* draw3DCopy = m_Shapes3D_list[ii]; S3D_MASTER* draw3DCopy = m_Shapes3D_list[ii];
if( draw3DCopy->m_Shape3DName.IsEmpty() ) if( draw3DCopy->GetShape3DName().IsEmpty() )
continue; continue;
if( draw3D == NULL ) if( draw3D == NULL )
...@@ -615,7 +620,7 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event ) ...@@ -615,7 +620,7 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
m_CurrentModule->Models().Append( draw3D ); m_CurrentModule->Models().Append( draw3D );
} }
draw3D->m_Shape3DName = draw3DCopy->m_Shape3DName; draw3D->SetShape3DName( draw3DCopy->GetShape3DName() );
draw3D->m_MatScale = draw3DCopy->m_MatScale; draw3D->m_MatScale = draw3DCopy->m_MatScale;
draw3D->m_MatRotation = draw3DCopy->m_MatRotation; draw3D->m_MatRotation = draw3DCopy->m_MatRotation;
draw3D->m_MatPosition = draw3DCopy->m_MatPosition; draw3D->m_MatPosition = draw3DCopy->m_MatPosition;
......
...@@ -98,12 +98,12 @@ void DIALOG_MODULE_MODULE_EDITOR::initModeditProperties() ...@@ -98,12 +98,12 @@ void DIALOG_MODULE_MODULE_EDITOR::initModeditProperties()
while( draw3D ) while( draw3D )
{ {
if( !draw3D->m_Shape3DName.IsEmpty() ) if( !draw3D->GetShape3DName().IsEmpty() )
{ {
S3D_MASTER* draw3DCopy = new S3D_MASTER(NULL); S3D_MASTER* draw3DCopy = new S3D_MASTER(NULL);
draw3DCopy->Copy( draw3D ); draw3DCopy->Copy( draw3D );
m_shapes3D_list.push_back( draw3DCopy ); m_shapes3D_list.push_back( draw3DCopy );
m_3D_ShapeNameListBox->Append( draw3DCopy->m_Shape3DName ); m_3D_ShapeNameListBox->Append( draw3DCopy->GetShape3DName() );
} }
draw3D = (S3D_MASTER*) draw3D->Next(); draw3D = (S3D_MASTER*) draw3D->Next();
} }
...@@ -292,11 +292,16 @@ void DIALOG_MODULE_MODULE_EDITOR::BrowseAndAdd3DLib( wxCommandEvent& event ) ...@@ -292,11 +292,16 @@ void DIALOG_MODULE_MODULE_EDITOR::BrowseAndAdd3DLib( wxCommandEvent& event )
fullpath.Replace( wxT( "/" ), wxT( "\\" ) ); fullpath.Replace( wxT( "/" ), wxT( "\\" ) );
#endif #endif
wxString fileFilters;
fileFilters = wxGetTranslation( Shapes3DFileWildcard );
fileFilters += wxChar( '|' );
fileFilters += wxGetTranslation( IDF3DFileWildcard );
fullfilename = EDA_FileSelector( _( "3D Shape:" ), fullfilename = EDA_FileSelector( _( "3D Shape:" ),
fullpath, fullpath,
wxEmptyString, wxEmptyString,
wxEmptyString, wxEmptyString,
wxGetTranslation( Shapes3DFileWildcard ), wxGetTranslation( fileFilters ),
this, this,
wxFD_OPEN, wxFD_OPEN,
true true
...@@ -339,7 +344,7 @@ void DIALOG_MODULE_MODULE_EDITOR::BrowseAndAdd3DLib( wxCommandEvent& event ) ...@@ -339,7 +344,7 @@ void DIALOG_MODULE_MODULE_EDITOR::BrowseAndAdd3DLib( wxCommandEvent& event )
shortfilename.Replace( wxT( "\\" ), wxT( "/" ) ); shortfilename.Replace( wxT( "\\" ), wxT( "/" ) );
#endif #endif
new3DShape->m_Shape3DName = shortfilename; new3DShape->SetShape3DName( shortfilename );
m_shapes3D_list.push_back( new3DShape ); m_shapes3D_list.push_back( new3DShape );
m_3D_ShapeNameListBox->Append( shortfilename ); m_3D_ShapeNameListBox->Append( shortfilename );
...@@ -439,7 +444,7 @@ void DIALOG_MODULE_MODULE_EDITOR::OnOkClick( wxCommandEvent& event ) ...@@ -439,7 +444,7 @@ void DIALOG_MODULE_MODULE_EDITOR::OnOkClick( wxCommandEvent& event )
{ {
S3D_MASTER* draw3DCopy = m_shapes3D_list[ii]; S3D_MASTER* draw3DCopy = m_shapes3D_list[ii];
if( draw3DCopy->m_Shape3DName.IsEmpty() ) if( draw3DCopy->GetShape3DName().IsEmpty() )
continue; continue;
if( draw3D == NULL ) if( draw3D == NULL )
...@@ -448,7 +453,7 @@ void DIALOG_MODULE_MODULE_EDITOR::OnOkClick( wxCommandEvent& event ) ...@@ -448,7 +453,7 @@ void DIALOG_MODULE_MODULE_EDITOR::OnOkClick( wxCommandEvent& event )
m_currentModule->Models().Append( draw3D ); m_currentModule->Models().Append( draw3D );
} }
draw3D->m_Shape3DName = draw3DCopy->m_Shape3DName; draw3D->SetShape3DName( draw3DCopy->GetShape3DName() );
draw3D->m_MatScale = draw3DCopy->m_MatScale; draw3D->m_MatScale = draw3DCopy->m_MatScale;
draw3D->m_MatRotation = draw3DCopy->m_MatRotation; draw3D->m_MatRotation = draw3DCopy->m_MatRotation;
draw3D->m_MatPosition = draw3DCopy->m_MatPosition; draw3D->m_MatPosition = draw3DCopy->m_MatPosition;
......
...@@ -64,7 +64,7 @@ public: ...@@ -64,7 +64,7 @@ public:
SetFocus(); SetFocus();
m_idfThouOpt = false; m_idfThouOpt = false;
m_config->Read( OPTKEY_IDF_THOU, &m_idfThouOpt ); m_config->Read( OPTKEY_IDF_THOU, &m_idfThouOpt );
m_chkThou->SetValue( m_idfThouOpt ); m_rbUnitSelection->SetSelection( m_idfThouOpt ? 1 : 0 );
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Centre(); Centre();
...@@ -72,13 +72,13 @@ public: ...@@ -72,13 +72,13 @@ public:
~DIALOG_EXPORT_IDF3() ~DIALOG_EXPORT_IDF3()
{ {
m_idfThouOpt = m_chkThou->GetValue(); m_idfThouOpt = m_rbUnitSelection->GetSelection() == 1;
m_config->Write( OPTKEY_IDF_THOU, m_idfThouOpt ); m_config->Write( OPTKEY_IDF_THOU, m_idfThouOpt );
} }
bool GetThouOption() bool GetThouOption()
{ {
return m_chkThou->GetValue(); return m_rbUnitSelection->GetSelection() == 1;
} }
wxFilePickerCtrl* FilePicker() wxFilePickerCtrl* FilePicker()
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012) // C++ code generated with wxFormBuilder (version Nov 6 2013)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -16,17 +16,22 @@ DIALOG_EXPORT_IDF3_BASE::DIALOG_EXPORT_IDF3_BASE( wxWindow* parent, wxWindowID i ...@@ -16,17 +16,22 @@ DIALOG_EXPORT_IDF3_BASE::DIALOG_EXPORT_IDF3_BASE( wxWindow* parent, wxWindowID i
wxBoxSizer* bSizerIDFFile; wxBoxSizer* bSizerIDFFile;
bSizerIDFFile = new wxBoxSizer( wxVERTICAL ); 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 ); 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 = 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 );
m_filePickerIDF->SetMinSize( wxSize( 420,30 ) ); 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 ); m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerIDFFile->Add( m_chkThou, 0, wxALL, 5 ); bSizerIDFFile->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer(); m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK ); m_sdbSizer1OK = new wxButton( this, wxID_OK );
...@@ -35,7 +40,7 @@ DIALOG_EXPORT_IDF3_BASE::DIALOG_EXPORT_IDF3_BASE( wxWindow* parent, wxWindowID i ...@@ -35,7 +40,7 @@ DIALOG_EXPORT_IDF3_BASE::DIALOG_EXPORT_IDF3_BASE( wxWindow* parent, wxWindowID i
m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize(); m_sdbSizer1->Realize();
bSizerIDFFile->Add( m_sdbSizer1, 1, wxEXPAND, 5 ); bSizerIDFFile->Add( m_sdbSizer1, 0, wxALIGN_RIGHT, 5 );
this->SetSizer( bSizerIDFFile ); 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/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM; class DIALOG_SHIM;
#include "dialog_shim.h" #include "dialog_shim.h"
...@@ -20,7 +21,8 @@ class DIALOG_SHIM; ...@@ -20,7 +21,8 @@ class DIALOG_SHIM;
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/filepicker.h> #include <wx/filepicker.h>
#include <wx/checkbox.h> #include <wx/radiobox.h>
#include <wx/statline.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/dialog.h> #include <wx/dialog.h>
...@@ -37,14 +39,15 @@ class DIALOG_EXPORT_IDF3_BASE : public DIALOG_SHIM ...@@ -37,14 +39,15 @@ class DIALOG_EXPORT_IDF3_BASE : public DIALOG_SHIM
protected: protected:
wxStaticText* m_txtBrdFile; wxStaticText* m_txtBrdFile;
wxFilePickerCtrl* m_filePickerIDF; wxFilePickerCtrl* m_filePickerIDF;
wxCheckBox* m_chkThou; wxRadioBox* m_rbUnitSelection;
wxStaticLine* m_staticline1;
wxStdDialogButtonSizer* m_sdbSizer1; wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel; wxButton* m_sdbSizer1Cancel;
public: 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(); ~DIALOG_EXPORT_IDF3_BASE();
}; };
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <class_module.h> #include <class_module.h>
#include <class_edge_mod.h> #include <class_edge_mod.h>
#include <idf.h> #include <idf.h>
#include <3d_struct.h>
// assumed default graphical line thickness: 10000 IU == 0.1mm // assumed default graphical line thickness: 10000 IU == 0.1mm
#define LINE_WIDTH (100000) #define LINE_WIDTH (100000)
...@@ -316,8 +317,50 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule, ...@@ -316,8 +317,50 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule,
} }
} }
// TODO // add any valid models to the library item list
// add 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 ) ...@@ -332,14 +375,12 @@ bool Export_IDF3( BOARD* aPcb, const wxString& aFullFileName, double aUseThou )
SetLocaleTo_C_standard(); SetLocaleTo_C_standard();
// NOTE:
// XXX We may enclose all this in a TRY .. CATCH block
idfBoard.Setup( aPcb->GetFileName(), aFullFileName, aUseThou, idfBoard.Setup( aPcb->GetFileName(), aFullFileName, aUseThou,
aPcb->GetDesignSettings().GetBoardThickness() ); aPcb->GetDesignSettings().GetBoardThickness() );
// set up the global offsets // set up the global offsets
EDA_RECT bbox = aPcb->ComputeBoundingBox( true ); 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() ); bbox.Centre().y * idfBoard.GetScale() );
// Export the board outline // Export the board outline
......
...@@ -1151,18 +1151,18 @@ static void export_vrml_module( MODEL_VRML& aModel, BOARD* aPcb, MODULE* aModule ...@@ -1151,18 +1151,18 @@ static void export_vrml_module( MODEL_VRML& aModel, BOARD* aPcb, MODULE* aModule
// Export the object VRML model(s) // Export the object VRML model(s)
for( S3D_MASTER* vrmlm = aModule->Models(); vrmlm != 0; vrmlm = vrmlm->Next() ) for( S3D_MASTER* vrmlm = aModule->Models(); vrmlm != 0; vrmlm = vrmlm->Next() )
{ {
wxString fname = vrmlm->m_Shape3DName; if( !vrmlm->Is3DType( S3D_MASTER::FILE3D_VRML ) )
if( fname.IsEmpty() )
continue; continue;
wxString fname = vrmlm->GetShape3DName();
if( !wxFileName::FileExists( fname ) ) if( !wxFileName::FileExists( fname ) )
{ {
wxFileName fn = fname; wxFileName fn = fname;
fname = wxGetApp().FindLibraryPath( fn ); fname = wxGetApp().FindLibraryPath( fn );
if( fname.IsEmpty() ) // keep "short" name if full filemane not found if( fname.IsEmpty() ) // keep "short" name if full filename not found
fname = vrmlm->m_Shape3DName; fname = vrmlm->GetShape3DName();
} }
fname.Replace( wxT( "\\" ), wxT( "/" ) ); fname.Replace( wxT( "\\" ), wxT( "/" ) );
......
This diff is collapsed.
This diff is collapsed.
...@@ -1050,10 +1050,10 @@ void PCB_IO::format( MODULE* aModule, int aNestLevel ) const ...@@ -1050,10 +1050,10 @@ void PCB_IO::format( MODULE* aModule, int aNestLevel ) const
// Save 3D info. // Save 3D info.
for( S3D_MASTER* t3D = aModule->Models(); t3D; t3D = t3D->Next() ) for( S3D_MASTER* t3D = aModule->Models(); t3D; t3D = t3D->Next() )
{ {
if( !t3D->m_Shape3DName.IsEmpty() ) if( !t3D->GetShape3DName().IsEmpty() )
{ {
m_out->Print( aNestLevel+1, "(model %s\n", m_out->Print( aNestLevel+1, "(model %s\n",
m_out->Quotew( t3D->m_Shape3DName ).c_str() ); m_out->Quotew( t3D->GetShape3DName() ).c_str() );
m_out->Print( aNestLevel+2, "(at (xyz %s %s %s))\n", m_out->Print( aNestLevel+2, "(at (xyz %s %s %s))\n",
Double2Str( t3D->m_MatPosition.x ).c_str(), Double2Str( t3D->m_MatPosition.x ).c_str(),
......
This diff is collapsed.
...@@ -205,7 +205,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -205,7 +205,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// IDF3 // IDF3
AddMenuItem( submenuexport, ID_GEN_EXPORT_FILE_IDF3, AddMenuItem( submenuexport, ID_GEN_EXPORT_FILE_IDF3,
_( "I&DFv3 Board Shape Export" ), _( "Basic export of board shape only IDFv3 format" ), _( "I&DFv3 Export" ), _( "IDFv3 board and component export" ),
KiBitmap( export_xpm ) ); KiBitmap( export_xpm ) );
AddMenuItem( filesMenu, submenuexport, AddMenuItem( filesMenu, submenuexport,
......
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