diff options
author | wizard23 <wizard23@cb376a5e-1013-0410-a455-b6b1f9ac8223> | 2009-02-22 19:23:42 +0000 |
---|---|---|
committer | wizard23 <wizard23@cb376a5e-1013-0410-a455-b6b1f9ac8223> | 2009-02-22 19:23:42 +0000 |
commit | 564da929e71eddb54cee6d5695699bc646a96906 (patch) | |
tree | 6ba2893f36ae7d5b09246f9cb06f43eea47c3259 | |
parent | 9f9722f3eb78651aae66bb5e57874740a524eb08 (diff) | |
download | reprap-backup-564da929e71eddb54cee6d5695699bc646a96906.tar.gz reprap-backup-564da929e71eddb54cee6d5695699bc646a96906.zip |
still working on creation of parametrized objects
git-svn-id: https://reprap.svn.sourceforge.net/svnroot/reprap@2588 cb376a5e-1013-0410-a455-b6b1f9ac8223
2 files changed, 10 insertions, 16 deletions
diff --git a/trunk/users/metalab/AoI/plugins/CSGEvaluator/src/org/reprap/artofillusion/CSGEvaluatorDialog.java b/trunk/users/metalab/AoI/plugins/CSGEvaluator/src/org/reprap/artofillusion/CSGEvaluatorDialog.java index d87bcab5..f4722d70 100644 --- a/trunk/users/metalab/AoI/plugins/CSGEvaluator/src/org/reprap/artofillusion/CSGEvaluatorDialog.java +++ b/trunk/users/metalab/AoI/plugins/CSGEvaluator/src/org/reprap/artofillusion/CSGEvaluatorDialog.java @@ -28,10 +28,6 @@ import buoy.widget.LayoutInfo; import java.util.*; import java.io.*; -import org.cheffo.jeplite.*; -import org.cheffo.jeplite.util.*; -import org.cheffo.jeplite.optimizer.*; - /** * CSGEvaluator dialog @@ -39,15 +35,11 @@ import org.cheffo.jeplite.optimizer.*; class CSGEvaluatorDialog extends BDialog { LayoutWindow window; - JEP jep = new JEP(); - + public CSGEvaluatorDialog(LayoutWindow window) { super(window, "CSG Evaluator ", false); // Modeless - jep.addVariable("x", 22.5); - jep.parseExpression("x*2-3"); - this.window = window; this.setResizable(false); @@ -74,13 +66,8 @@ class CSGEvaluatorDialog extends BDialog } */ - try { - - bc.add(new BLabel("<html>CSG Evaluator Control Panel <font size=1>V"+versionstr+"</font>" + jep.getValue() + "</html>"), BorderContainer.NORTH); - } - catch (Exception ex) - {} + bc.add(new BLabel("<html>CSG Evaluator Control Panel <font size=1>V"+versionstr+"</font></html>"), BorderContainer.NORTH); String[] buttons = new String [] {"evaluate", "devaluate", "union", "intersection", "difference", "readParameters"}; String[] labels = new String [] {"Actions", null, "Boolean Op", null, null, null}; diff --git a/trunk/users/metalab/AoI/plugins/CSGEvaluator/src/org/reprap/artofillusion/MetaCADEvaluatorEngine.java b/trunk/users/metalab/AoI/plugins/CSGEvaluator/src/org/reprap/artofillusion/MetaCADEvaluatorEngine.java index 5072f42a..d5074833 100644 --- a/trunk/users/metalab/AoI/plugins/CSGEvaluator/src/org/reprap/artofillusion/MetaCADEvaluatorEngine.java +++ b/trunk/users/metalab/AoI/plugins/CSGEvaluator/src/org/reprap/artofillusion/MetaCADEvaluatorEngine.java @@ -31,12 +31,15 @@ public class MetaCADEvaluatorEngine extends CSGEvaluatorEngine public void readParameters()
{
- JEP jep = new JEP();
+ jep = new JEP();
+ jep.addStandardConstants();
+ jep.addStandardFunctions();
EvaluateFile("cad_parameters.txt");
}
public ObjectInfo evaluateNode(ObjectInfo parent, UndoRecord undo)
{
+ readParameters();
ParseFunction(parent, undo);
return super.evaluateNode(parent, undo);
@@ -145,6 +148,10 @@ public class MetaCADEvaluatorEngine extends CSGEvaluatorEngine dy = Evaluate(splitParameters[7]);
dz = Evaluate(splitParameters[8]);
+ Cube newCube =new Cube(1,2,3);
+
+ parent.setObject(newCube);
+
obj.setSize(dx, dy, dz);
parent.setCoords(new CoordinateSystem(new Vec3(x, y, z), rotx, roty, rotz));
|