public class GeometricalComponent extends PlantComponent
Intermediate class for all geometrical components (i.e. components that have position, direction, etc. in space; they generate a mesh)
iComponentVisitor
iComponentListener
Constructor and Description |
---|
GeometricalComponent()
Nullary constructor.
|
GeometricalComponent(double[] pos,
double[] orient,
double rot)
Parameterized constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(IPlantComponentVisitor visitor)
Accepts IPlantComponentVisitors to reveal the type of a PlantComponent.
|
java.lang.Object |
clone()
Performs a deep copy and returns a newly instantiated Object.
|
void |
copy(GeometricalComponent otherObject)
Deep copies the contents of otherObject.
|
boolean |
equals(java.lang.Object otherObject)
Performs an equality check between two Objects.
|
int |
getNumElements() |
double[] |
getOrientation() |
double[] |
getPosition() |
double |
getRotation() |
int |
hashCode()
Returns the hashCode of the object.
|
void |
setNumElements(int numElements) |
void |
setOrientation(double[] orientation) |
void |
setPosition(double[] position) |
void |
setRotation(double rotation) |
accept, copy, toString
copy, getDescription, getId, getName, register, setDescription, setId, setName, unregister, update
register, unregister, update
getDescription, getId, getName, setDescription, setId, setName
public GeometricalComponent()
Nullary constructor.
public GeometricalComponent(double[] pos, double[] orient, double rot)
Parameterized constructor.
pos
- Position (origin) of the component.
orient
- Orientation vector of the pipe.
rot
- Rotation of the component (in degrees).
public double[] getPosition()
public void setPosition(double[] position)
position
- the position to setpublic double[] getOrientation()
public void setOrientation(double[] orientation)
orientation
- the orientation to setpublic double getRotation()
public void setRotation(double rotation)
rotation
- the rotation to setpublic int getNumElements()
public void setNumElements(int numElements)
numElements
- the numElements to setpublic boolean equals(java.lang.Object otherObject)
Performs an equality check between two Objects.
equals
in interface Identifiable
equals
in class PlantComponent
otherObject
- The other Object to compare against.
Returns true if the two objects are equal, otherwise false.
Identifiable.equals(Object otherObject)
public java.lang.Object clone()
Performs a deep copy and returns a newly instantiated Object.
clone
in interface Identifiable
clone
in class PlantComponent
The newly instantiated Object.
public void copy(GeometricalComponent otherObject)
Deep copies the contents of otherObject.
otherObject
- The other object to copy the contents from.
public int hashCode()
Returns the hashCode of the object.
hashCode
in interface Identifiable
hashCode
in class PlantComponent
The hashCode of the Object.
Identifiable.hashCode()
public void accept(IPlantComponentVisitor visitor)
Accepts IPlantComponentVisitors to reveal the type of a PlantComponent.
accept
in class PlantComponent
visitor
- The PlantComponent's visitor.