public class JunctionView extends AbstractPlantView
Junction
. A junction is rendered as
a box that contains the top ends of all input pipes and all bottom ends of
output pipes.Constructor and Description |
---|
JunctionView(java.lang.String name,
com.jme3.material.Material material)
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
com.jme3.math.Vector3f |
getCenter()
Gets the current center of the JunctionView.
|
boolean |
putPipes(java.util.List<java.lang.Integer> ids,
java.util.List<com.jme3.bounding.BoundingBox> boxes)
Adds or updates the view with BoundingBoxes defined by the outlets or
inlets of input or output pipes, respectively.
|
void |
refreshMesh()
Updates the box mesh based on the current min and max vectors in
boxMap . |
boolean |
removePipes(java.util.List<java.lang.Integer> ids)
Detaches all BoundingBoxes defined by the outlets or inlets of input or
output pipes, respectively.
|
boolean |
setSecondaryPipes(java.util.List<com.jme3.bounding.BoundingBox> boxes)
Sets the
BoundingBox es for the ends of the attached secondary
pipes. |
setBaseColor, setWireFrame
dispose, setLocation, setParentNode, setRotation
public JunctionView(java.lang.String name, com.jme3.material.Material material)
AbstractPlantView.geometry
.name
- The name of the view's root node.material
- The jME3 Material that should be used for the view's geometry.
Must not be null.public boolean removePipes(java.util.List<java.lang.Integer> ids)
ids
- The IDs of the pipes that have been detached from the
Junction.public boolean putPipes(java.util.List<java.lang.Integer> ids, java.util.List<com.jme3.bounding.BoundingBox> boxes)
ids
- A List of affected Pipe IDs.boxes
- The BoundingBoxes for the changing Pipes' outlets or inlets.public boolean setSecondaryPipes(java.util.List<com.jme3.bounding.BoundingBox> boxes)
BoundingBox
es for the ends of the attached secondary
pipes. These pipes should already be connected to the center of the
junction via getCenter()
.boxes
- A List of BoundingBoxes for secondary pipe inlets/outlets.public void refreshMesh()
boxMap
.public com.jme3.math.Vector3f getCenter()
Vector3f
with the coordinates of the junction's center.