summaryrefslogtreecommitdiff
path: root/src/surface.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-07-15 01:57:41 (GMT)
committerMarius Kintel <marius@kintel.net>2012-07-15 01:57:41 (GMT)
commit2495df6bab07f14f0eed7062dec17d24599aa838 (patch)
tree738002af91eb84dc98e20b42520745161be0ca29 /src/surface.cc
parent3085bcc65cd80cc70b3b118b89ee5a41e7ef8ceb (diff)
Add timestamp to cache key for modules importing files. Fixes #141
Diffstat (limited to 'src/surface.cc')
-rw-r--r--src/surface.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/surface.cc b/src/surface.cc
index 756ad74..d962e38 100644
--- a/src/surface.cc
+++ b/src/surface.cc
@@ -43,6 +43,9 @@
#include <boost/assign/std/vector.hpp>
using namespace boost::assign; // bring 'operator+=()' into scope
+#include <boost/filesystem.hpp>
+namespace fs = boost::filesystem;
+
class SurfaceModule : public AbstractModule
{
public:
@@ -222,9 +225,15 @@ PolySet *SurfaceNode::evaluate_polyset(class PolySetEvaluator *) const
std::string SurfaceNode::toString() const
{
std::stringstream stream;
+ fs::path path(this->filename);
stream << this->name() << "(file = " << this->filename << ", "
- "center = " << (this->center ? "true" : "false") << ")";
+ "center = " << (this->center ? "true" : "false")
+#ifndef OPENSCAD_TESTING
+ // timestamp is needed for caching, but disturbs the test framework
+ << ", " "timestamp = " << (fs::exists(path) ? fs::last_write_time(path) : 0)
+#endif
+ << ")";
return stream.str();
}
contact: Jan Huwald // Impressum