277 wxCHECK( aNode,
false );
288 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [BUG] assigning multiple Colors nodes" ),
289 __FILE__, __FUNCTION__, __LINE__ );
317 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [BUG] assigning multiple Colors nodes" ),
318 __FILE__, __FUNCTION__, __LINE__ );
346 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [BUG] assigning multiple Normals nodes" ),
347 __FILE__, __FUNCTION__, __LINE__ );
375 wxLogTrace( MASK_3D_SG,
376 wxT(
"%s:%s:%d * [BUG] assigning multiple CoordIndex nodes" ),
377 __FILE__, __FUNCTION__, __LINE__ );
391 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [BUG] object type '%s' is not a valid type for "
392 "this object '%d'" ),
393 __FILE__, __FUNCTION__, __LINE__,
606 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [BUG] non-empty node" ),
607 __FILE__, __FUNCTION__, __LINE__ );
615 for(
int i = 0; i <
NITEMS; ++i )
616 aFile.read( (
char*) &items[i],
sizeof(
bool ) );
618 if( ( items[0] && items[1] ) || ( items[3] && items[4] ) || ( items[5] && items[6] ) )
620 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; multiple item definitions "
622 __FILE__, __FUNCTION__, __LINE__,
623 static_cast<int>( aFile.tellg() ) );
634 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; bad child coords tag at "
636 __FILE__, __FUNCTION__, __LINE__,
637 static_cast<int>( aFile.tellg() ) );
645 if( !
m_Coords->ReadCache( aFile,
this ) )
647 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; corrupt data while "
648 "reading coords '%s'" ),
649 __FILE__, __FUNCTION__, __LINE__,
660 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; bad ref coords tag at "
662 __FILE__, __FUNCTION__, __LINE__,
663 static_cast<int>( aFile.tellg() ) );
672 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; cannot find ref "
674 __FILE__, __FUNCTION__, __LINE__,
682 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; type is not SGCOORDS "
684 __FILE__, __FUNCTION__, __LINE__,
698 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; bad coord index tag at "
700 __FILE__, __FUNCTION__, __LINE__,
701 static_cast<int>( aFile.tellg() ) );
711 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data while reading coord "
713 __FILE__, __FUNCTION__, __LINE__,
724 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; bad child normals tag "
726 __FILE__, __FUNCTION__, __LINE__,
727 static_cast<int>( aFile.tellg() ) );
735 if( !
m_Normals->ReadCache( aFile,
this ) )
737 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data while reading normals "
739 __FILE__, __FUNCTION__, __LINE__,
750 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; bad ref normals tag at "
752 __FILE__, __FUNCTION__, __LINE__,
753 static_cast<int>( aFile.tellg() ) );
762 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt: cannot find ref normals "
764 __FILE__, __FUNCTION__, __LINE__,
772 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt: type is not SGNORMALS '%s'" ),
773 __FILE__, __FUNCTION__, __LINE__,
787 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; bad child colors tag "
789 __FILE__, __FUNCTION__, __LINE__,
790 static_cast<int>( aFile.tellg() ) );
798 if( !
m_Colors->ReadCache( aFile,
this ) )
800 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data while reading colors "
802 __FILE__, __FUNCTION__, __LINE__,
813 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; bad ref colors tag at "
815 __FILE__, __FUNCTION__, __LINE__,
816 static_cast<int>( aFile.tellg() ) );
825 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data: cannot find ref colors "
827 __FILE__, __FUNCTION__, __LINE__,
835 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data: type is not SGCOLORS "
837 __FILE__, __FUNCTION__, __LINE__,
865 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] bad model; no vertices, vertex indices, "
867 __FILE__, __FUNCTION__, __LINE__ );
877 if(
nullptr == coords )
886 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] bad model; fewer than 3 vertices" ),
887 __FILE__, __FUNCTION__, __LINE__ );
896 int* lCIdx =
nullptr;
899 if( nCIdx < 3 || ( nCIdx % 3 > 0 ) )
901 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] bad model; no vertex indices or not "
903 __FILE__, __FUNCTION__, __LINE__ );
911 for(
size_t i = 0; i < nCIdx; ++i )
913 if( lCIdx[i] < 0 || lCIdx[i] >= (
int)nCoords )
915 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] bad model; vertex index out of "
917 __FILE__, __FUNCTION__, __LINE__ );
930 if(
nullptr == pNorms )
935 if( nNorms != nCoords )
937 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] bad model; number of normals (%ul) does "
938 "not match number of vertices (%ul)" ),
939 __FILE__, __FUNCTION__, __LINE__,
940 static_cast<unsigned long>( nNorms ),
941 static_cast<unsigned long>( nCoords ) );
951 if(
nullptr == pColors )
954 if(
nullptr != pColors )