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
41c80dd9
Commit
41c80dd9
authored
Aug 01, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcbnew: work on undo/redo in progress
parent
f9be70f2
Changes
68
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
68 changed files
with
1551 additions
and
1364 deletions
+1551
-1364
CMakeLists.txt
common/CMakeLists.txt
+2
-1
class_undoredo_container.cpp
common/class_undoredo_container.cpp
+4
-4
block.cpp
eeschema/block.cpp
+1
-1
class_marker_sch.cpp
eeschema/class_marker_sch.cpp
+2
-2
class_marker_sch.h
eeschema/class_marker_sch.h
+3
-3
class_sch_screen.cpp
eeschema/class_sch_screen.cpp
+1
-1
cleanup.cpp
eeschema/cleanup.cpp
+1
-1
delete.cpp
eeschema/delete.cpp
+1
-1
dialog_erc.cpp
eeschema/dialog_erc.cpp
+1
-1
eeredraw.cpp
eeschema/eeredraw.cpp
+1
-1
erc.cpp
eeschema/erc.cpp
+1
-1
files-io.cpp
eeschema/files-io.cpp
+0
-2
find.cpp
eeschema/find.cpp
+1
-1
locate.cpp
eeschema/locate.cpp
+8
-9
netlist.cpp
eeschema/netlist.cpp
+3
-8
onleftclick.cpp
eeschema/onleftclick.cpp
+1
-2
onrightclick.cpp
eeschema/onrightclick.cpp
+1
-5
operations_on_items_lists.cpp
eeschema/operations_on_items_lists.cpp
+2
-2
plot.cpp
eeschema/plot.cpp
+1
-2
protos.h
eeschema/protos.h
+0
-2
schedit.cpp
eeschema/schedit.cpp
+2
-2
schematic_undo_redo.cpp
eeschema/schematic_undo_redo.cpp
+16
-21
CMakeLists.txt
gerbview/CMakeLists.txt
+1
-1
base_struct.h
include/base_struct.h
+20
-20
board_item_struct.h
include/board_item_struct.h
+30
-0
class_undoredo_container.h
include/class_undoredo_container.h
+4
-4
pcbstruct.h
include/pcbstruct.h
+2
-2
wxEeschemaStruct.h
include/wxEeschemaStruct.h
+19
-1
wxPcbStruct.h
include/wxPcbStruct.h
+55
-23
block.cpp
pcbnew/block.cpp
+366
-669
board_undo_redo.cpp
pcbnew/board_undo_redo.cpp
+132
-70
class_board.cpp
pcbnew/class_board.cpp
+8
-11
class_board.h
pcbnew/class_board.h
+6
-6
class_board_item.cpp
pcbnew/class_board_item.cpp
+4
-12
class_cotation.cpp
pcbnew/class_cotation.cpp
+29
-19
class_cotation.h
pcbnew/class_cotation.h
+11
-3
class_drawsegment.cpp
pcbnew/class_drawsegment.cpp
+29
-0
class_drawsegment.h
pcbnew/class_drawsegment.h
+25
-0
class_marker_pcb.cpp
pcbnew/class_marker_pcb.cpp
+35
-19
class_marker_pcb.h
pcbnew/class_marker_pcb.h
+34
-12
class_mire.cpp
pcbnew/class_mire.cpp
+24
-0
class_mire.h
pcbnew/class_mire.h
+25
-0
class_module.cpp
pcbnew/class_module.cpp
+27
-139
class_module.h
pcbnew/class_module.h
+20
-0
class_module_transform_functions.cpp
pcbnew/class_module_transform_functions.cpp
+399
-0
class_pad.h
pcbnew/class_pad.h
+9
-0
class_pcb_text.cpp
pcbnew/class_pcb_text.cpp
+35
-0
class_pcb_text.h
pcbnew/class_pcb_text.h
+25
-0
class_track.cpp
pcbnew/class_track.cpp
+28
-0
class_track.h
pcbnew/class_track.h
+26
-0
class_zone.cpp
pcbnew/class_zone.cpp
+13
-0
class_zone.h
pcbnew/class_zone.h
+8
-0
collectors.cpp
pcbnew/collectors.cpp
+2
-2
dialog_drc.h
pcbnew/dialog_drc.h
+2
-2
dialog_track_options.cpp
pcbnew/dialog_track_options.cpp
+2
-2
drc.cpp
pcbnew/drc.cpp
+10
-10
drc_stuff.h
pcbnew/drc_stuff.h
+8
-8
edit.cpp
pcbnew/edit.cpp
+4
-4
find.cpp
pcbnew/find.cpp
+1
-1
gen_drill_report_files.cpp
pcbnew/gen_drill_report_files.cpp
+6
-6
ioascii.cpp
pcbnew/ioascii.cpp
+1
-1
modedit_onclick.cpp
pcbnew/modedit_onclick.cpp
+1
-1
modules.cpp
pcbnew/modules.cpp
+2
-233
onrightclick.cpp
pcbnew/onrightclick.cpp
+3
-3
plot_rtn.cpp
pcbnew/plot_rtn.cpp
+2
-2
print_board_functions.cpp
pcbnew/print_board_functions.cpp
+1
-1
ratsnest.cpp
pcbnew/ratsnest.cpp
+1
-1
zones_test_and_combine_areas.cpp
pcbnew/zones_test_and_combine_areas.cpp
+3
-3
No files found.
common/CMakeLists.txt
View file @
41c80dd9
...
...
@@ -64,9 +64,10 @@ set(PCB_COMMON_SRCS
../pcbnew/class_netclass.cpp
../pcbnew/class_netinfo_item.cpp
../pcbnew/class_netinfolist.cpp
../pcbnew/class_marker.cpp
../pcbnew/class_marker
_pcb
.cpp
../pcbnew/class_mire.cpp
../pcbnew/class_module.cpp
../pcbnew/class_module_transform_functions.cpp
../pcbnew/class_pad.cpp
../pcbnew/class_pad_draw_functions.cpp
../pcbnew/class_pcb_text.cpp
...
...
common/class_undoredo_container.cpp
View file @
41c80dd9
...
...
@@ -113,11 +113,11 @@ EDA_BaseStruct* PICKED_ITEMS_LIST::GetPickedItem( unsigned int aIdx )
}
/** function GetLink
/** function Get
PickedItem
Link
* @return link of the picked item, or null if does not exist
* @param aIdx = index of the picked item in the picked list
*/
EDA_BaseStruct
*
PICKED_ITEMS_LIST
::
GetLink
(
unsigned
int
aIdx
)
EDA_BaseStruct
*
PICKED_ITEMS_LIST
::
Get
PickedItem
Link
(
unsigned
int
aIdx
)
{
if
(
aIdx
<
m_ItemsList
.
size
()
)
return
m_ItemsList
[
aIdx
].
m_Link
;
...
...
@@ -157,13 +157,13 @@ bool PICKED_ITEMS_LIST::SetPickedItem( EDA_BaseStruct* aItem, unsigned aIdx )
}
/** function SetLink
/** function Set
PickedItem
Link
* Set the link associated to a given picked item
* @param aLink = the link to the item associated to the picked item
* @param aIdx = index of the picker in the picked list
* @return true if the picker exists, or false if does not exist
*/
bool
PICKED_ITEMS_LIST
::
SetLink
(
EDA_BaseStruct
*
aLink
,
unsigned
aIdx
)
bool
PICKED_ITEMS_LIST
::
Set
PickedItem
Link
(
EDA_BaseStruct
*
aLink
,
unsigned
aIdx
)
{
if
(
aIdx
<
m_ItemsList
.
size
()
)
{
...
...
eeschema/block.cpp
View file @
41c80dd9
...
...
@@ -812,7 +812,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
case
DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE
:
break
;
case
DRAW_MARKER_STRUCT_TYPE
:
case
TYPE_MARKER_SCH
:
#undef STRUCT
#define STRUCT ( (MARKER_SCH*) Struct )
if
(
Struct
->
m_Flags
&
SELECTED
)
...
...
eeschema/class_marker_sch.cpp
View file @
41c80dd9
...
...
@@ -32,14 +32,14 @@ const wxChar* NameMarqueurType[] =
/**************************/
MARKER_SCH
::
MARKER_SCH
()
:
SCH_ITEM
(
NULL
,
DRAW_MARKER_STRUCT_TYPE
),
SCH_ITEM
(
NULL
,
TYPE_MARKER_SCH
),
MARKER_BASE
()
{
}
MARKER_SCH
::
MARKER_SCH
(
const
wxPoint
&
pos
,
const
wxString
&
text
)
:
SCH_ITEM
(
NULL
,
DRAW_MARKER_STRUCT_TYPE
),
SCH_ITEM
(
NULL
,
TYPE_MARKER_SCH
),
MARKER_BASE
(
0
,
pos
,
text
,
pos
)
{
}
...
...
eeschema/class_marker_sch.h
View file @
41c80dd9
...
...
@@ -2,8 +2,8 @@
/* classes to handle markers used in schematic ... */
/***************************************************/
#ifndef _
CLASS
_MARKER_SCH_H_
#define _
CLASS
_MARKER_SCH_H_
#ifndef _
TYPE
_MARKER_SCH_H_
#define _
TYPE
_MARKER_SCH_H_
#include "sch_item_struct.h"
#include "class_marker_base.h"
...
...
@@ -103,4 +103,4 @@ public:
#endif
};
#endif
/* _
CLASS
_MARKER_SCH_H_ */
#endif
/* _
TYPE
_MARKER_SCH_H_ */
eeschema/class_sch_screen.cpp
View file @
41c80dd9
...
...
@@ -26,7 +26,7 @@ void SetaParent( EDA_BaseStruct* Struct, BASE_SCREEN* Screen )
case
DRAW_SEGMENT_STRUCT_TYPE
:
case
DRAW_BUSENTRY_STRUCT_TYPE
:
case
DRAW_SHEET_STRUCT_TYPE
:
case
DRAW_MARKER_STRUCT_TYPE
:
case
TYPE_MARKER_SCH
:
case
DRAW_NOCONNECT_STRUCT_TYPE
:
Struct
->
SetParent
(
Screen
);
break
;
...
...
eeschema/cleanup.cpp
View file @
41c80dd9
...
...
@@ -115,7 +115,7 @@ void BreakSegmentOnJunction( SCH_SCREEN* Screen )
case
TYPE_SCH_HIERLABEL
:
case
TYPE_SCH_COMPONENT
:
case
DRAW_POLYLINE_STRUCT_TYPE
:
case
DRAW_MARKER_STRUCT_TYPE
:
case
TYPE_MARKER_SCH
:
case
TYPE_SCH_TEXT
:
case
DRAW_SHEET_STRUCT_TYPE
:
case
DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE
:
...
...
eeschema/delete.cpp
View file @
41c80dd9
...
...
@@ -474,7 +474,7 @@ void DeleteAllMarkers( int type )
for
(
DrawStruct
=
screen
->
EEDrawList
;
DrawStruct
!=
NULL
;
DrawStruct
=
NextStruct
)
{
NextStruct
=
DrawStruct
->
Next
();
if
(
DrawStruct
->
Type
()
!=
DRAW_MARKER_STRUCT_TYPE
)
if
(
DrawStruct
->
Type
()
!=
TYPE_MARKER_SCH
)
continue
;
/* Marqueur trouve */
...
...
eeschema/dialog_erc.cpp
View file @
41c80dd9
...
...
@@ -303,7 +303,7 @@ void DIALOG_ERC::DisplayERC_MarkersList()
SCH_ITEM
*
DrawStruct
=
Sheet
->
LastDrawList
();
for
(
;
DrawStruct
!=
NULL
;
DrawStruct
=
DrawStruct
->
Next
()
)
{
if
(
DrawStruct
->
Type
()
!=
DRAW_MARKER_STRUCT_TYPE
)
if
(
DrawStruct
->
Type
()
!=
TYPE_MARKER_SCH
)
continue
;
/* Marqueur trouve */
...
...
eeschema/eeredraw.cpp
View file @
41c80dd9
...
...
@@ -279,7 +279,7 @@ void DrawStructsInGhost( WinEDA_DrawPanel * aPanel, wxDC * aDC, SCH_ITEM * aItem
}
case
DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE
:
case
DRAW_MARKER_STRUCT_TYPE
:
case
TYPE_MARKER_SCH
:
break
;
default
:
...
...
eeschema/erc.cpp
View file @
41c80dd9
...
...
@@ -668,7 +668,7 @@ static bool WriteDiagnosticERC( const wxString& FullFileName )
DrawStruct
=
Sheet
->
LastDrawList
();
for
(
;
DrawStruct
!=
NULL
;
DrawStruct
=
DrawStruct
->
Next
()
)
{
if
(
DrawStruct
->
Type
()
!=
DRAW_MARKER_STRUCT_TYPE
)
if
(
DrawStruct
->
Type
()
!=
TYPE_MARKER_SCH
)
continue
;
Marker
=
(
MARKER_SCH
*
)
DrawStruct
;
...
...
eeschema/files-io.cpp
View file @
41c80dd9
...
...
@@ -14,8 +14,6 @@
#include "protos.h"
#include "id.h"
/* Fonctions locales */
/****************************************************************/
void
WinEDA_SchematicFrame
::
Save_File
(
wxCommandEvent
&
event
)
...
...
eeschema/find.cpp
View file @
41c80dd9
...
...
@@ -291,7 +291,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindMarker( int SearchType )
DrawList
=
(
SCH_ITEM
*
)
sheet
->
LastDrawList
();
while
(
DrawList
&&
NotFound
)
{
if
(
DrawList
->
Type
()
==
DRAW_MARKER_STRUCT_TYPE
)
if
(
DrawList
->
Type
()
==
TYPE_MARKER_SCH
)
{
Marker
=
(
MARKER_SCH
*
)
DrawList
;
NotFound
=
FALSE
;
...
...
eeschema/locate.cpp
View file @
41c80dd9
...
...
@@ -3,9 +3,7 @@
/******************************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "confirm.h"
#include "program.h"
#include "libcmp.h"
#include "general.h"
...
...
@@ -16,6 +14,7 @@
#include "protos.h"
/* Routines Locales */
static
bool
DrawStructInBox
(
int
x1
,
int
y1
,
int
x2
,
int
y2
,
SCH_ITEM
*
DrawStruct
);
static
SCH_ITEM
*
LastSnappedStruct
=
NULL
;
static
bool
IsBox1InBox2
(
int
StartX1
,
int
StartY1
,
int
EndX1
,
int
EndY1
,
int
StartX2
,
int
StartY2
,
int
EndX2
,
int
EndY2
);
...
...
@@ -262,7 +261,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask,
}
break
;
case
DRAW_MARKER_STRUCT_TYPE
:
case
TYPE_MARKER_SCH
:
{
#undef STRUCT
#define STRUCT ( (MARKER_SCH*) DrawList )
...
...
@@ -358,7 +357,7 @@ bool SnapPoint2( const wxPoint& aPosRef, int SearchMask,
wxString
msg
;
msg
.
Printf
(
wxT
(
"SnapPoint2() error: unexpected struct type %d ("
),
DrawList
->
Type
()
);
msg
<<
DrawList
->
GetClass
()
<<
wxT
(
")"
);
DisplayError
(
NULL
,
msg
);
wxMessageBox
(
msg
);
break
;
}
}
...
...
@@ -433,7 +432,7 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2, SCH_ITEM* DrawStruct )
break
;
case
DRAW_MARKER_STRUCT_TYPE
:
case
TYPE_MARKER_SCH
:
#undef STRUCT
#define STRUCT ( (MARKER_SCH*) DrawStruct )
if
(
(
STRUCT
->
m_Pos
.
x
>=
x1
)
&&
(
STRUCT
->
m_Pos
.
x
<=
x2
)
...
...
@@ -540,7 +539,7 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2, SCH_ITEM* DrawStruct )
wxT
(
"DrawStructInBox() Err: unexpected StructType %d ("
),
DrawStruct
->
Type
()
);
msg
<<
DrawStruct
->
GetClass
()
<<
wxT
(
")"
);
DisplayError
(
NULL
,
msg
);
wxMessageBox
(
msg
);
break
;
}
...
...
@@ -634,7 +633,7 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
if
(
LibEntry
->
Type
!=
ROOT
)
{
DisplayError
(
NULL
,
wxT
(
"Error in LocateDrawItem: Entry is ALIAS"
)
);
wxMessageBox
(
wxT
(
"Error in LocateDrawItem: Entry is ALIAS"
)
);
return
NULL
;
}
...
...
@@ -729,7 +728,7 @@ LibDrawPin* LocatePinByNumber( const wxString& ePin_Number,
if
(
Entry
->
Type
!=
ROOT
)
{
DisplayError
(
NULL
,
wxT
(
"LocatePinByNumber() error: Entry is ALIAS"
)
);
wxMessageBox
(
wxT
(
"LocatePinByNumber() error: Entry is ALIAS"
)
);
return
NULL
;
}
...
...
@@ -776,7 +775,7 @@ LibEDA_BaseStruct* LocatePin( const wxPoint& RefPos,
if
(
Entry
->
Type
!=
ROOT
)
{
DisplayError
(
NULL
,
wxT
(
"LocatePin() error: Entry is ALIAS"
)
);
wxMessageBox
(
wxT
(
"LocatePin() error: Entry is ALIAS"
)
);
return
NULL
;
}
...
...
eeschema/netlist.cpp
View file @
41c80dd9
...
...
@@ -3,9 +3,7 @@
/***********************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "confirm.h"
#include "program.h"
#include "libcmp.h"
#include "general.h"
...
...
@@ -535,7 +533,7 @@ static void ListeObjetConnection( DrawSheetPath* sheetlist,
case
DRAW_POLYLINE_STRUCT_TYPE
:
case
DRAW_BUSENTRY_STRUCT_TYPE
:
case
DRAW_MARKER_STRUCT_TYPE
:
case
TYPE_MARKER_SCH
:
case
TYPE_SCH_TEXT
:
break
;
...
...
@@ -569,15 +567,12 @@ static void ListeObjetConnection( DrawSheetPath* sheetlist,
break
;
case
DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE
:
DisplayError
(
NULL
,
wxT
(
"Netlist: Type DRAW_SHEETLABEL inattendu"
)
);
break
;
default
:
{
wxString
msg
;
msg
.
Printf
(
wxT
(
"Netlist: unexpected
type struct
%d"
),
msg
.
Printf
(
wxT
(
"Netlist: unexpected
struct type
%d"
),
DrawList
->
Type
()
);
DisplayError
(
NULL
,
msg
);
wxMessageBox
(
msg
);
break
;
}
}
...
...
eeschema/onleftclick.cpp
View file @
41c80dd9
...
...
@@ -3,7 +3,6 @@
/******************************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "id.h"
#include "class_drawpanel.h"
...
...
@@ -370,7 +369,7 @@ void WinEDA_SchematicFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
DrawPanel
->
MouseToCursorSchema
();
break
;
case
DRAW_MARKER_STRUCT_TYPE
:
case
TYPE_MARKER_SCH
:
((
MARKER_SCH
*
)
DrawStruct
)
->
DisplayMarkerInfo
(
this
);
break
;
...
...
eeschema/onrightclick.cpp
View file @
41c80dd9
...
...
@@ -3,10 +3,6 @@
/* droit de la souris */
/******************************************************************/
#ifdef __GNUG__
#pragma implementation
#endif
#include "fctsys.h"
#include "common.h"
#include "id.h"
...
...
@@ -140,7 +136,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
_
(
"Delete Bus Entry"
),
delete_bus_xpm
);
break
;
case
DRAW_MARKER_STRUCT_TYPE
:
case
TYPE_MARKER_SCH
:
AddMenusForMarkers
(
PopMenu
,
(
MARKER_SCH
*
)
DrawStruct
,
this
);
break
;
...
...
eeschema/operations_on_items_lists.cpp
View file @
41c80dd9
...
...
@@ -169,7 +169,7 @@ void DuplicateItemsInList( SCH_SCREEN* screen, PICKED_ITEMS_LIST& aItemsList, co
case
TYPE_SCH_GLOBALLABEL
:
case
TYPE_SCH_HIERLABEL
:
case
DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE
:
case
DRAW_MARKER_STRUCT_TYPE
:
case
TYPE_MARKER_SCH
:
case
DRAW_NOCONNECT_STRUCT_TYPE
:
default
:
break
;
...
...
@@ -232,7 +232,7 @@ SCH_ITEM* DuplicateStruct( SCH_ITEM* DrawStruct )
NewDrawStruct
=
(
(
DrawJunctionStruct
*
)
DrawStruct
)
->
GenCopy
();
break
;
case
DRAW_MARKER_STRUCT_TYPE
:
case
TYPE_MARKER_SCH
:
NewDrawStruct
=
(
(
MARKER_SCH
*
)
DrawStruct
)
->
GenCopy
();
break
;
...
...
eeschema/plot.cpp
View file @
41c80dd9
...
...
@@ -3,7 +3,6 @@
/***************************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "plot_common.h"
#include "worksheet.h"
...
...
@@ -756,7 +755,7 @@ void PlotDrawlist( Plotter* plotter, SCH_ITEM* aDrawlist )
case
DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE
:
break
;
case
DRAW_MARKER_STRUCT_TYPE
:
case
TYPE_MARKER_SCH
:
break
;
case
DRAW_SHEET_STRUCT_TYPE
:
...
...
eeschema/protos.h
View file @
41c80dd9
...
...
@@ -98,8 +98,6 @@ void DeleteStruct(WinEDA_DrawPanel * panel, wxDC * DC, SCH_ITEM *DrawStruct);
/*************/
/* LOCATE.CPP */
/*************/
bool
DrawStructInBox
(
int
x1
,
int
y1
,
int
x2
,
int
y2
,
SCH_ITEM
*
DrawStruct
);
LibDrawPin
*
LocatePinByNumber
(
const
wxString
&
ePin_Number
,
SCH_COMPONENT
*
eComponent
);
...
...
eeschema/schedit.cpp
View file @
41c80dd9
...
...
@@ -714,7 +714,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
break
;
case
ID_POPUP_SCH_GETINFO_MARKER
:
if
(
screen
->
GetCurItem
()
&&
screen
->
GetCurItem
()
->
Type
()
==
DRAW_MARKER_STRUCT_TYPE
)
if
(
screen
->
GetCurItem
()
&&
screen
->
GetCurItem
()
->
Type
()
==
TYPE_MARKER_SCH
)
((
MARKER_SCH
*
)
screen
->
GetCurItem
())
->
DisplayMarkerInfo
(
this
);
break
;
...
...
@@ -775,7 +775,7 @@ void WinEDA_SchematicFrame::Process_Move_Item( SCH_ITEM* DrawStruct, wxDC* DC )
StartMoveCmpField
(
(
SCH_CMP_FIELD
*
)
DrawStruct
,
DC
);
break
;
case
DRAW_MARKER_STRUCT_TYPE
:
case
TYPE_MARKER_SCH
:
case
DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE
:
default
:
wxString
msg
;
...
...
eeschema/schematic_undo_redo.cpp
View file @
41c80dd9
...
...
@@ -144,7 +144,7 @@ void SwapData( EDA_BaseStruct* aItem, EDA_BaseStruct* aImage )
DEST
->
SwapData
(
SOURCE
);
break
;
case
DRAW_MARKER_STRUCT_TYPE
:
case
TYPE_MARKER_SCH
:
#undef SOURCE
#undef DEST
#define SOURCE ( (MARKER_SCH*) aItem )
...
...
@@ -322,17 +322,16 @@ void WinEDA_SchematicFrame::SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList,
}
/***************************************************************************/
void
WinEDA_SchematicFrame
::
PutDataInPreviousState
(
PICKED_ITEMS_LIST
*
aList
)
/***************************************************************************/
/* Used in undo or redo command.
/** Function PutDataInPreviousState()
* Used in undo or redo command.
* Put data pointed by List in the previous state, i.e. the state memorised by List
* @param aList = a PICKED_ITEMS_LIST pointer to the list of items to undo/redo
* @param aRedoCommand = a bool: true for redo, false for undo
*/
void
WinEDA_SchematicFrame
::
PutDataInPreviousState
(
PICKED_ITEMS_LIST
*
aList
,
bool
aRedoCommand
)
{
SCH_ITEM
*
item
;
SCH_ITEM
*
alt_item
;
bool
as_moved
=
false
;
for
(
unsigned
ii
=
0
;
ii
<
aList
->
GetCount
();
ii
++
)
{
...
...
@@ -360,8 +359,7 @@ void WinEDA_SchematicFrame::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
break
;
case
UR_MOVED
:
item
->
Move
(
-
aList
->
m_TransformPoint
);
as_moved
=
true
;
item
->
Move
(
aRedoCommand
?
aList
->
m_TransformPoint
:
-
aList
->
m_TransformPoint
);
break
;
case
UR_MIRRORED_Y
:
...
...
@@ -397,10 +395,6 @@ void WinEDA_SchematicFrame::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
break
;
}
}
// Undo for move transform needs to change the general move vector:
if
(
as_moved
)
aList
->
m_TransformPoint
=
-
aList
->
m_TransformPoint
;
}
...
...
@@ -411,8 +405,8 @@ void WinEDA_SchematicFrame::GetSchematicFromUndoList(wxCommandEvent& event)
/** Function GetSchematicFromUndoList
* Undo the last edition:
* - Save the current schematic in Redo list
* - Get
an old version of the schematic
* @return
false if nothing done, else tru
e
* - Get
the previous version of the schematic from Unodo list
* @return
non
e
*/
{
if
(
GetScreen
()
->
GetUndoCommandCount
()
<=
0
)
...
...
@@ -422,7 +416,7 @@ void WinEDA_SchematicFrame::GetSchematicFromUndoList(wxCommandEvent& event)
PICKED_ITEMS_LIST
*
List
=
GetScreen
()
->
PopCommandFromUndoList
();
GetScreen
()
->
PushCommandToRedoList
(
List
);
/* Undo the command */
PutDataInPreviousState
(
List
);
PutDataInPreviousState
(
List
,
false
);
CurrentDrawItem
=
NULL
;
GetScreen
()
->
SetModify
();
...
...
@@ -438,10 +432,11 @@ void WinEDA_SchematicFrame::GetSchematicFromUndoList(wxCommandEvent& event)
void
WinEDA_SchematicFrame
::
GetSchematicFromRedoList
(
wxCommandEvent
&
event
)
/**********************************************************/
/* Redo the last edition:
/** Function GetSchematicFromRedoList
* Redo the last edition:
* - Save the current schematic in undo list
* - Get the
old version
* @return
false if nothing done, else tru
e
* - Get the
previous version from Redo list
* @return
non
e
*/
{
if
(
GetScreen
()
->
GetRedoCommandCount
()
==
0
)
...
...
@@ -453,7 +448,7 @@ void WinEDA_SchematicFrame::GetSchematicFromRedoList(wxCommandEvent& event)
GetScreen
()
->
PushCommandToUndoList
(
List
);
/* Redo the command: */
PutDataInPreviousState
(
List
);
PutDataInPreviousState
(
List
,
true
);
CurrentDrawItem
=
NULL
;
GetScreen
()
->
SetModify
();
...
...
gerbview/CMakeLists.txt
View file @
41c80dd9
...
...
@@ -70,7 +70,7 @@ if(APPLE)
set_target_properties
(
gerbview PROPERTIES MACOSX_BUNDLE_INFO_PLIST
${
CMAKE_CURRENT_SOURCE_DIR
}
/Info.plist
)
endif
(
APPLE
)
target_link_libraries
(
gerbview
3d-viewer common pcbcommon
polygon bitmaps kbool
${
wxWidgets_LIBRARIES
}
)
target_link_libraries
(
gerbview
common pcbcommon 3d-viewer
polygon bitmaps kbool
${
wxWidgets_LIBRARIES
}
)
install
(
TARGETS gerbview
DESTINATION
${
KICAD_BIN
}
...
...
include/base_struct.h
View file @
41c80dd9
...
...
@@ -24,27 +24,24 @@ enum KICAD_T {
TYPE_NOT_INIT
=
0
,
TYPE_PCB
,
TYPE_SCREEN
,
// not really an item, used to identify a screen
// Items in pcb
TYPE_MODULE
,
TYPE_PAD
,
TYPE_DRAWSEGMENT
,
TYPE_TEXTE
,
TYPE_TEXTE_MODULE
,
TYPE_EDGE_MODULE
,
TYPE_TRACK
,
TYPE_CLR
,
TYPE_ZONE
,
TYPE_VIA
,
TYPE_MARKER
,
TYPE_COTATION
,
TYPE_MIRE
,
TYPE_SCREEN
,
TYPE_BLOCK
,
TYPE_ZONE_UNUSED
,
TYPE_ZONE_EDGE_CORNER
,
TYPE_ZONE_CONTAINER
,
TYPE_BOARD_ITEM_LIST
,
TYPE_MODULE
,
// a footprint
TYPE_PAD
,
// a pad in a footprint
TYPE_DRAWSEGMENT
,
// a segment not on copper layers
TYPE_TEXTE
,
// a text on a layer
TYPE_TEXTE_MODULE
,
// a text in a footprint
TYPE_EDGE_MODULE
,
// a footprint edge
TYPE_TRACK
,
// a track segment (segment on a copper layer)
TYPE_VIA
,
// a via (like atrack segment on a copper layer)
TYPE_ZONE
,
// a segment used to fill a zome area (segment on a copper layer)
TYPE_MARKER_PCB
,
// a marker used to show something
TYPE_COTATION
,
// a dimension (graphic item)
TYPE_MIRE
,
// a target (graphic item)
TYPE_ZONE_EDGE_CORNER
,
// in zone outline: a point to define an outline
TYPE_ZONE_CONTAINER
,
// a zone area
TYPE_BOARD_ITEM_LIST
,
// a list of board items
// Draw Items in schematic
DRAW_POLYLINE_STRUCT_TYPE
,
...
...
@@ -58,7 +55,7 @@ enum KICAD_T {
DRAW_BUSENTRY_STRUCT_TYPE
,
DRAW_SHEET_STRUCT_TYPE
,
DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE
,
DRAW_MARKER_STRUCT_TYPE
,
TYPE_MARKER_SCH
,
DRAW_NOCONNECT_STRUCT_TYPE
,
DRAW_PART_TEXT_STRUCT_TYPE
,
...
...
@@ -78,6 +75,9 @@ enum KICAD_T {
COMPONENT_FIELD_DRAW_TYPE
,
COMPONENT_BEZIER_DRAW_TYPE
,
// Special id used to store clearance values (this is not a good idea: TODO: change it)
TYPE_CLEARANCE
,
// End value
MAX_STRUCT_TYPE_ID
};
...
...
include/board_item_struct.h
View file @
41c80dd9
...
...
@@ -176,6 +176,36 @@ public:
* @return bool - true if success writing else false.
*/
virtual
bool
Save
(
FILE
*
aFile
)
const
=
0
;
// Some geometric transforms, that must be rewrittem for derived classes
/**
* Function Move
* move this object.
* @param const wxPoint& aMoveVector - the move vector for this object.
*/
virtual
void
Move
(
const
wxPoint
&
aMoveVector
)
{
wxMessageBox
(
wxT
(
"virtual BOARD_ITEM::Move used, should not occur"
),
GetClass
());
}
/**
* Function Rotate
* Rotate this object.
* @param const wxPoint& aRotCentre - the rotation point.
* @param aAngle - the rotation angle in 0.1 degree.
*/
virtual
void
Rotate
(
const
wxPoint
&
aRotCentre
,
int
aAngle
)
{
wxMessageBox
(
wxT
(
"virtual BOARD_ITEM::Rotate used, should not occur"
),
GetClass
());
}
/**
* Function Flip
* Flip this object, i.e. change the board side for this object
* @param const wxPoint& aCentre - the rotation point.
*/
virtual
void
Flip
(
const
wxPoint
&
aCentre
)
{
wxMessageBox
(
wxT
(
"virtual BOARD_ITEM::Flip used, should not occur"
),
GetClass
());
}
};
...
...
include/class_undoredo_container.h
View file @
41c80dd9
...
...
@@ -135,11 +135,11 @@ public:
*/
EDA_BaseStruct
*
GetPickedItem
(
unsigned
int
aIdx
);
/** function GetLink
/** function Get
PickedItem
Link
* @return link of the picked item, or null if does not exist
* @param aIdx = index of the picked item in the picked list
*/
EDA_BaseStruct
*
GetLink
(
unsigned
int
aIdx
);
EDA_BaseStruct
*
Get
PickedItem
Link
(
unsigned
int
aIdx
);
/** function GetPickedItemStatus
* @return the type of undo/redo opertaion associated to the picked item,
...
...
@@ -163,13 +163,13 @@ public:
*/
bool
SetPickedItem
(
EDA_BaseStruct
*
aItem
,
UndoRedoOpType
aStatus
,
unsigned
aIdx
);
/** function SetLink
/** function Set
PickedItem
Link
* Set the link associated to a given picked item
* @param aLink = the link to the item associated to the picked item
* @param aIdx = index of the picker in the picked list
* @return true if the pixker exists, or false if does not exist
*/
bool
SetLink
(
EDA_BaseStruct
*
aLink
,
unsigned
aIdx
);
bool
Set
PickedItem
Link
(
EDA_BaseStruct
*
aLink
,
unsigned
aIdx
);
/** function SetPickedItemStatus
* Set the the type of undo/redo operation for a given picked item
...
...
include/pcbstruct.h
View file @
41c80dd9
...
...
@@ -124,7 +124,7 @@
/* Forward declaration */
class
NETINFO_ITEM
;
class
MARKER
;
class
MARKER
_PCB
;
class
RATSNEST_ITEM
;
...
...
@@ -223,7 +223,7 @@ enum DisplayViaMode {
#include "class_cotation.h"
#include "class_mire.h"
#include "class_track.h"
#include "class_marker.h"
#include "class_marker
_pcb
.h"
#include "class_zone.h"
/* Values for DISPLAY_OPTIONS.ShowTrackClearanceMode parameter option
...
...
include/wxEeschemaStruct.h
View file @
41c80dd9
...
...
@@ -391,8 +391,26 @@ public:
const
wxPoint
&
aTransformPoint
=
wxPoint
(
0
,
0
)
);
private
:
void
PutDataInPreviousState
(
PICKED_ITEMS_LIST
*
aList
);
/** Function PutDataInPreviousState()
* Used in undo or redo command.
* Put data pointed by List in the previous state, i.e. the state memorised by List
* @param aList = a PICKED_ITEMS_LIST pointer to the list of items to undo/redo
* @param aRedoCommand = a bool: true for redo, false for undo
*/
void
PutDataInPreviousState
(
PICKED_ITEMS_LIST
*
aList
,
bool
aRedoCommand
);
/** Function GetSchematicFromRedoList
* Redo the last edition:
* - Save the current schematic in Undo list
* - Get an old version of the schematic from Redo list
* @return none
*/
void
GetSchematicFromRedoList
(
wxCommandEvent
&
event
);
/** Function GetSchematicFromUndoList
* Undo the last edition:
* - Save the current schematic in Redo list
* - Get an old version of the schematic from Undo list
* @return none
*/
void
GetSchematicFromUndoList
(
wxCommandEvent
&
event
);
...
...
include/wxPcbStruct.h
View file @
41c80dd9
...
...
@@ -72,7 +72,7 @@ private:
void
createPopupMenuForTracks
(
TRACK
*
aTrack
,
wxMenu
*
aPopMenu
);
void
createPopUpMenuForTexts
(
TEXTE_PCB
*
Text
,
wxMenu
*
menu
);
void
createPopUpBlockMenu
(
wxMenu
*
menu
);
void
createPopUpMenuForMarkers
(
MARKER
*
aMarker
,
wxMenu
*
aPopMenu
);
void
createPopUpMenuForMarkers
(
MARKER
_PCB
*
aMarker
,
wxMenu
*
aPopMenu
);
public
:
WinEDA_PcbFrame
(
wxWindow
*
father
,
const
wxString
&
title
,
...
...
@@ -156,8 +156,26 @@ public:
void
SaveCopyInUndoList
(
PICKED_ITEMS_LIST
&
aItemsList
,
UndoRedoOpType
aTypeCommand
,
const
wxPoint
&
aTransformPoint
=
wxPoint
(
0
,
0
)
);
void
PutDataInPreviousState
(
PICKED_ITEMS_LIST
*
aList
);
/** Function PutDataInPreviousState()
* Used in undo or redo command.
* Put data pointed by List in the previous state, i.e. the state memorised by List
* @param aList = a PICKED_ITEMS_LIST pointer to the list of items to undo/redo
* @param aRedoCommand = a bool: true for redo, false for undo
*/
void
PutDataInPreviousState
(
PICKED_ITEMS_LIST
*
aList
,
bool
aRedoCommand
);
/** Function GetBoardFromRedoList
* Redo the last edition:
* - Save the current board in Undo list
* - Get an old version of the board from Redo list
* @return none
*/
void
GetBoardFromRedoList
(
wxCommandEvent
&
event
);
/** Function GetBoardFromUndoList
* Undo the last edition:
* - Save the current board in Redo list
* - Get an old version of the board from Undo list
* @return none
*/
void
GetBoardFromUndoList
(
wxCommandEvent
&
event
);
/* Gestion generale des operations sur block */
...
...
@@ -166,41 +184,55 @@ public:
int
HandleBlockEnd
(
wxDC
*
DC
);
/* Block operations: */
/**
* Function Block_SelectItems
* Uses GetScreen()->m_BlockLocate
* select items within the selected block.
* selected items are put in the pick list
* @param none
*/
void
Block_SelectItems
(
);
/**
* Function Block_Delete
* deletes all tracks and segments within the selected block.
* Defined separately in pcbnew and gerbview
*
* @param DC A device context to draw on.
* deletes all items within the selected block.
* @param none
*/
void
Block_Delete
(
wxDC
*
DC
);
void
Block_Rotate
(
wxDC
*
DC
);
void
Block_Invert
(
wxDC
*
DC
);
void
Block_Delete
(
);
/**
* Function Block_Rotate
* Rotate all items within the selected block.
* The rotation centre is the centre of the block
* @param none
*/
void
Block_Rotate
(
);
/**
* Function Block_Flip
* Flip items within the selected block.
* The flip centre is the centre of the block
* @param none
*/
void
Block_Flip
(
);
/**
* Function Block_Move
* move
s all tracks and segment
s within the selected block.
* move
all item
s within the selected block.
* New location is determined by the current offset from the selected block's original location.
* Defined separately in pcbnew and gerbview
*
* @param DC A device context to draw on.
* @param none
*/
void
Block_Move
(
wxDC
*
DC
);
void
Block_Move
(
);
/**
* Function Block_Mirror_X
* mirrors all tracks and segments within the currently selected block in the X axis.
*
* @param DC A device context to draw on.
* mirrors all items within the currently selected block in the X axis.
* @param none
*/
void
Block_Mirror_X
(
wxDC
*
DC
);
void
Block_Mirror_X
(
);
/**
* Function Block_Duplicate
*
copies-and-moves all tracks and segment
s within the selected block.
*
Duplicate all item
s within the selected block.
* New location is determined by the current offset from the selected block's original location.
* Defined separately in pcbnew and gerbview
*
* @param DC A device context to draw on.
* @param none
*/
void
Block_Duplicate
(
wxDC
*
DC
);
void
Block_Duplicate
(
);
void
SetToolbars
();
...
...
pcbnew/block.cpp
View file @
41c80dd9
This diff is collapsed.
Click to expand it.
pcbnew/board_undo_redo.cpp
View file @
41c80dd9
This diff is collapsed.
Click to expand it.
pcbnew/class_board.cpp
View file @
41c80dd9
...
...
@@ -203,9 +203,9 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, int aControl )
switch
(
aBoardItem
->
Type
()
)
{
// this one uses a vector
case
TYPE_MARKER
:
case
TYPE_MARKER
_PCB
:
aBoardItem
->
SetParent
(
this
);
m_markers
.
push_back
(
(
MARKER
*
)
aBoardItem
);
m_markers
.
push_back
(
(
MARKER
_PCB
*
)
aBoardItem
);
break
;
// this one uses a vector
...
...
@@ -267,12 +267,12 @@ BOARD_ITEM* BOARD::Remove( BOARD_ITEM* aBoardItem )
switch
(
aBoardItem
->
Type
()
)
{
case
TYPE_MARKER
:
case
TYPE_MARKER
_PCB
:
// find the item in the vector, then remove it
for
(
unsigned
i
=
0
;
i
<
m_markers
.
size
();
++
i
)
{
if
(
m_markers
[
i
]
==
(
MARKER
*
)
aBoardItem
)
if
(
m_markers
[
i
]
==
(
MARKER
_PCB
*
)
aBoardItem
)
{
m_markers
.
erase
(
m_markers
.
begin
()
+
i
);
break
;
...
...
@@ -326,7 +326,7 @@ BOARD_ITEM* BOARD::Remove( BOARD_ITEM* aBoardItem )
void
BOARD
::
DeleteMARKERs
()
{
// the vector does not know how to delete the MARKER, it holds pointers
// the vector does not know how to delete the MARKER
_PCB
, it holds pointers
for
(
unsigned
i
=
0
;
i
<
m_markers
.
size
();
++
i
)
delete
m_markers
[
i
];
...
...
@@ -691,9 +691,9 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR* inspector, const void* testData,
break
;
#endif
case
TYPE_MARKER
:
case
TYPE_MARKER
_PCB
:
// MARKERS are in the m_markers std::vector
// MARKER
_PCB
S are in the m_markers std::vector
for
(
unsigned
i
=
0
;
i
<
m_markers
.
size
();
++
i
)
{
result
=
m_markers
[
i
]
->
Visit
(
inspector
,
testData
,
p
);
...
...
@@ -722,9 +722,6 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR* inspector, const void* testData,
++
p
;
break
;
case
TYPE_ZONE_UNUSED
:
// Unused type
break
;
default
:
// catch EOT or ANY OTHER type here and return.
done
=
true
;
break
;
...
...
@@ -975,7 +972,7 @@ bool BOARD::Save( FILE* aFile ) const
}
}
// do not save MARKERs, they can be regenerated easily
// do not save MARKER
_PCB
s, they can be regenerated easily
// save the tracks & vias
fprintf
(
aFile
,
"$TRACK
\n
"
);
...
...
pcbnew/class_board.h
View file @
41c80dd9
...
...
@@ -70,8 +70,8 @@ class BOARD : public BOARD_ITEM
friend
class
WinEDA_PcbFrame
;
private
:
typedef
std
::
vector
<
MARKER
*>
MARKERS
;
// @todo: switch to boost:ptr_vector, and change ~BOARD()
MARKERS
m_markers
;
///< MARKERs for clearance problems, owned by pointer
typedef
std
::
vector
<
MARKER
_PCB
*>
MARKERS
;
// @todo: switch to boost:ptr_vector, and change ~BOARD()
MARKERS
m_markers
;
///< MARKER
_PCB
s for clearance problems, owned by pointer
typedef
std
::
vector
<
ZONE_CONTAINER
*>
ZONE_CONTAINERS
;
// @todo: switch to boost::ptr_vector, and change ~BOARD()
ZONE_CONTAINERS
m_ZoneDescriptorList
;
///< edge zone descriptors, owned by pointer
...
...
@@ -162,10 +162,10 @@ public:
/**
* Function GetMARKER
* returns the MARKER at a given index.
* @param index The array type index into a collection of MARKERS.
* @return MARKER
* - a pointer to the MARKER
or NULL if index out of range.
* @param index The array type index into a collection of MARKER
_PCB
S.
* @return MARKER
_PCB* - a pointer to the MARKER_PCB
or NULL if index out of range.
*/
MARKER
*
GetMARKER
(
int
index
)
const
MARKER
_PCB
*
GetMARKER
(
int
index
)
const
{
if
(
(
unsigned
)
index
<
m_markers
.
size
()
)
return
m_markers
[
index
];
...
...
@@ -175,7 +175,7 @@ public:
/**
* Function GetMARKERCount
* @return int - The number of MARKERS.
* @return int - The number of MARKER
_PCB
S.
*/
int
GetMARKERCount
()
const
{
...
...
pcbnew/class_board_item.cpp
View file @
41c80dd9
...
...
@@ -212,9 +212,9 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
}
break
;
case
TYPE_MARKER
:
text
<<
_
(
"Marker"
)
<<
wxT
(
" @("
)
<<
((
MARKER
*
)
item
)
->
GetPos
().
x
<<
wxT
(
","
)
<<
((
MARKER
*
)
item
)
->
GetPos
().
y
<<
wxT
(
")"
);
case
TYPE_MARKER
_PCB
:
text
<<
_
(
"Marker"
)
<<
wxT
(
" @("
)
<<
((
MARKER
_PCB
*
)
item
)
->
GetPos
().
x
<<
wxT
(
","
)
<<
((
MARKER
_PCB
*
)
item
)
->
GetPos
().
y
<<
wxT
(
")"
);
break
;
case
TYPE_COTATION
:
...
...
@@ -228,10 +228,6 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
;
break
;
case
TYPE_ZONE_UNUSED
:
text
<<
wxT
(
"Unused"
);
break
;
default
:
text
<<
item
->
GetClass
()
<<
wxT
(
" Unexpected item type: BUG!!"
);
break
;
...
...
@@ -291,7 +287,7 @@ const char** BOARD_ITEM::MenuIcon() const
xpm
=
pad_sketch_xpm
;
break
;
case
TYPE_MARKER
:
case
TYPE_MARKER
_PCB
:
xpm
=
pad_xpm
;
// @todo: create and use marker xpm
break
;
...
...
@@ -303,10 +299,6 @@ const char** BOARD_ITEM::MenuIcon() const
xpm
=
add_mires_xpm
;
break
;
case
TYPE_ZONE_UNUSED
:
xpm
=
0
;
// unused
break
;
default
:
xpm
=
0
;
break
;
...
...
pcbnew/class_cotation.cpp
View file @
41c80dd9
...
...
@@ -10,7 +10,7 @@
#include "wxstruct.h"
#include "class_drawpanel.h"
#include "kicad_string.h"
#include "protos.h"
COTATION
::
COTATION
(
BOARD_ITEM
*
aParent
)
:
BOARD_ITEM
(
aParent
,
TYPE_COTATION
)
...
...
@@ -235,36 +235,46 @@ void COTATION::Rotate(const wxPoint& centre, int angle)
/******************************************************/
/**
* Function Rotate
* @param
offset
: Rotation point
* @param
centre
: Rotation point
* @param angle : Rotation angle in 0.1 degrees
*/
{
RotatePoint
(
&
m_Pos
,
centre
,
900
);
RotatePoint
(
&
m_Pos
,
centre
,
angle
);
RotatePoint
(
&
m_Text
->
m_Pos
,
centre
,
900
);
m_Text
->
m_Orient
+=
900
;
RotatePoint
(
&
m_Text
->
m_Pos
,
centre
,
angle
);
m_Text
->
m_Orient
+=
angle
;
if
(
m_Text
->
m_Orient
>=
3600
)
m_Text
->
m_Orient
-=
3600
;
if
(
(
m_Text
->
m_Orient
>
900
)
&&
(
m_Text
->
m_Orient
<
2700
)
)
m_Text
->
m_Orient
-=
1800
;
RotatePoint
(
&
Barre_ox
,
&
Barre_oy
,
centre
.
x
,
centre
.
y
,
900
);
RotatePoint
(
&
Barre_fx
,
&
Barre_fy
,
centre
.
x
,
centre
.
y
,
900
);
RotatePoint
(
&
TraitG_ox
,
&
TraitG_oy
,
centre
.
x
,
centre
.
y
,
900
);
RotatePoint
(
&
TraitG_fx
,
&
TraitG_fy
,
centre
.
x
,
centre
.
y
,
900
);
RotatePoint
(
&
TraitD_ox
,
&
TraitD_oy
,
centre
.
x
,
centre
.
y
,
900
);
RotatePoint
(
&
TraitD_fx
,
&
TraitD_fy
,
centre
.
x
,
centre
.
y
,
900
);
RotatePoint
(
&
FlecheG1_ox
,
&
FlecheG1_oy
,
centre
.
x
,
centre
.
y
,
900
);
RotatePoint
(
&
FlecheG1_fx
,
&
FlecheG1_fy
,
centre
.
x
,
centre
.
y
,
900
);
RotatePoint
(
&
FlecheG2_ox
,
&
FlecheG2_oy
,
centre
.
x
,
centre
.
y
,
900
);
RotatePoint
(
&
FlecheG2_fx
,
&
FlecheG2_fy
,
centre
.
x
,
centre
.
y
,
900
);
RotatePoint
(
&
FlecheD1_ox
,
&
FlecheD1_oy
,
centre
.
x
,
centre
.
y
,
900
);
RotatePoint
(
&
FlecheD1_fx
,
&
FlecheD1_fy
,
centre
.
x
,
centre
.
y
,
900
);
RotatePoint
(
&
FlecheD2_ox
,
&
FlecheD2_oy
,
centre
.
x
,
centre
.
y
,
900
);
RotatePoint
(
&
FlecheD2_fx
,
&
FlecheD2_fy
,
centre
.
x
,
centre
.
y
,
900
);
RotatePoint
(
&
Barre_ox
,
&
Barre_oy
,
centre
.
x
,
centre
.
y
,
angle
);
RotatePoint
(
&
Barre_fx
,
&
Barre_fy
,
centre
.
x
,
centre
.
y
,
angle
);
RotatePoint
(
&
TraitG_ox
,
&
TraitG_oy
,
centre
.
x
,
centre
.
y
,
angle
);
RotatePoint
(
&
TraitG_fx
,
&
TraitG_fy
,
centre
.
x
,
centre
.
y
,
angle
);
RotatePoint
(
&
TraitD_ox
,
&
TraitD_oy
,
centre
.
x
,
centre
.
y
,
angle
);
RotatePoint
(
&
TraitD_fx
,
&
TraitD_fy
,
centre
.
x
,
centre
.
y
,
angle
);
RotatePoint
(
&
FlecheG1_ox
,
&
FlecheG1_oy
,
centre
.
x
,
centre
.
y
,
angle
);
RotatePoint
(
&
FlecheG1_fx
,
&
FlecheG1_fy
,
centre
.
x
,
centre
.
y
,
angle
);
RotatePoint
(
&
FlecheG2_ox
,
&
FlecheG2_oy
,
centre
.
x
,
centre
.
y
,
angle
);
RotatePoint
(
&
FlecheG2_fx
,
&
FlecheG2_fy
,
centre
.
x
,
centre
.
y
,
angle
);
RotatePoint
(
&
FlecheD1_ox
,
&
FlecheD1_oy
,
centre
.
x
,
centre
.
y
,
angle
);
RotatePoint
(
&
FlecheD1_fx
,
&
FlecheD1_fy
,
centre
.
x
,
centre
.
y
,
angle
);
RotatePoint
(
&
FlecheD2_ox
,
&
FlecheD2_oy
,
centre
.
x
,
centre
.
y
,
angle
);
RotatePoint
(
&
FlecheD2_fx
,
&
FlecheD2_fy
,
centre
.
x
,
centre
.
y
,
angle
);
}
/**
* Function Flip
* Flip this object, i.e. change the board side for this object
* @param const wxPoint& aCentre - the rotation point.
*/
void
COTATION
::
Flip
(
const
wxPoint
&
aCentre
)
{
Mirror
(
aCentre
);
SetLayer
(
ChangeSideNumLayer
(
GetLayer
()
)
);
}
/**********************************************/
void
COTATION
::
Mirror
(
const
wxPoint
&
axis_pos
)
...
...
pcbnew/class_cotation.h
View file @
41c80dd9
...
...
@@ -64,10 +64,18 @@ public:
/**
* Function Rotate
* @param offset : Rotation point
* @param angle : Rotation angle in 0.1 degrees
* Rotate this object.
* @param const wxPoint& aRotCentre - the rotation point.
* @param aAngle - the rotation angle in 0.1 degree.
*/
void
Rotate
(
const
wxPoint
&
centre
,
int
angle
);
virtual
void
Rotate
(
const
wxPoint
&
aRotCentre
,
int
aAngle
);
/**
* Function Flip
* Flip this object, i.e. change the board side for this object
* @param const wxPoint& aCentre - the rotation point.
*/
virtual
void
Flip
(
const
wxPoint
&
aCentre
);
/**
* Function Mirror
...
...
pcbnew/class_drawsegment.cpp
View file @
41c80dd9
...
...
@@ -13,6 +13,7 @@
#include "pcbnew.h"
#include "trigo.h"
#include "protos.h"
/* DRAWSEGMENT: constructor */
DRAWSEGMENT
::
DRAWSEGMENT
(
BOARD_ITEM
*
aParent
,
KICAD_T
idtype
)
:
...
...
@@ -44,6 +45,34 @@ void DRAWSEGMENT::Copy( DRAWSEGMENT* source )
m_BezierC2
=
source
->
m_BezierC1
;
}
/**
* Function Rotate
* Rotate this object.
* @param const wxPoint& aRotCentre - the rotation point.
* @param aAngle - the rotation angle in 0.1 degree.
*/
void
DRAWSEGMENT
::
Rotate
(
const
wxPoint
&
aRotCentre
,
int
aAngle
)
{
RotatePoint
(
&
m_Start
,
aRotCentre
,
aAngle
);
RotatePoint
(
&
m_End
,
aRotCentre
,
aAngle
);
}
/**
* Function Flip
* Flip this object, i.e. change the board side for this object
* @param const wxPoint& aCentre - the rotation point.
*/
void
DRAWSEGMENT
::
Flip
(
const
wxPoint
&
aCentre
)
{
m_Start
.
y
=
aCentre
.
y
-
(
m_Start
.
y
-
aCentre
.
y
);
m_End
.
y
=
aCentre
.
y
-
(
m_End
.
y
-
aCentre
.
y
);
if
(
m_Shape
==
S_ARC
)
{
NEGATE
(
m_Angle
);
}
SetLayer
(
ChangeSideNumLayer
(
GetLayer
()
)
);
}
bool
DRAWSEGMENT
::
Save
(
FILE
*
aFile
)
const
{
...
...
pcbnew/class_drawsegment.h
View file @
41c80dd9
...
...
@@ -116,6 +116,31 @@ public:
return
hypot
(
delta
.
x
,
delta
.
y
);
}
/**
* Function Move
* move this object.
* @param const wxPoint& aMoveVector - the move vector for this object.
*/
virtual
void
Move
(
const
wxPoint
&
aMoveVector
)
{
m_Start
+=
aMoveVector
;
m_End
+=
aMoveVector
;
}
/**
* Function Rotate
* Rotate this object.
* @param const wxPoint& aRotCentre - the rotation point.
* @param aAngle - the rotation angle in 0.1 degree.
*/
virtual
void
Rotate
(
const
wxPoint
&
aRotCentre
,
int
aAngle
);
/**
* Function Flip
* Flip this object, i.e. change the board side for this object
* @param const wxPoint& aCentre - the rotation point.
*/
virtual
void
Flip
(
const
wxPoint
&
aCentre
);
#if defined(DEBUG)
void
Show
(
int
nestLevel
,
std
::
ostream
&
os
);
...
...
pcbnew/class_marker.cpp
→
pcbnew/class_marker
_pcb
.cpp
View file @
41c80dd9
...
...
@@ -8,18 +8,19 @@
#include "gr_basic.h"
#include "common.h"
#include "class_drawpanel.h"
#include "trigo.h"
#include "pcbnew.h"
#include "class_marker.h"
#include "class_marker
_pcb
.h"
#define SCALING_FACTOR 30 // Adjust the actual size of markers, when using default shape
/*******************/
/* Classe MARKER */
/* Classe MARKER
_PCB
*/
/*******************/
MARKER
::
MARKER
(
BOARD_ITEM
*
aParent
)
:
BOARD_ITEM
(
aParent
,
TYPE_MARKER
),
MARKER
_PCB
::
MARKER_PCB
(
BOARD_ITEM
*
aParent
)
:
BOARD_ITEM
(
aParent
,
TYPE_MARKER
_PCB
),
MARKER_BASE
(
)
{
m_Color
=
WHITE
;
...
...
@@ -27,10 +28,10 @@ MARKER::MARKER( BOARD_ITEM* aParent ) :
}
MARKER
::
MARKER
(
int
aErrorCode
,
const
wxPoint
&
aMarkerPos
,
MARKER
_PCB
::
MARKER_PCB
(
int
aErrorCode
,
const
wxPoint
&
aMarkerPos
,
const
wxString
&
aText
,
const
wxPoint
&
aPos
,
const
wxString
&
bText
,
const
wxPoint
&
bPos
)
:
BOARD_ITEM
(
NULL
,
TYPE_MARKER
),
// parent set during BOARD::Add()
BOARD_ITEM
(
NULL
,
TYPE_MARKER
_PCB
),
// parent set during BOARD::Add()
MARKER_BASE
(
aErrorCode
,
aMarkerPos
,
aText
,
aPos
,
bText
,
bPos
)
{
...
...
@@ -38,9 +39,9 @@ MARKER::MARKER( int aErrorCode, const wxPoint& aMarkerPos,
m_ScalingFactor
=
SCALING_FACTOR
;
}
MARKER
::
MARKER
(
int
aErrorCode
,
const
wxPoint
&
aMarkerPos
,
MARKER
_PCB
::
MARKER_PCB
(
int
aErrorCode
,
const
wxPoint
&
aMarkerPos
,
const
wxString
&
aText
,
const
wxPoint
&
aPos
)
:
BOARD_ITEM
(
NULL
,
TYPE_MARKER
),
// parent set during BOARD::Add()
BOARD_ITEM
(
NULL
,
TYPE_MARKER
_PCB
),
// parent set during BOARD::Add()
MARKER_BASE
(
aErrorCode
,
aMarkerPos
,
aText
,
aPos
)
{
m_Color
=
WHITE
;
...
...
@@ -48,21 +49,13 @@ MARKER::MARKER( int aErrorCode, const wxPoint& aMarkerPos,
}
/*
Effacement memoire de la structure
*/
MARKER
::~
MARKER
()
/*
destructor
*/
MARKER
_PCB
::~
MARKER_PCB
()
{
}
/* supprime du chainage la structure Struct
* les structures arrieres et avant sont chainees directement
*/
void
MARKER
::
UnLink
()
{
wxFAIL_MSG
(
wxT
(
"MARKER::UnLink is deprecated"
)
);
}
void
MARKER
::
DisplayInfo
(
WinEDA_DrawFrame
*
frame
)
void
MARKER_PCB
::
DisplayInfo
(
WinEDA_DrawFrame
*
frame
)
{
int
text_pos
;
...
...
@@ -91,3 +84,26 @@ void MARKER::DisplayInfo( WinEDA_DrawFrame* frame )
Affiche_1_Parametre
(
frame
,
text_pos
,
txtA
,
txtB
,
DARKBROWN
);
}
/**
* Function Rotate
* Rotate this object.
* @param const wxPoint& aRotCentre - the rotation point.
* @param aAngle - the rotation angle in 0.1 degree.
*/
void
MARKER_PCB
::
Rotate
(
const
wxPoint
&
aRotCentre
,
int
aAngle
)
{
RotatePoint
(
&
m_Pos
,
aRotCentre
,
aAngle
);
}
/**
* Function Flip
* Flip this object, i.e. change the board side for this object
* this function has not reeally sense for a marker.
* It moves just the marker to keep its position on board, when the board is flipped
* @param const wxPoint& aCentre - the rotation point.
*/
void
MARKER_PCB
::
Flip
(
const
wxPoint
&
aCentre
)
{
m_Pos
.
y
=
aCentre
.
y
-
(
m_Pos
.
y
-
aCentre
.
y
);
}
pcbnew/class_marker.h
→
pcbnew/class_marker
_pcb
.h
View file @
41c80dd9
...
...
@@ -2,47 +2,69 @@
/* Markers: used to show a drc problem */
/***************************************/
#ifndef CLASS_MARKER_H
#define CLASS_MARKER_H
#ifndef CLASS_MARKER_
PCB_
H
#define CLASS_MARKER_
PCB_
H
#include "base_struct.h"
#include "drc_stuff.h"
class
MARKER
:
public
BOARD_ITEM
,
public
MARKER_BASE
class
MARKER
_PCB
:
public
BOARD_ITEM
,
public
MARKER_BASE
{
public
:
MARKER
(
BOARD_ITEM
*
aParent
);
MARKER
_PCB
(
BOARD_ITEM
*
aParent
);
/**
* Constructor
* @param aErrorCode The categorizing identifier for an error
* @param aMarkerPos The position of the MARKER on the BOARD
* @param aMarkerPos The position of the MARKER
_PCB
on the BOARD
* @param aText Text describing the first of two objects
* @param aPos The position of the first of two objects
* @param bText Text describing the second of the two conflicting objects
* @param bPos The position of the second of two objects
*/
MARKER
(
int
aErrorCode
,
const
wxPoint
&
aMarkerPos
,
MARKER
_PCB
(
int
aErrorCode
,
const
wxPoint
&
aMarkerPos
,
const
wxString
&
aText
,
const
wxPoint
&
aPos
,
const
wxString
&
bText
,
const
wxPoint
&
bPos
);
/**
* Constructor
* @param aErrorCode The categorizing identifier for an error
* @param aMarkerPos The position of the MARKER on the BOARD
* @param aMarkerPos The position of the MARKER
_PCB
on the BOARD
* @param aText Text describing the object
* @param aPos The position of the object
*/
MARKER
(
int
aErrorCode
,
const
wxPoint
&
aMarkerPos
,
MARKER
_PCB
(
int
aErrorCode
,
const
wxPoint
&
aMarkerPos
,
const
wxString
&
aText
,
const
wxPoint
&
aPos
);
~
MARKER
();
~
MARKER
_PCB
();
void
UnLink
();
// Deprecated
/**
* Function Move
* move this object.
* @param const wxPoint& aMoveVector - the move vector for this object.
*/
virtual
void
Move
(
const
wxPoint
&
aMoveVector
)
{
m_Pos
+=
aMoveVector
;
}
/**
* Function Rotate
* Rotate this object.
* @param const wxPoint& aRotCentre - the rotation point.
* @param aAngle - the rotation angle in 0.1 degree.
*/
virtual
void
Rotate
(
const
wxPoint
&
aRotCentre
,
int
aAngle
);
/**
* Function Flip
* Flip this object, i.e. change the board side for this object
* @param const wxPoint& aCentre - the rotation point.
*/
virtual
void
Flip
(
const
wxPoint
&
aCentre
);
/** Function Draw
*/
...
...
@@ -53,7 +75,7 @@ public:
/**
* Function GetPosition
* returns the position of this MARKER.
* returns the position of this MARKER
_PCB
.
*/
wxPoint
&
GetPosition
()
{
...
...
@@ -93,4 +115,4 @@ public:
};
#endif // CLASS_MARKER_H
#endif // CLASS_MARKER_
PCB_
H
pcbnew/class_mire.cpp
View file @
41c80dd9
...
...
@@ -9,6 +9,8 @@
#include "kicad_string.h"
#include "pcbnew.h"
#include "trigo.h"
#include "protos.h"
MIREPCB
::
MIREPCB
(
BOARD_ITEM
*
aParent
)
:
...
...
@@ -201,3 +203,25 @@ bool MIREPCB::HitTest( EDA_Rect& refArea )
return
false
;
}
/**
* Function Rotate
* Rotate this object.
* @param const wxPoint& aRotCentre - the rotation point.
* @param aAngle - the rotation angle in 0.1 degree.
*/
void
MIREPCB
::
Rotate
(
const
wxPoint
&
aRotCentre
,
int
aAngle
)
{
RotatePoint
(
&
m_Pos
,
aRotCentre
,
aAngle
);
}
/**
* Function Flip
* Flip this object, i.e. change the board side for this object
* @param const wxPoint& aCentre - the rotation point.
*/
void
MIREPCB
::
Flip
(
const
wxPoint
&
aCentre
)
{
m_Pos
.
y
=
aCentre
.
y
-
(
m_Pos
.
y
-
aCentre
.
y
);
SetLayer
(
ChangeSideNumLayer
(
GetLayer
()
)
);
}
pcbnew/class_mire.h
View file @
41c80dd9
...
...
@@ -28,6 +28,31 @@ public:
}
/**
* Function Move
* move this object.
* @param const wxPoint& aMoveVector - the move vector for this object.
*/
virtual
void
Move
(
const
wxPoint
&
aMoveVector
)
{
m_Pos
+=
aMoveVector
;
}
/**
* Function Rotate
* Rotate this object.
* @param const wxPoint& aRotCentre - the rotation point.
* @param aAngle - the rotation angle in 0.1 degree.
*/
virtual
void
Rotate
(
const
wxPoint
&
aRotCentre
,
int
aAngle
);
/**
* Function Flip
* Flip this object, i.e. change the board side for this object
* @param const wxPoint& aCentre - the rotation point.
*/
virtual
void
Flip
(
const
wxPoint
&
aCentre
);
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
...
...
pcbnew/class_module.cpp
View file @
41c80dd9
...
...
@@ -21,32 +21,6 @@
#include "3d_struct.h"
#include "protos.h"
/*********************************************************************************/
void
MODULE
::
DrawAncre
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
int
dim_ancre
,
int
draw_mode
)
/*********************************************************************************/
/* trace de l'ancre (croix verticale)
* (doit etre fait apres les pads,
* car le trace du trou efface tout donc peut etre l'ancre */
{
int
anchor_size
=
panel
->
GetScreen
()
->
Unscale
(
dim_ancre
);
GRSetDrawMode
(
DC
,
draw_mode
);
if
(
(
g_AnchorColor
&
ITEM_NOT_SHOW
)
==
0
)
{
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
m_Pos
.
x
-
offset
.
x
-
anchor_size
,
m_Pos
.
y
-
offset
.
y
,
m_Pos
.
x
-
offset
.
x
+
anchor_size
,
m_Pos
.
y
-
offset
.
y
,
0
,
g_AnchorColor
);
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
m_Pos
.
x
-
offset
.
x
,
m_Pos
.
y
-
offset
.
y
-
anchor_size
,
m_Pos
.
x
-
offset
.
x
,
m_Pos
.
y
-
offset
.
y
+
anchor_size
,
0
,
g_AnchorColor
);
}
}
/*************************************************/
/* Class MODULE : description d'un composant pcb */
...
...
@@ -81,6 +55,32 @@ MODULE::~MODULE()
}
/*********************************************************************************/
void
MODULE
::
DrawAncre
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
int
dim_ancre
,
int
draw_mode
)
/*********************************************************************************/
/* trace de l'ancre (croix verticale)
* (doit etre fait apres les pads,
* car le trace du trou efface tout donc peut etre l'ancre */
{
int
anchor_size
=
panel
->
GetScreen
()
->
Unscale
(
dim_ancre
);
GRSetDrawMode
(
DC
,
draw_mode
);
if
(
(
g_AnchorColor
&
ITEM_NOT_SHOW
)
==
0
)
{
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
m_Pos
.
x
-
offset
.
x
-
anchor_size
,
m_Pos
.
y
-
offset
.
y
,
m_Pos
.
x
-
offset
.
x
+
anchor_size
,
m_Pos
.
y
-
offset
.
y
,
0
,
g_AnchorColor
);
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
m_Pos
.
x
-
offset
.
x
,
m_Pos
.
y
-
offset
.
y
-
anchor_size
,
m_Pos
.
x
-
offset
.
x
,
m_Pos
.
y
-
offset
.
y
+
anchor_size
,
0
,
g_AnchorColor
);
}
}
/*********************************/
void
MODULE
::
Copy
(
MODULE
*
aModule
)
/*********************************/
...
...
@@ -131,7 +131,7 @@ void MODULE::Copy( MODULE* aModule )
break
;
default
:
DisplayError
(
NULL
,
wxT
(
"Internal Err: CopyModule: type indefini"
)
);
wxMessageBox
(
wxT
(
"Internal Err: CopyModule: type indefini"
)
);
break
;
}
}
...
...
@@ -594,118 +594,6 @@ int MODULE::ReadDescr( FILE* File, int* LineNum )
}
/*************************************************/
void
MODULE
::
SetPosition
(
const
wxPoint
&
newpos
)
/*************************************************/
// replace le module en position newpos
{
int
deltaX
=
newpos
.
x
-
m_Pos
.
x
;
int
deltaY
=
newpos
.
y
-
m_Pos
.
y
;
/* deplacement de l'ancre */
m_Pos
.
x
+=
deltaX
;
m_Pos
.
y
+=
deltaY
;
/* deplacement de la reference */
m_Reference
->
m_Pos
.
x
+=
deltaX
;
m_Reference
->
m_Pos
.
y
+=
deltaY
;
/* deplacement de la Valeur */
m_Value
->
m_Pos
.
x
+=
deltaX
;
m_Value
->
m_Pos
.
y
+=
deltaY
;
/* deplacement des pastilles */
for
(
D_PAD
*
pad
=
m_Pads
;
pad
;
pad
=
pad
->
Next
()
)
{
pad
->
m_Pos
.
x
+=
deltaX
;
pad
->
m_Pos
.
y
+=
deltaY
;
}
/* deplacement des dessins de l'empreinte : */
EDA_BaseStruct
*
PtStruct
=
m_Drawings
;
for
(
;
PtStruct
!=
NULL
;
PtStruct
=
PtStruct
->
Next
()
)
{
switch
(
PtStruct
->
Type
()
)
{
case
TYPE_EDGE_MODULE
:
{
EDGE_MODULE
*
pt_edgmod
=
(
EDGE_MODULE
*
)
PtStruct
;
pt_edgmod
->
SetDrawCoord
();
break
;
}
case
TYPE_TEXTE_MODULE
:
{
TEXTE_MODULE
*
pt_texte
=
(
TEXTE_MODULE
*
)
PtStruct
;
pt_texte
->
m_Pos
.
x
+=
deltaX
;
pt_texte
->
m_Pos
.
y
+=
deltaY
;
break
;
}
default
:
DisplayError
(
NULL
,
wxT
(
"Type Draw Indefini"
)
);
break
;
}
}
Set_Rectangle_Encadrement
();
}
/*********************************************/
void
MODULE
::
SetOrientation
(
int
newangle
)
/*********************************************/
/* Tourne de newangle (en 0.1 degres) le module
*/
{
int
px
,
py
;
newangle
-=
m_Orient
;
// = delta de rotation
m_Orient
+=
newangle
;
NORMALIZE_ANGLE_POS
(
m_Orient
);
/* deplacement et rotation des pastilles */
for
(
D_PAD
*
pad
=
m_Pads
;
pad
;
pad
=
pad
->
Next
()
)
{
px
=
pad
->
m_Pos0
.
x
;
py
=
pad
->
m_Pos0
.
y
;
pad
->
m_Orient
+=
newangle
;
/* change m_Orientation */
NORMALIZE_ANGLE_POS
(
pad
->
m_Orient
);
RotatePoint
(
&
px
,
&
py
,
(
int
)
m_Orient
);
pad
->
m_Pos
.
x
=
m_Pos
.
x
+
px
;
pad
->
m_Pos
.
y
=
m_Pos
.
y
+
py
;
}
/* mise a jour de la reference et de la valeur*/
m_Reference
->
SetDrawCoord
();
m_Value
->
SetDrawCoord
();
/* deplacement des contours et textes de l'empreinte : */
for
(
BOARD_ITEM
*
item
=
m_Drawings
;
item
;
item
=
item
->
Next
()
)
{
if
(
item
->
Type
()
==
TYPE_EDGE_MODULE
)
{
EDGE_MODULE
*
pt_edgmod
=
(
EDGE_MODULE
*
)
item
;
pt_edgmod
->
SetDrawCoord
();
}
if
(
item
->
Type
()
==
TYPE_TEXTE_MODULE
)
{
/* deplacement des inscriptions : */
TEXTE_MODULE
*
pt_texte
=
(
TEXTE_MODULE
*
)
item
;
pt_texte
->
SetDrawCoord
();
}
}
/* Recalcul du rectangle d'encadrement */
Set_Rectangle_Encadrement
();
}
/************************************************/
void
MODULE
::
Set_Rectangle_Encadrement
()
/************************************************/
...
...
pcbnew/class_module.h
View file @
41c80dd9
...
...
@@ -123,7 +123,27 @@ public:
// Moves
void
SetPosition
(
const
wxPoint
&
newpos
);
void
SetOrientation
(
int
newangle
);
/**
* Function Move
* move this object.
* @param const wxPoint& aMoveVector - the move vector for this object.
*/
virtual
void
Move
(
const
wxPoint
&
aMoveVector
);
/**
* Function Rotate
* Rotate this object.
* @param const wxPoint& aRotCentre - the rotation point.
* @param aAngle - the rotation angle in 0.1 degree.
*/
virtual
void
Rotate
(
const
wxPoint
&
aRotCentre
,
int
aAngle
);
/**
* Function Flip
* Flip this object, i.e. change the board side for this object
* @param const wxPoint& aCentre - the rotation point.
*/
virtual
void
Flip
(
const
wxPoint
&
aCentre
);
/**
* Function IsLocked
...
...
pcbnew/class_module_transform_functions.cpp
0 → 100644
View file @
41c80dd9
This diff is collapsed.
Click to expand it.
pcbnew/class_pad.h
View file @
41c80dd9
...
...
@@ -203,6 +203,15 @@ public:
*/
static
int
Compare
(
const
D_PAD
*
padref
,
const
D_PAD
*
padcmp
);
/**
* Function Move
* move this object.
* @param const wxPoint& aMoveVector - the move vector for this object.
*/
virtual
void
Move
(
const
wxPoint
&
aMoveVector
)
{
m_Pos
+=
aMoveVector
;
}
#if defined(DEBUG)
...
...
pcbnew/class_pcb_text.cpp
View file @
41c80dd9
...
...
@@ -11,6 +11,8 @@
#include "kicad_string.h"
#include "pcbnew.h"
#include "trigo.h"
#include "protos.h"
/*******************/
...
...
@@ -258,6 +260,39 @@ void TEXTE_PCB::DisplayInfo( WinEDA_DrawFrame* frame )
Affiche_1_Parametre
(
frame
,
70
,
_
(
"V Size"
),
msg
,
RED
);
}
/**
* Function Rotate
* Rotate this object.
* @param const wxPoint& aRotCentre - the rotation point.
* @param aAngle - the rotation angle in 0.1 degree.
*/
void
TEXTE_PCB
::
Rotate
(
const
wxPoint
&
aRotCentre
,
int
aAngle
)
{
RotatePoint
(
&
m_Pos
,
aRotCentre
,
aAngle
);
m_Orient
+=
aAngle
;
while
(
m_Orient
>=
3600
)
m_Orient
-=
3600
;
while
(
m_Orient
<
-
3600
)
m_Orient
+=
3600
;
}
/**
* Function Flip
* Flip this object, i.e. change the board side for this object
* @param const wxPoint& aCentre - the rotation point.
*/
void
TEXTE_PCB
::
Flip
(
const
wxPoint
&
aCentre
)
{
m_Pos
.
y
=
aCentre
.
y
-
(
m_Pos
.
y
-
aCentre
.
y
);
NEGATE
(
m_Orient
);
if
(
(
GetLayer
()
==
COPPER_LAYER_N
)
||
(
GetLayer
()
==
CMP_N
)
)
{
m_Mirror
=
not
m_Mirror
;
/* inverse miroir */
}
SetLayer
(
ChangeSideNumLayer
(
GetLayer
()
)
);
}
#if defined(DEBUG)
...
...
pcbnew/class_pcb_text.h
View file @
41c80dd9
...
...
@@ -24,6 +24,31 @@ public:
return
m_Pos
;
// within EDA_TextStruct
}
/**
* Function Move
* move this object.
* @param const wxPoint& aMoveVector - the move vector for this object.
*/
virtual
void
Move
(
const
wxPoint
&
aMoveVector
)
{
m_Pos
+=
aMoveVector
;
}
/**
* Function Rotate
* Rotate this object.
* @param const wxPoint& aRotCentre - the rotation point.
* @param aAngle - the rotation angle in 0.1 degree.
*/
virtual
void
Rotate
(
const
wxPoint
&
aRotCentre
,
int
aAngle
);
/**
* Function Flip
* Flip this object, i.e. change the board side for this object
* @param const wxPoint& aCentre - the rotation point.
*/
virtual
void
Flip
(
const
wxPoint
&
aCentre
);
/* duplicate structure */
void
Copy
(
TEXTE_PCB
*
source
);
...
...
pcbnew/class_track.cpp
View file @
41c80dd9
...
...
@@ -272,6 +272,34 @@ EDA_Rect TRACK::GetBoundingBox()
return
ret
;
}
/**
* Function Rotate
* Rotate this object.
* @param const wxPoint& aRotCentre - the rotation point.
* @param aAngle - the rotation angle in 0.1 degree.
*/
void
TRACK
::
Rotate
(
const
wxPoint
&
aRotCentre
,
int
aAngle
)
{
RotatePoint
(
&
m_Start
,
aRotCentre
,
aAngle
);
RotatePoint
(
&
m_End
,
aRotCentre
,
aAngle
);
}
/**
* Function Flip
* Flip this object, i.e. change the board side for this object
* @param const wxPoint& aCentre - the rotation point.
*/
void
TRACK
::
Flip
(
const
wxPoint
&
aCentre
)
{
m_Start
.
y
=
aCentre
.
y
-
(
m_Start
.
y
-
aCentre
.
y
);
m_End
.
y
=
aCentre
.
y
-
(
m_End
.
y
-
aCentre
.
y
);
if
(
Type
()
==
TYPE_VIA
)
{
}
else
SetLayer
(
ChangeSideNumLayer
(
GetLayer
()
)
);
}
// see class_track.h
// SEGVIA and SEGZONE inherit this version
...
...
pcbnew/class_track.h
View file @
41c80dd9
...
...
@@ -60,6 +60,32 @@ public:
TRACK
*
Back
()
const
{
return
(
TRACK
*
)
Pback
;
}
/**
* Function Move
* move this object.
* @param const wxPoint& aMoveVector - the move vector for this object.
*/
virtual
void
Move
(
const
wxPoint
&
aMoveVector
)
{
m_Start
+=
aMoveVector
;
m_End
+=
aMoveVector
;
}
/**
* Function Rotate
* Rotate this object.
* @param const wxPoint& aRotCentre - the rotation point.
* @param aAngle - the rotation angle in 0.1 degree.
*/
virtual
void
Rotate
(
const
wxPoint
&
aRotCentre
,
int
aAngle
);
/**
* Function Flip
* Flip this object, i.e. change the board side for this object
* @param const wxPoint& aCentre - the rotation point.
*/
virtual
void
Flip
(
const
wxPoint
&
aCentre
);
/**
* Function GetPosition
* returns the position of this object.
...
...
pcbnew/class_zone.cpp
View file @
41c80dd9
...
...
@@ -14,6 +14,8 @@
#include "pcbnew.h"
#include "zones.h"
#include "protos.h"
/************************/
/* class ZONE_CONTAINER */
...
...
@@ -1010,6 +1012,17 @@ void ZONE_CONTAINER::Rotate( const wxPoint& centre, int angle )
m_Poly
->
Hatch
();
}
/**
* Function Flip
* Flip this object, i.e. change the board side for this object
* (like Mirror() but changes layer)
* @param const wxPoint& aCentre - the rotation point.
*/
void
ZONE_CONTAINER
::
Flip
(
const
wxPoint
&
aCentre
)
{
Mirror
(
aCentre
);
SetLayer
(
ChangeSideNumLayer
(
GetLayer
()
)
);
}
/**
* Function Mirror
...
...
pcbnew/class_zone.h
View file @
41c80dd9
...
...
@@ -285,6 +285,14 @@ public:
*/
void
Rotate
(
const
wxPoint
&
centre
,
int
angle
);
/**
* Function Flip
* Flip this object, i.e. change the board side for this object
* (like Mirror() but changes layer)
* @param const wxPoint& aCentre - the rotation point.
*/
virtual
void
Flip
(
const
wxPoint
&
aCentre
);
/**
* Function Mirror
* Mirror the outlines , relative to a given horizontal axis
...
...
pcbnew/collectors.cpp
View file @
41c80dd9
...
...
@@ -36,7 +36,7 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
// there are some restrictions on the order of items in the general case.
// all items in m_Drawings for instance should be contiguous.
// *** all items in a same list (shown here) must be contiguous ****
TYPE_MARKER
,
// in m_markers
TYPE_MARKER
_PCB
,
// in m_markers
TYPE_TEXTE
,
// in m_Drawings
TYPE_DRAWSEGMENT
,
// in m_Drawings
TYPE_COTATION
,
// in m_Drawings
...
...
@@ -66,7 +66,7 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
const
KICAD_T
GENERAL_COLLECTOR
::
AllButZones
[]
=
{
TYPE_MARKER
,
TYPE_MARKER
_PCB
,
TYPE_TEXTE
,
TYPE_DRAWSEGMENT
,
TYPE_COTATION
,
...
...
pcbnew/dialog_drc.h
View file @
41c80dd9
...
...
@@ -136,7 +136,7 @@ public:
const
DRC_ITEM
*
GetItem
(
int
aIndex
)
{
const
MARKER
*
marker
=
m_board
->
GetMARKER
(
aIndex
);
const
MARKER
_PCB
*
marker
=
m_board
->
GetMARKER
(
aIndex
);
if
(
marker
)
return
&
marker
->
GetReporter
();
return
NULL
;
...
...
@@ -144,7 +144,7 @@ public:
void
DeleteItem
(
int
aIndex
)
{
MARKER
*
marker
=
m_board
->
GetMARKER
(
aIndex
);
MARKER
_PCB
*
marker
=
m_board
->
GetMARKER
(
aIndex
);
if
(
marker
)
m_board
->
Delete
(
marker
);
}
...
...
pcbnew/dialog_track_options.cpp
View file @
41c80dd9
...
...
@@ -119,7 +119,7 @@ void DIALOG_TRACKS_OPTIONS::OnButtonOkClick( wxCommandEvent& event )
m_Parent
->
AddHistory
(
g_DesignSettings
.
m_CurrentViaSize
,
TYPE_VIA
);
m_Parent
->
AddHistory
(
g_DesignSettings
.
m_CurrentTrackWidth
,
TYPE_TRACK
);
m_Parent
->
AddHistory
(
g_DesignSettings
.
m_TrackClearence
,
TYPE_CL
R
);
m_Parent
->
AddHistory
(
g_DesignSettings
.
m_TrackClearence
,
TYPE_CL
EARANCE
);
EndModal
(
1
);
}
...
...
@@ -171,7 +171,7 @@ void WinEDA_BasePcbFrame::AddHistory( int value, KICAD_T type )
}
break
;
case
TYPE_CL
R
:
case
TYPE_CL
EARANCE
:
for
(
ii
=
0
;
ii
<
HISTORY_NUMBER
;
ii
++
)
{
if
(
g_DesignSettings
.
m_TrackClearenceHistory
[
ii
]
==
value
)
...
...
pcbnew/drc.cpp
View file @
41c80dd9
...
...
@@ -409,7 +409,7 @@ void DRC::testZones( bool adoTestFillSegments )
}
MARKER
*
DRC
::
fillMarker
(
TRACK
*
aTrack
,
BOARD_ITEM
*
aItem
,
int
aErrorCode
,
MARKER
*
fillMe
)
MARKER
_PCB
*
DRC
::
fillMarker
(
TRACK
*
aTrack
,
BOARD_ITEM
*
aItem
,
int
aErrorCode
,
MARKER_PCB
*
fillMe
)
{
wxString
textA
=
aTrack
->
MenuText
(
m_pcb
);
wxString
textB
;
...
...
@@ -464,11 +464,11 @@ MARKER* DRC::fillMarker( TRACK* aTrack, BOARD_ITEM* aItem, int aErrorCode, MARKE
else
{
if
(
aItem
)
fillMe
=
new
MARKER
(
aErrorCode
,
position
,
fillMe
=
new
MARKER
_PCB
(
aErrorCode
,
position
,
textA
,
aTrack
->
GetPosition
(),
textB
,
posB
);
else
fillMe
=
new
MARKER
(
aErrorCode
,
position
,
fillMe
=
new
MARKER
_PCB
(
aErrorCode
,
position
,
textA
,
aTrack
->
GetPosition
()
);
}
...
...
@@ -476,7 +476,7 @@ MARKER* DRC::fillMarker( TRACK* aTrack, BOARD_ITEM* aItem, int aErrorCode, MARKE
}
MARKER
*
DRC
::
fillMarker
(
D_PAD
*
aPad
,
D_PAD
*
bPad
,
int
aErrorCode
,
MARKER
*
fillMe
)
MARKER
_PCB
*
DRC
::
fillMarker
(
D_PAD
*
aPad
,
D_PAD
*
bPad
,
int
aErrorCode
,
MARKER_PCB
*
fillMe
)
{
wxString
textA
=
aPad
->
MenuText
(
m_pcb
);
wxString
textB
=
bPad
->
MenuText
(
m_pcb
);
...
...
@@ -487,13 +487,13 @@ MARKER* DRC::fillMarker( D_PAD* aPad, D_PAD* bPad, int aErrorCode, MARKER* fillM
if
(
fillMe
)
fillMe
->
SetData
(
aErrorCode
,
posA
,
textA
,
posA
,
textB
,
posB
);
else
fillMe
=
new
MARKER
(
aErrorCode
,
posA
,
textA
,
posA
,
textB
,
posB
);
fillMe
=
new
MARKER
_PCB
(
aErrorCode
,
posA
,
textA
,
posA
,
textB
,
posB
);
return
fillMe
;
}
MARKER
*
DRC
::
fillMarker
(
ZONE_CONTAINER
*
aArea
,
int
aErrorCode
,
MARKER
*
fillMe
)
MARKER
_PCB
*
DRC
::
fillMarker
(
ZONE_CONTAINER
*
aArea
,
int
aErrorCode
,
MARKER_PCB
*
fillMe
)
{
wxString
textA
=
aArea
->
MenuText
(
m_pcb
);
...
...
@@ -502,16 +502,16 @@ MARKER* DRC::fillMarker( ZONE_CONTAINER* aArea, int aErrorCode, MARKER* fillMe )
if
(
fillMe
)
fillMe
->
SetData
(
aErrorCode
,
posA
,
textA
,
posA
);
else
fillMe
=
new
MARKER
(
aErrorCode
,
posA
,
textA
,
posA
);
fillMe
=
new
MARKER
_PCB
(
aErrorCode
,
posA
,
textA
,
posA
);
return
fillMe
;
}
MARKER
*
DRC
::
fillMarker
(
const
ZONE_CONTAINER
*
aArea
,
MARKER
_PCB
*
DRC
::
fillMarker
(
const
ZONE_CONTAINER
*
aArea
,
const
wxPoint
&
aPos
,
int
aErrorCode
,
MARKER
*
fillMe
)
MARKER
_PCB
*
fillMe
)
{
wxString
textA
=
aArea
->
MenuText
(
m_pcb
);
...
...
@@ -520,7 +520,7 @@ MARKER* DRC::fillMarker( const ZONE_CONTAINER* aArea,
if
(
fillMe
)
fillMe
->
SetData
(
aErrorCode
,
posA
,
textA
,
posA
);
else
fillMe
=
new
MARKER
(
aErrorCode
,
posA
,
textA
,
posA
);
fillMe
=
new
MARKER
_PCB
(
aErrorCode
,
posA
,
textA
,
posA
);
return
fillMe
;
}
...
...
pcbnew/drc_stuff.h
View file @
41c80dd9
...
...
@@ -67,7 +67,7 @@
class
WinEDA_DrawPanel
;
class
MARKER
;
class
MARKER
_PCB
;
class
DIALOG_DRC_CONTROL
;
...
...
@@ -144,7 +144,7 @@ private:
// int m_errorCount;
MARKER
*
m_currentMarker
;
MARKER
_PCB
*
m_currentMarker
;
bool
m_aboartDRC
;
bool
m_drcInProgress
;
...
...
@@ -188,14 +188,14 @@ private:
* or TRACK.
* @param aErrorCode A categorizing identifier for the particular type
* of error that is being reported.
* @param fillMe A MARKER* which is to be filled in, or NULL if one is to
* @param fillMe A MARKER
_PCB
* which is to be filled in, or NULL if one is to
* first be allocated, then filled.
*/
MARKER
*
fillMarker
(
TRACK
*
aTrack
,
BOARD_ITEM
*
aItem
,
int
aErrorCode
,
MARKER
*
fillMe
);
MARKER
_PCB
*
fillMarker
(
TRACK
*
aTrack
,
BOARD_ITEM
*
aItem
,
int
aErrorCode
,
MARKER_PCB
*
fillMe
);
MARKER
*
fillMarker
(
D_PAD
*
aPad
,
D_PAD
*
bPad
,
int
aErrorCode
,
MARKER
*
fillMe
);
MARKER
_PCB
*
fillMarker
(
D_PAD
*
aPad
,
D_PAD
*
bPad
,
int
aErrorCode
,
MARKER_PCB
*
fillMe
);
MARKER
*
fillMarker
(
ZONE_CONTAINER
*
aArea
,
int
aErrorCode
,
MARKER
*
fillMe
);
MARKER
_PCB
*
fillMarker
(
ZONE_CONTAINER
*
aArea
,
int
aErrorCode
,
MARKER_PCB
*
fillMe
);
/**
* Function fillMarker
...
...
@@ -206,10 +206,10 @@ private:
* @param aEdge edge zone to test
* @param aPos position of error
* @param aErrorCode Type of error
* @param fillMe A MARKER* which is to be filled in, or NULL if one is to
* @param fillMe A MARKER
_PCB
* which is to be filled in, or NULL if one is to
* first be allocated, then filled.
*/
MARKER
*
fillMarker
(
const
ZONE_CONTAINER
*
aArea
,
const
wxPoint
&
aPos
,
int
aErrorCode
,
MARKER
*
fillMe
);
MARKER
_PCB
*
fillMarker
(
const
ZONE_CONTAINER
*
aArea
,
const
wxPoint
&
aPos
,
int
aErrorCode
,
MARKER_PCB
*
fillMe
);
//-----<categorical group tests>-----------------------------------------
...
...
pcbnew/edit.cpp
View file @
41c80dd9
...
...
@@ -958,8 +958,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break
;
case
ID_POPUP_PCB_GETINFO_MARKER
:
if
(
GetCurItem
()
&&
GetCurItem
()
->
Type
()
==
TYPE_MARKER
)
(
(
MARKER
*
)
GetCurItem
()
)
->
DisplayMarkerInfo
(
this
);
if
(
GetCurItem
()
&&
GetCurItem
()
->
Type
()
==
TYPE_MARKER
_PCB
)
(
(
MARKER
_PCB
*
)
GetCurItem
()
)
->
DisplayMarkerInfo
(
this
);
DrawPanel
->
MouseToCursorSchema
();
break
;
...
...
@@ -1261,10 +1261,10 @@ void WinEDA_PcbFrame::RemoveStruct( BOARD_ITEM* Item, wxDC* DC )
}
break
;
case
TYPE_MARKER
:
case
TYPE_MARKER
_PCB
:
if
(
Item
==
GetCurItem
()
)
SetCurItem
(
NULL
);
(
(
MARKER
*
)
Item
)
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
(
(
MARKER
_PCB
*
)
Item
)
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
// delete the marker, and free memory. Don't use undo stack.
GetBoard
()
->
Delete
(
Item
);
...
...
pcbnew/find.cpp
View file @
41c80dd9
...
...
@@ -72,7 +72,7 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event )
if
(
FindMarker
)
{
MARKER
*
marker
=
m_Parent
->
GetBoard
()
->
GetMARKER
(
s_MarkerCount
++
);
MARKER
_PCB
*
marker
=
m_Parent
->
GetBoard
()
->
GetMARKER
(
s_MarkerCount
++
);
if
(
marker
)
{
foundItem
=
marker
;
...
...
pcbnew/gen_drill_report_files.cpp
View file @
41c80dd9
...
...
@@ -145,7 +145,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
PlotMirePcb
(
plotter
,
(
MIREPCB
*
)
PtStruct
,
EDGE_LAYER
,
FILLED
);
break
;
case
TYPE_MARKER
:
// do not draw
case
TYPE_MARKER
_PCB
:
// do not draw
break
;
default
:
...
...
pcbnew/ioascii.cpp
View file @
41c80dd9
...
...
@@ -370,7 +370,7 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum )
if
(
stricmp
(
Line
,
"TrackClearenceHistory"
)
==
0
)
{
int
tmp
=
atoi
(
data
);
AddHistory
(
tmp
,
TYPE_CL
R
);
AddHistory
(
tmp
,
TYPE_CL
EARANCE
);
continue
;
}
...
...
pcbnew/modedit_onclick.cpp
View file @
41c80dd9
...
...
@@ -322,7 +322,7 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
case
TYPE_VIA
:
case
TYPE_TRACK
:
case
TYPE_ZONE
:
case
TYPE_MARKER
:
case
TYPE_MARKER
_PCB
:
case
TYPE_COTATION
:
case
TYPE_MIRE
:
break
;
...
...
pcbnew/modules.cpp
View file @
41c80dd9
...
...
@@ -21,7 +21,6 @@
/* fonctions externes */
/* Fonctions locales */
static
int
ChangeSideMaskLayer
(
int
masque
);
static
void
Abort_MoveOrCopyModule
(
WinEDA_DrawPanel
*
Panel
,
wxDC
*
DC
);
/* Variables locales : */
...
...
@@ -349,10 +348,6 @@ void BOARD::Change_Side_Module( MODULE* Module, wxDC* DC )
* @param DC Current Device Context. if NULL, no redraw
*/
{
D_PAD
*
pt_pad
;
TEXTE_MODULE
*
pt_texte
;
EDGE_MODULE
*
pt_edgmod
;
EDA_BaseStruct
*
PtStruct
;
if
(
Module
==
NULL
)
return
;
...
...
@@ -390,131 +385,8 @@ void BOARD::Change_Side_Module( MODULE* Module, wxDC* DC )
}
}
/* mise a jour du Flag de l'empreinte et des couches des contours et textes */
Module
->
SetLayer
(
ChangeSideNumLayer
(
Module
->
GetLayer
()
)
);
/* Inversion miroir de l'orientation */
Module
->
m_Orient
=
-
Module
->
m_Orient
;
NORMALIZE_ANGLE_POS
(
Module
->
m_Orient
);
/* Inversion miroir + layers des pastilles */
pt_pad
=
Module
->
m_Pads
;
for
(
;
pt_pad
!=
NULL
;
pt_pad
=
pt_pad
->
Next
()
)
{
pt_pad
->
m_Pos
.
y
-=
Module
->
m_Pos
.
y
;
pt_pad
->
m_Pos
.
y
=
-
pt_pad
->
m_Pos
.
y
;
pt_pad
->
m_Pos
.
y
+=
Module
->
m_Pos
.
y
;
pt_pad
->
m_Pos0
.
y
=
-
pt_pad
->
m_Pos0
.
y
;
pt_pad
->
m_Offset
.
y
=
-
pt_pad
->
m_Offset
.
y
;
pt_pad
->
m_DeltaSize
.
y
=
-
pt_pad
->
m_DeltaSize
.
y
;
NEGATE_AND_NORMALIZE_ANGLE_POS
(
pt_pad
->
m_Orient
);
/* change cote pour pastilles surfaciques */
pt_pad
->
m_Masque_Layer
=
ChangeSideMaskLayer
(
pt_pad
->
m_Masque_Layer
);
}
/* Inversion miroir de la Reference et mise en miroir : */
pt_texte
=
Module
->
m_Reference
;
pt_texte
->
m_Pos
.
y
-=
Module
->
m_Pos
.
y
;
pt_texte
->
m_Pos
.
y
=
-
pt_texte
->
m_Pos
.
y
;
pt_texte
->
m_Pos
.
y
+=
Module
->
m_Pos
.
y
;
pt_texte
->
m_Pos0
.
y
=
-
pt_texte
->
m_Pos0
.
y
;
pt_texte
->
m_Mirror
=
false
;
NEGATE_AND_NORMALIZE_ANGLE_POS
(
pt_texte
->
m_Orient
);
pt_texte
->
SetLayer
(
Module
->
GetLayer
()
);
pt_texte
->
SetLayer
(
ChangeSideNumLayer
(
pt_texte
->
GetLayer
()
)
);
if
(
Module
->
GetLayer
()
==
COPPER_LAYER_N
)
pt_texte
->
SetLayer
(
SILKSCREEN_N_CU
);
if
(
Module
->
GetLayer
()
==
CMP_N
)
pt_texte
->
SetLayer
(
SILKSCREEN_N_CMP
);
if
(
(
Module
->
GetLayer
()
==
SILKSCREEN_N_CU
)
||
(
Module
->
GetLayer
()
==
ADHESIVE_N_CU
)
||
(
Module
->
GetLayer
()
==
COPPER_LAYER_N
)
)
pt_texte
->
m_Mirror
=
true
;
/* Inversion miroir de la Valeur et mise en miroir : */
pt_texte
=
Module
->
m_Value
;
pt_texte
->
m_Pos
.
y
-=
Module
->
m_Pos
.
y
;
pt_texte
->
m_Pos
.
y
=
-
pt_texte
->
m_Pos
.
y
;
pt_texte
->
m_Pos
.
y
+=
Module
->
m_Pos
.
y
;
pt_texte
->
m_Pos0
.
y
=
-
pt_texte
->
m_Pos0
.
y
;
pt_texte
->
m_Mirror
=
false
;
NEGATE_AND_NORMALIZE_ANGLE_POS
(
pt_texte
->
m_Orient
);
pt_texte
->
SetLayer
(
Module
->
GetLayer
()
);
pt_texte
->
SetLayer
(
ChangeSideNumLayer
(
pt_texte
->
GetLayer
()
)
);
if
(
Module
->
GetLayer
()
==
COPPER_LAYER_N
)
pt_texte
->
SetLayer
(
SILKSCREEN_N_CU
);
if
(
Module
->
GetLayer
()
==
CMP_N
)
pt_texte
->
SetLayer
(
SILKSCREEN_N_CMP
);
if
(
(
Module
->
GetLayer
()
==
SILKSCREEN_N_CU
)
||
(
Module
->
GetLayer
()
==
ADHESIVE_N_CU
)
||
(
Module
->
GetLayer
()
==
COPPER_LAYER_N
)
)
pt_texte
->
m_Mirror
=
true
;
/* Inversion miroir des dessins de l'empreinte : */
PtStruct
=
Module
->
m_Drawings
;
for
(
;
PtStruct
!=
NULL
;
PtStruct
=
PtStruct
->
Next
()
)
{
switch
(
PtStruct
->
Type
()
)
{
case
TYPE_EDGE_MODULE
:
pt_edgmod
=
(
EDGE_MODULE
*
)
PtStruct
;
pt_edgmod
->
m_Start
.
y
-=
Module
->
m_Pos
.
y
;
pt_edgmod
->
m_Start
.
y
=
-
pt_edgmod
->
m_Start
.
y
;
pt_edgmod
->
m_Start
.
y
+=
Module
->
m_Pos
.
y
;
pt_edgmod
->
m_End
.
y
-=
Module
->
m_Pos
.
y
;
pt_edgmod
->
m_End
.
y
=
-
pt_edgmod
->
m_End
.
y
;
pt_edgmod
->
m_End
.
y
+=
Module
->
m_Pos
.
y
;
/* inversion des coords locales */
pt_edgmod
->
m_Start0
.
y
=
-
pt_edgmod
->
m_Start0
.
y
;
pt_edgmod
->
m_End0
.
y
=
-
pt_edgmod
->
m_End0
.
y
;
if
(
pt_edgmod
->
m_Shape
==
S_ARC
)
{
pt_edgmod
->
m_Angle
=
-
pt_edgmod
->
m_Angle
;
}
pt_edgmod
->
SetLayer
(
ChangeSideNumLayer
(
pt_edgmod
->
GetLayer
()
)
);
break
;
case
TYPE_TEXTE_MODULE
:
/* Inversion miroir de la position et mise en miroir : */
pt_texte
=
(
TEXTE_MODULE
*
)
PtStruct
;
pt_texte
->
m_Pos
.
y
-=
Module
->
m_Pos
.
y
;
pt_texte
->
m_Pos
.
y
=
-
pt_texte
->
m_Pos
.
y
;
pt_texte
->
m_Pos
.
y
+=
Module
->
m_Pos
.
y
;
pt_texte
->
m_Pos0
.
y
=
-
pt_texte
->
m_Pos0
.
y
;
pt_texte
->
m_Mirror
=
false
;
NEGATE_AND_NORMALIZE_ANGLE_POS
(
pt_texte
->
m_Orient
);
pt_texte
->
SetLayer
(
Module
->
GetLayer
()
);
pt_texte
->
SetLayer
(
ChangeSideNumLayer
(
pt_texte
->
GetLayer
()
)
);
if
(
Module
->
GetLayer
()
==
COPPER_LAYER_N
)
pt_texte
->
SetLayer
(
SILKSCREEN_N_CU
);
if
(
Module
->
GetLayer
()
==
CMP_N
)
pt_texte
->
SetLayer
(
SILKSCREEN_N_CMP
);
if
(
Module
->
GetLayer
()
==
SILKSCREEN_N_CU
||
Module
->
GetLayer
()
==
ADHESIVE_N_CU
||
Module
->
GetLayer
()
==
COPPER_LAYER_N
)
{
pt_texte
->
m_Mirror
=
true
;
}
break
;
default
:
DisplayError
(
m_PcbFrame
,
wxT
(
"Unknown Draw Type"
)
);
break
;
}
}
/* calcul du rectangle d'encadrement */
Module
->
Set_Rectangle_Encadrement
();
/* Flip the module */
Module
->
Flip
(
Module
->
m_Pos
);
if
(
m_PcbFrame
)
Module
->
DisplayInfo
(
m_PcbFrame
);
...
...
@@ -541,109 +413,6 @@ void BOARD::Change_Side_Module( MODULE* Module, wxDC* DC )
}
/*********************************************/
static
int
ChangeSideMaskLayer
(
int
masque
)
/*********************************************/
/* Routine de recalcul du masque-layer lors des
* echanges cote cu/cmp pour les couches CU/CMP specialisees
* (cuivre, serigr., pate , soudure)
*/
{
int
newmasque
;
newmasque
=
masque
&
~
(
CUIVRE_LAYER
|
CMP_LAYER
|
SILKSCREEN_LAYER_CU
|
SILKSCREEN_LAYER_CMP
|
ADHESIVE_LAYER_CU
|
ADHESIVE_LAYER_CMP
|
SOLDERMASK_LAYER_CU
|
SOLDERMASK_LAYER_CMP
|
SOLDERPASTE_LAYER_CU
|
SOLDERPASTE_LAYER_CMP
|
ADHESIVE_LAYER_CU
|
ADHESIVE_LAYER_CMP
);
if
(
masque
&
CUIVRE_LAYER
)
newmasque
|=
CMP_LAYER
;
if
(
masque
&
CMP_LAYER
)
newmasque
|=
CUIVRE_LAYER
;
if
(
masque
&
SILKSCREEN_LAYER_CU
)
newmasque
|=
SILKSCREEN_LAYER_CMP
;
if
(
masque
&
SILKSCREEN_LAYER_CMP
)
newmasque
|=
SILKSCREEN_LAYER_CU
;
if
(
masque
&
ADHESIVE_LAYER_CU
)
newmasque
|=
ADHESIVE_LAYER_CMP
;
if
(
masque
&
ADHESIVE_LAYER_CMP
)
newmasque
|=
ADHESIVE_LAYER_CU
;
if
(
masque
&
SOLDERMASK_LAYER_CU
)
newmasque
|=
SOLDERMASK_LAYER_CMP
;
if
(
masque
&
SOLDERMASK_LAYER_CMP
)
newmasque
|=
SOLDERMASK_LAYER_CU
;
if
(
masque
&
SOLDERPASTE_LAYER_CU
)
newmasque
|=
SOLDERPASTE_LAYER_CMP
;
if
(
masque
&
SOLDERPASTE_LAYER_CMP
)
newmasque
|=
SOLDERPASTE_LAYER_CU
;
if
(
masque
&
ADHESIVE_LAYER_CU
)
newmasque
|=
ADHESIVE_LAYER_CMP
;
if
(
masque
&
ADHESIVE_LAYER_CMP
)
newmasque
|=
ADHESIVE_LAYER_CU
;
return
newmasque
;
}
/*************************************/
int
ChangeSideNumLayer
(
int
oldlayer
)
/*************************************/
/* Routine de recalcul du numero de couche lors des
* echanges cote cu/cmp pour les couches CU/CMP specialisees
* (cuivre, serigr., pate , soudure)
*/
{
int
newlayer
;
switch
(
oldlayer
)
{
case
COPPER_LAYER_N
:
newlayer
=
CMP_N
;
break
;
case
CMP_N
:
newlayer
=
COPPER_LAYER_N
;
break
;
case
SILKSCREEN_N_CU
:
newlayer
=
SILKSCREEN_N_CMP
;
break
;
case
SILKSCREEN_N_CMP
:
newlayer
=
SILKSCREEN_N_CU
;
break
;
case
ADHESIVE_N_CU
:
newlayer
=
ADHESIVE_N_CMP
;
break
;
case
ADHESIVE_N_CMP
:
newlayer
=
ADHESIVE_N_CU
;
break
;
case
SOLDERMASK_N_CU
:
newlayer
=
SOLDERMASK_N_CMP
;
break
;
case
SOLDERMASK_N_CMP
:
newlayer
=
SOLDERMASK_N_CU
;
break
;
case
SOLDERPASTE_N_CU
:
newlayer
=
SOLDERPASTE_N_CMP
;
break
;
case
SOLDERPASTE_N_CMP
:
newlayer
=
SOLDERPASTE_N_CU
;
break
;
default
:
newlayer
=
oldlayer
;
}
return
newlayer
;
}
/*****************************************************************/
void
WinEDA_BasePcbFrame
::
Place_Module
(
MODULE
*
module
,
wxDC
*
DC
,
bool
aDoNotRecreateRatsnest
)
/*****************************************************************/
...
...
pcbnew/onrightclick.cpp
View file @
41c80dd9
...
...
@@ -275,8 +275,8 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
createPopupMenuForTracks
(
(
TRACK
*
)
item
,
aPopMenu
);
break
;
case
TYPE_MARKER
:
createPopUpMenuForMarkers
(
(
MARKER
*
)
item
,
aPopMenu
);
case
TYPE_MARKER
_PCB
:
createPopUpMenuForMarkers
(
(
MARKER
_PCB
*
)
item
,
aPopMenu
);
break
;
case
TYPE_COTATION
:
...
...
@@ -879,7 +879,7 @@ void WinEDA_PcbFrame::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu )
}
/**********************************************************************/
void
WinEDA_PcbFrame
::
createPopUpMenuForMarkers
(
MARKER
*
aMarker
,
wxMenu
*
aPopMenu
)
void
WinEDA_PcbFrame
::
createPopUpMenuForMarkers
(
MARKER
_PCB
*
aMarker
,
wxMenu
*
aPopMenu
)
/**********************************************************************/
{
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_DELETE_MARKER
,
_
(
"Delete Marker"
),
delete_xpm
);
...
...
pcbnew/plot_rtn.cpp
View file @
41c80dd9
...
...
@@ -57,7 +57,7 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( Plotter* plotter,
PlotMirePcb
(
plotter
,
(
MIREPCB
*
)
PtStruct
,
masque_layer
,
trace_mode
);
break
;
case
TYPE_MARKER
:
case
TYPE_MARKER
_PCB
:
break
;
default
:
...
...
@@ -740,7 +740,7 @@ void WinEDA_BasePcbFrame::Plot_Standard_Layer( Plotter* plotter,
PlotMirePcb
(
plotter
,
(
MIREPCB
*
)
item
,
masque_layer
,
trace_mode
);
break
;
case
TYPE_MARKER
:
case
TYPE_MARKER
_PCB
:
break
;
default
:
...
...
pcbnew/print_board_functions.cpp
View file @
41c80dd9
...
...
@@ -76,7 +76,7 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMa
item
->
Draw
(
this
,
aDC
,
drawmode
);
break
;
case
TYPE_MARKER
:
/* Trace des marqueurs */
case
TYPE_MARKER
_PCB
:
/* Trace des marqueurs */
default
:
break
;
}
...
...
pcbnew/ratsnest.cpp
View file @
41c80dd9
...
...
@@ -482,7 +482,7 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC )
// erase the ratsnest displayed on screen if needed
for
(
unsigned
ii
=
0
;
ii
<
m_Pcb
->
GetRatsnestsCount
();
ii
++
)
{
if
(
!
g_Show_Ratsnest
)
// Clear VISIBLE flag
if
(
!
g_Show_Ratsnest
&&
DC
)
// Clear VISIBLE flag
m_Pcb
->
m_FullRatsnest
[
ii
].
m_Status
&=
~
CH_VISIBLE
;
if
(
DC
)
...
...
pcbnew/zones_test_and_combine_areas.cpp
View file @
41c80dd9
...
...
@@ -847,7 +847,7 @@ int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_E
{
wxString
msg1
=
Area_Ref
->
MenuText
(
this
);
wxString
msg2
=
Area_To_Test
->
MenuText
(
this
);
MARKER
*
marker
=
new
MARKER
(
COPPERAREA_INSIDE_COPPERAREA
,
wxPoint
(
x
,
y
),
MARKER
_PCB
*
marker
=
new
MARKER_PCB
(
COPPERAREA_INSIDE_COPPERAREA
,
wxPoint
(
x
,
y
),
msg1
,
wxPoint
(
x
,
y
),
msg2
,
wxPoint
(
x
,
y
)
);
Add
(
marker
);
...
...
@@ -868,7 +868,7 @@ int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_E
{
wxString
msg1
=
Area_To_Test
->
MenuText
(
this
);
wxString
msg2
=
Area_Ref
->
MenuText
(
this
);
MARKER
*
marker
=
new
MARKER
(
COPPERAREA_INSIDE_COPPERAREA
,
wxPoint
(
x
,
y
),
MARKER
_PCB
*
marker
=
new
MARKER_PCB
(
COPPERAREA_INSIDE_COPPERAREA
,
wxPoint
(
x
,
y
),
msg1
,
wxPoint
(
x
,
y
),
msg2
,
wxPoint
(
x
,
y
)
);
Add
(
marker
);
...
...
@@ -935,7 +935,7 @@ int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_E
{
wxString
msg1
=
Area_Ref
->
MenuText
(
this
);
wxString
msg2
=
Area_To_Test
->
MenuText
(
this
);
MARKER
*
marker
=
new
MARKER
(
COPPERAREA_CLOSE_TO_COPPERAREA
,
MARKER
_PCB
*
marker
=
new
MARKER_PCB
(
COPPERAREA_CLOSE_TO_COPPERAREA
,
wxPoint
(
x
,
y
),
msg1
,
wxPoint
(
x
,
y
),
msg2
,
wxPoint
(
x
,
y
)
);
...
...
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