* 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;
|
std::string line;
|
||||||
|
|
||||||
|
static std::string garbage;
|
||||||
|
static std::stringstream strstream;
|
||||||
|
|
||||||
bool facet_normal(false);
|
bool facet_normal(false);
|
||||||
|
|
||||||
while( _in && !_in.eof() ) {
|
while( _in && !_in.eof() ) {
|
||||||
@@ -265,9 +268,8 @@ read_stla(std::istream& _in, BaseImporter& _bi, Options& _opt) const
|
|||||||
|
|
||||||
// Normal found?
|
// Normal found?
|
||||||
if (line.find("facet normal") != std::string::npos) {
|
if (line.find("facet normal") != std::string::npos) {
|
||||||
std::stringstream strstream(line);
|
strstream.str(line);
|
||||||
|
strstream.clear();
|
||||||
std::string garbage;
|
|
||||||
|
|
||||||
// facet
|
// facet
|
||||||
strstream >> garbage;
|
strstream >> garbage;
|
||||||
@@ -292,9 +294,9 @@ read_stla(std::istream& _in, BaseImporter& _bi, Options& _opt) const
|
|||||||
std::getline(_in, line);
|
std::getline(_in, line);
|
||||||
trimStdString(line);
|
trimStdString(line);
|
||||||
|
|
||||||
std::stringstream strstream(line);
|
strstream.str(line);
|
||||||
|
strstream.clear();
|
||||||
|
|
||||||
std::string garbage;
|
|
||||||
strstream >> garbage;
|
strstream >> garbage;
|
||||||
|
|
||||||
strstream >> v[0];
|
strstream >> v[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user