package geom
I chose the package name to not clash with "geometry" that may be use in other libraries This package contains Basic geometry. A number of implementation Value classes of the Int and Double product classes defined in ostrat. 2d graphical objects for generalised use. They are of particular use for the generic canvas based classes defined in pCanv but can be used in any display framework and for printing.
- Alphabetic
- By Inheritance
- geom
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final class Angle extends AnyVal with AngleLike
Angle value class.
Angle value class. Its particularly important not to use this class to represent Latitudes as the Angle class has a normal range +- 180 degrees, while Latitudes have a normal range +- 90 degrees.
- trait AngleLike extends Any
Base trait for Angle, Latitude and Longitude.
Base trait for Angle, Latitude and Longitude. Not sure if this is a good idea.
- case class Arc(xStart: Double, yStart: Double, xCen: Double, yCen: Double, xEnd: Double, yEnd: Double, zOrder: Int = 0) extends ArcLike with Product with Serializable
Currently the Arc class doesn't define direction of the Arc.
Currently the Arc class doesn't define direction of the Arc. I think this needs modification.
- case class ArcDraw(xStart: Double, yStart: Double, xCen: Double, yCen: Double, xEnd: Double, yEnd: Double, lineWidth: Double, colour: Colour, zOrder: Int) extends PaintElem with ArcLike with Product with Serializable
A functional paint element to Draw an Arc.
A functional paint element to Draw an Arc. Defined by the arc, the line width, the colour and the zOrder.
- trait ArcLike extends CurveLike
Super trait to Arc and ArcDraw and Arc fill which has not been implemented yet.
- class Bezier extends BezierLike
Cubic bezier curve.
- case class BezierDraw(xStart: Double, yStart: Double, xC1: Double, yC1: Double, xC2: Double, yC2: Double, xEnd: Double, yEnd: Double, lineWidth: Double, colour: Colour, zOrder: Int = 0) extends PaintElem with BezierLike with Product with Serializable
Functional class for Drawing a cubic Bezier curve.
- trait BezierLike extends CurveLike
Super trait for a (cubic) Bezier and BezierDraw
- case class BoundingRect(minX: Double, maxX: Double, minY: Double, maxY: Double) extends Product with Serializable
An intermediate class for describing the vertical / horisontal bounding rectangle for a Polygon or Shape.
An intermediate class for describing the vertical / horisontal bounding rectangle for a Polygon or Shape. Defined by 4 Double values.
- type CanvO = GraphicElem
Hopefully this existential syntax baggage will be gone in dotty
- trait CurveEndingDist extends AnyRef
A base trait for CurveSegDist and CurveDist and their associated GraphicElemsDist (these haven't been implemented yet).
- trait CurveLike extends CurveSegLike
Sub traits include Line, LineDraw, Arc, ArcDraw, Bezier, BezierDraw
- trait CurveLikePaintElem extends CurveLike with PaintElem
- case class CurveSeg(iMatch: Double, xC1: Double, yC1: Double, xUses: Double, yUses: Double, xEnd: Double, yEnd: Double) extends ProdDbl7 with CurveSegLike with Product with Serializable
A CurveSeg can be a line segment or an arc segment or a bezier segment.
A CurveSeg can be a line segment or an arc segment or a bezier segment. It takes its start point from the pEnd of the previous segment. There is no CurveSeg companion object as the LineSeg, ArcSeg and BezierSeg all have their own factory object apply methods.
- class CurveSegDist extends ProdDbl7 with CurveEndingDist
- final class CurveSegDists extends AnyVal with ArrProdDbl7[CurveSegDist]
- trait CurveSegLike extends Transer
The base trait for CurveSeg and Curve and their associated GraphicElems
- final class DPolygon extends AnyVal with ArrProdDbl2[Dist2]
- case class DashedLineDraw(xStart: Double, yStart: Double, xEnd: Double, yEnd: Double, lineWidth: Double, colour: Colour, dashArr: Array[Double]) extends CurveLikePaintElem with Product with Serializable
- case class DisplayRowGraphicSubject(margin: Double, subjs: Arr[GraphicSubject]) extends Product with Serializable
Creates a row of GraphicSubject.
Creates a row of GraphicSubject. Not sure about the usefulness of this specific class, or its implementation
- final class Dist extends AnyVal with Ordered[Dist]
Distance in metres
- class Dist2 extends ProdDbl2
2 dimensional vector using metres as units rather than pure numbers.
- final class Dist2s extends AnyVal with ArrProdDbl2[Dist2]
- final class Dist3 extends ProdDbl3
3 dimensional vector using metres as units rather than pure numbers.
- final class Dist3s extends AnyVal with ArrProdDbl3[Dist3]
Collection class for Dist3s.
Collection class for Dist3s. Not clear if this a Polygon equivalent or a Vec3s equivalent
- implicit class DistImplicit extends AnyRef
- implicit class DoubleImplicit extends AnyRef
- class DoubleImplicitGeom extends AnyRef
- case class GlobedAll(d2s: Dist2s) extends GlobedArea with Product with Serializable
- sealed trait GlobedArea extends AnyRef
represents a polygon on a globe's (eg the Earth) surface.
represents a polygon on a globe's (eg the Earth) surface. If all the points are visible returns a straight line polygon. If none are visible it returns a none, the polygon is over the horizon. If some are visible inserts curves along horizon.
- case class GlobedSome(segs: CurveSegDists) extends GlobedArea with Product with Serializable
- trait GraphicActive extends AnyRef
The base trait for all objects that can have mouse / touch pad interaction.
- trait GraphicElem extends Transer
The base trait for all objects on a canvas / panel.
The base trait for all objects on a canvas / panel. The objects are re-composed for each frame. The Canvas objects must be re-composed each time there is a change within the application state or the user view of that application state.
- type GraphicElems = ArraySeq[GraphicElem]
- trait GraphicSubject extends GraphicElem with GraphicActive
This is an active visual canvas object.
This is an active visual canvas object. A pointable polygon / shape with visual, that also knows how much display space it needs and preferred margin space. Not sure about the name. not sure if the trait is useful.
- class IntGeomImplicit extends AnyRef
- class LatLong extends LatLongBase with ProdDbl2
longitude and latitude measured in radians for the earth.
longitude and latitude measured in radians for the earth. "ll" and "LL" will be used as an abbreviation for LatLong in method names.
- trait LatLongBase extends AnyRef
- case class LatLongLine(latStart: Double, longStart: Double, lat2: Double, long2: Double) extends Product with Serializable
- final class LatLongs extends AnyVal with ArrProdDbl2[LatLong]
- final class Latitude extends AnyVal with AngleLike
- class Line2 extends ProdDbl4 with CurveLike
In geometry this is a line segment.
In geometry this is a line segment. But in this library a seg refers to shape segemnt with out its start (pt1) point
- final class Line2s extends AnyVal with ArrProdDbl4[Line2] with Transer
Array[Double based collection class for Line2s
- case class Line3(xStart: Double, yStart: Double, zStart: Double, xEnd: Double, yEnd: Double, zEnd: Double) extends ProdDbl6 with Product with Serializable
In geometry this is a 3 dimensional line segment.
In geometry this is a 3 dimensional line segment. A straight line between two points.
- class LineDist2 extends AnyRef
A 2 dimensional line segment measured in metres.
A 2 dimensional line segment measured in metres. A straight line between two points on a 2 dimensional flat surface.
- class LineDist3 extends ProdDbl6
3 dimensional line segment measured in metres.
3 dimensional line segment measured in metres. A straight line between two points in 3d.
- case class LineDraw(xStart: Double, yStart: Double, xEnd: Double, yEnd: Double, width: Double, colour: Colour) extends CurveLikePaintElem with Product with Serializable
- final class LinePath extends AnyVal with ArrProdDbl2[Vec2] with Transer with Vec2sLike
Array[Double] based collection class for a LinePath.
Array[Double] based collection class for a LinePath. Conversion to and from the Vec2s class and Polygon class should not entail a runtime cost.
- case class LinePathDraw(path: LinePath, lineWidth: Double, colour: Colour = Black) extends PaintElem with Product with Serializable
- case class LinesDraw(lines: Line2s, lineWidth: Double, colour: Colour = Black) extends PaintElem with Product with Serializable
I think its to better to use the mame lineWidth consistently.
- final case class Longitude(radians: Double) extends AnyVal with AngleLike with Product with Serializable
- implicit class OptionGeomImplicit[A] extends AnyRef
- trait PaintElem extends GraphicElem
- case class PolyActive(poly: Polygon, evObj: AnyRef) extends GraphicElem with PolyActiveTr with Product with Serializable
A pointable polygon without visual
- trait PolyActiveTr extends GraphicActive
An active transparent pointable polygon
- case class PolyDraw(poly: Polygon, lineWidth: Double, colour: Colour = Black) extends PolyElem with Product with Serializable
Immutable Graphic element that defines and draws a Polygon.
- trait PolyElem extends PaintElem
- case class PolyFill(poly: Polygon, colour: Colour) extends PolyElem with Product with Serializable
Immutable Graphic element that defines and fills a Polygon.
- case class PolyFillDraw(poly: Polygon, fillColour: Colour, lineWidth: Double, lineColour: Colour = Black) extends PolyElem with Product with Serializable
Immutable Graphic element that defines, fills and draws a Polygon.
- case class PolyFillDrawText(poly: Polygon, fillColour: Colour, str: String, fontSize: Int = 24, lineWidth: Double = 2, lineColour: Colour = Black) extends PolyElem with Product with Serializable
- case class PolyFillText(poly: Polygon, fillColour: Colour, str: String, fontSize: Int = 24, textColour: Colour = Black) extends PolyElem with Product with Serializable
- case class PolySubj(cen: Vec2, poly: Polygon, evObj: AnyRef, elems: Arr[PaintElem]) extends GraphicSubject with PolyActiveTr with Product with Serializable
- final class Polygon extends AnyVal with Transer with Vec2sLike
A Polygon is encoded as a sequence of plain 2 dimension (mathematical) vectors.
A Polygon is encoded as a sequence of plain 2 dimension (mathematical) vectors. Minimum length 3.. Clockwise is the default
- trait RectGeom extends AnyRef
This trait may need new name and modification
- trait RectMap extends AnyRef
Dubious trait.
Dubious trait. Only known sub trait is TileGrid, used by pGrid.RectGui
- trait RectMapToDist extends RectMap
- class Rectangle extends AnyRef
- class RectangleDims extends AnyRef
- type SSet[A] = SortedSet[A]
- final class Shape extends AnyVal with ArrProdDbl7[CurveSeg] with Transer
Shape is an Array[Double] based collection for a sequence of CurveSegs, similar to a Polygon which is an Array[Double based collection of just LineSegs.
Shape is an Array[Double] based collection for a sequence of CurveSegs, similar to a Polygon which is an Array[Double based collection of just LineSegs. It Uses 6 Doubles for each CurveSeg. The first Double of each curveSeg is set to Negative Infinity for a LineSeg positive infinity for an ArcSeg, but represents the x component of the first control point for a BezierSeg.
- case class ShapeActive(shape: Shape, evObj: AnyRef, zOrder: Int = 0) extends GraphicElem with ShapeActiveTr with Product with Serializable
A pointable shape without visual
- trait ShapeActiveTr extends GraphicActive
A pointable shape
- case class ShapeCentred(cen: Vec2, segs: Shape) extends Transer with Product with Serializable
So there is a lack of clarity over whether the segs are relative to the cen, and if the cen is needed at all.
- case class ShapeDraw(segs: Shape, lineWidth: Double, colour: Colour = Black, zOrder: Int = 0) extends ShapeElem with Product with Serializable
- trait ShapeElem extends PaintElem
- case class ShapeFill(segs: Shape, colour: Colour, zOrder: Int = 0) extends ShapeElem with Product with Serializable
- case class ShapeFillDraw(segs: Shape, fillColour: Colour, lineWidth: Double, lineColour: Colour = Black, zOrder: Int = 0) extends ShapeElem with Product with Serializable
- case class ShapeSubj(cen: Vec2, shape: Shape, evObj: AnyRef, elems: Arr[PaintElem]) extends GraphicSubject with ShapeActiveTr with Product with Serializable
- implicit class StringImplictGeom extends AnyRef
- sealed trait TextAlign extends AnyRef
- case class TextGraphic(str: String, fontSize: Int = 24, posn: Vec2 = Vec2Z, colour: Colour = Black, align: TextAlign = CenAlign, zOrder: Int = 0) extends PaintElem with Product with Serializable
A Graphical display of Text.
A Graphical display of Text.
- posn
The point to orient from. By default this Vec2 defines the centre but from right or left depending on alignment.
- case class TextOutline(posn: Vec2, str: String, fontSize: Int, colour: Colour, lineWidth: Double, align: TextAlign = CenAlign, zOrder: Int = 0) extends PaintElem with Product with Serializable
- trait Trans[T] extends AnyRef
The typeclass trait for transforming an object in 2d geometry.
- trait TransDist[T] extends AnyRef
The typeclass trait for transforming an object in 2d geometry.
- trait TransDistExtension[T] extends TransGenExtension[T]
The object can be transformed in 2 dimensional Distance space.
The object can be transformed in 2 dimensional Distance space. Leaf classes must implement the single method fTrans(f: Dist2 => Dist2): T The related trait TranExtension does the same for trans(f: Vec2 => Vec2): T.
- trait TransDister extends Any
Trait for objects that can be transformed in 2 dimensional distance space.
- class TransExtension[T] extends TransGenExtension[T]
Extension methods for an object that can transform itself in 2d geometry via the function f: Vec2 => Vec2.
Extension methods for an object that can transform itself in 2d geometry via the function f: Vec2 => Vec2. There is an implicit conversion of any object that has a Trans instance. Trans instances are founded on objects that inherit the Transer trait. Eg Polygon inherits from Transer. There is a Trans[Polygon]instance and a Trans[List[Polygon]] instance. The TransDistExtension class provides similar extension methods for objects that can perform the Dist2 => Dist2 transformation.
- trait TransGenExtension[T] extends Any
This is the base trait for TransExtension[T] and TransDistExtension.
This is the base trait for TransExtension[T] and TransDistExtension. An object that can transform itself in a 2d geometry. This is a key trait, the object can be transformed in 2 dimensional space. Leaf classes must implement the single method fTrans(f: VT => VT): T.
- trait Transer extends Any
An object that can transform itself in 2d geometry.
An object that can transform itself in 2d geometry. This is a key trait, the object can be transformed in 2 dimensional space. Leaf classes must implement the single method fTrans(f: Vec2 => Vec2): T. The related trait TransDistable does the same for fTrans(f: Dist2 => Dist2): T.
- trait UnFilled extends AnyRef
- trait UnScaled extends Transer
A Geometrical object or shape that has not been scaled.
A Geometrical object or shape that has not been scaled. That has its iconic scale. An object centred on x = , y = 0, all the object is between x = +- 0.5 and y = +- 0.5
- trait UnScaledGraphicElem extends GraphicElem
This is a display object that has a fixed size and alignment.
This is a display object that has a fixed size and alignment. The object itself should not scale or rotate. Hence transformations are applied to its reference point. This is for objects on a map as opposed to objects that are part of the map.
- trait UnScaledPolygon extends UnScaled
This is not a Polygon but should fTrans to Polygon.
- trait UnScaledPolygonYMirror extends UnScaledPolygon
- case class UnScaledShape(referenceVec: Vec2, relShape: Shape, evObj: AnyRef, elems: Arr[PaintElem], zOrder: Int = 0) extends UnScaledGraphicElem with ShapeActiveTr with Product with Serializable
This is a shape that has a fixed size and alignment.
This is a shape that has a fixed size and alignment. Hence transformations are applied to its reference point.
- trait Val1Vec2s[Val1T] extends ValsVec2s
- trait Val2Vec2s[Val1T, Val2T] extends ValsVec2s
- trait Val3Vec2s[Val1T, Val2T, Val3T] extends ValsVec2s
- trait ValsVec2s extends Any
Not sure how useful these classes are in the immediate as when used in a collection they will box, undermining the benefits of using an Array
- final class Vec2 extends ProdDbl2
A 2 dimensional vector, can be used to represent 2 dimensional points and translations of 2 dimensional points.
A 2 dimensional vector, can be used to represent 2 dimensional points and translations of 2 dimensional points. Thanks to Rene Descarte this was a great idea.
- final class Vec2s extends AnyVal with Transer with Vec2sLike
Array[Double] based collection class for Vec2s.
Array[Double] based collection class for Vec2s. Use Polygon or LinePath to represent those structures. Conversion to and from Polygon class and LinePath class should not entail a runtime cost.
- final class Vec2sBuff extends AnyVal with BuffProdDbl2[Vec2]
- trait Vec2sLike extends ArrProdDbl2[Vec2]
Not sure the helpfulness of this trait.
- final class Vec3 extends ProdDbl3
A 3 dimensional vector, can be used to represent 3 dimensional points and translations of 3 dimensional points.
A 3 dimensional vector, can be used to represent 3 dimensional points and translations of 3 dimensional points. Right-handed coordinate system is the default
Value Members
- val Dist2Z: Dist2
Dist2(0.km, 0.km) constant
- val EarthAvDiameter: Dist
- val EarthAvRadius: Dist
- val EarthEquatorialRadius: Dist
- val EarthPolarRadius: Dist
- val LatLong0: LatLong
- val LongD: Double
- implicit def TransToExtension[T](value: T)(implicit ev: Trans[T]): TransExtension[T]
- val Vec2Z: Vec2
Vec2(x = 0, y = 0) constant
- val cos30: Double
- def deg0: Angle
0 degrees or 0 radians
- val deg120: Angle
120 degrees anti-clockwise or + 2 * Pi/3 radians
- val deg135: Angle
135 degrees anti-clockwise or + 3 * Pi/4 radians
- val deg150: Angle
150 degrees anti-clockwise or + 5 * Pi/6 radians
- def deg180: Angle
180 degrees or Pi radians
- val deg30: Angle
30 degrees anti-clockwise or + Pi/6 radians
- val deg36: Angle
36 degrees anti-clockwise or + Pi/5 radians
- val deg45: Angle
45 degrees anti-clockwise or + Pi/4 radians
- val deg60: Angle
60 degrees anti-clockwise or + Pi/3 radians
- val deg72: Angle
72 degrees anti-clockwise or + Pi2/5 radians
- val deg90: Angle
90 degrees anti-clockwise or + Pi/2 radians
- implicit def doubleToImplicitGeom(thisDouble: Double): DoubleImplicitGeom
- implicit def intToImplicitGeom(thisInt: Int): IntGeomImplicit
- implicit def noScaleTransExtension[T <: UnScaled](value: T)(implicit ev: Trans[geom.noScaleTransExtension.T.TranserT]): TransExtension[geom.noScaleTransExtension.T.TranserT]
- object Angle
Angle Companion object.
- object Arc extends Serializable
The companion object for the Arc class.
- object ArcDraw extends Serializable
The companion object for the ArcDraw class
- object ArcSeg
This provides factory methods to create an ArcSeg.
This provides factory methods to create an ArcSeg. There is no independent ArcSeg class. This is one of 3 factory objects to CurveSeg.
- object ArcSegDist
- object Arrow
- object Bezier
- object BezierDraw extends Serializable
Companion object for the BezierDraw class.
- object BezierSeg
This provides factory methods to create a BezierSeg.
This provides factory methods to create a BezierSeg. There is no independent BezierSeg class. This is one of 3 factory objects to CurveSeg.
- object CenAlign extends TextAlign with Product with Serializable
- object Circle
This object provides factory methods for circles.
- object CurveSegDists extends ProdDbl7sCompanion[CurveSegDist, CurveSegDists]
- object DPolygon extends ProdDbl2sCompanion[Dist2, DPolygon]
The companion object for DPolygon.
The companion object for DPolygon. Provides an implicit builder.
- object DashedLineDraw extends Serializable
- object Diamond
- object Dist
- object Dist2
- object Dist2s extends ProdDbl2sCompanion[Dist2, Dist2s]
- object Dist3
Companion object for the Dist3 class.
- object Dist3s
- object Equilateral
- object GlobedNone extends GlobedArea with Product with Serializable
- object GraphicActive
- object HLine
- object LatLong
- object LatLongLine extends Serializable
- object LatLongs extends ProdDbl2sCompanion[LatLong, LatLongs]
- object Latitude
- object LeftAlign extends TextAlign with Product with Serializable
- object Line2
Companion object for the Line2 class
- object Line2s extends ProdDbl4sCompanion[Line2, Line2s]
Companion object for the Lines class
- object Line3 extends Serializable
- object LineDist2
- object LineDist3
- object LineDraw extends Serializable
- object LinePath extends ProdDbl2sCompanion[Vec2, LinePath]
- object LineSeg
This provides factory methods to create a LineSeg.
This provides factory methods to create a LineSeg. There is no independent LineSeg class. This is one of 3 factory objects to CurveSeg.
- object LineSegDist
- object LinesDraw extends Serializable
- object Longitude extends Serializable
- object PolyDraw extends Serializable
- object PolyFill extends Serializable
- object PolyFillDraw extends Serializable
- object PolyFillDrawText extends Serializable
- object PolySubj extends Serializable
- object Polygon
- object Rectangle
This perhaps should be changed to Rectangle.
This perhaps should be changed to Rectangle. Some methods need renaming or possibly even deleting
- object RightAlign extends TextAlign with Product with Serializable
- object Shape extends ProdDbl7sCompanion[CurveSeg, Shape]
- object ShapeSubj extends Serializable
- object Square extends UnScaledPolygon
Factory object for squares.
Factory object for squares. There is no companion Square class.
- object Star5
- object TextGraphic extends Serializable
- object TextGraphicCen
Not sure if this is a good object to have.
- object Trans
The companion object for the Trans[T] typeclass, containing instances for common classes.
- object TransDist
The companion object for the TransDist typeclass, containing instances for common classes.
- object TransDister
The companion object for Transer.
- object Trapezium
Probably worth keeping
- object TrapezoidIsosceles
- object Triangle
- object UnScaledShape extends Serializable
- object VLine
- object Vec2
- object Vec2s extends ProdDbl2sCompanion[Vec2, Vec2s]
- object Vec3