Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
142782b4
Commit
142782b4
authored
Feb 03, 2014
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove wxApp()::FindLibraryPath() usages from Pcbnew. Use environment variable substitution.
parent
33e26b27
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
56 deletions
+40
-56
3d_read_mesh.cpp
3d-viewer/3d_read_mesh.cpp
+14
-23
CMakeLists.txt
common/CMakeLists.txt
+12
-8
export_vrml.cpp
pcbnew/exporters/export_vrml.cpp
+8
-15
idf.cpp
pcbnew/exporters/idf.cpp
+6
-10
No files found.
3d-viewer/3d_read_mesh.cpp
View file @
142782b4
...
@@ -62,52 +62,43 @@ S3D_MODEL_PARSER* S3D_MODEL_PARSER::Create( S3D_MASTER* aMaster,
...
@@ -62,52 +62,43 @@ S3D_MODEL_PARSER* S3D_MODEL_PARSER::Create( S3D_MASTER* aMaster,
int
S3D_MASTER
::
ReadData
()
int
S3D_MASTER
::
ReadData
()
{
{
wxFileName
fn
;
wxString
FullFilename
;
if
(
m_Shape3DName
.
IsEmpty
()
)
if
(
m_Shape3DName
.
IsEmpty
()
)
{
{
return
1
;
return
1
;
}
}
wxString
shape3DNname
=
m_Shape3DName
;
// Expand any environment variables embedded in footprint's m_Shape3DName field.
wxString
filename
=
wxExpandEnvVars
(
m_Shape3DName
);
#ifdef __WINDOWS__
#ifdef __WINDOWS__
shape3DN
name
.
Replace
(
wxT
(
"/"
),
wxT
(
"
\\
"
)
);
file
name
.
Replace
(
wxT
(
"/"
),
wxT
(
"
\\
"
)
);
#else
#else
shape3DN
name
.
Replace
(
wxT
(
"
\\
"
),
wxT
(
"/"
)
);
file
name
.
Replace
(
wxT
(
"
\\
"
),
wxT
(
"/"
)
);
#endif
#endif
if
(
wxFileName
::
FileExists
(
shape3DN
name
)
)
if
(
!
wxFileName
::
FileExists
(
file
name
)
)
{
{
FullFilename
=
shape3DNname
;
wxLogDebug
(
wxT
(
"3D shape '%s' not found, even tried '%s' after env var substitution."
),
fn
.
Assign
(
FullFilename
);
GetChars
(
m_Shape3DName
),
}
GetChars
(
filename
)
else
);
{
return
-
1
;
fn
=
shape3DNname
;
FullFilename
=
wxGetApp
().
FindLibraryPath
(
fn
);
if
(
FullFilename
.
IsEmpty
()
)
{
wxLogDebug
(
wxT
(
"3D part library <%s> could not be found."
),
GetChars
(
fn
.
GetFullPath
()
)
);
return
-
1
;
}
}
}
wxFileName
fn
(
filename
);
wxString
extension
=
fn
.
GetExt
();
wxString
extension
=
fn
.
GetExt
();
S3D_MODEL_PARSER
*
parser
=
S3D_MODEL_PARSER
::
Create
(
this
,
extension
);
S3D_MODEL_PARSER
*
parser
=
S3D_MODEL_PARSER
::
Create
(
this
,
extension
);
if
(
parser
)
if
(
parser
)
{
{
parser
->
Load
(
FullF
ilename
);
parser
->
Load
(
f
ilename
);
delete
parser
;
delete
parser
;
return
0
;
return
0
;
}
}
else
else
{
{
wxLogDebug
(
wxT
(
"Unknown file type
<%s>
"
),
GetChars
(
extension
)
);
wxLogDebug
(
wxT
(
"Unknown file type
'%s'
"
),
GetChars
(
extension
)
);
}
}
return
-
1
;
return
-
1
;
...
...
common/CMakeLists.txt
View file @
142782b4
...
@@ -27,7 +27,7 @@ add_custom_target(
...
@@ -27,7 +27,7 @@ add_custom_target(
DEPENDS gal/opengl/shader_src.h
DEPENDS gal/opengl/shader_src.h
)
)
set
(
GAL_SRCS
set
(
GAL_SRCS
# Common part
# Common part
drawpanel_gal.cpp
drawpanel_gal.cpp
painter.cpp
painter.cpp
...
@@ -54,13 +54,13 @@ set(GAL_SRCS
...
@@ -54,13 +54,13 @@ set(GAL_SRCS
gal/cairo/cairo_compositor.cpp
gal/cairo/cairo_compositor.cpp
)
)
add_library
(
gal STATIC
${
GAL_SRCS
}
)
add_library
(
gal STATIC
${
GAL_SRCS
}
)
add_dependencies
(
gal shader_headers
)
add_dependencies
(
gal shader_headers
)
# Only for win32 cross compilation using MXE
# Only for win32 cross compilation using MXE
if
(
WIN32 AND MSYS
)
if
(
WIN32 AND MSYS
)
add_definitions
(
-DGLEW_STATIC
)
add_definitions
(
-DGLEW_STATIC
)
endif
(
WIN32 AND MSYS
)
endif
()
set
(
COMMON_ABOUT_DLG_SRCS
set
(
COMMON_ABOUT_DLG_SRCS
dialog_about/AboutDialog_main.cpp
dialog_about/AboutDialog_main.cpp
...
@@ -120,7 +120,6 @@ set( COMMON_SRCS
...
@@ -120,7 +120,6 @@ set( COMMON_SRCS
drawpanel.cpp
drawpanel.cpp
drawtxt.cpp
drawtxt.cpp
dsnlexer.cpp
dsnlexer.cpp
edaappl.cpp
eda_dde.cpp
eda_dde.cpp
eda_doc.cpp
eda_doc.cpp
filter_reader.cpp
filter_reader.cpp
...
@@ -150,8 +149,13 @@ set( COMMON_SRCS
...
@@ -150,8 +149,13 @@ set( COMMON_SRCS
zoom.cpp
zoom.cpp
)
)
# We will not want edaappl.cpp linked into the KIFACE, only into the KIWAY.
if
(
TRUE OR NOT USE_KIWAY_DLLS
)
list
(
APPEND COMMON_SRCS edaappl.cpp
)
endif
()
if
(
NOT HAVE_STRTOKR
)
if
(
NOT HAVE_STRTOKR
)
set
(
COMMON_SRCS
${
COMMON_SRCS
}
strtok_r.c
)
list
(
APPEND COMMON_SRCS
strtok_r.c
)
endif
()
endif
()
...
...
pcbnew/exporters/export_vrml.cpp
View file @
142782b4
...
@@ -1149,26 +1149,18 @@ static void export_vrml_module( MODEL_VRML& aModel, BOARD* aPcb, MODULE* aModule
...
@@ -1149,26 +1149,18 @@ static void export_vrml_module( MODEL_VRML& aModel, BOARD* aPcb, MODULE* aModule
bool
isFlipped
=
aModule
->
GetLayer
()
==
LAYER_N_BACK
;
bool
isFlipped
=
aModule
->
GetLayer
()
==
LAYER_N_BACK
;
// 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
;
vrmlm
=
vrmlm
->
Next
()
)
{
{
if
(
!
vrmlm
->
Is3DType
(
S3D_MASTER
::
FILE3D_VRML
)
)
if
(
!
vrmlm
->
Is3DType
(
S3D_MASTER
::
FILE3D_VRML
)
)
continue
;
continue
;
wxString
fname
=
vrmlm
->
GetShape3DName
();
// expand environment variables
wxString
fname
=
wxExpandEnvVars
(
vrmlm
->
GetShape3DName
()
);
if
(
!
wxFileName
::
FileExists
(
fname
)
)
{
wxFileName
fn
=
fname
;
fname
=
wxGetApp
().
FindLibraryPath
(
fn
);
if
(
fname
.
IsEmpty
()
)
// keep "short" name if full filename not found
fname
=
vrmlm
->
GetShape3DName
();
}
fname
.
Replace
(
wxT
(
"
\\
"
),
wxT
(
"/"
)
);
fname
.
Replace
(
wxT
(
"
\\
"
),
wxT
(
"/"
)
);
wxString
source_fname
=
fname
;
wxString
source_fname
=
fname
;
if
(
aExport3DFiles
)
// Change illegal characters
in short filename
if
(
aExport3DFiles
)
// Change illegal characters
{
{
ChangeIllegalCharacters
(
fname
,
true
);
ChangeIllegalCharacters
(
fname
,
true
);
fname
=
a3D_Subdir
+
wxT
(
"/"
)
+
fname
;
fname
=
a3D_Subdir
+
wxT
(
"/"
)
+
fname
;
...
@@ -1267,9 +1259,9 @@ bool PCB_EDIT_FRAME::ExportVRML_File( const wxString& aFullFileName,
...
@@ -1267,9 +1259,9 @@ bool PCB_EDIT_FRAME::ExportVRML_File( const wxString& aFullFileName,
double
aMMtoWRMLunit
,
bool
aExport3DFiles
,
double
aMMtoWRMLunit
,
bool
aExport3DFiles
,
const
wxString
&
a3D_Subdir
)
const
wxString
&
a3D_Subdir
)
{
{
wxString
msg
;
wxString
msg
;
FILE
*
output_file
;
FILE
*
output_file
;
BOARD
*
pcb
=
GetBoard
();
BOARD
*
pcb
=
GetBoard
();
MODEL_VRML
model3d
;
MODEL_VRML
model3d
;
...
@@ -1295,6 +1287,7 @@ bool PCB_EDIT_FRAME::ExportVRML_File( const wxString& aFullFileName,
...
@@ -1295,6 +1287,7 @@ bool PCB_EDIT_FRAME::ExportVRML_File( const wxString& aFullFileName,
// Global VRML scale to export to a different scale.
// Global VRML scale to export to a different scale.
model3d
.
scale
=
aMMtoWRMLunit
/
MM_PER_IU
;
model3d
.
scale
=
aMMtoWRMLunit
/
MM_PER_IU
;
// Set the mechanical deviation limit (in this case 0.02mm)
// Set the mechanical deviation limit (in this case 0.02mm)
// XXX - NOTE: the value should be set via the GUI
// XXX - NOTE: the value should be set via the GUI
model3d
.
SetMaxDev
(
20000
*
model3d
.
scale
);
model3d
.
SetMaxDev
(
20000
*
model3d
.
scale
);
...
...
pcbnew/exporters/idf.cpp
View file @
142782b4
...
@@ -1146,7 +1146,7 @@ bool IDF_COMP::PlaceComponent( const wxString aComponentFile, const std::string
...
@@ -1146,7 +1146,7 @@ bool IDF_COMP::PlaceComponent( const wxString aComponentFile, const std::string
componentFile
=
aComponentFile
;
componentFile
=
aComponentFile
;
refdes
=
aRefDes
;
refdes
=
aRefDes
;
if
(
refdes
.
empty
()
||
!
refdes
.
compare
(
"~"
)
||
!
refdes
.
compare
(
"0"
)
)
if
(
refdes
.
empty
()
||
!
refdes
.
compare
(
"~"
)
||
!
refdes
.
compare
(
"0"
)
)
refdes
=
"NOREFDES"
;
refdes
=
"NOREFDES"
;
loc_x
=
aXLoc
;
loc_x
=
aXLoc
;
...
@@ -1155,16 +1155,12 @@ bool IDF_COMP::PlaceComponent( const wxString aComponentFile, const std::string
...
@@ -1155,16 +1155,12 @@ bool IDF_COMP::PlaceComponent( const wxString aComponentFile, const std::string
rotation
=
aRotation
;
rotation
=
aRotation
;
top
=
isOnTop
;
top
=
isOnTop
;
if
(
!
wxFileName
::
FileExists
(
aComponentFile
)
)
wxString
fname
=
wxExpandEnvVars
(
aComponentFile
);
{
wxFileName
fn
=
aComponentFile
;
wxString
fname
=
wxGetApp
().
FindLibraryPath
(
fn
);
if
(
fname
.
IsEmpty
()
)
if
(
!
wxFileName
::
FileExists
(
fname
)
)
return
false
;
return
false
;
else
componentFile
=
fname
;
componentFile
=
fname
;
}
return
true
;
return
true
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment