public class Polygon extends AbstractShape implements IUpdateableListener, IMeshPart
This class represents a polygon composed of a certain number of vertices connected by edges.
component
iComponentVisitor
iComponentListener
Constructor and Description |
---|
Polygon()
A nullary constructor.
|
Polygon(java.util.ArrayList<Edge> edges,
java.util.ArrayList<Vertex> vertices)
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
acceptMeshVisitor(IMeshPartVisitor visitor)
This method calls the
IMeshPartVisitor 's visit method. |
void |
acceptShapeVisitor(IShapeVisitor visitor)
(non-Javadoc)
|
java.lang.Object |
clone()
This operation returns a clone of the Polygon using a deep copy.
|
void |
copy(Polygon polygon)
This operation copies the contents of a Polygon into the current object
using a deep copy.
|
boolean |
equals(java.lang.Object otherObject)
This operation is used to check equality between this Polygon and another
Polygon.
|
java.util.ArrayList<Edge> |
getEdges()
Gets the collection of edges composing the polygon.
|
BoundaryCondition |
getFluidBoundaryCondition(int edgeId)
Gets the fluid boundary condition for an edge of the polygon.
|
BoundaryCondition |
getOtherBoundaryCondition(int edgeId,
int otherId)
Gets a passive scalar boundary condition for an edge of the polygon.
|
PolygonProperties |
getPolygonProperties()
Returns the properties for the current polygon.
|
BoundaryCondition |
getThermalBoundaryCondition(int edgeId)
Gets the thermal boundary condition for an edge of the polygon.
|
java.util.ArrayList<Vertex> |
getVertices()
Gets the collection of vertices composing the polygon.
|
int |
hashCode()
This operation returns the hash value of the Polygon.
|
void |
setFluidBoundaryCondition(int edgeId,
BoundaryCondition condition)
Sets a fluid boundary condition for an edge of the polygon.
|
void |
setOtherBoundaryCondition(int edgeId,
int otherId,
BoundaryCondition condition)
Sets a passive scalar boundary condition for an edge of the polygon.
|
void |
setPolygonProperties(java.lang.String materialId,
int group)
Sets the properties for the current polygon.
|
void |
setThermalBoundaryCondition(int edgeId,
BoundaryCondition condition)
Sets a thermal boundary condition for an edge of the polygon.
|
void |
update(IUpdateable component)
Implements the update operation.
|
accept, copy, getParent, getProperty, getTransformation, removeProperty, setProperty, setTransformation
copy, getDescription, getId, getName, register, setDescription, setId, setName, unregister, update
getClass, notify, notifyAll, toString, wait, wait, wait
register, unregister, update
getDescription, getId, getName, setDescription, setId, setName
public Polygon()
A nullary constructor. This creates a Polygon with no vertices or edges and initializes any fields necessary. Required for persistence.
public java.util.ArrayList<Edge> getEdges()
Gets the collection of edges composing the polygon.
The collection of Edges composing the 2D polygon.
public java.util.ArrayList<Vertex> getVertices()
Gets the collection of vertices composing the polygon.
The collection of Vertices composing the 2D polygon.
public void setFluidBoundaryCondition(int edgeId, BoundaryCondition condition)
Sets a fluid boundary condition for an edge of the polygon.
edgeId
- The ID of the edge that will have the new BoundaryCondition.condition
- The new BoundaryCondition.public BoundaryCondition getFluidBoundaryCondition(int edgeId)
Gets the fluid boundary condition for an edge of the polygon.
edgeId
- The ID of the edge that has a BoundaryCondition.public void setThermalBoundaryCondition(int edgeId, BoundaryCondition condition)
Sets a thermal boundary condition for an edge of the polygon.
edgeId
- The ID of the edge that will have the new BoundaryCondition.condition
- The new BoundaryCondition.public BoundaryCondition getThermalBoundaryCondition(int edgeId)
Gets the thermal boundary condition for an edge of the polygon.
edgeId
- The ID of the edge that has a BoundaryCondition.public void setOtherBoundaryCondition(int edgeId, int otherId, BoundaryCondition condition)
Sets a passive scalar boundary condition for an edge of the polygon.
edgeId
- The ID of the edge that will have the new BoundaryCondition.otherId
- The ID or index of the set of passive scalar boundary
conditions.condition
- The new BoundaryCondition.public BoundaryCondition getOtherBoundaryCondition(int edgeId, int otherId)
Gets a passive scalar boundary condition for an edge of the polygon.
edgeId
- The ID of the edge that has a BoundaryCondition.otherId
- The ID or index of the set of passive scalar boundary
conditions.public void setPolygonProperties(java.lang.String materialId, int group)
Sets the properties for the current polygon.
materialId
- The material ID of the current polygon.group
- The group number of the current polygon.public PolygonProperties getPolygonProperties()
Returns the properties for the current polygon.
public int hashCode()
This operation returns the hash value of the Polygon.
hashCode
in interface Identifiable
hashCode
in class AbstractShape
The hash of the Object.
Identifiable.hashCode()
public boolean equals(java.lang.Object otherObject)
This operation is used to check equality between this Polygon and another Polygon. It returns true if the Polygons are equal and false if they are not.
equals
in interface Identifiable
equals
in class AbstractShape
otherObject
- The other Object that should be compared with this one.
True if the Objects are equal, false otherwise.
Identifiable.equals(Object otherObject)
public void copy(Polygon polygon)
This operation copies the contents of a Polygon into the current object using a deep copy.
polygon
- The Object from which the values should be copied.
public java.lang.Object clone()
This operation returns a clone of the Polygon using a deep copy.
clone
in interface Identifiable
clone
in class ICEObject
The new clone.
public void acceptShapeVisitor(IShapeVisitor visitor)
acceptShapeVisitor
in interface IShape
visitor
- The IShapeVisitor to call back in order to reveal the type of this IShape
IShape.acceptShapeVisitor(IShapeVisitor visitor)
public void update(IUpdateable component)
Implements the update operation. Currently, the Polygon registers with its current set of BoundaryConditions.
update
in interface IUpdateableListener
component
- The updated component. This should always be a BoundaryCondition.
public void acceptMeshVisitor(IMeshPartVisitor visitor)
This method calls the IMeshPartVisitor
's visit method.
acceptMeshVisitor
in interface IMeshPart
visitor
-
The IMeshPartVisitor
that is visiting this
IMeshPart
.