* made STLReader reuse stringstreams
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user