PolygonGen

final
class PolygonGen(val arrayUnsafe: Array[Double]) extends Polygon with Pt2sLike with AffinePreserve with DataDbl2s[Pt2]

The implementation class for a general Polygon as opposed to a specific Polygon such as a Square or a Rectangle, is encoded as a sequence of plain 2 dimension (mathematical) vectors. Minimum length 3. Clockwise is the default. Polygon may be altered to include a centre.

Companion
object
trait Pt2sLike
trait DataDbl2s[Pt2]
trait DataDblNs[Pt2]
trait DataImut[Pt2]
trait DataGen[Pt2]
trait Polygon
trait Approx[Double]
trait Equals
trait Shape
trait Fillable
trait Drawable
trait GeomElem
class Object
trait Matchable
class Any

Type members

Types

override

Inherited types

override
type SideT = LineSeg
Inherited from
Polygon

Value members

Concrete methods

override
Definition Classes
override
def canEqual(that: Any): Boolean
Definition Classes
Equals -> Shape
def distScale(distRatio: Metres): PolygonMetre
override
def draw(lineColour: Colour, lineWidth: Double): PolygonDraw
Definition Classes
def eq(obj: PolygonGen): Boolean
override
def fill(fillColour: Colour): PolygonFill
Definition Classes
@inline
override
def foreachVertPairTail[U](f: (Double, Double) => U): Unit
Definition Classes
override
def foreachVertTail[U](f: Pt2 => U): Unit
Definition Classes
def height: Double
override
def insVert(insertionPoint: Int, newVec: Pt2): PolygonGen

Insert vertex.

Insert vertex.

Definition Classes
override
def insVerts(insertionPoint: Int, newVecs: Pt2*): PolygonGen

Insert vertices

Insert vertices

Definition Classes
def maxX: Double
def maxY: Double
def minX: Double
def minY: Double
@inline
override
Definition Classes
@inline
override

A method to perform all the ProlignPreserve transformations with a function from PT2 => PT2.

A method to perform all the ProlignPreserve transformations with a function from PT2 => PT2.

Definition Classes
override
def typeStr: String
Definition Classes
override
def unsafeFromArray(array: Array[Double]): PolygonGen
Definition Classes
@inline
def v1: Pt2
@inline
def v1x: Double
@inline
def v1y: Double
override
def vert(index: Int): Pt2
Definition Classes
@inline
override
def vertsArray: Array[Double]
Definition Classes
override
def vertsArrayX: Array[Double]
Definition Classes
override
def vertsArrayY: Array[Double]
Definition Classes
override
def vertsForeach[U](f: Pt2 => U): Unit
Definition Classes
override
def vertsNum: Int
Definition Classes
override
Definition Classes
def width: Double
override
def xVert(index: Int): Double
Definition Classes
override
def yVert(index: Int): Double
Definition Classes

Inherited methods

def active(id: AnyRef): PolygonActive
Inherited from
Polygon
def activeChildren(id: AnyRef, children: GraphicElems): PolygonCompound
Inherited from
Polygon
override
def approx(that: Any, precision: Double): Boolean
Definition Classes
Inherited from
Polygon
override
def arrLen: Int
Definition Classes
Inherited from
DataDblNs
def arrTrans(f: Pt2 => Pt2): Array[Double]
Inherited from
Pt2sLike
Inherited from
BoundedElem
@inline
final

The centre of the bounding rectangle. consider also using cenDefault.

The centre of the bounding rectangle. consider also using cenDefault.

Inherited from
BoundedElem
def boundingHeight: Double
Inherited from
BoundedElem

Currently throws, not sure if that is the correct behaviour. Creates a bounding rectangle for a collection of 2d points

Currently throws, not sure if that is the correct behaviour. Creates a bounding rectangle for a collection of 2d points

Definition Classes
Inherited from
Polygon
def boundingWidth: Double

The width of the BoundingRect of this object.

The width of the BoundingRect of this object.

Inherited from
BoundedElem
Inherited from
BoundedElem

If the geometric element has a defined centre then the cenDefault uses that, else it defaults to the centre of the bounding rectangle.

If the geometric element has a defined centre then the cenDefault uses that, else it defaults to the centre of the bounding rectangle.

Inherited from
BoundedElem
def cenPt: Pt2

The centre point of this Polygon. The default centre for Polygons is the centre of the bounding rectangle.

The centre point of this Polygon. The default centre for Polygons is the centre of the bounding rectangle.

Inherited from
Polygon
Inherited from
Polygon
final override
def dataElem(d1: Double, d2: Double): Pt2
Definition Classes
Inherited from
Pt2sLike
def dataForeach[U](f: Pt2 => U): Unit

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

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

Inherited from
DataGen
def dataForeachPairTail[U](f: (Double, Double) => U): Unit
Inherited from
DataDbl2s
def dataIForeach[U](f: (Pt2, Int) => U): Unit

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

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

Inherited from
DataGen
Inherited from
DataGen
def dataMap[B, ArrB <: ArrBase[B]](f: Pt2 => B)(implicit ev: ArrBuilder[B, ArrB]): ArrB

Specialised map to an immutable ArrBase of B.

Specialised map to an immutable ArrBase of B.

Inherited from
DataGen
def dataTailForeach[U](f: Pt2 => U): Unit

Foreachs over the tail of the data sequence.

Foreachs over the tail of the data sequence.

Inherited from
DataGen
def dataTailfold[B](initial: B)(f: (B, Pt2) => B): B

foldLeft over the tail of the data sequence.

foldLeft over the tail of the data sequence.

Inherited from
DataGen
def drawActive(lineColour: Colour, lineWidth: Double, pointerID: AnyRef): PolygonCompound
Inherited from
Polygon
def elem1sArray: Array[Double]
Inherited from
DataDbl2s
def elem2sArray: Array[Double]
Inherited from
DataDbl2s
override
def elemProdSize: Int
Definition Classes
Inherited from
DataDbl2s
def elemsLenStr: String

Just a handy short cut to give the length of this collection as a string.

Just a handy short cut to give the length of this collection as a string.

Inherited from
DataGen
final override
def elemsNum: Int

The number of product elements in this collection. For example in a [[PolygonImp], this is the number of Pt2s in the Polygon

The number of product elements in this collection. For example in a [[PolygonImp], this is the number of Pt2s in the Polygon

Definition Classes
Inherited from
DataValueNs
final
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.

Inherited from
DataGen
override
def fElemStr: Pt2 => String
Definition Classes
Inherited from
Pt2sLike
def fillActive(fillColour: Colour, pointerID: AnyRef): PolygonCompound
Inherited from
Polygon
def fillActiveDraw(fillColour: Colour, pointerID: AnyRef, lineColour: Colour, lineWidth: Double): PolygonCompound

Creates a PolygonCompound graphic that is active with a simple 1 colour fill and has a draw graphic for the Polygon. The default values for the draw area line width of 2 and a colour of Black.

Creates a PolygonCompound graphic that is active with a simple 1 colour fill and has a draw graphic for the Polygon. The default values for the draw area line width of 2 and a colour of Black.

Inherited from
Polygon
override
def fillDraw(fillColour: Colour, lineColour: Colour, lineWidth: Double): PolygonCompound
Definition Classes
Inherited from
Polygon
def fillDrawActive(fillColour: Colour, pointerID: AnyRef, lineWidth: Double, lineColour: Colour): PolygonCompound
Inherited from
Polygon
def fillDrawText(fillColour: Colour, str: String, fontSize: Int, lineColour: Colour, lineWidth: Double): PolygonCompound
Inherited from
Polygon
def fillDrawTextActive(fillColour: Colour, pointerID: AnyRef, str: String, fontSize: Int, lineWidth: Double, lineColour: Colour, align: TextAlign): PolygonCompound
Inherited from
Polygon
override
def fillInt(intValue: Int): PolygonFill
Definition Classes
Inherited from
Polygon
def fillText(fillColour: Colour, str: String, fontSize: Int, textColour: Colour, layer: Int): PolygonCompound
Inherited from
Polygon
def fillTextActive(fillColour: Colour, pointerEv: AnyRef, str: String, fontSize: Int, fontColour: Colour, align: TextAlign): PolygonCompound
Inherited from
Polygon
def iForeachSide(initCount: Int)(f: (LineSeg, Int) => Unit): Unit

foreachs over the sides or edges of the Polygon These are of type LineSeg.

foreachs over the sides or edges of the Polygon These are of type LineSeg.

Inherited from
Polygon
override
def indexData(index: Int): Pt2
Definition Classes
Inherited from
DataDbl2s
def map[B <: ElemValueN, BB <: PolygonLike[B]](f: Pt2 => B)(implicit build: PolygonBuilder[B, BB]): BB

Map this collection of data elements to PolygonLike class of type BB.

Map this collection of data elements to PolygonLike class of type BB.

Inherited from
PolygonLike
override
def negX: ThisT
Definition Classes
Inherited from
SimilarPreserve
override
def negY: ThisT
Definition Classes
Inherited from
SimilarPreserve
def parentFillText(pointerID: Any, fillColour: Colour, str: String, fontSize: Int, textColour: Colour, align: TextAlign): PolygonCompound
Inherited from
Polygon
def precisionDefault: Double
Inherited from
Polygon
override
Definition Classes
Inherited from
ProlignPreserve
def ptInside(pt: Pt2): Boolean

Determines if the parameter point lies inside this Polygon.

Determines if the parameter point lies inside this Polygon.

Inherited from
Polygon
override
def reflect(lineLike: LineLike): ThisT
Definition Classes
Inherited from
SimilarPreserve
override
Definition Classes
Inherited from
DataDblNs
override
def rotate(angle: AngleVec): ThisT
Definition Classes
Inherited from
SimilarPreserve
override
Definition Classes
Inherited from
SimilarPreserve
override
Definition Classes
Inherited from
SimilarPreserve
override
Definition Classes
Inherited from
SimilarPreserve
override
def scale(operand: Double): ThisT
Definition Classes
Inherited from
ProlignPreserve
override
def scaleXY(xOperand: Double, yOperand: Double): ThisT
Definition Classes
Inherited from
AffinePreserve
override
def shearX(operand: Double): ThisT
Definition Classes
Inherited from
AffinePreserve
override
def shearY(operand: Double): ThisT
Definition Classes
Inherited from
AffinePreserve
@inline
def side(index: Int): LineSeg
Inherited from
Polygon
def sidesFold[A](init: A)(f: (A, LineSeg) => A): A
Inherited from
Polygon
override
def sidesForeach[U](f: LineSeg => U): Unit

foreachs over the sides or edges of the Polygon These are of type LineSeg.

foreachs over the sides or edges of the Polygon These are of type LineSeg.

Definition Classes
Inherited from
Polygon
def sidesIFlatMap[AA <: ArrBase[_]](initCount: Int)(f: (LineSeg, Int) => AA)(implicit build: ArrFlatBuilder[AA]): AA

maps with a integer counter over the sides or edges of the Polygon These are of type LineSeg.

maps with a integer counter over the sides or edges of the Polygon These are of type LineSeg.

Inherited from
Polygon
def sidesIMap[A, AA <: ArrBase[A]](initCount: Int)(f: (LineSeg, Int) => A)(implicit build: ArrBuilder[A, AA]): AA

maps with a integer counter over the sides or edges of the Polygon These are of type LineSeg.

maps with a integer counter over the sides or edges of the Polygon These are of type LineSeg.

Inherited from
Polygon
def sidesMap[A, AA <: ArrBase[A]](f: LineSeg => A)(implicit build: ArrBuilder[A, AA]): AA

maps over the sides or edges of the Polygon These are of type LineSeg.

maps over the sides or edges of the Polygon These are of type LineSeg.

Inherited from
Polygon
def slate(offset: Vec2Like): Polygon

Translate geometric transformation on a Polygon returns a Polygon. The return type of this method will be narrowed further in most descendant traits / classes. The exceptions being those classes where the centring of the geometry at the origin is part of the type.

Translate geometric transformation on a Polygon returns a Polygon. The return type of this method will be narrowed further in most descendant traits / classes. The exceptions being those classes where the centring of the geometry at the origin is part of the type.

Inherited from
Polygon
override
def slateXY(xDelta: Double, yDelta: Double): ThisT
Definition Classes
Inherited from
ProlignPreserve
def sline(index: Int): LineSeg
Inherited from
Polygon
Inherited from
BoundedElem
final override
def toString: String
Definition Classes
DataGen -> Any
Inherited from
DataGen
Inherited from
BoundedElem
final override
def unsafeSameSize(length: Int): ThisT
Definition Classes
Inherited from
DataDblNs
override
def unsafeSetElem(index: Int, elem: Pt2): Unit
Definition Classes
Inherited from
DataDbl2s
def unsafeSetElems(index: Int, elems: Pt2*): 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.

Inherited from
DataGen
def vLast: Pt2

The last vertex will throw an exception on a 0 vertices polygon.

The last vertex will throw an exception on a 0 vertices polygon.

Inherited from
Polygon
def vertsFlatMap[BB <: ArrBase[_]](f: Pt2 => BB)(implicit build: ArrFlatBuilder[BB]): BB

flatMap to an immutable Arr.

flatMap to an immutable Arr.

Inherited from
Polygon
override
def vertsFold[B](init: B)(f: (B, Pt2) => B): B
Definition Classes
Inherited from
Polygon
def vertsForAll(f: Pt2 => Boolean): Boolean

This method should be overridden in final classes.

This method should be overridden in final classes.

Inherited from
PolygonLike
def vertsIFlatMap[BB <: ArrBase[_]](iInit: Int)(f: (Pt2, Int) => BB)(implicit build: ArrFlatBuilder[BB]): BB

flatMap with index to an immutable Arr.

flatMap with index to an immutable Arr.

Inherited from
Polygon
override
def vertsIForeach[U](f: (Int, Pt2) => Any): Unit
Definition Classes
Inherited from
Polygon
override
def vertsMap[B, ArrB <: ArrBase[B]](f: Pt2 => B)(implicit build: ArrBuilder[B, ArrB]): ArrB
Definition Classes
Inherited from
Polygon
override
def vertsPrevForEach[U](f: (Pt2, Pt2) => 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.

Definition Classes
Inherited from
Polygon

Concrete fields

val arrayUnsafe: Array[Double]