7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-07 23:25:34 +00:00

see change_log for 2007-Aug-31

This commit is contained in:
dickelbeck 2007-09-01 12:00:30 +00:00
parent 726a8ab4df
commit dff70646a2
197 changed files with 3032 additions and 2652 deletions
3d-viewer
change_log.txt
common
cvpcb
eeschema
gerbview
include
pcbnew
share
todo.txt

View File

@ -80,7 +80,7 @@ Pcb3D_GLCanvas::Pcb3D_GLCanvas( WinEDA3D_DrawFrame* parent, wxWindowID id,
/*************************************/
Pcb3D_GLCanvas::~Pcb3D_GLCanvas( void )
Pcb3D_GLCanvas::~Pcb3D_GLCanvas()
/*************************************/
{
ClearLists();
@ -88,7 +88,7 @@ Pcb3D_GLCanvas::~Pcb3D_GLCanvas( void )
/*************************************/
void Pcb3D_GLCanvas::ClearLists( void )
void Pcb3D_GLCanvas::ClearLists()
/*************************************/
{
if( m_gllist > 0 )
@ -448,7 +448,7 @@ void Pcb3D_GLCanvas::OnPopUpMenu( wxCommandEvent& event )
/***************************************/
void Pcb3D_GLCanvas::DisplayStatus( void )
void Pcb3D_GLCanvas::DisplayStatus()
/***************************************/
{
wxString msg;
@ -573,7 +573,7 @@ void Pcb3D_GLCanvas::InitGL()
/***********************************/
void Pcb3D_GLCanvas::SetLights( void )
void Pcb3D_GLCanvas::SetLights()
/***********************************/
/* Init sources lumineuses pour OPENGL

View File

@ -168,7 +168,7 @@ glEnable(GL_FOG);
/* Tracé des pistes : */
for (pt_piste = pcb->m_Track ; pt_piste != NULL ; pt_piste = (TRACK*) pt_piste->Pnext )
{
if ( pt_piste->m_StructType == TYPEVIA )
if ( pt_piste->Type() == TYPEVIA )
Draw3D_Via((SEGVIA*)pt_piste);
else Draw3D_Track( pt_piste);
}
@ -178,7 +178,7 @@ EDA_BaseStruct * PtStruct;
for ( PtStruct = pcb->m_Drawings; PtStruct != NULL; PtStruct = PtStruct->Pnext)
{
#define STRUCT ((DRAWSEGMENT *) PtStruct)
if( PtStruct->m_StructType != TYPEDRAWSEGMENT ) continue;
if( PtStruct->Type() != TYPEDRAWSEGMENT ) continue;
Draw3D_DrawSegment(STRUCT);
}
@ -358,7 +358,7 @@ bool As3dShape = FALSE;
glNormal3f( 0.0, 0.0, 1.0); // Normal is Z axis
for( ;Struct != NULL; Struct = Struct->Pnext )
{
switch( Struct->m_StructType )
switch( Struct->Type() )
{
case TYPETEXTEMODULE:
break;

View File

@ -97,7 +97,7 @@ public:
void OnEnterWindow( wxMouseEvent& event );
void Render( void );
void Render();
GLuint CreateDrawGL_List(void);
void InitGL(void);
void SetLights(void);

View File

@ -4,6 +4,19 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-Aug-31 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+ pcbnew & gerbview
* Added TRACK::Copy() which can copy a SEGVIA or a TRACK.
* Changed export_to_pcbnew.cpp so it created a SEGVIA properly, a significant change.
Moved and changed a big block of code in export_to_pcbnew.cpp so we can
properly construct the SEGVIA(). Not tested.
* Make EDA_BaseStruct::m_StructType private so we can trap where it is being
changed. (It should never be changed after construction, see comment above
EDA_BaseStruct::SetType().)
2007-Aug-30 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+ pcbnew

View File

@ -16,7 +16,8 @@
/*******************************************************/
/* Class BASE_SCREEN: classe de gestion d'un affichage */
/*******************************************************/
BASE_SCREEN::BASE_SCREEN( int idscreen ) : EDA_BaseStruct( SCREEN_STRUCT_TYPE )
BASE_SCREEN::BASE_SCREEN( int idscreen, KICAD_T aType ) :
EDA_BaseStruct( aType )
{
EEDrawList = NULL; /* Schematic items list */
m_Type = idscreen;
@ -31,7 +32,7 @@ BASE_SCREEN::BASE_SCREEN( int idscreen ) : EDA_BaseStruct( SCREEN_STRUCT_TYPE )
/******************************/
BASE_SCREEN::~BASE_SCREEN( void )
BASE_SCREEN::~BASE_SCREEN()
/******************************/
{
if( m_ZoomList )
@ -43,7 +44,7 @@ BASE_SCREEN::~BASE_SCREEN( void )
/*******************************/
void BASE_SCREEN::InitDatas( void )
void BASE_SCREEN::InitDatas()
/*******************************/
{
m_SheetNumber = m_NumberOfSheet = 1; /* gestion hierarchie: Root: SheetNumber = 1 */
@ -121,7 +122,7 @@ wxPoint BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos )
/***************************************/
int BASE_SCREEN::GetInternalUnits( void )
int BASE_SCREEN::GetInternalUnits()
/***************************************/
{
switch( m_Type )
@ -141,7 +142,7 @@ int BASE_SCREEN::GetInternalUnits( void )
/*****************************************/
wxSize BASE_SCREEN::ReturnPageSize( void )
wxSize BASE_SCREEN::ReturnPageSize()
/*****************************************/
/* Retourne en unites internes la taille de la feuille de dessin
@ -199,7 +200,7 @@ void BASE_SCREEN::SetZoomList( int* zoomlist )
/***********************************/
void BASE_SCREEN::SetFirstZoom( void )
void BASE_SCREEN::SetFirstZoom()
/***********************************/
/* ajuste le coeff de zoom a 1*/
{
@ -208,7 +209,7 @@ void BASE_SCREEN::SetFirstZoom( void )
/****************************/
int BASE_SCREEN::GetZoom( void )
int BASE_SCREEN::GetZoom()
/****************************/
/* retourne le coeff de zoom */
{
@ -228,7 +229,7 @@ void BASE_SCREEN::SetZoom( int coeff )
/********************************/
void BASE_SCREEN::SetNextZoom( void )
void BASE_SCREEN::SetNextZoom()
/********************************/
/* Selectionne le prochain coeff de zoom
@ -249,7 +250,7 @@ void BASE_SCREEN::SetNextZoom( void )
/*************************************/
void BASE_SCREEN::SetPreviousZoom( void )
void BASE_SCREEN::SetPreviousZoom()
/*************************************/
/* Selectionne le precedent coeff de zoom
@ -262,7 +263,7 @@ void BASE_SCREEN::SetPreviousZoom( void )
/**********************************/
void BASE_SCREEN::SetLastZoom( void )
void BASE_SCREEN::SetLastZoom()
/**********************************/
/* ajuste le coeff de zoom au max
@ -326,7 +327,7 @@ void BASE_SCREEN::SetGrid( const wxSize& size )
/*********************************/
wxSize BASE_SCREEN::GetGrid( void )
wxSize BASE_SCREEN::GetGrid()
/*********************************/
{
wxSize grid = m_Grid;
@ -351,7 +352,7 @@ wxSize BASE_SCREEN::GetGrid( void )
/*********************************/
void BASE_SCREEN::SetNextGrid( void )
void BASE_SCREEN::SetNextGrid()
/*********************************/
/* Selectionne la prochaine grille
@ -376,7 +377,7 @@ void BASE_SCREEN::SetNextGrid( void )
/*************************************/
void BASE_SCREEN::SetPreviousGrid( void )
void BASE_SCREEN::SetPreviousGrid()
/*************************************/
/* Selectionne le precedent coeff de grille
@ -401,7 +402,7 @@ void BASE_SCREEN::SetPreviousGrid( void )
/**********************************/
void BASE_SCREEN::SetFirstGrid( void )
void BASE_SCREEN::SetFirstGrid()
/**********************************/
/* ajuste le coeff de grille a 1
@ -419,7 +420,7 @@ void BASE_SCREEN::SetFirstGrid( void )
/**********************************/
void BASE_SCREEN::SetLastGrid( void )
void BASE_SCREEN::SetLastGrid()
/**********************************/
/* ajuste le coeff de grille au max
@ -432,7 +433,7 @@ void BASE_SCREEN::SetLastGrid( void )
/*****************************************/
void BASE_SCREEN::ClearUndoRedoList( void )
void BASE_SCREEN::ClearUndoRedoList()
/*****************************************/
/* free the undo and the redo lists
@ -532,7 +533,7 @@ void BASE_SCREEN::AddItemToRedoList( EDA_BaseStruct* newitem )
/*****************************************************/
EDA_BaseStruct* BASE_SCREEN::GetItemFromUndoList( void )
EDA_BaseStruct* BASE_SCREEN::GetItemFromUndoList()
/*****************************************************/
{
EDA_BaseStruct* item = m_UndoList;
@ -544,7 +545,7 @@ EDA_BaseStruct* BASE_SCREEN::GetItemFromUndoList( void )
/******************************************************/
EDA_BaseStruct* BASE_SCREEN::GetItemFromRedoList( void )
EDA_BaseStruct* BASE_SCREEN::GetItemFromRedoList()
/******************************************************/
{
EDA_BaseStruct* item = m_RedoList;

View File

@ -93,7 +93,7 @@ EDA_BaseStruct::EDA_BaseStruct( KICAD_T idType )
/********************************************/
void EDA_BaseStruct::InitVars( void )
void EDA_BaseStruct::InitVars()
/********************************************/
{
m_StructType = TYPE_NOT_INIT;
@ -151,7 +151,7 @@ void EDA_BaseStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& off
msg.Printf( wxT(
"EDA_BaseStruct::Draw() error. Method for struct type %d used but not implemented (" ),
m_StructType );
Type() );
msg += ReturnClassName() + wxT( ")\n" );
printf( CONV_TO_UTF8( msg ) );
}
@ -175,10 +175,10 @@ wxString EDA_BaseStruct::ReturnClassName() const
/*********************************************/
/* Used at run time for diags: return the class name of the item,
* from its .m_StructType value.
* from its .Type() value.
*/
{
int ii = m_StructType;
int ii = Type();
wxString classname;
if( (ii < 0) || (ii > MAX_STRUCT_TYPE_ID) )
@ -218,7 +218,7 @@ SEARCH_RESULT EDA_BaseStruct::Visit( INSPECTOR* inspector, const void* testData,
for( const KICAD_T* p = scanTypes; (stype=*p) != EOT; ++p )
{
// If caller wants to inspect my type
if( stype == m_StructType )
if( stype == Type() )
{
if( SEARCH_QUIT == inspector->Inspect( this, testData ) )
return SEARCH_QUIT;
@ -307,7 +307,7 @@ EDA_TextStruct::EDA_TextStruct( const wxString& text )
}
EDA_TextStruct::~EDA_TextStruct( void )
EDA_TextStruct::~EDA_TextStruct()
{
if( m_TextDrawings ) /* pointeur sur la liste des segments de dessin */
{
@ -318,7 +318,7 @@ EDA_TextStruct::~EDA_TextStruct( void )
/********************************/
int EDA_TextStruct::Len_Size( void )
int EDA_TextStruct::Len_Size()
/********************************/
// Return the text lenght in internal units
@ -364,7 +364,7 @@ bool EDA_TextStruct::HitTest( const wxPoint& posref )
/*******************************/
int EDA_TextStruct::Pitch( void )
int EDA_TextStruct::Pitch()
/*******************************/
/* retourne le pas entre 2 caracteres
@ -474,7 +474,7 @@ void EDA_TextStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
/****************************************/
void EDA_TextStruct::CreateDrawData( void )
void EDA_TextStruct::CreateDrawData()
/****************************************/
/* Cree le tableau de donn<6E>s n<>essaire au trace d'un texte (pcb, module..)
@ -683,7 +683,7 @@ void EDA_TextStruct::CreateDrawData( void )
/******************************/
void EDA_Rect::Normalize( void )
void EDA_Rect::Normalize()
/******************************/
// Ensure the height ant width are >= 0
@ -785,13 +785,13 @@ DrawPickedStruct::DrawPickedStruct( EDA_BaseStruct* pickedstruct ) :
}
DrawPickedStruct::~DrawPickedStruct( void )
DrawPickedStruct::~DrawPickedStruct()
{
}
/*********************************************/
void DrawPickedStruct::DeleteWrapperList( void )
void DrawPickedStruct::DeleteWrapperList()
/*********************************************/
/* Delete this item all the items of the linked list

View File

@ -17,7 +17,7 @@
/*******************/
/****************************************************************************/
DrawBlockStruct::DrawBlockStruct( void ) :
DrawBlockStruct::DrawBlockStruct() :
EDA_BaseStruct( BLOCK_LOCATE_STRUCT_TYPE )
, EDA_Rect()
/****************************************************************************/
@ -30,7 +30,7 @@ DrawBlockStruct::DrawBlockStruct( void ) :
/****************************************/
DrawBlockStruct::~DrawBlockStruct( void )
DrawBlockStruct::~DrawBlockStruct()
/****************************************/
{
}
@ -219,7 +219,7 @@ void AbortBlockCurrentCommand( WinEDA_DrawPanel* Panel, wxDC* DC )
if( (screen->BlockLocate.m_Command != BLOCK_PASTE)
&& screen->BlockLocate.m_BlockDrawStruct )
{
if( screen->BlockLocate.m_BlockDrawStruct->m_StructType == DRAW_PICK_ITEM_STRUCT_TYPE )
if( screen->BlockLocate.m_BlockDrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
{
DrawPickedStruct* PickedList;
PickedList = (DrawPickedStruct*) screen->BlockLocate.m_BlockDrawStruct;

View File

@ -14,7 +14,7 @@
#include "build_version.h"
/*****************************/
wxString GetBuildVersion( void )
wxString GetBuildVersion()
/*****************************/
/* Return the build date
@ -193,7 +193,7 @@ int From_User_Unit( bool is_metric, double val, int internal_unit_value )
/**********************/
wxString GenDate( void )
wxString GenDate()
/**********************/
/* Return the string date "day month year" like "23 jun 2005"
@ -427,7 +427,7 @@ void AfficheDoc( WinEDA_DrawFrame* frame, const wxString& Doc, const wxString& K
/***********************/
int GetTimeStamp( void )
int GetTimeStamp()
/***********************/
/*

View File

@ -233,7 +233,7 @@ static int SortItems( const wxString ** ptr1, const wxString ** ptr2 )
/************************************/
void WinEDAListBox:: SortList( void )
void WinEDAListBox:: SortList()
/************************************/
{
int ii, NbItems = m_List->GetCount();

View File

@ -312,7 +312,7 @@ wxString EDA_FileSelector( const wxString& Title, /* Dialog ti
/********************************************************/
wxString FindKicadHelpPath( void )
wxString FindKicadHelpPath()
/********************************************************/
/* Find absolute path for kicad/help (or kicad/help/<language>) */
@ -536,7 +536,7 @@ void SetRealLibraryPath( const wxString& shortlibname )
/***********************************/
wxString ReturnKicadDatasPath( void )
wxString ReturnKicadDatasPath()
/***********************************/
/* Retourne le chemin des donnees communes de kicad.
@ -605,7 +605,7 @@ wxString ReturnKicadDatasPath( void )
/***************************/
wxString GetEditorName( void )
wxString GetEditorName()
/***************************/
/* Return the prefered editor name

View File

@ -27,7 +27,7 @@ using namespace boost::python;
/* Common Python Binding */
/*****************************************************************************/
static int GetLastID( void ) { return ID_END_LIST; }
static int GetLastID() { return ID_END_LIST; }
static object ChooseFile( str objTitle, str objMask, object objOpen )
{

View File

@ -58,7 +58,7 @@ wxString msg;
PtStruct = (EDA_BaseStruct *) GenericStructure;
if( PtStruct == NULL) return ;
typestruct = (int)PtStruct->m_StructType;
typestruct = (int)PtStruct->Type();
IsDeleted = PtStruct->GetState(DELETED);
PtNext = PtStruct->Pnext;
@ -167,7 +167,7 @@ wxString msg;
default:
msg.Printf( wxT(" DeleteStructure: Type %d Inattendu"),
PtStruct->m_StructType);
PtStruct->Type());
DisplayError(NULL, msg);
break;
}

View File

@ -132,7 +132,7 @@ void LibEDA_BaseStruct::Display_Infos_DrawEntry( WinEDA_DrawFrame* frame )
/* affichage du type */
msg = wxT( "??" );
switch( m_StructType )
switch( Type() )
{
case COMPONENT_ARC_DRAW_TYPE:
msg = wxT( "Arc" ); break;

View File

@ -26,7 +26,7 @@ static bool SortByPosition = TRUE;
/**************************************/
void ReAnnotatePowerSymbolsOnly( void )
void ReAnnotatePowerSymbolsOnly()
/**************************************/
/* Used to reannotate the power symbols, before testing erc or computing netlist
when a true component reannotation is not necessary
@ -48,7 +48,7 @@ In order to avoid conflicts the ref number start with a 0:
EDA_BaseStruct *DrawList = screen->EEDrawList;
for ( ; DrawList != NULL ; DrawList = DrawList->Pnext )
{
if ( DrawList->m_StructType != DRAW_LIB_ITEM_STRUCT_TYPE )
if ( DrawList->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
continue;
EDA_SchComponentStruct * DrawLibItem = (EDA_SchComponentStruct *) DrawList;
EDA_LibComponentStruct * Entry =
@ -194,7 +194,7 @@ EDA_SchComponentStruct *DrawLibItem;
EDA_BaseStruct *DrawList = screen->EEDrawList;
for ( ; DrawList != NULL ; DrawList = DrawList->Pnext )
{
if ( DrawList->m_StructType == DRAW_LIB_ITEM_STRUCT_TYPE )
if ( DrawList->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
{
DrawLibItem = (EDA_SchComponentStruct *) DrawList;
DrawLibItem->ClearAnnotation();
@ -224,7 +224,7 @@ EDA_LibComponentStruct *Entry;
while ( DrawList )
{
switch( DrawList->m_StructType )
switch( DrawList->Type() )
{
case DRAW_SEGMENT_STRUCT_TYPE :
case DRAW_JUNCTION_STRUCT_TYPE :

View File

@ -371,7 +371,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
if( block->m_BlockDrawStruct )
{
if( block->m_BlockDrawStruct->m_StructType == DRAW_PICK_ITEM_STRUCT_TYPE )
if( block->m_BlockDrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
{ /* Delete the picked wrapper if this is a picked list. */
DrawPickedStruct* PickedList;
PickedList = (DrawPickedStruct*) block->m_BlockDrawStruct;
@ -490,7 +490,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
PtBlock->Offset( -PtBlock->m_MoveVector.x, -PtBlock->m_MoveVector.y );
/* Effacement ancien affichage */
if( PtBlock->m_BlockDrawStruct->m_StructType == DRAW_PICK_ITEM_STRUCT_TYPE )
if( PtBlock->m_BlockDrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
{
PickedList = (DrawPickedStruct*) PtBlock->m_BlockDrawStruct;
while( PickedList )
@ -523,7 +523,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
if( PtBlock->m_BlockDrawStruct )
{
if( PtBlock->m_BlockDrawStruct->m_StructType == DRAW_PICK_ITEM_STRUCT_TYPE )
if( PtBlock->m_BlockDrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
{
PickedList = (DrawPickedStruct*) PtBlock->m_BlockDrawStruct;
while( PickedList )
@ -558,7 +558,7 @@ bool MoveStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct )
if( !DrawStruct )
return FALSE;
if( DrawStruct->m_StructType == DRAW_PICK_ITEM_STRUCT_TYPE )
if( DrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
{
if( DC )
RedrawStructList( panel, DC, DrawStruct, g_XorMode );
@ -613,7 +613,7 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
if( !DrawStruct )
return;
switch( DrawStruct->m_StructType )
switch( DrawStruct->Type() )
{
case TYPE_NOT_INIT:
break;
@ -756,7 +756,7 @@ bool MirrorStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct
if( !DrawStruct )
return FALSE;
if( DrawStruct->m_StructType == DRAW_PICK_ITEM_STRUCT_TYPE )
if( DrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
{
if( DC )
RedrawStructList( panel, DC, DrawStruct, g_XorMode );
@ -813,14 +813,14 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE
PlaceStruct( screen, NewDrawStruct );
/* Draw the new structure and chain it in: */
if( NewDrawStruct->m_StructType == DRAW_PICK_ITEM_STRUCT_TYPE )
if( NewDrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
{
PickedList = (DrawPickedStruct*) NewDrawStruct;
while( PickedList ) // Clear annotation for new components
{
EDA_BaseStruct* Struct = PickedList->m_PickedStruct;
switch( Struct->m_StructType )
switch( Struct->Type() )
{
case DRAW_LIB_ITEM_STRUCT_TYPE:
{
@ -862,7 +862,7 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE
}
else
{
switch( NewDrawStruct->m_StructType )
switch( NewDrawStruct->Type() )
{
case DRAW_POLYLINE_STRUCT_TYPE:
case DRAW_JUNCTION_STRUCT_TYPE:
@ -905,7 +905,7 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE
}
/* Free the original DrawPickedStruct chain: */
if( DrawStruct->m_StructType == DRAW_PICK_ITEM_STRUCT_TYPE )
if( DrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
{
PickedList = (DrawPickedStruct*) DrawStruct;
PickedList->DeleteWrapperList();
@ -931,7 +931,7 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct
return;
if( DrawStruct->m_StructType == DRAW_SHEETLABEL_STRUCT_TYPE )
if( DrawStruct->Type() == DRAW_SHEETLABEL_STRUCT_TYPE )
{ /* Cette stucture est rattachee a une feuille, et n'est pas
* accessible par la liste globale directement */
frame->SaveCopyInUndoList( ( (DrawSheetLabelStruct*) DrawStruct )->m_Parent, IS_CHANGED );
@ -939,7 +939,7 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct
return;
}
if( DrawStruct->m_StructType == DRAW_PICK_ITEM_STRUCT_TYPE )
if( DrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
{
/* Unlink all picked structs from current EEDrawList */
PickedList = (DrawPickedStruct*) DrawStruct;
@ -988,7 +988,7 @@ EDA_BaseStruct* SaveStructListForPaste( EDA_BaseStruct* DrawStruct )
/* Make a copy of the original picked item. */
DrawStructCopy = DuplicateStruct( DrawStruct );
if( DrawStruct->m_StructType == DRAW_PICK_ITEM_STRUCT_TYPE )
if( DrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
{
/* Delete the picked wrapper if this is a picked list. */
PickedList = (DrawPickedStruct*) DrawStruct;
@ -1036,12 +1036,12 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC )
RedrawStructList( DrawPanel, DC, DrawStruct, GR_DEFAULT_DRAWMODE );
// Clear annotation and init new time stamp for the new components:
if( DrawStruct->m_StructType == DRAW_PICK_ITEM_STRUCT_TYPE )
if( DrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
{
for( PickedList = (DrawPickedStruct*) DrawStruct; PickedList != NULL; ) // Clear annotation for new components
{
EDA_BaseStruct* Struct = PickedList->m_PickedStruct;
if( Struct->m_StructType == DRAW_LIB_ITEM_STRUCT_TYPE )
if( Struct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
{
( (EDA_SchComponentStruct*) Struct )->m_TimeStamp = GetTimeStamp();
( (EDA_SchComponentStruct*) Struct )->ClearAnnotation();
@ -1065,7 +1065,7 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC )
}
else
{
if( DrawStruct->m_StructType == DRAW_LIB_ITEM_STRUCT_TYPE )
if( DrawStruct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
{
( (EDA_SchComponentStruct*) DrawStruct )->m_TimeStamp = GetTimeStamp();
( (EDA_SchComponentStruct*) DrawStruct )->ClearAnnotation();
@ -1104,7 +1104,7 @@ bool PlaceStruct( BASE_SCREEN* screen, EDA_BaseStruct* DrawStruct )
move_vector.y = screen->m_Curseur.y -
screen->BlockLocate.m_BlockLastCursorPosition.y;
switch( DrawStruct->m_StructType )
switch( DrawStruct->Type() )
{
default:
case TYPE_NOT_INIT:
@ -1161,7 +1161,7 @@ void MoveOneStruct( EDA_BaseStruct* DrawStruct, const wxPoint& move_vector )
if( !DrawStruct )
return;
switch( DrawStruct->m_StructType )
switch( DrawStruct->Type() )
{
case TYPE_NOT_INIT:
break;
@ -1276,7 +1276,7 @@ EDA_BaseStruct* DuplicateStruct( EDA_BaseStruct* DrawStruct )
return NULL;
}
switch( DrawStruct->m_StructType )
switch( DrawStruct->Type() )
{
case DRAW_POLYLINE_STRUCT_TYPE:
NewDrawStruct = ( (DrawPolylineStruct*) DrawStruct )->GenCopy();
@ -1350,7 +1350,7 @@ EDA_BaseStruct* DuplicateStruct( EDA_BaseStruct* DrawStruct )
{
wxString msg;
msg << wxT( "DuplicateStruct error: unexpected StructType " ) <<
DrawStruct->m_StructType << wxT( " " ) << DrawStruct->ReturnClassName();
DrawStruct->Type() << wxT( " " ) << DrawStruct->ReturnClassName();
DisplayError( NULL, msg );
}
break;
@ -1374,10 +1374,10 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )
for( Struct = screen->EEDrawList; Struct != NULL; Struct = Struct->Pnext )
Struct->m_Flags = 0;
if( screen->BlockLocate.m_BlockDrawStruct->m_StructType == DRAW_SEGMENT_STRUCT_TYPE )
if( screen->BlockLocate.m_BlockDrawStruct->Type() == DRAW_SEGMENT_STRUCT_TYPE )
screen->BlockLocate.m_BlockDrawStruct->m_Flags = SELECTED;
else if( screen->BlockLocate.m_BlockDrawStruct->m_StructType == DRAW_PICK_ITEM_STRUCT_TYPE )
else if( screen->BlockLocate.m_BlockDrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
{
DrawStructs = (DrawPickedStruct*) screen->BlockLocate.m_BlockDrawStruct;
while( DrawStructs )
@ -1403,7 +1403,7 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )
/* Pour Drag Block: remise sous forme de liste de structure, s'il n'y
* a qu'un seul element ( pour homogeneiser les traitements ulterieurs */
if( screen->BlockLocate.m_BlockDrawStruct->m_StructType != DRAW_PICK_ITEM_STRUCT_TYPE )
if( screen->BlockLocate.m_BlockDrawStruct->Type() != DRAW_PICK_ITEM_STRUCT_TYPE )
{
DrawStructs = new DrawPickedStruct( screen->BlockLocate.m_BlockDrawStruct );
screen->BlockLocate.m_BlockDrawStruct = DrawStructs;
@ -1416,7 +1416,7 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )
{
Struct = DrawStructs->m_PickedStruct;
DrawStructs = (DrawPickedStruct*) DrawStructs->Pnext;
if( Struct->m_StructType == DRAW_SEGMENT_STRUCT_TYPE )
if( Struct->Type() == DRAW_SEGMENT_STRUCT_TYPE )
{
SegmStruct = (EDA_DrawLineStruct*) Struct;
if( (SegmStruct->m_Start.x < ox) || (SegmStruct->m_Start.x > fx)
@ -1438,7 +1438,7 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )
{
Struct = DrawStructs->m_PickedStruct;
DrawStructs = (DrawPickedStruct*) DrawStructs->Pnext;
if( Struct->m_StructType == DRAW_LIB_ITEM_STRUCT_TYPE )
if( Struct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
{
LibEDA_BaseStruct* DrawItem;
int x, y;
@ -1452,18 +1452,18 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )
}
}
if( Struct->m_StructType == DRAW_SHEET_STRUCT_TYPE )
if( Struct->Type() == DRAW_SHEET_STRUCT_TYPE )
{
DrawSheetLabelStruct* SLabel = ( (DrawSheetStruct*) Struct )->m_Label;
while( SLabel )
{
if( SLabel->m_StructType == DRAW_SHEETLABEL_STRUCT_TYPE )
if( SLabel->Type() == DRAW_SHEETLABEL_STRUCT_TYPE )
AddPickedItem( screen, SLabel->m_Pos.x, SLabel->m_Pos.y );
SLabel = (DrawSheetLabelStruct*) SLabel->Pnext;
}
}
if( Struct->m_StructType == DRAW_BUSENTRY_STRUCT_TYPE )
if( Struct->Type() == DRAW_BUSENTRY_STRUCT_TYPE )
{
DrawBusEntryStruct* item = (DrawBusEntryStruct*) Struct;
AddPickedItem( screen, item->m_Pos.x, item->m_Pos.y );
@ -1487,7 +1487,7 @@ static void AddPickedItem( SCH_SCREEN* screen, int px, int py )
Struct = DrawStructs->m_PickedStruct;
DrawStructs = (DrawPickedStruct*) DrawStructs->Pnext;
switch( Struct->m_StructType )
switch( Struct->Type() )
{
case DRAW_SEGMENT_STRUCT_TYPE:
#undef STRUCT
@ -1509,7 +1509,7 @@ static void AddPickedItem( SCH_SCREEN* screen, int px, int py )
Struct = screen->EEDrawList;
while( Struct )
{
switch( Struct->m_StructType )
switch( Struct->Type() )
{
case TYPE_NOT_INIT:
break;
@ -1684,7 +1684,7 @@ static LibEDA_BaseStruct* GetNextPinPosition( EDA_SchComponentStruct* DrawLibIte
continue;
if( convert && DEntry->m_Convert && (DEntry->m_Convert != convert) )
continue;
if( DEntry->m_StructType != COMPONENT_PIN_DRAW_TYPE )
if( DEntry->Type() != COMPONENT_PIN_DRAW_TYPE )
continue;
Pin = (LibDrawPin*) DEntry;

View File

@ -81,7 +81,7 @@ int MarkItemsInBloc( EDA_LibComponentStruct* LibComponent,
ItemIsInOtherConvert = TRUE;
if( ItemIsInOtherPart || ItemIsInOtherConvert )
{
if( item->m_StructType == COMPONENT_PIN_DRAW_TYPE )
if( item->Type() == COMPONENT_PIN_DRAW_TYPE )
{ // Specific rules for pins:
if( g_EditPinByPinIsOn )
continue;
@ -94,7 +94,7 @@ int MarkItemsInBloc( EDA_LibComponentStruct* LibComponent,
continue;
}
switch( item->m_StructType )
switch( item->Type() )
{
case COMPONENT_ARC_DRAW_TYPE:
{
@ -545,7 +545,7 @@ void MoveMarkedItems( EDA_LibComponentStruct* LibEntry, wxPoint offset )
if( item->m_Selected == 0 )
continue;
switch( item->m_StructType )
switch( item->Type() )
{
case COMPONENT_PIN_DRAW_TYPE:
( (LibDrawPin*) item )->m_Pos.x += offset.x;
@ -647,7 +647,7 @@ void MirrorMarkedItems( EDA_LibComponentStruct* LibEntry, wxPoint offset )
if( item->m_Selected == 0 )
continue;
switch( item->m_StructType )
switch( item->Type() )
{
case COMPONENT_PIN_DRAW_TYPE:
SETMIRROR( ( (LibDrawPin*) item )->m_Pos.x );

View File

@ -45,7 +45,7 @@ EDA_BaseStruct* SCH_SCREEN::ExtractWires( bool CreateCopy )
{
next_item = item->Pnext;
switch( item->m_StructType )
switch( item->Type() )
{
case DRAW_JUNCTION_STRUCT_TYPE:
case DRAW_SEGMENT_STRUCT_TYPE:
@ -54,7 +54,7 @@ EDA_BaseStruct* SCH_SCREEN::ExtractWires( bool CreateCopy )
List = item;
if( CreateCopy )
{
if( item->m_StructType == DRAW_JUNCTION_STRUCT_TYPE )
if( item->Type() == DRAW_JUNCTION_STRUCT_TYPE )
new_item = ( (DrawJunctionStruct*) item )->GenCopy();
else
new_item = ( (EDA_DrawLineStruct*) item )->GenCopy();
@ -85,7 +85,7 @@ static void RestoreOldWires( SCH_SCREEN* screen )
{
next_item = item->Pnext;
switch( item->m_StructType )
switch( item->Type() )
{
case DRAW_JUNCTION_STRUCT_TYPE:
case DRAW_SEGMENT_STRUCT_TYPE:
@ -123,7 +123,7 @@ void WinEDA_SchematicFrame::BeginSegment( wxDC* DC, int type )
if( GetScreen()->GetCurItem() )
{
switch( GetScreen()->GetCurItem()->m_StructType )
switch( GetScreen()->GetCurItem()->Type() )
{
case DRAW_SEGMENT_STRUCT_TYPE:
case DRAW_POLYLINE_STRUCT_TYPE:
@ -337,7 +337,7 @@ void WinEDA_SchematicFrame::EndSegment( wxDC* DC )
EDA_BaseStruct* item = GetScreen()->EEDrawList;
while( item )
{
switch( item->m_StructType )
switch( item->Type() )
{
case DRAW_JUNCTION_STRUCT_TYPE:
case DRAW_SEGMENT_STRUCT_TYPE:
@ -510,7 +510,7 @@ void WinEDA_SchematicFrame::DeleteCurrentSegment( wxDC* DC )
}
/* Trace en cours: annulation */
if( GetScreen()->GetCurItem()->m_StructType == DRAW_POLYLINE_STRUCT_TYPE )
if( GetScreen()->GetCurItem()->Type() == DRAW_POLYLINE_STRUCT_TYPE )
{
Show_Polyline_in_Ghost( DrawPanel, DC, FALSE ); /* Effacement du trace en cours */
}
@ -622,7 +622,7 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
if( g_ItemToRepeat == NULL )
return;
switch( g_ItemToRepeat->m_StructType )
switch( g_ItemToRepeat->Type() )
{
case DRAW_JUNCTION_STRUCT_TYPE:
#undef STRUCT
@ -825,7 +825,7 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
return TRUE;
item = PickStruct( pos, screen->EEDrawList, LABELITEM );
if( item && (item->m_StructType != DRAW_TEXT_STRUCT_TYPE)
if( item && (item->Type() != DRAW_TEXT_STRUCT_TYPE)
&& ( ( (DrawGlobalLabelStruct*) item )->m_Pos.x == pos.x )
&& ( ( (DrawGlobalLabelStruct*) item )->m_Pos.y == pos.y ) )
return TRUE;

View File

@ -137,7 +137,7 @@ void WinEDA_SchematicFrame::SetBusEntryShape( wxDC* DC,
if( BusEntry == NULL )
return;
if( BusEntry->m_StructType != DRAW_BUSENTRY_STRUCT_TYPE )
if( BusEntry->Type() != DRAW_BUSENTRY_STRUCT_TYPE )
{
DisplayError( this, wxT( "SetBusEntryType: Bad StructType" ) );
return;

View File

@ -34,7 +34,7 @@
/***********************************************************/
DrawSheetStruct::DrawSheetStruct( const wxPoint& pos ) :
SCH_SCREEN( SCHEMATIC_FRAME )
SCH_SCREEN( DRAW_SHEET_STRUCT_TYPE )
/***********************************************************/
{
m_Label = NULL;
@ -42,8 +42,6 @@ DrawSheetStruct::DrawSheetStruct( const wxPoint& pos ) :
m_Layer = LAYER_SHEET;
m_Pos = pos;
m_SheetNameSize = m_FileNameSize = 60;
/* change the struct type: SCREEN_STRUCT_TYPE to DRAW_SHEET_STRUCT_TYPE */
m_StructType = DRAW_SHEET_STRUCT_TYPE;
}
@ -63,7 +61,7 @@ DrawSheetStruct::~DrawSheetStruct()
/***********************************************/
DrawSheetStruct* DrawSheetStruct::GenCopy( void )
DrawSheetStruct* DrawSheetStruct::GenCopy()
/***********************************************/
/* creates a copy of a sheet
@ -226,7 +224,7 @@ DrawSheetLabelStruct::DrawSheetLabelStruct( DrawSheetStruct* parent,
/***********************************************************/
DrawSheetLabelStruct* DrawSheetLabelStruct::GenCopy( void )
DrawSheetLabelStruct* DrawSheetLabelStruct::GenCopy()
/***********************************************************/
{
DrawSheetLabelStruct* newitem =

View File

@ -17,7 +17,7 @@
void SetStructFather( EDA_BaseStruct* Struct, BASE_SCREEN* Screen )
/******************************************************************/
{
switch( Struct->m_StructType )
switch( Struct->Type() )
{
case DRAW_POLYLINE_STRUCT_TYPE:
case DRAW_JUNCTION_STRUCT_TYPE:
@ -82,7 +82,8 @@ void EDA_BaseStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
static int table_zoom[] = { 1, 2, 4, 8, 16, 32, 64, 128, 0 }; /* Valeurs standards du zoom */
/* Constructeur de SCREEN */
SCH_SCREEN::SCH_SCREEN( int screentype ) : BASE_SCREEN( screentype )
SCH_SCREEN::SCH_SCREEN( int screentype, KICAD_T aType ) :
BASE_SCREEN( screentype, aType )
{
EEDrawList = NULL; /* Schematic items list */
m_Zoom = 32;
@ -94,7 +95,7 @@ SCH_SCREEN::SCH_SCREEN( int screentype ) : BASE_SCREEN( screentype )
/****************************/
SCH_SCREEN::~SCH_SCREEN( void )
SCH_SCREEN::~SCH_SCREEN()
/****************************/
{
ClearUndoRedoList();
@ -103,7 +104,7 @@ SCH_SCREEN::~SCH_SCREEN( void )
/***********************************/
void SCH_SCREEN::FreeDrawList( void )
void SCH_SCREEN::FreeDrawList()
/***********************************/
/* Routine to clear (free) EESchema drawing list of a screen.
@ -187,7 +188,7 @@ EDA_ScreenList::~EDA_ScreenList()
/*****************************************/
SCH_SCREEN* EDA_ScreenList::GetFirst( void )
SCH_SCREEN* EDA_ScreenList::GetFirst()
/*****************************************/
{
m_Index = 0;
@ -199,7 +200,7 @@ SCH_SCREEN* EDA_ScreenList::GetFirst( void )
/*****************************************/
SCH_SCREEN* EDA_ScreenList::GetNext( void )
SCH_SCREEN* EDA_ScreenList::GetNext()
/*****************************************/
{
if( m_Index < m_Count )
@ -231,7 +232,7 @@ SCH_SCREEN* EDA_ScreenList::GetScreen( int index )
/**************************************************/
void EDA_ScreenList::UpdateSheetNumberAndDate( void )
void EDA_ScreenList::UpdateSheetNumberAndDate()
/**************************************************/
/* Update the sheet number, the sheet count and the date for all sheets in list
@ -285,7 +286,7 @@ SCH_SCREEN** EDA_ScreenList::BuildScreenList( SCH_SCREEN** ScreenList,
CurrStruct = DrawStruct;
while( CurrStruct )
{
if( CurrStruct->m_StructType == DRAW_SHEET_STRUCT_TYPE )
if( CurrStruct->Type() == DRAW_SHEET_STRUCT_TYPE )
{
HasSubhierarchy = TRUE;
if( ScreenList )
@ -306,7 +307,7 @@ SCH_SCREEN** EDA_ScreenList::BuildScreenList( SCH_SCREEN** ScreenList,
CurrStruct = DrawStruct;
while( CurrStruct )
{
if( CurrStruct->m_StructType == DRAW_SHEET_STRUCT_TYPE )
if( CurrStruct->Type() == DRAW_SHEET_STRUCT_TYPE )
{
SCH_SCREEN* Screen = (SCH_SCREEN*) CurrStruct;

View File

@ -88,10 +88,10 @@ class DrawSheetStruct;
class SCH_SCREEN : public BASE_SCREEN
{
public:
SCH_SCREEN( int idtype );
SCH_SCREEN( int idtype, KICAD_T aType = SCREEN_STRUCT_TYPE );
~SCH_SCREEN();
void FreeDrawList( void ); // Free EESchema drawing list (does not delete the sub hierarchies)
void FreeDrawList(); // Free EESchema drawing list (does not delete the sub hierarchies)
void Place( WinEDA_DrawFrame* frame, wxDC* DC ) { };
void RemoveFromDrawList( EDA_BaseStruct* DrawStruct );/* remove DrawStruct from EEDrawList. */
@ -101,7 +101,7 @@ public:
EDA_BaseStruct* ExtractWires( bool CreateCopy );
/* full undo redo management : */
virtual void ClearUndoRedoList( void );
virtual void ClearUndoRedoList();
virtual void AddItemToUndoList( EDA_BaseStruct* item );
virtual void AddItemToRedoList( EDA_BaseStruct* item );
};
@ -119,10 +119,10 @@ public:
const wxPoint& pos = wxPoint( 0, 0 ),
const wxString& text = wxEmptyString );
~DrawSheetLabelStruct( void ) { }
DrawSheetLabelStruct* GenCopy( void );
~DrawSheetLabelStruct() { }
DrawSheetLabelStruct* GenCopy();
DrawSheetLabelStruct* Next( void )
DrawSheetLabelStruct* Next()
{ return (DrawSheetLabelStruct*) Pnext; }
void Place( WinEDA_DrawFrame* frame, wxDC* DC );
@ -147,9 +147,9 @@ public:
public:
DrawSheetStruct( const wxPoint& pos = wxPoint( 0, 0 ) );
~DrawSheetStruct( void );
~DrawSheetStruct();
void Place( WinEDA_DrawFrame* frame, wxDC* DC );
DrawSheetStruct* GenCopy( void );
DrawSheetStruct* GenCopy();
void Display_Infos( WinEDA_DrawFrame* frame );
void CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC );
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
@ -169,11 +169,11 @@ private:
public:
EDA_ScreenList( EDA_BaseStruct* DrawStruct );
~EDA_ScreenList();
int GetCount( void ) { return m_Count; }
SCH_SCREEN* GetFirst( void );
SCH_SCREEN* GetNext( void );
int GetCount() { return m_Count; }
SCH_SCREEN* GetFirst();
SCH_SCREEN* GetNext();
SCH_SCREEN* GetScreen( int index );
void UpdateSheetNumberAndDate( void );
void UpdateSheetNumberAndDate();
private:
SCH_SCREEN** BuildScreenList( SCH_SCREEN** ScreenList,

View File

@ -14,251 +14,286 @@
#include "protos.h"
/************************/
/* class DrawTextStruct */
/* class DrawLabelStruct */
/* class DrawGlobalLabelStruct */
/************************/
/************************/
/* class DrawTextStruct */
/* class DrawLabelStruct */
/* class DrawGlobalLabelStruct */
/************************/
/**************************************************************************/
DrawTextStruct::DrawTextStruct(const wxPoint & pos, const wxString & text):
EDA_BaseStruct(DRAW_TEXT_STRUCT_TYPE),
EDA_TextStruct(text)
DrawTextStruct::DrawTextStruct( const wxPoint& pos, const wxString& text, KICAD_T aType ) :
EDA_BaseStruct( aType ),
EDA_TextStruct( text )
/**************************************************************************/
{
m_Layer = LAYER_NOTES;
m_Pos = pos;
m_Shape = 0;
m_IsDangling = FALSE;
m_Layer = LAYER_NOTES;
m_Pos = pos;
m_Shape = 0;
m_IsDangling = FALSE;
}
/*********************************************/
DrawTextStruct * DrawTextStruct::GenCopy(void)
DrawTextStruct* DrawTextStruct::GenCopy()
/*********************************************/
{
DrawTextStruct * newitem = new DrawTextStruct(m_Pos, m_Text);
DrawTextStruct* newitem;
switch( Type() )
{
case DRAW_TEXT_STRUCT_TYPE:
newitem = new DrawTextStruct( m_Pos, m_Text );
break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
newitem = new DrawGlobalLabelStruct( m_Pos, m_Text );
break;
case DRAW_LABEL_STRUCT_TYPE:
newitem = new DrawLabelStruct( m_Pos, m_Text );
break;
default:
newitem = 0; // will crash below
}
newitem->m_StructType = m_StructType;
newitem->m_Layer = m_Layer;
newitem->m_Shape = m_Shape;
newitem->m_Orient = m_Orient;
newitem->m_Size = m_Size;
newitem->m_Width = m_Width;
newitem->m_HJustify = m_HJustify;
newitem->m_VJustify = m_VJustify;
newitem->m_IsDangling = m_IsDangling ;
newitem->m_Layer = m_Layer;
newitem->m_Shape = m_Shape;
newitem->m_Orient = m_Orient;
newitem->m_Size = m_Size;
newitem->m_Width = m_Width;
newitem->m_HJustify = m_HJustify;
newitem->m_VJustify = m_VJustify;
newitem->m_IsDangling = m_IsDangling;
return newitem;
return newitem;
}
/********************************************************/
void DrawTextStruct::SwapData(DrawTextStruct * copyitem)
void DrawTextStruct::SwapData( DrawTextStruct* copyitem )
/********************************************************/
{
EXCHG(m_Text, copyitem->m_Text);
EXCHG(m_Pos, copyitem->m_Pos);
EXCHG(m_Size, copyitem->m_Size);
EXCHG(m_Width, copyitem->m_Width);
EXCHG(m_Shape, copyitem->m_Shape);
EXCHG(m_Orient, copyitem->m_Orient);
EXCHG(m_StructType, copyitem->m_StructType);
EXCHG(m_Layer, copyitem->m_Layer);
EXCHG(m_HJustify, copyitem->m_HJustify);
EXCHG(m_VJustify, copyitem->m_VJustify);
EXCHG(m_IsDangling, copyitem->m_IsDangling);
EXCHG( m_Text, copyitem->m_Text );
EXCHG( m_Pos, copyitem->m_Pos );
EXCHG( m_Size, copyitem->m_Size );
EXCHG( m_Width, copyitem->m_Width );
EXCHG( m_Shape, copyitem->m_Shape );
EXCHG( m_Orient, copyitem->m_Orient );
// EXCHG( m_StructType, copyitem->m_StructType );
// how can you swap a type, it is what it was created as!
// this is a very bad usage of m_StructType.
KICAD_T aType = copyitem->Type();
copyitem->SetType( Type() );
SetType( aType );
EXCHG( m_Layer, copyitem->m_Layer );
EXCHG( m_HJustify, copyitem->m_HJustify );
EXCHG( m_VJustify, copyitem->m_VJustify );
EXCHG( m_IsDangling, copyitem->m_IsDangling );
}
/***************************************************************/
void DrawTextStruct::Place(WinEDA_DrawFrame * frame, wxDC * DC)
void DrawTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
/***************************************************************/
{
/* save old text in undo list */
if ( g_ItemToUndoCopy && ((m_Flags & IS_NEW) == 0) )
{
/* restore old values and save new ones */
SwapData( (DrawTextStruct*)g_ItemToUndoCopy);
/* save in undo list */
((WinEDA_SchematicFrame*)frame)->SaveCopyInUndoList(this, IS_CHANGED);
/* restore new values */
SwapData((DrawTextStruct*)g_ItemToUndoCopy);
delete g_ItemToUndoCopy;
g_ItemToUndoCopy = NULL;
}
EDA_BaseStruct::Place(frame, DC);
/* save old text in undo list */
if( g_ItemToUndoCopy && ( (m_Flags & IS_NEW) == 0 ) )
{
/* restore old values and save new ones */
SwapData( (DrawTextStruct*) g_ItemToUndoCopy );
/* save in undo list */
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED );
/* restore new values */
SwapData( (DrawTextStruct*) g_ItemToUndoCopy );
delete g_ItemToUndoCopy;
g_ItemToUndoCopy = NULL;
}
EDA_BaseStruct::Place( frame, DC );
}
/****************************************************************************/
DrawLabelStruct::DrawLabelStruct(const wxPoint & pos, const wxString & text):
DrawTextStruct(pos, text)
DrawLabelStruct::DrawLabelStruct( const wxPoint& pos, const wxString& text ) :
DrawTextStruct( pos, text, DRAW_LABEL_STRUCT_TYPE )
/****************************************************************************/
{
m_StructType = DRAW_LABEL_STRUCT_TYPE;
m_Layer = LAYER_LOCLABEL;
m_IsDangling = TRUE;
m_Layer = LAYER_LOCLABEL;
m_IsDangling = TRUE;
}
/***********************************************************************************/
DrawGlobalLabelStruct::DrawGlobalLabelStruct(const wxPoint & pos, const wxString & text):
DrawTextStruct(pos, text)
DrawGlobalLabelStruct::DrawGlobalLabelStruct( const wxPoint& pos, const wxString& text ) :
DrawTextStruct( pos, text, DRAW_GLOBAL_LABEL_STRUCT_TYPE )
/***********************************************************************************/
{
m_StructType = DRAW_GLOBAL_LABEL_STRUCT_TYPE;
m_Layer = LAYER_GLOBLABEL;
m_Shape = NET_INPUT;
m_IsDangling = TRUE;
m_Layer = LAYER_GLOBLABEL;
m_Shape = NET_INPUT;
m_IsDangling = TRUE;
}
/***************************************************************/
void DrawTextStruct::Draw(WinEDA_DrawPanel * panel,wxDC * DC, const wxPoint & offset,
int DrawMode, int Color)
void DrawTextStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int DrawMode, int Color )
/***************************************************************/
/* Les textes type label ou notes peuvent avoir 4 directions, mais
sont tj cadres par rapport a la 1ere lettre du texte
*/
* sont tj cadres par rapport a la 1ere lettre du texte
*/
{
switch ( m_StructType )
{
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
DrawAsGlobalLabel(panel, DC, offset, DrawMode, Color);
break;
switch( Type() )
{
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
DrawAsGlobalLabel( panel, DC, offset, DrawMode, Color );
break;
case DRAW_LABEL_STRUCT_TYPE:
DrawAsLabel(panel, DC, offset, DrawMode, Color);
break;
case DRAW_LABEL_STRUCT_TYPE:
DrawAsLabel( panel, DC, offset, DrawMode, Color );
break;
default:
DrawAsText(panel, DC, offset, DrawMode, Color);
}
default:
DrawAsText( panel, DC, offset, DrawMode, Color );
}
}
/*******************************************************************************************/
void DrawTextStruct::DrawAsText(WinEDA_DrawPanel * panel,wxDC * DC, const wxPoint & offset,
int DrawMode, int Color)
void DrawTextStruct::DrawAsText( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int DrawMode, int Color )
/*******************************************************************************************/
/* Texts type Label or Comment (text on layer "NOTE") have 4 directions, and the Text origin is the first letter
*/
*/
{
int color;
int width = MAX(m_Width, g_DrawMinimunLineWidth);
if( Color >= 0 ) color = Color;
else color = ReturnLayerColor(m_Layer);
GRSetDrawMode(DC, DrawMode);
int color;
int width = MAX( m_Width, g_DrawMinimunLineWidth );
switch(m_Orient)
{
case 0: /* Orientation horiz normale */
DrawGraphicText(panel, DC,
wxPoint(m_Pos.x + offset.x, m_Pos.y - TXTMARGE + offset.y),
color,
m_Text, m_Orient*900, m_Size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM, width);
break;
if( Color >= 0 )
color = Color;
else
color = ReturnLayerColor( m_Layer );
GRSetDrawMode( DC, DrawMode );
case 1: /* Orientation vert UP */
DrawGraphicText(panel, DC,
wxPoint(m_Pos.x - TXTMARGE + offset.x, m_Pos.y + offset.y), color,
m_Text, m_Orient*900, m_Size,
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_BOTTOM, width);
break;
switch( m_Orient )
{
case 0: /* Orientation horiz normale */
DrawGraphicText( panel, DC,
wxPoint( m_Pos.x + offset.x, m_Pos.y - TXTMARGE + offset.y ),
color,
m_Text, m_Orient * 900, m_Size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM, width );
break;
case 2: /* Orientation horiz inverse */
DrawGraphicText(panel, DC,
wxPoint(m_Pos.x + offset.x, m_Pos.y + TXTMARGE + offset.y), color,
m_Text, m_Orient*900, m_Size,
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_TOP, width);
break;
case 1: /* Orientation vert UP */
DrawGraphicText( panel, DC,
wxPoint( m_Pos.x - TXTMARGE + offset.x, m_Pos.y + offset.y ), color,
m_Text, m_Orient * 900, m_Size,
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_BOTTOM, width );
break;
case 3: /* Orientation vert BOTTOM */
DrawGraphicText(panel, DC,
wxPoint(m_Pos.x + TXTMARGE + offset.y, m_Pos.y + offset.y), color,
m_Text, m_Orient*900, m_Size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_TOP, width);
break;
}
if ( m_IsDangling )
DrawDanglingSymbol(panel, DC, m_Pos + offset, color);
case 2: /* Orientation horiz inverse */
DrawGraphicText( panel, DC,
wxPoint( m_Pos.x + offset.x, m_Pos.y + TXTMARGE + offset.y ), color,
m_Text, m_Orient * 900, m_Size,
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_TOP, width );
break;
case 3: /* Orientation vert BOTTOM */
DrawGraphicText( panel, DC,
wxPoint( m_Pos.x + TXTMARGE + offset.y, m_Pos.y + offset.y ), color,
m_Text, m_Orient * 900, m_Size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_TOP, width );
break;
}
if( m_IsDangling )
DrawDanglingSymbol( panel, DC, m_Pos + offset, color );
}
/***************************************************************/
void DrawTextStruct::DrawAsLabel(WinEDA_DrawPanel * panel,wxDC * DC, const wxPoint & offset,
int DrawMode, int Color)
void DrawTextStruct::DrawAsLabel( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int DrawMode, int Color )
/***************************************************************/
{
DrawAsText(panel, DC, offset, DrawMode, Color);
DrawAsText( panel, DC, offset, DrawMode, Color );
}
/*****************************************************************************/
void DrawTextStruct::DrawAsGlobalLabel(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint& offset,
int DrawMode, int Color)
void DrawTextStruct::DrawAsGlobalLabel( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int DrawMode, int Color )
/*****************************************************************************/
/* Texts type Global Label have 4 directions, and the Text origin is the graphic icon
*/
*/
{
int * Template;
int Poly[12];
int ii, jj, imax, color, HalfSize;
wxSize Size = m_Size;
int width = MAX(m_Width, g_DrawMinimunLineWidth);
int* Template;
int Poly[12];
int ii, jj, imax, color, HalfSize;
wxSize Size = m_Size;
int width = MAX( m_Width, g_DrawMinimunLineWidth );
if( Color >= 0 ) color = Color;
else color = ReturnLayerColor(m_Layer);
if( Color >= 0 )
color = Color;
else
color = ReturnLayerColor( m_Layer );
GRSetDrawMode(DC, DrawMode);
GRSetDrawMode( DC, DrawMode );
HalfSize = Size.x / 2; ii = Size.x + TXTMARGE;
HalfSize = Size.x / 2; ii = Size.x + TXTMARGE;
switch(m_Orient)
{
case 0: /* Orientation horiz normale */
DrawGraphicText(panel, DC,
wxPoint(m_Pos.x - ii + offset.x, m_Pos.y + offset.y), color,
m_Text, TEXT_ORIENT_HORIZ, Size,
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER, width);
break;
switch( m_Orient )
{
case 0: /* Orientation horiz normale */
DrawGraphicText( panel, DC,
wxPoint( m_Pos.x - ii + offset.x, m_Pos.y + offset.y ), color,
m_Text, TEXT_ORIENT_HORIZ, Size,
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER, width );
break;
case 1: /* Orientation vert UP */
DrawGraphicText(panel, DC,
wxPoint(m_Pos.x + offset.x, m_Pos.y + ii + offset.y), color,
m_Text, TEXT_ORIENT_VERT, Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, width);
break;
case 1: /* Orientation vert UP */
DrawGraphicText( panel, DC,
wxPoint( m_Pos.x + offset.x, m_Pos.y + ii + offset.y ), color,
m_Text, TEXT_ORIENT_VERT, Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, width );
break;
case 2: /* Orientation horiz inverse */
DrawGraphicText(panel, DC,
wxPoint(m_Pos.x + ii + offset.x, m_Pos.y + offset.y), color,
m_Text, TEXT_ORIENT_HORIZ, Size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width);
break;
case 2: /* Orientation horiz inverse */
DrawGraphicText( panel, DC,
wxPoint( m_Pos.x + ii + offset.x, m_Pos.y + offset.y ), color,
m_Text, TEXT_ORIENT_HORIZ, Size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width );
break;
case 3: /* Orientation vert BOTTOM */
DrawGraphicText(panel, DC,
wxPoint(m_Pos.x + offset.x, m_Pos.y - ii + offset.y), color,
m_Text, TEXT_ORIENT_VERT, Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, width);
break;
}
case 3: /* Orientation vert BOTTOM */
DrawGraphicText( panel, DC,
wxPoint( m_Pos.x + offset.x, m_Pos.y - ii + offset.y ), color,
m_Text, TEXT_ORIENT_VERT, Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, width );
break;
}
Template = TemplateShape[m_Shape][m_Orient];
Template = TemplateShape[m_Shape][m_Orient];
imax = *Template; Template++;
for ( ii = 0, jj = 0; ii < imax ; ii++ )
{
Poly[jj] = ( HalfSize * (*Template) ) + m_Pos.x + offset.x;
jj++; Template++;
Poly[jj] = ( HalfSize * (*Template) ) + m_Pos.y + offset.y;
jj++; Template++;
}
imax = *Template; Template++;
for( ii = 0, jj = 0; ii < imax; ii++ )
{
Poly[jj] = ( HalfSize * (*Template) ) + m_Pos.x + offset.x;
jj++; Template++;
Poly[jj] = ( HalfSize * (*Template) ) + m_Pos.y + offset.y;
jj++; Template++;
}
// GRPoly(&panel->m_ClipBox, DC, imax,Poly,1, width, color, color ); /* Polygne Rempli */
GRPoly(&panel->m_ClipBox, DC, imax,Poly,0, width, color, color ); /* Polygne Non Rempli */
GRPoly( &panel->m_ClipBox, DC, imax, Poly, 0, width, color, color ); /* Polygne Non Rempli */
if ( m_IsDangling )
DrawDanglingSymbol(panel, DC, m_Pos + offset, color);
if( m_IsDangling )
DrawDanglingSymbol( panel, DC, m_Pos + offset, color );
}

View File

@ -35,12 +35,12 @@ bool Modify = FALSE;
DrawList = EEDrawList;
for ( ;DrawList != NULL; DrawList = DrawList->Pnext )
{
if( DrawList->m_StructType == DRAW_SEGMENT_STRUCT_TYPE )
if( DrawList->Type() == DRAW_SEGMENT_STRUCT_TYPE )
{
TstDrawList = DrawList->Pnext;
while ( TstDrawList )
{
if( TstDrawList->m_StructType == DRAW_SEGMENT_STRUCT_TYPE )
if( TstDrawList->Type() == DRAW_SEGMENT_STRUCT_TYPE )
{
flag = TstAlignSegment( (EDA_DrawLineStruct*)DrawList,
(EDA_DrawLineStruct*)TstDrawList);
@ -82,7 +82,7 @@ EDA_BaseStruct *DrawList;
DrawList = Screen->EEDrawList;
while ( DrawList )
{
switch( DrawList->m_StructType )
switch( DrawList->Type() )
{
case DRAW_JUNCTION_STRUCT_TYPE :
#undef STRUCT
@ -136,7 +136,7 @@ DrawPickedStruct * List = NULL;
DrawList = screen->EEDrawList;
while ( DrawList )
{
switch( DrawList->m_StructType )
switch( DrawList->Type() )
{
case DRAW_SEGMENT_STRUCT_TYPE :
segment = (EDA_DrawLineStruct*)DrawList;

View File

@ -37,7 +37,7 @@ DrawBusEntryStruct::DrawBusEntryStruct( const wxPoint& pos, int shape, int id )
/*************************************/
wxPoint DrawBusEntryStruct::m_End( void )
wxPoint DrawBusEntryStruct::m_End()
/*************************************/
// retourne la coord de fin du raccord
@ -47,7 +47,7 @@ wxPoint DrawBusEntryStruct::m_End( void )
/***************************************************/
DrawBusEntryStruct* DrawBusEntryStruct::GenCopy( void )
DrawBusEntryStruct* DrawBusEntryStruct::GenCopy()
/***************************************************/
{
DrawBusEntryStruct* newitem = new DrawBusEntryStruct( m_Pos, 0, 0 );
@ -75,7 +75,7 @@ DrawJunctionStruct::DrawJunctionStruct( const wxPoint& pos ) :
}
DrawJunctionStruct* DrawJunctionStruct::GenCopy( void )
DrawJunctionStruct* DrawJunctionStruct::GenCopy()
{
DrawJunctionStruct* newitem = new DrawJunctionStruct( m_Pos );
@ -97,7 +97,7 @@ DrawNoConnectStruct::DrawNoConnectStruct( const wxPoint& pos ) :
}
DrawNoConnectStruct* DrawNoConnectStruct::GenCopy( void )
DrawNoConnectStruct* DrawNoConnectStruct::GenCopy()
{
DrawNoConnectStruct* newitem = new DrawNoConnectStruct( m_Pos );
@ -121,12 +121,12 @@ DrawMarkerStruct::DrawMarkerStruct( const wxPoint& pos, const wxString& text ) :
}
DrawMarkerStruct::~DrawMarkerStruct( void )
DrawMarkerStruct::~DrawMarkerStruct()
{
}
DrawMarkerStruct* DrawMarkerStruct::GenCopy( void )
DrawMarkerStruct* DrawMarkerStruct::GenCopy()
{
DrawMarkerStruct* newitem = new DrawMarkerStruct( m_Pos, m_Comment );
@ -137,7 +137,7 @@ DrawMarkerStruct* DrawMarkerStruct::GenCopy( void )
}
wxString DrawMarkerStruct::GetComment( void )
wxString DrawMarkerStruct::GetComment()
{
return m_Comment;
}
@ -175,7 +175,7 @@ EDA_DrawLineStruct::EDA_DrawLineStruct( const wxPoint& pos, int layer ) :
/***************************************************/
EDA_DrawLineStruct* EDA_DrawLineStruct::GenCopy( void )
EDA_DrawLineStruct* EDA_DrawLineStruct::GenCopy()
/***************************************************/
{
EDA_DrawLineStruct* newitem = new EDA_DrawLineStruct( m_Start, m_Layer );
@ -234,7 +234,7 @@ DrawPolylineStruct::DrawPolylineStruct( int layer ) :
/********************************************/
DrawPolylineStruct::~DrawPolylineStruct( void )
DrawPolylineStruct::~DrawPolylineStruct()
/*********************************************/
{
if( m_Points )
@ -243,7 +243,7 @@ DrawPolylineStruct::~DrawPolylineStruct( void )
/*****************************************************/
DrawPolylineStruct* DrawPolylineStruct::GenCopy( void )
DrawPolylineStruct* DrawPolylineStruct::GenCopy()
/*****************************************************/
{
int memsize;

View File

@ -109,7 +109,7 @@ int ii;
/**********************************************************************/
EDA_Rect EDA_SchComponentStruct::GetBoundaryBox( void )
EDA_Rect EDA_SchComponentStruct::GetBoundaryBox()
/**********************************************************************/
{
EDA_LibComponentStruct * Entry = FindLibPart(m_ChipName.GetData(), wxEmptyString, FIND_ROOT);
@ -203,7 +203,7 @@ void EDA_SchComponentStruct::Place(WinEDA_DrawFrame * frame, wxDC * DC)
{
/* save old text in undo list */
if ( g_ItemToUndoCopy &&
(g_ItemToUndoCopy->m_StructType == m_StructType) &&
(g_ItemToUndoCopy->Type() == Type()) &&
((m_Flags & IS_NEW) == 0) )
{
/* restore old values and save new ones */

Some files were not shown because too many files have changed in this diff Show More