X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Fscenegraph%2FPipelineComponent.java;h=c0feb668d183ff090dad98fa81ed844cce02ab0b;hb=b93886889422a3111b05a6944b3bcb2cdd8c416a;hp=90dba91d0282b748ec0c0c8be196a6651af102ea;hpb=43b9a071783377f64924bb0c2f1930fb49316f6f;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 90dba91d..c0feb668 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/PipelineComponent.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/PipelineComponent.java @@ -93,7 +93,6 @@ public abstract class PipelineComponent extends GeometryNode { @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(); } @@ -109,6 +108,8 @@ public abstract class PipelineComponent extends GeometryNode { // TODO : how to filter parameters that are calculated by geometry provider? Map map = new HashMap(getParameterMap()); map.remove("radius"); + map.remove("radius2"); + map.remove("offset"); return map; } @@ -265,16 +266,19 @@ public abstract class PipelineComponent extends GeometryNode { if (next == comp) { next = null; syncnext = false; + if (DEBUG) System.out.println(this + " remove next " + comp); firePropertyChanged(Plant3D.URIs.HasNext); syncNext(); } else if (previous == comp) { previous = null; syncprev = false; + if (DEBUG) System.out.println(this + " remove prev " + comp); firePropertyChanged(Plant3D.URIs.HasPrevious); syncPrevious(); } else if (branch0 == comp) { branch0 = null; syncbr0 = false; + if (DEBUG) System.out.println(this + " remove br0 " + comp); firePropertyChanged(Plant3D.URIs.HasBranch0); syncBranch0(); } @@ -463,12 +467,7 @@ public abstract class PipelineComponent extends GeometryNode { super.setOrientation(orientation); if (getControlPoint() != null) { getControlPoint()._setWorldOrientation(getWorldOrientation()); - try { - PipingRules.requestUpdate(getControlPoint()); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + PipingRules.requestUpdate(getControlPoint()); } } @@ -479,12 +478,7 @@ public abstract class PipelineComponent extends GeometryNode { super.setPosition(position); if (getControlPoint() != null) { getControlPoint()._setWorldPosition(getWorldPosition()); - try { - PipingRules.requestUpdate(getControlPoint()); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + PipingRules.requestUpdate(getControlPoint()); } } @@ -510,7 +504,7 @@ public abstract class PipelineComponent extends GeometryNode { case END: return null; case TURN: { - double r = getPipeRun().getTurnRadius(); + double r = ((TurnComponent)this).getTurnRadius(); double a = pcp.getTurnAngle(); return a*r; } @@ -519,6 +513,24 @@ public abstract class PipelineComponent extends GeometryNode { } } + /** + * Returns diameter of the pipe + * @return + */ + public Double getDiameter() { + return getPipeRun().getPipeDiameter(); + } + + /** + * Returns secondary diameter of the pipe for size change components + * @return + */ + public Double getDiameter2() { + if (getAlternativePipeRun() == null) + return null; + return getAlternativePipeRun().getPipeDiameter(); + } + public void getEnds(Tuple3d p1, Tuple3d p2) { getControlPoint().getControlPointEnds(p1, p2); } @@ -570,7 +582,7 @@ public abstract class PipelineComponent extends GeometryNode { case TURN: { Vector3d loc = pcp.getRealPosition(PositionType.PREVIOUS); - double r = getPipeRun().getTurnRadius(); + double r = ((TurnComponent)this).getTurnRadius(); double a = pcp.getTurnAngle(); double pipeRadius = pcp.getPipeRun().getPipeDiameter() / 2; @@ -627,7 +639,7 @@ public abstract class PipelineComponent extends GeometryNode { double r2 = getAlternativePipeRun().getPipeDiameter() / 2; return pcp.getLength() * Math.PI * (r1*r1 + r1*r2 + r2*r2) / 4; case TURN: { - double r = getPipeRun().getTurnRadius(); + double r = ((TurnComponent)this).getTurnRadius(); double a = pcp.getTurnAngle(); return r * a * Math.PI * pipeRadius * pipeRadius; }