| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Eventloop.Module.BasicShapes
- setupBasicShapesModuleConfiguration :: EventloopSetupModuleConfiguration
- basicShapesModuleIdentifier :: EventloopModuleIdentifier
- basicShapesPostProcessor :: PostProcessor
- type GraphicalNumeric = Float
- type Position = Point
- type Width = GraphicalNumeric
- type Height = GraphicalNumeric
- type Dimensions = (Width, Height)
- type Radius = GraphicalNumeric
- type Red = GraphicalNumeric
- type Green = GraphicalNumeric
- type Blue = GraphicalNumeric
- type Alpha = GraphicalNumeric
- type Color = (Red, Green, Blue, Alpha)
- type FillColor = Color
- type StrokeColor = Color
- type StrokeLineThickness = GraphicalNumeric
- type UpperLeft = Point
- type UpperRight = Point
- type LowerLeft = Point
- type LowerRight = Point
- type NumberOfPoints = Int
- type FontFamily = [Char]
- type FontSize = GraphicalNumeric
- data BasicShapesOut = DrawShapes CanvasId [Shape]
- data Shape
- = CompositeShape { }
- | Rectangle { }
- | Circle { }
- | RegularPolygon { }
- | Text { }
- | Line { }
- | MultiLine { }
- | Polygon { }
- data Rotation = Rotation RotatePoint Angle
- data RotatePoint
- data BoundingBox = BoundingBox LowerLeft UpperLeft UpperRight LowerRight
- type CanvasId = NumericId
- data Alignment
- data GeometricPrimitive
- = Points [Point]
- | CircleArea Point Radius
- opOnBoundingBox :: (Point -> Point) -> BoundingBox -> BoundingBox
- allRegularPolygonPoints :: NumberOfPoints -> Point -> Radius -> [Point]
- boundingBoxFromPrimitives :: [GeometricPrimitive] -> BoundingBox
- normalizeBBox :: BoundingBox -> BoundingBox
- roundPoint :: Point -> ScreenPoint
- roundColor :: Color -> ScreenColor
- class ToPrimitives a where
- toPrimitives :: a -> [GeometricPrimitive]
- class ToCenter a where
- class ToPrimitives a => ToBoundingBox a where
- toBoundingBox :: a -> BoundingBox
- class ToBoundingBox a => Overlaps a where
- findRotationPoint :: ToCenter a => a -> Rotation -> Point
- class ToCanvasOut a where
- toCanvasOut :: a -> CanvasOut
- class ToCanvasOperations a where
- toCanvasOperations :: a -> [CanvasOperation]
- toCanvasText :: Shape -> CanvasText
- class ToScreenPathPart a where
- toScreenPathParts :: a -> Maybe ([ScreenPathPart], ScreenStartingPoint)
- toCanvasPathFill :: Shape -> PathFill
- hasCanvasPathFill :: Shape -> Bool
- allScreenPolygonPoints :: Shape -> [Point]
Documentation
type GraphicalNumeric = Float Source
type Width = GraphicalNumeric Source
type Height = GraphicalNumeric Source
type Dimensions = (Width, Height) Source
type Radius = GraphicalNumeric Source
type Red = GraphicalNumeric Source
type Green = GraphicalNumeric Source
type Blue = GraphicalNumeric Source
type Alpha = GraphicalNumeric Source
type StrokeColor = Color Source
type UpperRight = Point Source
type LowerRight = Point Source
type NumberOfPoints = Int Source
type FontFamily = [Char] Source
type FontSize = GraphicalNumeric Source
data BasicShapesOut Source
Constructors
| DrawShapes CanvasId [Shape] |
Constructors
| CompositeShape | Should contain atleast 1 shape. Rotation before Position |
| Rectangle | | Position is upperleftcorner. Position is the corner closes to origin. Visually in canvas, this is top left. In a Cartesian coördinate system, this is bottom left. |
Fields | |
| Circle | | Position is center |
Fields | |
| RegularPolygon | The first point of the regular polygon, always starts in the direction from the x-axis.(Towards x-infinity). Position is the the centre of the regular polygon |
Fields | |
| Text | |
Fields
| |
| Line | |
Fields | |
| MultiLine | |
Fields
| |
| Polygon | |
Fields
| |
Constructors
| Rotation RotatePoint Angle | | Rotation is around a point on the canvas. May be the centre of the boundingbox (enclosing rectangle) or an arbitrary point. Angle is in degrees and counter-clockwise in the coördinate system(from the x-axis to the y-axis) and visually on canvas clock-wise. |
data BoundingBox Source
Constructors
| BoundingBox LowerLeft UpperLeft UpperRight LowerRight | | The point indications are from the perspective of a regular Cartesian coördinate system. |
Opcode: 1500
Constructors
| AlignLeft | Opcode: 1501 |
| AlignRight | Opcode: 1502 |
| AlignCenter | Opcode: 1503 |
data GeometricPrimitive Source
Constructors
| Points [Point] | |
| CircleArea Point Radius |
opOnBoundingBox :: (Point -> Point) -> BoundingBox -> BoundingBox Source
allRegularPolygonPoints :: NumberOfPoints -> Point -> Radius -> [Point] Source
roundPoint :: Point -> ScreenPoint Source
roundColor :: Color -> ScreenColor Source
class ToPrimitives a where Source
Methods
toPrimitives :: a -> [GeometricPrimitive] Source
class ToPrimitives a => ToBoundingBox a where Source
Methods
toBoundingBox :: a -> BoundingBox Source
class ToBoundingBox a => Overlaps a where Source
Minimal complete definition
Nothing
findRotationPoint :: ToCenter a => a -> Rotation -> Point Source
class ToCanvasOperations a where Source
Methods
toCanvasOperations :: a -> [CanvasOperation] Source
Instances
toCanvasText :: Shape -> CanvasText Source
class ToScreenPathPart a where Source
Methods
toScreenPathParts :: a -> Maybe ([ScreenPathPart], ScreenStartingPoint) Source
Instances
toCanvasPathFill :: Shape -> PathFill Source
hasCanvasPathFill :: Shape -> Bool Source
allScreenPolygonPoints :: Shape -> [Point] Source