Loading 3d-viewer/vrml_aux.cpp +10 −6 Original line number Original line Diff line number Diff line Loading @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application. * * * Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com> * Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com> * Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors. * * * This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License Loading @@ -28,9 +28,13 @@ #include "vrml_aux.h" #include "vrml_aux.h" char SkipGetChar( FILE* File ) static int SkipGetChar ( FILE* File ); static int SkipGetChar( FILE* File ) { { char c; int c; bool re_parse; bool re_parse; if( ( c = fgetc( File ) ) == EOF ) if( ( c = fgetc( File ) ) == EOF ) Loading Loading @@ -92,7 +96,7 @@ char SkipGetChar( FILE* File ) char* GetNextTag( FILE* File, char* tag ) char* GetNextTag( FILE* File, char* tag ) { { char c = SkipGetChar( File ); int c = SkipGetChar( File ); if( c == EOF ) if( c == EOF ) { { Loading Loading @@ -136,7 +140,7 @@ char* GetNextTag( FILE* File, char* tag ) int read_NotImplemented( FILE* File, char closeChar ) int read_NotImplemented( FILE* File, char closeChar ) { { char c; int c; // DBG( printf( "look for %c\n", closeChar) ); // DBG( printf( "look for %c\n", closeChar) ); while( ( c = fgetc( File ) ) != EOF ) while( ( c = fgetc( File ) ) != EOF ) Loading Loading @@ -189,7 +193,7 @@ int parseVertex( FILE* File, glm::vec3& dst_vertex ) dst_vertex.y = b; dst_vertex.y = b; dst_vertex.z = c; dst_vertex.z = c; char s = SkipGetChar( File ); int s = SkipGetChar( File ); if( s != EOF ) if( s != EOF ) { { Loading 3d-viewer/vrml_aux.h +0 −1 Original line number Original line Diff line number Diff line Loading @@ -49,7 +49,6 @@ #include <wx/glcanvas.h> #include <wx/glcanvas.h> int read_NotImplemented( FILE* File, char closeChar); int read_NotImplemented( FILE* File, char closeChar); char SkipGetChar ( FILE* File ); int parseVertexList( FILE* File, std::vector< glm::vec3 > &dst_vector); int parseVertexList( FILE* File, std::vector< glm::vec3 > &dst_vector); int parseVertex( FILE* File, glm::vec3 &dst_vertex ); int parseVertex( FILE* File, glm::vec3 &dst_vertex ); int parseFloat( FILE* File, float *dst_float ); int parseFloat( FILE* File, float *dst_float ); Loading 3d-viewer/vrml_v1_modelparser.cpp +5 −5 Original line number Original line Diff line number Diff line Loading @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application. * * * Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com> * Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com> * Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors. * * * This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License Loading Loading @@ -93,7 +93,7 @@ void VRML1_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3 while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == '}' ) || ( *text == ']' ) ) if( ( *text == '}' ) || ( *text == ']' ) ) { { continue; continue; } } Loading Loading @@ -187,7 +187,7 @@ int VRML1_MODEL_PARSER::readMaterial() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading Loading @@ -235,7 +235,7 @@ int VRML1_MODEL_PARSER::readCoordinate3() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading Loading @@ -263,7 +263,7 @@ int VRML1_MODEL_PARSER::readIndexedFaceSet() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading 3d-viewer/vrml_v2_modelparser.cpp +10 −10 Original line number Original line Diff line number Diff line Loading @@ -95,7 +95,7 @@ void VRML2_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3 while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == '}' ) || ( *text == ']' ) ) if( ( *text == '}' ) || ( *text == ']' ) ) { { continue; continue; } } Loading Loading @@ -140,7 +140,7 @@ int VRML2_MODEL_PARSER::read_Transform() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading Loading @@ -259,7 +259,7 @@ int VRML2_MODEL_PARSER::read_DEF() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { // DBG( printf( " skiping %c\n", *text) ); // DBG( printf( " skiping %c\n", *text) ); continue; continue; Loading Loading @@ -316,7 +316,7 @@ int VRML2_MODEL_PARSER::read_Shape() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading Loading @@ -363,7 +363,7 @@ int VRML2_MODEL_PARSER::read_Appearance() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading Loading @@ -468,7 +468,7 @@ int VRML2_MODEL_PARSER::read_Material() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading Loading @@ -561,7 +561,7 @@ int VRML2_MODEL_PARSER::read_IndexedFaceSet() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading Loading @@ -744,7 +744,7 @@ int VRML2_MODEL_PARSER::read_Color() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading Loading @@ -774,7 +774,7 @@ int VRML2_MODEL_PARSER::read_Normal() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading Loading @@ -812,7 +812,7 @@ int VRML2_MODEL_PARSER::read_Coordinate() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading bitmap2component/bitmap2component.cpp +6 −0 Original line number Original line Diff line number Diff line Loading @@ -158,6 +158,12 @@ int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile, st = potrace_trace( param, aPotrace_bitmap ); st = potrace_trace( param, aPotrace_bitmap ); if( !st || st->status != POTRACE_STATUS_OK ) if( !st || st->status != POTRACE_STATUS_OK ) { { if( st ) { potrace_state_free( st ); } potrace_param_free( param ); fprintf( stderr, "Error tracing bitmap: %s\n", strerror( errno ) ); fprintf( stderr, "Error tracing bitmap: %s\n", strerror( errno ) ); return 1; return 1; } } Loading Loading
3d-viewer/vrml_aux.cpp +10 −6 Original line number Original line Diff line number Diff line Loading @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application. * * * Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com> * Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com> * Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors. * * * This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License Loading @@ -28,9 +28,13 @@ #include "vrml_aux.h" #include "vrml_aux.h" char SkipGetChar( FILE* File ) static int SkipGetChar ( FILE* File ); static int SkipGetChar( FILE* File ) { { char c; int c; bool re_parse; bool re_parse; if( ( c = fgetc( File ) ) == EOF ) if( ( c = fgetc( File ) ) == EOF ) Loading Loading @@ -92,7 +96,7 @@ char SkipGetChar( FILE* File ) char* GetNextTag( FILE* File, char* tag ) char* GetNextTag( FILE* File, char* tag ) { { char c = SkipGetChar( File ); int c = SkipGetChar( File ); if( c == EOF ) if( c == EOF ) { { Loading Loading @@ -136,7 +140,7 @@ char* GetNextTag( FILE* File, char* tag ) int read_NotImplemented( FILE* File, char closeChar ) int read_NotImplemented( FILE* File, char closeChar ) { { char c; int c; // DBG( printf( "look for %c\n", closeChar) ); // DBG( printf( "look for %c\n", closeChar) ); while( ( c = fgetc( File ) ) != EOF ) while( ( c = fgetc( File ) ) != EOF ) Loading Loading @@ -189,7 +193,7 @@ int parseVertex( FILE* File, glm::vec3& dst_vertex ) dst_vertex.y = b; dst_vertex.y = b; dst_vertex.z = c; dst_vertex.z = c; char s = SkipGetChar( File ); int s = SkipGetChar( File ); if( s != EOF ) if( s != EOF ) { { Loading
3d-viewer/vrml_aux.h +0 −1 Original line number Original line Diff line number Diff line Loading @@ -49,7 +49,6 @@ #include <wx/glcanvas.h> #include <wx/glcanvas.h> int read_NotImplemented( FILE* File, char closeChar); int read_NotImplemented( FILE* File, char closeChar); char SkipGetChar ( FILE* File ); int parseVertexList( FILE* File, std::vector< glm::vec3 > &dst_vector); int parseVertexList( FILE* File, std::vector< glm::vec3 > &dst_vector); int parseVertex( FILE* File, glm::vec3 &dst_vertex ); int parseVertex( FILE* File, glm::vec3 &dst_vertex ); int parseFloat( FILE* File, float *dst_float ); int parseFloat( FILE* File, float *dst_float ); Loading
3d-viewer/vrml_v1_modelparser.cpp +5 −5 Original line number Original line Diff line number Diff line Loading @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application. * * * Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com> * Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com> * Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors. * * * This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License Loading Loading @@ -93,7 +93,7 @@ void VRML1_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3 while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == '}' ) || ( *text == ']' ) ) if( ( *text == '}' ) || ( *text == ']' ) ) { { continue; continue; } } Loading Loading @@ -187,7 +187,7 @@ int VRML1_MODEL_PARSER::readMaterial() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading Loading @@ -235,7 +235,7 @@ int VRML1_MODEL_PARSER::readCoordinate3() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading Loading @@ -263,7 +263,7 @@ int VRML1_MODEL_PARSER::readIndexedFaceSet() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading
3d-viewer/vrml_v2_modelparser.cpp +10 −10 Original line number Original line Diff line number Diff line Loading @@ -95,7 +95,7 @@ void VRML2_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3 while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == '}' ) || ( *text == ']' ) ) if( ( *text == '}' ) || ( *text == ']' ) ) { { continue; continue; } } Loading Loading @@ -140,7 +140,7 @@ int VRML2_MODEL_PARSER::read_Transform() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading Loading @@ -259,7 +259,7 @@ int VRML2_MODEL_PARSER::read_DEF() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { // DBG( printf( " skiping %c\n", *text) ); // DBG( printf( " skiping %c\n", *text) ); continue; continue; Loading Loading @@ -316,7 +316,7 @@ int VRML2_MODEL_PARSER::read_Shape() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading Loading @@ -363,7 +363,7 @@ int VRML2_MODEL_PARSER::read_Appearance() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading Loading @@ -468,7 +468,7 @@ int VRML2_MODEL_PARSER::read_Material() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading Loading @@ -561,7 +561,7 @@ int VRML2_MODEL_PARSER::read_IndexedFaceSet() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading Loading @@ -744,7 +744,7 @@ int VRML2_MODEL_PARSER::read_Color() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading Loading @@ -774,7 +774,7 @@ int VRML2_MODEL_PARSER::read_Normal() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading Loading @@ -812,7 +812,7 @@ int VRML2_MODEL_PARSER::read_Coordinate() while( GetNextTag( m_file, text ) ) while( GetNextTag( m_file, text ) ) { { if( ( text == NULL ) || ( *text == ']' ) ) if( *text == ']' ) { { continue; continue; } } Loading
bitmap2component/bitmap2component.cpp +6 −0 Original line number Original line Diff line number Diff line Loading @@ -158,6 +158,12 @@ int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile, st = potrace_trace( param, aPotrace_bitmap ); st = potrace_trace( param, aPotrace_bitmap ); if( !st || st->status != POTRACE_STATUS_OK ) if( !st || st->status != POTRACE_STATUS_OK ) { { if( st ) { potrace_state_free( st ); } potrace_param_free( param ); fprintf( stderr, "Error tracing bitmap: %s\n", strerror( errno ) ); fprintf( stderr, "Error tracing bitmap: %s\n", strerror( errno ) ); return 1; return 1; } } Loading