PolygonGen

ostrat.geom.PolygonGen
See thePolygonGen companion object

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.

Attributes

Companion
object
Graph
Supertypes
trait Pt2SeqSpec
trait PolygonDbl2[Pt2]
trait PolygonDblN[Pt2]
trait SeqSpecDbl2[Pt2]
trait SeqSpecDblN[Pt2]
trait Pt2SeqLike
trait SeqLikeDbl2[Pt2]
trait SpecialT
trait PointSeqLike[Pt2]
trait Polygon
trait PolygonBase[Pt2]
trait VertSeqSpec[Pt2]
trait SeqSpec[Pt2]
trait SeqLike[Pt2]
trait Approx[Double]
trait Equals
trait Shape
trait BoundedElem
trait Fillable
trait Drawable
trait Aff2Elem
trait Simil2Elem
trait Axlign2Elem
class Object
trait Matchable
class Any
Show all

Members list

Type members

Types

override type ThisT = PolygonGen

Gives the final type of this class.

Gives the final type of this class.

Attributes

Inherited types

override type SideT = LSeg2

Attributes

Inherited from:
Polygon

Value members

Concrete methods

override def attribs: RArr[XAtt]

The SVG attributes for this polygon.

The SVG attributes for this polygon.

Attributes

Definition Classes
override def canEqual(that: Any): Boolean

This canEqual override allow the comparison of Shapes.

This canEqual override allow the comparison of Shapes.

Attributes

Definition Classes
def distScale(distRatio: Metres): PolygonM2Gen
override def draw(lineWidth: Double, lineColour: Colour): PolygonDraw

Draws this geometric element to produce a GraphElem graphical element, that can be displayed or printed.

Draws this geometric element to produce a GraphElem graphical element, that can be displayed or printed.

Attributes

Definition Classes
def eq(obj: PolygonGen): Boolean
override def fill(fillfacet: FillFacet): PolygonFill

Returns a fill graphic of this geometric object.

Returns a fill graphic of this geometric object.

Attributes

Definition Classes
override def fromArray(array: Array[Double]): PolygonGen

Attributes

Definition Classes
def height: Double
override def insVert(insertionPoint: Int, newVec: Pt2): PolygonGen

Insert vertex.

Insert vertex.

Attributes

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

Insert vertices

Insert vertices

Attributes

Definition Classes
def maxX: Double
def maxY: Double
def minX: Double
def minY: Double
override def negX: PolygonGen

Mirror, reflection 2D geometric transformation across the Y axis by negating X. The return type will be narrowed in sub traits / classes.

Mirror, reflection 2D geometric transformation across the Y axis by negating X. The return type will be narrowed in sub traits / classes.

Attributes

Definition Classes
override def negY: PolygonGen

Mirror, reflection 2D geometric transformation across the X axis by negating y. The return type will be narrowed in sub traits / classes.

Mirror, reflection 2D geometric transformation across the X axis by negating y. The return type will be narrowed in sub traits / classes.

Attributes

Definition Classes
override def numVerts: Int

The number of vertices.

The number of vertices.

Attributes

Definition Classes
override def prolign(matrix: AxlignMatrix): PolygonGen

2D Transformation using a AxlignMatrix. The return type will be narrowed in subclasses / traits.

2D Transformation using a AxlignMatrix. The return type will be narrowed in subclasses / traits.

Attributes

Definition Classes
override def ptsTrans(f: Pt2 => Pt2): PolygonGen

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.

Attributes

Definition Classes
override def reflect(lineLike: LineLike): PolygonGen

Reflect 2D geometric transformation across a line, line segment or ray on a GeomElem. The return type will be narrowed in subclasses and traits.

Reflect 2D geometric transformation across a line, line segment or ray on a GeomElem. The return type will be narrowed in subclasses and traits.

Attributes

Definition Classes
override def rotate(rotation: AngleVec): PolygonGen

Rotation 2D geometric transformation on a GeomElem. The return type will be narrowed in subclasses and traits.

Rotation 2D geometric transformation on a GeomElem. The return type will be narrowed in subclasses and traits.

Attributes

Definition Classes
override def rotate180: PolygonGen

Rotation of 180 degrees, 2D geometric transformation on a GeomElem, returns a GeomElem. The return type will be narrowed in subclasses and traits.

Rotation of 180 degrees, 2D geometric transformation on a GeomElem, returns a GeomElem. The return type will be narrowed in subclasses and traits.

Attributes

Definition Classes
override def rotate270: PolygonGen

Rotation positive or anti-clockwise 270 degrees, 2D geometric transformation on a GeomElem, returns a GeomElem. The return type will be narrowed in subclasses and traits.

Rotation positive or anti-clockwise 270 degrees, 2D geometric transformation on a GeomElem, returns a GeomElem. The return type will be narrowed in subclasses and traits.

Attributes

Definition Classes
override def rotate90: PolygonGen

Rotation positive or anti-clockwise 90 degrees, 2D geometric transformation on a GeomElem, returns a GeomElem. The return type will be narrowed in subclasses and traits.

Rotation positive or anti-clockwise 90 degrees, 2D geometric transformation on a GeomElem, returns a GeomElem. The return type will be narrowed in subclasses and traits.

Attributes

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

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

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

Attributes

Definition Classes
override def scaleXY(xOperand: Double, yOperand: Double): PolygonGen

Scaling X and Y axes independently, 2D geometric transformation on this Aff2Elem, returns a new Aff2Elem. This allows different scaling factors across X and Y dimensions. The return type will be narrowed in subclasses and traits. This is an affine transformation, but it is not a similar transformation.

Scaling X and Y axes independently, 2D geometric transformation on this Aff2Elem, returns a new Aff2Elem. This allows different scaling factors across X and Y dimensions. The return type will be narrowed in subclasses and traits. This is an affine transformation, but it is not a similar transformation.

Attributes

Definition Classes
override def sd0Cen: Pt2

The centre or halfway point of side 0 of this polygon. Side 0 starts at the vertex v0 and ends at the vertex v1. This can be thought of as vertex 0.5.

The centre or halfway point of side 0 of this polygon. Side 0 starts at the vertex v0 and ends at the vertex v1. This can be thought of as vertex 0.5.

Attributes

Definition Classes
override def sd0CenX: Double

The X component of the centre or halfway point of side 0 of this polygon.

The X component of the centre or halfway point of side 0 of this polygon.

Attributes

Definition Classes
override def sd0CenY: Double

The Y component of the centre or halfway point of side 0 of this polygon.

The Y component of the centre or halfway point of side 0 of this polygon.

Attributes

Definition Classes
override def shearX(operand: Double): PolygonGen

Shear 2D geometric transformation along the X Axis on a GeomElem. The return type will be narrowed in subclasses and traits. This is an affine transformation, but it is not a similar transformation.

Shear 2D geometric transformation along the X Axis on a GeomElem. The return type will be narrowed in subclasses and traits. This is an affine transformation, but it is not a similar transformation.

Attributes

Definition Classes
override def shearY(operand: Double): PolygonGen

Shear 2D geometric transformation along the Y Axis on a GeomElem. The return type will be narrowed in subclasses and traits. This is an affine transformation, but it is not a similar transformation.

Shear 2D geometric transformation along the Y Axis on a GeomElem. The return type will be narrowed in subclasses and traits. This is an affine transformation, but it is not a similar transformation.

Attributes

Definition Classes
override def side0: LSeg2

Polygon side 0 from vertex 0 to vertex 1.

Polygon side 0 from vertex 0 to vertex 1.

Attributes

Definition Classes
override def sides: LSeg2Arr

Attributes

Definition Classes
override def slate(xOperand: Double, yOperand: Double): PolygonGen

Translate 2D geometric transformation, taking the xOffset and yOffset as parameters on this GeomElem returning a GeomElem. The Return type will be narrowed in sub traits. End users will often want to use the slate method taking a Pt2 or Vec2 as a parameter, the slateX or the slateY methods. These methods will be offered as extension methods using this method for their implementations.

Translate 2D geometric transformation, taking the xOffset and yOffset as parameters on this GeomElem returning a GeomElem. The Return type will be narrowed in sub traits. End users will often want to use the slate method taking a Pt2 or Vec2 as a parameter, the slateX or the slateY methods. These methods will be offered as extension methods using this method for their implementations.

Attributes

Definition Classes
override def slate(operand: VecPt2): PolygonGen

Translate 2D geometric transformation, taking the xOffset and yOffset as parameters on this GeomElem returning a GeomElem. The Return type will be narrowed in sub traits. End users will often want to use the slate method taking a Pt2 or Vec2 as a parameter, the slateX or the slateY methods. These methods will be offered as extension methods using this method for their implementations.

Translate 2D geometric transformation, taking the xOffset and yOffset as parameters on this GeomElem returning a GeomElem. The Return type will be narrowed in sub traits. End users will often want to use the slate method taking a Pt2 or Vec2 as a parameter, the slateX or the slateY methods. These methods will be offered as extension methods using this method for their implementations.

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: Pt2

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: Double

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: Double

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 vLast: Pt2

The last vertex. The default convention places this just anti-clockwise of 12 o'clock.

The last vertex. The default convention places this just anti-clockwise of 12 o'clock.

Attributes

Definition Classes
override def vLastX: Double

Attributes

Definition Classes
override def vLastY: Double

Attributes

Definition Classes
override def vertX(index: Int): Double

Returns the X component of the vertex of the given number. Will throw an exception if the vertex index is out of range.

Returns the X component of the vertex of the given number. Will throw an exception if the vertex index is out of range.

Attributes

Definition Classes
override def vertY(index: Int): Double

Returns the Y component of the vertex of the given number. Will throw an exception if the vertex index is out of range. For maximum efficiency override the implementation in subclasses.

Returns the Y component of the vertex of the given number. Will throw an exception if the vertex index is out of range. For maximum efficiency override the implementation in subclasses.

Attributes

Definition Classes
override def verts: Pt2Arr

Attributes

Definition Classes
def width: Double

Inherited methods

def active(id: AnyRef): PolygonActive

Attributes

Inherited from:
Polygon
def activeChildren(id: AnyRef, children: GraphicElems): PolygonCompound

Attributes

Inherited from:
Polygon
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
override def approx(that: Any, precision: Double): Boolean

Attributes

Definition Classes
Inherited from:
Polygon
def arrTrans(f: Pt2 => Pt2): Array[Double]

Attributes

Inherited from:
Pt2SeqLike

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
protected def arrayNegX: Array[Double]

Attributes

Inherited from:
Pt2SeqSpec
protected def arrayNegY: Array[Double]

Attributes

Inherited from:
Pt2SeqSpec
protected def arrayProlign(matrix: AxlignMatrix): Array[Double]

Attributes

Inherited from:
Pt2SeqSpec
protected def arrayReflect(lineLike: LineLike): Array[Double]

Attributes

Inherited from:
Pt2SeqSpec
protected def arrayRotate(rotation: AngleVec): Array[Double]

Attributes

Inherited from:
Pt2SeqSpec
protected def arrayRotate180: Array[Double]

Attributes

Inherited from:
Pt2SeqSpec
protected def arrayRotate270: Array[Double]

Attributes

Inherited from:
Pt2SeqSpec
protected def arrayRotate90: Array[Double]

Attributes

Inherited from:
Pt2SeqSpec
protected def arrayScale(operand: Double): Array[Double]

Attributes

Inherited from:
Pt2SeqSpec
protected def arrayScaleXY(xOperand: Double, yOperand: Double): Array[Double]

Attributes

Inherited from:
Pt2SeqSpec
protected def arrayShearX(operand: Double): Array[Double]

Attributes

Inherited from:
Pt2SeqSpec
protected def arrayShearY(operand: Double): Array[Double]

Attributes

Inherited from:
Pt2SeqSpec
protected def arraySlate(operand: VecPt2): Array[Double]

Attributes

Inherited from:
Pt2SeqSpec
protected def arraySlateX(xOperand: Double): Array[Double]

Attributes

Inherited from:
Pt2SeqSpec
protected def arraySlateXY(xOperand: Double, yOperand: Double): Array[Double]

Attributes

Inherited from:
Pt2SeqSpec
protected def arraySlateY(yOperand: Double): Array[Double]

Attributes

Inherited from:
Pt2SeqSpec

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

Attributes

Inherited from:
BoundedElem

Attributes

Inherited from:
BoundedElem

Attributes

Inherited from:
BoundedElem
final def boundingCen: Pt2

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

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

Attributes

Inherited from:
BoundedElem
override def boundingHeight: Double

The height of the BoundingRect of this object.

The height of the BoundingRect of this object.

Attributes

Definition Classes
Inherited from:
Polygon
override def boundingRect: Rect

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.

Attributes

Definition Classes
Inherited from:
Polygon
override def boundingWidth: Double

The width of the BoundingRect of this object.

The width of the BoundingRect of this object.

Attributes

Definition Classes
Inherited from:
Polygon

Attributes

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.

Attributes

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.

Attributes

Inherited from:
Polygon
def cenVec: Vec2

Attributes

Inherited from:
Polygon
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
def drawActive(lineColour: Colour, lineWidth: Double, pointerID: Any): PolygonCompound

Attributes

Inherited from:
Polygon
def dropVert(v: Int): Polygon

Attributes

Inherited from:
Polygon
final override def elem(index: Int): Pt2

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: Pt2, a2: Pt2): 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 elemFromDbls(d1: Double, d2: Double): Pt2

Constructs a Dbl2Elem from 2 Doubles.

Constructs a Dbl2Elem from 2 Doubles.

Attributes

Definition Classes
Inherited from:
Pt2SeqSpec
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
final override def fElemStr: Pt2 => String

String for element, can be overridden.

String for element, can be overridden.

Attributes

Definition Classes
Inherited from:
Pt2SeqLike
def fillActive(fillColour: Colour, pointerID: Any): PolygonCompound

Attributes

Inherited from:
Polygon
def fillActiveDraw(fillColour: Colour, pointerID: Any, 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.

Attributes

Inherited from:
Polygon
def fillActiveDrawText(fillColour: Colour, pointerID: Any, str: String, fontSize: Double, lineWidth: Double, lineColour: Colour, textColour: Colour, align: TextAlign): PolygonCompound

Attributes

Inherited from:
Polygon
override def fillActiveText(fillColour: Colour, pointerEv: Any, str: String, fontRatio: Double, fontColour: Colour, align: TextAlign, baseLine: BaseLine, minSize: Double): PolygonCompound

ShapeCompound graphic with a FillFacet, a TextFacet and a ShapeActive child.

ShapeCompound graphic with a FillFacet, a TextFacet and a ShapeActive child.

Attributes

Definition Classes
Inherited from:
Polygon
def fillActiveTextAbs(fillColour: Colour, pointerEv: Any, str: String, fontSize: Double, fontColour: Colour, align: TextAlign): PolygonCompound

Returns compound polygon graphic with fill, active and Text members. The element parameters being entered in name order.

Returns compound polygon graphic with fill, active and Text members. The element parameters being entered in name order.

Attributes

Inherited from:
Polygon
def fillActiveTextlign(fillColour: Colour, pointerEv: Any, str: String, fontSize: Double, fontColour: Colour, align: TextAlign): PolygonCompound

Attributes

Inherited from:
Polygon
override def fillDraw(fillColour: Colour, lineColour: Colour, lineWidth: Double): PolygonCompound

Graphically fill and draws this object.

Graphically fill and draws this object.

Attributes

Definition Classes
Inherited from:
Polygon
def fillDrawText(fillColour: Colour, str: String, fontSize: Double, lineColour: Colour, lineWidth: Double): PolygonCompound

Attributes

Inherited from:
Polygon
override def fillInt(intValue: Int): PolygonFill

Returns a fill graphic of this geometric object from the Int RGBA value.

Returns a fill graphic of this geometric object from the Int RGBA value.

Attributes

Definition Classes
Inherited from:
Polygon
def fillOrDraw(lineWidth: Double, colour: Colour): Graphic2Elem

If this element is Fillable applies the fill method, ignoring the line width parameter, else applies the draw method.

If this element is Fillable applies the fill method, ignoring the line width parameter, else applies the draw method.

Attributes

Inherited from:
Drawable
def fillTextAbs(fillColour: Colour, str: String, fontSize: Double, textColour: Colour, layer: Int): PolygonCompound

Returns compound polygon graphic with fill and Text members. The element parameters being entered in name order.

Returns compound polygon graphic with fill and Text members. The element parameters being entered in name order.

Attributes

Inherited from:
Polygon
def flatMap[B <: ValueNElem, BB <: PolygonBase[B]](f: Pt2 => 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, Pt2) => B): B

foldLeft over the specifying sequence.

foldLeft over the specifying sequence.

Attributes

Inherited from:
SeqSpec
override def foreach[U](f: Pt2 => 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, Pt2) => 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, Pt2) => 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 inRect(ratio: Double): Rect

Attributes

Inherited from:
Polygon
def inRectFrom(startCen: Pt2, ratio: Double): Rect

Approximation for an inner rectangle given a starting centre.

Approximation for an inner rectangle given a starting centre.

Attributes

Inherited from:
Polygon
def innerForeach[U](f: Pt2 => 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 insVertDbls(insertionPoint: Int, newPts: Double*): Polygon

Insert vertices as Doubles before the specified insertion vertex.

Insert vertices as Doubles before the specified insertion vertex.

Attributes

Inherited from:
Polygon
def last: Pt2

Last element of the specifying sequence.

Last element of the specifying sequence.

Attributes

Inherited from:
SeqSpec
def map[B <: ValueNElem, BB <: PolygonBase[B]](f: Pt2 => 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: Pt2 => 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: Pt2 => Pt2): 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
def optMap[B <: ValueNElem, BB <: PolygonBase[B]](f: Pt2 => 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

The SVG points attributes for this polygon.

The SVG points attributes for this polygon.

Attributes

Inherited from:
Polygon

Attributes

Inherited from:
Polygon
def ptInside(pt: Pt2): Boolean

Determines if the parameter point lies inside this Polygon.

Determines if the parameter point lies inside this Polygon.

Attributes

Inherited from:
Polygon
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: Pt2 => 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: Pt2): 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: 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.

Attributes

Inherited from:
SeqLikeBacked
override def side(index: Int): LSeg2

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
Inherited from:
Polygon
def sidesFold[A](init: A)(f: (A, LSeg2) => A): A

Attributes

Inherited from:
Polygon
override def sidesForeach[U](f: LSeg2 => U): Unit

Attributes

Definition Classes
Inherited from:
Polygon
def sidesMap[A, AA <: Arr[A]](f: LSeg2 => A)(implicit build: BuilderArrMap[A, AA]): AA

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

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

Attributes

Inherited from:
Polygon
override def slateX(xOperand: Double): ThisT

Translate 2D geometric transformation in the X dimension, returning a GeomElem. The Return type will be narrowed in sub traits.

Translate 2D geometric transformation in the X dimension, returning a GeomElem. The Return type will be narrowed in sub traits.

Attributes

Definition Classes
Inherited from:
ProlignPreserve
override def slateY(yOperand: Double): ThisT

Translate 2D geometric transformation in the Y dimension, returning a GeomElem. The Return type will be narrowed in sub traits.

Translate 2D geometric transformation in the Y dimension, returning a GeomElem. The Return type will be narrowed in sub traits.

Attributes

Definition Classes
Inherited from:
ProlignPreserve
def sline(index: Int): LSeg2

Attributes

Inherited from:
Polygon
def tailFold[B](initial: B)(f: (B, Pt2) => 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: Pt2 => 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
def textSized(str: String, colour: Colour): TextFixed

Text centred and sized from the bounding rectangle.

Text centred and sized from the bounding rectangle.

Attributes

Inherited from:
Polygon

Attributes

Inherited from:
BoundedElem
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
final def unsafeVert(rawIndex: Int): Pt2

Returns the vertex of the given index. Throws if the index is out of range, if it less than 1 or greater than the number of vertices.

Returns the vertex of the given index. Throws if the index is out of range, if it less than 1 or greater than the number of vertices.

Attributes

Inherited from:
Polygon
def vert(vertNum: Int): Pt2

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
override def vertsForeach[U](f: Pt2 => 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

Definition Classes
Inherited from:
PolygonValueN
override def vertsMap[B, ArrB <: Arr[B]](f: Pt2 => B)(implicit build: 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 from:
Polygon

Checks this polygon has at least 3 vertices.

Checks this polygon has at least 3 vertices.

Attributes

Inherited from:
PolygonBase

Increase the number of vertices and LSeg2s by breaking up the LSeg2s into parts.

Increase the number of vertices and LSeg2s by breaking up the LSeg2s into parts.

Attributes

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

Attributes

Inherited from:
Pt2SeqSpec

Attributes

Inherited from:
Pt2SeqSpec

Concrete fields