diff --git a/org.eclipse.emf.cdo.threedee.ui/icons/parameters.gif b/org.eclipse.emf.cdo.threedee.ui/icons/parameters.gif
new file mode 100644
index 0000000..d37495a
--- /dev/null
+++ b/org.eclipse.emf.cdo.threedee.ui/icons/parameters.gif
Binary files differ
diff --git a/org.eclipse.emf.cdo.threedee.ui/plugin.xml b/org.eclipse.emf.cdo.threedee.ui/plugin.xml
index cec4052..abb64e7 100644
--- a/org.eclipse.emf.cdo.threedee.ui/plugin.xml
+++ b/org.eclipse.emf.cdo.threedee.ui/plugin.xml
@@ -19,14 +19,14 @@
class="org.eclipse.emf.cdo.threedee.ui.ThreeDeeView"
icon="icons/world.gif"
id="org.eclipse.emf.cdo.threedee.ui.ThreeDeeWorld"
- name="ThreeDee World">
+ name="World">
</view>
<view
category="org.eclipse.emf.cdo.threedee"
- class="org.eclipse.emf.cdo.threedee.ui.InfoTransformView"
- icon="icons/text.gif"
- id="org.eclipse.emf.cdo.threedee.ui.InfoTransformView"
- name="ThreeDee Info Transform">
+ class="org.eclipse.emf.cdo.threedee.ui.ParametersView"
+ icon="icons/parameters.gif"
+ id="org.eclipse.emf.cdo.threedee.ui.ParametersView"
+ name="Parameters">
</view>
</extension>
diff --git a/org.eclipse.emf.cdo.threedee.ui/src/org/eclipse/emf/cdo/threedee/ui/InfoTransformView.java b/org.eclipse.emf.cdo.threedee.ui/src/org/eclipse/emf/cdo/threedee/ui/ParametersView.java
similarity index 89%
rename from org.eclipse.emf.cdo.threedee.ui/src/org/eclipse/emf/cdo/threedee/ui/InfoTransformView.java
rename to org.eclipse.emf.cdo.threedee.ui/src/org/eclipse/emf/cdo/threedee/ui/ParametersView.java
index c159e8b..03aaf11 100644
--- a/org.eclipse.emf.cdo.threedee.ui/src/org/eclipse/emf/cdo/threedee/ui/InfoTransformView.java
+++ b/org.eclipse.emf.cdo.threedee.ui/src/org/eclipse/emf/cdo/threedee/ui/ParametersView.java
@@ -12,6 +12,7 @@
import org.eclipse.emf.cdo.threedee.ui.ThreeDeeWorld.InfoPanel;
import org.eclipse.emf.cdo.threedee.ui.bundle.OM;
+import org.eclipse.emf.cdo.threedee.ui.nodes.RootElementGroup;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -36,11 +37,11 @@
/**
* @author Eike Stepper
*/
-public class InfoTransformView extends ViewPart
+public class ParametersView extends ViewPart
{
- public static final String ID = "org.eclipse.emf.cdo.threedee.ui.InfoTransformView";
+ public static final String ID = "org.eclipse.emf.cdo.threedee.ui.ParametersView";
- public InfoTransformView()
+ public ParametersView()
{
}
@@ -59,6 +60,7 @@
}
ThreeDeeView view = (ThreeDeeView)page.findView(ThreeDeeView.ID);
+ createRootRadius(composite, view);
createLightDirection(composite, view);
createInfoPanelTransform(composite, view);
}
@@ -68,6 +70,23 @@
}
}
+ private void createRootRadius(Composite composite, ThreeDeeView view)
+ {
+ final ThreeDeeWorld world = view.getWorld();
+ final RootElementGroup root = world.getRoot();
+
+ final Transformer transformer = new Transformer(composite, "Radius", 0f, 2f, root.getRadiusFactor());
+ transformer.addSelectionListener(new SelectionAdapter()
+ {
+ @Override
+ public void widgetSelected(SelectionEvent e)
+ {
+ root.setRadiusFactor(transformer.getValue());
+ world.layout();
+ }
+ });
+ }
+
private void createLightDirection(Composite composite, ThreeDeeView view)
{
final DirectionalLight directionalLight = view.getWorld().getDirectionalLight();
diff --git a/org.eclipse.emf.cdo.threedee.ui/src/org/eclipse/emf/cdo/threedee/ui/ThreeDeePerspective.java b/org.eclipse.emf.cdo.threedee.ui/src/org/eclipse/emf/cdo/threedee/ui/ThreeDeePerspective.java
index 20c60a9..2ed28f9 100644
--- a/org.eclipse.emf.cdo.threedee.ui/src/org/eclipse/emf/cdo/threedee/ui/ThreeDeePerspective.java
+++ b/org.eclipse.emf.cdo.threedee.ui/src/org/eclipse/emf/cdo/threedee/ui/ThreeDeePerspective.java
@@ -26,8 +26,10 @@
String editorArea = layout.getEditorArea();
layout.setEditorAreaVisible(false);
- layout.addView(ElementView.ID, IPageLayout.LEFT, 0.15f, editorArea);
+ layout.addView(ElementView.ID, IPageLayout.LEFT, 0.2f, editorArea);
layout.addView(DescriptorView.ID, IPageLayout.BOTTOM, 0.75f, ElementView.ID);
+ layout.addView(ParametersView.ID, IPageLayout.BOTTOM, 0.75f, DescriptorView.ID);
+
// layout.addView(ThreeDeeView.ID, IPageLayout.LEFT, 1.0f, editorArea);
layout.addStandaloneView(ThreeDeeView.ID, false, IPageLayout.LEFT, 1.0f, editorArea);
}
diff --git a/org.eclipse.emf.cdo.threedee.ui/src/org/eclipse/emf/cdo/threedee/ui/ThreeDeeWorld.java b/org.eclipse.emf.cdo.threedee.ui/src/org/eclipse/emf/cdo/threedee/ui/ThreeDeeWorld.java
index 7e7f859..7bad3b6 100644
--- a/org.eclipse.emf.cdo.threedee.ui/src/org/eclipse/emf/cdo/threedee/ui/ThreeDeeWorld.java
+++ b/org.eclipse.emf.cdo.threedee.ui/src/org/eclipse/emf/cdo/threedee/ui/ThreeDeeWorld.java
@@ -317,6 +317,11 @@
return infoPanel;
}
+ public RootElementGroup getRoot()
+ {
+ return root;
+ }
+
public void addElement(Element element)
{
if (!elementGroups.containsKey(element))
diff --git a/org.eclipse.emf.cdo.threedee.ui/src/org/eclipse/emf/cdo/threedee/ui/nodes/RootElementGroup.java b/org.eclipse.emf.cdo.threedee.ui/src/org/eclipse/emf/cdo/threedee/ui/nodes/RootElementGroup.java
index 584a620..4c0e7fd 100644
--- a/org.eclipse.emf.cdo.threedee.ui/src/org/eclipse/emf/cdo/threedee/ui/nodes/RootElementGroup.java
+++ b/org.eclipse.emf.cdo.threedee.ui/src/org/eclipse/emf/cdo/threedee/ui/nodes/RootElementGroup.java
@@ -30,11 +30,23 @@
private static final double TWO_PI = 2.0d * PI;
+ private double radiusFactor = 0.8d;
+
public RootElementGroup(ThreeDeeWorld world)
{
super(world, null, createAppearance());
}
+ public double getRadiusFactor()
+ {
+ return radiusFactor;
+ }
+
+ public void setRadiusFactor(double radiusFactor)
+ {
+ this.radiusFactor = radiusFactor;
+ }
+
@Override
protected void layout(ThreeDeeNode<Element>[] children, int n)
{
@@ -54,7 +66,7 @@
double distanceAngle = TWO_PI / n;
double phi = 0.0d;
- radius *= 0.8d;
+ radius *= radiusFactor;
for (int i = 0; i < n; i++)
{