Loading 3d-viewer/3d_class.cpp +41 −1 Original line number Original line Diff line number Diff line Loading @@ -59,7 +59,7 @@ void S3D_MATERIAL::SetMaterial() void S3D_MASTER::Copy( S3D_MASTER* pattern ) void S3D_MASTER::Copy( S3D_MASTER* pattern ) { { m_Shape3DName = pattern->m_Shape3DName; SetShape3DName( pattern->GetShape3DName() ); m_MatScale = pattern->m_MatScale; m_MatScale = pattern->m_MatScale; m_MatRotation = pattern->m_MatRotation; m_MatRotation = pattern->m_MatRotation; m_MatPosition = pattern->m_MatPosition; m_MatPosition = pattern->m_MatPosition; Loading @@ -74,6 +74,7 @@ S3D_MASTER::S3D_MASTER( EDA_ITEM* aParent ) : m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0; m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0; m_3D_Drawings = NULL; m_3D_Drawings = NULL; m_Materials = NULL; m_Materials = NULL; m_ShapeType = FILE3D_NONE; } } Loading @@ -96,6 +97,45 @@ S3D_MASTER:: ~S3D_MASTER() } } bool S3D_MASTER::Is3DType( enum FILE3D_TYPE aShapeType ) { // type 'none' is not valid and will always return false if( aShapeType == FILE3D_NONE ) return false; // no one is interested if we have no file if( m_Shape3DName.empty() ) return false; if( aShapeType == m_ShapeType ) return true; return false; } void S3D_MASTER::SetShape3DName( const wxString& aShapeName ) { m_ShapeType = FILE3D_NONE; m_Shape3DName = aShapeName; if( m_Shape3DName.empty() ) return; wxFileName fn = m_Shape3DName; wxString ext = fn.GetExt(); if( ext == wxT( "wrl" ) || ext == wxT( "x3d" ) ) m_ShapeType = FILE3D_VRML; else if( ext == wxT( "idf" ) ) m_ShapeType = FILE3D_IDF; else m_ShapeType = FILE3D_UNKNOWN; return; } STRUCT_3D_SHAPE::STRUCT_3D_SHAPE( EDA_ITEM* aParent ) : STRUCT_3D_SHAPE::STRUCT_3D_SHAPE( EDA_ITEM* aParent ) : EDA_ITEM( aParent, NOT_USED ) EDA_ITEM( aParent, NOT_USED ) { { Loading 3d-viewer/3d_draw.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -857,7 +857,7 @@ void MODULE::ReadAndInsert3DComponentShape( EDA_3D_CANVAS* glcanvas ) for( ; struct3D != NULL; struct3D = struct3D->Next() ) for( ; struct3D != NULL; struct3D = struct3D->Next() ) { { if( !struct3D->m_Shape3DName.IsEmpty() ) if( struct3D->Is3DType( S3D_MASTER::FILE3D_VRML ) ) struct3D->ReadData(); struct3D->ReadData(); } } Loading 3d-viewer/3d_struct.h +26 −1 Original line number Original line Diff line number Diff line Loading @@ -92,13 +92,24 @@ public: class S3D_MASTER : public EDA_ITEM class S3D_MASTER : public EDA_ITEM { { public: public: wxString m_Shape3DName; /* 3D shape name in 3D library */ S3D_VERTEX m_MatScale; S3D_VERTEX m_MatScale; S3D_VERTEX m_MatRotation; S3D_VERTEX m_MatRotation; S3D_VERTEX m_MatPosition; S3D_VERTEX m_MatPosition; STRUCT_3D_SHAPE* m_3D_Drawings; STRUCT_3D_SHAPE* m_3D_Drawings; S3D_MATERIAL* m_Materials; S3D_MATERIAL* m_Materials; enum FILE3D_TYPE { FILE3D_NONE = 0, FILE3D_VRML, FILE3D_IDF, FILE3D_UNKNOWN }; private: wxString m_Shape3DName; /* 3D shape name in 3D library */ FILE3D_TYPE m_ShapeType; public: public: S3D_MASTER( EDA_ITEM* aParent ); S3D_MASTER( EDA_ITEM* aParent ); ~S3D_MASTER(); ~S3D_MASTER(); Loading @@ -120,6 +131,20 @@ public: #if defined(DEBUG) #if defined(DEBUG) void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override #endif #endif /** * Function Is3DType * returns true if the argument matches the type of model referred to * by m_Shape3DName */ bool Is3DType( enum FILE3D_TYPE aShapeType ); const wxString& GetShape3DName( void ) { return m_Shape3DName; } void SetShape3DName( const wxString& aShapeName ); }; }; Loading CMakeLists.txt +5 −4 Original line number Original line Diff line number Diff line Loading @@ -171,10 +171,11 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" ) set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" ) endif() endif() # quiet GCC 4.8.1 while in boost # quiet GCC while in boost if( GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8 ) if( GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8 ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs" ) endif() endif() set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-strict-aliasing" ) if( APPLE ) if( APPLE ) set( KICAD_BUILD_STATIC ON) set( KICAD_BUILD_STATIC ON) Loading common/build_version.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -6,7 +6,7 @@ #endif #endif #ifndef KICAD_BUILD_VERSION #ifndef KICAD_BUILD_VERSION # define KICAD_BUILD_VERSION "(2013-jul-14)" # define KICAD_BUILD_VERSION "(2014-jan-25)" #endif #endif /** /** Loading Loading
3d-viewer/3d_class.cpp +41 −1 Original line number Original line Diff line number Diff line Loading @@ -59,7 +59,7 @@ void S3D_MATERIAL::SetMaterial() void S3D_MASTER::Copy( S3D_MASTER* pattern ) void S3D_MASTER::Copy( S3D_MASTER* pattern ) { { m_Shape3DName = pattern->m_Shape3DName; SetShape3DName( pattern->GetShape3DName() ); m_MatScale = pattern->m_MatScale; m_MatScale = pattern->m_MatScale; m_MatRotation = pattern->m_MatRotation; m_MatRotation = pattern->m_MatRotation; m_MatPosition = pattern->m_MatPosition; m_MatPosition = pattern->m_MatPosition; Loading @@ -74,6 +74,7 @@ S3D_MASTER::S3D_MASTER( EDA_ITEM* aParent ) : m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0; m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0; m_3D_Drawings = NULL; m_3D_Drawings = NULL; m_Materials = NULL; m_Materials = NULL; m_ShapeType = FILE3D_NONE; } } Loading @@ -96,6 +97,45 @@ S3D_MASTER:: ~S3D_MASTER() } } bool S3D_MASTER::Is3DType( enum FILE3D_TYPE aShapeType ) { // type 'none' is not valid and will always return false if( aShapeType == FILE3D_NONE ) return false; // no one is interested if we have no file if( m_Shape3DName.empty() ) return false; if( aShapeType == m_ShapeType ) return true; return false; } void S3D_MASTER::SetShape3DName( const wxString& aShapeName ) { m_ShapeType = FILE3D_NONE; m_Shape3DName = aShapeName; if( m_Shape3DName.empty() ) return; wxFileName fn = m_Shape3DName; wxString ext = fn.GetExt(); if( ext == wxT( "wrl" ) || ext == wxT( "x3d" ) ) m_ShapeType = FILE3D_VRML; else if( ext == wxT( "idf" ) ) m_ShapeType = FILE3D_IDF; else m_ShapeType = FILE3D_UNKNOWN; return; } STRUCT_3D_SHAPE::STRUCT_3D_SHAPE( EDA_ITEM* aParent ) : STRUCT_3D_SHAPE::STRUCT_3D_SHAPE( EDA_ITEM* aParent ) : EDA_ITEM( aParent, NOT_USED ) EDA_ITEM( aParent, NOT_USED ) { { Loading
3d-viewer/3d_draw.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -857,7 +857,7 @@ void MODULE::ReadAndInsert3DComponentShape( EDA_3D_CANVAS* glcanvas ) for( ; struct3D != NULL; struct3D = struct3D->Next() ) for( ; struct3D != NULL; struct3D = struct3D->Next() ) { { if( !struct3D->m_Shape3DName.IsEmpty() ) if( struct3D->Is3DType( S3D_MASTER::FILE3D_VRML ) ) struct3D->ReadData(); struct3D->ReadData(); } } Loading
3d-viewer/3d_struct.h +26 −1 Original line number Original line Diff line number Diff line Loading @@ -92,13 +92,24 @@ public: class S3D_MASTER : public EDA_ITEM class S3D_MASTER : public EDA_ITEM { { public: public: wxString m_Shape3DName; /* 3D shape name in 3D library */ S3D_VERTEX m_MatScale; S3D_VERTEX m_MatScale; S3D_VERTEX m_MatRotation; S3D_VERTEX m_MatRotation; S3D_VERTEX m_MatPosition; S3D_VERTEX m_MatPosition; STRUCT_3D_SHAPE* m_3D_Drawings; STRUCT_3D_SHAPE* m_3D_Drawings; S3D_MATERIAL* m_Materials; S3D_MATERIAL* m_Materials; enum FILE3D_TYPE { FILE3D_NONE = 0, FILE3D_VRML, FILE3D_IDF, FILE3D_UNKNOWN }; private: wxString m_Shape3DName; /* 3D shape name in 3D library */ FILE3D_TYPE m_ShapeType; public: public: S3D_MASTER( EDA_ITEM* aParent ); S3D_MASTER( EDA_ITEM* aParent ); ~S3D_MASTER(); ~S3D_MASTER(); Loading @@ -120,6 +131,20 @@ public: #if defined(DEBUG) #if defined(DEBUG) void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override #endif #endif /** * Function Is3DType * returns true if the argument matches the type of model referred to * by m_Shape3DName */ bool Is3DType( enum FILE3D_TYPE aShapeType ); const wxString& GetShape3DName( void ) { return m_Shape3DName; } void SetShape3DName( const wxString& aShapeName ); }; }; Loading
CMakeLists.txt +5 −4 Original line number Original line Diff line number Diff line Loading @@ -171,10 +171,11 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" ) set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" ) endif() endif() # quiet GCC 4.8.1 while in boost # quiet GCC while in boost if( GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8 ) if( GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8 ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs" ) endif() endif() set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-strict-aliasing" ) if( APPLE ) if( APPLE ) set( KICAD_BUILD_STATIC ON) set( KICAD_BUILD_STATIC ON) Loading
common/build_version.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -6,7 +6,7 @@ #endif #endif #ifndef KICAD_BUILD_VERSION #ifndef KICAD_BUILD_VERSION # define KICAD_BUILD_VERSION "(2013-jul-14)" # define KICAD_BUILD_VERSION "(2014-jan-25)" #endif #endif /** /** Loading