Package com.anylogic.engine.markup
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.markup.AbstractFluidMarkup
- Methods inherited from class com.anylogic.engine.markup.AbstractLevelMarkup
- Methods inherited from class com.anylogic.engine.markup.MarkupShape
- Methods inherited from class com.anylogic.engine.markup.AbstractMarkup
- Methods inherited from class java.lang.Object
- Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement
- Constructor Details
- Method Details
- addSegment
- getSegmentCount
- getSegment
- iterator
- getStartPoint
- getStartPoint
- getEndPoint
- getEndPoint
- getStartPosition
- getStartPosition
- getEndPosition
- getEndPosition
- length
- length
- getPointAtOffset
- getPointAtOffset
- getPositionAtOffset
- getPositionAtOffset
- getDiameter
- setDiameter
- contains
- contains
- containsSq
- startDrawing
- updateDynamicProperties
- All Implemented Interfaces:
AggregatableAnimationElement
,HasLevel
,LevelElement
,LevelMarkup
,SVGElement
,Serializable
public class Pipe extends AbstractFluidMarkup<PipeDataSource>
- See Also:
- Serialized Form
Constructor | Description |
---|---|
Pipe() | |
Pipe |
Deprecated.
deprecated in version 8.4, will be removed in the future releases
|
Modifier and Type | Method | Description |
---|---|---|
void | addSegment |
Adds a segment to this element
|
boolean | contains |
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e.
|
boolean | contains |
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e.
|
boolean | containsSq |
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e.
|
double | getDiameter() |
Returns the diameter of the pipe
|
Point | getEndPoint() |
Returns the Point object with coordinates of the pipe's ending point.
|
Point | getEndPoint |
Returns the Point object with coordinates of the pipe's ending point.
|
Position | getEndPosition() |
Returns the end position
|
Position | getEndPosition | |
final Point | getPointAtOffset |
Returns the point located on the markup element with the given
offset
distance calculated from start point.This method may be slightly faster in some cases but returns no orientation information (rotations). |
final Point | getPointAtOffset |
Returns the point located on the markup element with the given
offset
distance calculated from start point.This method may be slightly faster in some cases but returns no orientation information (rotations). |
final Position | getPositionAtOffset |
Returns the Position object with coordinates and orientation of the point that
is located at the given offset distance (in pixels) from the pipe's starting point.
|
final Position | getPositionAtOffset |
Returns the Position object with coordinates and orientation of the point that
is located at the given offset distance (in pixels) from the pipe's starting point.
|
MarkupSegment | getSegment |
Returns the segment by the provided index
|
int | getSegmentCount() |
Returns the number of the pipe's segments.
|
Point | getStartPoint() |
Returns the Point object with coordinates of the pipe's starting point.
|
Point | getStartPoint |
Returns the Point object with coordinates of the pipe's starting point.
|
Position | getStartPosition() |
Returns the start position
|
Position | getStartPosition |
Returns the Position object with coordinates and orientation of the pipe's starting point.
|
Iterator<MarkupSegment> | iterator() |
Creates and returns read-only iterator over segments
|
final double | length() |
Returns the length of the markup element, calculated in 3D space.
|
final double | length |
Returns the length of the markup element, calculated in 3D space.
|
void | setDiameter |
Sets the diameter of the pipe
|
void | startDrawing |
Starts drawing (available for markup elements created with no-argument constructor)
|
void | updateDynamicProperties() |
Updates dynamic properties of this shape only (without structural contents, if any) in a given context.
Method should be overridden for shapes with dynamic properties. |
error, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner
discardOwner, executeUserAction, findSVGElement, getName, getSVGId, initializeInternal, isVisible, onAggregatorInitialized, onAggregatorVisibilityChanged, removeSVGFromOwner, resetSVGState, setVisible, updateDynamicPropertiesStructural, updateSVGProperties
public Pipe()
@Deprecated public Pipe(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double diameter, Paint color, MarkupSegment... segments)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
- Parameters:
owner
-drawMode
-isPublic
-diameter
-color
-segments
-
public void addSegment(MarkupSegmentLine segment)
Adds a segment to this element
- Parameters:
segment
- segment to be added, should be initialized.
public int getSegmentCount()
Returns the number of the pipe's segments.
public MarkupSegment getSegment(int index)
Returns the segment by the provided index
- Parameters:
index
- the segment index, starting from zero up until the number of segments -1.
public Iterator<MarkupSegment> iterator()
Creates and returns read-only iterator over segments
public Point getStartPoint(Point out)
Returns the Point object with coordinates of the pipe's starting point.
- Parameters:
out
- output object to write to, may be null.
public Point getStartPoint()
Returns the Point object with coordinates of the pipe's starting point.
public Point getEndPoint(Point out)
Returns the Point object with coordinates of the pipe's ending point.
- Parameters:
out
- output object to write to, may be null.
public Point getEndPoint()
Returns the Point object with coordinates of the pipe's ending point.
public Position getStartPosition(Position out)
Returns the Position object with coordinates and orientation of the pipe's starting point.
- Parameters:
out
- output object to write to, may be null.
public Position getStartPosition()
Returns the start position
- Returns:
- the Position object with coordinates of the first position
public Position getEndPosition(Position out)
public Position getEndPosition()
Returns the end position
- Returns:
- the Position object with coordinates of the last position
public final double length()
Returns the length of the markup element, calculated in 3D space.
- Returns:
- the length of the markup element (measured in pixels), a positive number
public final double length(LengthUnits units)
Returns the length of the markup element, calculated in 3D space.
- Parameters:
units
- the units of length- Returns:
- the length of the markup element, a positive number
- Since:
- 7.1
public final Point getPointAtOffset(double offset, Point out)
Returns the point located on the markup element with the given
This method may be slightly faster in some cases but returns no orientation information (rotations).
offset
distance calculated from start point.This method may be slightly faster in some cases but returns no orientation information (rotations).
- Parameters:
offset
- offset, non-negative value, should be less or equal to the full length.out
- output object to write to, may benull
- Returns:
- the Point object with coordinates of the point with the given offset
- See Also:
public final Point getPointAtOffset(double offset, LengthUnits units, Point out)
Returns the point located on the markup element with the given
This method may be slightly faster in some cases but returns no orientation information (rotations).
offset
distance calculated from start point.This method may be slightly faster in some cases but returns no orientation information (rotations).
- Parameters:
offset
- offset, non-negative value, should be less or equal to the full length.units
- the length unitsout
- output object to write to, may benull
- Returns:
- the Point object with coordinates of the point with the given offset
- See Also:
public final Position getPositionAtOffset(double offset, Position out)
Returns the Position object with coordinates and orientation of the point that
is located at the given offset distance (in pixels) from the pipe's starting point.
- Parameters:
offset
- offset, non-negative value, should be less or equal to the full length.out
- output object to write to, may be null.
public final Position getPositionAtOffset(double offset, LengthUnits units, Position out)
Returns the Position object with coordinates and orientation of the point that
is located at the given offset distance (in pixels) from the pipe's starting point.
- Parameters:
offset
- offset, non-negative value, should be less or equal to the full length.units
- length units of the offset valueout
- output object to write to, may be null.
public double getDiameter()
Returns the diameter of the pipe
- Returns:
- the diameter of the pipe
public void setDiameter(double diameter)
Sets the diameter of the pipe
- Parameters:
diameter
- the new diameter
public boolean contains(double px, double py)
Description copied from class:
MarkupShape
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e. in the same system with the coordinates
of this shape, x and y)
- Specified by:
contains
in classMarkupShape
- Parameters:
px
- the x coordinate relative to this shape's containerpy
- the y coordinate relative to this shape's container- Returns:
true
if the shape contains the point with the given coordinates
public boolean contains(double px, double py, double distance)
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e. in the same system with the coordinates
of this shape, x and y), using
the given tolerance
- Parameters:
px
- the x coordinate relative to this shape's containerpy
- the y coordinate relative to this shape's containerdistance
- the distance tolerance to determine whether the given point lies on the markup element line or not- Returns:
true
if the shape contains the point with the given coordinates
public boolean containsSq(double px, double py, double squareDistance)
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e. in the same system with the coordinates
of this shape, x and y), using
the given tolerance
- Parameters:
px
- the x coordinate relative to this shape's containerpy
- the y coordinate relative to this shape's containersquareDistance
- the square of distance tolerance to determine whether the given point lies on the markup element line or not- Returns:
true
if the shape contains the point with the given coordinates
public void startDrawing(double x, double y, double z)
Starts drawing (available for markup elements created with no-argument constructor)
- Parameters:
x
- the x coordinate of the first pointy
- the y coordinate of the first pointz
- the z coordinate of the first point
@AnyLogicInternalCodegenAPI public void updateDynamicProperties()
Description copied from class:
AbstractMarkup
Updates dynamic properties of this shape only (without structural contents, if any) in a given context.
Method should be overridden for shapes with dynamic properties. Note that you should call super.updateDynamicProperties() at the end of overridden method
Method should be overridden for shapes with dynamic properties. Note that you should call super.updateDynamicProperties() at the end of overridden method
- Overrides:
updateDynamicProperties
in classAbstractMarkup