* made STLReader reuse stringstreams

This commit is contained in:
Martin Schultz
2015-09-11 15:41:16 +02:00
parent ebd5180a8f
commit 2dce1916c5

View File

@@ -249,6 +249,9 @@ read_stla(std::istream& _in, BaseImporter& _bi, Options& _opt) const
std::string line;
static std::string garbage;
static std::stringstream strstream;
bool facet_normal(false);
while( _in && !_in.eof() ) {
@@ -265,9 +268,8 @@ read_stla(std::istream& _in, BaseImporter& _bi, Options& _opt) const
// Normal found?
if (line.find("facet normal") != std::string::npos) {
std::stringstream strstream(line);
std::string garbage;
strstream.str(line);
strstream.clear();
// facet
strstream >> garbage;
@@ -292,9 +294,9 @@ read_stla(std::istream& _in, BaseImporter& _bi, Options& _opt) const
std::getline(_in, line);
trimStdString(line);
std::stringstream strstream(line);
strstream.str(line);
strstream.clear();
std::string garbage;
strstream >> garbage;
strstream >> v[0];