Package com.anylogic.engine.markup
- java.lang.Object
-
- com.anylogic.engine.markup.AbstractCurve<T>
- All Implemented Interfaces:
IPathData
,java.io.Serializable
,java.lang.Iterable<T>
- Direct Known Subclasses:
AbstractNetworkCurve
,Curve
@AnyLogicInternalAPI public abstract class AbstractCurve<T extends AbstractMarkupSegment> extends java.lang.Object implements IPathData, java.lang.Iterable<T>
- See Also:
- Serialized Form
AbstractCurve() |
|
Constructor | Description |
---|
void |
addSegment(T segment) |
Adss a segment to this curve when creating the curve from code.
|
Point |
getEndPoint(Point out) |
Returns the location of the end point
|
Position |
getPositionAtOffset(double offset,
Position out) |
Returns the point (+rotations) located on the markup element with the given
offset
distance calculated from start point. |
T |
getSegment(int index) |
Returns the segment by its index
|
int |
getSegmentCount() |
Returns the number of segments
|
Point |
getStartPoint(Point out) |
Returns the location of the start point
|
boolean |
isInitialized() |
Returns was this markup initialized of not
|
java.util.Iterator<T> |
iterator() |
Creates and returns read-only iterator over segments
|
double |
length() |
Returns the length of the markup element, calculated in 3D space.
|
java.util.stream.Stream<T> |
segmentsStream() |
Creates and returns stream over segments
|
java.lang.String |
toString() |
|
Modifier and Type | Method | Description |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
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 java.util.Iterator<T> iterator()
Creates and returns read-only iterator over segments
- Specified by:
iterator
in interfacejava.lang.Iterable<T extends AbstractMarkupSegment>
public java.util.stream.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 java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
How can we improve this article?
-