Loading .bzrignore +1 −0 Original line number Diff line number Diff line boost_root .downloads-by-cmake Build common/netlist_keywords.* common/netlist_lexer.h common/pcb_plot_params_lexer.h Loading 3d-viewer/3d_aux.cpp +3 −46 Original line number Diff line number Diff line Loading @@ -45,16 +45,11 @@ #include <info3d_visu.h> #include <trackball.h> // Exported function: void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits ); void S3D_MASTER::Set_Object_Coords( std::vector< S3D_VERTEX >& aVertices ) void S3D_MASTER::ObjectCoordsTo3DUnits( std::vector< S3D_VERTEX >& aVertices ) { unsigned ii; /* adjust object scale, rotation and offset position */ for( ii = 0; ii < aVertices.size(); ii++ ) for( unsigned ii = 0; ii < aVertices.size(); ii++ ) { aVertices[ii].x *= m_MatScale.x; aVertices[ii].y *= m_MatScale.y; Loading @@ -79,7 +74,7 @@ void S3D_MASTER::Set_Object_Coords( std::vector< S3D_VERTEX >& aVertices ) } void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits ) void TransfertToGLlist( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits ) { unsigned ii; GLfloat ax, ay, az, bx, by, bz, nx, ny, nz, r; Loading Loading @@ -138,44 +133,6 @@ void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits glEnd(); } GLuint EDA_3D_CANVAS::DisplayCubeforTest() { GLuint gllist = glGenLists( 1 ); glNewList( gllist, GL_COMPILE_AND_EXECUTE ); /* draw six faces of a cube */ glBegin( GL_QUADS ); glNormal3f( 0.0F, 0.0F, 1.0F ); glVertex3f( 0.5F, 0.5F, 0.5F ); glVertex3f( -0.5F, 0.5F, 0.5F ); glVertex3f( -0.5F, -0.5F, 0.5F ); glVertex3f( 0.5F, -0.5F, 0.5F ); glNormal3f( 0.0F, 0.0F, -1.0F ); glVertex3f( -0.5F, -0.5F, -0.5F ); glVertex3f( -0.5F, 0.5F, -0.5F ); glVertex3f( 0.5F, 0.5F, -0.5F ); glVertex3f( 0.5F, -0.5F, -0.5F ); glNormal3f( 0.0F, 1.0F, 0.0F ); glVertex3f( 0.5F, 0.5F, 0.5F ); glVertex3f( 0.5F, 0.5F, -0.5F ); glVertex3f( -0.5F, 0.5F, -0.5F ); glVertex3f( -0.5F, 0.5F, 0.5F ); glNormal3f( 0.0F, -1.0F, 0.0F ); glVertex3f( -0.5F, -0.5F, -0.5F ); glVertex3f( 0.5F, -0.5F, -0.5F ); glVertex3f( 0.5F, -0.5F, 0.5F ); glVertex3f( -0.5F, -0.5F, 0.5F ); glNormal3f( 1.0F, 0.0F, 0.0F ); glVertex3f( 0.5F, 0.5F, 0.5F ); glVertex3f( 0.5F, -0.5F, 0.5F ); glVertex3f( 0.5F, -0.5F, -0.5F ); glVertex3f( 0.5F, 0.5F, -0.5F ); glNormal3f( -1.0F, 0.0F, 0.0F ); glVertex3f( -0.5F, -0.5F, -0.5F ); glVertex3f( -0.5F, -0.5F, 0.5F ); glVertex3f( -0.5F, 0.5F, 0.5F ); glVertex3f( -0.5F, 0.5F, -0.5F ); glEnd(); glEndList(); return gllist; } VERTEX_VALUE_CTRL::VERTEX_VALUE_CTRL( wxWindow* aParent, wxBoxSizer* aBoxSizer ) { wxString text; Loading 3d-viewer/3d_canvas.cpp +22 −5 Original line number Diff line number Diff line Loading @@ -78,7 +78,11 @@ EDA_3D_CANVAS::EDA_3D_CANVAS( EDA_3D_FRAME* parent, int* attribList ) : wxFULL_REPAINT_ON_RESIZE ) { m_init = false; m_gllist = 0; // Clear all gl list identifiers: for( int ii = GL_ID_BEGIN; ii < GL_ID_END; ii++ ) m_glLists[ii] = 0; // Explicitly create a new rendering context instance for this canvas. m_glRC = new wxGLContext( this ); Loading @@ -94,12 +98,25 @@ EDA_3D_CANVAS::~EDA_3D_CANVAS() } void EDA_3D_CANVAS::ClearLists() void EDA_3D_CANVAS::ClearLists( GLuint aGlList ) { if( aGlList ) { if( m_glLists[aGlList] > 0 ) glDeleteLists( m_glLists[aGlList], 1 ); m_glLists[aGlList] = 0; return; } for( int ii = GL_ID_BEGIN; ii < GL_ID_END; ii++ ) { if( m_gllist > 0 ) glDeleteLists( m_gllist, 1 ); if( m_glLists[ii] > 0 ) glDeleteLists( m_glLists[ii], 1 ); m_gllist = 0; m_glLists[ii] = 0; } } Loading 3d-viewer/3d_canvas.h +59 −8 Original line number Diff line number Diff line Loading @@ -50,14 +50,29 @@ class S3D_VERTEX; class SEGVIA; class D_PAD; // We are using GL lists to store layers and other items // to draw or not // GL_LIST_ID are the GL lists indexes in m_glLists enum GL_LIST_ID { GL_ID_BEGIN = 0, GL_ID_AXIS = GL_ID_BEGIN, // list id for 3D axis GL_ID_GRID, // list id for 3D grid GL_ID_BOARD, // List id for copper layers GL_ID_TECH_LAYERS, // List id for non copper layers (masks...) GL_ID_AUX_LAYERS, // List id for user layers (draw, eco, comment) GL_ID_3DSHAPES_SOLID, // List id for 3D shapes, non transparent entities GL_ID_3DSHAPES_TRANSP, // List id for 3D shapes, transparent entities GL_ID_END }; class EDA_3D_CANVAS : public wxGLCanvas { private: bool m_init; GLuint m_gllist; GLuint m_glLists[GL_ID_END]; // GL lists wxGLContext* m_glRC; wxRealPoint m_draw3dOffset; // offset to draw the 3 mesh. wxRealPoint m_draw3dOffset; // offset to draw the 3D mesh. double m_ZBottom; // position of the back layer double m_ZTop; // position of the front layer Loading @@ -67,7 +82,15 @@ public: EDA_3D_FRAME* Parent() { return (EDA_3D_FRAME*)GetParent(); } void ClearLists(); BOARD* GetBoard() { return Parent()->GetBoard(); } /** * Function ClearLists * Clear the display list. * @param aGlList = the list to clear. * if 0 (default) all lists are cleared */ void ClearLists( GLuint aGlList = 0 ); // Event functions: void OnPaint( wxPaintEvent& event ); Loading @@ -81,10 +104,9 @@ public: void OnEnterWindow( wxMouseEvent& event ); // Display functions GLuint DisplayCubeforTest(); // Just a test function void SetView3D( int keycode ); void DisplayStatus(); void Redraw( bool finish = false ); void Redraw(); void Render(); /** Loading @@ -92,7 +114,7 @@ public: * Prepares the parameters of the OpenGL draw list * creates the OpenGL draw list items (board, grid ... */ GLuint CreateDrawGL_List(); void CreateDrawGL_List(); void InitGL(); void SetLights(); void SetOffset(double aPosX, double aPosY) Loading @@ -104,11 +126,40 @@ public: /** * Function BuildBoard3DView * Called by CreateDrawGL_List() * Fills the OpenGL draw list with board items draw list. * Populates the OpenGL GL_ID_BOARD draw list with board items only on copper layers. * 3D footprint shapes, tech layers and aux layers are not on this list */ void BuildBoard3DView(); void DrawGrid( double aGriSizeMM ); /** * Function BuildTechLayers3DView * Called by CreateDrawGL_List() * Populates the OpenGL GL_ID_BOARD draw list with items on tech layers */ void BuildTechLayers3DView(); /** * Function BuildFootprintShape3DList * Called by CreateDrawGL_List() * Fills the OpenGL GL_ID_3DSHAPES_SOLID and GL_ID_3DSHAPES_TRANSP * draw lists with 3D footprint shapes * @param aOpaqueList is the gl list for non transparent items * @param aTransparentList is the gl list for non transparent items, * which need to be drawn after all other items */ void BuildFootprintShape3DList( GLuint aOpaqueList, GLuint aTransparentList); /** * Function BuildBoard3DAuxLayers * Called by CreateDrawGL_List() * Fills the OpenGL GL_ID_AUX_LAYERS draw list * with items on aux layers only */ void BuildBoard3DAuxLayers(); void Draw3DGrid( double aGriSizeMM ); void Draw3DAxis(); void Draw3DViaHole( SEGVIA * aVia ); void Draw3DPadHole( D_PAD * aPad ); Loading 3d-viewer/3d_class.cpp +29 −2 Original line number Diff line number Diff line Loading @@ -41,9 +41,14 @@ S3D_MATERIAL::S3D_MATERIAL( S3D_MASTER* father, const wxString& name ) : m_Name = name; } void S3D_MATERIAL::SetMaterial() { S3D_MASTER * s3dParent = (S3D_MASTER *) GetParent(); s3dParent->SetLastTransparency( m_Transparency ); if( ! s3dParent->IsOpenGlAllowed() ) return; glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE ); glColor4f( m_DiffuseColor.x * m_AmbientIntensity, m_DiffuseColor.y * m_AmbientIntensity, Loading @@ -52,8 +57,29 @@ void S3D_MATERIAL::SetMaterial() #if 0 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 ); #endif } bool S3D_MASTER::IsOpenGlAllowed() { if( m_loadNonTransparentObjects ) // return true for non transparent objects only { if( m_lastTransparency == 0.0 ) return true; } if( m_loadTransparentObjects ) // return true for transparent objects only if( m_lastTransparency != 0.0 ) return true; return false; } void S3D_MASTER::Insert( S3D_MATERIAL* aMaterial ) { aMaterial->SetNext( m_Materials ); m_Materials = aMaterial; } Loading @@ -72,6 +98,7 @@ S3D_MASTER::S3D_MASTER( EDA_ITEM* aParent ) : EDA_ITEM( aParent, NOT_USED ) { m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0; m_lastTransparency = 0.0; m_3D_Drawings = NULL; m_Materials = NULL; m_ShapeType = FILE3D_NONE; Loading Loading
.bzrignore +1 −0 Original line number Diff line number Diff line boost_root .downloads-by-cmake Build common/netlist_keywords.* common/netlist_lexer.h common/pcb_plot_params_lexer.h Loading
3d-viewer/3d_aux.cpp +3 −46 Original line number Diff line number Diff line Loading @@ -45,16 +45,11 @@ #include <info3d_visu.h> #include <trackball.h> // Exported function: void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits ); void S3D_MASTER::Set_Object_Coords( std::vector< S3D_VERTEX >& aVertices ) void S3D_MASTER::ObjectCoordsTo3DUnits( std::vector< S3D_VERTEX >& aVertices ) { unsigned ii; /* adjust object scale, rotation and offset position */ for( ii = 0; ii < aVertices.size(); ii++ ) for( unsigned ii = 0; ii < aVertices.size(); ii++ ) { aVertices[ii].x *= m_MatScale.x; aVertices[ii].y *= m_MatScale.y; Loading @@ -79,7 +74,7 @@ void S3D_MASTER::Set_Object_Coords( std::vector< S3D_VERTEX >& aVertices ) } void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits ) void TransfertToGLlist( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits ) { unsigned ii; GLfloat ax, ay, az, bx, by, bz, nx, ny, nz, r; Loading Loading @@ -138,44 +133,6 @@ void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits glEnd(); } GLuint EDA_3D_CANVAS::DisplayCubeforTest() { GLuint gllist = glGenLists( 1 ); glNewList( gllist, GL_COMPILE_AND_EXECUTE ); /* draw six faces of a cube */ glBegin( GL_QUADS ); glNormal3f( 0.0F, 0.0F, 1.0F ); glVertex3f( 0.5F, 0.5F, 0.5F ); glVertex3f( -0.5F, 0.5F, 0.5F ); glVertex3f( -0.5F, -0.5F, 0.5F ); glVertex3f( 0.5F, -0.5F, 0.5F ); glNormal3f( 0.0F, 0.0F, -1.0F ); glVertex3f( -0.5F, -0.5F, -0.5F ); glVertex3f( -0.5F, 0.5F, -0.5F ); glVertex3f( 0.5F, 0.5F, -0.5F ); glVertex3f( 0.5F, -0.5F, -0.5F ); glNormal3f( 0.0F, 1.0F, 0.0F ); glVertex3f( 0.5F, 0.5F, 0.5F ); glVertex3f( 0.5F, 0.5F, -0.5F ); glVertex3f( -0.5F, 0.5F, -0.5F ); glVertex3f( -0.5F, 0.5F, 0.5F ); glNormal3f( 0.0F, -1.0F, 0.0F ); glVertex3f( -0.5F, -0.5F, -0.5F ); glVertex3f( 0.5F, -0.5F, -0.5F ); glVertex3f( 0.5F, -0.5F, 0.5F ); glVertex3f( -0.5F, -0.5F, 0.5F ); glNormal3f( 1.0F, 0.0F, 0.0F ); glVertex3f( 0.5F, 0.5F, 0.5F ); glVertex3f( 0.5F, -0.5F, 0.5F ); glVertex3f( 0.5F, -0.5F, -0.5F ); glVertex3f( 0.5F, 0.5F, -0.5F ); glNormal3f( -1.0F, 0.0F, 0.0F ); glVertex3f( -0.5F, -0.5F, -0.5F ); glVertex3f( -0.5F, -0.5F, 0.5F ); glVertex3f( -0.5F, 0.5F, 0.5F ); glVertex3f( -0.5F, 0.5F, -0.5F ); glEnd(); glEndList(); return gllist; } VERTEX_VALUE_CTRL::VERTEX_VALUE_CTRL( wxWindow* aParent, wxBoxSizer* aBoxSizer ) { wxString text; Loading
3d-viewer/3d_canvas.cpp +22 −5 Original line number Diff line number Diff line Loading @@ -78,7 +78,11 @@ EDA_3D_CANVAS::EDA_3D_CANVAS( EDA_3D_FRAME* parent, int* attribList ) : wxFULL_REPAINT_ON_RESIZE ) { m_init = false; m_gllist = 0; // Clear all gl list identifiers: for( int ii = GL_ID_BEGIN; ii < GL_ID_END; ii++ ) m_glLists[ii] = 0; // Explicitly create a new rendering context instance for this canvas. m_glRC = new wxGLContext( this ); Loading @@ -94,12 +98,25 @@ EDA_3D_CANVAS::~EDA_3D_CANVAS() } void EDA_3D_CANVAS::ClearLists() void EDA_3D_CANVAS::ClearLists( GLuint aGlList ) { if( aGlList ) { if( m_glLists[aGlList] > 0 ) glDeleteLists( m_glLists[aGlList], 1 ); m_glLists[aGlList] = 0; return; } for( int ii = GL_ID_BEGIN; ii < GL_ID_END; ii++ ) { if( m_gllist > 0 ) glDeleteLists( m_gllist, 1 ); if( m_glLists[ii] > 0 ) glDeleteLists( m_glLists[ii], 1 ); m_gllist = 0; m_glLists[ii] = 0; } } Loading
3d-viewer/3d_canvas.h +59 −8 Original line number Diff line number Diff line Loading @@ -50,14 +50,29 @@ class S3D_VERTEX; class SEGVIA; class D_PAD; // We are using GL lists to store layers and other items // to draw or not // GL_LIST_ID are the GL lists indexes in m_glLists enum GL_LIST_ID { GL_ID_BEGIN = 0, GL_ID_AXIS = GL_ID_BEGIN, // list id for 3D axis GL_ID_GRID, // list id for 3D grid GL_ID_BOARD, // List id for copper layers GL_ID_TECH_LAYERS, // List id for non copper layers (masks...) GL_ID_AUX_LAYERS, // List id for user layers (draw, eco, comment) GL_ID_3DSHAPES_SOLID, // List id for 3D shapes, non transparent entities GL_ID_3DSHAPES_TRANSP, // List id for 3D shapes, transparent entities GL_ID_END }; class EDA_3D_CANVAS : public wxGLCanvas { private: bool m_init; GLuint m_gllist; GLuint m_glLists[GL_ID_END]; // GL lists wxGLContext* m_glRC; wxRealPoint m_draw3dOffset; // offset to draw the 3 mesh. wxRealPoint m_draw3dOffset; // offset to draw the 3D mesh. double m_ZBottom; // position of the back layer double m_ZTop; // position of the front layer Loading @@ -67,7 +82,15 @@ public: EDA_3D_FRAME* Parent() { return (EDA_3D_FRAME*)GetParent(); } void ClearLists(); BOARD* GetBoard() { return Parent()->GetBoard(); } /** * Function ClearLists * Clear the display list. * @param aGlList = the list to clear. * if 0 (default) all lists are cleared */ void ClearLists( GLuint aGlList = 0 ); // Event functions: void OnPaint( wxPaintEvent& event ); Loading @@ -81,10 +104,9 @@ public: void OnEnterWindow( wxMouseEvent& event ); // Display functions GLuint DisplayCubeforTest(); // Just a test function void SetView3D( int keycode ); void DisplayStatus(); void Redraw( bool finish = false ); void Redraw(); void Render(); /** Loading @@ -92,7 +114,7 @@ public: * Prepares the parameters of the OpenGL draw list * creates the OpenGL draw list items (board, grid ... */ GLuint CreateDrawGL_List(); void CreateDrawGL_List(); void InitGL(); void SetLights(); void SetOffset(double aPosX, double aPosY) Loading @@ -104,11 +126,40 @@ public: /** * Function BuildBoard3DView * Called by CreateDrawGL_List() * Fills the OpenGL draw list with board items draw list. * Populates the OpenGL GL_ID_BOARD draw list with board items only on copper layers. * 3D footprint shapes, tech layers and aux layers are not on this list */ void BuildBoard3DView(); void DrawGrid( double aGriSizeMM ); /** * Function BuildTechLayers3DView * Called by CreateDrawGL_List() * Populates the OpenGL GL_ID_BOARD draw list with items on tech layers */ void BuildTechLayers3DView(); /** * Function BuildFootprintShape3DList * Called by CreateDrawGL_List() * Fills the OpenGL GL_ID_3DSHAPES_SOLID and GL_ID_3DSHAPES_TRANSP * draw lists with 3D footprint shapes * @param aOpaqueList is the gl list for non transparent items * @param aTransparentList is the gl list for non transparent items, * which need to be drawn after all other items */ void BuildFootprintShape3DList( GLuint aOpaqueList, GLuint aTransparentList); /** * Function BuildBoard3DAuxLayers * Called by CreateDrawGL_List() * Fills the OpenGL GL_ID_AUX_LAYERS draw list * with items on aux layers only */ void BuildBoard3DAuxLayers(); void Draw3DGrid( double aGriSizeMM ); void Draw3DAxis(); void Draw3DViaHole( SEGVIA * aVia ); void Draw3DPadHole( D_PAD * aPad ); Loading
3d-viewer/3d_class.cpp +29 −2 Original line number Diff line number Diff line Loading @@ -41,9 +41,14 @@ S3D_MATERIAL::S3D_MATERIAL( S3D_MASTER* father, const wxString& name ) : m_Name = name; } void S3D_MATERIAL::SetMaterial() { S3D_MASTER * s3dParent = (S3D_MASTER *) GetParent(); s3dParent->SetLastTransparency( m_Transparency ); if( ! s3dParent->IsOpenGlAllowed() ) return; glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE ); glColor4f( m_DiffuseColor.x * m_AmbientIntensity, m_DiffuseColor.y * m_AmbientIntensity, Loading @@ -52,8 +57,29 @@ void S3D_MATERIAL::SetMaterial() #if 0 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 ); #endif } bool S3D_MASTER::IsOpenGlAllowed() { if( m_loadNonTransparentObjects ) // return true for non transparent objects only { if( m_lastTransparency == 0.0 ) return true; } if( m_loadTransparentObjects ) // return true for transparent objects only if( m_lastTransparency != 0.0 ) return true; return false; } void S3D_MASTER::Insert( S3D_MATERIAL* aMaterial ) { aMaterial->SetNext( m_Materials ); m_Materials = aMaterial; } Loading @@ -72,6 +98,7 @@ S3D_MASTER::S3D_MASTER( EDA_ITEM* aParent ) : EDA_ITEM( aParent, NOT_USED ) { m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0; m_lastTransparency = 0.0; m_3D_Drawings = NULL; m_Materials = NULL; m_ShapeType = FILE3D_NONE; Loading