# BGRABitmap Geometry types

Here are all the basic geometry types used in BGRABitmap library. They are provided by BGRABitmapTypes unit.

### Geometry types

#### 3D points

 PPoint3D = ^TPoint3D; Pointer to a TPoint3D structure TPoint3D = record Point in 3D with single-precision floating point coordinates procedure Offset(const point3D: TPoint3D); Offsets the point by the given 3D vector procedure Scale(AScale: single); Scale the point (as a vector from the origin) function Point3D(x,y,z: single): TPoint3D; Creates a new structure with values (x, y, z) operator = (const v1,v2: TPoint3D): boolean; inline; Checks if all components x, y and z are equal operator + (const v1,v2: TPoint3D): TPoint3D; inline; Adds components separately. It is like adding vectors operator - (const v1,v2: TPoint3D): TPoint3D; inline; Subtract components separately. It is like subtracting vectors operator - (const v: TPoint3D): TPoint3D; inline; Returns a point with opposite values for all components operator * (const v1,v2: TPoint3D): single; inline; Scalar product: multiplies components and returns the sum operator * (const v1: TPoint3D; const factor: single): TPoint3D; inline; Multiplies components by factor. It scales the vector represented by (x, y, z) operator * (const factor: single; const v1: TPoint3D): TPoint3D; inline; Multiplies components by factor. It scales the vector represented by (x, y, z) procedure VectProduct3D(u,v: TPoint3D; out w: TPoint3D); Computes the vectorial product w. It is perpendicular to both u and v procedure Normalize3D(var v: TPoint3D); inline; Normalize the vector, i.e. scale it so that its length be 1 function VectLen3D(const v: TPoint3D): single; Computes the length of the vector from the origin to the point TFaceCulling = ( Enumerates the modes of face culling in 3D rendering. Face culling is a technique used to determine which faces of a polygon are visible and should be rendered fcNone, No face culling is applied. All faces of the polygon are rendered fcKeepCW, Keeps only the faces that are clockwise (CW) from the viewer's perspective. Typically used to remove back faces when the convention is that CW is for front faces fcKeepCCW); Keeps only the faces that are counter-clockwise (CCW) from the viewer's perspective. Typically used to remove back faces when the convention is that CCW is for front faces

#### Polygon filling

 TPolygonOrder = ( Order of polygons when rendered using TBGRAMultiShapeFiller (in unit BGRAPolygon) poNone, No order, colors are mixed together poFirstOnTop, First polygon is on top poLastOnTop); Last polygon is on top TIntersectionInfo = class Contains an intersection between an horizontal line and any shape. It is used when filling shapes interX: single; Horizontal position of the intersection winding: integer; Winding count numSegment: integer; Number identifying the current segment where the intersection was found procedure SetValues(AInterX: Single; AWinding, ANumSegment: integer); Sets the position and other information about the intersection ArrayOfTIntersectionInfo = array of TIntersectionInfo; An array of intersections between an horizontal line and any shape TBGRACustomFillInfo = class Abstract class defining any shape that can be filled function SegmentsCurved: boolean; virtual; abstract; Returns true if one segment number can represent a curve and thus cannot be considered exactly straight function GetBounds: TRect; virtual; abstract; Returns integer bounds for the shape function IsPointInside(x,y: single; windingMode: boolean): boolean; virtual; abstract; Check if the point is inside the shape function CreateIntersectionArray: ArrayOfTIntersectionInfo; virtual; abstract; Create an array that will contain computed intersections. To augment that array, use CreateIntersectionInfo for new items function CreateIntersectionInfo: TIntersectionInfo; virtual; abstract; Create a structure to define one single intersection procedure FreeIntersectionArray(var inter: ArrayOfTIntersectionInfo); virtual; abstract; Free an array of intersections procedure ComputeAndSort(cury: single; var inter: ArrayOfTIntersectionInfo; out nbInter: integer; windingMode: boolean); virtual; abstract; Fill an array inter with actual intersections with the shape at the y coordinate cury. nbInter receives the number of computed intersections. windingMode specifies if the winding method must be used to determine what is inside of the shape function GetSliceIndex: integer; virtual; abstract; Returns the index of the current slice (horizontal stripe)