remove the std::istream version of vtkfileread

This commit is contained in:
Xuchen Han
2019-08-21 22:39:07 -07:00
parent 4df31305a8
commit 750ff33f26
2 changed files with 6 additions and 12 deletions

View File

@@ -1244,13 +1244,7 @@ btSoftBody* btSoftBodyHelpers::CreateFromVtkFile(btSoftBodyWorldInfo& worldInfo,
std::ifstream fs;
fs.open(vtk_file);
btAssert(fs);
btSoftBody* psb = CreateFromVtkFile(worldInfo, fs);
fs.close();
return psb;
}
btSoftBody* btSoftBodyHelpers::CreateFromVtkFile(btSoftBodyWorldInfo& worldInfo, std::istream& in)
{
typedef btAlignedObjectArray<int> Index;
std::string line;
btAlignedObjectArray<btVector3> X;
@@ -1262,7 +1256,7 @@ btSoftBody* btSoftBodyHelpers::CreateFromVtkFile(btSoftBodyWorldInfo& worldInfo,
size_t n_tets = 0;
size_t x_count = 0;
size_t indices_count = 0;
while (std::getline(in, line))
while (std::getline(fs, line))
{
std::stringstream ss(line);
if (line.size() == (size_t)(0))
@@ -1332,7 +1326,7 @@ btSoftBody* btSoftBodyHelpers::CreateFromVtkFile(btSoftBodyWorldInfo& worldInfo,
printf("Links: %u\r\n", psb->m_links.size());
printf("Faces: %u\r\n", psb->m_faces.size());
printf("Tetras: %u\r\n", psb->m_tetras.size());
return (psb);
fs.close();
return psb;
}

View File

@@ -143,7 +143,7 @@ struct btSoftBodyHelpers
bool btetralinks,
bool bfacesfromtetras);
static btSoftBody* CreateFromVtkFile(btSoftBodyWorldInfo& worldInfo, const char* vtk_file);
static btSoftBody* CreateFromVtkFile(btSoftBodyWorldInfo& worldInfo, std::istream& in);
/// Sort the list of links to move link calculations that are dependent upon earlier