From 1f58db7da35869751bf70d6070b8b5f60d0b47e3 Mon Sep 17 00:00:00 2001 From: Merlijn Wajer Date: Thu, 9 Sep 2010 17:53:07 +0200 Subject: [PATCH] More Documentation additions --- Doc/sphinx/referencescript.rst | 2 + Doc/sphinx/scriptref/string.rst | 247 ++++++++++++ Doc/sphinx/scriptref/tpa.rst | 678 ++++++++++++++++++++++++++++++++ 3 files changed, 927 insertions(+) create mode 100644 Doc/sphinx/scriptref/string.rst create mode 100644 Doc/sphinx/scriptref/tpa.rst diff --git a/Doc/sphinx/referencescript.rst b/Doc/sphinx/referencescript.rst index 8e9095c..402e5dd 100644 --- a/Doc/sphinx/referencescript.rst +++ b/Doc/sphinx/referencescript.rst @@ -19,3 +19,5 @@ default (Pascal) engine. scriptref/window.rst scriptref/web.rst scriptref/bitmaps.rst + scriptref/string.rst + scriptref/tpa.rst diff --git a/Doc/sphinx/scriptref/string.rst b/Doc/sphinx/scriptref/string.rst new file mode 100644 index 0000000..9fbb140 --- /dev/null +++ b/Doc/sphinx/scriptref/string.rst @@ -0,0 +1,247 @@ + +.. _scriptref_string: + +String Functions +================ + +Capitalize +---------- + +.. code-block:: pascal + + function Capitalize(str : string) : string; + + +CompressString +-------------- + +.. code-block:: pascal + + function CompressString(const Str : string) : string; + + +DecompressString +---------------- + +.. code-block:: pascal + + function DecompressString(const Compressed : string) : string; + + +Base64Encode +------------ + +.. code-block:: pascal + + function Base64Encode(const str : string) : string; + + +Base64Decode +------------ + +.. code-block:: pascal + + function Base64Decode(const str : string) : string; + + +Format +------ + +.. code-block:: pascal + + function Format(const fmt : string;const args : array of const) : string; + + +ToStr +----- + +.. code-block:: pascal + + function ToStr(x) : string; + + +Between +------- + +.. code-block:: pascal + + function Between(s1, s2, str: string): string; + + +IntToStr +-------- + +.. code-block:: pascal + + function IntToStr(value: Integer): String; + + +FloatToStr +---------- + +.. code-block:: pascal + + function FloatToStr(value: Extended): String; + + +BoolToStr +--------- + +.. code-block:: pascal + + function BoolToStr(value: Boolean): String; + + +StrToInt +-------- + +.. code-block:: pascal + + function StrToInt(value: String): Integer; + + +StrToIntDef +----------- + +.. code-block:: pascal + + function StrToIntDef(value: String; default: Integer): Integer; + + +StrToFloat +---------- + +.. code-block:: pascal + + function StrToFloat(value: String): Extended; + + +StrToFloatDef +------------- + +.. code-block:: pascal + + function StrToFloatDef(value: String; default: Extended): Extended; + + +StrToBool +--------- + +.. code-block:: pascal + + function StrToBool(value: String): Boolean; + + +StrToBoolDef +------------ + +.. code-block:: pascal + + function StrToBoolDef(value: String; default: Boolean): Boolean; + + +ExtractFromStr +-------------- + +.. code-block:: pascal + + function ExtractFromStr( Str : string; Extract : StrExtr) : string; + + +Replace +------- + +.. code-block:: pascal + + function Replace(Text, FindStr, ReplaceStr: string; Flags: TReplaceFlags): string; + + +ReplaceWrap +----------- + +.. code-block:: pascal + + function ReplaceWrap(Text, FindStr, ReplaceStr: string; Flags: TReplaceFlags): string; + + +Implode +------- + +.. code-block:: pascal + + function Implode(Glue: string; Pieces: TStringArray): string; + + +Explode +------- + +.. code-block:: pascal + + function Explode(del, str: string): TStringArray; + + +ExplodeWrap +----------- + +.. code-block:: pascal + + procedure ExplodeWrap(del, str: string; var res : TStringArray); + + +Padl +---- + +.. code-block:: pascal + + function Padl(s: String; i: longInt): String; + + +Padz +---- + +.. code-block:: pascal + + function Padz(s: String; i: longInt): String; + + +Padr +---- + +.. code-block:: pascal + + function Padr(s: String; i: longInt): String; + + +ExecRegExpr +----------- + +.. code-block:: pascal + + function ExecRegExpr( const RegExpr, InputStr : String) : boolean; + + +SplitRegExpr +------------ + +.. code-block:: pascal + + procedure SplitRegExpr( const RegExpr, InputStr : String; Pieces : TStrings); + + +ReplaceRegExpr +-------------- + +.. code-block:: pascal + + function ReplaceRegExpr( const RegExpr, InputStr, ReplaceStr : String; UseSubstitution : boolean) : String; + + +PosEx +----- + +.. code-block:: pascal + + function PosEx(needle, haystack: String; offset: integer): integer;'); + + + diff --git a/Doc/sphinx/scriptref/tpa.rst b/Doc/sphinx/scriptref/tpa.rst new file mode 100644 index 0000000..271ee2e --- /dev/null +++ b/Doc/sphinx/scriptref/tpa.rst @@ -0,0 +1,678 @@ + +.. _scriptref_tpa: + +TPointArray Functions +===================== + +Quicksort +--------- + +.. code-block:: pascal + + procedure Quicksort(var Arr : TIntegerArray); + + +tSwap +----- + +.. code-block:: pascal + + procedure tSwap(var a, b: TPoint); + + +tpaSwap +------- + +.. code-block:: pascal + + procedure tpaSwap(var a, b: TPointArray); + + +SwapE +----- + +.. code-block:: pascal + + procedure SwapE(var a, b: Extended); + + +RAaSTPAEx +--------- + +.. code-block:: pascal + + procedure RAaSTPAEx(var a: TPointArray; const w, h: Integer); + + +RAaSTPA +------- + +.. code-block:: pascal + + procedure RAaSTPA(var a: TPointArray; const Dist: Integer); + + +NearbyPointInArrayEx +-------------------- + +.. code-block:: pascal + + function NearbyPointInArrayEx(const P: TPoint; w, h:Integer;const a: TPointArray): Boolean; + + +NearbyPointInArray +------------------ + +.. code-block:: pascal + + function NearbyPointInArray(const P: TPoint; Dist:Integer;const a: TPointArray): Boolean; + + +QuickTPASort +------------ + +.. code-block:: pascal + + procedure QuickTPASort(var A: TIntegerArray; var B: TPointArray; iLo, iHi: Integer; SortUp: Boolean); + + +QuickATPASort +------------- + +.. code-block:: pascal + + procedure QuickATPASort(var A: TIntegerArray; var B: T2DPointArray; iLo, iHi: Integer; SortUp: Boolean); + + +SortTPAFrom +----------- + +.. code-block:: pascal + + procedure SortTPAFrom(var a: TPointArray; const From: TPoint); + + +SortATPAFrom +------------ + +.. code-block:: pascal + + procedure SortATPAFrom(var a: T2DPointArray; const From: TPoint); + + +SortATPAFromFirstPoint +---------------------- + +.. code-block:: pascal + + procedure SortATPAFromFirstPoint(var a: T2DPointArray; const From: TPoint); + + +InvertTPA +--------- + +.. code-block:: pascal + + procedure InvertTPA(var a: TPointArray); + + +InvertATPA +---------- + +.. code-block:: pascal + + procedure InvertATPA(var a: T2DPointArray); + + +MiddleTPAEx +----------- + +.. code-block:: pascal + + function MiddleTPAEx(const TPA: TPointArray; var x, y: Integer): Boolean; + + +MiddleTPA +--------- + +.. code-block:: pascal + + function MiddleTPA(const tpa: TPointArray): TPoint; + + +SortATPASize +------------ + +.. code-block:: pascal + + procedure SortATPASize(var a: T2DPointArray; const BigFirst: Boolean); + + +SortATPAFromSize +---------------- + +.. code-block:: pascal + + procedure SortATPAFromSize(var a: T2DPointArray; const Size: Integer; CloseFirst: Boolean); + + +InIntArrayEx +------------ + +.. code-block:: pascal + + function InIntArrayEx(const a: TIntegerArray; var Where: Integer; const Number: Integer): Boolean; + + +InIntArray +---------- + +.. code-block:: pascal + + function InIntArray(const a: TIntegerArray; Number: Integer): Boolean; + + +ClearSameIntegers +----------------- + +.. code-block:: pascal + + procedure ClearSameIntegers(var a: TIntegerArray); + + +ClearSameIntegersAndTPA +----------------------- + +.. code-block:: pascal + + procedure ClearSameIntegersAndTPA(var a: TIntegerArray; var p: TPointArray); + + +SplitTPAEx +---------- + +.. code-block:: pascal + + function SplitTPAEx(const arr: TPointArray; w, h: Integer): T2DPointArray; + + +SplitTPA +-------- + +.. code-block:: pascal + + function SplitTPA(const arr: TPointArray; Dist: Integer): T2DPointArray; + + +FloodFillTPA +------------ + +.. code-block:: pascal + + function FloodFillTPA(const TPA : TPointArray) : T2DPointArray; + + +FilterPointsPie +--------------- + +.. code-block:: pascal + + procedure FilterPointsPie(var Points: TPointArray; const SD, ED, MinR, MaxR: Extended; Mx, My: Integer); + + +FilterPointsLine +---------------- + +.. code-block:: pascal + + procedure FilterPointsLine(var Points: TPointArray; Radial: Extended; Radius, MX, MY: Integer); + + +FilterPointsDist +---------------- + +.. code-block:: pascal + + procedure FilterPointsDist(var Points: TPointArray; const MinDist, MaxDist: Extended; Mx, My: Integer); + + +GetATPABounds +------------- + +.. code-block:: pascal + + function GetATPABounds(const ATPA: T2DPointArray): TBox; + + +GetTPABounds +------------ + +.. code-block:: pascal + + function GetTPABounds(const TPA: TPointArray): TBox; + + +FindTPAinTPA +------------ + +.. code-block:: pascal + + function FindTPAinTPA(const SearchTPA, TotalTPA: TPointArray; var Matches: TPointArray): Boolean; + + +GetSamePointsATPA +----------------- + +.. code-block:: pascal + + function GetSamePointsATPA(const ATPA : T2DPointArray; var Matches : TPointArray) : boolean; + + +FindTextTPAinTPA +---------------- + +.. code-block:: pascal + + function FindTextTPAinTPA(Height : integer;const SearchTPA, TotalTPA: TPointArray; var Matches: TPointArray): Boolean; + + +SortCircleWise +-------------- + +.. code-block:: pascal + + procedure SortCircleWise(var tpa: TPointArray; const cx, cy, StartDegree: Integer; SortUp, ClockWise: Boolean); + + +LinearSort +---------- + +.. code-block:: pascal + + procedure LinearSort(var tpa: TPointArray; cx, cy, sd: Integer; SortUp: Boolean); + + +RotatePoint +----------- + +.. code-block:: pascal + + function RotatePoint(Const p: TPoint; angle, mx, my: Extended): TPoint; + + +ChangeDistPT +------------ + +.. code-block:: pascal + + function ChangeDistPT(const PT : TPoint; mx,my : integer; newdist : extended) : TPoint; + + +ChangeDistTPA +------------- + +.. code-block:: pascal + + function ChangeDistTPA(var TPA : TPointArray; mx,my : integer; newdist : extended) : boolean; + + +FindGapsTPA +----------- + +.. code-block:: pascal + + function FindGapsTPA(const TPA: TPointArray; MinPixels: Integer): T2DPointArray; + + +RemoveDistTPointArray +--------------------- + +.. code-block:: pascal + + function RemoveDistTPointArray(x, y, dist: Integer;const ThePoints: TPointArray; RemoveHigher: Boolean): TPointArray; + + +CombineTPA +---------- + +.. code-block:: pascal + + function CombineTPA(const Ar1, Ar2: TPointArray): TPointArray; + + +ReArrangeandShortenArrayEx +-------------------------- + +.. code-block:: pascal + + function ReArrangeandShortenArrayEx(const a: TPointArray; w, h: Integer): TPointArray; + + +ReArrangeandShortenArray +------------------------ + +.. code-block:: pascal + + function ReArrangeandShortenArray(const a: TPointArray; Dist: Integer): TPointArray; + + +TPAtoATPAEx +----------- + +.. code-block:: pascal + + function TPAtoATPAEx(const TPA: TPointArray; w, h: Integer): T2DPointArray; + + +TPAtoATPA +--------- + +.. code-block:: pascal + + function TPAtoATPA(const TPA: TPointArray; Dist: Integer): T2DPointArray; + + +CombineIntArray +--------------- + +.. code-block:: pascal + + function CombineIntArray(const Ar1, Ar2: TIntegerArray): TIntegerArray; + + +MergeATPA +--------- + +.. code-block:: pascal + + function MergeATPA(const ATPA : T2DPointArray) : TPointArray; + + +AppendTPA +--------- + +.. code-block:: pascal + + procedure AppendTPA(var TPA: TPointArray; const ToAppend: TPointArray); + + +TPAFromBox +---------- + +.. code-block:: pascal + + function TPAFromBox(const Box : TBox) : TPointArray; + + +RotatePoints +------------ + +.. code-block:: pascal + + function RotatePoints(Const P: TPointArray; A, cx, cy: Extended): TPointArray ; + + +FindTPAEdges +------------ + +.. code-block:: pascal + + function FindTPAEdges(const p: TPointArray): TPointArray; + + +ClearTPAFromTPA +--------------- + +.. code-block:: pascal + + function ClearTPAFromTPA(const arP, ClearPoints: TPointArray): TPointArray; + + +ReturnPointsNotInTPA +-------------------- + +.. code-block:: pascal + + function ReturnPointsNotInTPA(Const TotalTPA: TPointArray; const Box: TBox): TPointArray; + + +PointInTPA +---------- + +.. code-block:: pascal + + function PointInTPA(p: TPoint;const arP: TPointArray): Boolean; + + +ClearDoubleTPA +-------------- + +.. code-block:: pascal + + procedure ClearDoubleTPA(var TPA: TPointArray); + + +TPACountSort +------------ + +.. code-block:: pascal + + procedure TPACountSort(Var TPA: TPointArray;const max: TPoint;Const SortOnX : Boolean); + + +TPACountSortBase +---------------- + +.. code-block:: pascal + + procedure TPACountSortBase(Var TPA: TPointArray;const maxx, base: TPoint; const SortOnX : Boolean); + + +InvertTIA +--------- + +.. code-block:: pascal + + procedure InvertTIA(var tI: TIntegerArray); + + +SumIntegerArray +--------------- + +.. code-block:: pascal + + function SumIntegerArray(const Ints : TIntegerArray): Integer; + + +AverageTIA +---------- + +.. code-block:: pascal + + function AverageTIA(const tI: TIntegerArray): Integer; + + +AverageExtended +--------------- + +.. code-block:: pascal + + function AverageExtended(const tE: TExtendedArray): Extended; + + +SplitTPAExWrap +-------------- + +.. code-block:: pascal + + procedure SplitTPAExWrap(const arr: TPointArray; w, h: Integer; var res : T2DPointArray); + + +SplitTPAWrap +------------ + +.. code-block:: pascal + + procedure SplitTPAWrap(const arr: TPointArray; Dist: Integer; var res: T2DPointArray); + + +FindGapsTPAWrap +--------------- + +.. code-block:: pascal + + procedure FindGapsTPAWrap(const TPA: TPointArray; MinPixels: Integer; var Res : T2DPointArray); + + +RemoveDistTPointArrayWrap +------------------------- + +.. code-block:: pascal + + procedure RemoveDistTPointArrayWrap(x, y, dist: Integer;const ThePoints: TPointArray; RemoveHigher: Boolean; var Res : TPointArray); + + +CombineTPAWrap +-------------- + +.. code-block:: pascal + + procedure CombineTPAWrap(const Ar1, Ar2: TPointArray; var Res : TPointArray); + + +ReArrangeandShortenArrayExWrap +------------------------------ + +.. code-block:: pascal + + procedure ReArrangeandShortenArrayExWrap(const a: TPointArray; w, h: Integer; var Res : TPointArray); + + +ReArrangeandShortenArrayWrap +---------------------------- + +.. code-block:: pascal + + procedure ReArrangeandShortenArrayWrap(const a: TPointArray; Dist: Integer; var Res : TPointArray); + + +TPAtoATPAExWrap +--------------- + +.. code-block:: pascal + + procedure TPAtoATPAExWrap(const TPA: TPointArray; w, h: Integer; var Res : T2DPointArray); + + +TPAtoATPAWrap +------------- + +.. code-block:: pascal + + procedure TPAtoATPAWrap(const TPA: TPointArray; Dist: Integer; var Res : T2DPointArray); + + +CombineIntArrayWrap +------------------- + +.. code-block:: pascal + + procedure CombineIntArrayWrap(const Ar1, Ar2: TIntegerArray; var Res : TIntegerArray); + + +ReturnPointsNotInTPAWrap +------------------------ + +.. code-block:: pascal + + procedure ReturnPointsNotInTPAWrap(Const TotalTPA: TPointArray; const Box: TBox; var Res : TPointArray); + + +MergeATPAWrap +------------- + +.. code-block:: pascal + + procedure MergeATPAWrap(const ATPA : T2DPointArray; var Res: TPointArray); + + +TPAFromBoxWrap +-------------- + +.. code-block:: pascal + + procedure TPAFromBoxWrap(const Box : TBox; var Res : TPointArray); + + +RotatePointsWrap +---------------- + +.. code-block:: pascal + + procedure RotatePointsWrap(Const P: TPointArray; A, cx, cy: Extended; var Res : TPointArray); + + +FindTPAEdgesWrap +---------------- + +.. code-block:: pascal + + procedure FindTPAEdgesWrap(const p: TPointArray; var Res : TPointArray); + + +ClearTPAFromTPAWrap +------------------- + +.. code-block:: pascal + + procedure ClearTPAFromTPAWrap(const arP, ClearPoints: TPointArray; var Res : TPointArray); + + +SameTPA +------- + +.. code-block:: pascal + + function SameTPA(const aTPA, bTPA: TPointArray): Boolean; + + +TPAInATPA +--------- + +.. code-block:: pascal + + function TPAInATPA(const TPA: TPointArray;const InATPA: T2DPointArray; var Index: LongInt): Boolean; + + +OffsetTPA +--------- + +.. code-block:: pascal + + procedure OffsetTPA(var TPA : TPointArray; const Offset : TPoint); + + +OffsetATPA +---------- + +.. code-block:: pascal + + procedure OffsetATPA(var ATPA : T2DPointArray; const Offset : TPoint); + + +CopyTPA +------- + +.. code-block:: pascal + + function CopyTPA(const TPA : TPointArray) : TPointArray; + + +CopyATPA +-------- + +.. code-block:: pascal + + function CopyATPA(const ATPA : T2DPointArray) : T2DPointArray; + +