Dark_Sniper
2007-10-09 20:23:05
Well Rs monkey did tip me off with setarraylength…
simple to use and easy to make a ddtm…
usage:
everything after that is subpoints.
i have tested this and it works.
actully pretty fun to use :p
you should give it a go.:garfield:
Summary:
basically it is a shorter + takes up less lines DDTM declarement.
if you don't understand that it is
its a way to make ddtms with out all the hassle of diffrent vars and space taking way of making a ddtm.(check usage)
Understanding usage:
usage:
lets break it down to CreateDDTM.
Function CreateDDTM(PointX, PointY, PointAreaSize, PointAreaShape, PointColor, PointTolerance : TIntegerArray) : TDTM;
PointX - the X value for a DDTM
PointY - the Y value for a DDTM
PointAreaSize - how big of an area can this color be in ( 3-4 max)
pointAreaShape - leave at 0 for default.
PointColor - color value for that point.
PointTolerance - tolerance for the pointcolor
createddtm will make the ddtm and return it to its result.
so now createddtm(…) will be the ddtm.
now you need a reg var declare as integer.
and just follow the usage and it will save the ddtm to that var.
and from there all you have to do is use the var like it has a dtm declared in it.
FindDTM(Var,….)
note:
it automatically assumes the first set of inputs for the var is your main point.
everything after that is subpoints.
this means
CreateDDTM([432, 426, 430], [65, 68, 64], [1, 1, 1], [0, 0, 0], [5000447, 14145495, 15198183], [3, 3, 3])
makes the main point of the ddtm
everything after is the subpoint :)
enjoy :p
simple to use and easy to make a ddtm…
Function CreateDDTM(PointX, PointY, PointAreaSize, PointAreaShape, PointColor, PointTolerance : TIntegerArray) : TDTM;
var
b : Integer;
DDTM : TDTMPointDefArray;
MainDDTM : TDTMPointDef;
DDTMSkel : TDTM;
begin
MainDDTM.x:=PointX[0];
MainDDTM.y:=Pointy[0];
MainDDTM.areasize:=Pointareasize[0];
MainDDTM.areashape:=Pointareashape[0];
MainDDTM.color:=Pointcolor[0];
MainDDTM.tolerance:=Pointtolerance[0];
setarraylength(DDTM, (GetArrayLength(PointX)-1))
for b := 1 to (GetArrayLength(pointX)-1) do
begin
DDTM[b-1].x:=PointX[b];
DDTM[b-1].y:=Pointy[b];
DDTM[b-1].areasize:=PointAreaSize[b];
DDTM[b-1].areashape:=PointAreaShape[b];
DDTM[b-1].color:=PointColor[b];
DDTM[b-1].tolerance:=PointTolerance[b];
end;
DDTMSkel.MainPoint:=MainDDTM;
DDTMSkel.SubPoints:=DDTM;
Result:=DDTMSkel;
end;usage:
YourDTM:=AddDtm(CreateDDTM([432, 426, 430], [65, 68, 64], [1, 1, 1], [0, 0, 0], [5000447, 14145495, 15198183], [3, 3, 3]));
it automatically assumes the first set of inputs for the var is your main point.everything after that is subpoints.
i have tested this and it works.
actully pretty fun to use :p
you should give it a go.:garfield:
Summary:
basically it is a shorter + takes up less lines DDTM declarement.
if you don't understand that it is
its a way to make ddtms with out all the hassle of diffrent vars and space taking way of making a ddtm.(check usage)
Understanding usage:
usage:
YourDTM:=AddDtm(CreateDDTM([432, 426, 430], [65, 68, 64], [1, 1, 1], [0, 0, 0], [5000447, 14145495, 15198183], [3, 3, 3]));
lets break it down to CreateDDTM.
Function CreateDDTM(PointX, PointY, PointAreaSize, PointAreaShape, PointColor, PointTolerance : TIntegerArray) : TDTM;
PointX - the X value for a DDTM
PointY - the Y value for a DDTM
PointAreaSize - how big of an area can this color be in ( 3-4 max)
pointAreaShape - leave at 0 for default.
PointColor - color value for that point.
PointTolerance - tolerance for the pointcolor
createddtm will make the ddtm and return it to its result.
so now createddtm(…) will be the ddtm.
now you need a reg var declare as integer.
and just follow the usage and it will save the ddtm to that var.
and from there all you have to do is use the var like it has a dtm declared in it.
FindDTM(Var,….)
note:
it automatically assumes the first set of inputs for the var is your main point.
everything after that is subpoints.
this means
CreateDDTM([432, 426, 430], [65, 68, 64], [1, 1, 1], [0, 0, 0], [5000447, 14145495, 15198183], [3, 3, 3])
makes the main point of the ddtm
everything after is the subpoint :)
enjoy :p