273 wxCHECK( aNode,
false );
284 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [BUG] assigning multiple Colors nodes" ),
285 __FILE__, __FUNCTION__, __LINE__ );
313 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [BUG] assigning multiple Colors nodes" ),
314 __FILE__, __FUNCTION__, __LINE__ );
342 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [BUG] assigning multiple Normals nodes" ),
343 __FILE__, __FUNCTION__, __LINE__ );
371 wxLogTrace( MASK_3D_SG,
372 wxT(
"%s:%s:%d * [BUG] assigning multiple CoordIndex nodes" ),
373 __FILE__, __FUNCTION__, __LINE__ );
387 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [BUG] object type '%s' is not a valid type for "
388 "this object '%d'" ),
389 __FILE__, __FUNCTION__, __LINE__,
602 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [BUG] non-empty node" ),
603 __FILE__, __FUNCTION__, __LINE__ );
611 for(
int i = 0; i <
NITEMS; ++i )
612 aFile.read( (
char*) &items[i],
sizeof(
bool ) );
614 if( ( items[0] && items[1] ) || ( items[3] && items[4] ) || ( items[5] && items[6] ) )
616 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; multiple item definitions "
618 __FILE__, __FUNCTION__, __LINE__,
619 static_cast<int>( aFile.tellg() ) );
630 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; bad child coords tag at "
632 __FILE__, __FUNCTION__, __LINE__,
633 static_cast<int>( aFile.tellg() ) );
641 if( !
m_Coords->ReadCache( aFile,
this ) )
643 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; corrupt data while "
644 "reading coords '%s'" ),
645 __FILE__, __FUNCTION__, __LINE__,
656 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; bad ref coords tag at "
658 __FILE__, __FUNCTION__, __LINE__,
659 static_cast<int>( aFile.tellg() ) );
668 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; cannot find ref "
670 __FILE__, __FUNCTION__, __LINE__,
678 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; type is not SGCOORDS "
680 __FILE__, __FUNCTION__, __LINE__,
694 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; bad coord index tag at "
696 __FILE__, __FUNCTION__, __LINE__,
697 static_cast<int>( aFile.tellg() ) );
707 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data while reading coord "
709 __FILE__, __FUNCTION__, __LINE__,
720 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; bad child normals tag "
722 __FILE__, __FUNCTION__, __LINE__,
723 static_cast<int>( aFile.tellg() ) );
731 if( !
m_Normals->ReadCache( aFile,
this ) )
733 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data while reading normals "
735 __FILE__, __FUNCTION__, __LINE__,
746 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; bad ref normals tag at "
748 __FILE__, __FUNCTION__, __LINE__,
749 static_cast<int>( aFile.tellg() ) );
758 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt: cannot find ref normals "
760 __FILE__, __FUNCTION__, __LINE__,
768 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt: type is not SGNORMALS '%s'" ),
769 __FILE__, __FUNCTION__, __LINE__,
783 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; bad child colors tag "
785 __FILE__, __FUNCTION__, __LINE__,
786 static_cast<int>( aFile.tellg() ) );
794 if( !
m_Colors->ReadCache( aFile,
this ) )
796 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data while reading colors "
798 __FILE__, __FUNCTION__, __LINE__,
809 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data; bad ref colors tag at "
811 __FILE__, __FUNCTION__, __LINE__,
812 static_cast<int>( aFile.tellg() ) );
821 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data: cannot find ref colors "
823 __FILE__, __FUNCTION__, __LINE__,
831 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] corrupt data: type is not SGCOLORS "
833 __FILE__, __FUNCTION__, __LINE__,
861 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] bad model; no vertices, vertex indices, "
863 __FILE__, __FUNCTION__, __LINE__ );
873 if(
nullptr == coords )
882 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] bad model; fewer than 3 vertices" ),
883 __FILE__, __FUNCTION__, __LINE__ );
892 int* lCIdx =
nullptr;
895 if( nCIdx < 3 || ( nCIdx % 3 > 0 ) )
897 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] bad model; no vertex indices or not "
899 __FILE__, __FUNCTION__, __LINE__ );
907 for(
size_t i = 0; i < nCIdx; ++i )
909 if( lCIdx[i] < 0 || lCIdx[i] >= (
int)nCoords )
911 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] bad model; vertex index out of "
913 __FILE__, __FUNCTION__, __LINE__ );
926 if(
nullptr == pNorms )
931 if( nNorms != nCoords )
933 wxLogTrace( MASK_3D_SG, wxT(
"%s:%s:%d * [INFO] bad model; number of normals (%ul) does "
934 "not match number of vertices (%ul)" ),
935 __FILE__, __FUNCTION__, __LINE__,
936 static_cast<unsigned long>( nNorms ),
937 static_cast<unsigned long>( nCoords ) );
947 if(
nullptr == pColors )
950 if(
nullptr != pColors )