Commit f3c324d5 authored by dickelbeck's avatar dickelbeck

EDA_BaseStruct::m_StructType is now type KICAD_T

parent 908f6d93
...@@ -25,8 +25,8 @@ S3D_Vertex::S3D_Vertex(void) ...@@ -25,8 +25,8 @@ S3D_Vertex::S3D_Vertex(void)
/**************************************************************************/ /**************************************************************************/
S3D_Material::S3D_Material(Struct3D_Master * father, const wxString & name): S3D_Material::S3D_Material( Struct3D_Master * father, const wxString & name ):
EDA_BaseStruct( father, -1) EDA_BaseStruct( father, NOT_USED )
/**************************************************************************/ /**************************************************************************/
{ {
m_DiffuseColor.x = m_DiffuseColor.y = m_DiffuseColor.z = 1.0; m_DiffuseColor.x = m_DiffuseColor.y = m_DiffuseColor.z = 1.0;
...@@ -67,7 +67,7 @@ void Struct3D_Master::Copy(Struct3D_Master * pattern) ...@@ -67,7 +67,7 @@ void Struct3D_Master::Copy(Struct3D_Master * pattern)
/***************************************************************/ /***************************************************************/
Struct3D_Master::Struct3D_Master(EDA_BaseStruct * StructFather): Struct3D_Master::Struct3D_Master(EDA_BaseStruct * StructFather):
EDA_BaseStruct( StructFather, -1) EDA_BaseStruct( StructFather, NOT_USED )
/***************************************************************/ /***************************************************************/
{ {
m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0; m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0;
...@@ -100,7 +100,7 @@ S3D_Material * nextmat; ...@@ -100,7 +100,7 @@ S3D_Material * nextmat;
/***************************************************************/ /***************************************************************/
Struct3D_Shape::Struct3D_Shape(EDA_BaseStruct * StructFather): Struct3D_Shape::Struct3D_Shape(EDA_BaseStruct * StructFather):
EDA_BaseStruct( StructFather, -1) EDA_BaseStruct( StructFather, NOT_USED )
/***************************************************************/ /***************************************************************/
{ {
m_3D_Coord = NULL; m_3D_Coord = NULL;
......
...@@ -5,6 +5,18 @@ Please add newer entries at the top, list the date and your name with ...@@ -5,6 +5,18 @@ Please add newer entries at the top, list the date and your name with
email address. email address.
2007-Aug-23 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+ eeschema & pcbnew
* Removed class EDA_BaseLineStruct, which brought no behavioral advantage, only data.
Classes which were based on got its data members added and their initializers.
* Changed type of EDA_BaseStruct::m_StructType from int to KICAD_T which is an
enum. This makes debugging easier since gdb will show the name of the
KICAD_T rather than simply a number. Added NOT_USED = -1 to KICAD_T enum for
3d which was using -1.
* More beautification using latest uncrustify and the committed uncrustify.cfg
2007-Aug-24 UPDATE Geoff Harland <gharlandau@yahoo.com.au> 2007-Aug-24 UPDATE Geoff Harland <gharlandau@yahoo.com.au>
================================================================================ ================================================================================
+ pcbnew + pcbnew
...@@ -27,9 +39,6 @@ email address. ...@@ -27,9 +39,6 @@ email address.
tomorrow I will add a new class COLLECTORS_GUIDE which can be used by a tomorrow I will add a new class COLLECTORS_GUIDE which can be used by a
COLLECTOR to control its operation. It adds the concept of layer COLLECTOR to control its operation. It adds the concept of layer
locking, even though PCBNEW does not support that in the UI yet. locking, even though PCBNEW does not support that in the UI yet.
@todo:
add constructor initializers for classes that were derived from
EDA_BaseLineStruct but are now not. Its late, will do tomorrow.
2007-Aug-22 UPDATE Dick Hollenbeck <dick@softplc.com> 2007-Aug-22 UPDATE Dick Hollenbeck <dick@softplc.com>
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
#include "macros.h" #include "macros.h"
// DrawStructureType names for error messages only: // KICAD_T names for error messages only:
static wxString DrawStructureTypeName[MAX_STRUCT_TYPE_ID + 1] = { static wxString KICAD_TName[MAX_STRUCT_TYPE_ID + 1] = {
wxT( "Not init" ), wxT( "Not init" ),
wxT( "Pcb" ), wxT( "Pcb" ),
...@@ -74,7 +74,7 @@ enum textbox { ...@@ -74,7 +74,7 @@ enum textbox {
/******************************************************************************/ /******************************************************************************/
EDA_BaseStruct::EDA_BaseStruct( EDA_BaseStruct* parent, int idType ) EDA_BaseStruct::EDA_BaseStruct( EDA_BaseStruct* parent, KICAD_T idType )
/******************************************************************************/ /******************************************************************************/
{ {
InitVars(); InitVars();
...@@ -84,7 +84,7 @@ EDA_BaseStruct::EDA_BaseStruct( EDA_BaseStruct* parent, int idType ) ...@@ -84,7 +84,7 @@ EDA_BaseStruct::EDA_BaseStruct( EDA_BaseStruct* parent, int idType )
/********************************************/ /********************************************/
EDA_BaseStruct::EDA_BaseStruct( int idType ) EDA_BaseStruct::EDA_BaseStruct( KICAD_T idType )
/********************************************/ /********************************************/
{ {
InitVars(); InitVars();
...@@ -183,7 +183,7 @@ wxString EDA_BaseStruct::ReturnClassName() const ...@@ -183,7 +183,7 @@ wxString EDA_BaseStruct::ReturnClassName() const
if( (ii < 0) || (ii > MAX_STRUCT_TYPE_ID) ) if( (ii < 0) || (ii > MAX_STRUCT_TYPE_ID) )
ii = MAX_STRUCT_TYPE_ID; ii = MAX_STRUCT_TYPE_ID;
classname = DrawStructureTypeName[ii]; classname = KICAD_TName[ii];
return classname; return classname;
} }
...@@ -287,16 +287,6 @@ std::ostream& EDA_BaseStruct::NestedSpace( int nestLevel, std::ostream& os ) ...@@ -287,16 +287,6 @@ std::ostream& EDA_BaseStruct::NestedSpace( int nestLevel, std::ostream& os )
/**********************************************************************************************/
EDA_BaseLineStruct::EDA_BaseLineStruct( EDA_BaseStruct* StructFather, DrawStructureType idtype ) :
EDA_BaseStruct( StructFather, idtype )
/**********************************************************************************************/
{
m_Layer = 0;
m_Width = 0; // 0 = line, > 0 = tracks, bus ...
};
/*********************************************************/ /*********************************************************/
/* EDA_TextStruct (classe de base, non utilis� seule */ /* EDA_TextStruct (classe de base, non utilis� seule */
/*********************************************************/ /*********************************************************/
......
/**********************************************************/ /**********************************************************/
/* Routines d'affichage de parametres et caracteristiques */ /* Routines d'affichage de parametres et caracteristiques */
/**********************************************************/ /**********************************************************/
/* Fichier AFFICHE.CPP */ /* Fichier AFFICHE.CPP */
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
...@@ -15,136 +15,175 @@ ...@@ -15,136 +15,175 @@
/***********************************************************/ /***********************************************************/
void DrawSheetStruct::Display_Infos(WinEDA_DrawFrame * frame) void DrawSheetStruct::Display_Infos( WinEDA_DrawFrame* frame )
/************************************************************/ /************************************************************/
{ {
frame->MsgPanel->EraseMsgBox(); frame->MsgPanel->EraseMsgBox();
Affiche_1_Parametre(frame, 1, _("Name"), m_SheetName, CYAN); Affiche_1_Parametre( frame, 1, _( "Name" ), m_SheetName, CYAN );
Affiche_1_Parametre(frame, 30, _("FileName"), m_FileName, BROWN); Affiche_1_Parametre( frame, 30, _( "FileName" ), m_FileName, BROWN );
} }
/***************************************************************/ /***************************************************************/
void EDA_SchComponentStruct::Display_Infos(WinEDA_DrawFrame * frame) void EDA_SchComponentStruct::Display_Infos( WinEDA_DrawFrame* frame )
/***************************************************************/ /***************************************************************/
{ {
EDA_LibComponentStruct * Entry = FindLibPart(m_ChipName.GetData(),wxEmptyString,FIND_ROOT);; EDA_LibComponentStruct* Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT );;
wxString msg;
wxString msg;
frame->MsgPanel->EraseMsgBox(); frame->MsgPanel->EraseMsgBox();
Affiche_1_Parametre(frame, 1, _("Ref"), Affiche_1_Parametre( frame, 1, _( "Ref" ),
m_Field[REFERENCE].m_Text, DARKCYAN); m_Field[REFERENCE].m_Text, DARKCYAN );
if (Entry && Entry->m_Options == ENTRY_POWER) if( Entry && Entry->m_Options == ENTRY_POWER )
msg = _("Pwr Symb"); msg = _( "Pwr Symb" );
else msg = _("Val"); else
Affiche_1_Parametre(frame, 10, msg, m_Field[VALUE].m_Text, DARKCYAN); msg = _( "Val" );
Affiche_1_Parametre( frame, 10, msg, m_Field[VALUE].m_Text, DARKCYAN );
Affiche_1_Parametre(frame, 28, _("RefLib"), m_ChipName.GetData(), BROWN); Affiche_1_Parametre( frame, 28, _( "RefLib" ), m_ChipName.GetData(), BROWN );
msg = FindLibName; msg = FindLibName;
Affiche_1_Parametre(frame, 40, _("Lib"), msg, DARKRED); Affiche_1_Parametre( frame, 40, _( "Lib" ), msg, DARKRED );
if( Entry ) if( Entry )
{ {
Affiche_1_Parametre(frame, 52, Entry->m_Doc, wxEmptyString, DARKCYAN); Affiche_1_Parametre( frame, 52, Entry->m_Doc, wxEmptyString, DARKCYAN );
Affiche_1_Parametre(frame, 52, wxEmptyString, Entry->m_KeyWord, DARKGREEN); Affiche_1_Parametre( frame, 52, wxEmptyString, Entry->m_KeyWord, DARKGREEN );
} }
} }
/*******************************************************/ /*******************************************************/
void LibDrawPin::Display_Infos(WinEDA_DrawFrame * frame) void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame )
/*******************************************************/ /*******************************************************/
/* Affiche en bas d'ecran les caracteristiques de la pin /* Affiche en bas d'ecran les caracteristiques de la pin
*/ */
{ {
wxString Text; wxString Text;
int ii; int ii;
frame->MsgPanel->EraseMsgBox(); frame->MsgPanel->EraseMsgBox();
/* Affichage du nom */ /* Affichage du nom */
Affiche_1_Parametre(frame, 24, _("PinName"), m_PinName, DARKCYAN); Affiche_1_Parametre( frame, 24, _( "PinName" ), m_PinName, DARKCYAN );
/* Affichage du numero */ /* Affichage du numero */
if(m_PinNum == 0) Text = wxT("?" ); if( m_PinNum == 0 )
else ReturnPinStringNum(Text); Text = wxT( "?" );
else
ReturnPinStringNum( Text );
Affiche_1_Parametre(frame, 40, _("PinNum"), Text, DARKCYAN); Affiche_1_Parametre( frame, 40, _( "PinNum" ), Text, DARKCYAN );
/* Affichage du type */ /* Affichage du type */
ii = m_PinType; ii = m_PinType;
Affiche_1_Parametre(frame, 48, _("PinType"), MsgPinElectricType[ii], RED); Affiche_1_Parametre( frame, 48, _( "PinType" ), MsgPinElectricType[ii], RED );
/* Affichage de la visiblite */ /* Affichage de la visiblite */
ii = m_Attributs; ii = m_Attributs;
if( ii & 1 ) Text = _("no"); if( ii & 1 )
else Text = _("yes"); Text = _( "no" );
Affiche_1_Parametre(frame, 58, _("Display"), Text, DARKGREEN); else
Text = _( "yes" );
Affiche_1_Parametre( frame, 58, _( "Display" ), Text, DARKGREEN );
/* Affichage de la longueur */ /* Affichage de la longueur */
Text.Printf( wxT("%d"), m_PinLen); Text.Printf( wxT( "%d" ), m_PinLen );
Affiche_1_Parametre(frame, 66, _("Lengh"), Text, MAGENTA); Affiche_1_Parametre( frame, 66, _( "Lengh" ), Text, MAGENTA );
/* Affichage de l'orientation */ /* Affichage de l'orientation */
switch(m_Orient) switch( m_Orient )
{ {
case PIN_UP: Text = _("Up"); break; case PIN_UP:
case PIN_DOWN: Text = _("Down"); break; Text = _( "Up" ); break;
case PIN_LEFT: Text = _("Left"); break;
case PIN_RIGHT: Text = _("Right"); break; case PIN_DOWN:
default: Text = wxT("??"); break; Text = _( "Down" ); break;
case PIN_LEFT:
Text = _( "Left" ); break;
case PIN_RIGHT:
Text = _( "Right" ); break;
default:
Text = wxT( "??" ); break;
} }
Affiche_1_Parametre(frame, 72, _("Orient"), Text, MAGENTA); Affiche_1_Parametre( frame, 72, _( "Orient" ), Text, MAGENTA );
} }
/***********************************************************************/ /***********************************************************************/
void LibEDA_BaseStruct::Display_Infos_DrawEntry(WinEDA_DrawFrame * frame) void LibEDA_BaseStruct::Display_Infos_DrawEntry( WinEDA_DrawFrame* frame )
/***********************************************************************/ /***********************************************************************/
/* Affiche en bas d'ecran les caracteristiques de l'element /* Affiche en bas d'ecran les caracteristiques de l'element
*/ */
{ {
wxString msg; wxString msg;
frame->MsgPanel->EraseMsgBox(); frame->MsgPanel->EraseMsgBox();
/* affichage du type */ /* affichage du type */
msg = wxT("??"); msg = wxT( "??" );
switch( m_StructType ) switch( m_StructType )
{ {
case COMPONENT_ARC_DRAW_TYPE: msg = wxT("Arc"); break; case COMPONENT_ARC_DRAW_TYPE:
case COMPONENT_CIRCLE_DRAW_TYPE: msg = wxT("Circle"); break; msg = wxT( "Arc" ); break;
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE: msg = wxT("Text"); break;
case COMPONENT_RECT_DRAW_TYPE: msg = wxT("Rect"); break; case COMPONENT_CIRCLE_DRAW_TYPE:
case COMPONENT_POLYLINE_DRAW_TYPE: msg = wxT("PolyLine"); break; msg = wxT( "Circle" ); break;
case COMPONENT_LINE_DRAW_TYPE: msg = wxT("Segment"); break;
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
msg = wxT( "Text" ); break;
case COMPONENT_RECT_DRAW_TYPE:
msg = wxT( "Rect" ); break;
case COMPONENT_POLYLINE_DRAW_TYPE:
msg = wxT( "PolyLine" ); break;
case COMPONENT_LINE_DRAW_TYPE:
msg = wxT( "Segment" ); break;
case COMPONENT_PIN_DRAW_TYPE: case COMPONENT_PIN_DRAW_TYPE:
((LibDrawPin*) this)->Display_Infos(frame); ( (LibDrawPin*) this )->Display_Infos( frame );
msg = wxT("Pin"); msg = wxT( "Pin" );
break; break;
default:
;
} }
Affiche_1_Parametre(frame, 1, wxT("Type"), msg, CYAN); Affiche_1_Parametre( frame, 1, wxT( "Type" ), msg, CYAN );
/* Affichage de l'appartenance */ /* Affichage de l'appartenance */
if( m_Unit == 0 ) msg = _("All"); if( m_Unit == 0 )
else msg.Printf( wxT("%d"), m_Unit ); msg = _( "All" );
Affiche_1_Parametre(frame, 10, _("Unit"), msg, BROWN); else
msg.Printf( wxT( "%d" ), m_Unit );
if( m_Convert == 0 ) msg = _("All" ); Affiche_1_Parametre( frame, 10, _( "Unit" ), msg, BROWN );
else if( m_Convert == 1 ) msg = _("no");
else if( m_Convert == 2 ) msg = _("yes"); if( m_Convert == 0 )
else msg = wxT("?"); msg = _( "All" );
Affiche_1_Parametre(frame, 16, _("Convert"), msg, BROWN); else if( m_Convert == 1 )
msg = _( "no" );
if ( m_Width ) valeur_param(m_Width, msg); else if( m_Convert == 2 )
else msg = _("default"); msg = _( "yes" );
Affiche_1_Parametre(frame, 24, _("Width"), msg, BLUE); else
msg = wxT( "?" );
Affiche_1_Parametre( frame, 16, _( "Convert" ), msg, BROWN );
if( m_Width )
valeur_param( m_Width, msg );
else
msg = _( "default" );
Affiche_1_Parametre( frame, 24, _( "Width" ), msg, BLUE );
} }
...@@ -841,6 +841,9 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE ...@@ -841,6 +841,9 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE
sheet->m_FileName = sheet->m_SheetName + wxT( ".sch" ); sheet->m_FileName = sheet->m_SheetName + wxT( ".sch" );
break; break;
} }
default:
;
} }
SetStructFather( Struct, screen ); SetStructFather( Struct, screen );
......
...@@ -594,6 +594,9 @@ void MoveMarkedItems( EDA_LibComponentStruct* LibEntry, wxPoint offset ) ...@@ -594,6 +594,9 @@ void MoveMarkedItems( EDA_LibComponentStruct* LibEntry, wxPoint offset )
( (LibDrawText*) item )->m_Pos.x += offset.x; ( (LibDrawText*) item )->m_Pos.x += offset.x;
( (LibDrawText*) item )->m_Pos.y += offset.y; ( (LibDrawText*) item )->m_Pos.y += offset.y;
break; break;
default:
;
} }
item->m_Flags = item->m_Selected = 0; item->m_Flags = item->m_Selected = 0;
...@@ -701,6 +704,9 @@ void MirrorMarkedItems( EDA_LibComponentStruct* LibEntry, wxPoint offset ) ...@@ -701,6 +704,9 @@ void MirrorMarkedItems( EDA_LibComponentStruct* LibEntry, wxPoint offset )
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE: case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
SETMIRROR( ( (LibDrawText*) item )->m_Pos.x ); SETMIRROR( ( (LibDrawText*) item )->m_Pos.x );
break; break;
default:
;
} }
item->m_Flags = item->m_Selected = 0; item->m_Flags = item->m_Selected = 0;
......
...@@ -148,7 +148,7 @@ wxString DrawMarkerStruct::GetComment( void ) ...@@ -148,7 +148,7 @@ wxString DrawMarkerStruct::GetComment( void )
/***************************/ /***************************/
EDA_DrawLineStruct::EDA_DrawLineStruct( const wxPoint& pos, int layer ) : EDA_DrawLineStruct::EDA_DrawLineStruct( const wxPoint& pos, int layer ) :
EDA_BaseLineStruct( NULL, DRAW_SEGMENT_STRUCT_TYPE ) EDA_BaseStruct( NULL, DRAW_SEGMENT_STRUCT_TYPE )
{ {
m_Start = pos; m_Start = pos;
m_End = pos; m_End = pos;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
/***************************/ /***************************/
/***********************************************************************************/ /***********************************************************************************/
DrawPartStruct::DrawPartStruct( DrawStructureType struct_type, const wxPoint & pos): DrawPartStruct::DrawPartStruct( KICAD_T struct_type, const wxPoint & pos):
EDA_BaseStruct(struct_type) EDA_BaseStruct(struct_type)
/***********************************************************************************/ /***********************************************************************************/
{ {
......
...@@ -70,7 +70,7 @@ public: ...@@ -70,7 +70,7 @@ public:
wxPoint m_Pos; /* Exact position of part. */ wxPoint m_Pos; /* Exact position of part. */
public: public:
DrawPartStruct( DrawStructureType struct_type, const wxPoint & pos); DrawPartStruct( KICAD_T struct_type, const wxPoint & pos);
~DrawPartStruct(void); ~DrawPartStruct(void);
}; };
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -212,6 +212,8 @@ wxPoint MousePos = m_CurrentScreen->m_MousePosition; ...@@ -212,6 +212,8 @@ wxPoint MousePos = m_CurrentScreen->m_MousePosition;
} }
ChangeTextOrient( (DrawTextStruct*)DrawStruct, DC); ChangeTextOrient( (DrawTextStruct*)DrawStruct, DC);
break; break;
default:;
} }
break; break;
......
This diff is collapsed.
This diff is collapsed.
...@@ -543,6 +543,7 @@ wxClientDC dc(DrawPanel); ...@@ -543,6 +543,7 @@ wxClientDC dc(DrawPanel);
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE: case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
EditSymbolText(&dc, CurrentDrawItem); EditSymbolText(&dc, CurrentDrawItem);
break; break;
default:;
} }
DrawPanel->CursorOn(&dc); DrawPanel->CursorOn(&dc);
} }
......
...@@ -839,6 +839,9 @@ int seuil; ...@@ -839,6 +839,9 @@ int seuil;
return(DrawItem); /* Texte trouve */ return(DrawItem); /* Texte trouve */
} }
break; break;
default:
;
} }
} }
return(NULL); return(NULL);
......
...@@ -290,6 +290,9 @@ wxPoint pos; ...@@ -290,6 +290,9 @@ wxPoint pos;
MyFree(Poly); MyFree(Poly);
} }
break; break;
default:;
} /* Fin Switch */ } /* Fin Switch */
Plume('U'); Plume('U');
} /* Fin Boucle de dessin */ } /* Fin Boucle de dessin */
......
/********************************************/ /********************************************/
/* Definitions for the EESchema program: */ /* Definitions for the EESchema program: */
/********************************************/ /********************************************/
#ifndef PROGRAM_H #ifndef PROGRAM_H
#define PROGRAM_H #define PROGRAM_H
...@@ -39,42 +39,56 @@ typedef enum { /* Type des Marqueurs */ ...@@ -39,42 +39,56 @@ typedef enum { /* Type des Marqueurs */
/* Messages correspondants aux types des marqueurs */ /* Messages correspondants aux types des marqueurs */
#ifdef MAIN #ifdef MAIN
const wxChar * NameMarqueurType[] = const wxChar* NameMarqueurType[] =
{ {
wxT(""), wxT( "" ),
wxT("ERC"), wxT( "ERC" ),
wxT("PCB"), wxT( "PCB" ),
wxT("SIMUL"), wxT( "SIMUL" ),
wxT("?????") wxT( "?????" )
}; };
#else #else
extern const wxChar * NameMarqueurType[]; extern const wxChar* NameMarqueurType[];
#endif #endif
/* Forward declarations */ /* Forward declarations */
class DrawSheetStruct; class DrawSheetStruct;
class EDA_DrawLineStruct: public EDA_BaseLineStruct /* Segment decription
base class to describe items which have 2 end points (track, wire, draw line ...) */ /**
* Class EDA_DrawLineStruct
* is a segment decription base class to describe items which have 2 end
* points (track, wire, draw line ...)
*/
class EDA_DrawLineStruct : public EDA_BaseStruct
{ {
public: public:
bool m_StartIsDangling, m_EndIsDangling; // TRUE si Start ou End not connected (wires, tracks...) int m_Layer; // Layer number
int m_Width; // 0 = line, > 0 = tracks, bus ...
wxPoint m_Start; // Line start point
wxPoint m_End; // Line end point
bool m_StartIsDangling;
bool m_EndIsDangling; // TRUE si Start ou End not connected (wires, tracks...)
public: public:
EDA_DrawLineStruct(const wxPoint & pos, int layer ); EDA_DrawLineStruct( const wxPoint &pos, int layer );
~EDA_DrawLineStruct(void) {} ~EDA_DrawLineStruct( void ) { }
bool IsOneEndPointAt(const wxPoint & pos); bool IsOneEndPointAt( const wxPoint& pos );
EDA_DrawLineStruct * GenCopy(void); EDA_DrawLineStruct* GenCopy( void );
bool IsNull(void)
bool IsNull( void )
{ {
return (m_Start == m_End); return m_Start == m_End;
} }
virtual void Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset, int draw_mode, int Color = -1);
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
int Color = -1 );
}; };
class DrawMarkerStruct: public EDA_BaseStruct /* marqueurs */ class DrawMarkerStruct : public EDA_BaseStruct /* marqueurs */
{ {
public: public:
wxPoint m_Pos; /* XY coordinates of marker. */ wxPoint m_Pos; /* XY coordinates of marker. */
...@@ -83,27 +97,34 @@ public: ...@@ -83,27 +97,34 @@ public:
wxString m_Comment; /* Texte (commentaireassocie eventuel */ wxString m_Comment; /* Texte (commentaireassocie eventuel */
public: public:
DrawMarkerStruct(const wxPoint & pos, const wxString & text); DrawMarkerStruct( const wxPoint &pos, const wxString &text );
~DrawMarkerStruct(void); ~DrawMarkerStruct( void );
DrawMarkerStruct * GenCopy(void); DrawMarkerStruct* GenCopy( void );
wxString GetComment(void); wxString GetComment( void );
virtual void Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset, int draw_mode, int Color = -1); virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int draw_mode, int Color = -1 );
}; };
class DrawNoConnectStruct: public EDA_BaseStruct /* Symboles de non connexion */
class DrawNoConnectStruct : public EDA_BaseStruct /* Symboles de non connexion */
{ {
public: public:
wxPoint m_Pos; /* XY coordinates of NoConnect. */ wxPoint m_Pos; /* XY coordinates of NoConnect. */
public: public:
DrawNoConnectStruct(const wxPoint & pos); DrawNoConnectStruct( const wxPoint &pos );
~DrawNoConnectStruct(void) {} ~DrawNoConnectStruct( void ) { }
DrawNoConnectStruct * GenCopy(void); DrawNoConnectStruct* GenCopy( void );
virtual void Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset, int draw_mode, int Color = -1); virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int draw_mode, int Color = -1 );
}; };
class DrawBusEntryStruct: public EDA_BaseStruct /* Struct de descr 1 raccord
a 45 degres de BUS ou WIRE */ /**
* Class DrawBusEntryStruct
* Struct de descr 1 raccord a 45 degres de BUS ou WIRE
*/
class DrawBusEntryStruct : public EDA_BaseStruct
{ {
public: public:
int m_Layer; int m_Layer;
...@@ -112,42 +133,45 @@ public: ...@@ -112,42 +133,45 @@ public:
wxSize m_Size; wxSize m_Size;
public: public:
DrawBusEntryStruct(const wxPoint & pos, int shape, int id ); DrawBusEntryStruct( const wxPoint &pos, int shape, int id );
~DrawBusEntryStruct(void) {} ~DrawBusEntryStruct( void ) { }
DrawBusEntryStruct * GenCopy(void); DrawBusEntryStruct* GenCopy( void );
wxPoint m_End(void); // retourne la coord de fin du raccord wxPoint m_End( void ); // retourne la coord de fin du raccord
virtual void Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset, int draw_mode, int Color = -1); virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int draw_mode, int Color = -1 );
}; };
class DrawPolylineStruct: public EDA_BaseStruct /* Polyligne (serie de segments) */ class DrawPolylineStruct : public EDA_BaseStruct/* Polyligne (serie de segments) */
{ {
public: public:
int m_Layer; int m_Layer;
int m_Width; int m_Width;
int m_NumOfPoints; /* Number of XY pairs in Points array. */ int m_NumOfPoints; /* Number of XY pairs in Points array. */
int *m_Points; /* XY pairs that forms the polyline. */ int* m_Points; /* XY pairs that forms the polyline. */
public: public:
DrawPolylineStruct(int layer); DrawPolylineStruct( int layer );
~DrawPolylineStruct(void); ~DrawPolylineStruct( void );
DrawPolylineStruct * GenCopy(void); DrawPolylineStruct* GenCopy( void );
virtual void Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset, int draw_mode, int Color = -1); virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int draw_mode, int Color = -1 );
}; };
class DrawJunctionStruct: public EDA_BaseStruct class DrawJunctionStruct : public EDA_BaseStruct
{ {
public: public:
int m_Layer; int m_Layer;
wxPoint m_Pos; /* XY coordinates of connection. */ wxPoint m_Pos; /* XY coordinates of connection. */
public: public:
DrawJunctionStruct(const wxPoint & pos); DrawJunctionStruct( const wxPoint &pos );
~DrawJunctionStruct(void){} ~DrawJunctionStruct( void ) { }
DrawJunctionStruct * GenCopy(void); DrawJunctionStruct* GenCopy( void );
virtual void Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset, int draw_mode, int Color = -1); virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int draw_mode, int Color = -1 );
}; };
class DrawTextStruct: public EDA_BaseStruct, public EDA_TextStruct class DrawTextStruct : public EDA_BaseStruct, public EDA_TextStruct
{ {
public: public:
int m_Layer; int m_Layer;
...@@ -155,32 +179,38 @@ public: ...@@ -155,32 +179,38 @@ public:
bool m_IsDangling; // TRUE si non connect bool m_IsDangling; // TRUE si non connect
public: public:
DrawTextStruct(const wxPoint & pos = wxPoint(0,0), const wxString & text = wxEmptyString); DrawTextStruct( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString );
~DrawTextStruct(void) {} ~DrawTextStruct( void ) { }
DrawTextStruct * GenCopy(void); DrawTextStruct* GenCopy( void );
virtual void Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset, int draw_mode, int Color = -1); virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
void SwapData(DrawTextStruct * copyitem); int Color = -1 );
virtual void Place(WinEDA_DrawFrame * frame, wxDC * DC); void SwapData( DrawTextStruct* copyitem );
virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC );
private: private:
void DrawAsText(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset, int draw_mode, int Color); void DrawAsText( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
void DrawAsLabel(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset, int draw_mode, int Color); int draw_mode, int Color );
void DrawAsGlobalLabel(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset, int draw_mode, int Color); void DrawAsLabel( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int draw_mode, int Color );
void DrawAsGlobalLabel( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int draw_mode, int Color );
}; };
class DrawLabelStruct: public DrawTextStruct class DrawLabelStruct : public DrawTextStruct
{ {
public: public:
DrawLabelStruct(const wxPoint & pos = wxPoint(0,0), const wxString & text = wxEmptyString); DrawLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString );
~DrawLabelStruct(void) {} ~DrawLabelStruct( void ) { }
}; };
class DrawGlobalLabelStruct: public DrawTextStruct class DrawGlobalLabelStruct : public DrawTextStruct
{ {
public: public:
DrawGlobalLabelStruct(const wxPoint & pos = wxPoint(0,0), const wxString & text = wxEmptyString); DrawGlobalLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ),
~DrawGlobalLabelStruct(void) {} const wxString& text = wxEmptyString );
~DrawGlobalLabelStruct( void ) { }
}; };
...@@ -188,9 +218,9 @@ public: ...@@ -188,9 +218,9 @@ public:
class LayerStruct class LayerStruct
{ {
public: public:
char LayerNames[MAX_LAYERS+1][8]; char LayerNames[MAX_LAYERS + 1][8];
int LayerColor[MAX_LAYERS+1]; int LayerColor[MAX_LAYERS + 1];
char LayerStatus[MAX_LAYERS+1]; char LayerStatus[MAX_LAYERS + 1];
int NumberOfLayers; int NumberOfLayers;
int CurrentLayer; int CurrentLayer;
int CurrentWidth; int CurrentWidth;
...@@ -200,4 +230,3 @@ public: ...@@ -200,4 +230,3 @@ public:
#endif /* PROGRAM_H */ #endif /* PROGRAM_H */
This diff is collapsed.
This diff is collapsed.
...@@ -14,7 +14,9 @@ extern std::ostream& operator<<( std::ostream& out, const wxPoint& pt ); ...@@ -14,7 +14,9 @@ extern std::ostream& operator<<( std::ostream& out, const wxPoint& pt );
/* Id for class identification, at run time */ /* Id for class identification, at run time */
enum DrawStructureType { enum KICAD_T {
NOT_USED = -1, // the 3d code uses this value
EOT = 0, // search types array terminator (End Of Types) EOT = 0, // search types array terminator (End Of Types)
...@@ -80,7 +82,6 @@ enum SEARCH_RESULT { ...@@ -80,7 +82,6 @@ enum SEARCH_RESULT {
SEARCH_CONTINUE SEARCH_CONTINUE
}; };
typedef DrawStructureType KICAD_T; // shorter name
class EDA_BaseStruct; class EDA_BaseStruct;
class WinEDA_DrawFrame; class WinEDA_DrawFrame;
...@@ -126,7 +127,7 @@ public: ...@@ -126,7 +127,7 @@ public:
class EDA_BaseStruct /* Basic class, not directly used */ class EDA_BaseStruct /* Basic class, not directly used */
{ {
public: public:
int m_StructType; /* Struct ident for run time identification */ KICAD_T m_StructType; /* Struct ident for run time identification */
EDA_BaseStruct* Pnext; /* Linked list: Link (next struct) */ EDA_BaseStruct* Pnext; /* Linked list: Link (next struct) */
EDA_BaseStruct* Pback; /* Linked list: Link (previous struct) */ EDA_BaseStruct* Pback; /* Linked list: Link (previous struct) */
EDA_BaseStruct* m_Parent; /* Linked list: Link (parent struct) */ EDA_BaseStruct* m_Parent; /* Linked list: Link (parent struct) */
...@@ -163,11 +164,11 @@ private: ...@@ -163,11 +164,11 @@ private:
public: public:
EDA_BaseStruct( EDA_BaseStruct* parent, int idType ); EDA_BaseStruct( EDA_BaseStruct* parent, KICAD_T idType );
EDA_BaseStruct( int struct_type ); EDA_BaseStruct( KICAD_T struct_type );
virtual ~EDA_BaseStruct() { }; virtual ~EDA_BaseStruct() { };
EDA_BaseStruct* Next( void ) { return Pnext; } EDA_BaseStruct* Next() { return Pnext; }
/* Gestion de l'etat (status) de la structure (active, deleted..) */ /* Gestion de l'etat (status) de la structure (active, deleted..) */
int GetState( int type ); int GetState( int type );
...@@ -381,7 +382,7 @@ protected: ...@@ -381,7 +382,7 @@ protected:
public: public:
BOARD_ITEM( BOARD_ITEM* StructFather, DrawStructureType idtype ) : BOARD_ITEM( BOARD_ITEM* StructFather, KICAD_T idtype ) :
EDA_BaseStruct( StructFather, idtype ), EDA_BaseStruct( StructFather, idtype ),
m_Layer(0) m_Layer(0)
{ {
...@@ -450,22 +451,6 @@ public: ...@@ -450,22 +451,6 @@ public:
}; };
/* Base class for building items like lines, which have 1 start point and 1 end point.
* Arc and circles can use this class.
*/
class EDA_BaseLineStruct : public EDA_BaseStruct
{
public:
int m_Layer; // Layer number
int m_Width; // 0 = line, > 0 = tracks, bus ...
wxPoint m_Start; // Line start point
wxPoint m_End; // Line end point
public:
EDA_BaseLineStruct( EDA_BaseStruct* StructFather, DrawStructureType idtype );
};
/**************************/ /**************************/
/* class DrawPickedStruct */ /* class DrawPickedStruct */
/**************************/ /**************************/
......
...@@ -358,7 +358,7 @@ public: ...@@ -358,7 +358,7 @@ public:
int m_Angle; // pour les arcs: "longueur" de l'arc en 1/10 deg int m_Angle; // pour les arcs: "longueur" de l'arc en 1/10 deg
public: public:
DRAWSEGMENT( BOARD_ITEM* StructFather, DrawStructureType idtype = TYPEDRAWSEGMENT ); DRAWSEGMENT( BOARD_ITEM* StructFather, KICAD_T idtype = TYPEDRAWSEGMENT );
~DRAWSEGMENT( void ); ~DRAWSEGMENT( void );
// Read/write data // Read/write data
......
...@@ -501,7 +501,7 @@ public: ...@@ -501,7 +501,7 @@ public:
virtual void SwitchLayer( wxDC* DC, int layer ); virtual void SwitchLayer( wxDC* DC, int layer );
// divers // divers
void AddHistory( int value, DrawStructureType type ); // Add value in data list history void AddHistory( int value, KICAD_T type ); // Add value in data list history
void InstallGridFrame( const wxPoint& pos ); void InstallGridFrame( const wxPoint& pos );
}; };
......
...@@ -502,6 +502,9 @@ void MoveMarkedItems( MODULE* module, wxPoint offset ) ...@@ -502,6 +502,9 @@ void MoveMarkedItems( MODULE* module, wxPoint offset )
( (EDGE_MODULE*) item )->m_End0.x += offset.x; ( (EDGE_MODULE*) item )->m_End0.x += offset.x;
( (EDGE_MODULE*) item )->m_End0.y += offset.y; ( (EDGE_MODULE*) item )->m_End0.y += offset.y;
break; break;
default:
;
} }
item->m_Flags = item->m_Selected = 0; item->m_Flags = item->m_Selected = 0;
...@@ -588,6 +591,9 @@ void MirrorMarkedItems( MODULE* module, wxPoint offset ) ...@@ -588,6 +591,9 @@ void MirrorMarkedItems( MODULE* module, wxPoint offset )
SETMIRROR( ( (TEXTE_MODULE*) item )->m_Pos.x ); SETMIRROR( ( (TEXTE_MODULE*) item )->m_Pos.x );
( (TEXTE_MODULE*) item )->m_Pos0.x = ( (TEXTE_MODULE*) item )->m_Pos.x; ( (TEXTE_MODULE*) item )->m_Pos0.x = ( (TEXTE_MODULE*) item )->m_Pos.x;
break; break;
default:
;
} }
item->m_Flags = item->m_Selected = 0; item->m_Flags = item->m_Selected = 0;
...@@ -639,6 +645,9 @@ void RotateMarkedItems( MODULE* module, wxPoint offset ) ...@@ -639,6 +645,9 @@ void RotateMarkedItems( MODULE* module, wxPoint offset )
( (TEXTE_MODULE*) item )->m_Pos0 = ( (TEXTE_MODULE*) item )->m_Pos; ( (TEXTE_MODULE*) item )->m_Pos0 = ( (TEXTE_MODULE*) item )->m_Pos;
( (TEXTE_MODULE*) item )->m_Orient += 900; ( (TEXTE_MODULE*) item )->m_Orient += 900;
break; break;
default:
;
} }
item->m_Flags = item->m_Selected = 0; item->m_Flags = item->m_Selected = 0;
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
EDGE_MODULE::EDGE_MODULE( MODULE* parent ) : EDGE_MODULE::EDGE_MODULE( MODULE* parent ) :
BOARD_ITEM( parent, TYPEEDGEMODULE ) BOARD_ITEM( parent, TYPEEDGEMODULE )
{ {
m_Width = 0;
m_Shape = S_SEGMENT; m_Shape = S_SEGMENT;
m_Angle = 0; m_Angle = 0;
m_Width = 120; m_Width = 120;
......
...@@ -22,9 +22,10 @@ ...@@ -22,9 +22,10 @@
/* Constructeur des classes type pistes, vias et zones */ /* Constructeur des classes type pistes, vias et zones */
TRACK::TRACK( BOARD_ITEM* StructFather, DrawStructureType idtype ) : TRACK::TRACK( BOARD_ITEM* StructFather, KICAD_T idtype ) :
BOARD_ITEM( StructFather, idtype ) BOARD_ITEM( StructFather, idtype )
{ {
m_Width = 0;
m_Shape = S_SEGMENT; m_Shape = S_SEGMENT;
start = end = NULL; start = end = NULL;
m_NetCode = 0; m_NetCode = 0;
......
...@@ -40,7 +40,7 @@ public: ...@@ -40,7 +40,7 @@ public:
int m_Param; // Auxiliary variable ( used in some computations ) int m_Param; // Auxiliary variable ( used in some computations )
public: public:
TRACK( BOARD_ITEM* StructFather, DrawStructureType idtype = TYPETRACK ); TRACK( BOARD_ITEM* StructFather, KICAD_T idtype = TYPETRACK );
TRACK( const TRACK& track ); TRACK( const TRACK& track );
TRACK* Next() { return (TRACK*) Pnext; } TRACK* Next() { return (TRACK*) Pnext; }
......
...@@ -52,10 +52,10 @@ EDGE_ZONE:: ~EDGE_ZONE( void ) ...@@ -52,10 +52,10 @@ EDGE_ZONE:: ~EDGE_ZONE( void )
/**********************/ /**********************/
/* Classe DRAWSEGMENT: constructeur */ /* Classe DRAWSEGMENT: constructeur */
DRAWSEGMENT::DRAWSEGMENT( BOARD_ITEM* StructFather, DrawStructureType idtype ) : DRAWSEGMENT::DRAWSEGMENT( BOARD_ITEM* StructFather, KICAD_T idtype ) :
BOARD_ITEM( StructFather, idtype ) BOARD_ITEM( StructFather, idtype )
{ {
m_Flags = m_Shape = m_Type = m_Angle = 0; m_Width = m_Flags = m_Shape = m_Type = m_Angle = 0;
} }
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
/* Constructeur des classes type pistes, vias et zones */ /* Constructeur des classes type pistes, vias et zones */
TRACK::TRACK( EDA_BaseStruct* StructFather, DrawStructureType idtype ) : TRACK::TRACK( EDA_BaseStruct* StructFather, KICAD_T idtype ) :
SEGDRAW_Struct( StructFather, idtype ) SEGDRAW_Struct( StructFather, idtype )
{ {
m_Shape = S_SEGMENT; m_Shape = S_SEGMENT;
......
...@@ -281,7 +281,7 @@ void WinEDA_PcbTracksDialog::AcceptPcbOptions(wxCommandEvent& event) ...@@ -281,7 +281,7 @@ void WinEDA_PcbTracksDialog::AcceptPcbOptions(wxCommandEvent& event)
/*********************************************************************/ /*********************************************************************/
void WinEDA_BasePcbFrame::AddHistory(int value, DrawStructureType type) void WinEDA_BasePcbFrame::AddHistory(int value, KICAD_T type)
/**********************************************************************/ /**********************************************************************/
// Mise a jour des listes des dernieres epaisseurs de via et track utilisées // Mise a jour des listes des dernieres epaisseurs de via et track utilisées
{ {
......
...@@ -1254,6 +1254,9 @@ int* WinEDA_BasePcbFrame::build_ratsnest_pad( EDA_BaseStruct* ref, ...@@ -1254,6 +1254,9 @@ int* WinEDA_BasePcbFrame::build_ratsnest_pad( EDA_BaseStruct* ref,
conn_number = track_ref->m_Sous_Netcode; conn_number = track_ref->m_Sous_Netcode;
break; break;
} }
default:
;
} }
if( current_net_code <= 0 ) if( current_net_code <= 0 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment