Commit b6e3b3a3 authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Merged selection_tool branch.

parents 24c9b705 5ed0980d
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
boost_root
boost_root
.downloads-by-cmake
.downloads-by-cmake
Build
common/netlist_keywords.*
common/netlist_keywords.*
common/netlist_lexer.h
common/netlist_lexer.h
common/pcb_plot_params_lexer.h
common/pcb_plot_params_lexer.h
+1 −1
Original line number Original line Diff line number Diff line
@@ -84,7 +84,7 @@ public:
    GLuint DisplayCubeforTest();        // Just a test function
    GLuint DisplayCubeforTest();        // Just a test function
    void   SetView3D( int keycode );
    void   SetView3D( int keycode );
    void   DisplayStatus();
    void   DisplayStatus();
    void   Redraw( bool finish = false );
    void   Redraw();
    void   Render();
    void   Render();


    /**
    /**
+8 −1
Original line number Original line Diff line number Diff line
@@ -52,8 +52,15 @@ void S3D_MATERIAL::SetMaterial()
#if 0
#if 0
    glColorMaterial( GL_FRONT_AND_BACK, GL_SPECULAR );
    glColorMaterial( GL_FRONT_AND_BACK, GL_SPECULAR );
    glColor3f( m_SpecularColor.x, m_SpecularColor.y, m_SpecularColor.z );
    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 );
#endif
}


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




+26 −38
Original line number Original line Diff line number Diff line
@@ -50,7 +50,6 @@
#include <3d_draw_basic_functions.h>
#include <3d_draw_basic_functions.h>


// Imported function:
// Imported function:
extern void     Set_Object_Data( std::vector<S3D_VERTEX>& aVertices, double aBiuTo3DUnits );
extern void     CheckGLError();
extern void     CheckGLError();


/* returns true if aLayer should be displayed, false otherwise
/* returns true if aLayer should be displayed, false otherwise
@@ -99,7 +98,7 @@ static void BuildPadShapeThickOutlineAsPolygon( D_PAD* aPad,
}
}




void EDA_3D_CANVAS::Redraw( bool finish )
void EDA_3D_CANVAS::Redraw()
{
{
    // SwapBuffer requires the window to be shown before calling
    // SwapBuffer requires the window to be shown before calling
    if( !IsShown() )
    if( !IsShown() )
@@ -139,11 +138,6 @@ void EDA_3D_CANVAS::Redraw( bool finish )
    else
    else
        CreateDrawGL_List();
        CreateDrawGL_List();


    glFlush();

    if( finish )
        glFinish();

    SwapBuffers();
    SwapBuffers();
}
}


@@ -593,9 +587,12 @@ void EDA_3D_CANVAS::BuildBoard3DView()
    }
    }


    // draw modules 3D shapes
    // draw modules 3D shapes
    for( MODULE* module = pcb->m_Modules; module != NULL; module = module->Next() )
    if( g_Parm_3D_Visu.GetFlag( FL_MODULE )  )
    {
        for( MODULE* module = pcb->m_Modules; module; module = module->Next() )
            module->ReadAndInsert3DComponentShape( this );
            module->ReadAndInsert3DComponentShape( this );
    }
    }
}




GLuint EDA_3D_CANVAS::CreateDrawGL_List()
GLuint EDA_3D_CANVAS::CreateDrawGL_List()
@@ -831,17 +828,9 @@ void EDA_3D_CANVAS::Draw3DViaHole( SEGVIA* aVia )


void MODULE::ReadAndInsert3DComponentShape( EDA_3D_CANVAS* glcanvas )
void MODULE::ReadAndInsert3DComponentShape( EDA_3D_CANVAS* glcanvas )
{
{
    // Draw module shape: 3D shape if exists (or module outlines if not exists)
    // Read from disk and draws the footprint 3D shapes if exists
    S3D_MASTER* struct3D = m_3D_Drawings;
    S3D_MASTER* shape3D = m_3D_Drawings;

    double zpos = g_Parm_3D_Visu.GetModulesZcoord3DIU( IsFlipped() );
    if( g_Parm_3D_Visu.GetFlag( FL_MODULE )  )
    {
        double zpos;

        if( IsFlipped() )
            zpos = g_Parm_3D_Visu.GetModulesZcoord3DIU( true );
        else
            zpos = g_Parm_3D_Visu.GetModulesZcoord3DIU( false );


    glPushMatrix();
    glPushMatrix();


@@ -858,15 +847,14 @@ void MODULE::ReadAndInsert3DComponentShape( EDA_3D_CANVAS* glcanvas )
        glRotatef( 180.0, 0.0, 0.0, 1.0 );
        glRotatef( 180.0, 0.0, 0.0, 1.0 );
    }
    }


        for( ; struct3D != NULL; struct3D = struct3D->Next() )
    for( ; shape3D != NULL; shape3D = shape3D->Next() )
    {
    {
            if( struct3D->Is3DType( S3D_MASTER::FILE3D_VRML ) )
        if( shape3D->Is3DType( S3D_MASTER::FILE3D_VRML ) )
                struct3D->ReadData();
            shape3D->ReadData();
    }
    }


    glPopMatrix();
    glPopMatrix();
}
}
}




// Draw 3D pads.
// Draw 3D pads.
+34 −19
Original line number Original line Diff line number Diff line
@@ -38,9 +38,6 @@
#include "3d_struct.h"
#include "3d_struct.h"
#include "modelparsers.h"
#include "modelparsers.h"


// Imported function:
extern void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits );



S3D_MODEL_PARSER* S3D_MODEL_PARSER::Create( S3D_MASTER* aMaster,
S3D_MODEL_PARSER* S3D_MODEL_PARSER::Create( S3D_MASTER* aMaster,
                                            const wxString aExtension )
                                            const wxString aExtension )
@@ -59,16 +56,46 @@ S3D_MODEL_PARSER* S3D_MODEL_PARSER::Create( S3D_MASTER* aMaster,
    }
    }
}
}


const wxString S3D_MASTER::GetShape3DFullFilename()
{

    wxString shapeName;

    // Expand any environment variables embedded in footprint's m_Shape3DName field.
    // To ensure compatibility with most of footprint's m_Shape3DName field,
    // if the m_Shape3DName is not an absolute path the default path
    // given by the environment variable KISYS3DMOD will be used

    if( m_Shape3DName.StartsWith( wxT("${") ) )
        shapeName = wxExpandEnvVars( m_Shape3DName );
    else
        shapeName = m_Shape3DName;

    wxFileName fn( shapeName );

    if( fn.IsAbsolute() || shapeName.StartsWith( wxT(".") ) )
        return shapeName;

    wxString default_path;
    wxGetEnv( wxT( KISYS3DMOD ), &default_path );

    if( default_path.IsEmpty() )
        return shapeName;

    if( !default_path.EndsWith( wxT("/") ) && !default_path.EndsWith( wxT("\\") ) )
        default_path += wxT("/");

    default_path += shapeName;

    return default_path;
}


int S3D_MASTER::ReadData()
int S3D_MASTER::ReadData()
{
{
    if( m_Shape3DName.IsEmpty() )
    if( m_Shape3DName.IsEmpty() )
    {
        return 1;
        return 1;
    }


    // Expand any environment variables embedded in footprint's m_Shape3DName field.
    wxString filename = GetShape3DFullFilename();
    wxString filename = wxExpandEnvVars( m_Shape3DName );


#ifdef __WINDOWS__
#ifdef __WINDOWS__
    filename.Replace( wxT( "/" ), wxT( "\\" ) );
    filename.Replace( wxT( "/" ), wxT( "\\" ) );
@@ -103,15 +130,3 @@ int S3D_MASTER::ReadData()


    return -1;
    return -1;
}
}


int STRUCT_3D_SHAPE::ReadData( FILE* file, int* LineNum )
{
    char line[512];

    while( GetLine( file, line, LineNum, 512 ) )
    {
    }

    return -1;
}
Loading