public abstract class MovableSpatialEntity extends SpatialEntity implements MovableSpatialObject
Constructor and Description |
---|
MovableSpatialEntity(Model owner,
java.lang.String name,
java.lang.String type,
boolean showInTrace)
Constructs a MovableSpatialEntity without specify the spatial data.
|
MovableSpatialEntity(Model owner,
java.lang.String name,
java.lang.String type,
boolean showInTrace,
double acc,
double dec,
double mSpeed,
Length startPositionX,
Length startPositionY,
Length startPositionZ)
Constructs a MovableSpatialEntity with specific acceleration and negative acceleration, maximum speed and position data.
|
MovableSpatialEntity(Model owner,
java.lang.String name,
java.lang.String type,
boolean showInTrace,
double acc,
double dec,
double mSpeed,
Length startPositionX,
Length startPositionY,
Length startPositionZ,
SpatialMovementManager manager)
Constructs a MovableSpatialEntity with specific acceleration and negative acceleration, maximum speed, position data and SpatialMovementManager for movement customizing.
|
Modifier and Type | Method and Description |
---|---|
void |
attach(MovableSpatialObject host)
Snaps to another MovableSpatialObject.
|
void |
cancelMovement()
Cancel the movement if there is a movement performing.
|
void |
cancelRotation()
Cancel the rotation if there is a rotation performing.
|
void |
detach()
Releases from the host object if this object is attached to it.
|
double |
getAcc()
Gets the acceleration of the object.
|
SpatialObject |
getCurrentLocation()
Returns the SpatialObject where this MovableSpatialObject is currently located.
|
Movement |
getCurrentMovement()
Gets the current Movement object.
|
Rotation |
getCurrentRotation()
Gets the current Rotation object.
|
double |
getCurrentSpeed()
Gets the current moving speed of the object.
|
double |
getDec()
Gets the negative acceleration of the object.
|
Matrix4d |
getMatrix()
Gets a 4x4 double matrix object which contains the spatial data of the SpatialObejct.
|
double |
getMaxSpeed()
Gets the maximum speed of the object.
|
Length |
getPosX() |
Length |
getPosY() |
Length |
getPosZ() |
boolean |
isAttached()
IShows whether the MovableSpatialObject is attached.
|
boolean |
isFocusedOnTrack()
Returns whether the FocusOnTrack function is on.
|
boolean |
isMoving()
Shows whether the MovableSpatialObject is moving.
|
boolean |
isRotating()
Shows whether the MovableSpatialObject is rotating.
|
void |
move(Movement movement,
boolean focusOnTrack)
Move the object to the destination according to the given movement object.
|
void |
move(SpatialObject destination,
java.lang.String entryPointName,
boolean focusOnTrack)
Move the object to the position of another SpatialObject without a specified duration.
|
void |
move(SpatialObject destination,
java.lang.String entryPointName,
TimeSpan duration,
boolean focusOnTrack)
Move the object to the position of another SpatialObject with a specified duration.
|
void |
move(SpatialObject destination,
java.lang.String entryPointName,
TimeSpan duration,
double maxSpeed,
double acc,
double dec,
boolean focusOnTrack)
Move the object to the position of another SpatialObject with specific attributes.
|
void |
notifyMovingDone()
Notifies the MovableSpatialObject that the moving is finished and updates the new coordinates.
|
void |
notifyRotatingDone()
Notifies the MovableSpatialObject that the rotating is finished and updates the new coordinates.
|
void |
resetRotation()
Resets the rotation of the object.
|
void |
rotX(double angle)
Adds a rotation about the x-axis to the current orientation.
|
void |
rotX(double angle,
TimeSpan duration)
Rotates the object about the x-axis using an animation.
|
void |
rotY(double angle)
Adds a rotation about the y-axis to the current orientation.
|
void |
rotY(double angle,
TimeSpan duration)
Rotates the object about the y-axis using an animation.
|
void |
rotZ(double angle)
Adds a rotation about the z-axis to the current orientation.
|
void |
rotZ(double angle,
TimeSpan duration)
Rotates the object about the z-axis using an animation.
|
void |
sendToLocation(SpatialObject destination)
Set this object to the position of the destination object and
change the currentLocation to the destination object.
|
void |
sendToLocationEntryPoint(SpatialObject destination,
java.lang.String entryPoint)
Set this object to the position of the given entry point of
the destination object.
|
void |
sendToLocationExitPoint(SpatialObject destination,
java.lang.String exitPoint)
Set this object to the position of the given exit point of
the destination object.
|
void |
setAcc(double acc)
Sets the acceleration of the object.
|
void |
setDec(double dec)
Sets the negative acceleration of the object.
|
void |
setMaxSpeed(double mSpeed)
Sets the maximum speed of this object
|
void |
setPosition(Length x,
Length y,
Length z)
It sets the new position for the object
|
addEntryPoint, addExitPoint, getEntryPoint, getEntryPointGlobal, getEntryPointNames, getExitPoint, getExitPointGlobal, getExitPointNames, getVisualModel, isMovable, isVisible, removeVisible, setVisible
getIdentNumber, getQueueingPriority, getQueues, getScheduledEvents, isEqual, isLarger, isLargerOrEqual, isNotEqual, isQueued, isSimProcess, isSmaller, isSmallerOrEqual, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, scheduleAfter, scheduleAfter, scheduleAfter, scheduleBefore, scheduleBefore, scheduleBefore, schedulePreempt, schedulePreempt, schedulePreempt, setQueueingPriority
assignReporter, cancel, getCorrespondingReportable, isCurrent, isScheduled, rename, reSchedule, reSchedule, reSchedulePreempt, scheduledNext, setCorrespondingReportable
current, currentEntity, currentEntityAll, currentEvent, currentModel, currentSimProcess, debugIsOn, debugOff, debugOn, getModel, isExperimentCompatible, isModelCompatible, presentTime, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn
getName, getQuotedName, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
addEntryPoint, addExitPoint, getEntryPoint, getEntryPointGlobal, getEntryPointNames, getExitPoint, getExitPointGlobal, getExitPointNames, getName, isMovable
public MovableSpatialEntity(Model owner, java.lang.String name, java.lang.String type, boolean showInTrace)
owner
- The model this entity is associated to.name
- The name of the entity.type
- The type attribute belongs to the SpatialObject interface.showInTrace
- Flag for showing entity in trace-files. Set it to true if entity should show up in trace. Set to false in entity should not be shown in trace.public MovableSpatialEntity(Model owner, java.lang.String name, java.lang.String type, boolean showInTrace, double acc, double dec, double mSpeed, Length startPositionX, Length startPositionY, Length startPositionZ)
owner
- The model this entity is associated to.name
- The name of the entity.type
- The type attribute belongs to the SpatialObject interface.showInTrace
- showInTrace Flag for showing entity in trace-files. Set it to true if entity should show up in trace. Set to false in entity should not be shown in trace..acc
- The acceleration of this MovableSpatialObject.dec
- The breaking acceleration of this MovableSpatialObject (normally a negative value).mSpeed
- The maximum speed of this MobavleSpatialObject.public MovableSpatialEntity(Model owner, java.lang.String name, java.lang.String type, boolean showInTrace, double acc, double dec, double mSpeed, Length startPositionX, Length startPositionY, Length startPositionZ, SpatialMovementManager manager)
owner
- The model this entity is associated to.name
- The name of the entity.type
- The type attribute belongs to the SpatialObject interface.showInTrace
- showInTrace Flag for showing entity in trace-files. Set it to true if entity should show up in trace. Set to false in entity should not be shown in trace.acc
- The acceleration of this MovableSpatialObject.dec
- The breaking acceleration of this MovableSpatialObject (normally a negative value)mSpeed
- The maximum speed of this MovableSpatialObject.startPositionX
- The x start position in ExtendedLength.startPositionY
- The y start position in ExtendedLength.startPositionZ
- The z start position in ExtendedLength.manager
- a specific SpatialMovementManager which the user could have customized.public void attach(MovableSpatialObject host)
MovableSpatialObject
attach
in interface MovableSpatialObject
host
- The MovableSpatialObject who to attach to.public void cancelMovement()
MovableSpatialObject
cancelMovement
in interface MovableSpatialObject
public void cancelRotation()
MovableSpatialObject
cancelRotation
in interface MovableSpatialObject
public void detach()
MovableSpatialObject
detach
in interface MovableSpatialObject
public double getAcc()
MovableSpatialObject
getAcc
in interface MovableSpatialObject
public SpatialObject getCurrentLocation()
MovableSpatialObject
getCurrentLocation
in interface MovableSpatialObject
public Movement getCurrentMovement()
MovableSpatialObject
getCurrentMovement
in interface MovableSpatialObject
public Rotation getCurrentRotation()
MovableSpatialObject
getCurrentRotation
in interface MovableSpatialObject
public double getCurrentSpeed()
MovableSpatialObject
getCurrentSpeed
in interface MovableSpatialObject
public double getDec()
MovableSpatialObject
getDec
in interface MovableSpatialObject
public Matrix4d getMatrix()
SpatialObject
getMatrix
in interface SpatialObject
getMatrix
in class SpatialEntity
public double getMaxSpeed()
MovableSpatialObject
getMaxSpeed
in interface MovableSpatialObject
public Length getPosX()
getPosX
in interface SpatialObject
getPosX
in class SpatialEntity
public Length getPosY()
getPosY
in interface SpatialObject
getPosY
in class SpatialEntity
public Length getPosZ()
getPosZ
in interface SpatialObject
getPosZ
in class SpatialEntity
public boolean isAttached()
MovableSpatialObject
isAttached
in interface MovableSpatialObject
public boolean isFocusedOnTrack()
MovableSpatialObject
isFocusedOnTrack
in interface MovableSpatialObject
public boolean isMoving()
MovableSpatialObject
isMoving
in interface MovableSpatialObject
public boolean isRotating()
MovableSpatialObject
isRotating
in interface MovableSpatialObject
public void move(SpatialObject destination, java.lang.String entryPointName, boolean focusOnTrack)
MovableSpatialObject
move
in interface MovableSpatialObject
destination
- The destination object we want to move to.focusOnTrack
- Whether the orientation of the moving object should focus to the moving direction.public void move(SpatialObject destination, java.lang.String entryPointName, TimeSpan duration, boolean focusOnTrack)
MovableSpatialObject
move
in interface MovableSpatialObject
destination
- The destination object we want to move to.duration
- The duration of the movement in TimeSpan.focusOnTrack
- Whether the orientation of the moving object should focus to the moving direction.public void move(SpatialObject destination, java.lang.String entryPointName, TimeSpan duration, double maxSpeed, double acc, double dec, boolean focusOnTrack)
MovableSpatialObject
move
in interface MovableSpatialObject
destination
- The destination object we want to move to.duration
- The duration of the movement in TimeSpan(optional).maxSpeed
- The maximum speed of the movement(optional).acc
- The acceleration of the movement(optional).dec
- The deceleration of the movement(optional).focusOnTrack
- Whether the orientation of the moving object should focus to the moving direction.public void move(Movement movement, boolean focusOnTrack)
MovableSpatialObject
move
in interface MovableSpatialObject
movement
- The movement which should be performed.focusOnTrack
- Whether the orientation of the moving object should focus to the moving direction.public void notifyMovingDone()
MovableSpatialObject
notifyMovingDone
in interface MovableSpatialObject
public void notifyRotatingDone()
MovableSpatialObject
notifyRotatingDone
in interface MovableSpatialObject
public void resetRotation()
SpatialObject
resetRotation
in interface SpatialObject
resetRotation
in class SpatialEntity
public void rotX(double angle, TimeSpan duration)
MovableSpatialObject
rotX
in interface MovableSpatialObject
angle
- The start angleduration
- The duration of the animationpublic void rotY(double angle, TimeSpan duration)
MovableSpatialObject
rotY
in interface MovableSpatialObject
angle
- The start angleduration
- The duration of the animationpublic void rotZ(double angle, TimeSpan duration)
MovableSpatialObject
rotZ
in interface MovableSpatialObject
angle
- The start angleduration
- The duration of the animationpublic void rotX(double angle)
SpatialObject
rotX
in interface SpatialObject
rotX
in class SpatialEntity
angle
- The rotation angle in radianspublic void rotY(double angle)
SpatialObject
rotY
in interface SpatialObject
rotY
in class SpatialEntity
angle
- The rotation angle in radianspublic void rotZ(double angle)
SpatialObject
rotZ
in interface SpatialObject
rotZ
in class SpatialEntity
angle
- The rotation angle in radianspublic void sendToLocation(SpatialObject destination)
MovableSpatialObject
sendToLocation
in interface MovableSpatialObject
destination
- The destination this object will be send to.public void sendToLocationEntryPoint(SpatialObject destination, java.lang.String entryPoint)
MovableSpatialObject
sendToLocationEntryPoint
in interface MovableSpatialObject
destination
- The destination object the currentLocation should be set to.entryPoint
- The specific entry point of the destination object.public void sendToLocationExitPoint(SpatialObject destination, java.lang.String exitPoint)
MovableSpatialObject
sendToLocationExitPoint
in interface MovableSpatialObject
destination
- The destination object the currentLocation should be set to.exitPoint
- The specific exit point of the destination object
this object will be send to.public void setAcc(double acc)
MovableSpatialObject
setAcc
in interface MovableSpatialObject
acc
- The accelerationpublic void setDec(double dec)
MovableSpatialObject
setDec
in interface MovableSpatialObject
dec
- The negative accelerationpublic void setMaxSpeed(double mSpeed)
MovableSpatialObject
setMaxSpeed
in interface MovableSpatialObject
mSpeed
- The maximum speed of the objectpublic void setPosition(Length x, Length y, Length z)
SpatialObject
setPosition
in interface SpatialObject
setPosition
in class SpatialEntity
x
- The ExtendedLength which contains the new x-position.y
- The ExtendedLength which contains the new y-position.z
- The ExtendedLength which contains the new z-position.