PolygonPm2

ostrat.geom.PolygonPm2
See thePolygonPm2 companion object
final class PolygonPm2(val arrayUnsafe: Array[Double]) extends AnyVal, PolygonLen2[PtPm2]

A polygon using vertices specified in PtPm2 points rather than scalars.

Attributes

Companion
object
Graph
Supertypes
trait ShapeLen2
trait FillableLen2
trait DrawableLen2
trait SpecialT
trait SeqSpec[PtPm2]
trait SeqLike[PtPm2]
trait GeomLen2Elem
class AnyVal
trait Matchable
class Any
Show all

Members list

Type members

Types

type SideT = LineSegPm2
type ThisT = PolygonPm2

Gives the final type of this class.

Gives the final type of this class.

Attributes

Value members

Concrete methods

override def elemFromDbls(d1: Double, d2: Double): PtPm2

Constructs a Dbl2Elem from 2 Doubles.

Constructs a Dbl2Elem from 2 Doubles.

Attributes

Definition Classes
override def fElemStr: PtPm2 => String

String for element, can be overridden.

String for element, can be overridden.

Attributes

Definition Classes
override def mapGeom2(operand: Length): Polygon

Divides by a Length to produce an equivalent Aff2Elem without Length units.

Divides by a Length to produce an equivalent Aff2Elem without Length units.

Attributes

Definition Classes
override def revY: PolygonPm2

Attributes

Definition Classes
override def revYIf(cond: Boolean): PolygonPm2

Attributes

Definition Classes
override def rotate180: PolygonPm2

Attributes

Definition Classes
override def rotate180If(cond: Boolean): PolygonPm2

Attributes

Definition Classes
override def rotate180IfNot(cond: Boolean): PolygonPm2

Attributes

Definition Classes
override def scale(operand: Double): PolygonPm2

Uniform 2 Length dimension geometric scaling transformation. The scale name was chosen for this operation as it is normally the desired operation and preserves Circles and Squares. The Return type will be narrowed in sub traits / classes.

Uniform 2 Length dimension geometric scaling transformation. The scale name was chosen for this operation as it is normally the desired operation and preserves Circles and Squares. The Return type will be narrowed in sub traits / classes.

Attributes

Definition Classes
override def side(index: Int): LineSegPm2

Returns a side of the appropriate type for the PolygonBase from the given index. The index cycles.

Returns a side of the appropriate type for the PolygonBase from the given index. The index cycles.

Attributes

Definition Classes
override def sides: LineSegPm2Arr

Attributes

Definition Classes
override def sidesForeach[U](f: LineSegPm2 => U): Unit

Attributes

Definition Classes
override def slate(operand: VecPtLen2): PolygonPm2

Translate 2 Length dimension geometric transformation GeomLen2Elem. The Return type will be narrowed in sub traits. There is a name overload taking the X and Y Deltas as separate parameters, slateX and slateY methods are also available.

Translate 2 Length dimension geometric transformation GeomLen2Elem. The Return type will be narrowed in sub traits. There is a name overload taking the X and Y Deltas as separate parameters, slateX and slateY methods are also available.

Attributes

Definition Classes
override def slate(xOperand: Length, yOperand: Length): PolygonPm2

Translate 2 Length dimension geometric transformation, taking the xDelta and yDelta as parameters on this GeomLen2Elem returning a GeomLen2Elem. The Return type will be narrowed in sub traits. There is a name overload method taking a Pt2 or Vec2 as a parameter, slateX and slateY methods are also available.

Translate 2 Length dimension geometric transformation, taking the xDelta and yDelta as parameters on this GeomLen2Elem returning a GeomLen2Elem. The Return type will be narrowed in sub traits. There is a name overload method taking a Pt2 or Vec2 as a parameter, slateX and slateY methods are also available.

Attributes

Definition Classes
override def slateX(xOperand: Length): PolygonPm2

Translate 2 Length dimension geometric transformation in the X dimension returning a GeomLen2Elem. The Return type will be narrowed in sub traits.

Translate 2 Length dimension geometric transformation in the X dimension returning a GeomLen2Elem. The Return type will be narrowed in sub traits.

Attributes

Definition Classes
override def slateY(yOperand: Length): PolygonPm2

Translate 2 Length dimension geometric transformation in the Y dimension returning a GeomLen2Elem. The Return type will be narrowed in sub traits.

Translate 2 Length dimension geometric transformation in the Y dimension returning a GeomLen2Elem. The Return type will be narrowed in sub traits.

Attributes

Definition Classes
override def typeStr: String

String specifying the type of this object.

String specifying the type of this object.

Attributes

Definition Classes
override def v0: PtLen2

Vertex v0, will throw on a 0 vertices polygon. By convention the default position for this vertex is at the top or 12 o'clock position of the polygon or the vertex immediately anti-clockwise if there is no vertex in this position.

Vertex v0, will throw on a 0 vertices polygon. By convention the default position for this vertex is at the top or 12 o'clock position of the polygon or the vertex immediately anti-clockwise if there is no vertex in this position.

Attributes

Definition Classes
override def v0x: Length

The X component of vertex v0, will throw on a 0 vertices polygon.

The X component of vertex v0, will throw on a 0 vertices polygon.

Attributes

Definition Classes
override def v0y: Length

The Y component of vertex v1, will throw on a 0 vertices polygon.

The Y component of vertex v1, will throw on a 0 vertices polygon.

Attributes

Definition Classes
override def verts: PtPm2Arr

Attributes

Definition Classes
override def vertsForeach[U](f: PtPm2 => U): Unit

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

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

Attributes

Definition Classes
override def vertsMap[B, ArrB <: Arr[B]](f: PtPm2 => 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.

Definition Classes

Inherited methods

def appendArray(appendProductsLength: Int): Array[Double]

Builder helper method that provides a longer array, with the underlying array copied into the new extended Array.

Builder helper method that provides a longer array, with the underlying array copied into the new extended Array.

Attributes

Inherited from:
SeqSpecDblN

Maps the 1st Doubles of each element to a double with one functions and then the second Doubles with a second Double.

Maps the 1st Doubles of each element to a double with one functions and then the second Doubles with a second Double.

Attributes

Inherited from:
SeqLikeImutDbl2

Maps the 1st Double of each element to a new Array[Double], copies the 2nd elements.

Maps the 1st Double of each element to a new Array[Double], copies the 2nd elements.

Attributes

Inherited from:
SeqLikeImutDbl2

Maps the 2nd Double of each element with the parameter function to a new Array[Double], copies the 1st Double of each element.

Maps the 2nd Double of each element with the parameter function to a new Array[Double], copies the 1st Double of each element.

Attributes

Inherited from:
SeqLikeImutDbl2

Maps the 2 Doubles of each element to a new Array[Double].

Maps the 2 Doubles of each element to a new Array[Double].

Attributes

Inherited from:
SeqLikeImutDbl2
override protected def arrayForSides: Array[Double]

Creates the Array[Double] need to implement the sides method.

Creates the Array[Double] need to implement the sides method.

Attributes

Definition Classes
Inherited from:
PolygonDbl2
final def arrayLen: Int

The length of the backing Array Double.

The length of the backing Array Double.

Attributes

Inherited from:
ArrayDblBacked

Maps the Tuple2[Double, Double]s to Tuple2[Double, Double}.

Maps the Tuple2[Double, Double]s to Tuple2[Double, Double}.

Attributes

Inherited from:
SeqLikeImutDbl2

Produces a new Array[Double] of the same size, with the functions acting on the first and second Double of each element.

Produces a new Array[Double] of the same size, with the functions acting on the first and second Double of each element.

Attributes

Inherited from:
SeqLikeImutDbl2
def dblsMap(f1: Double => Double, f2: Double => Double): ThisT

This maps from the final type to the final type by just using functions on the underlying Doubles.

This maps from the final type to the final type by just using functions on the underlying Doubles.

Attributes

Inherited from:
SeqLikeImutDbl2
override def draw(lineWidth: Double, lineColour: Colour): GraphicLen2Elem

Draws the object. The line width is defined in pixels.

Draws the object. The line width is defined in pixels.

Attributes

Definition Classes
Inherited from:
PolygonLen2
final override def elem(index: Int): PtPm2

Accesses the specifying sequence element by a 0 based index. For Sequs this will an alternative name for apply.

Accesses the specifying sequence element by a 0 based index. For Sequs this will an alternative name for apply.

Attributes

Definition Classes
Inherited from:
SeqLikeImutDbl2

Attributes

Inherited from:
SeqLikeImutDbl2

Attributes

Inherited from:
SeqLikeImutDbl2
final override def elemEq(a1: PtPm2, a2: PtPm2): Boolean

Checks if 2 values of the specifying sequence are equal.

Checks if 2 values of the specifying sequence are equal.

Attributes

Definition Classes
Inherited from:
SeqLikeDbl2
final override def elemProdSize: Int

The number of atomic values, Ints, Doubles, Longs etc that specify / construct an element of this immutable flat Array based collection class.

The number of atomic values, Ints, Doubles, Longs etc that specify / construct an element of this immutable flat Array based collection class.

Attributes

Definition Classes
Inherited from:
SeqLikeDbl2

Attributes

Inherited from:
SeqSpecValueN
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
override def fill(fillFacet: FillFacet): PolygonLen2Fill

Graphically fills this object.

Graphically fills this object.

Attributes

Definition Classes
Inherited from:
PolygonLen2
override def fillDraw(fillFacet: FillFacet, lineColour: Colour, lineWidth: Double): GraphicLen2Elem

Graphically fills and draws this object.

Graphically fills and draws this object.

Attributes

Definition Classes
Inherited from:
PolygonLen2
def flatMap[B <: ValueNElem, BB <: PolygonBase[B]](f: PtPm2 => SeqLike[B])(implicit build: PolygonLikeFlatBuilder[B, BB]): BB

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

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

Attributes

Inherited from:
PolygonBase
def foldLeft[B](initVal: B)(f: (B, PtPm2) => B): B

foldLeft over the specifying sequence.

foldLeft over the specifying sequence.

Attributes

Inherited from:
SeqSpec
override def foreach[U](f: PtPm2 => 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

Definition Classes
Inherited from:
SeqSpec
def iForeach[U](initIndex: Int)(f: (Int, PtPm2) => 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 iForeach[U](f: (Int, PtPm2) => Any): Unit

Index with foreach on 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 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 innerForeach[U](f: PtPm2 => 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 last: PtPm2

Last element of the specifying sequence.

Last element of the specifying sequence.

Attributes

Inherited from:
SeqSpec
def map[B <: ValueNElem, BB <: PolygonBase[B]](f: PtPm2 => B)(implicit build: PolygonLikeBuilderMap[B, BB]): BB

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

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

Attributes

Inherited from:
PolygonBase
def mapArr[B, ArrB <: Arr[B]](f: PtPm2 => 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 mutateElemUnsafe(index: Int, f: PtPm2 => PtPm2): Unit

Mutates an element in the Arr at the given index. This method should rarely be needed by end users, but is used by the initialisation and factory methods.

Mutates an element in the Arr at the given index. This method should rarely be needed by end users, but is used by the initialisation and factory methods.

Attributes

Inherited from:
SeqLikeBacked
final override def numElems: 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. For Sequs this will be an alternative name for length.

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. For Sequs this will be an alternative name for length.

Attributes

Definition Classes
Inherited from:
SeqLikeImutDbl2
override def numVerts: Int

The number of vertices.

The number of vertices.

Attributes

Definition Classes
Inherited from:
PolygonValueN
def optMap[B <: ValueNElem, BB <: PolygonBase[B]](f: PtPm2 => Option[B])(implicit build: PolygonLikeBuilderMap[B, BB]): Option[BB]

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

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

Attributes

Inherited from:
PolygonBase
override def reverse: ThisT

Reverses the order of the elements of the specifying sequence.

Reverses the order of the elements of the specifying sequence.

Attributes

Definition Classes
Inherited from:
SeqSpecDblN
def reverseForeach[U](f: PtPm2 => 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
override def setElemUnsafe(index: Int, newElem: PtPm2): Unit

Sets / mutates an element in the Arr at the given index. 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 at the given index. This method should rarely be needed by end users, but is used by the initialisation and factory methods.

Attributes

Definition Classes
Inherited from:
SeqLikeImutDbl2
def setElemsUnsafe(index: Int, elems: PtPm2*): 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:
SeqLikeBacked
def tailFold[B](initial: B)(f: (B, PtPm2) => B): B

FoldLeft over the tail of the specifying sequence.

FoldLeft over the tail of the specifying sequence.

Attributes

Inherited from:
SeqSpec
def tailForeach[U](f: PtPm2 => 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
def tailForeachPair[U](f: (Double, Double) => U): Unit

Attributes

Inherited from:
SeqSpecDbl2
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

Reverses the order of the elements in a new Array[Double] which is returned.

Reverses the order of the elements in a new Array[Double] which is returned.

Attributes

Inherited from:
SeqSpecDblN
def unsafeSameSize(length: Int): ThisT

Attributes

Inherited from:
SeqLikeImutDblN
def vert(vertNum: Int): PtPm2

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

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

Attributes

Inherited from:
PolygonBase

This method should be overridden in final classes.

This method should be overridden in final classes.

Attributes

Inherited from:
PolygonBase

Checks this polygon has at least 3 vertices.

Checks this polygon has at least 3 vertices.

Attributes

Inherited from:
PolygonBase
def vertsPrevForEach[U](f: (PtPm2, PtPm2) => 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 PolygonBase. 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 PolygonBase. 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 from:
PolygonBase

Concrete fields