PolygonLike

ostrat.geom.PolygonLike
trait PolygonLike[VT] extends SeqSpec[VT]

A Polygon like object, where the points dimensions could be specified in 2D or 3D Length, latitude and longitude etc as well as the regular scalar values of the standard Polygon.

Type parameters

VT

The type of the vertices in this polygon like trait. For a standard Polygon this will be a Pt2, but for example for a PolygonM3 it would be a PtM3.

Attributes

Graph
Supertypes
trait SeqSpec[VT]
trait SeqLike[VT]
class Any
Known subtypes
trait PolygonValueN[VT]
trait PolygonLikeDblN[VT]
trait PolygonLikeDbl2[VT]
class PolygonLL
trait Polygon
trait Polygon3Plus
trait Polygon4Plus
trait Polygon5Plus
trait Polygon6Plus
class DoDeclign
trait HexReg
class HexRegImp
trait Hexlign
class HexParrX
class HexParrY
trait Rectangle
trait PhiRectangle
class PhiRect
class PhiRectY
trait Rect
object NoBounds
class RectImp
class Sqlign
class RectangleImp
trait Square
class SquareImp
trait Triangle
class TriangleImp
trait TriangleIsos
class TriangleEqui
class PolygonGen
class PolygonM2
trait PolygonLikeDbl3[VT]
class PolygonM3
trait PolygonLikeIntN[VT]
trait PolygonLikeInt2[VT]
class PolygonHC
class PolygonSqC
trait PolygonLikeInt3[VT]
Show all

Members list

Type members

Types

type SideT <: LineSegLike[VT]

Inherited types

type ThisT <: SeqSpec[VT]

Gives the final type of this class.

Gives the final type of this class.

Attributes

Inherited from:
SeqSpec

Value members

Abstract methods

def numVerts: Int

The number of vertices and also the number of sides in this Polygon.

The number of vertices and also the number of sides in this Polygon.

Attributes

def side(index: Int): SideT

Returns a side of the appropriate type for the PolygonLike from the goven index. The index cycles.

Returns a side of the appropriate type for the PolygonLike from the goven index. The index cycles.

Attributes

def sides: Arr[SideT]
def sidesForeach[U](f: SideT => U): Unit
def verts: Arr[VT]
def vertsForeach[U](f: VT => U): Unit

Performs the side effecting function on the value of each vertex.

Performs the side effecting function on the value of each vertex.

Attributes

Concrete methods

def flatMap[B <: ValueNElem, BB <: PolygonLike[B]](f: VT => SeqLike[B])(implicit build: PolygonLikeFlatBuilder[B, BB]): BB

FlatMaps the vertices of this PolygonLike to a new to PolygonLike class of type BB.

FlatMaps the vertices of this PolygonLike to a new to PolygonLike class of type BB.

Attributes

def map[B <: ValueNElem, BB <: PolygonLike[B]](f: VT => B)(implicit build: PolygonLikeMapBuilder[B, BB]): BB

Maps the vertices of this PolygonLike to a new to PolygonLike class of type BB.

Maps the vertices of this PolygonLike to a new to PolygonLike class of type BB.

Attributes

def optMap[B <: ValueNElem, BB <: PolygonLike[B]](f: VT => Option[B])(implicit build: PolygonLikeMapBuilder[B, BB]): Option[BB]

Optionally maps the vertices of this PolygonLike to vertices of a new to PolygonLike class of type BB. If the new PolygonLike has at least 3 vertices returns Some else returns None.

Optionally maps the vertices of this PolygonLike to vertices of a new to PolygonLike class of type BB. If the new PolygonLike has at least 3 vertices returns Some else returns None.

Attributes

def vert(index: Int): VT

Returns the vertex of the given index. Cycles around if the index is out of range, vert 3 retruns vert 0 on a triangle.

Returns the vertex of the given index. Cycles around if the index is out of range, vert 3 retruns vert 0 on a triangle.

Attributes

def vertsForAll(f: VT => Boolean): Boolean

This method should be overridden in final classes.

This method should be overridden in final classes.

Attributes

def vertsMap[B, ArrB <: Arr[B]](f: VT => B)(implicit builder: BuilderArrMap[B, ArrB]): ArrB

Maps the vertices of this polygon to an immutable Array like sequence of type B.

Maps the vertices of this polygon to an immutable Array like sequence of type B.

Type parameters

ArrB

The type of the immutable Array like sequence of B.

B

The element type of the returned sequence.

Attributes

Returns

the immutable sequence collection by applying the supplied function to each vertex.

Checks this polygon has at least 3 vertices.

Checks this polygon has at least 3 vertices.

Attributes

def vertsPrevForEach[U](f: (VT, VT) => U): Unit

This method does nothing if the vertNum < 2. Foreach vertex applies the side effecting function to the previous vertex with each vertex. The previous vertex to the first vertex is the last vertex of the PolygonLike. Note the function signature (previous, vertex) => U follows the foreach based convention of putting the collection element 2nd or last as seen for example in fold methods'(accumulator, element) => B signature.

This method does nothing if the vertNum < 2. Foreach vertex applies the side effecting function to the previous vertex with each vertex. The previous vertex to the first vertex is the last vertex of the PolygonLike. Note the function signature (previous, vertex) => U follows the foreach based convention of putting the collection element 2nd or last as seen for example in fold methods'(accumulator, element) => B signature.

Attributes

Inherited methods

override def elemsStr: String

The element String allows the composition of toString for the whole collection. The syntax of the output will be reworked.

The element String allows the composition of toString for the whole collection. The syntax of the output will be reworked.

Attributes

Definition Classes
Inherited from:
SeqSpec
def fElemStr: (VT) => String

Attributes

Inherited from:
SeqLike
def setElemUnsafe(i: Int, newElem: VT): Unit

Sets / mutates an element in the Arr. This method should rarely be needed by end users, but is used by the initialisation and factory methods.

Sets / mutates an element in the Arr. This method should rarely be needed by end users, but is used by the initialisation and factory methods.

Attributes

Inherited from:
SeqLike
def setElemsUnsafe(index: Int, elems: VT*): Unit

Sets / mutates elements in the Arr. This method should rarely be needed by end users, but is used by the initialisation and factory methods.

Sets / mutates elements in the Arr. This method should rarely be needed by end users, but is used by the initialisation and factory methods.

Attributes

Inherited from:
SeqLike
def ssFold[B](initVal: B)(f: (B, VT) => B): B

specifying -sequence fold.

specifying -sequence fold.

Attributes

Inherited from:
SeqSpec
def ssForeach[U](f: VT => U): Unit

Performs a side effecting function on each element of the specifying sequence in order.

Performs a side effecting function on each element of the specifying sequence in order.

Attributes

Inherited from:
SeqSpec
def ssIForeach[U](initIndex: Int)(f: (Int, VT) => U): Unit

Index with foreach on the data elements. Performs a side effecting function on the index and each element of the data sequence. It takes a function as a parameter. The function may return Unit. If it does return a non Unit value it is discarded. The [U] type parameter is there just to avoid warnings about discarded values and can be ignored by method users. The method has 2 versions / name overloads. The default start for the index is 0 if just the function parameter is passed. The second version name overload takes an Int for the first parameter list, to set the start value of the index. Note the function signature follows the foreach based convention of putting the collection element 2nd or last as seen for example in fold methods' (accumulator, element) => B signature.

Index with foreach on the data elements. Performs a side effecting function on the index and each element of the data sequence. It takes a function as a parameter. The function may return Unit. If it does return a non Unit value it is discarded. The [U] type parameter is there just to avoid warnings about discarded values and can be ignored by method users. The method has 2 versions / name overloads. The default start for the index is 0 if just the function parameter is passed. The second version name overload takes an Int for the first parameter list, to set the start value of the index. Note the function signature follows the foreach based convention of putting the collection element 2nd or last as seen for example in fold methods' (accumulator, element) => B signature.

Attributes

Inherited from:
SeqSpec
def ssIForeach[U](f: (Int, VT) => Any): Unit

Index with foreach on the the specifying sequence elements. Performs a side effecting function on the index and each element of the specifying sequence. It takes a function as a parameter. The function may return Unit. If it does return a non Unit value it is discarded. The [U] type parameter is there just to avoid warnings about discarded values and can be ignored by method users. The method has 2 versions / name overloads. The default start for the index is 0 if just the function parameter is passed. The second version name overload takes an Int for the first parameter list, to set the start value of the index. Note the function signature follows the foreach based convention of putting the collection element 2nd or last as seen for example in fold methods' (accumulator, element) => B signature.

Index with foreach on the the specifying sequence elements. Performs a side effecting function on the index and each element of the specifying sequence. It takes a function as a parameter. The function may return Unit. If it does return a non Unit value it is discarded. The [U] type parameter is there just to avoid warnings about discarded values and can be ignored by method users. The method has 2 versions / name overloads. The default start for the index is 0 if just the function parameter is passed. The second version name overload takes an Int for the first parameter list, to set the start value of the index. Note the function signature follows the foreach based convention of putting the collection element 2nd or last as seen for example in fold methods' (accumulator, element) => B signature.

Attributes

Inherited from:
SeqSpec
def ssIndex(index: Int): VT

Accesses the specifying sequence element by a 0 based index.

Accesses the specifying sequence element by a 0 based index.

Attributes

Inherited from:
SeqSpec
def ssInnerForeach[U](f: VT => U): Unit

Foreachs over the inner of the specifying sequence, excludes the first and last element. Performs a side effecting function on each element of the tail of the specifying sequence in order.

Foreachs over the inner of the specifying sequence, excludes the first and last element. Performs a side effecting function on each element of the tail of the specifying sequence in order.

Attributes

Inherited from:
SeqSpec
def ssLast: VT

Last element of the specifying sequence.

Last element of the specifying sequence.

Attributes

Inherited from:
SeqSpec
def ssLength: Int

The number of data elements in the defining sequence. These collections use underlying mutable Arrays and ArrayBuffers. The length of the underlying Array will be a multiple of this number.

The number of data elements in the defining sequence. These collections use underlying mutable Arrays and ArrayBuffers. The length of the underlying Array will be a multiple of this number.

Attributes

Inherited from:
SeqSpec
def ssMap[B, ArrB <: Arr[B]](f: VT => B)(implicit ev: BuilderArrMap[B, ArrB]): ArrB

Specialised map to an immutable Arr of B. For Sequ dataMap is the same as map, but for other structures it will be different, for example a PolygonLike will map to another PolygonLike.

Specialised map to an immutable Arr of B. For Sequ dataMap is the same as map, but for other structures it will be different, for example a PolygonLike will map to another PolygonLike.

Attributes

Inherited from:
SeqSpec
def ssReverseForeach[U](f: VT => U): Unit

Performs a side effecting function on each element of the specifying-sequence in reverse order. The function may return Unit. If it does return a non Unit value it is discarded. The [U] type parameter is there just to avoid warnings about discarded values and can be ignored by method users.

Performs a side effecting function on each element of the specifying-sequence in reverse order. The function may return Unit. If it does return a non Unit value it is discarded. The [U] type parameter is there just to avoid warnings about discarded values and can be ignored by method users.

Attributes

Inherited from:
SeqSpec
def ssTailFold[B](initial: B)(f: (B, VT) => B): B

FoldLeft over the tail of the specifying sequence.

FoldLeft over the tail of the specifying sequence.

Attributes

Inherited from:
SeqSpec
def ssTailForeach[U](f: VT => U): Unit

Foreachs over the tail of the specifying sequence. Performs a side effecting function on each element of the tail of the specifying sequence in order.

Foreachs over the tail of the specifying sequence. Performs a side effecting function on each element of the tail of the specifying sequence in order.

Attributes

Inherited from:
SeqSpec
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
SeqLike -> Any
Inherited from:
SeqLike

String specifying the type of this object.

String specifying the type of this object.

Attributes

Inherited from:
SeqLike