summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-09-06 22:11:00 (GMT)
committerMarius Kintel <marius@kintel.net>2011-09-06 22:11:00 (GMT)
commit29adaed02441832ce54d0f232f5ecb43eb28355d (patch)
treeefc2c6e7d174c856e3fab68336af61cb7a096a70
parentac01975b02055c6e66bb8c9d97f0d9bc876913b5 (diff)
Deprecated dxf_linear_extrude(), dxf_rotate_extrude() and the file parameters to linear_extrude() and rotate_extrude()
-rw-r--r--src/context.cc13
-rw-r--r--src/dxflinextrude.cc4
-rw-r--r--src/dxfrotextrude.cc4
3 files changed, 17 insertions, 4 deletions
diff --git a/src/context.cc b/src/context.cc
index 9722428..0100234 100644
--- a/src/context.cc
+++ b/src/context.cc
@@ -28,6 +28,7 @@
#include "expression.h"
#include "function.h"
#include "module.h"
+#include "builtin.h"
#include "printutils.h"
#include <QFileInfo>
#include <QDir>
@@ -147,8 +148,16 @@ Value Context::evaluate_function(const std::string &name,
AbstractNode *Context::evaluate_module(const ModuleInstantiation &inst) const
{
- if (this->modules_p && this->modules_p->find(inst.modname) != this->modules_p->end())
- return this->modules_p->find(inst.modname)->second->evaluate(this, &inst);
+ if (this->modules_p && this->modules_p->find(inst.modname) != this->modules_p->end()) {
+ AbstractModule *m = this->modules_p->find(inst.modname)->second;
+ if (m == builtin_modules["dxf_linear_extrude"]) {
+ PRINTF("DEPRECATED: The dxf_linear_extrude() module will be removed in future releases. Use a linear_extrude() instead.");
+ }
+ if (m == builtin_modules["dxf_rotate_extrude"]) {
+ PRINTF("DEPRECATED: The dxf_rotate_extrude() module will be removed in future releases. Use a rotate_extrude() instead.");
+ }
+ return m->evaluate(this, &inst);
+ }
if (this->usedlibs_p) {
BOOST_FOREACH(const ModuleContainer::value_type &m, *this->usedlibs_p) {
if (m.second->modules.find(inst.modname) != m.second->modules.end()) {
diff --git a/src/dxflinextrude.cc b/src/dxflinextrude.cc
index 14d69c4..fd37ffa 100644
--- a/src/dxflinextrude.cc
+++ b/src/dxflinextrude.cc
@@ -76,8 +76,10 @@ AbstractNode *DxfLinearExtrudeModule::evaluate(const Context *ctx, const ModuleI
Value twist = c.lookup_variable("twist", true);
Value slices = c.lookup_variable("slices", true);
- if (!file.text.empty())
+ if (!file.text.empty()) {
+ PRINTF("DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.");
node->filename = c.getAbsolutePath(file.text);
+ }
node->layername = layer.text;
node->height = height.num;
diff --git a/src/dxfrotextrude.cc b/src/dxfrotextrude.cc
index 338a73e..5889cee 100644
--- a/src/dxfrotextrude.cc
+++ b/src/dxfrotextrude.cc
@@ -70,8 +70,10 @@ AbstractNode *DxfRotateExtrudeModule::evaluate(const Context *ctx, const ModuleI
Value origin = c.lookup_variable("origin", true);
Value scale = c.lookup_variable("scale", true);
- if (!file.text.empty())
+ if (!file.text.empty()) {
+ PRINTF("DEPRECATED: Support for reading files in rotate_extrude will be removed in future releases. Use a child import() instead.");
node->filename = c.getAbsolutePath(file.text);
+ }
node->layername = layer.text;
node->convexity = (int)convexity.num;
contact: Jan Huwald // Impressum