package org.simantics.plant3d.scenegraph;
import java.util.Collections;
+import java.util.HashMap;
import java.util.Map;
+import java.util.Map.Entry;
import javax.vecmath.Quat4d;
import javax.vecmath.Tuple3d;
import javax.vecmath.Vector3d;
import org.simantics.g3d.math.MathTools;
+import org.simantics.g3d.property.annotations.CompoundGetPropertyValue;
+import org.simantics.g3d.property.annotations.CompoundSetPropertyValue;
import org.simantics.g3d.property.annotations.GetPropertyValue;
import org.simantics.g3d.property.annotations.PropertyContributor;
+import org.simantics.objmap.graph.annotations.CompoundRelatedGetValue;
+import org.simantics.objmap.graph.annotations.CompoundRelatedSetValue;
import org.simantics.objmap.graph.annotations.RelatedGetObj;
import org.simantics.objmap.graph.annotations.RelatedSetObj;
import org.simantics.plant3d.ontology.Plant3D;
*/
@PropertyContributor
public abstract class PipelineComponent extends GeometryNode {
+
+ private static boolean DEBUG = false;
private PipeRun pipeRun;
super.updateParameters();
}
+ @Override
+ @CompoundRelatedGetValue(objRelation=Plant3D.URIs.hasParameter,objType=Plant3D.URIs.Parameter,valRelation=Plant3D.URIs.hasParameterValue)
+ @CompoundGetPropertyValue(name="Parameters",tabId="Parameters",value="parameters")
+ public Map<String, Object> getParameterMap() {
+ return super.getParameterMap();
+ }
+
+ @Override
+ @CompoundRelatedSetValue(Plant3D.URIs.hasParameter)
+ public void setParameterMap(Map<String, Object> parameters) {
+ super.setParameterMap(parameters);
+ }
+
+ @CompoundGetPropertyValue(name="Parameters",tabId="Parameters",value="parameters")
+ public Map<String,Object> getParameterMapUI() {
+ // TODO : how to filter parameters that are calculated by geometry provider?
+ Map<String,Object> map = new HashMap<String, Object>(getParameterMap());
+ map.remove("radius");
+ return map;
+ }
+
+ @CompoundSetPropertyValue(value="parameters")
+ public void setParameterMapUI(Map<String, Object> parameters) {
+ Map<String, Object> curr = getParameterMap();
+ for (Entry<String, Object> entry : curr.entrySet()) {
+ if (!parameters.containsKey(entry.getKey()))
+ parameters.put(entry.getKey(), entry.getValue());
+ }
+ setParameterMap(parameters);
+ }
+
public abstract void setType(String typeURI) throws Exception;
@RelatedGetObj(Plant3D.URIs.HasNext)
this.next._removeRef(this);
this.next = comp;
this.syncnext = false;
+ if (DEBUG) System.out.println(this + " next " + comp);
syncNext();
firePropertyChanged(Plant3D.URIs.HasNext);
if (comp != null)
comp.sync();
-// System.out.println(this + " next " + comp);
+
}
this.previous._removeRef(this);
this.previous = comp;
this.syncprev = false;
+ if (DEBUG) System.out.println(this + " prev " + comp);
syncPrevious();
firePropertyChanged(Plant3D.URIs.HasPrevious);
if (comp != null)
comp.sync();
-// System.out.println(this + " prev " + comp);
+
}
private PipelineComponent branch0;
this.branch0._removeRef(this);
this.branch0 = comp;
this.syncbr0 = false;
+ if (DEBUG) System.out.println(this + " br0 " + comp);
syncBranch0();
firePropertyChanged(Plant3D.URIs.HasBranch0);
if (comp != null)
comp.sync();
-// System.out.println(this + " next " + comp);
}
@GetPropertyValue(name="Previous",tabId="Debug",value=Plant3D.URIs.HasPrevious)
if (next == comp) {
next = null;
syncnext = false;
+ firePropertyChanged(Plant3D.URIs.HasNext);
syncNext();
} else if (previous == comp) {
previous = null;
syncprev = false;
+ firePropertyChanged(Plant3D.URIs.HasPrevious);
syncPrevious();
} else if (branch0 == comp) {
branch0 = null;
syncbr0 = false;
+ firePropertyChanged(Plant3D.URIs.HasBranch0);
syncBranch0();
}
}
}
} else if (getControlPoint().getSubPoint().size() > 0) { // TODO : this may cause problems? (Removes branch point, before branch has been set?)
- getControlPoint().getSubPoint().get(0).remove();
- getControlPoint().children.clear();
+ //getControlPoint().getSubPoint().get(0).remove();
+ //getControlPoint().children.clear();
return true;
}
} else {
@Override
public void remove() {
+ if (DEBUG) System.out.println(this + " remove");
PipeControlPoint pcp = getControlPoint();
// Second check is needed, when remove process is initiated from control point.
if (pcp != null && pcp.getPipelineComponent() != null) {