mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-23 17:52:16 -05:00
Merge branch 'master' into cts-rework
This commit is contained in:
commit
d0bd81c2e9
@ -14,9 +14,17 @@ Recommended Simba Extensions
|
||||
----------------------------
|
||||
|
||||
Recommended:
|
||||
* SRL Updater (and Downloader)
|
||||
* DTM Editor
|
||||
|
||||
* Extension Updater (highly recommended)
|
||||
* SRL Updater (and Installer/Download)
|
||||
* Associate Files
|
||||
* Security extension. (Implements a File and Fire wall)
|
||||
|
||||
For developers:
|
||||
|
||||
* DTM Editor
|
||||
* Paster Extension
|
||||
* CRov, Crash Recovery.
|
||||
|
||||
.. note::
|
||||
You can also use the Reflection Updater (and Downloader) for updating
|
||||
|
@ -87,7 +87,7 @@ begin
|
||||
HOST := HOSTDef;
|
||||
if (InputQuery(GetName + ' ' + GetVersion + ' Extension', 'Which ID would you like to grab?', Data)) then
|
||||
begin
|
||||
if IntToStr(StrToInt(Data)) = Data then
|
||||
if IntToStr(StrToIntDef(Data, -1)) = Data then
|
||||
Data := '{"paste_id": ' + Data + '}'
|
||||
else
|
||||
Data := '{"paste_id": "' + Data + '"}';
|
||||
|
@ -26,11 +26,13 @@
|
||||
// See Units/Linux/keybinder.pas
|
||||
{$ENDIF}
|
||||
|
||||
//{$DEFINE SIMBA_VERBOSE} // For more verbosity.
|
||||
|
||||
//{$DEFINE USE_RUTIS}
|
||||
|
||||
//{$DEFINE USE_CPASCAL} // TODO
|
||||
//{$DEFINE USE_LAPE} // TODO
|
||||
//{$DEFINE USE_EXTENSIONS}
|
||||
{$DEFINE USE_EXTENSIONS}
|
||||
//{$DEFINE USE_CODECOMPLETION} // TODO
|
||||
|
||||
//{$DEFINE TERMINALWRITELN} // Only used once. Remove from SimbaUnit?
|
||||
|
@ -35,20 +35,16 @@
|
||||
<LaunchingApplication PathPlusParams="/usr/bin/gnome-terminal -t 'Lazarus Run Output' -e '$(LazarusDir)/tools/runwait.sh $(TargetCmdLine)'"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="3">
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="LCLBase"/>
|
||||
<MinVersion Major="1" Release="1" Valid="True"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="SynEdit"/>
|
||||
<MinVersion Major="1" Valid="True"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item3>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="48">
|
||||
<Units Count="50">
|
||||
<Unit0>
|
||||
<Filename Value="Simba.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@ -308,10 +304,19 @@
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="os_linux"/>
|
||||
</Unit47>
|
||||
<Unit48>
|
||||
<Filename Value="../../Units/MMLCore/tpa.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="tpa"/>
|
||||
</Unit48>
|
||||
<Unit49>
|
||||
<Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit49>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="10"/>
|
||||
<Version Value="9"/>
|
||||
<Target>
|
||||
<Filename Value="../../Simba"/>
|
||||
</Target>
|
||||
|
@ -33,7 +33,7 @@ uses
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, Forms, SimbaUnit, colourhistory, About, internets, debugimage,
|
||||
framefunctionlist, simpleanalyzer, updater, updateform, Simbasettings,
|
||||
libloader, mufasabase, v_ideCodeInsight,
|
||||
libloader, mufasabase, tpa, v_ideCodeInsight,
|
||||
PSDump, v_ideCodeParser,
|
||||
v_AutoCompleteForm, CastaliaPasLex, CastaliaPasLexTypes, CastaliaSimplePasPar,
|
||||
CastaliaSimplePasParTypes, dcpbase64, mPasLex, v_Constants, v_MiscFunctions,
|
||||
|
@ -143,6 +143,11 @@ begin
|
||||
FilterPointsLine(points,radial,radius,mx,my);
|
||||
end;
|
||||
|
||||
procedure ps_FilterTPADist(var TPA: TPointArray; maxDist: integer);
|
||||
begin
|
||||
FilterTPADist(TPA, maxDist);
|
||||
end;
|
||||
|
||||
function ps_GetATPABounds(const ATPA: T2DPointArray): TBox;extdecl;
|
||||
begin
|
||||
result := GetATPABounds(ATPA);
|
||||
|
@ -458,6 +458,7 @@ AddFunction(@ps_FloodFillTPA,'function FloodFillTPA(const TPA : TPointArray) : T
|
||||
AddFunction(@ps_FilterPointsPie,'procedure FilterPointsPie(var Points: TPointArray; const SD, ED, MinR, MaxR: Extended; Mx, My: Integer);');
|
||||
AddFunction(@ps_FilterPointsLine,'procedure FilterPointsLine(var Points: TPointArray; Radial: Extended; Radius, MX, MY: Integer);');
|
||||
AddFunction(@ps_filterpointsdist,'procedure FilterPointsDist(var Points: TPointArray; const MinDist, MaxDist: Extended; Mx, My: Integer);');
|
||||
AddFunction(@ps_filterTPADist, 'procedure FilterTPADist(var TPA: TPointArray; maxDist: integer);');
|
||||
AddFunction(@ps_GetATPABounds,'function GetATPABounds(const ATPA: T2DPointArray): TBox;');
|
||||
AddFunction(@ps_GetTPABounds,'function GetTPABounds(const TPA: TPointArray): TBox;');
|
||||
AddFunction(@ps_FindTPAinTPA,'function FindTPAinTPA(const SearchTPA, TotalTPA: TPointArray; var Matches: TPointArray): Boolean;');
|
||||
|
@ -746,11 +746,15 @@ begin
|
||||
if (path <> '') then
|
||||
if Includes.Find(path,i) then
|
||||
begin
|
||||
psWriteln('Include_Once file already included');
|
||||
Result := False;
|
||||
end;
|
||||
Includes.Add(path);
|
||||
{$IFDEF SIMBA_VERBOSE}
|
||||
psWriteln('Include_Once file already included:' + Path);
|
||||
{$ENDIF}
|
||||
Result := True;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
Includes.Add(path);
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
procedure SIRegister_Mufasa(cl: TPSPascalCompiler);
|
||||
|
@ -67,6 +67,7 @@ function FloodFillTPA(const TPA : TPointArray) : T2DPointArray;
|
||||
procedure FilterPointsPie(var Points: TPointArray; const SD, ED, MinR, MaxR: Extended; Mx, My: Integer);
|
||||
procedure FilterPointsDist(var Points: TPointArray; const MinDist,MaxDist: Extended; Mx, My: Integer);
|
||||
procedure FilterPointsLine(var Points: TPointArray; Radial: Extended; Radius, MX, MY: Integer);
|
||||
procedure FilterTPADist(var TPA: TPointArray; maxDist: integer);
|
||||
function RemoveDistTPointArray(x, y, dist: Integer;const ThePoints: TPointArray; RemoveHigher: Boolean): TPointArray;
|
||||
function GetATPABounds(const ATPA: T2DPointArray): TBox;
|
||||
function GetTPABounds(const TPA: TPointArray): TBox;
|
||||
@ -1168,6 +1169,55 @@ begin
|
||||
Points:= P;
|
||||
end;
|
||||
|
||||
{/\
|
||||
Removes points in the TPA that are within maxDist of each other.
|
||||
/\}
|
||||
procedure FilterTPADist(var TPA: TPointArray; maxDist: integer);
|
||||
var
|
||||
c, i, j, l, h, maxDistSq: integer;
|
||||
newTPA: TPointArray;
|
||||
inBadElements: TBooleanArray;
|
||||
begin
|
||||
h := high(TPA);
|
||||
l := (h + 1);
|
||||
maxDistSq := (maxDist * maxDist);
|
||||
|
||||
setLength(inBadElements, l);
|
||||
setLength(newTPA, l);
|
||||
|
||||
for i := 0 to h do
|
||||
inBadElements[i] := false;
|
||||
|
||||
for i := 0 to (h - 1) do
|
||||
begin
|
||||
if (inBadElements[i]) then
|
||||
continue;
|
||||
|
||||
for j := (i + 1) to h do
|
||||
begin
|
||||
if (inBadElements[j]) then
|
||||
continue;
|
||||
|
||||
// simplified -> a^2 + b^2 <= c^2
|
||||
if (((TPA[i].x - TPA[j].x) * (TPA[i].x - TPA[j].x)) + ((TPA[i].y - TPA[j].y) * (TPA[i].y - TPA[j].y)) <= maxDistSq) then
|
||||
inBadElements[j] := true;
|
||||
end;
|
||||
end;
|
||||
|
||||
c := 0;
|
||||
|
||||
// set the new TPA
|
||||
for i := 0 to h do
|
||||
if (not inBadElements[i]) then
|
||||
begin
|
||||
newTPA[c] := TPA[i];
|
||||
inc(c);
|
||||
end;
|
||||
|
||||
setLength(newTPA, c);
|
||||
TPA := newTPA;
|
||||
end;
|
||||
|
||||
{/\
|
||||
Removes the points that are inside or outside the distance Dist from the point (x, y) from the TPointArray ThePoints.
|
||||
/\}
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 1b8211db373428cd2916905980ad51be8fab1f83
|
||||
Subproject commit 940053e16d79c3d76b6b70d6a1bf56507ad0e627
|
Loading…
Reference in New Issue
Block a user