mastaraymond
2010-05-19 16:54:34
So yes, the latest Simba uses a new structure for DTMs.
We got rid of the pDTM structure and created a new one.. It works like this; The 'DTM' itself is an Object called TMDTM. It has a few members (Like AddPoint).. And it holds an Array of TMDTMPoints.. (This is the actual DTM-information!)
The structure of a TMDTMPoint looks like this:
Now there is also support for DTM.ToString and DTMFromString with this new structure (the old dtm strings will still work!).
Here is a little testscript:
We got rid of the pDTM structure and created a new one.. It works like this; The 'DTM' itself is an Object called TMDTM. It has a few members (Like AddPoint).. And it holds an Array of TMDTMPoints.. (This is the actual DTM-information!)
The structure of a TMDTMPoint looks like this:
{
x,y : Coordinates;
c : Color;
t : Tolerance;
Asz: Area size;
bp: Bad Point;
}
TMDTMPoint = record //TMufasaDTMPoint
x,y,c,t,asz : integer;
bp : boolean;
end; Now there is also support for DTM.ToString and DTMFromString with this new structure (the old dtm strings will still work!).
Here is a little testscript:
program new;
var
x : TMDTM;
y,xx,yy : integer;
str : string;
begin
x := TMDTM.create;
x.AddPoint(CreateDTMPoint(5,5,clwhite,5,0,true));
x.AddPoint(CreateDTMPoint(-5,-5,clwhite,30,5,false));
Writeln(format('Our DTM index is: %d',[x.index]));
str := x.ToString;
y := DTMFromString(str);
writeln(GetDTM(y).Count);
PrintDTM(GetDTM(y));
Writeln(format('The DTM index is: %d',[GetDTM(y).index]));
FindDTM(x.Index,xx,yy,0,0,50,50);
end.