7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-19 12:01:42 +00:00

dlist cleanups, start of edit component in schematic rework

This commit is contained in:
dickelbeck 2008-11-24 06:53:43 +00:00
parent 4d3d0a8fcc
commit 3ef380f936
152 changed files with 2605 additions and 2712 deletions
3d-viewer
change_log.txt
common
eeschema
gerbview
include
pcbnew

View File

@ -1,4 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: 3d_class.cpp
/////////////////////////////////////////////////////////////////////////////
@ -20,59 +21,62 @@
S3D_Vertex::S3D_Vertex()
/****************************/
{
x = y = z = 0.0;
x = y = z = 0.0;
}
/**************************************************************************/
S3D_Material::S3D_Material( Struct3D_Master * father, const wxString & name ):
EDA_BaseStruct( father, NOT_USED )
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;
m_SpecularColor.x = m_SpecularColor.y = m_SpecularColor.z = 1.0;
m_DiffuseColor.x = m_DiffuseColor.y = m_DiffuseColor.z = 1.0;
m_SpecularColor.x = m_SpecularColor.y = m_SpecularColor.z = 1.0;
m_AmbientIntensity = 1.0;
m_Transparency = 0.0;
m_Shininess = 1.0;
m_Name = name;
m_Shininess = 1.0;
m_Name = name;
}
/***********************************/
void S3D_Material::SetMaterial()
/***********************************/
{
glColorMaterial(GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE);
glColor4f(m_DiffuseColor.x * m_AmbientIntensity,
m_DiffuseColor.y * m_AmbientIntensity,
m_DiffuseColor.z * m_AmbientIntensity,
1.0 - m_Transparency );
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
glColor4f( m_DiffuseColor.x * m_AmbientIntensity,
m_DiffuseColor.y * m_AmbientIntensity,
m_DiffuseColor.z * m_AmbientIntensity,
1.0 - m_Transparency );
#if 0
glColorMaterial(GL_FRONT_AND_BACK,GL_SPECULAR);
glColor3f(m_SpecularColor.x, m_SpecularColor.y,m_SpecularColor.z);
glColorMaterial( GL_FRONT_AND_BACK, GL_SPECULAR );
glColor3f( m_SpecularColor.x, m_SpecularColor.y, m_SpecularColor.z );
#endif
glColorMaterial(GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE);
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
}
/****************************************************/
void Struct3D_Master::Copy(Struct3D_Master * pattern)
void Struct3D_Master::Copy( Struct3D_Master* pattern )
/****************************************************/
{
m_Shape3DName = pattern->m_Shape3DName;
m_MatScale = pattern->m_MatScale;
m_MatRotation = pattern->m_MatRotation;
m_MatPosition = pattern->m_MatPosition;
m_3D_Drawings = NULL;
m_Materials = NULL;
m_Shape3DName = pattern->m_Shape3DName;
m_MatScale = pattern->m_MatScale;
m_MatRotation = pattern->m_MatRotation;
m_MatPosition = pattern->m_MatPosition;
m_3D_Drawings = NULL;
m_Materials = NULL;
}
/***************************************************************/
Struct3D_Master::Struct3D_Master(EDA_BaseStruct * StructFather):
EDA_BaseStruct( StructFather, NOT_USED )
Struct3D_Master::Struct3D_Master( EDA_BaseStruct* StructFather ) :
EDA_BaseStruct( StructFather, NOT_USED )
/***************************************************************/
{
m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0;
m_3D_Drawings = NULL;
m_Materials = NULL;
m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0;
m_3D_Drawings = NULL;
m_Materials = NULL;
}
@ -80,32 +84,31 @@ Struct3D_Master::Struct3D_Master(EDA_BaseStruct * StructFather):
Struct3D_Master:: ~Struct3D_Master()
/***************************************/
{
Struct3D_Shape * next;
S3D_Material * nextmat;
Struct3D_Shape* next;
S3D_Material* nextmat;
for( ; m_3D_Drawings != NULL; m_3D_Drawings = next )
{
next = (Struct3D_Shape *) m_3D_Drawings->Pnext;
delete m_3D_Drawings;
}
for( ; m_3D_Drawings != NULL; m_3D_Drawings = next )
{
next = m_3D_Drawings->Next();
delete m_3D_Drawings;
}
for( ; m_Materials != NULL; m_Materials = nextmat )
{
nextmat = (S3D_Material *) m_Materials->Pnext;
delete m_Materials;
}
for( ; m_Materials != NULL; m_Materials = nextmat )
{
nextmat = m_Materials->Next();
delete m_Materials;
}
}
/***************************************************************/
Struct3D_Shape::Struct3D_Shape(EDA_BaseStruct * StructFather):
EDA_BaseStruct( StructFather, NOT_USED )
Struct3D_Shape::Struct3D_Shape( EDA_BaseStruct* StructFather ) :
EDA_BaseStruct( StructFather, NOT_USED )
/***************************************************************/
{
m_3D_Coord = NULL;
m_3D_CoordIndex = NULL;
m_3D_Points = 0;
m_3D_Coord = NULL;
m_3D_CoordIndex = NULL;
m_3D_Points = 0;
}
@ -113,7 +116,6 @@ Struct3D_Shape::Struct3D_Shape(EDA_BaseStruct * StructFather):
Struct3D_Shape:: ~Struct3D_Shape()
/***************************************/
{
delete m_3D_Coord;
delete m_3D_CoordIndex;
delete m_3D_Coord;
delete m_3D_CoordIndex;
}

View File

@ -214,7 +214,7 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
/* draw graphic items */
EDA_BaseStruct* PtStruct;
for( PtStruct = pcb->m_Drawings; PtStruct != NULL; PtStruct = PtStruct->Pnext )
for( PtStruct = pcb->m_Drawings; PtStruct != NULL; PtStruct = PtStruct->Next() )
{
switch( PtStruct->Type() )
{
@ -466,7 +466,7 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
/* Draw pads */
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis
for( ; pad != NULL; pad = (D_PAD*) pad->Pnext )
for( ; pad != NULL; pad = pad->Next() )
{
pad->Draw3D( glcanvas );
}
@ -477,9 +477,11 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
if( g_Parm_3D_Visu.m_Draw3DModule )
{
glPushMatrix();
glTranslatef( m_Pos.x * g_Parm_3D_Visu.m_BoardScale,
-m_Pos.y * g_Parm_3D_Visu.m_BoardScale,
g_Parm_3D_Visu.m_LayerZcoord[m_Layer] );
if( m_Orient )
{
glRotatef( (double) m_Orient / 10, 0.0, 0.0, 1.0 );
@ -491,7 +493,7 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
}
DataScale3D = g_Parm_3D_Visu.m_BoardScale * UNITS3D_TO_UNITSPCB;
for( ; Struct3D != NULL; Struct3D = (Struct3D_Master*) Struct3D->Pnext )
for( ; Struct3D != NULL; Struct3D = Struct3D->Next() )
{
if( !Struct3D->m_Shape3DName.IsEmpty() )
{
@ -507,7 +509,7 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
{
EDA_BaseStruct* Struct = m_Drawings;
glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis
for( ; Struct != NULL; Struct = Struct->Pnext )
for( ; Struct != NULL; Struct = Struct->Next() )
{
switch( Struct->Type() )
{

View File

@ -108,8 +108,7 @@ int Struct3D_Master:: ReadMaterial( FILE* file, int* LineNum )
mat_name = CONV_FROM_UTF8( text );
if( stricmp( command, "USE" ) == 0 )
{
for( material = m_Materials; material != NULL;
material = (S3D_Material*) material->Pnext )
for( material = m_Materials; material; material = material->Next() )
{
if( material->m_Name == mat_name )
{
@ -126,8 +125,8 @@ int Struct3D_Master:: ReadMaterial( FILE* file, int* LineNum )
{
material = new S3D_Material( this, mat_name );
material->Pnext = m_Materials;
m_Materials = material;
Insert( material );
while( GetLine( file, line, LineNum, 512 ) )
{
text = strtok( line, " \t\n\r" );
@ -297,7 +296,7 @@ double* ReadCoordsList( FILE* file, char* text_buffer, int* bufsize, int* LineNu
* 0.923880 -4.09802e-6 0.382683,
* 0.707107 -9.38186e-7 0.707107]
* }
*
*
* Return the coordinate list
* text_buffer contains the first line of this node :
* "coord Coordinate { point ["

View File

@ -1,7 +1,7 @@
/********************************************************/
/* 3d_struct.h : definition des structures de donnees */
/* pour la representation 3D des modules */
/********************************************************/
/********************************************************/
/* 3d_struct.h : definition des structures de donnees */
/* pour la representation 3D des modules */
/********************************************************/
#ifndef STRUCT_3D_H
#define STRUCT_3D_H
@ -9,128 +9,143 @@
#include "base_struct.h"
/* 3D modeler units -> PCB units conversion scale:
1 "3D unit modeler" = 1 unit wings3d = 2,54 mm = 0.1 inch */
* 1 "3D unit modeler" = 1 unit wings3d = 2,54 mm = 0.1 inch */
#define UNITS3D_TO_UNITSPCB 1000
class Struct3D_Master;
class Struct3D_Shape;
class S3D_Color /* This is a 3D color (R, G, G) 3 floats range 0 to 1.0*/
class S3D_Color /* This is a 3D color (R, G, G) 3 floats range 0 to 1.0*/
{
public:
double m_Red, m_Green, m_Blue;
double m_Red, m_Green, m_Blue;
public:
S3D_Color()
{
m_Red = m_Green = m_Blue = 0;
}
S3D_Color() {
m_Red = m_Green = m_Blue = 0;
}
};
class S3D_Vertex /* This is a 3D coordinate (3 float numbers: x,y,z coordinates)*/
class S3D_Vertex /* This is a 3D coordinate (3 float numbers: x,y,z coordinates)*/
{
public:
double x, y, z;
double x, y, z;
public:
S3D_Vertex();
S3D_Vertex();
};
class S3D_Material: public EDA_BaseStruct /* openGL "material" data*/
class S3D_Material : public EDA_BaseStruct /* openGL "material" data*/
{
public:
wxString m_Name;
S3D_Vertex m_DiffuseColor;
wxString m_Name;
S3D_Vertex m_DiffuseColor;
S3D_Vertex m_EmissiveColor;
S3D_Vertex m_SpecularColor;
float m_AmbientIntensity;
float m_Transparency;
float m_Shininess;
float m_AmbientIntensity;
float m_Transparency;
float m_Shininess;
public:
S3D_Material(Struct3D_Master * father, const wxString & name);
void SetMaterial();
S3D_Material( Struct3D_Master * father, const wxString &name );
S3D_Material* Next() const { return (S3D_Material*) Pnext; }
S3D_Material* Back() const { return (S3D_Material*) Pback; }
void SetMaterial();
};
/*******************************************/
class Struct3D_Master: public EDA_BaseStruct
class Struct3D_Master : public EDA_BaseStruct
/*******************************************/
/* Master structure for a 3D item description */
{
public:
wxString m_Shape3DName; /* 3D shape name in 3D library */
S3D_Vertex m_MatScale;
S3D_Vertex m_MatRotation;
S3D_Vertex m_MatPosition;
Struct3D_Shape * m_3D_Drawings;
S3D_Material *m_Materials;
wxString m_Shape3DName; /* 3D shape name in 3D library */
S3D_Vertex m_MatScale;
S3D_Vertex m_MatRotation;
S3D_Vertex m_MatPosition;
Struct3D_Shape* m_3D_Drawings;
S3D_Material* m_Materials;
public:
Struct3D_Master(EDA_BaseStruct * StructFather);
~Struct3D_Master();
Struct3D_Master( EDA_BaseStruct * StructFather );
~Struct3D_Master();
void Copy(Struct3D_Master * pattern);
int ReadData();
int ReadMaterial(FILE * file, int *LineNum);
int ReadChildren(FILE * file, int *LineNum);
int ReadShape(FILE * file, int *LineNum);
int ReadAppearance(FILE * file, int *LineNum);
int ReadGeometry(FILE * file, int *LineNum);
void Set_Object_Coords(S3D_Vertex * coord, int nbcoord );
Struct3D_Master* Next() const { return (Struct3D_Master*) Pnext; }
Struct3D_Master* Back() const { return (Struct3D_Master*) Pback; }
void Insert( S3D_Material* aMaterial )
{
aMaterial->SetNext( m_Materials );
m_Materials = aMaterial;
}
void Copy( Struct3D_Master* pattern );
int ReadData();
int ReadMaterial( FILE* file, int* LineNum );
int ReadChildren( FILE* file, int* LineNum );
int ReadShape( FILE* file, int* LineNum );
int ReadAppearance( FILE* file, int* LineNum );
int ReadGeometry( FILE* file, int* LineNum );
void Set_Object_Coords( S3D_Vertex* coord, int nbcoord );
};
/*********************************************/
class Struct3D_Shape: public EDA_BaseStruct
class Struct3D_Shape : public EDA_BaseStruct
/*********************************************/
/* decrit une forme complexe 3D */
{
public:
S3D_Vertex * m_3D_Coord;
int * m_3D_CoordIndex;
int m_3D_Points;
S3D_Vertex* m_3D_Coord;
int* m_3D_CoordIndex;
int m_3D_Points;
public:
Struct3D_Shape(EDA_BaseStruct * StructFather);
~Struct3D_Shape();
Struct3D_Shape( EDA_BaseStruct * StructFather );
~Struct3D_Shape();
int ReadData(FILE * file, int *LineNum);
Struct3D_Shape* Next() const { return (Struct3D_Shape*) Pnext; }
Struct3D_Shape* Back() const { return (Struct3D_Shape*) Pback; }
int ReadData( FILE* file, int* LineNum );
};
/*****************************************************************/
/* Classe pour afficher et editer un Vertex (triplet de valeurs),*/
/* en INCHES ou MM ou sans unites */
/*****************************************************************/
/* internal_unit is the internal unit number by inch:
- 1000 for EESchema
- 10000 for PcbNew
*/
* - 1000 for EESchema
* - 10000 for PcbNew
*/
class WinEDA_VertexCtrl
{
private:
int m_Units;
int m_Internal_Unit;
wxTextCtrl * m_XValueCtrl, * m_YValueCtrl, * m_ZValueCtrl;
wxStaticText * m_Text;
int m_Units;
int m_Internal_Unit;
wxTextCtrl* m_XValueCtrl, * m_YValueCtrl, * m_ZValueCtrl;
wxStaticText* m_Text;
public:
// Constructor and destructor
WinEDA_VertexCtrl(wxWindow *parent, const wxString & title,
wxBoxSizer * BoxSizer,
int units, int internal_unit);
~WinEDA_VertexCtrl();
// Constructor and destructor
WinEDA_VertexCtrl( wxWindow * parent, const wxString &title,
wxBoxSizer * BoxSizer,
int units, int internal_unit );
S3D_Vertex GetValue();
void SetValue(S3D_Vertex vertex);
void Enable(bool enbl);
void SetToolTip(const wxString & text);
~WinEDA_VertexCtrl();
S3D_Vertex GetValue();
void SetValue( S3D_Vertex vertex );
void Enable( bool enbl );
void SetToolTip( const wxString& text );
};
#endif /* STRUCT_3D_H */

View File

@ -5,6 +5,30 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2008-Nov-23 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+all
+ Made _protected_ EDA_BaseStruct's:
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) */
EDA_BaseStruct* m_Son; /* Linked list: Link (son struct) */
+ Split TRACK::Draw() out for SEGVIA
+ Added dlist.h & dlist.cpp for DLIST<> template. All the _inline_ list manipulation
code throughout the package is rediculous. I don't mind list traversal, only
list manipulation. DLIST<> templates can be used to consolidate reliable
list manipulation operations and get this code out of the mainline.
These functions are shared/inherited for any derivation, so only one copy exists
in the final program image. To use, simply declare e.g. DLIST<D_PAD> or similar.
See dlist.h, template class DLIST for function comments.
+ added EDA_BaseStruct::m_List to assist in debugging list manipulation functions.
+eeschema
Started on the edit component in schematic editor. It is not complete and
breaks the usefulness of the editor at this moment. Do not build this version
if you want to fully use eeschema. I will get something working in another day,
even if it is the old editor.
2008-Nov-22 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
++pcbnew

View File

@ -16,6 +16,7 @@ set(COMMON_SRCS
copy_to_clipboard.cpp
dcsvg.cpp
displlst.cpp
dlist.cpp
drawtxt.cpp
edaappl.cpp
eda_dde.cpp

View File

@ -446,14 +446,14 @@ void BASE_SCREEN::ClearUndoRedoList()
while( m_UndoList )
{
nextitem = m_UndoList->Pnext;
nextitem = m_UndoList->Next();
delete m_UndoList;
m_UndoList = nextitem;
}
while( m_RedoList )
{
nextitem = m_RedoList->Pnext;
nextitem = m_RedoList->Next();
delete m_RedoList;
m_RedoList = nextitem;
}
@ -469,32 +469,33 @@ void BASE_SCREEN::AddItemToUndoList( EDA_BaseStruct* newitem )
*/
{
int ii;
EDA_BaseStruct* item, * nextitem;
EDA_BaseStruct* item;
EDA_BaseStruct* nextitem;
if( newitem == NULL )
return;
newitem->Pnext = m_UndoList;
newitem->SetNext( m_UndoList );
m_UndoList = newitem;
/* Free first items, if count max reached */
for( ii = 0, item = m_UndoList; ii < m_UndoRedoCountMax; ii++ )
{
if( item->Pnext == NULL )
if( item->Next() == NULL )
return;
item = item->Pnext;
item = item->Next();
}
if( item == NULL )
return;
nextitem = item->Pnext;
item->Pnext = NULL; // Set end of chain
nextitem = item->Next();
item->SetNext( NULL ); // Set end of chain
// Delete the extra items
for( item = nextitem; item != NULL; item = nextitem )
{
nextitem = item->Pnext;
nextitem = item->Next();
delete item;
}
}
@ -510,26 +511,26 @@ void BASE_SCREEN::AddItemToRedoList( EDA_BaseStruct* newitem )
if( newitem == NULL )
return;
newitem->Pnext = m_RedoList;
newitem->SetNext( m_RedoList );
m_RedoList = newitem;
/* Free first items, if count max reached */
for( ii = 0, item = m_RedoList; ii < m_UndoRedoCountMax; ii++ )
{
if( item->Pnext == NULL )
if( item->Next() == NULL )
break;
item = item->Pnext;
item = item->Next();
}
if( item == NULL )
return;
nextitem = item->Pnext;
item->Pnext = NULL; // Set end of chain
nextitem = item->Next();
item->SetNext( NULL ); // Set end of chain
// Delete the extra items
for( item = nextitem; item != NULL; item = nextitem )
{
nextitem = item->Pnext;
nextitem = item->Next();
delete item;
}
}
@ -542,7 +543,7 @@ EDA_BaseStruct* BASE_SCREEN::GetItemFromUndoList()
EDA_BaseStruct* item = m_UndoList;
if( item )
m_UndoList = item->Pnext;
m_UndoList = item->Next();
return item;
}
@ -554,7 +555,7 @@ EDA_BaseStruct* BASE_SCREEN::GetItemFromRedoList()
EDA_BaseStruct* item = m_RedoList;
if( item )
m_RedoList = item->Pnext;
m_RedoList = item->Next();
return item;
}

View File

@ -43,15 +43,16 @@ void EDA_BaseStruct::InitVars()
/********************************************/
{
m_StructType = TYPE_NOT_INIT;
Pnext = NULL; /* Linked list: Link (next struct) */
Pback = NULL; /* Linked list: Link (previous struct) */
m_Parent = NULL; /* Linked list: Link (parent struct) */
m_Son = NULL; /* Linked list: Link (son struct) */
m_Image = NULL; /* Link to an image copy for undelete or abort command */
m_Flags = 0; /* flags for editions and other */
m_TimeStamp = 0; // Time stamp used for logical links
Pnext = NULL; // Linked list: Link (next struct)
Pback = NULL; // Linked list: Link (previous struct)
m_Parent = NULL; // Linked list: Link (parent struct)
m_Son = NULL; // Linked list: Link (son struct)
m_List = NULL; // I am not on any list yet
m_Image = NULL; // Link to an image copy for undelete or abort command
m_Flags = 0; // flags for editions and other
m_TimeStamp = 0; // Time stamp used for logical links
m_Status = 0;
m_Selected = 0; /* Used by block commands, and selective editing */
m_Selected = 0; // Used by block commands, and selective editing
}
@ -536,11 +537,11 @@ void EDA_TextStruct::CreateDrawData()
{
x0 = 0; y0 = 0;
#if defined(wxUSE_UNICODE) && defined(KICAD_CYRILLIC)
AsciiCode = (*ptr) & 0x7FF;
if ( AsciiCode > 0x40F && AsciiCode < 0x450 ) // big small Cyr
AsciiCode = utf8_to_ascii[AsciiCode - 0x410] & 0xFF;
else
AsciiCode = AsciiCode & 0xFF;
AsciiCode = (*ptr) & 0x7FF;
if ( AsciiCode > 0x40F && AsciiCode < 0x450 ) // big small Cyr
AsciiCode = utf8_to_ascii[AsciiCode - 0x410] & 0xFF;
else
AsciiCode = AsciiCode & 0xFF;
#else
AsciiCode = (*ptr) & 255;
#endif

View File

@ -254,7 +254,7 @@ void InitBlockLocateDatas( WinEDA_DrawPanel* Panel, const wxPoint& startpos )
screen->BlockLocate.m_State = STATE_BLOCK_INIT;
screen->BlockLocate.SetOrigin( startpos );
screen->BlockLocate.SetSize( wxSize( 0, 0 ) );
screen->BlockLocate.Pnext = NULL;
screen->BlockLocate.SetNext( NULL );
screen->BlockLocate.m_BlockDrawStruct = NULL;
Panel->ManageCurseur = DrawAndSizingBlockOutlines;
Panel->ForceCloseManageCurseur = AbortBlockCurrentCommand;

View File

@ -128,7 +128,7 @@ void DHEAD::Insert( EDA_BaseStruct* aNewElement, EDA_BaseStruct* aAfterMe )
void DHEAD::Remove( EDA_BaseStruct* aElement )
{
wxASSERT( aElement )
wxASSERT( aElement );
wxASSERT( aElement->GetList() == this );
if( aElement->Next() )

View File

@ -5,36 +5,37 @@ COMMON = ../include/colors.h
OBJECTS= \
confirm.o \
base_struct.o\
copy_to_clipboard.o\
basicframe.o\
confirm.o \
base_struct.o\
copy_to_clipboard.o\
basicframe.o\
class_drawpickedstruct.o\
common_plot_functions.o\
common_plotPS_functions.o\
common_plotHPGL_functions.o\
hotkeys_basic.o\
drawtxt.o \
about_kicad.o\
wxwineda.o \
string.o \
gr_basic.o\
gestfich.o\
trigo.o\
selcolor.o\
common.o\
eda_doc.o\
toolbars.o\
displlst.o \
edaappl.o\
block_commande.o\
msgpanel.o\
projet_config.o\
get_component_dialog.o\
eda_dde.o\
worksheet.o\
base_screen.o\
dcsvg.o
common_plot_functions.o\
common_plotPS_functions.o\
common_plotHPGL_functions.o\
dlist.o \
hotkeys_basic.o\
drawtxt.o \
about_kicad.o\
wxwineda.o \
string.o \
gr_basic.o\
gestfich.o\
trigo.o\
selcolor.o\
common.o\
eda_doc.o\
toolbars.o\
displlst.o \
edaappl.o\
block_commande.o\
msgpanel.o\
projet_config.o\
get_component_dialog.o\
eda_dde.o\
worksheet.o\
base_screen.o\
dcsvg.o
ifdef KICAD_PYTHON
OBJECTS += pyhandler.o
@ -86,8 +87,8 @@ trigo.o: trigo.cpp ../include/trigo.h
bitmaps.o: bitmaps.cpp ../include/bitmaps.h
edaappl.o: edaappl.cpp $(COMMON) ../include/worksheet.h\
../include/common.h ../include/gr_basic.h\
../include/build_version.h
../include/common.h ../include/gr_basic.h\
../include/build_version.h
eda_dde.o: eda_dde.cpp $(COMMON) ../include/eda_dde.h

View File

@ -36,7 +36,8 @@ set(EESCHEMA_SRCS
# dialog_cmp_graphic_properties.cpp
dialog_create_component.cpp
# dialog_edit_component_in_lib.cpp
# dialog_edit_component_in_schematic.cpp
dialog_edit_component_in_schematic_fbp.cpp
dialog_edit_component_in_schematic.cpp
# dialog_edit_label.cpp
dialog_eeschema_config.cpp
dialog_erc.cpp

View File

@ -64,7 +64,7 @@ void ReAnnotatePowerSymbolsOnly( void )
sheet = SheetList.GetNext() )
{
EDA_BaseStruct* DrawList = sheet->LastDrawList();
for( ; DrawList != NULL; DrawList = DrawList->Pnext )
for( ; DrawList != NULL; DrawList = DrawList->Next() )
{
if( DrawList->Type() != TYPE_SCH_COMPONENT )
continue;
@ -207,7 +207,7 @@ void WinEDA_SchematicFrame::DeleteAnnotation( bool aCurrentSheetOnly, bool aRedr
while( screen )
{
strct = screen->EEDrawList;
for( ; strct; strct = strct->Pnext )
for( ; strct; strct = strct->Next() )
{
if( strct->Type() == TYPE_SCH_COMPONENT )
{
@ -348,7 +348,7 @@ int ListeComposants( CmpListStruct* BaseListeCmp, DrawSheetPath* sheet )
SCH_COMPONENT* DrawLibItem;
EDA_LibComponentStruct* Entry;
for( ; DrawList; DrawList = DrawList->Pnext )
for( ; DrawList; DrawList = DrawList->Next() )
{
if( DrawList->Type() == TYPE_SCH_COMPONENT )
{

View File

@ -316,7 +316,7 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC )
if( block->m_Command == BLOCK_ABORT )
{ /* clear struct.m_Flags */
EDA_BaseStruct* Struct;
for( Struct = GetScreen()->EEDrawList; Struct != NULL; Struct = Struct->Pnext )
for( Struct = GetScreen()->EEDrawList; Struct != NULL; Struct = Struct->Next() )
Struct->m_Flags = 0;
}
@ -502,7 +502,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
(SCH_ITEM*)PickedList->m_PickedStruct,
PtBlock->m_MoveVector.x,
PtBlock->m_MoveVector.y );
PickedList = (DrawPickedStruct*) PickedList->Pnext;
PickedList = (DrawPickedStruct*) PickedList->Next();
}
}
else
@ -535,7 +535,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
(SCH_ITEM*)PickedList->m_PickedStruct,
PtBlock->m_MoveVector.x,
PtBlock->m_MoveVector.y );
PickedList = (DrawPickedStruct*) PickedList->Pnext;
PickedList = (DrawPickedStruct*) PickedList->Next();
}
}
else
@ -729,7 +729,7 @@ void MirrorOneStruct( SCH_ITEM * DrawStruct, wxPoint& Center )
{
MirrorYPoint( DrawSheetLabel->m_Pos, Center );
DrawSheetLabel->m_Edge = DrawSheetLabel->m_Edge ? 0 : 1;
DrawSheetLabel = (Hierarchical_PIN_Sheet_Struct*) DrawSheetLabel->Pnext;
DrawSheetLabel = (Hierarchical_PIN_Sheet_Struct*) DrawSheetLabel->Next();
}
break;
@ -852,7 +852,7 @@ static SCH_ITEM * CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREEN* sc
}
SetStructFather( Struct, screen );
PickedList = (DrawPickedStruct*) PickedList->Pnext;
PickedList = (DrawPickedStruct*) PickedList->Next();
}
RedrawStructList( panel, DC, NewDrawStruct, GR_DEFAULT_DRAWMODE );
@ -860,7 +860,7 @@ static SCH_ITEM * CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREEN* sc
PickedList = (DrawPickedStruct*) NewDrawStruct;
while( PickedList )
{
PickedList->m_PickedStruct->Pnext = screen->EEDrawList;
PickedList->m_PickedStruct->SetNext( screen->EEDrawList );
screen->EEDrawList = PickedList->m_PickedStruct;
PickedList = PickedList->Next();
}
@ -888,7 +888,7 @@ static SCH_ITEM * CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREEN* sc
{
DrawSheetStruct* sheet = (DrawSheetStruct*) NewDrawStruct;
sheet->m_TimeStamp = GetTimeStamp();
sheet->m_Son = NULL;
sheet->SetSon( NULL );
break;
}
@ -901,7 +901,7 @@ static SCH_ITEM * CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREEN* sc
RedrawOneStruct( panel, DC, NewDrawStruct, GR_DEFAULT_DRAWMODE );
SetStructFather( NewDrawStruct, screen );
NewDrawStruct->Pnext = screen->EEDrawList;
NewDrawStruct->SetNext( screen->EEDrawList );
screen->EEDrawList = NewDrawStruct;
}
@ -934,7 +934,7 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM * DrawStruct )
{
/* Cette stucture est rattachee a une feuille, et n'est pas
* accessible par la liste globale directement */
frame->SaveCopyInUndoList( (SCH_ITEM*) ( (Hierarchical_PIN_Sheet_Struct*) DrawStruct )->m_Parent, IS_CHANGED );
frame->SaveCopyInUndoList( (SCH_ITEM*) ( (Hierarchical_PIN_Sheet_Struct*) DrawStruct )->GetParent(), IS_CHANGED );
frame->DeleteSheetLabel( DC ? true : false , (Hierarchical_PIN_Sheet_Struct*) DrawStruct );
return;
}
@ -948,7 +948,8 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM * DrawStruct )
SCH_ITEM * item = cur->m_PickedStruct;
screen->RemoveFromDrawList( item );
panel->PostDirtyRect( item->GetBoundingBox() );
item->Pnext = item->Pback = NULL;
item->SetNext( 0 );
item->SetBack( 0 );
item->m_Flags = IS_DELETED;
}
@ -962,7 +963,9 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM * DrawStruct )
panel->PostDirtyRect( DrawStruct->GetBoundingBox() );
/* Unlink the structure */
DrawStruct->Pnext = DrawStruct->Pback = NULL; // Only one struct -> no link
DrawStruct->SetNext( 0 );
DrawStruct->SetBack( 0 ); // Only one struct -> no link
if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE )
{
frame->SaveCopyInUndoList( DrawStruct, IS_DELETED ); // Currently In TEST
@ -1005,14 +1008,14 @@ SCH_ITEM * SaveStructListForPaste( SCH_ITEM * DrawStruct )
EDA_BaseStruct* item = g_BlockSaveDataList, * next_item;
while( item )
{
next_item = item->Pnext;
next_item = item->Next();
delete item;
item = next_item;
}
}
g_BlockSaveDataList = DrawStructCopy;
DrawStructCopy->m_Parent = NULL;
g_BlockSaveDataList = DrawStructCopy;
DrawStructCopy->SetParent( NULL );
return DrawStructCopy;
}
@ -1051,14 +1054,14 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC )
( (SCH_COMPONENT*) Struct )->ClearAnnotation(NULL);
SetStructFather( Struct, GetScreen() );
}
PickedList = (DrawPickedStruct*) PickedList->Pnext;
PickedList = (DrawPickedStruct*) PickedList->Next();
}
RedrawStructList( DrawPanel, DC, DrawStruct, GR_DEFAULT_DRAWMODE );
for( PickedList = (DrawPickedStruct*) DrawStruct; PickedList != NULL; )
{
SCH_ITEM * Struct = PickedList->m_PickedStruct;
Struct->Pnext = GetScreen()->EEDrawList;
Struct->SetNext( GetScreen()->EEDrawList );
SetStructFather( Struct, GetScreen() );
GetScreen()->EEDrawList = Struct;
PickedList = PickedList->Next();
@ -1076,7 +1079,7 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC )
}
SetStructFather( DrawStruct, GetScreen() );
RedrawOneStruct( DrawPanel, DC, DrawStruct, GR_DEFAULT_DRAWMODE );
DrawStruct->Pnext = GetScreen()->EEDrawList;
DrawStruct->SetNext( GetScreen()->EEDrawList );
GetScreen()->EEDrawList = DrawStruct;
SaveCopyInUndoList( DrawStruct, IS_NEW );
}
@ -1343,7 +1346,7 @@ SCH_ITEM * DuplicateStruct( SCH_ITEM * DrawStruct )
if( NewDrawStruct == NULL )
NewDrawStruct = NewPickedItem;
if( LastPickedItem )
LastPickedItem->Pnext = NewPickedItem;
LastPickedItem->SetNext( NewPickedItem );
LastPickedItem = NewPickedItem;
NewPickedItem->m_PickedStruct =
DuplicateStruct( PickedList->m_PickedStruct );
@ -1469,7 +1472,7 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )
{
if( SLabel->Type() == DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE )
AddPickedItem( screen, SLabel->m_Pos );
SLabel = (Hierarchical_PIN_Sheet_Struct*) SLabel->Pnext;
SLabel = (Hierarchical_PIN_Sheet_Struct*) SLabel->Next();
}
}
@ -1495,7 +1498,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
while( DrawStructs )
{
Struct = DrawStructs->m_PickedStruct;
DrawStructs = (DrawPickedStruct*) DrawStructs->Pnext;
DrawStructs = (DrawPickedStruct*) DrawStructs->Next();
switch( Struct->Type() )
{
@ -1537,8 +1540,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
if( STRUCT->m_Pos != position )
break;
DrawStructs = new DrawPickedStruct( Struct );
DrawStructs->Pnext =
(DrawPickedStruct*) screen->BlockLocate.m_BlockDrawStruct;
DrawStructs->SetNext( screen->BlockLocate.m_BlockDrawStruct );
screen->BlockLocate.m_BlockDrawStruct = (EDA_BaseStruct*) DrawStructs;
break;
@ -1550,8 +1552,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
if( STRUCT->m_Start == position )
{
DrawStructs = new DrawPickedStruct( Struct );
DrawStructs->Pnext =
(DrawPickedStruct*) screen->BlockLocate.m_BlockDrawStruct;
DrawStructs->SetNext( screen->BlockLocate.m_BlockDrawStruct );
screen->BlockLocate.m_BlockDrawStruct = (EDA_BaseStruct*) DrawStructs;
Struct->m_Flags = SELECTED | ENDPOINT | STARTPOINT;
Struct->m_Flags &= ~STARTPOINT;
@ -1559,8 +1560,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
else if( STRUCT->m_End == position )
{
DrawStructs = new DrawPickedStruct( Struct );
DrawStructs->Pnext =
(DrawPickedStruct*) screen->BlockLocate.m_BlockDrawStruct;
DrawStructs->SetNext( screen->BlockLocate.m_BlockDrawStruct );
screen->BlockLocate.m_BlockDrawStruct = (EDA_BaseStruct*) DrawStructs;
Struct->m_Flags = SELECTED | ENDPOINT | STARTPOINT;
Struct->m_Flags &= ~ENDPOINT;
@ -1581,8 +1581,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
if( STRUCT->m_Pos != position )
break;
DrawStructs = new DrawPickedStruct( Struct );
DrawStructs->Pnext =
(DrawPickedStruct*) screen->BlockLocate.m_BlockDrawStruct;
DrawStructs->SetNext( screen->BlockLocate.m_BlockDrawStruct );
screen->BlockLocate.m_BlockDrawStruct = (EDA_BaseStruct*) DrawStructs;
Struct->m_Flags |= SELECTED;
break;
@ -1596,8 +1595,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
if( STRUCT->m_Pos != position )
break;
DrawStructs = new DrawPickedStruct( Struct );
DrawStructs->Pnext =
(DrawPickedStruct*) screen->BlockLocate.m_BlockDrawStruct;
DrawStructs->SetNext( screen->BlockLocate.m_BlockDrawStruct );
screen->BlockLocate.m_BlockDrawStruct = (EDA_BaseStruct*) DrawStructs;
Struct->m_Flags |= SELECTED;
break;
@ -1622,8 +1620,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
if( STRUCT->m_Pos != position )
break;
DrawStructs = new DrawPickedStruct( Struct );
DrawStructs->Pnext =
(DrawPickedStruct*) screen->BlockLocate.m_BlockDrawStruct;
DrawStructs->SetNext( screen->BlockLocate.m_BlockDrawStruct );
screen->BlockLocate.m_BlockDrawStruct = (EDA_BaseStruct*) DrawStructs;
Struct->m_Flags |= SELECTED;
break;
@ -1636,8 +1633,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
if( STRUCT->m_Pos != position )
break;
DrawStructs = new DrawPickedStruct( Struct );
DrawStructs->Pnext =
(DrawPickedStruct*) screen->BlockLocate.m_BlockDrawStruct;
DrawStructs->SetNext( screen->BlockLocate.m_BlockDrawStruct );
screen->BlockLocate.m_BlockDrawStruct = (EDA_BaseStruct*) DrawStructs;
Struct->m_Flags |= SELECTED;
break;

View File

@ -517,7 +517,7 @@ void CopyMarkedItems( EDA_LibComponentStruct* LibEntry, wxPoint offset )
item->m_Selected = 0;
LibEDA_BaseStruct* newitem = CopyDrawEntryStruct( NULL, item );
newitem->m_Selected = IS_SELECTED;
newitem->Pnext = LibEntry->m_Drawings;
newitem->SetNext( LibEntry->m_Drawings );
LibEntry->m_Drawings = newitem;
}

View File

@ -301,7 +301,7 @@ int BuildComponentsListFromSchematic( ListComponent* aList )
itemCount++;
DrawLibItem = (SCH_COMPONENT*) SchItem;
DrawLibItem->m_Parent = sheet->LastScreen();
DrawLibItem->SetParent( sheet->LastScreen() );
if( aList )
{
aList->m_Comp = DrawLibItem;
@ -362,29 +362,29 @@ static int GenListeGLabels( ListLabel* list )
break;
case DRAW_SHEET_STRUCT_TYPE:
{
#define Sheet ( (DrawSheetStruct*) DrawList )
SheetLabel = Sheet->m_Label;
while( SheetLabel != NULL )
{
if( list )
#define Sheet ( (DrawSheetStruct*) DrawList )
SheetLabel = Sheet->m_Label;
while( SheetLabel != NULL )
{
list->m_LabelType = DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE;
snprintf( list->m_SheetPath, sizeof(list->m_SheetPath),
"%s", CONV_TO_UTF8( path ) );
list->m_Label = SheetLabel;
list++;
if( list )
{
list->m_LabelType = DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE;
snprintf( list->m_SheetPath, sizeof(list->m_SheetPath),
"%s", CONV_TO_UTF8( path ) );
list->m_Label = SheetLabel;
list++;
}
itemCount++;
SheetLabel = SheetLabel->Next();
}
itemCount++;
SheetLabel = (Hierarchical_PIN_Sheet_Struct*) (SheetLabel->Pnext);
}
}
break;
default:
break;
}
DrawList = DrawList->Pnext;
DrawList = DrawList->Next();
}
}
@ -750,13 +750,13 @@ int WinEDA_Build_BOM_Frame::PrintComponentsListByRef( FILE* f,
if( CompactForm )
{
fprintf( f, "%c%s", s_ExportSeparatorSymbol, CONV_TO_UTF8( msg ) );
msg = m_Parent->GetXYSheetReferences( (BASE_SCREEN*)DrawLibItem->m_Parent, DrawLibItem->m_Pos );
msg = m_Parent->GetXYSheetReferences( (BASE_SCREEN*)DrawLibItem->GetParent(), DrawLibItem->m_Pos );
fprintf( f, "%c%s)", s_ExportSeparatorSymbol, CONV_TO_UTF8( msg ) );
}
else
{
fprintf( f, " (Sheet %s)", CONV_TO_UTF8( msg ) );
msg = m_Parent->GetXYSheetReferences( (BASE_SCREEN*)DrawLibItem->m_Parent, DrawLibItem->m_Pos );
msg = m_Parent->GetXYSheetReferences( (BASE_SCREEN*)DrawLibItem->GetParent(), DrawLibItem->m_Pos );
fprintf( f, " (loc %s)", CONV_TO_UTF8( msg ) );
}
}
@ -819,7 +819,7 @@ int WinEDA_Build_BOM_Frame::PrintComponentsListByVal( FILE* f,
if( ( Multi > 1 ) && aIncludeSubComponents )
{
#if defined(KICAD_GOST)
#if defined(KICAD_GOST)
Unit = aList[ii].m_Unit + '1' - 1;
}
@ -837,7 +837,7 @@ int WinEDA_Build_BOM_Frame::PrintComponentsListByVal( FILE* f,
{
msg = aList[ii].m_SheetList.PathHumanReadable();
fprintf( f, " (Sheet %s)", CONV_TO_UTF8( msg ) );
msg = m_Parent->GetXYSheetReferences( (BASE_SCREEN*)DrawLibItem->m_Parent, DrawLibItem->m_Pos );
msg = m_Parent->GetXYSheetReferences( (BASE_SCREEN*)DrawLibItem->GetParent(), DrawLibItem->m_Pos );
fprintf( f, " (loc %s)", CONV_TO_UTF8( msg ) );
}

View File

@ -50,7 +50,7 @@ SCH_ITEM* SCH_SCREEN::ExtractWires( bool CreateCopy )
case DRAW_JUNCTION_STRUCT_TYPE:
case DRAW_SEGMENT_STRUCT_TYPE:
RemoveFromDrawList( item );
item->Pnext = List;
item->SetNext( List );
List = item;
if( CreateCopy )
{
@ -58,7 +58,7 @@ SCH_ITEM* SCH_SCREEN::ExtractWires( bool CreateCopy )
new_item = ( (DrawJunctionStruct*) item )->GenCopy();
else
new_item = ( (EDA_DrawLineStruct*) item )->GenCopy();
new_item->Pnext = EEDrawList;
new_item->SetNext( EEDrawList );
EEDrawList = new_item;
}
break;
@ -79,7 +79,8 @@ static void RestoreOldWires( SCH_SCREEN* screen )
/* Replace the wires in screen->EEDrawList by s_OldWiresList wires.
*/
{
SCH_ITEM* item, * next_item;
SCH_ITEM* item;
SCH_ITEM* next_item;
for( item = screen->EEDrawList; item != NULL; item = next_item )
{
@ -101,7 +102,8 @@ static void RestoreOldWires( SCH_SCREEN* screen )
while( s_OldWiresList )
{
next_item = s_OldWiresList->Next();
s_OldWiresList->Pnext = screen->EEDrawList,
s_OldWiresList->SetNext( screen->EEDrawList );
screen->EEDrawList = s_OldWiresList;
s_OldWiresList = next_item;
}
@ -166,8 +168,8 @@ void WinEDA_SchematicFrame::BeginSegment( wxDC* DC, int type )
{
nextsegment = newsegment->GenCopy();
nextsegment->m_Flags = IS_NEW;
newsegment->Pnext = nextsegment;
nextsegment->Pback = newsegment;
newsegment->SetNext( nextsegment );
nextsegment->SetBack( newsegment );
}
GetScreen()->SetCurItem( newsegment );
DrawPanel->ManageCurseur = Segment_in_Ghost;
@ -176,7 +178,7 @@ void WinEDA_SchematicFrame::BeginSegment( wxDC* DC, int type )
}
else /* Trace en cours: Placement d'un point supplementaire */
{
nextsegment = (EDA_DrawLineStruct*) oldsegment->Pnext;
nextsegment = oldsegment->Next();
if( !g_HVLines )
{ /* if only one segment is needed and the current is has len = 0, do not create a new one*/
if( oldsegment->IsNull() )
@ -198,7 +200,7 @@ void WinEDA_SchematicFrame::BeginSegment( wxDC* DC, int type )
}
/* Placement en liste generale */
oldsegment->Pnext = GetScreen()->EEDrawList;
oldsegment->SetNext( GetScreen()->EEDrawList );
GetScreen()->EEDrawList = oldsegment;
DrawPanel->CursorOff( DC ); // Erase schematic cursor
RedrawOneStruct( DrawPanel, DC, oldsegment, GR_DEFAULT_DRAWMODE );
@ -209,10 +211,10 @@ void WinEDA_SchematicFrame::BeginSegment( wxDC* DC, int type )
{
newsegment = nextsegment->GenCopy();
nextsegment->m_Start = newsegment->m_End;
nextsegment->Pnext = NULL;
nextsegment->Pback = newsegment;
newsegment->Pnext = nextsegment;
newsegment->Pback = NULL;
nextsegment->SetNext( NULL );
nextsegment->SetBack( newsegment );
newsegment->SetNext( nextsegment );
newsegment->SetBack( NULL );
}
else
{
@ -256,16 +258,16 @@ void WinEDA_SchematicFrame::EndSegment( wxDC* DC )
lastsegment = firstsegment;
while( lastsegment )
{
EDA_DrawLineStruct* nextsegment = (EDA_DrawLineStruct*) lastsegment->Pnext;
EDA_DrawLineStruct* nextsegment = lastsegment->Next();
if( lastsegment->IsNull() )
{
EDA_DrawLineStruct* previous_segment = (EDA_DrawLineStruct*) lastsegment->Pback;
EDA_DrawLineStruct* previous_segment = lastsegment->Back();
if( firstsegment == lastsegment )
firstsegment = nextsegment;
if( nextsegment )
nextsegment->Pback = NULL;
nextsegment->SetBack( NULL );
if( previous_segment )
previous_segment->Pnext = nextsegment;
previous_segment->SetNext( nextsegment );
delete lastsegment;
}
lastsegment = nextsegment;
@ -276,8 +278,8 @@ void WinEDA_SchematicFrame::EndSegment( wxDC* DC )
while( segment )
{
lastsegment = segment;
segment = (EDA_DrawLineStruct*) segment->Pnext;
lastsegment->Pnext = GetScreen()->EEDrawList;
segment = segment->Next();
lastsegment->SetNext( GetScreen()->EEDrawList );
GetScreen()->EEDrawList = lastsegment;
}
@ -311,7 +313,7 @@ void WinEDA_SchematicFrame::EndSegment( wxDC* DC )
g_ItemToRepeat = segment;
}
segment->m_Flags = 0;
segment = (EDA_DrawLineStruct*) segment->Pnext;
segment = segment->Next();
}
// Automatic place of a junction on the end point, if needed
@ -348,7 +350,7 @@ void WinEDA_SchematicFrame::EndSegment( wxDC* DC )
break;
}
item = item->Pnext;
item = item->Next();
}
@ -386,7 +388,7 @@ static void Segment_in_Ghost( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{
if( !segment->IsNull() ) // Redraw if segment lengtht != 0
RedrawOneStruct( panel, DC, segment, g_XorMode, color );
segment = (EDA_DrawLineStruct*) segment->Pnext;
segment = segment->Next();
}
}
@ -403,7 +405,7 @@ static void Segment_in_Ghost( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{
if( !segment->IsNull() ) // Redraw if segment lengtht != 0
RedrawOneStruct( panel, DC, segment, g_XorMode, color );
segment = (EDA_DrawLineStruct*) segment->Pnext;
segment = segment->Next();
}
}
@ -416,7 +418,7 @@ static void ComputeBreakPoint( EDA_DrawLineStruct* segment, const wxPoint& new_p
* with the 2 segments kept H or V only
*/
{
EDA_DrawLineStruct* nextsegment = (EDA_DrawLineStruct*) segment->Pnext;
EDA_DrawLineStruct* nextsegment = segment->Next();
wxPoint middle_position = new_pos;
if( nextsegment == NULL )
@ -543,7 +545,7 @@ DrawJunctionStruct* WinEDA_SchematicFrame::CreateNewJunctionStruct(
RedrawOneStruct( DrawPanel, DC, NewJunction, GR_DEFAULT_DRAWMODE );
DrawPanel->CursorOn( DC ); // Display schematic cursor
NewJunction->Pnext = GetScreen()->EEDrawList;
NewJunction->SetNext( GetScreen()->EEDrawList );
GetScreen()->EEDrawList = NewJunction;
GetScreen()->SetModify();
if( PutInUndoList )
@ -568,7 +570,7 @@ DrawNoConnectStruct* WinEDA_SchematicFrame::CreateNewNoConnectStruct( wxDC* DC )
RedrawOneStruct( DrawPanel, DC, NewNoConnect, GR_DEFAULT_DRAWMODE );
DrawPanel->CursorOn( DC ); // Display schematic cursor
NewNoConnect->Pnext = GetScreen()->EEDrawList;
NewNoConnect->SetNext( GetScreen()->EEDrawList );
GetScreen()->EEDrawList = NewNoConnect;
GetScreen()->SetModify();
SaveCopyInUndoList( NewNoConnect, IS_NEW );
@ -729,7 +731,7 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
if( g_ItemToRepeat )
{
g_ItemToRepeat->Pnext = GetScreen()->EEDrawList;
g_ItemToRepeat->SetNext( GetScreen()->EEDrawList );
GetScreen()->EEDrawList = g_ItemToRepeat;
TestDanglingEnds( GetScreen()->EEDrawList, NULL );
RedrawOneStruct( DrawPanel, DC, g_ItemToRepeat, GR_DEFAULT_DRAWMODE );

View File

@ -146,7 +146,7 @@ DrawSheetStruct* DrawSheetStruct::GenCopy()
newitem->m_Size = m_Size;
newitem->m_Parent = m_Parent;
newitem->SetParent( m_Parent );
newitem->m_TimeStamp = GetTimeStamp();
newitem->m_FileName = m_FileName;
@ -161,15 +161,15 @@ DrawSheetStruct* DrawSheetStruct::GenCopy()
if( label )
{
Slabel = newitem->m_Label = label->GenCopy();
Slabel->m_Parent = newitem;
Slabel->SetParent( newitem );
label = label->Next();
}
while( label )
{
Slabel->Pnext = label->GenCopy();
Slabel = (Hierarchical_PIN_Sheet_Struct*) Slabel->Pnext;
Slabel->m_Parent = newitem;
Slabel->SetNext( label->GenCopy() );
Slabel = Slabel->Next();
Slabel->SetParent( newitem );
label = label->Next();
}
@ -202,14 +202,14 @@ void DrawSheetStruct::SwapData( DrawSheetStruct* copyitem )
Hierarchical_PIN_Sheet_Struct* label = m_Label;
while( label )
{
label->m_Parent = this;
label->SetParent( this );
label = label->Next();
}
label = copyitem->m_Label;
while( label )
{
label->m_Parent = copyitem;
label->SetParent( copyitem );
label = label->Next();
}
}
@ -257,13 +257,15 @@ void DrawSheetStruct::CleanupSheet( WinEDA_SchematicFrame* aFrame, bool aRedraw
EDA_BaseStruct* DrawStruct = m_AssociatedScreen->EEDrawList;
SCH_HIERLABEL* HLabel = NULL;
for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext )
for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Next() )
{
if( DrawStruct->Type() != TYPE_SCH_HIERLABEL )
continue;
HLabel = (SCH_HIERLABEL*) DrawStruct;
if( Pinsheet->m_Text.CmpNoCase( HLabel->m_Text ) == 0 )
break; // Found!
HLabel = NULL;
}
@ -375,7 +377,7 @@ int DrawSheetStruct::ComponentCount()
if( m_AssociatedScreen )
{
EDA_BaseStruct* bs;
for( bs = m_AssociatedScreen->EEDrawList; bs != NULL; bs = bs->Pnext )
for( bs = m_AssociatedScreen->EEDrawList; bs != NULL; bs = bs->Next() )
{
if( bs->Type() == TYPE_SCH_COMPONENT )
{
@ -416,7 +418,7 @@ bool DrawSheetStruct::SearchHierarchy( wxString filename, SCH_SCREEN** screen )
if( ss->SearchHierarchy( filename, screen ) )
return true;
}
strct = strct->Pnext;
strct = strct->Next();
}
}
return false;
@ -446,7 +448,7 @@ bool DrawSheetStruct::LocatePathOfScreen( SCH_SCREEN* screen, DrawSheetPath* lis
if( ss->LocatePathOfScreen( screen, list ) )
return true;
}
strct = strct->Pnext;
strct = strct->Next();
}
list->Pop();
@ -488,7 +490,7 @@ bool DrawSheetStruct::Load( WinEDA_SchematicFrame* frame )
if( !sheetstruct->Load( frame ) )
success = false;
}
bs = bs->Pnext;
bs = bs->Next();
}
}
}
@ -506,7 +508,7 @@ int DrawSheetStruct::CountSheets()
if( m_AssociatedScreen )
{
EDA_BaseStruct* strct = m_AssociatedScreen->EEDrawList;
for( ; strct; strct = strct->Pnext )
for( ; strct; strct = strct->Next() )
{
if( strct->Type() == DRAW_SHEET_STRUCT_TYPE )
{
@ -787,7 +789,7 @@ void DrawSheetPath::UpdateAllScreenReferences()
component->GetField(REFERENCE)->m_Text = component->GetRef( this );
component->m_Multi = component->GetUnitSelection( this );
}
t = t->Pnext;
t = t->Next();
}
}

View File

@ -41,7 +41,7 @@ void FreeLibraryEntry( LibCmpEntry* Entry )
/* Used by PQFreeFunc() to delete all entries
*/
{
SAFE_DELETE( Entry );
SAFE_DELETE( Entry );
}
@ -196,8 +196,9 @@ EDA_LibComponentStruct::~EDA_LibComponentStruct()
field = Fields; Fields = NULL;
while( field )
{
TempField = field; field = (LibDrawField*) field->Pnext;
SAFE_DELETE( TempField );
TempField = field;
field = field->Next();
SAFE_DELETE( TempField );
}
/* suppression des elements dependants */
@ -205,7 +206,7 @@ EDA_LibComponentStruct::~EDA_LibComponentStruct()
while( DrawItem )
{
NextDrawItem = DrawItem->Next();
SAFE_DELETE( DrawItem );
SAFE_DELETE( DrawItem );
DrawItem = NextDrawItem;
}
}

View File

@ -28,7 +28,7 @@ void SetStructFather( EDA_BaseStruct* Struct, BASE_SCREEN* Screen )
case DRAW_SHEET_STRUCT_TYPE:
case DRAW_MARKER_STRUCT_TYPE:
case DRAW_NOCONNECT_STRUCT_TYPE:
Struct->m_Parent = Screen;
Struct->SetParent( Screen );
break;
case DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE:
@ -138,9 +138,9 @@ void SCH_SCREEN::RemoveFromDrawList( SCH_ITEM * DrawStruct )
EDA_BaseStruct* DrawList = EEDrawList;
while( DrawList && DrawList->Next() )
{
if( DrawList->Pnext == DrawStruct )
if( DrawList->Next() == DrawStruct )
{
DrawList->Pnext = DrawList->Pnext->Pnext;
DrawList->SetNext( DrawList->Next()->Next() );
break;
}
DrawList = DrawList->Next();
@ -170,7 +170,7 @@ bool SCH_SCREEN::CheckIfOnDrawList( SCH_ITEM* st )
void SCH_SCREEN::AddToDrawList( SCH_ITEM* st )
/**************************************************************/
{ //simple function to add to the head of the drawlist.
st->Pnext = EEDrawList;
st->SetNext( EEDrawList );
EEDrawList = st;
}
@ -262,7 +262,7 @@ void EDA_ScreenList::BuildScreenList( EDA_BaseStruct* s )
{
BuildScreenList( strct );
}
strct = strct->Pnext;
strct = strct->Next();
}
}
}
@ -335,7 +335,7 @@ void EDA_SheetList::BuildSheetList( DrawSheetStruct* sheet )
DrawSheetStruct* sht = (DrawSheetStruct*) strct;
BuildSheetList( sht );
}
strct = strct->Pnext;
strct = strct->Next();
}
}
m_currList.Pop();

View File

@ -193,10 +193,15 @@ public:
public:
LibDrawPin();
~LibDrawPin() { }
LibDrawPin* Next() const { return (LibDrawPin*) Pnext; }
LibDrawPin* Back() const { return (LibDrawPin*) Pback; }
virtual wxString GetClass() const
{
return wxT( "LibDrawPin" );
}
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
@ -451,8 +456,8 @@ public:
public:
LibDrawField* Next() { return (LibDrawField*) Pnext; }
LibDrawField* Prev() { return (LibDrawField*) Pback; }
LibDrawField* Next() const { return (LibDrawField*) Pnext; }
LibDrawField* Back() const { return (LibDrawField*) Pback; }
LibDrawField( int idfield = 2 );

View File

@ -167,14 +167,14 @@ DrawPickedStruct* BreakSegment( SCH_SCREEN* screen,
wrapper->m_PickedStruct = segment->GenCopy();
wrapper->m_Image = segment;
wrapper->m_PickedStruct->m_Image = segment;
wrapper->Pnext = List;
wrapper->SetNext( List );
List = wrapper;
}
NewSegment = segment->GenCopy();
NewSegment->m_Start = breakpoint;
segment->m_End = NewSegment->m_Start;
NewSegment->Pnext = segment->Pnext;
segment->Pnext = NewSegment;
NewSegment->SetNext( segment->Next() );
segment->SetNext( NewSegment );
DrawList = NewSegment;
if( PutInUndoList )
{
@ -182,7 +182,7 @@ DrawPickedStruct* BreakSegment( SCH_SCREEN* screen,
wrapper->m_Flags = IS_NEW;
wrapper->m_Image = NewSegment;
wrapper->Pnext = List;
wrapper->SetNext( List );
List = wrapper;
}
break;
@ -196,7 +196,7 @@ DrawPickedStruct* BreakSegment( SCH_SCREEN* screen,
break;
}
DrawList = DrawList->Pnext;
DrawList = DrawList->Next();
}
return List;

View File

@ -72,10 +72,10 @@ SCH_COMPONENT::SCH_COMPONENT( const SCH_COMPONENT& aTemplate ) :
Pnext = NULL;
m_Son = NULL;
// Re-parent the fields, which before this were aTemplate's parent
// Re-parent the fields, which before this had aTemplate as parent
for( int i=0; i<GetFieldCount(); ++i )
{
GetField( i )->m_Parent = this;
GetField( i )->SetParent( this );
}
}
@ -424,11 +424,11 @@ void SCH_COMPONENT::SwapData( SCH_COMPONENT* copyitem )
// (after swap(), m_Parent member does not point to the right parent):
for( int ii = 0; ii < copyitem->GetFieldCount(); ++ii )
{
copyitem->GetField(ii)->m_Parent = copyitem;
copyitem->GetField(ii)->SetParent( copyitem );
}
for( int ii = 0; ii < GetFieldCount(); ++ii )
{
GetField(ii)->m_Parent = this;
GetField(ii)->SetParent( this );
}
}

View File

@ -39,7 +39,11 @@ struct Error
}
};
/* Fields identifiers */
/**
* Enum NumFieldType
* is the numbered set of all fields a SCH_COMPONENT can hold
*/
enum NumFieldType {
REFERENCE = 0, ///< Field Reference of part, i.e. "IC21"
VALUE, ///< Field Value of part, i.e. "3.3K"
@ -59,31 +63,36 @@ enum NumFieldType {
};
/// A container for several SCH_CMP_FIELD items
typedef std::vector<SCH_CMP_FIELD> SCH_CMP_FIELDS;
/**
* Class SCH_COMPONENT
* describes a real schematic component
*/
class SCH_COMPONENT : public SCH_ITEM
{
friend class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC;
public:
int m_Multi; /* In multi unit chip - which unit to draw. */
int m_Multi; ///< In multi unit chip - which unit to draw.
wxPoint m_Pos;
wxString m_ChipName; /* Key to look for in the library, i.e. "74LS00". */
wxString m_ChipName; ///< Key to look for in the library, i.e. "74LS00".
wxString m_PrefixString; /* C, R, U, Q etc - the first character which typically indicates what the component is.
* determined, upon placement, from the library component.
* determined, upon file load, by the first non-digits in the reference fields. */
* determined, upon file load, by the first non-digits in the reference fields.
*/
int m_Convert; /* Handle mutiple shape (for instance De Morgan conversion) */
int m_Transform[2][2]; /* The rotation/mirror transformation matrix. */
private:
/** how many fields are fixed, or automatic and pre-made in the SCH_COMPONENT class */
typedef std::vector<SCH_CMP_FIELD> SCH_CMP_FIELDS;
SCH_CMP_FIELDS m_Fields;
SCH_CMP_FIELDS m_Fields; ///< variable length list of fields
/* Hierarchical references.
@ -200,14 +209,16 @@ public:
void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
//returns a unique ID, in the form of a path.
// returns a unique ID, in the form of a path.
wxString GetPath( DrawSheetPath* sheet );
//returns the reference, for the given sheet path.
/**
* Function GetRef
* returns the reference, for the given sheet path.
*/
const wxString GetRef( DrawSheetPath* sheet );
//Set the reference, for the given sheet path.
// Set the reference, for the given sheet path.
void SetRef( DrawSheetPath* sheet, const wxString& ref );
/**

View File

@ -54,7 +54,7 @@ SCH_ITEM * WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool Includ
{
case DRAW_PART_TEXT_STRUCT_TYPE:
case COMPONENT_FIELD_DRAW_TYPE:
LibItem = (SCH_COMPONENT*) DrawStruct->m_Parent;
LibItem = (SCH_COMPONENT*) DrawStruct->GetParent();
SendMessageToPCBNEW( DrawStruct,LibItem );
break;
@ -168,7 +168,7 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin
if( DrawStruct )
{
SCH_CMP_FIELD* Field = (SCH_CMP_FIELD*) DrawStruct;
LibItem = (SCH_COMPONENT*) Field->m_Parent;
LibItem = (SCH_COMPONENT*) Field->GetParent();
LibItem->Display_Infos( this );
return DrawStruct;

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