]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
git-svn-id: https://www.simantics.org/svn/simantics/3d/branches/dev@8535 ac1ea38d...
authorluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 8 Jan 2009 14:57:15 +0000 (14:57 +0000)
committerluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 8 Jan 2009 14:57:15 +0000 (14:57 +0000)
org.simantics.proconf.g3d/schema/geometry.exsd
org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/base/ScenegraphAdapterImpl.java
org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/scenegraph/ModelNode.java

index f6af1286d722a07b13753508372382185b87bffb..2447088b58b03ddec8666931d7da25a7d4648d79 100644 (file)
@@ -1,16 +1,21 @@
 <?xml version='1.0' encoding='UTF-8'?>\r
 <!-- Schema file written by PDE -->\r
-<schema targetNamespace="org.simantics.proconf.g3d">\r
+<schema targetNamespace="org.simantics.proconf.g3d" xmlns="http://www.w3.org/2001/XMLSchema">\r
 <annotation>\r
-      <appInfo>\r
+      <appinfo>\r
          <meta.schema plugin="org.simantics.proconf.g3d" id="geometry" name="Geometry"/>\r
-      </appInfo>\r
+      </appinfo>\r
       <documentation>\r
          [Enter description of this extension point.]\r
       </documentation>\r
    </annotation>\r
 \r
    <element name="extension">\r
+      <annotation>\r
+         <appinfo>\r
+            <meta.element />\r
+         </appinfo>\r
+      </annotation>\r
       <complexType>\r
          <sequence>\r
             <element ref="Geometry" minOccurs="0" maxOccurs="unbounded"/>\r
@@ -34,9 +39,9 @@
                <documentation>\r
                   \r
                </documentation>\r
-               <appInfo>\r
+               <appinfo>\r
                   <meta.attribute translatable="true"/>\r
-               </appInfo>\r
+               </appinfo>\r
             </annotation>\r
          </attribute>\r
       </complexType>\r
                <documentation>\r
                   \r
                </documentation>\r
-               <appInfo>\r
-                  <meta.attribute kind="java" basedOn=":fi.vtt.simantics.g3d.base.GeometryProvider"/>\r
-               </appInfo>\r
+               <appinfo>\r
+                  <meta.attribute kind="java" basedOn=":org.simantics.proconf.g3d.base.GeometryProvider"/>\r
+               </appinfo>\r
             </annotation>\r
          </attribute>\r
       </complexType>\r
    </element>\r
 \r
    <annotation>\r
-      <appInfo>\r
+      <appinfo>\r
          <meta.section type="since"/>\r
-      </appInfo>\r
+      </appinfo>\r
       <documentation>\r
          [Enter the first release in which this extension point appears.]\r
       </documentation>\r
    </annotation>\r
 \r
    <annotation>\r
-      <appInfo>\r
+      <appinfo>\r
          <meta.section type="examples"/>\r
-      </appInfo>\r
+      </appinfo>\r
       <documentation>\r
          [Enter extension point usage example here.]\r
       </documentation>\r
    </annotation>\r
 \r
    <annotation>\r
-      <appInfo>\r
+      <appinfo>\r
          <meta.section type="apiInfo"/>\r
-      </appInfo>\r
+      </appinfo>\r
       <documentation>\r
          [Enter API information here.]\r
       </documentation>\r
    </annotation>\r
 \r
    <annotation>\r
-      <appInfo>\r
+      <appinfo>\r
          <meta.section type="implementation"/>\r
-      </appInfo>\r
+      </appinfo>\r
       <documentation>\r
          [Enter information about supplied implementation of this extension point.]\r
       </documentation>\r
    </annotation>\r
 \r
-   <annotation>\r
-      <appInfo>\r
-         <meta.section type="copyright"/>\r
-      </appInfo>\r
-      <documentation>\r
-         \r
-      </documentation>\r
-   </annotation>\r
 \r
 </schema>\r
index c7ba95dbc80bca818789d4abe98dbefd9922b8e6..d90b9dd0a3226b5db08eef62cc4f112ef89a9122 100644 (file)
@@ -317,7 +317,7 @@ public abstract class ScenegraphAdapterImpl implements ScenegraphAdapter {
      */\r
     protected IGraphicsNode addNode(IEntity parent, IEntity r) {\r
         if (!r.isInstanceOf(Resources.g3dResource.G3DNode)) {\r
-            ErrorLogger.defaultLogError("Trying to add node into scenegraph that is not instance of graphicsnode " + r,new Exception("ASSERT!"));\r
+            ErrorLogger.defaultLogError("Trying to add node into scenegraph that is not instance of G3DNode " + r,new Exception("ASSERT!"));\r
             return null;\r
         }\r
         if (parent.equals(r)) {\r
@@ -473,6 +473,7 @@ public abstract class ScenegraphAdapterImpl implements ScenegraphAdapter {
         protected Resource nodeResource;\r
         private boolean disposed = false;\r
         \r
+        private IQueryListener listener = null;\r
        \r
        public NodeQuery(Resource r) {\r
                this.nodeResource = r;\r
@@ -541,6 +542,25 @@ public abstract class ScenegraphAdapterImpl implements ScenegraphAdapter {
         public boolean isDisposed() {\r
             return disposed;\r
         }\r
+        \r
+        // without separate listener, this query would work only once\r
+        @Override\r
+        public IQueryListener getListener() {\r
+               if (listener == null) {\r
+                       listener = new IQueryListener() {\r
+                               @Override\r
+                               public boolean isDisposed() {\r
+                                       return NodeQuery.this.disposed;\r
+                               }\r
+                               \r
+                               @Override\r
+                               public void resultChangedRaw(Object oldResult, Object newResult) {\r
+                                       NodeQuery.this.resultChangedRaw(oldResult, newResult);\r
+                               }\r
+                       };\r
+               }\r
+               return listener;\r
+        }\r
     }\r
     \r
     /**\r
index 844393aa76ef8ca24ace66a72be700372378348d..ad0780d883c343be0a175db1ed793928f06ea1a9 100644 (file)
@@ -43,7 +43,7 @@ public class ModelNode extends AbstractGraphicsNode implements Animatable, IGeom
                G3DModel model = getG3DModel(graph);\r
             Collection<G3DNode> nodes = model.getChild();\r
             if (nodes.size() == 0) {\r
-                ErrorLogger.defaultLogError("ModelNode " + model.getResource() + " has no shapes", null);\r
+                ErrorLogger.defaultLogError("ModelNode " + model.getResource().getResourceId() + " has no shapes", null);\r
                 return;\r
             }\r
             for (G3DNode node: nodes) {\r