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
4ac27702
Commit
4ac27702
authored
Jul 09, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code formatting.
parent
77d8b2d8
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
130 additions
and
144 deletions
+130
-144
dxf2brd_items.cpp
pcbnew/import_dxf/dxf2brd_items.cpp
+77
-89
dxf2brd_items.h
pcbnew/import_dxf/dxf2brd_items.h
+53
-55
No files found.
pcbnew/import_dxf/dxf2brd_items.cpp
View file @
4ac27702
This diff is collapsed.
Click to expand it.
pcbnew/import_dxf/dxf2brd_items.h
View file @
4ac27702
...
@@ -41,16 +41,15 @@ class BOARD_ITEM;
...
@@ -41,16 +41,15 @@ class BOARD_ITEM;
class
DXF2BRD_CONVERTER
:
public
DRW_Interface
class
DXF2BRD_CONVERTER
:
public
DRW_Interface
{
{
private
:
private
:
std
::
vector
<
BOARD_ITEM
*>
m_newItemsList
;
// The list of new items added
std
::
vector
<
BOARD_ITEM
*>
m_newItemsList
;
// The list of new items added to the board
// to the board
BOARD
*
m_brd
;
BOARD
*
m_brd
;
double
m_xOffset
;
// X coord offset for conversion (in mm)
double
m_xOffset
;
// X coord offset for conversion (in mm)
double
m_yOffset
;
// Y coord offset for conversion (in mm)
double
m_yOffset
;
// Y coord offset for conversion (in mm)
double
m_defaultThickness
;
// default line thickness for conversion (in mm)
double
m_defaultThickness
;
// default line thickness for conversion (in mm)
double
m_Dfx2mm
;
// The scale factor to convert DXF units to mm
double
m_Dfx2mm
;
// The scale factor to convert DXF units to mm
// Seems DRW_Interface always converts DXF coordinates in mm
// Seems DRW_Interface always converts DXF coordinates in mm
// (to be confirmed)
// (to be confirmed)
int
m_brdLayer
;
// The board layer to place imported dfx items
int
m_brdLayer
;
// The board layer to place imported dfx items
int
m_version
;
// the dxf version, not used here
int
m_version
;
// the dxf version, not used here
std
::
string
m_codePage
;
// The code page, not used here
std
::
string
m_codePage
;
// The code page, not used here
...
@@ -85,7 +84,7 @@ public:
...
@@ -85,7 +84,7 @@ public:
* @param aFile = the full filename.
* @param aFile = the full filename.
* @param aBoard = where to store the graphical items and text
* @param aBoard = where to store the graphical items and text
*/
*/
bool
ImportDxfFile
(
const
wxString
&
aFile
,
BOARD
*
aBoard
);
bool
ImportDxfFile
(
const
wxString
&
aFile
,
BOARD
*
aBoard
);
/**
/**
* @return the list of new BOARD_ITEM
* @return the list of new BOARD_ITEM
...
@@ -104,65 +103,65 @@ private:
...
@@ -104,65 +103,65 @@ private:
// Add aItem the the board
// Add aItem the the board
// this item is also added to the list of new items
// this item is also added to the list of new items
// (for undo command for instance)
// (for undo command for instance)
void
appendToBoard
(
BOARD_ITEM
*
aItem
);
void
appendToBoard
(
BOARD_ITEM
*
aItem
);
// Methods from DRW_CreationInterface:
// Methods from DRW_CreationInterface:
// They are "call back" fonctions, called when the corresponding object
// They are "call back" fonctions, called when the corresponding object
// is read in dxf file
// is read in dxf file
// Depending of the application, they can do something or not
// Depending of the application, they can do something or not
virtual
void
addHeader
(
const
DRW_Header
*
d
ata
);
virtual
void
addHeader
(
const
DRW_Header
*
aD
ata
);
virtual
void
addLType
(
const
DRW_LType
&
data
)
{}
virtual
void
addLType
(
const
DRW_LType
&
aData
)
{}
virtual
void
addLayer
(
const
DRW_Layer
&
d
ata
);
virtual
void
addLayer
(
const
DRW_Layer
&
aD
ata
);
virtual
void
addDimStyle
(
const
DRW_Dimstyle
&
data
)
{}
virtual
void
addDimStyle
(
const
DRW_Dimstyle
&
aData
)
{}
virtual
void
addBlock
(
const
DRW_Block
&
data
)
{}
virtual
void
addBlock
(
const
DRW_Block
&
aData
)
{}
virtual
void
endBlock
(){}
virtual
void
endBlock
()
{}
virtual
void
addPoint
(
const
DRW_Point
&
data
)
{}
virtual
void
addPoint
(
const
DRW_Point
&
aData
)
{}
virtual
void
addLine
(
const
DRW_Line
&
d
ata
);
virtual
void
addLine
(
const
DRW_Line
&
aD
ata
);
virtual
void
addRay
(
const
DRW_Ray
&
data
)
{}
virtual
void
addRay
(
const
DRW_Ray
&
aData
)
{}
virtual
void
addXline
(
const
DRW_Xline
&
data
)
{}
virtual
void
addXline
(
const
DRW_Xline
&
aData
)
{}
virtual
void
addCircle
(
const
DRW_Circle
&
d
ata
);
virtual
void
addCircle
(
const
DRW_Circle
&
aD
ata
);
virtual
void
addArc
(
const
DRW_Arc
&
d
ata
);
virtual
void
addArc
(
const
DRW_Arc
&
aD
ata
);
virtual
void
addEllipse
(
const
DRW_Ellipse
&
data
)
{}
virtual
void
addEllipse
(
const
DRW_Ellipse
&
aData
)
{}
virtual
void
addLWPolyline
(
const
DRW_LWPolyline
&
d
ata
);
virtual
void
addLWPolyline
(
const
DRW_LWPolyline
&
aD
ata
);
virtual
void
addText
(
const
DRW_Text
&
d
ata
);
virtual
void
addText
(
const
DRW_Text
&
aD
ata
);
virtual
void
addPolyline
(
const
DRW_Polyline
&
d
ata
);
virtual
void
addPolyline
(
const
DRW_Polyline
&
aD
ata
);
virtual
void
addSpline
(
const
DRW_Spline
*
data
)
{}
virtual
void
addSpline
(
const
DRW_Spline
*
aData
)
{}
virtual
void
addKnot
(
const
DRW_Entity
&
)
{}
virtual
void
addKnot
(
const
DRW_Entity
&
)
{}
virtual
void
addInsert
(
const
DRW_Insert
&
d
ata
){}
virtual
void
addInsert
(
const
DRW_Insert
&
aD
ata
){}
virtual
void
addTrace
(
const
DRW_Trace
&
d
ata
){}
virtual
void
addTrace
(
const
DRW_Trace
&
aD
ata
){}
virtual
void
addSolid
(
const
DRW_Solid
&
d
ata
){}
virtual
void
addSolid
(
const
DRW_Solid
&
aD
ata
){}
virtual
void
addMText
(
const
DRW_MText
&
d
ata
);
virtual
void
addMText
(
const
DRW_MText
&
aD
ata
);
virtual
void
addDimAlign
(
const
DRW_DimAligned
*
data
)
{}
virtual
void
addDimAlign
(
const
DRW_DimAligned
*
aData
)
{}
virtual
void
addDimLinear
(
const
DRW_DimLinear
*
data
)
{}
virtual
void
addDimLinear
(
const
DRW_DimLinear
*
aData
)
{}
virtual
void
addDimRadial
(
const
DRW_DimRadial
*
data
)
{}
virtual
void
addDimRadial
(
const
DRW_DimRadial
*
aData
)
{}
virtual
void
addDimDiametric
(
const
DRW_DimDiametric
*
data
)
{}
virtual
void
addDimDiametric
(
const
DRW_DimDiametric
*
aData
)
{}
virtual
void
addDimAngular
(
const
DRW_DimAngular
*
data
)
{}
virtual
void
addDimAngular
(
const
DRW_DimAngular
*
aData
)
{}
virtual
void
addDimAngular3P
(
const
DRW_DimAngular3p
*
data
)
{}
virtual
void
addDimAngular3P
(
const
DRW_DimAngular3p
*
aData
)
{}
virtual
void
addDimOrdinate
(
const
DRW_DimOrdinate
*
data
)
{}
virtual
void
addDimOrdinate
(
const
DRW_DimOrdinate
*
aData
)
{}
virtual
void
addLeader
(
const
DRW_Leader
*
data
)
{}
virtual
void
addLeader
(
const
DRW_Leader
*
aData
)
{}
virtual
void
addHatch
(
const
DRW_Hatch
*
data
)
{}
virtual
void
addHatch
(
const
DRW_Hatch
*
aData
)
{}
virtual
void
addImage
(
const
DRW_Image
*
data
)
{}
virtual
void
addImage
(
const
DRW_Image
*
aData
)
{}
virtual
void
linkImage
(
const
DRW_ImageDef
*
data
)
{}
virtual
void
linkImage
(
const
DRW_ImageDef
*
aData
)
{}
virtual
void
add3dFace
(
const
DRW_3Dface
&
data
)
{}
virtual
void
add3dFace
(
const
DRW_3Dface
&
aData
)
{}
virtual
void
addComment
(
const
char
*
)
{}
virtual
void
addComment
(
const
char
*
)
{}
virtual
void
addVport
(
const
DRW_Vport
&
data
)
{}
virtual
void
addVport
(
const
DRW_Vport
&
aData
)
{}
virtual
void
addTextStyle
(
const
DRW_Textstyle
&
data
);
virtual
void
addTextStyle
(
const
DRW_Textstyle
&
aData
);
virtual
void
addViewport
(
const
DRW_Viewport
&
data
)
{}
virtual
void
addViewport
(
const
DRW_Viewport
&
aData
)
{}
virtual
void
setBlock
(
const
int
handle
)
{}
virtual
void
setBlock
(
const
int
aHandle
)
{}
static
wxString
toDxfString
(
const
wxString
&
str
);
static
wxString
toDxfString
(
const
wxString
&
aStr
);
static
wxString
toNativeString
(
const
wxString
&
data
);
static
wxString
toNativeString
(
const
wxString
&
aData
);
// These functions are not used in Kicad.
// These functions are not used in Kicad.
// But because they are virtual pure in DRW_Interface, they should be defined
// But because they are virtual pure in DRW_Interface, they should be defined
virtual
void
writeTextstyles
()
{}
virtual
void
writeTextstyles
()
{}
virtual
void
writeVports
()
{}
virtual
void
writeVports
()
{}
virtual
void
writeHeader
(
DRW_Header
&
data
)
{}
virtual
void
writeHeader
(
DRW_Header
&
aData
)
{}
virtual
void
writeEntities
()
{}
virtual
void
writeEntities
()
{}
virtual
void
writeLTypes
()
{}
virtual
void
writeLTypes
()
{}
virtual
void
writeLayers
()
{}
virtual
void
writeLayers
()
{}
...
@@ -172,7 +171,6 @@ private:
...
@@ -172,7 +171,6 @@ private:
void
writeLine
();
void
writeLine
();
void
writeMtext
();
void
writeMtext
();
};
};
#endif // FILTERDXFRW_H
#endif // FILTERDXFRW_H
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