Commit e574a1b0 authored by dickelbeck's avatar dickelbeck
Browse files

more DLIST<> work

parent f966097d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
#include "trackball.h"

/**************************************************************************/
void Struct3D_Master::Set_Object_Coords( S3D_Vertex* coord, int nbcoord )
void S3D_MASTER::Set_Object_Coords( S3D_Vertex* coord, int nbcoord )
/**************************************************************************/
{
    int ii;
+6 −6
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ S3D_Vertex::S3D_Vertex()


/**************************************************************************/
S3D_Material::S3D_Material( Struct3D_Master* father, const wxString& name ) :
S3D_MATERIAL::S3D_MATERIAL( S3D_MASTER* father, const wxString& name ) :
    EDA_BaseStruct( father, NOT_USED )
/**************************************************************************/
{
@@ -40,7 +40,7 @@ S3D_Material::S3D_Material( Struct3D_Master* father, const wxString& name ) :


/***********************************/
void S3D_Material::SetMaterial()
void S3D_MATERIAL::SetMaterial()
/***********************************/
{
    glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
@@ -57,7 +57,7 @@ void S3D_Material::SetMaterial()


/****************************************************/
void Struct3D_Master::Copy( Struct3D_Master* pattern )
void S3D_MASTER::Copy( S3D_MASTER* pattern )
/****************************************************/
{
    m_Shape3DName = pattern->m_Shape3DName;
@@ -70,7 +70,7 @@ void Struct3D_Master::Copy( Struct3D_Master* pattern )


/***************************************************************/
Struct3D_Master::Struct3D_Master( EDA_BaseStruct* aParent ) :
S3D_MASTER::S3D_MASTER( EDA_BaseStruct* aParent ) :
    EDA_BaseStruct( aParent, NOT_USED )
/***************************************************************/
{
@@ -81,11 +81,11 @@ Struct3D_Master::Struct3D_Master( EDA_BaseStruct* aParent ) :


/***************************************/
Struct3D_Master:: ~Struct3D_Master()
S3D_MASTER:: ~S3D_MASTER()
/***************************************/
{
    Struct3D_Shape* next;
    S3D_Material*   nextmat;
    S3D_MATERIAL*   nextmat;

    for( ; m_3D_Drawings != NULL; m_3D_Drawings = next )
    {
+1 −1
Original line number Diff line number Diff line
@@ -472,7 +472,7 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
    }

    /* Draw module shape: 3D shape if exists (or module edge if not exists) */
    Struct3D_Master* Struct3D  = m_3D_Drawings;
    S3D_MASTER* Struct3D  = m_3D_Drawings;
    bool             As3dShape = FALSE;
    if( g_Parm_3D_Visu.m_Draw3DModule )
    {
+8 −8
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@


/***********************************/
int Struct3D_Master:: ReadData()
int S3D_MASTER:: ReadData()
/************************************/
{
    char     line[1024], * text;
@@ -81,7 +81,7 @@ int Struct3D_Master:: ReadData()


/*********************************************************/
int Struct3D_Master:: ReadMaterial( FILE* file, int* LineNum )
int S3D_MASTER:: ReadMaterial( FILE* file, int* LineNum )
/*********************************************************/

/*
@@ -100,7 +100,7 @@ int Struct3D_Master:: ReadMaterial( FILE* file, int* LineNum )
{
    char          line[512], * text, * command;
    wxString      mat_name;
    S3D_Material* material = NULL;
    S3D_MATERIAL* material = NULL;

    // Lecture de la commande:
    command  = strtok( NULL, " \t\n\r" );
@@ -123,7 +123,7 @@ int Struct3D_Master:: ReadMaterial( FILE* file, int* LineNum )

    if( stricmp( command, "DEF" ) == 0 )
    {
        material = new S3D_Material( this, mat_name );
        material = new S3D_MATERIAL( this, mat_name );

        Insert( material );

@@ -186,7 +186,7 @@ int Struct3D_Master:: ReadMaterial( FILE* file, int* LineNum )


/**********************************************************/
int Struct3D_Master::ReadChildren( FILE* file, int* LineNum )
int S3D_MASTER::ReadChildren( FILE* file, int* LineNum )
/***********************************************************/
{
    char line[1024], * text;
@@ -215,7 +215,7 @@ int Struct3D_Master::ReadChildren( FILE* file, int* LineNum )


/********************************************************/
int Struct3D_Master::ReadShape( FILE* file, int* LineNum )
int S3D_MASTER::ReadShape( FILE* file, int* LineNum )
/********************************************************/
{
    char line[1024], * text;
@@ -250,7 +250,7 @@ int Struct3D_Master::ReadShape( FILE* file, int* LineNum )


/*************************************************************/
int Struct3D_Master::ReadAppearance( FILE* file, int* LineNum )
int S3D_MASTER::ReadAppearance( FILE* file, int* LineNum )
/*************************************************************/
{
    char line[1024], * text;
@@ -381,7 +381,7 @@ double* ReadCoordsList( FILE* file, char* text_buffer, int* bufsize, int* LineNu


/***********************************************************/
int Struct3D_Master::ReadGeometry( FILE* file, int* LineNum )
int S3D_MASTER::ReadGeometry( FILE* file, int* LineNum )
/***********************************************************/
{
    char    line[1024], buffer[1024], * text;
+13 −13
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
#define UNITS3D_TO_UNITSPCB 1000


class Struct3D_Master;
class S3D_MASTER;
class Struct3D_Shape;

class S3D_Color     /* This is a 3D color (R, G, G) 3 floats range 0 to 1.0*/
@@ -34,7 +34,7 @@ public:
    S3D_Vertex();
};

class S3D_Material : public EDA_BaseStruct       /* openGL "material" data*/
class S3D_MATERIAL : public EDA_BaseStruct       /* openGL "material" data*/
{
public:
    wxString   m_Name;
@@ -46,17 +46,17 @@ public:
    float      m_Shininess;

public:
    S3D_Material( Struct3D_Master * father, const wxString &name );
    S3D_MATERIAL( S3D_MASTER * father, const wxString &name );

    S3D_Material* Next() const { return (S3D_Material*) Pnext; }
    S3D_Material* Back() const { return (S3D_Material*) Pback; }
    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 S3D_MASTER : public EDA_BaseStruct
/*******************************************/
/* Master structure for a 3D item description */
{
@@ -66,23 +66,23 @@ public:
    S3D_Vertex      m_MatRotation;
    S3D_Vertex      m_MatPosition;
    Struct3D_Shape* m_3D_Drawings;
    S3D_Material*   m_Materials;
    S3D_MATERIAL*   m_Materials;

public:

    Struct3D_Master( EDA_BaseStruct * aParent );
    ~Struct3D_Master();
    S3D_MASTER( EDA_BaseStruct * aParent );
    ~S3D_MASTER();

    Struct3D_Master* Next() const { return (Struct3D_Master*) Pnext; }
    Struct3D_Master* Back() const { return (Struct3D_Master*) Pback; }
    S3D_MASTER* Next() const { return (S3D_MASTER*) Pnext; }
    S3D_MASTER* Back() const { return (S3D_MASTER*) Pback; }

    void Insert( S3D_Material* aMaterial )
    void Insert( S3D_MATERIAL* aMaterial )
    {
        aMaterial->SetNext( m_Materials );
        m_Materials = aMaterial;
    }

    void    Copy( Struct3D_Master* pattern );
    void    Copy( S3D_MASTER* pattern );
    int     ReadData();
    int     ReadMaterial( FILE* file, int* LineNum );
    int     ReadChildren( FILE* file, int* LineNum );
Loading