2010-01-25 08:59:44 -05:00
|
|
|
{
|
|
|
|
This file is part of the Mufasa Macro Library (MML)
|
|
|
|
Copyright (c) 2009 by Raymond van Venetië and Merlijn Wajer
|
|
|
|
|
|
|
|
MML is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
MML is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with MML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
See the file COPYING, included in this distribution,
|
|
|
|
for details about the copyright.
|
|
|
|
|
|
|
|
DTM.inc for the Mufasa Macro Library
|
|
|
|
}
|
|
|
|
|
2010-04-18 11:14:19 -04:00
|
|
|
function ps_FindDTM(DTM: Integer; var x, y: Integer; xs, ys, xe, ye: Integer): Boolean; extdecl;
|
2010-01-25 08:59:44 -05:00
|
|
|
begin
|
2010-04-03 08:05:15 -04:00
|
|
|
with CurrThread.Client do
|
2010-05-19 10:01:01 -04:00
|
|
|
result := MFinder.FindDTM(MDTMs[DTM],x,y,xs,ys,xe,ye);
|
2010-01-25 08:59:44 -05:00
|
|
|
end;
|
|
|
|
|
2010-04-18 11:14:19 -04:00
|
|
|
function ps_FindDTMs(DTM: Integer; var p: TPointArray; xs, ys, xe, ye: Integer): Boolean; extdecl;
|
2010-01-25 08:59:44 -05:00
|
|
|
begin
|
2010-04-03 08:05:15 -04:00
|
|
|
with CurrThread.Client do
|
2010-05-19 10:01:01 -04:00
|
|
|
result := MFinder.FindDTMs(MDTMs[DTM], p, xs, ys, xe, ye);
|
2010-01-25 08:59:44 -05:00
|
|
|
end;
|
|
|
|
|
2010-04-18 11:14:19 -04:00
|
|
|
function ps_FindDTMRotatedAlternating(DTM: Integer; var x, y: Integer; xs, ys, xe, ye:
|
2010-01-25 08:59:44 -05:00
|
|
|
Integer; sAngle, eAngle, aStep: Extended;
|
2010-04-18 11:14:19 -04:00
|
|
|
var aFound: Extended): Boolean; extdecl;
|
2010-01-25 08:59:44 -05:00
|
|
|
begin
|
2010-04-03 08:05:15 -04:00
|
|
|
with CurrThread.Client do
|
2010-05-19 10:01:01 -04:00
|
|
|
result := MFinder.FindDTMRotated(MDTMs[DTM], x,y, xs, ys, xe, ye, sAngle, eAngle, aStep, aFound,true);
|
2010-01-25 08:59:44 -05:00
|
|
|
end;
|
|
|
|
|
2010-04-18 11:14:19 -04:00
|
|
|
function ps_FindDTMRotatedSE(DTM: Integer; var x, y: Integer; xs, ys, xe, ye:
|
2010-02-28 14:21:15 -05:00
|
|
|
Integer; sAngle, eAngle, aStep: Extended;
|
2010-04-18 11:14:19 -04:00
|
|
|
var aFound: Extended): Boolean; extdecl;
|
2010-02-28 14:21:15 -05:00
|
|
|
begin
|
2010-04-03 08:05:15 -04:00
|
|
|
with CurrThread.Client do
|
2010-05-19 10:01:01 -04:00
|
|
|
result := MFinder.FindDTMRotated(MDTMs[DTM], x, y, xs, ys, xe, ye, sAngle, eAngle, aStep, aFound,false);
|
2010-02-28 14:21:15 -05:00
|
|
|
end;
|
|
|
|
|
2010-04-18 17:26:21 -04:00
|
|
|
function ps_FindDTMsRotatedAlternating(DTM: Integer; var Points: TPointArray; xs, ys, xe, ye: Integer; sAngle, eAngle, aStep: Extended; var aFound: T2DExtendedArray): Boolean; extdecl;
|
2010-02-28 14:21:15 -05:00
|
|
|
begin
|
2010-04-03 08:05:15 -04:00
|
|
|
with CurrThread.Client do
|
2010-05-19 10:01:01 -04:00
|
|
|
result := MFinder.FindDTMsRotated(MDTMs[DTM], Points, xs, ys, xe, ye,
|
2010-04-03 08:05:15 -04:00
|
|
|
sAngle, eAngle, aStep, aFound, true);
|
2010-02-28 14:21:15 -05:00
|
|
|
end;
|
|
|
|
|
2010-04-18 17:26:21 -04:00
|
|
|
function ps_FindDTMsRotatedSE(DTM: Integer; var Points: TPointArray; xs, ys, xe, ye: Integer; sAngle, eAngle, aStep: Extended; var aFound: T2DExtendedArray): Boolean; extdecl;
|
2010-01-25 08:59:44 -05:00
|
|
|
begin
|
2010-04-03 08:05:15 -04:00
|
|
|
with CurrThread.Client do
|
2010-05-19 10:01:01 -04:00
|
|
|
result := MFinder.FindDTMsRotated(MDTMs[DTM], Points, xs, ys, xe, ye,
|
2010-04-03 08:05:15 -04:00
|
|
|
sAngle, eAngle, aStep, aFound, false);
|
2010-01-25 08:59:44 -05:00
|
|
|
end;
|
|
|
|
|
2010-04-03 08:05:15 -04:00
|
|
|
procedure ps_SetDTMName(DTM : integer;const name : string);
|
2010-02-06 19:55:52 -05:00
|
|
|
begin
|
2010-05-19 10:01:01 -04:00
|
|
|
CurrThread.Client.MDTMs[DTM].Name := Name;
|
2010-02-06 19:55:52 -05:00
|
|
|
end;
|
|
|
|
|
2010-04-03 08:05:15 -04:00
|
|
|
function ps_DTMFromString(const DTMString: String): Integer; extdecl;
|
2010-01-25 08:59:44 -05:00
|
|
|
begin
|
2010-05-19 14:01:46 -04:00
|
|
|
Result := CurrThread.Client.MDTMs.StringToDTM(DTMString);
|
2010-01-25 08:59:44 -05:00
|
|
|
end;
|
|
|
|
|
2010-01-28 18:34:03 -05:00
|
|
|
procedure ps_FreeDTM(DTM: Integer); extdecl;
|
2010-01-25 08:59:44 -05:00
|
|
|
begin
|
2010-05-19 10:01:01 -04:00
|
|
|
CurrThread.Client.MDTMs.FreeDTM(DTM);
|
2010-01-25 08:59:44 -05:00
|
|
|
end;
|
|
|
|
|
2010-05-19 10:01:01 -04:00
|
|
|
function ps_GetDTM(index: Integer) : TMDTM; extdecl;
|
2010-01-25 08:59:44 -05:00
|
|
|
begin
|
2010-05-19 10:01:01 -04:00
|
|
|
result := CurrThread.Client.MDTMs[Index];
|
2010-01-25 08:59:44 -05:00
|
|
|
end;
|
|
|
|
|
2010-05-19 10:01:01 -04:00
|
|
|
function ps_AddTSDTM(const d: TSDTM): Integer; extdecl;
|
2010-01-25 08:59:44 -05:00
|
|
|
begin
|
2010-05-19 10:01:01 -04:00
|
|
|
Result := CurrThread.Client.MDTMs.AddDTM(d);
|
2010-01-25 08:59:44 -05:00
|
|
|
end;
|
|
|
|
|
2010-05-19 10:01:01 -04:00
|
|
|
function ps_AddDTM(const d: TMDTM): Integer; extdecl;
|
2010-01-25 08:59:44 -05:00
|
|
|
begin
|
2010-05-19 10:01:01 -04:00
|
|
|
Result := CurrThread.Client.MDTMs.AddDTM(d);
|
2010-01-25 08:59:44 -05:00
|
|
|
end;
|
2010-01-26 11:51:36 -05:00
|
|
|
|
2010-05-19 10:01:01 -04:00
|
|
|
procedure ps_PrintDTM(const aDTM : TMDTM);extdecl;
|
2010-01-26 11:51:36 -05:00
|
|
|
begin
|
2010-05-19 10:01:01 -04:00
|
|
|
PrintDTM(aDTM);
|
2010-01-26 11:51:36 -05:00
|
|
|
end;
|
|
|
|
|
2010-05-19 10:01:01 -04:00
|
|
|
function ps_MDTMToSDTM(Const DTM: TMDTM): TSDTM;extdecl;
|
2010-04-03 08:05:15 -04:00
|
|
|
begin
|
2010-05-19 10:01:01 -04:00
|
|
|
result := MDTMToSDTM(DTM);
|
2010-04-03 08:05:15 -04:00
|
|
|
end;
|
|
|
|
|
2010-05-19 10:01:01 -04:00
|
|
|
function ps_SDTMToMDTM(Const DTM: TSDTM): TMDTM;extdecl;
|
2010-04-03 08:05:15 -04:00
|
|
|
begin
|
2010-05-19 10:01:01 -04:00
|
|
|
result := SDTMToMDTM(DTM);
|
2010-05-19 17:32:54 -04:00
|
|
|
CurrThread.Client.MDTMs.AddDTM(result);
|
2010-04-03 08:05:15 -04:00
|
|
|
end;
|
2010-05-19 14:01:46 -04:00
|
|
|
|
|
|
|
function ps_CreateDTMPoint(x,y,c,t,asz : integer; bp : boolean) : TMDTMPoint;
|
|
|
|
begin
|
|
|
|
result := CreateDTMPoint(x,y,c,t,asz,bp);
|
|
|
|
end;
|