Package com.anylogic.engine.markup
- java.lang.Object
- com.anylogic.engine.markup.AbstractCurve<T>
- All Implemented Interfaces:
IPathData
,Serializable
,Iterable<T>
- Direct Known Subclasses:
AbstractNetworkCurve
,Curve
@AnyLogicInternalAPI public abstract class AbstractCurve<T extends AbstractMarkupSegment> extends Object implements IPathData, Iterable<T>
- See Also:
- Serialized Form
Constructor | Description |
---|---|
AbstractCurve() |
Modifier and Type | Method | Description |
---|---|---|
void | addSegment |
Adss a segment to this curve when creating the curve from code.
|
Point | getEndPoint |
Returns the location of the end point
|
double | getOffset3D |
Returns offset on the curve, which correlates to provided offset2D on XY
projection
|
final Position | getPositionAt2DOffset |
Returns the point (+rotations) located on the markup element at the XY projection with the given
offset
distance calculated from start point. |
final Position | getPositionAtOffset |
Returns the point (+rotations) located on the markup element with the given
offset
distance calculated from start point. |
T | getSegment |
Returns the segment by its index
|
int | getSegmentCount() |
Returns the number of segments
|
Point | getStartPoint |
Returns the location of the start point
|
final boolean | isInitialized() |
Returns was this markup initialized of not
|
Iterator<T> | iterator() |
Creates and returns read-only iterator over segments
|
final double | length() |
Returns the length of the markup element, calculated in 3D space.
|
Stream<T> | segmentsStream() |
Creates and returns stream over segments
|
String | toString() |
public AbstractCurve()
public final boolean isInitialized()
Returns was this markup initialized of not
public void addSegment(T segment)
Adss a segment to this curve when creating the curve from code. The curve should be uninitialized, while
the segment should be initialized.
- Parameters:
segment
- a segment to be added
public int getSegmentCount()
Returns the number of segments
- Returns:
- the number of segments
public T getSegment(int index)
Returns the segment by its index
- Parameters:
index
- the segment index, [0 ..getSegmentCount()
- 1]- Returns:
- the segment
public Iterator<T> iterator()
Creates and returns read-only iterator over segments
- Specified by:
iterator
in interfaceIterable<T extends AbstractMarkupSegment>
public Stream<T> segmentsStream()
Creates and returns stream over segments
public Point getStartPoint(Point out)
Returns the location of the start point
- Parameters:
out
- output object to write to, may benull
- Returns:
- the Point object with coordinates of the first point
public Point getEndPoint(Point out)
Returns the location of the end point
- Parameters:
out
- output object to write to, may benull
- Returns:
- the Point object with coordinates of the last point
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 Position getPositionAtOffset(double offset, Position out)
Returns the point (+rotations) located on the markup element with the given
offset
distance calculated from start point.- 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 Position object with coordinates of the point with the given offset and orientation along markup element line at this point
public final Position getPositionAt2DOffset(double offset, Position out)
Returns the point (+rotations) located on the markup element at the XY projection with the given
offset
distance calculated from start point.- Parameters:
offset
- offset, non-negative value, should be less or equal to the length of the projection to XY.out
- output object to write to, may benull
- Returns:
- the Position object with coordinates of the point with the given offset and orientation along markup element line at this point
public double getOffset3D(double offset2D)
Returns offset on the curve, which correlates to provided offset2D on XY
projection
- Parameters:
offset2D
- offset on the XY projection of the curve- Returns:
- offset on the curve, which correlates to offset on XY projection
public String toString()