瀏覽代碼

ObjImporter: remove unused code.

Kim Kulling 9 年之前
父節點
當前提交
ffdca3593b
共有 2 個文件被更改,包括 8 次插入12 次删除
  1. 0 2
      code/ObjFileData.h
  2. 8 10
      code/ObjFileParser.cpp

+ 0 - 2
code/ObjFileData.h

@@ -285,8 +285,6 @@ struct Model
     ObjFile::Material *m_pDefaultMaterial;
     ObjFile::Material *m_pDefaultMaterial;
     //! Vector with all generated materials
     //! Vector with all generated materials
     std::vector<std::string> m_MaterialLib;
     std::vector<std::string> m_MaterialLib;
-    //! Vector with all generated group
-    std::vector<std::string> m_GroupLib;
     //! Vector with all generated vertices
     //! Vector with all generated vertices
     std::vector<aiVector3D> m_Vertices;
     std::vector<aiVector3D> m_Vertices;
     //! vector with all generated normals
     //! vector with all generated normals

+ 8 - 10
code/ObjFileParser.cpp

@@ -692,38 +692,36 @@ int ObjFileParser::getMaterialIndex( const std::string &strMaterialName )
 
 
 // -------------------------------------------------------------------
 // -------------------------------------------------------------------
 //  Getter for a group name.
 //  Getter for a group name.
-void ObjFileParser::getGroupName()
-{
-    std::string strGroupName;
+void ObjFileParser::getGroupName() {
+    std::string groupName;
 
 
     // here we skip 'g ' from line
     // here we skip 'g ' from line
     m_DataIt = getNextToken<DataArrayIt>(m_DataIt, m_DataItEnd);
     m_DataIt = getNextToken<DataArrayIt>(m_DataIt, m_DataItEnd);
-    m_DataIt = getName<DataArrayIt>(m_DataIt, m_DataItEnd, strGroupName);
+    m_DataIt = getName<DataArrayIt>(m_DataIt, m_DataItEnd, groupName);
     if( isEndOfBuffer( m_DataIt, m_DataItEnd ) ) {
     if( isEndOfBuffer( m_DataIt, m_DataItEnd ) ) {
         return;
         return;
     }
     }
 
 
     // Change active group, if necessary
     // Change active group, if necessary
-    if ( m_pModel->m_strActiveGroup != strGroupName )
-    {
+    if ( m_pModel->m_strActiveGroup != groupName ) {
         // Search for already existing entry
         // Search for already existing entry
-        ObjFile::Model::ConstGroupMapIt it = m_pModel->m_Groups.find(strGroupName);
+        ObjFile::Model::ConstGroupMapIt it = m_pModel->m_Groups.find(groupName);
 
 
         // We are mapping groups into the object structure
         // We are mapping groups into the object structure
-        createObject( strGroupName );
+        createObject( groupName );
 
 
         // New group name, creating a new entry
         // New group name, creating a new entry
         if (it == m_pModel->m_Groups.end())
         if (it == m_pModel->m_Groups.end())
         {
         {
             std::vector<unsigned int> *pFaceIDArray = new std::vector<unsigned int>;
             std::vector<unsigned int> *pFaceIDArray = new std::vector<unsigned int>;
-            m_pModel->m_Groups[ strGroupName ] = pFaceIDArray;
+            m_pModel->m_Groups[ groupName ] = pFaceIDArray;
             m_pModel->m_pGroupFaceIDs = (pFaceIDArray);
             m_pModel->m_pGroupFaceIDs = (pFaceIDArray);
         }
         }
         else
         else
         {
         {
             m_pModel->m_pGroupFaceIDs = (*it).second;
             m_pModel->m_pGroupFaceIDs = (*it).second;
         }
         }
-        m_pModel->m_strActiveGroup = strGroupName;
+        m_pModel->m_strActiveGroup = groupName;
     }
     }
     m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
     m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
 }
 }