public class PipeRun extends P3DParentNode<IP3DNode> {
private double pipeDiameter = 0.1;
- private double turnRadius = 0.2;
+ private double[] turnRadius = new double[] {0.2};
@Override
public void update(vtkRenderer ren) {
@RelatedGetValue(Plant3D.URIs.HasTurnRadius)
@GetPropertyValue(value=Plant3D.URIs.HasTurnRadius, name = "Elbow radius")
public double getTurnRadius() {
- return turnRadius;
+ return turnRadius[0];
}
@RelatedSetValue(Plant3D.URIs.HasTurnRadius)
@SetPropertyValue(Plant3D.URIs.HasTurnRadius)
public void setTurnRadius(double turnRadius) {
- this.turnRadius = turnRadius;
+ this.turnRadius[0] = turnRadius;
firePropertyChanged(Plant3D.URIs.HasTurnRadius);
- }
+ firePropertyChanged(Plant3D.URIs.HasTurnRadiusArray);
+ }
+
+ @RelatedGetValue(Plant3D.URIs.HasTurnRadiusArray)
+ @GetPropertyValue(value=Plant3D.URIs.HasTurnRadiusArray, name = "Elbow radius array")
+ public double[] getTurnRadiusArray() {
+ return turnRadius;
+ }
+
+ @RelatedSetValue(Plant3D.URIs.HasTurnRadiusArray)
+ @SetPropertyValue(Plant3D.URIs.HasTurnRadiusArray)
+ public void setTurnRadiusArray(double[] turnRadiusArray) {
+ if (turnRadiusArray == null || turnRadiusArray.length == 0)
+ return;
+ this.turnRadius = turnRadiusArray;
+ firePropertyChanged(Plant3D.URIs.HasTurnRadiusArray);
+ }
@RelatedGetValue(Plant3D.URIs.HasPipeDiameter)
@GetPropertyValue(value=Plant3D.URIs.HasPipeDiameter, name = "Diameter")
firePropertyChanged(Plant3D.URIs.HasPipeDiameter);
}
- @RelatedElementsAdd(Plant3D.URIs.childen)
+ @RelatedElementsAdd(Plant3D.URIs.children)
public void addChild(PipelineComponent node) {
- addNode(Plant3D.URIs.childen,node);
+ addNode(Plant3D.URIs.children,node);
}
- @RelatedElementsGet(Plant3D.URIs.childen)
+ @RelatedElementsGet(Plant3D.URIs.children)
public Collection<PipelineComponent> getChild() {
Collection<PipelineComponent> coll = new ArrayList<PipelineComponent>();
- for (IG3DNode n : getNodes(Plant3D.URIs.childen)) {
+ for (IG3DNode n : getNodes(Plant3D.URIs.children)) {
coll.add((PipelineComponent)n);
}
return coll;
}
- @RelatedElementsRem(Plant3D.URIs.childen)
+ @RelatedElementsRem(Plant3D.URIs.children)
public void remChild(PipelineComponent node) {
- removeNode(Plant3D.URIs.childen, node);
+ removeNode(Plant3D.URIs.children, node);
}
public List<PipelineComponent> getSortedChild() {
List<PipelineComponent> coll = new ArrayList<PipelineComponent>();
- for (IG3DNode n : getNodes(Plant3D.URIs.childen)) {
+ for (IG3DNode n : getNodes(Plant3D.URIs.children)) {
coll.add((PipelineComponent)n);
}
Collections.sort(coll, new ComponentComparator());
return coll;
}
+ private static String PIPECP = "pipecp";
+
public void addChild(PipeControlPoint node) {
- addNode("pipecp",node);
+ addNode(PIPECP,node);
}
public void remChild(PipeControlPoint node) {
- removeNode("pipecp", node);
+ removeNode(PIPECP, node);
}
public void deattachChild(PipeControlPoint node) {
- deattachNode("pipecp", node);
+ deattachNode(PIPECP, node);
}
public Collection<PipeControlPoint> getControlPoints() {
Collection<PipeControlPoint> coll = new ArrayList<PipeControlPoint>();
- for (IG3DNode n : getNodes("pipecp")) {
+ for (IG3DNode n : getNodes(PIPECP)) {
coll.add((PipeControlPoint)n);
}
return coll;
}
+
public boolean equalSpecs(PipeRun other) {
if (!MathTools.equals(pipeDiameter,other.pipeDiameter))
return false;
- if (!MathTools.equals(turnRadius,other.turnRadius))
- return false;
+ if (turnRadius.length != other.turnRadius.length)
+ return false;
+ for (int i = 0; i < turnRadius.length; i++) {
+ if (!MathTools.equals(turnRadius[i],other.turnRadius[i]))
+ return false;
+ }
return true;
}
}
}
+
}