summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-08 03:35:04 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-08 03:35:04 (GMT)
commit36eb2d48c743d70ea39c3bd0afc1a23c127397aa (patch)
treee6bb1554e2fd7a96fa649aad97e96d29eba818d7
parent8df04678d04c65094b66da9abfe8443501fa62d2 (diff)
Clifford Wolf:
Fixed dumping/caching of import_* statements git-svn-id: http://svn.clifford.at/openscad/trunk@236 b57f626f-c46c-0410-a088-ec61d464b74c
-rw-r--r--import.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/import.cc b/import.cc
index 3d332b8..88fae83 100644
--- a/import.cc
+++ b/import.cc
@@ -200,23 +200,22 @@ QString ImportNode::dump(QString indent) const
{
if (dump_cache.isEmpty()) {
QString text;
+ struct stat st;
+ memset(&st, 0, sizeof(struct stat));
+ stat(filename.toAscii().data(), &st);
if (type == TYPE_STL)
- text.sprintf("import_stl(filename = \"%s\", convexity = %d);\n",
- filename.toAscii().data(), convexity);
+ text.sprintf("import_stl(file = \"%s\", cache = \"%x.%x\", convexity = %d);\n",
+ filename.toAscii().data(), (int)st.st_mtime, (int)st.st_size, convexity);
if (type == TYPE_OFF)
- text.sprintf("import_off(filename = \"%s\", convexity = %d);\n",
- filename.toAscii().data(), convexity);
- if (type == TYPE_DXF) {
- struct stat st;
- memset(&st, 0, sizeof(struct stat));
- stat(filename.toAscii().data(), &st);
+ text.sprintf("import_off(file = \"%s\", cache = \"%x.%x\", convexity = %d);\n",
+ filename.toAscii().data(), (int)st.st_mtime, (int)st.st_size, convexity);
+ if (type == TYPE_DXF)
text.sprintf("import_dxf(file = \"%s\", cache = \"%x.%x\", layer = \"%s\", "
"origin = [ %f %f ], scale = %f, convexity = %d, "
"$fn = %f, $fa = %f, $fs = %f);\n",
filename.toAscii().data(), (int)st.st_mtime, (int)st.st_size,
layername.toAscii().data(), origin_x, origin_y, scale, convexity,
fn, fs, fa);
- }
((AbstractNode*)this)->dump_cache = indent + QString("n%1: ").arg(idx) + text;
}
return dump_cache;
contact: Jan Huwald // Impressum