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)
/**************************************************************************/
S3D_Material::S3D_Material(Struct3D_Master * father, const wxString & name):
EDA_BaseStruct( father, -1)
S3D_Material::S3D_Material( Struct3D_Master * father, const wxString & name ):
EDA_BaseStruct( father, NOT_USED )
/**************************************************************************/
{
m_DiffuseColor.x = m_DiffuseColor.y = m_DiffuseColor.z = 1.0;
......@@ -67,7 +67,7 @@ void Struct3D_Master::Copy(Struct3D_Master * pattern)
/***************************************************************/
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;
......@@ -100,7 +100,7 @@ S3D_Material * nextmat;
/***************************************************************/
Struct3D_Shape::Struct3D_Shape(EDA_BaseStruct * StructFather):
EDA_BaseStruct( StructFather, -1)
EDA_BaseStruct( StructFather, NOT_USED )
/***************************************************************/
{
m_3D_Coord = NULL;
......
......@@ -5,6 +5,18 @@ Please add newer entries at the top, list the date and your name with
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>
================================================================================
+ pcbnew
......@@ -27,9 +39,6 @@ email address.
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
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>
......
......@@ -17,8 +17,8 @@
#include "macros.h"
// DrawStructureType names for error messages only:
static wxString DrawStructureTypeName[MAX_STRUCT_TYPE_ID + 1] = {
// KICAD_T names for error messages only:
static wxString KICAD_TName[MAX_STRUCT_TYPE_ID + 1] = {
wxT( "Not init" ),
wxT( "Pcb" ),
......@@ -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();
......@@ -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();
......@@ -183,7 +183,7 @@ wxString EDA_BaseStruct::ReturnClassName() const
if( (ii < 0) || (ii > MAX_STRUCT_TYPE_ID) )
ii = MAX_STRUCT_TYPE_ID;
classname = DrawStructureTypeName[ii];
classname = KICAD_TName[ii];
return classname;
}
......@@ -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 */
/*********************************************************/
......
/**********************************************************/
/* Routines d'affichage de parametres et caracteristiques */
/**********************************************************/
/**********************************************************/
/* Routines d'affichage de parametres et caracteristiques */
/**********************************************************/
/* Fichier AFFICHE.CPP */
/* Fichier AFFICHE.CPP */
#include "fctsys.h"
#include "gr_basic.h"
......@@ -15,136 +15,175 @@
/***********************************************************/
void DrawSheetStruct::Display_Infos(WinEDA_DrawFrame * frame)
void DrawSheetStruct::Display_Infos( WinEDA_DrawFrame* frame )
/************************************************************/
{
frame->MsgPanel->EraseMsgBox();
Affiche_1_Parametre(frame, 1, _("Name"), m_SheetName, CYAN);
Affiche_1_Parametre(frame, 30, _("FileName"), m_FileName, BROWN);
Affiche_1_Parametre( frame, 1, _( "Name" ), m_SheetName, CYAN );
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);;
wxString msg;
EDA_LibComponentStruct* Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT );;
wxString msg;
frame->MsgPanel->EraseMsgBox();
Affiche_1_Parametre(frame, 1, _("Ref"),
m_Field[REFERENCE].m_Text, DARKCYAN);
Affiche_1_Parametre( frame, 1, _( "Ref" ),
m_Field[REFERENCE].m_Text, DARKCYAN );
if (Entry && Entry->m_Options == ENTRY_POWER)
msg = _("Pwr Symb");
else msg = _("Val");
Affiche_1_Parametre(frame, 10, msg, m_Field[VALUE].m_Text, DARKCYAN);
if( Entry && Entry->m_Options == ENTRY_POWER )
msg = _( "Pwr Symb" );
else
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;
Affiche_1_Parametre(frame, 40, _("Lib"), msg, DARKRED);
Affiche_1_Parametre( frame, 40, _( "Lib" ), msg, DARKRED );
if( Entry )
{
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, Entry->m_Doc, wxEmptyString, DARKCYAN );
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
*/
*/
{
wxString Text;
int ii;
wxString Text;
int ii;
frame->MsgPanel->EraseMsgBox();
/* Affichage du nom */
Affiche_1_Parametre(frame, 24, _("PinName"), m_PinName, DARKCYAN);
Affiche_1_Parametre( frame, 24, _( "PinName" ), m_PinName, DARKCYAN );
/* Affichage du numero */
if(m_PinNum == 0) Text = wxT("?" );
else ReturnPinStringNum(Text);
if( m_PinNum == 0 )
Text = wxT( "?" );
else
ReturnPinStringNum( Text );
Affiche_1_Parametre(frame, 40, _("PinNum"), Text, DARKCYAN);
Affiche_1_Parametre( frame, 40, _( "PinNum" ), Text, DARKCYAN );
/* Affichage du type */
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 */
ii = m_Attributs;
if( ii & 1 ) Text = _("no");
else Text = _("yes");
Affiche_1_Parametre(frame, 58, _("Display"), Text, DARKGREEN);
if( ii & 1 )
Text = _( "no" );
else
Text = _( "yes" );
Affiche_1_Parametre( frame, 58, _( "Display" ), Text, DARKGREEN );
/* Affichage de la longueur */
Text.Printf( wxT("%d"), m_PinLen);
Affiche_1_Parametre(frame, 66, _("Lengh"), Text, MAGENTA);
Text.Printf( wxT( "%d" ), m_PinLen );
Affiche_1_Parametre( frame, 66, _( "Lengh" ), Text, MAGENTA );
/* Affichage de l'orientation */
switch(m_Orient)
switch( m_Orient )
{
case PIN_UP: Text = _("Up"); break;
case PIN_DOWN: Text = _("Down"); break;
case PIN_LEFT: Text = _("Left"); break;
case PIN_RIGHT: Text = _("Right"); break;
default: Text = wxT("??"); break;
case PIN_UP:
Text = _( "Up" ); break;
case PIN_DOWN:
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
*/
*/
{
wxString msg;
wxString msg;
frame->MsgPanel->EraseMsgBox();
/* affichage du type */
msg = wxT("??");
msg = wxT( "??" );
switch( m_StructType )
{
case COMPONENT_ARC_DRAW_TYPE: msg = wxT("Arc"); break;
case COMPONENT_CIRCLE_DRAW_TYPE: msg = wxT("Circle"); 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_ARC_DRAW_TYPE:
msg = wxT( "Arc" ); break;
case COMPONENT_CIRCLE_DRAW_TYPE:
msg = wxT( "Circle" ); 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:
((LibDrawPin*) this)->Display_Infos(frame);
msg = wxT("Pin");
( (LibDrawPin*) this )->Display_Infos( frame );
msg = wxT( "Pin" );
break;
default:
;
}
Affiche_1_Parametre(frame, 1, wxT("Type"), msg, CYAN);
Affiche_1_Parametre( frame, 1, wxT( "Type" ), msg, CYAN );
/* Affichage de l'appartenance */
if( m_Unit == 0 ) msg = _("All");
else msg.Printf( wxT("%d"), m_Unit );
Affiche_1_Parametre(frame, 10, _("Unit"), msg, BROWN);
if( m_Convert == 0 ) msg = _("All" );
else if( m_Convert == 1 ) msg = _("no");
else if( m_Convert == 2 ) msg = _("yes");
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);
if( m_Unit == 0 )
msg = _( "All" );
else
msg.Printf( wxT( "%d" ), m_Unit );
Affiche_1_Parametre( frame, 10, _( "Unit" ), msg, BROWN );
if( m_Convert == 0 )
msg = _( "All" );
else if( m_Convert == 1 )
msg = _( "no" );
else if( m_Convert == 2 )
msg = _( "yes" );
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
sheet->m_FileName = sheet->m_SheetName + wxT( ".sch" );
break;
}
default:
;
}
SetStructFather( Struct, screen );
......
......@@ -594,6 +594,9 @@ void MoveMarkedItems( EDA_LibComponentStruct* LibEntry, wxPoint offset )
( (LibDrawText*) item )->m_Pos.x += offset.x;
( (LibDrawText*) item )->m_Pos.y += offset.y;
break;
default:
;
}
item->m_Flags = item->m_Selected = 0;
......@@ -701,6 +704,9 @@ void MirrorMarkedItems( EDA_LibComponentStruct* LibEntry, wxPoint offset )
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
SETMIRROR( ( (LibDrawText*) item )->m_Pos.x );
break;
default:
;
}
item->m_Flags = item->m_Selected = 0;
......
......@@ -148,7 +148,7 @@ wxString DrawMarkerStruct::GetComment( void )
/***************************/
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_End = pos;
......
......@@ -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)
/***********************************************************************************/
{
......
......@@ -70,7 +70,7 @@ public:
wxPoint m_Pos; /* Exact position of part. */
public:
DrawPartStruct( DrawStructureType struct_type, const wxPoint & pos);
DrawPartStruct( KICAD_T struct_type, const wxPoint & pos);
~DrawPartStruct(void);
};
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -212,6 +212,8 @@ wxPoint MousePos = m_CurrentScreen->m_MousePosition;
}
ChangeTextOrient( (DrawTextStruct*)DrawStruct, DC);
break;
default:;
}
break;
......
This diff is collapsed.
This diff is collapsed.
......@@ -543,6 +543,7 @@ wxClientDC dc(DrawPanel);
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
EditSymbolText(&dc, CurrentDrawItem);
break;
default:;
}
DrawPanel->CursorOn(&dc);
}
......
......@@ -839,6 +839,9 @@ int seuil;
return(DrawItem); /* Texte trouve */
}
break;
default:
;
}
}
return(NULL);
......
......@@ -290,6 +290,9 @@ wxPoint pos;
MyFree(Poly);
}
break;
default:;
} /* Fin Switch */
Plume('U');
} /* Fin Boucle de dessin */
......
/********************************************/
/* Definitions for the EESchema program: */
/********************************************/
/********************************************/
/* Definitions for the EESchema program: */
/********************************************/
#ifndef PROGRAM_H
#define PROGRAM_H
......@@ -39,42 +39,56 @@ typedef enum { /* Type des Marqueurs */
/* Messages correspondants aux types des marqueurs */
#ifdef MAIN
const wxChar * NameMarqueurType[] =
{
wxT(""),
wxT("ERC"),
wxT("PCB"),
wxT("SIMUL"),
wxT("?????")
};
const wxChar* NameMarqueurType[] =
{
wxT( "" ),
wxT( "ERC" ),
wxT( "PCB" ),
wxT( "SIMUL" ),
wxT( "?????" )
};
#else
extern const wxChar * NameMarqueurType[];
extern const wxChar* NameMarqueurType[];
#endif
/* Forward declarations */
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:
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:
EDA_DrawLineStruct(const wxPoint & pos, int layer );
~EDA_DrawLineStruct(void) {}
bool IsOneEndPointAt(const wxPoint & pos);
EDA_DrawLineStruct * GenCopy(void);
bool IsNull(void)
EDA_DrawLineStruct( const wxPoint &pos, int layer );
~EDA_DrawLineStruct( void ) { }
bool IsOneEndPointAt( const wxPoint& pos );
EDA_DrawLineStruct* GenCopy( 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:
wxPoint m_Pos; /* XY coordinates of marker. */
......@@ -83,27 +97,34 @@ public:
wxString m_Comment; /* Texte (commentaireassocie eventuel */
public:
DrawMarkerStruct(const wxPoint & pos, const wxString & text);
~DrawMarkerStruct(void);
DrawMarkerStruct * GenCopy(void);
wxString GetComment(void);
virtual void Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset, int draw_mode, int Color = -1);
DrawMarkerStruct( const wxPoint &pos, const wxString &text );
~DrawMarkerStruct( void );
DrawMarkerStruct* GenCopy( void );
wxString GetComment( void );
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:
wxPoint m_Pos; /* XY coordinates of NoConnect. */
public:
DrawNoConnectStruct(const wxPoint & pos);
~DrawNoConnectStruct(void) {}
DrawNoConnectStruct * GenCopy(void);
virtual void Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset, int draw_mode, int Color = -1);
DrawNoConnectStruct( const wxPoint &pos );
~DrawNoConnectStruct( void ) { }
DrawNoConnectStruct* GenCopy( void );
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:
int m_Layer;
......@@ -112,42 +133,45 @@ public:
wxSize m_Size;
public:
DrawBusEntryStruct(const wxPoint & pos, int shape, int id );
~DrawBusEntryStruct(void) {}
DrawBusEntryStruct * GenCopy(void);
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);
DrawBusEntryStruct( const wxPoint &pos, int shape, int id );
~DrawBusEntryStruct( void ) { }
DrawBusEntryStruct* GenCopy( void );
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 );
};
class DrawPolylineStruct: public EDA_BaseStruct /* Polyligne (serie de segments) */
class DrawPolylineStruct : public EDA_BaseStruct/* Polyligne (serie de segments) */
{
public:
int m_Layer;
int m_Width;
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:
DrawPolylineStruct(int layer);
~DrawPolylineStruct(void);
DrawPolylineStruct * GenCopy(void);
virtual void Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset, int draw_mode, int Color = -1);
DrawPolylineStruct( int layer );
~DrawPolylineStruct( void );
DrawPolylineStruct* GenCopy( void );
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:
int m_Layer;
wxPoint m_Pos; /* XY coordinates of connection. */
public:
DrawJunctionStruct(const wxPoint & pos);
~DrawJunctionStruct(void){}
DrawJunctionStruct * GenCopy(void);
virtual void Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset, int draw_mode, int Color = -1);
DrawJunctionStruct( const wxPoint &pos );
~DrawJunctionStruct( void ) { }
DrawJunctionStruct* GenCopy( void );
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:
int m_Layer;
......@@ -155,32 +179,38 @@ public:
bool m_IsDangling; // TRUE si non connect
public:
DrawTextStruct(const wxPoint & pos = wxPoint(0,0), const wxString & text = wxEmptyString);
~DrawTextStruct(void) {}
DrawTextStruct * GenCopy(void);
virtual void Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset, int draw_mode, int Color = -1);
void SwapData(DrawTextStruct * copyitem);
virtual void Place(WinEDA_DrawFrame * frame, wxDC * DC);
DrawTextStruct( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString );
~DrawTextStruct( void ) { }
DrawTextStruct* GenCopy( void );
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
int Color = -1 );
void SwapData( DrawTextStruct* copyitem );
virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC );
private:
void DrawAsText(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);
void DrawAsText( 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:
DrawLabelStruct(const wxPoint & pos = wxPoint(0,0), const wxString & text = wxEmptyString);
~DrawLabelStruct(void) {}
DrawLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString );
~DrawLabelStruct( void ) { }
};
class DrawGlobalLabelStruct: public DrawTextStruct
class DrawGlobalLabelStruct : public DrawTextStruct
{
public:
DrawGlobalLabelStruct(const wxPoint & pos = wxPoint(0,0), const wxString & text = wxEmptyString);
~DrawGlobalLabelStruct(void) {}
DrawGlobalLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ),
const wxString& text = wxEmptyString );
~DrawGlobalLabelStruct( void ) { }
};
......@@ -188,9 +218,9 @@ public:
class LayerStruct
{
public:
char LayerNames[MAX_LAYERS+1][8];
int LayerColor[MAX_LAYERS+1];
char LayerStatus[MAX_LAYERS+1];
char LayerNames[MAX_LAYERS + 1][8];
int LayerColor[MAX_LAYERS + 1];
char LayerStatus[MAX_LAYERS + 1];
int NumberOfLayers;
int CurrentLayer;
int CurrentWidth;
......@@ -200,4 +230,3 @@ public:
#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 );
/* 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)
......@@ -80,7 +82,6 @@ enum SEARCH_RESULT {
SEARCH_CONTINUE
};
typedef DrawStructureType KICAD_T; // shorter name
class EDA_BaseStruct;
class WinEDA_DrawFrame;
......@@ -126,7 +127,7 @@ public:
class EDA_BaseStruct /* Basic class, not directly used */
{
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* Pback; /* Linked list: Link (previous struct) */
EDA_BaseStruct* m_Parent; /* Linked list: Link (parent struct) */
......@@ -163,11 +164,11 @@ private:
public:
EDA_BaseStruct( EDA_BaseStruct* parent, int idType );
EDA_BaseStruct( int struct_type );
EDA_BaseStruct( EDA_BaseStruct* parent, KICAD_T idType );
EDA_BaseStruct( KICAD_T struct_type );
virtual ~EDA_BaseStruct() { };
EDA_BaseStruct* Next( void ) { return Pnext; }
EDA_BaseStruct* Next() { return Pnext; }
/* Gestion de l'etat (status) de la structure (active, deleted..) */
int GetState( int type );
......@@ -381,7 +382,7 @@ protected:
public:
BOARD_ITEM( BOARD_ITEM* StructFather, DrawStructureType idtype ) :
BOARD_ITEM( BOARD_ITEM* StructFather, KICAD_T idtype ) :
EDA_BaseStruct( StructFather, idtype ),
m_Layer(0)
{
......@@ -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 */
/**************************/
......
......@@ -358,7 +358,7 @@ public:
int m_Angle; // pour les arcs: "longueur" de l'arc en 1/10 deg
public:
DRAWSEGMENT( BOARD_ITEM* StructFather, DrawStructureType idtype = TYPEDRAWSEGMENT );
DRAWSEGMENT( BOARD_ITEM* StructFather, KICAD_T idtype = TYPEDRAWSEGMENT );
~DRAWSEGMENT( void );
// Read/write data
......
......@@ -501,7 +501,7 @@ public:
virtual void SwitchLayer( wxDC* DC, int layer );
// 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 );
};
......
......@@ -502,6 +502,9 @@ void MoveMarkedItems( MODULE* module, wxPoint offset )
( (EDGE_MODULE*) item )->m_End0.x += offset.x;
( (EDGE_MODULE*) item )->m_End0.y += offset.y;
break;
default:
;
}
item->m_Flags = item->m_Selected = 0;
......@@ -588,6 +591,9 @@ void MirrorMarkedItems( MODULE* module, wxPoint offset )
SETMIRROR( ( (TEXTE_MODULE*) item )->m_Pos.x );
( (TEXTE_MODULE*) item )->m_Pos0.x = ( (TEXTE_MODULE*) item )->m_Pos.x;
break;
default:
;
}
item->m_Flags = item->m_Selected = 0;
......@@ -639,6 +645,9 @@ void RotateMarkedItems( MODULE* module, wxPoint offset )
( (TEXTE_MODULE*) item )->m_Pos0 = ( (TEXTE_MODULE*) item )->m_Pos;
( (TEXTE_MODULE*) item )->m_Orient += 900;
break;
default:
;
}
item->m_Flags = item->m_Selected = 0;
......
......@@ -31,6 +31,7 @@
EDGE_MODULE::EDGE_MODULE( MODULE* parent ) :
BOARD_ITEM( parent, TYPEEDGEMODULE )
{
m_Width = 0;
m_Shape = S_SEGMENT;
m_Angle = 0;
m_Width = 120;
......
......@@ -22,9 +22,10 @@
/* 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 )
{
m_Width = 0;
m_Shape = S_SEGMENT;
start = end = NULL;
m_NetCode = 0;
......
......@@ -40,7 +40,7 @@ public:
int m_Param; // Auxiliary variable ( used in some computations )
public:
TRACK( BOARD_ITEM* StructFather, DrawStructureType idtype = TYPETRACK );
TRACK( BOARD_ITEM* StructFather, KICAD_T idtype = TYPETRACK );
TRACK( const TRACK& track );
TRACK* Next() { return (TRACK*) Pnext; }
......
......@@ -52,10 +52,10 @@ EDGE_ZONE:: ~EDGE_ZONE( void )
/**********************/
/* Classe DRAWSEGMENT: constructeur */
DRAWSEGMENT::DRAWSEGMENT( BOARD_ITEM* StructFather, DrawStructureType idtype ) :
DRAWSEGMENT::DRAWSEGMENT( BOARD_ITEM* StructFather, KICAD_T 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 @@
/* 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 )
{
m_Shape = S_SEGMENT;
......
......@@ -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
{
......
......@@ -1254,6 +1254,9 @@ int* WinEDA_BasePcbFrame::build_ratsnest_pad( EDA_BaseStruct* ref,
conn_number = track_ref->m_Sous_Netcode;
break;
}
default:
;
}
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