All Functions and Procedures

Name Unit Description
LineIntersection uLazQuadTreeGeometry

 

LineIntersection uLazQuadTreeGeometry

function LineIntersection checks wether two lines intersects. Parameter: AP0X, AP0Y, AP1X, AP1Y, AP2X, AP2Y, AP3X, AP3Y The 4 points forming the two lines AIX, AIY the coords of the intersection (if found) Result: True if the lines intersect, otherwise False. Source: https://stackoverflow.com/questions/563198/how-do-you-detect-where-two-line-segments-intersect

LineRectInteraction uLazQuadTreeGeometry

 

LineRectInteraction uLazQuadTreeGeometry

function LineRectIntersection will test whether a line intersects or overlap with a rectangle. The rectangle is seen as a solid block and the right and bottom coord is *not* included in rectangles area. Thus if the rectangle is (0,0,100,100) a line (100,-1,100,101) which is overlaying the right border of the rectangle will tested as false. But a line (0,-1,0,101) which is overlaying to the left side is tested as true.

Parameters ALeft, ATop, ARight, ABottom: The coords of the two points forming the rectangle. AP0X, AP0Y, AP1X, AP1Y: The coords forming the two points of the line. Result: One of the TLineRectInteractio values (lriOutSide, lriInside, lriIntersecting) Remark: The used Coordinatesystem is Right bigger Than Left and Bottom bigger than Top! CAUTION: If the line is part of a polygon, the function may may give a false positive result if the right / bottom side of the polygon is touching the left / top side of the rectangle, since the function has no knowledge about the orientation of the segment. The Code is complexer/larger than the function LineRectInteractionSimple, but the performance is 50% faster.

LineRectInteractionSimple uLazQuadTreeGeometry

function LineRectIntersectionSimple is given for curiosity only. It will test whether a line intersects or overlap with a rectangle. Parameters ALeft, ATop, ARight, ABottom: The coords of the two points forming the rectangle. AP0X, AP0Y, AP1X, AP1Y: The coords forming the two points of the line. Result: One of the TLineRectInteractio values (lriOutSide, lriInside, lriIntersecting) Remark: The used Coordinatesystem is Right bigger Than Left and Bottom bigger than Top! CAUTION: The right and bottom border of the rectangle is treated to be part of the rectangle! REMARK: The Code is simpler/smaller than the function LineRectInteraction, but the performance is 35% slower.

NormalizeRectangle uLazQuadTreeGeometry

procedure NormalizeRectangle normalize the passed Rectangle and World rectangle. Parameters Input parameter ARect: The rectangle to be normalized AWorldModel: The world model, flat, cylindric or toroidial AWorldRect: The rectangle with the world borders Output parameters ANormalizedRectangles: An array containing the normalized rectangle(s) ANormalizedWorldRect: The normalized world rectangle Remarks The normalized rectangle has smaller values for top and left and bigger for right and bottom. The world rectangle defines the world, but also the sign of the X- and Y-Axis. The normalization will - ensure that the sign of the X- and Y-Axis is positive, in the meaning of Increasing values while travel to the right and to the bottom - adjust the sign of the borders in coordination with the world rectangle - if nesesarry split the rectangle to fit into the worlds border without overlapping If the world model ist flat, no splitting will occour. If the world model is cylindrical, a split into two rectangles may occour If the world model is toroidial, a split into two or four rectangles may occour

NormatePointToWorld uLazQuadTreeGeometry

procedure NormatePointToWorld will force the point to be valid in the given World. Parameters Inputs AInX, AInY the coordinates to be normated AWorldRect: The rectangle which describes the extensions of the world. AWorldModel : The world model (flat, cylindrical or toroidal) to be used. Outputs AOutX, AOutY the coordinates in the target world Remarks The passed world must be valid. The signs of the axes of the world are used. The right and bottom values of the rectangle equal to the correspondent of the world, are treated as valid in the meaning, that a rectangle may have the same size as the world. But if the values are bigger than this assumption is not longer used! Caution: if AWorldRect is not valid, an exception is thrown.

PointInRectangle uLazQuadTreeGeometry

function PointInRectangle tests whether a point is inside a rectangle on a curved world. It decapsulate the function ARect.ContainsPoint(....). See details there.

PolylineRectangleInterAction uLazQuadTreeGeometry

function PolylineRectangleInterAction will test whether the rectangle and polygon intersects or overlap The function work on regular infinite planes. The sign of X and Y-Axis could be changed Parameters ALeft, ATop, ARight, ABottom: The coords of the two points forming the rectangle. APolyline: vertex points of a polyline or a polygon with V[n]=V[0]. The Polyline is defined by pairs of Double values. The method of passing an untyped reference allows the usage of several datatype like packed records etc. A dynamic Array is passed by referencing the first item The last point of the Polygon must be identical to the first point, to close the polygon. Self-Overlapping of the polygon is *not* allowed APolylinePointCount: The Number of points in the polyline = half the number of doubles passed in APolygon. AFirstValueIsY: If True, the first double value in APolygon is the Y-Value of the coordinate. If False, the first value is the X-Value (default). AXAxisLeftPlus : If True the values of X increasing when going direction left. If False, they increase to the right (default) AYAxisUpPlus : If True the values of Y increasing when going in direction top. If false they decreases (default). AFullInsideCheck: If True the the Result lriInside is valid for the full polygon. In other words, if the Polygon is completely inside the rectangle If False, the Result lriInside might be valid only for the first linesegment and an intersecting may occour later, but is not checked. Result: One of the TLineRectInteractio values (lriOutside, lriInside, lriIntersecting) The meaning is as follows lriOutside : All parts of the polygon are outside of the rectangle lriInside : If AFullInsideCheck is False (default): At least one part of the polygon is located in the rectangle. If AFullInsideCheck is True: All Parts of the polygon are inside the rectangle. lriIntersecting : The polygon intersects with the rectangle (thus, some parts are inside, others outside the rectangle). Remark: To reduce the computation load, the function should only be called, if the bounding rectangle of the Polygon is overlapping the test rectangle. This test is not performed by the function to avoid code duplication.

ReadDoubleFromStream uLazQuadTree

 

ReadIntegerFromStream uLazQuadTree

 

ReadStringFromStream uLazQuadTree

 

RectanglesOverlap uLazQuadTreeGeometry

 

RectanglesOverlap uLazQuadTreeGeometry

function RectanglesOverlap checks whether two rectangles are overlapping and if so which are the common part. Caution: works only for flat (nonwrapping) rectangles parameters ALeft, ATop, ARight, ABottom : The Rectangle A BLeft, BTop, BRight, BBottom : The Rectangle B variable CLeft, CTop, CRight, CBottom : The overlapping Rectangle return value: True if the rectangles overlapping (and the CLeft ...CBottom values are valid) False if the rectangle are not overlapping. Remarks: If parts of the right side of one of the rectangle are identical to parts the left side or top side and bottom side, the rectangles are *not* overlapping!

RectanglesOverlap uLazQuadTreeGeometry

function RectanglesOverlap checks whether two rectangles are overlapping and if so which are the common part. Caution: works only for flat (nonwrapping) rectangles parameters ARect : The Rectangle A BRect : The Rectangle B outout CRect : The overlapping Rectangle return value: True if the rectangles overlapping (and the CRect is valid) False if the rectangle are not overlapping. Remarks: If parts of the right side of one of the rectangle are identical to parts the left side or top side and bottom side, the rectangles are *not* overlapping!

RectanglesOverlapEx uLazQuadTreeGeometry

function RectanglesOverlapEx checks whether two rectangles are overlapping and if so, what kind of overlapping is found and which areas are shared between the two rectangles. The function works on all world models (flat, cylindrical and toroidal) and on all axis orientations. parameters Input ARect, BRect the two rectangles which may overlapping AWorldModel the world model (flat, cylindrical and toroidal) AWorldRect the world definition used for the determination of the axis orientation Output CRectangles an array of rectangles containing the common/shared areas in the orientation of the given world. The array will has always one of the follwing length 0: No overlapping area 1: One overlapping area (all world models) 2: Two overlapping areas (cylindrical and toroidal worlds) 4: Four overlapping areas (toroidal worlds) Remark: The returned areas in the cylindrical and toroidal worlds may wrap around the worlds border. Return value is the TLQTRectOverlapKind type.

RemoveNotAreaRectanglesFromArray uLazQuadTreeGeometry

procedure RemoveNotAreaRectanglesFromArray will remove rectangles from the passed array, if the area is zero.

TransformPoint uLazQuadTreeGeometry

procedure TransformPoint transforms the location of a point in one world to the corresponding location in the other world. Parameters : Inputs AInX, AInY the coordinates in the source world ASourceWorld, ATargetWorld the extension of the two worlds Outputs AOutX, AOutY the coordinates in the target world Remarks : If both worlds are equal the input is copied to the output without any further processing. If not equal the following processing is performed: - If at least one two worlds is empy an exception is thrown. - If one of the worlds in infinite, while the other is not an exception is thrown. Care must be taken if points from a complex world (toroidal, cylindric) transformed into a simpler world (flat). Creating gemometric objects (Rectangles, Polygons) from those transformed points may change the layout dramaticaly.

UnNormalizeRectangles uLazQuadTreeGeometry

procedure UnNormalizeRectangles invertes the process of normalization of the rectangles Parameters Input ANormalizedRectangles: An array containing normalized rectangles (all rectangles must be inside or equal to the normalized word-borders). AUnNormalizedWorldModel: The world model to transformed to AUnNormalizedWorldRect: The borders of the world to be transformed in Output AUnNormalizedRectangles : An array of the transformed, unnormalized rectangles Remarks The input are assumed to be in a flat world with rectangles left, top values smaller than right, bottom values. And also all values laying within the world borders. In a flat world model the signs of the rectangles are adjusted and the result placed into the output rectangle array In a cylindrical world model the input rectangles are merged, if they share the same top and bottom values and having the same values for the left and right edges, vice versa. Additionally the left and right border of the world are treated as identical, thus rectangle who share the east-west-border are combined as well. In a toroidial world model additional to the cylidrical world the top and bottom values of the rectangles are also merged, if fit. This may collapse up to four rectangles in on single bigger rectangle.

WriteDoubleToStream uLazQuadTree

 

WriteIntegerToStream uLazQuadTree

 

WriteStringToStream uLazQuadTree

 


Generated by PasDoc 0.16.0.