]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/P3DRootNode.java
Add units to ComponentSelectionDialog
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / scenegraph / P3DRootNode.java
index 5b7fe274c0b509dcba87151505d3794054a60e15..7a5ce551a7c317c16df776455125398213378934 100644 (file)
@@ -27,7 +27,9 @@ import vtk.vtkProp;
 @GraphType(Plant3D.URIs.Plant)
 public class P3DRootNode extends ParentNode<INode> implements IG3DNode, NodeMapProvider<Resource, vtkProp, INode> {
        
-       
+       // Vertical direction that determines the interpretation of rotation angle origin
+       protected Vector3d upVector = new Vector3d(0.0, 1.0, 0.0);
+
        @RelatedElementsAdd(Plant3D.URIs.children)
        public void addChild(INode node) {
        //public void addChild(IP3DVisualNode node) {
@@ -157,11 +159,10 @@ public class P3DRootNode extends ParentNode<INode> implements IG3DNode, NodeMapP
        }
 
        
-       @SuppressWarnings("rawtypes")
        @Override
-       public Object getAdapter(Class adapter) {
-               if (NodeMap.class == adapter)
-                       return nodeMap;
+       public <T> T getAdapter(Class<T> adapter) {
+               if (adapter.isAssignableFrom(NodeMap.class))
+                       return adapter.cast(nodeMap);
                return null;
        }
        
@@ -184,4 +185,8 @@ public class P3DRootNode extends ParentNode<INode> implements IG3DNode, NodeMapP
        public TurnComponent createTurn() {
                return new TurnComponent();
        }
+
+       public Vector3d getUpVector() {
+               return upVector;
+       }
 }