X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Fscenegraph%2FPipelineComponent.java;h=fd085db11bb530f4007fbd1fabda812166a9c24b;hb=c44f3e6a480f19b26a586a271ac200f051c60cf2;hp=3f393364e3ccf456cc9ab63b53b8c01927ee6278;hpb=c107c8c7654c47da1cbc57336a524efe0f48d77a;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/PipelineComponent.java b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/PipelineComponent.java index 3f393364..fd085db1 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/PipelineComponent.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/PipelineComponent.java @@ -1,15 +1,21 @@ 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; @@ -83,6 +89,37 @@ public abstract class PipelineComponent extends GeometryNode { 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 getParameterMap() { + return super.getParameterMap(); + } + + @Override + @CompoundRelatedSetValue(Plant3D.URIs.hasParameter) + public void setParameterMap(Map parameters) { + super.setParameterMap(parameters); + } + + @CompoundGetPropertyValue(name="Parameters",tabId="Parameters",value="parameters") + public Map getParameterMapUI() { + // TODO : how to filter parameters that are calculated by geometry provider? + Map map = new HashMap(getParameterMap()); + map.remove("radius"); + return map; + } + + @CompoundSetPropertyValue(value="parameters") + public void setParameterMapUI(Map parameters) { + Map curr = getParameterMap(); + for (Entry 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)