MCPcopy Create free account
hub / github.com/assimp/assimp / FillDefaultStatistics

Method FillDefaultStatistics

tools/assimp_view/Display.cpp:802–854  ·  view source on GitHub ↗

------------------------------------------------------------------------------- FIll statistics UI

Source from the content-addressed store, hash-verified

800//-------------------------------------------------------------------------------
801// FIll statistics UI
802int CDisplay::FillDefaultStatistics(void)
803{
804 if (!g_pcAsset)
805 {
806 // clear all stats edit controls
807 SetDlgItemText(g_hDlg,IDC_EVERT,"0");
808 SetDlgItemText(g_hDlg,IDC_EFACE,"0");
809 SetDlgItemText(g_hDlg,IDC_EMAT,"0");
810 SetDlgItemText(g_hDlg,IDC_EMESH,"0");
811 SetDlgItemText(g_hDlg,IDC_ENODEWND,"0");
812 SetDlgItemText(g_hDlg,IDC_ESHADER,"0");
813 SetDlgItemText(g_hDlg,IDC_ELOAD,"");
814 SetDlgItemText(g_hDlg,IDC_ETEX,"0");
815 return 1;
816 }
817
818 // get the number of vertices/faces in the model
819 unsigned int iNumVert = 0;
820 unsigned int iNumFaces = 0;
821 for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumMeshes;++i)
822 {
823 iNumVert += g_pcAsset->pcScene->mMeshes[i]->mNumVertices;
824 iNumFaces += g_pcAsset->pcScene->mMeshes[i]->mNumFaces;
825 }
826 // and fill the statistic edit controls
827 char szOut[1024];
828 ai_snprintf(szOut,1024,"%i",(int)iNumVert);
829 SetDlgItemText(g_hDlg,IDC_EVERT,szOut);
830 ai_snprintf(szOut, 1024,"%i",(int)iNumFaces);
831 SetDlgItemText(g_hDlg,IDC_EFACE,szOut);
832 ai_snprintf(szOut, 1024,"%i",(int)g_pcAsset->pcScene->mNumMaterials);
833 SetDlgItemText(g_hDlg,IDC_EMAT,szOut);
834 ai_snprintf(szOut, 1024,"%i",(int)g_pcAsset->pcScene->mNumMeshes);
835 SetDlgItemText(g_hDlg,IDC_EMESH,szOut);
836
837 // need to get the number of nodes
838 iNumVert = 0;
839 GetNodeCount(g_pcAsset->pcScene->mRootNode,&iNumVert);
840 ai_snprintf(szOut, 1024,"%i",(int)iNumVert);
841 SetDlgItemText(g_hDlg,IDC_ENODEWND,szOut);
842
843 // now get the number of unique shaders generated for the asset
844 // (even if the environment changes this number won't change)
845 ai_snprintf(szOut, 1024,"%i", CMaterialManager::Instance().GetShaderCount());
846 SetDlgItemText(g_hDlg,IDC_ESHADER,szOut);
847
848 sprintf(szOut,"%.5f",(float)g_fLoadTime);
849 SetDlgItemText(g_hDlg,IDC_ELOAD,szOut);
850
851 UpdateColorFieldsInUI();
852 UpdateWindow(g_hDlg);
853 return 1;
854}
855//-------------------------------------------------------------------------------
856// Reset UI
857int CDisplay::Reset(void)

Callers 1

LoadAssetFunction · 0.80

Calls 5

ai_snprintfFunction · 0.85
GetNodeCountFunction · 0.85
InstanceClass · 0.85
UpdateColorFieldsInUIFunction · 0.85
GetShaderCountMethod · 0.80

Tested by

no test coverage detected