abs(x)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
numeric a,b; a = -6; b = abs(2 * a); # b = 12 print(b);
acos(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
numeric b; b = acos(0.5); print(b); # b = 1.0471975511965979
acosd(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
acosh(x)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
numeric b; b = acosh(0.5); print(b); # b = NULL
acoth(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
numeric b; b = acoth(0); print(b); # b = NULL
acsch(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
numeric b; b = acsch(0); print(b); # b = Infinity
asech(x)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
numeric b; b = asech(1); print(b); # b = 0
asin(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
numeric a, b; a = sqrt(3) / 2; b = deg * asin(a); print(b); # b = 59.99999999999999
asind(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
asinh(x)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
numeric a, b; a = (exp(0) - exp(-0)) / 2; b = asinh(a); print(b); # b = 0
atan(x)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
numeric a, b; a = 1; b = deg * atan(a); print(b); # b = 45
atan2(y, x)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
numeric a, b, c; a = sqrt(3) / 2; b = -.5; c = deg * atan2(a, b); print(c); # c = 120
atand(x)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
atanh(x)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
numeric a, b, c; a = exp(0) - exp(-0); b = exp(0) + exp(-0); c = atanh(a/b); print(c); # c = 0
Bound(val, min, max)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
print(Bound(15, 0, 10)); print(Bound(-5, 0, 10)); print(Bound(5, 0, 10));
ceil(x)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
numeric a, b, c, d; a = ceil(7.499); # a = 8 b = ceil(7.001); # b = 8 c = ceil(-7.01); # c = -7 d = ceil(-7.99); # d = -7 print(a, b, c, d);
ConvertPolartoXY(Theta, R, X, Y)
場所:
パラメータ:
戻り値
作成日時: 16-Jun-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ConvertPolartoXYd(Theta, R, X, Y)
場所:
パラメータ:
戻り値
作成日時: 16-Jun-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ConvertSphericaltoXYZ(Rho, Theta, Phi, X, Y, Z)
場所:
パラメータ:
戻り値
作成日時: 17-Jun-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ConvertSphericaltoXYZd(Rho, Theta, Phi, X, Y, Z)
場所:
パラメータ:
戻り値
作成日時: 17-Jun-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ConvertXYtoPolar(X, Y, Theta, R)
場所:
パラメータ:
戻り値
作成日時: 16-Jun-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ConvertXYtoPolard(X, Y, Theta, R)
場所:
パラメータ:
戻り値
作成日時: 16-Jun-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ConvertXYZtoSpherical(X, Y, Z, Rho, Theta, Phi)
場所:
パラメータ:
戻り値
作成日時: 17-Jun-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ConvertXYZtoSphericald(X, Y, Z, Rho, Theta, Phi)
場所:
パラメータ:
戻り値
作成日時: 17-Jun-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
CopyArrayElements(dest, source, dest_start, dest_end, source_start, source_end)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 22-Jul-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); array numeric a1[10]; array numeric a2[10]; numeric x; for x=1 to 10{ a1[x]=20+x; a2[x]=x; } CopyArrayElements(a2,a1,3,6,5,8); for x=1 to 10{ print(a2[x]); }
cos(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(cos(60 / deg)); # prints .500000000000001
cosd(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/CAD.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
cosh(x)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(cosh(0)); # prints 1
csc(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(csc(30 / deg)); # prints 2
cscd(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ctn(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(ctn(0 / deg)); # prints Infinity
ctnd(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
Displacement3D(X1, Y1, Z1, X2, Y2, Z2, Distance, Azimuth, Elevation)
場所:
パラメータ:
戻り値
作成日時: 17-Jun-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); class POINT3D pt1, pt2; pt1.x = 500; pt1.y = 500; pt1.z = 0; pt2.x = 1000; pt2.y = 1000; pt2.z = sqrt(500000); # sqrt(500^2 + 500^2) numeric distance, azimuth, elevation; # in radians Displacement3D(pt1.x, pt1.y, pt1.z, pt2.x, pt2.y, pt2.z, distance, azimuth, elevation); print(distance, azimuth, elevation); # in degrees Displacement3Dd(pt1.x, pt1.y, pt1.z, pt2.x, pt2.y, pt2.z, distance, azimuth, elevation); print(distance, azimuth, elevation);
Displacement3Dd(X1, Y1, Z1, X2, Y2, Z2, Distance, Azimuth, Elevation)
場所:
パラメータ:
戻り値
作成日時: 17-Jun-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); class POINT3D pt1, pt2; pt1.x = 500; pt1.y = 500; pt1.z = 0; pt2.x = 1000; pt2.y = 1000; pt2.z = sqrt(500000); # sqrt(500^2 + 500^2) numeric distance, azimuth, elevation; # in radians Displacement3D(pt1.x, pt1.y, pt1.z, pt2.x, pt2.y, pt2.z, distance, azimuth, elevation); print(distance, azimuth, elevation); # in degrees Displacement3Dd(pt1.x, pt1.y, pt1.z, pt2.x, pt2.y, pt2.z, distance, azimuth, elevation); print(distance, azimuth, elevation);
exp(x)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(exp(-1/0)); # prints 0
exp10(x)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(exp10(3)); # prints 1000
floor(x)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(floor(7.5)); # prints 7 print(floor(-7.5)); # prints -8
GetUnitConvAngle(from$, to$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GetUnitConvArea(from$, to$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/Dialog/areacalc.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
GetUnitConvDist(from$, to$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/MacroScript/ZOOMTO.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
GetUnitConvVolume(from$, to$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
hypot(dx, dy)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); numeric dx, dy; dx = 3; dy = 4; print(hypot(dx, dy)); # 5
int(x)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); numeric a; a = int(7.7); # a = 7 a = int(-7.7); # a = -8
IsNull(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(IsNull(null));
LinearRegression(x, y, num, slope, intercept, omit)
場所:
パラメータ:
戻り値
作成日時: 17-Jun-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
log(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print("Enter a number."); numeric x=PopupNum("Enter a number"); numeric a=log(x); print("log(x)=", a);
log10(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print("Enter a number."); numeric x=PopupNum("Enter a number"); numeric a=log10(x); print("log10(x)=", a);
PolynomialCurveFit(x, y, num, power, carray, R)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 22-Jun-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); array numeric xpoints[4]; array numeric ypoints[4]; array numeric carray[3]; numeric r; xpoints[1]=-1; xpoints[2]=0; xpoints[3]=1; xpoints[4]=2; ypoints[1]=4; ypoints[2]=10; ypoints[3]=20; ypoints[4]=34; string string$=PolynomialCurveFit(xpoints,ypoints,4,2,carray,r); printf("%s\n",string$); printf("%f %f %f\n",carray[1],carray[2],carray[3]); printf("r = %f\n",r);
pow(x, y)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(pow(2, 3)); # 8
rand(x)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
print(rand(1));
RandomGaussian(mu, sigma, x1, x2)
場所:
パラメータ:
戻り値
作成日時: 21-Jun-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ResizeArrayClear(array, index1Size, index2Size)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 08-Oct-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
array numeric a[3]; array numeric a2[3, 4]; ResizeArrayClear(a, 5); # increase size of one dimensional array ResizeArrayClear(a, 2); # decrease size of one dimensional array ResizeArrayClear(a2, 5, 6); # increase size of two dimensional array ResizeArrayClear(a2, 2, 3); # decrease size of two dimensional array
ResizeArrayPreserve(array, index1Size, index2Size)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 08-Oct-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
array numeric a[3]; array numeric a2[3, 4]; ResizeArrayPreserve(a, 5); # increase size of one dimensional array ResizeArrayPreserve(a, 2); # decrease size of one dimensional array ResizeArrayPreserve(a2, 5, 6); # increase size of two dimensional array ResizeArrayPreserve(a2, 2, 3); # decrease size of two dimensional array
round(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
print(round(10.5)); # 11 print(round(-10.5)); #-10
sec(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
print(sec(60/deg));
secd(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
Sign(x)
場所:
パラメータ:
戻り値
作成日時: 20-Jun-2000
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
print(Sign(-10)); # -1 print(Sign(0)); # 0 print(Sign(10)); # 1
sin(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(sin(30/deg)); #.5
sind(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/CAD.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
sinh(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(sinh(0)); # 0
Solve(CoefArray, ConstArray, Result)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); array numeric a[2, 2]; array numeric b[2]; array numeric x[2]; a[1,1]=1; a[1,2]=0; a[2,1]=1; a[2,2]=1; b[1]=1; b[2]=1; Solve(a, b, x); print(x[1], x[2]);
sqr(x)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(sqr(-3)); # 9
sqrt(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(sqrt(9)); # 3 print(sqrt(-9)); # 0
tan(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(tan(90/deg)); # -2147483648 (roundoff error)
tand(x)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
tanh(x)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(tanh(0)); # 0
Date()
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); numeric d; d=Date(); print(d);
DateDiff(yyyymmdd1, yyyymmdd2)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); numeric d=DateDiff(19960101, 19970101); print(d); # 365
DateToJulian(yyyymmdd)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 17-Jun-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); numeric d=DateToJulian(19960101); print(d); print(JulianToDate(d));
DateToString(yyyymmdd, format$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
print(DateToString(20031208)); # 12/08/03
JulianDate()
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); numeric d=JulianDate(); print(d);
JulianToDate(julian)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); numeric d=DateToJulian(19960101); print(d); print(JulianToDate(d));
SetMajority(x1, x2, ...)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(SetMajority(1, 3, 3, 4, 4, 5)); # prints 4
SetMax(x1, x2, ...)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(SetMax(1, 3, 3, 4, 4, 5)); # prints 5
SetMean(x1, x2, ...)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(SetMean(1, 2, 2, 5, 5)); # prints 3 (15/5)
SetMedian(x1, x2, ...)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(SetMedian(1, 3, 7)); # prints 3
SetMin(x1, x2, ...)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(SetMin(1, 3, 5)); # prints 1
SetMinority(x1, x2, ...)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(SetMinority(1, 3, 3, 4, 4, 5)); # prints 1
SetNum(x1, x2, ...)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(SetNum(2, 1, 3, 4, 99)); # returns 5
SetSD(x1, x2, ...)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(SetSD(2, 1, 3, 4, 99));
SetSum(x1, x2, ...)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(SetSum(2, 1, 3, 4, 99)); # prints 109
SetVariance(x1, x2, ...)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(SetVariance(2, 1, 3, 4, 99));
SetVariety(x1, x2, ...)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(SetVariety(2, 1, 3, 4, 99));
DegToStr(num)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(DegToStr(94.345));
FileNameGetExt(filename$)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); string f$ = GetInputFileName("", "Select a file",""); print(FileNameGetExt(f$));
FileNameGetName(filename$)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); string f$ = GetInputFileName("", "Select a file",""); print(FileNameGetName(f$));
FileNameGetPath(filename$)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); string f$ = GetInputFileName("", "Select a file",""); print(FileNameGetPath(f$));
GetToken(string$, delimiters$, tokenNumber, compress)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 25-Sep-1998
修正日時: 05-Jun-2001
TNTsml for Windows で使用可能: はい
例:
clear(); string token$; string str$ = "a b c,d"; string delimit$ = " ,"; numeric n = NumberTokens(str$, delimit$); numeric i; for i = 1 to n { token$ = GetToken(str$, delimit$, i); print(i, token$); }
left$(str$, length)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print("Enter a sentence."); string a$=PopupString("Enter a sentence."); print("Enter # of chars to get."); numeric n=PopupNum("Enter # of chars to get."); print(left$(a$, n));
mid$(str$, start, length)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# mid$ clear(); print("Enter a sentence."); string a$=PopupString("Enter a sentence."); print("Enter start position."); numeric m=PopupNum("Enter start position."); print("Enter # of chars to get."); numeric n=PopupNum("Enter # of chars to get."); print(mid$ (a$, m, n));
NumberTokens(string$, delimiters$)
場所:
パラメータ:
戻り値
作成日時: 25-Sep-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); string token$; string str$ = "a b c,d"; string delimit$ = " ,"; numeric n = NumberTokens(str$, delimit$); numeric i; for i = 1 to n { token$ = GetToken(str$, delimit$, i); print(i, token$); }
NumToStr(num)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
print("Enter a number."); numeric n=PopupNum("Enter a number"); string nstr$ = NumToStr(n); # one can now do any string operations desired on nstr$ print(nstr$);
right$(str$, length)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print("Enter a sentence."); string a$=PopupString("Enter a sentence."); print("Enter # of chars to get from the end of the string."); numeric n=PopupNum("Enter # of chars to get from the end of the string."); print(right$(a$, n));
sprintf(format$, value, ...)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); string format$="%s%d%s\n%s"; string str1$="This is line "; string str2$=" you see."; string str3$="This is line 2"; string s4$=sprintf(format$, str1$, 1, str2$, str3$); print(s4$);
strlen(str$)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); string a$; print("Enter a string. "); a$=PopupString("Enter a string. "); print(strlen(a$));
StrToDeg(str$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 16-Nov-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); print(StrToDeg("S 24 30 00"));
StrToNum(str$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); string a$; print("Enter a number. "); # would be better to just input as numeric a$=PopupString("Enter a number. "); numeric b=StrToNum(a$); print(b/10);
tolower$(string$)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
print(tolower$("MiXeD CaSe")); # mixed case;
toupper$(string$)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
print(toupper$("MiXeD CaSe")); # MIXED CASE;
CloseDatabase(db)
場所:
パラメータ:
戻り値
作成日時: 21-Sep-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
DatabaseCreate(filename$, name$, description$, Credentials)
場所:
パラメータ:
戻り値
作成日時: 02-Jun-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
string file$ = "C:/test.rvc"; numeric err = DatabaseCreate(file$, "name", "desc"); if (err < 0) print("error occurred creating database"); else { # open database and add table to database }
DatabaseGetTableInfo(database, name)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 29-May-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/cumul.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
FieldGetInfoByName(table, name$)
場所:
パラメータ:
戻り値
作成日時: 06-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/create.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
FieldGetInfoByNumber(table, number)
場所:
パラメータ:
戻り値
作成日時: 06-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class DATABASE db; class DBTABLEINFO table, table2; class DBFIELDINFO field, fieldcopy; vector V; numeric tablenum=1; GetInputVector(V); # used cb_soils db = OpenVectorPolyDatabase(V); if(TableExists(db, tablenum)) { table = DatabaseGetTableInfo(db, tablenum); field = FieldGetInfoByNumber(table, 1); # get the first field fieldcopy = field; table2 = TableCreate(db, "NewTable", "Desc"); TableAddField(table2, field); # copy it to a second table print(field.Name,"added."); } else print("No table found");
NumRecords(table)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector V; GetInputVector(V); # assume you know the table name, here we used the # Crow Butte Soils Vector object. Note that 'YIELD' # is the correct field name,not 'yield'. numeric n=NumRecords(V.poly.YIELD); print("Record count:", n);
OpenCADDatabase(CADVar, Credentials)
場所:
パラメータ:
戻り値
作成日時: 20-Jun-2000
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
cad C; GetOutputCAD(C); class DATABASE db; class DBTABLEINFO table; # write a point numeric xin = 100, yin = 200; CADWritePoint(C, 1, xin, yin); CADWritePoint(C, 1, xin+yin, yin); CADWritePoint(C, 1, xin-yin, yin); CADWritePoint(C, 1, xin, yin+xin); # now create a table db = OpenCADDatabase(C); table = TableCreate(db, "MyTable", "Newly Created Table"); TableAddFieldInteger(table, "NewField"); # write some important info to the db table TableWriteRecord(table, 0, 55); TableWriteRecord(table, 0, 45); # attach the records to elements CADAttachDBRecord(C, 1, 1, table, 1); CADUnattachDBRecord(C, 1, 1, table, 1); CADAttachDBRecord(C, 1, 1, table, 2); CADAttachDBRecord(C, 1, 2, table, 1); CADAttachDBRecord(C, 1, 3, table, 2); CADAttachDBRecord(C, 1, 4, table, 1);
OpenDatabase(filename$, objectname$, openmode$, Credentials)
場所:
パラメータ:
戻り値
作成日時: 11-Sep-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/doqq7.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
OpenRasterDatabase(Rast, Credentials)
場所:
パラメータ:
戻り値
作成日時: 06-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/classifyRaster.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
OpenTINDatabase(TINVar, Credentials)
場所:
パラメータ:
戻り値
作成日時: 20-Jun-2000
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
tin T; class DATABASE db; class DBTABLEINFO table; GetInputTIN(T); db = OpenTINDatabase(T); table = TableCreate(db, "MyTINTable", "Newly create tin db table"); TableAddFieldInteger(table, "IntField"); # write some important info to the db table TableWriteRecord(table, 0, 55); TableWriteRecord(table, 0, 45); # one could then set up attachment or relation as desired
OpenVectorLineDatabase(Vect, Credentials)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 06-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/tiger.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
OpenVectorNodeDatabase(Vect, Credentials)
場所:
パラメータ:
戻り値
作成日時: 06-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/NETWORK1.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
OpenVectorPointDatabase(Vect, Credentials)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 06-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/attach.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
OpenVectorPolyDatabase(Vect, Credentials)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 06-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/tiger.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
RecordDelete(table, recordnum1, recordnum2, ...)
場所:
パラメータ:
戻り値
作成日時: 06-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/tiger.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
TableAddField(table, field)
場所:
パラメータ:
戻り値
作成日時: 08-Jun-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class DATABASE db; class DBTABLEINFO table, table2; class DBFIELDINFO field, fieldcopy; vector V; numeric tablenum=1; GetInputVector(V); # used cb_soils db = OpenVectorPolyDatabase(V); if(TableExists(db, tablenum)) { table = DatabaseGetTableInfo(db, tablenum); field = FieldGetInfoByNumber(table, 1); # get the first field fieldcopy = field; table2 = TableCreate(db, "NewTable", "Desc"); TableAddField(table2, field); # copy it to a second table print(field.Name,"added."); } else print("No table found");
TableAddFieldFloat(table, name$, dispwidth, places)
場所:
パラメータ:
戻り値
作成日時: 06-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/Misc/CreateTable.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
TableAddFieldInteger(table, name$, dispwidth)
場所:
パラメータ:
戻り値
作成日時: 06-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/DB2.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
TableAddFieldString(table, name$, maxlength, dispwidth)
場所:
パラメータ:
戻り値
作成日時: 06-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/DB2.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
TableCopy(databaseSrc, table, databaseDest)
場所:
パラメータ:
戻り値
作成日時: 08-Mar-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
vector V1, V2; GetInputVector(V1); GetInputVector(V2); class DATABASE db1, db2; class DBTABLEINFO t1; db1 = OpenVectorPolyDatabase(V1); db2 = OpenVectorPolyDatabase(V2); string table$; PopupSelectTable(db1, table$); t1 = DatabaseGetTableInfo(db1, table$); numeric num = TableCopy(db1, t1, db2); print(num);
TableCopyToDBASE(table, filename$)
場所:
パラメータ:
戻り値
作成日時: 11-Sep-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector V; class DATABASE db; class DBTABLEINFO table; string tablename$, dbffile$; GetInputVector(V); if (V.$Info.NumPolys>0) { # open the db and table db = OpenVectorPolyDatabase(V); PopupSelectTable(db, tablename$); print("You selected:", tablename$); # save the table to dbase dbffile$ = GetOutputFileName(tablename$, "Where would you like to save the table?", "dbf"); table = DatabaseGetTableInfo(db, tablename$); TableCopyToDBASE(table, dbffile$); # for demonstration purposes, let's create a link to that dbase file TableLinkDBASE(db, dbffile$, tablename$+"Link", "Table linked from dbase"); } else print("Cannot open polygon database");
TableCreate(database, name$, description$)
場所:
パラメータ:
戻り値
作成日時: 06-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/DB2.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
TableDelete(table)
場所:
パラメータ:
戻り値
作成日時: 24-Mar-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector V; class DATABASE db; class DBTABLEINFO table; string tablename$; GetInputVector(V); if (V.$Info.NumPolys>0) { numeric err = 0; db = OpenVectorPolyDatabase(V); PopupSelectTable(db, tablename$); print("You selected:", tablename$); table = DatabaseGetTableInfo(db, tablename$); err = TableDelete(table); if (err<0) print("An error occurred"); else print("Table deleted successfully."); }
TableExists(database, name)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 27-Nov-2000
修正日時: 16-Jul-2003
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/attach.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
TableGetInfo(table)
場所:
パラメータ:
戻り値
作成日時: 06-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
vector Vect; class DBTABLEINFO table; table = TableGetInfo(Vect.poly.YIELD); # Another example: string tablename$ = "YIELD"; table = TableGetInfo(Vect.poly.(tablename$));
TableGetRecordElementList(table, recordNum, elements, element_type$)
場所:
パラメータ:
戻り値
作成日時: 24-Mar-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
TableGetRecordListElementList(table, records, num_records, elements, element_type$)
場所:
パラメータ:
戻り値
作成日時: 24-Mar-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
TableInsertFieldFloat(table, name$, before, dispwidth, places)
場所:
パラメータ:
戻り値
作成日時: 06-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); class DATABASE db; class DBTABLEINFO table; class DBFIELDINFO field; vector V; string table$, field$; # let the user select the desired Vect.Table.Field # the script will insert fields prior to the one selected GetInputVector(V); db = OpenVectorPolyDatabase(V); PopupSelectTableField(db, table$, field$); table = DatabaseGetTableInfo(db, table$); field = FieldGetInfoByName(table, field$); numeric dispwidth=10, places=2; TableInsertFieldFloat(table, "FloatField", field, dispwidth, places); TableInsertFieldInteger(table, "IntegerField", field, dispwidth); TableInsertFieldString(table, "StringField", field, dispwidth*2); print(table$ + "." + field$);
TableInsertFieldInteger(table, name$, before, dispwidth)
場所:
パラメータ:
戻り値
作成日時: 06-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); class DATABASE db; class DBTABLEINFO table; class DBFIELDINFO field; vector V; string table$, field$; # let the user select the desired Vect.Table.Field # the script will insert fields prior to the one selected GetInputVector(V); db = OpenVectorPolyDatabase(V); PopupSelectTableField(db, table$, field$); table = DatabaseGetTableInfo(db, table$); field = FieldGetInfoByName(table, field$); numeric dispwidth=10, places=2; TableInsertFieldFloat(table, "FloatField", field, dispwidth, places); TableInsertFieldInteger(table, "IntegerField", field, dispwidth); TableInsertFieldString(table, "StringField", field, dispwidth*2); print(table$ + "." + field$);
TableInsertFieldString(table, name$, before, maxlength, dispwidth)
場所:
パラメータ:
戻り値
作成日時: 06-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); class DATABASE db; class DBTABLEINFO table; class DBFIELDINFO field; vector V; string table$, field$; # let the user select the desired Vect.Table.Field # the script will insert fields prior to the one selected GetInputVector(V); db = OpenVectorPolyDatabase(V); PopupSelectTableField(db, table$, field$); table = DatabaseGetTableInfo(db, table$); field = FieldGetInfoByName(table, field$); numeric dispwidth=10, places=2; TableInsertFieldFloat(table, "FloatField", field, dispwidth, places); TableInsertFieldInteger(table, "IntegerField", field, dispwidth); TableInsertFieldString(table, "StringField", field, dispwidth*2); print(table$ + "." + field$);
TableKeyFieldLookup(table, fieldName$, fieldValue1, comparison_type$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 13-Jul-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); class DATABASE db; class DBTABLEINFO table; vector V; string table$, field$; numeric value = 5; # the value to search for numeric found=0; # have user select vector, table, and field GetInputVector(V); db = OpenVectorPolyDatabase(V); PopupSelectTableField(db, table$, field$); print(table$+"."+field$); # get the table table = DatabaseGetTableInfo(db, table$); found = TableKeyFieldLookup(table, field$, value); print(found); if (found>0) { print(table$ + "." + field$ + " record number", found, "is the first match."); } else print("No match found.");
TableKeyFieldLookupList(table, fieldName$, fieldValue1, record_list, comparison_type$)
場所:
パラメータ:
戻り値
作成日時: 24-Mar-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
TableLinkDBASE(database, filename$, name$, description$)
場所:
パラメータ:
戻り値
作成日時: 06-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector V; class DATABASE db; class DBTABLEINFO table; string tablename$, dbffile$; GetInputVector(V); if (V.$Info.NumPolys>0) { # open the db and table db = OpenVectorPolyDatabase(V); PopupSelectTable(db, tablename$); print("You selected:", tablename$); # save the table to dbase dbffile$ = GetOutputFileName(tablename$, "Where would you like to save the table?", "dbf"); table = DatabaseGetTableInfo(db, tablename$); TableCopyToDBASE(table, dbffile$); # for demonstration purposes, let's create a link to that dbase file TableLinkDBASE(db, dbffile$, tablename$+"Link", "Table linked from dbase"); } else print("Cannot open polygon database");
TableNewRecord(table, fieldValue1, fieldValue2, ...)
場所:
パラメータ:
戻り値
作成日時: 29-May-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/tiger.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
TableOpen(database, tablename$)
場所:
パラメータ:
戻り値
作成日時: 26-May-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/tiger.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
TableReadAttachment(table, element_number, records, element_type$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 14-Nov-2000
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/attach.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
TableReadFieldNum(table, fieldName$, recordNum)
場所:
パラメータ:
戻り値
作成日時: 12-Jun-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/attach.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
TableReadFieldStr(table, fieldName$, recordNum)
場所:
パラメータ:
戻り値
作成日時: 12-Jun-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/tiger.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
TableRemoveAttachment(table, element_number, records, num_records, element_type$)
場所:
パラメータ:
戻り値
作成日時: 14-Nov-2000
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# CAUTION: This script will attempt to remove some attachments # between elements and their db records. For example purposes only! clear(); vector V; class DATABASE db; class DBTABLEINFO table; string tablename$; GetInputVector(V); if (V.$Info.NumPolys>0) { db = OpenVectorPolyDatabase(V); PopupSelectTable(db, tablename$); print("You have sealed the fate of table:",tablename$); table = DatabaseGetTableInfo(db, tablename$); # mark all records for their ensuing detachment array numeric records[table.NumRecords]; numeric numrecords=0; numeric i; for i=1 to NumVectorPolys(V) step 2 # deattach every other element { numrecords = TableReadAttachment(table, i, records); TableRemoveAttachment(table, i, records, numrecords); } }
TableRemoveDuplicateRecords(table)
場所:
パラメータ:
戻り値
作成日時: 23-Mar-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector V; class DATABASE db; class DBTABLEINFO table; string tablename$; GetInputVector(V); if (V.$Info.NumPolys>0) { numeric err = 0; db = OpenVectorPolyDatabase(V); PopupSelectTable(db, tablename$); print("You selected:", tablename$); table = DatabaseGetTableInfo(db, tablename$); err = TableRemoveDuplicateRecords(table); if (err<0) print("An error occurred"); else print(err, "duplicate records removed"); }
TableRemoveUnattachedRecords(table)
場所:
パラメータ:
戻り値
作成日時: 23-Mar-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector V; class DATABASE db; class DBTABLEINFO table; string tablename$; GetInputVector(V); if (V.$Info.NumPolys>0) { numeric err = 0; db = OpenVectorPolyDatabase(V); PopupSelectTable(db, tablename$); print("You selected:", tablename$); table = DatabaseGetTableInfo(db, tablename$); err = TableRemoveUnattachedRecords(table); if (err<0) print("An error occurred."); else print("All unattached records have been removed."); }
TableTriggerRecordChangedCallback(table, recordNum)
場所:
パラメータ:
戻り値
作成日時: 12-May-2003
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/VisualBasic/ParcelToolModeless.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
TableWriteAttachment(table, element_number, records, num_records, element_type$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 14-Nov-2000
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# Example: # Have the user select a vector object. # attach records 5 and 7 to polygon number 12. VECTOR Vect; class DBTABLEINFO table; array numeric records[2]; GetInputVector(Vect); table = TableGetInfo(Vect.poly.YIELD); records[1] = 5; records[2] = 7; TableWriteAttachment(table, 12, records, 2, "polygon");
TableWriteField(table, recordNum, fieldName$, fieldValue)
場所:
パラメータ:
戻り値
作成日時: 08-Nov-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class DATABASE database; vector V; string tablename$, field$; GetInputVector(V); database = OpenVectorPolyDatabase(V); PopupSelectTableField(database, tablename$, field$); print(tablename$ + "." + field$); class DBTABLEINFO table; table = DatabaseGetTableInfo(database, tablename$); # Write the value 999 to the selected field in record 3 numeric err = TableWriteField(table, 3, field$, 999); PopupError(err);
TableWriteRecord(table, recordNum, fieldValue1, fieldValue2, ...)
場所:
パラメータ:
戻り値
作成日時: 15-Jun-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
vector V; GetInputVector(V);# cbsoils_lite used class DBTABLEINFO table; table = TableGetInfo(V.poly.CLASS); numeric recordNum = TableWriteRecord(table, 0, "AAAAA"); print(recordNum);
AreaCorrelatePoint(RasterSource, xSource, ySource, RasterDestination, xDestination, yDestination, sourceSize, targetSize)
場所:
パラメータ:
戻り値
作成日時: 20-Jul-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster Rs, Rd; numeric xS, yS, xD, yD; GetInputRaster(Rs); GetInputRaster(Rd); xS = 55; yS = 60; xD = 50; yD = 63; numeric sourceSize = 21; numeric targetSize = 50; numeric cor = AreaCorrelatePoint(Rs, xS, yS, Rd, xD, yD, sourceSize, targetSize); print(xS, yS, xD, yD, cor);
Binarization(Raster, filename$, objname$, Array, BinaryValue, Credentials)
場所:
パラメータ:
戻り値
作成日時: 15-Jul-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); class DISP handle; raster Rvar, Rout; array numeric myarray[15]; numeric x; for x=1 to 15{ myarray[x]=80+x; } OpenRaster(Rvar, "c:/tnt/testdata.rvc", "GREEN"); Binarization(Rvar, "c:/tnt/testdata.rvc", "binaryout", myarray, 1); OpenRaster(Rout, "c:/tnt/testdata.rvc", "binaryout"); handle=DispOpen(750,550); DispQuickAddRasterVar(handle, Rout); DispRedraw(handle); CloseRaster(Rvar); CloseRaster(Rout);
CloseRaster(Raster)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster Rvar; clear(); GetInputRaster(Rvar); Rvar[1, 1] = 42; print(Rvar[1, 1]); CloseRaster(Rvar);
ColScale(Raster)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster R; GetInputRaster(R); print(ColScale(R));
ComputeMeanRaster(OutputRaster, Raster1, Raster2, ...)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 25-Mar-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster R1, R2, R3, Rout; GetInputRaster(R1); GetInputRaster(R2); GetInputRaster(R3); IgnoreNull(R1); IgnoreNull(R2); IgnoreNull(R3); GetOutputRaster(Rout, NumLins(R1), NumCols(R1), RastType(R1)); ComputeMeanRaster(Rout, R1, R2, R3); CloseRaster(Rout); CloseRaster(R1); CloseRaster(R2); CloseRaster(R3);
ComputeRasterProperties(Raster, Vector, tableName$, tableDescription$, flag1$, flag2$, ...)
場所:
パラメータ:
戻り値
作成日時: 11-Aug-1998
修正日時: 08-Jul-1999
TNTsml for Windows で使用可能: はい
例:
raster R; vector V; GetInputRaster(R); GetInputVector(V); ComputeRasterProperties(R, V, "TableName", "Description", "IncludeAll", "ComputeHistogram");
ComputeReliefShading(InputRast, OutputRast, sunElevationAngle, sunDirection, elevationScale)
場所:
パラメータ:
戻り値
作成日時: 09-Apr-2002
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster R; raster Rshade; GetInputRaster(R); GetOutputRaster(Rshade, NumLins(R), NumCols(R), RastType(R)); numeric sunAngle=45, sunDir=180, elevScale=3; ComputeReliefShading(R, Rshade, sunAngle, sunDir, elevScale);
ComputeSlopeAspectShading(inputRVCFile$, InputRaster$, outputRVCFile$, rescaleSlope, numberSlopeCells$, slopeTypeDegrees$, rescaleAspect, horizontalScale, verticalScale, elevationScale, sunElevationAngle, sunDirection, slopeObjectName$, slopeDescription$, slopeDataType$, aspectObjectName$, aspectDescription$, aspectDataType$, shadingObjectName$, shadingDescription$, shadingDataType$)
場所:
パラメータ:
戻り値
作成日時: 22-Dec-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
string inputFile$ = "c:/cb_tm.rvc"; string inputRaster$ = "ELEVATION"; string outputFile$ = "c:/SAS.rvc"; numeric rescaleSlope = 1; string numberSlopeCells$ = "4 neighbor"; string slopeTypeDegrees$ = "Degrees"; numeric rescaleAspect = 1; numeric horizontalScale = 30.0; numeric verticalScale = 30.0; numeric elevationScale = 1.0; numeric sunElevationAngle = 50.0; numeric sunDirection = 45.0; ComputeSlopeAspectShading(inputFile$, inputRaster$, outputFile$, rescaleSlope, numberSlopeCells$, slopeTypeDegrees$, rescaleAspect, horizontalScale, verticalScale, elevationScale, sunElevationAngle, sunDirection);
ComputeStdDevRaster(OutputRaster, Raster1, Raster2, ...)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 25-Mar-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster R1, R2, R3, Rout; GetInputRaster(R1); GetInputRaster(R2); GetInputRaster(R3); IgnoreNull(R1); IgnoreNull(R2); IgnoreNull(R3); GetOutputRaster(Rout, NumLins(R1), NumCols(R1), RastType(R1)); ComputeStdDevRaster(Rout, R1, R2, R3); CloseRaster(Rout); CloseRaster(R1); CloseRaster(R2); CloseRaster(R3);
ConvertCompToComp(InputRaster, FileName$, ObjName$, ColorDepth)
場所:
パラメータ:
戻り値
作成日時: 06-Aug-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); class DISP handle; raster Rvar, Ovar; OpenRaster(Rvar, "c:/tnt/samp.rvc", "COMP24"); ConvertCompToComp(Rvar, "c:/tnt/samp.rvc", "conv8", 8); OpenRaster(Ovar, "c:/tnt/samp.rvc", "conv8"); handle=DispOpen(750,550); DispQuickAddRasterVar(handle, Ovar); DispRedraw(handle); CloseRaster(Rvar); CloseRaster(Ovar);
ConvertRGBToComposite(RedRaster, GreenRaster, BlueRaster, FileName$, ObjName$, NumColors, BitDepth, SamplingRate, NullValue)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 28-Jul-1999
修正日時: 19-Mar-2004
TNTsml for Windows で使用可能: はい
例:
clear(); class DISP handle; raster Rvar, Gvar, Bvar, Ovar; OpenRaster(Rvar, "c:/tnt/samp.rvc", "RED"); OpenRaster(Gvar, "c:/tnt/samp.rvc", "GREEN"); OpenRaster(Bvar, "c:/tnt/samp.rvc", "BLUE"); ConvertRGBToComposite(Rvar, Gvar, Bvar, "c:/tnt/samp.rvc", "composite", 16, 8, 2); OpenRaster(Ovar, "c:/tnt/samp.rvc", "composite"); handle=DispOpen(750,550); DispQuickAddRasterVar(handle, Ovar); DispRedraw(handle); CloseRaster(Rvar); CloseRaster(Gvar); CloseRaster(Bvar); CloseRaster(Ovar);
CreateHistogram(Raster, sampled)
場所:
パラメータ:
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster R; GetInputRaster(R); CreateHistogram(R); CloseRaster(R);
CreatePyramid(Raster, average)
場所:
パラメータ:
戻り値
作成日時: 10-Jun-1998
修正日時: 10-Jun-1998
TNTsml for Windows で使用可能: はい
例:
raster R; GetInputRaster(R); CreatePyramid(R); CloseRaster(R);
CreateRaster(Raster, filename$, objname$, desc$, lins, cols, datatype$, Credentials)
場所:
パラメータ:
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster Rvar; string file$="c:/temp.rvc"; string obj$="TempRast"; string description$="temporary raster for test"; numeric lin = 1024, col = 512; string type$="8-bit unsigned"; CreateRaster(Rvar, file$, obj$, description$, lin, col, type$); print(NumLins(Rvar), NumCols(Rvar)); # do some things to Rvar CloseRaster(Rvar);
CreateRasterBinaryMask(Raster, filename$, objname$, MaskValue)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 23-Jul-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/MacroScript/printsep.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
CreateRasterFromObject(Object, Raster, filename$, objname$, description$, horizontalScale, verticalScale, datatype$, georef, Credentials)
場所:
パラメータ:
戻り値
作成日時: 29-Apr-1998
修正日時: 20-Dec-2005
TNTsml for Windows で使用可能: はい
例:
raster R; vector V; class Georef georef; GetInputVector(V); georef = GetLastUsedGeorefObject(V); CreateRasterFromObject(V, R, "c:/tnt/win32/projects/vtor/RasOut.rvc", "VtoR", "Raster from Vector", 30, 30, "8-bit unsigned", georef); R = 0; # zero out the Raster CloseRaster(R); CloseVector(V); print("done");
CreateRasterMask(Raster, filename$, objname$, MaskValue, Credentials)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 23-Jul-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Raster R; GetInputRaster(R); numeric percent = 50; CreateRasterMask(R, R.$Info.Filename, R.$Info.Name+"Mask",percent*255/100);
CreateTempRaster(Raster, lins, cols, datatype$, noDeleteOnClose)
場所:
パラメータ:
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster Rvar; numeric lin = 1024, col = 512; string type$="8-bit unsigned"; CreateTempRaster(Rvar, lin, col, type$); print(NumLins(Rvar), NumCols(Rvar)); # do some things to Rvar CloseRaster(Rvar);
DeleteContrast(Raster)
場所:
パラメータ:
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster Rvar; GetInputRaster(Rvar); DeleteContrast(Rvar);
DeleteHistogram(Raster)
場所:
パラメータ:
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster Rvar; GetInputRaster(Rvar); DeleteHistogram(Rvar);
DeletePyramid(Raster)
場所:
パラメータ:
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster Rvar; GetInputRaster(Rvar); DeletePyramid(Rvar);
DeleteTempRaster(Raster)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster rTemp; numeric lin = 1024, col = 512; string type$="8-bit unsigned"; CreateTempRaster(rTemp, lin, col, type$); # do something with rTemp DeleteTempRaster(rTemp);
GetInputRaster(Raster, lins, cols, datatype$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster R; numeric lines=488, columns=361; # Crow Butte TM raster dimensions string type$="8-bit unsigned"; # allow only specific raster size and type GetInputRaster(R, lines, columns, type$); CloseRaster(R); # allow any size, but only a specific type GetInputRaster(R, 0, 0, type$); CloseRaster(R);
GetInputRasters(Raster, ...)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster Red, Green, Blue; GetInputRasters(Red, Green, Blue);
GetMaxPossibleValue(Raster)
場所:
パラメータ:
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GetMinPossibleValue(Raster)
場所:
パラメータ:
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GetOutputRaster(Raster, lins, cols, datatype$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster R, R2; GetInputRaster(R); numeric lin = 1024, col = 512; string type$="8-bit unsigned"; # allow selection or creation of a raster identical # in size and type to R. GetOutputRaster(R2, lin, col, type$); CloseRaster(R); CloseRaster(R2);
HasNull(Raster)
場所:
パラメータ:
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster R; GetInputRaster(R); if (HasNull(R)) then print("R has a NULL value."); else print("R does not have a NULL value."); # The last line is always executed - it's not part of the 'else' statement. CloseRaster(R);
HasNullMask(Raster)
場所:
パラメータ:
戻り値
作成日時: 07-Jun-2005
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
HasNullValue(Raster)
場所:
パラメータ:
戻り値
作成日時: 07-Jun-2005
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
HistogramGetSampleInterval(Raster)
場所:
パラメータ:
戻り値
作成日時: 06-May-2005
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
IgnoreNull(Raster, temporary)
場所:
パラメータ:
詳細と仮定
詳細と仮定
戻り値
作成日時: 01-Jan-2004
修正日時: 22-Mar-2005
TNTsml for Windows で使用可能: はい
例:
clear(); raster R; GetInputRaster(R); if (HasNull(R)) then begin print("R has a NULL value."); print("\nIt is now ignored."); IgnoreNull(R); end else begin print("R has no NULL value."); print("That's all, folks."); end # The last line is always executed - it's not in the loop. CloseRaster(R);
LinScale(Raster)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster R; GetInputRaster(R); numeric a=LinScale(R); print("Line scale is:", a); CloseRaster(R);
MultiRegression(resultMat, Raster1, Raster2, ...)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); class MATRIX h1; raster Rr, Rg, Rb; h1 = CreateMatrix(3, 4); # holds the results # get three input rasters to do multiregression on GetInputRaster(Rr); # get red input raster GetInputRaster(Rg); # get green input raster GetInputRaster(Rb); # get blue input raster # do the multi-regression - result in h1 MultiRegression(h1, Rr, Rg, Rb); numeric r, c, a; print("Multi-Regression Output"); for r = 0 to 2 { for c = 0 to 3 { a = GetMatrixItem(h1, r, c); printf("%8.4f ", a); } print(); } CloseRaster(Rr); # do clean up CloseRaster(Rg); CloseRaster(Rb); DestroyMatrix(h1);
NullValue(Raster)
場所:
パラメータ:
戻り値
作成日時: 01-Jan-2003
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster R; GetInputRaster(R); numeric n=NullValue(R); print("Null value is",n); CloseRaster(R);
NumCols(Raster)
場所:
パラメータ:
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster R; GetInputRaster(R); numeric columns=NumCols(R); print("Number of columns:", columns); CloseRaster(R);
NumLins(Raster)
場所:
パラメータ:
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster R; GetInputRaster(R); numeric lines=NumLins(R); print("Number of lines:", lines); CloseRaster(R);
OpenRaster(Raster, filename$, objname$, Credentials)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster R; OpenRaster(R, "c:/data/cb_tm.rvc", "blue"); # or OpenRaster(R, "c:\\data\\cb_tm.rvc", "blue"); print("Line count: ", NumLins(R));
OpenRasterObject(Raster, object)
場所:
パラメータ:
戻り値
作成日時: 18-Nov-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# See also OpenRaster(), GetInputRaster() # as they are more straightforward for raster selection. raster R; class OBJECT obj; obj = SelectInputObject("RASTER", "Select your favorite raster"); OpenRasterObject(R, obj); print(R.$Info.Filename); print(R.$Info.Number); print(R.$Info.Name); print(R.$Info.Type);
PackRGB(color, bits, order$)
場所:
パラメータ:
戻り値
作成日時: 09-Apr-2002
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
PrincipleComponents(forwardMat, inverseMat, Raster1, Raster2, ...)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); # clear the console # declare raster variables raster Rr, Rg, Rb; raster R1, R2, R3; # declare matrices class MATRIX forwardMat, inverseMat, inMat, outMat; # create the transformation matrices # to send to principal companent function forwardMat = CreateMatrix(3, 3); inverseMat = CreateMatrix(3, 3); # outMat = (forward * inMat) inMat = CreateMatrix(3, 1); # use to calculate the transformation outMat = CreateMatrix(3, 1); # get three input rasters to do principal components on # get red input raster GetInputRaster(Rr); GetInputRaster(Rg); # get green input raster GetInputRaster(Rb); # get blue input raster # create the rasters to hold principal components # output values will contain negative numbers so # allways use signed type GetOutputRaster(R1, NumLins(Rr), NumCols(Rr), "64-bit float"); GetOutputRaster(R2, NumLins(Rr), NumCols(Rr), "64-bit float"); GetOutputRaster(R3, NumLins(Rr), NumCols(Rr), "64-bit float"); # get the tranformation matrices PrincipleComponents(forwardMat, inverseMat, Rr, Rg, Rb); # print the forward matrix print("Forward matrix"); numeric r, c; for r = 0 to 2 { for c = 0 to 2 { numeric a = GetMatrixItem(forwardMat, r, c); printf("%8.4f ", a); } print(); } # print the inverse matrix print("Inverse matrix"); for r = 0 to 2 { for c = 0 to 2 { a = GetMatrixItem(inverseMat, r, c); printf("%8.4f ", a); } print(); } # now compute the principal component values # for each point in raster numeric numColumns = NumCols(Rr); numeric numLines = NumLins(Rr); for r = 1 to NumLins(Rr) { for c = 1 to NumCols(Rr) { SetMatrixItem(inMat, 0, 0, Rr[r,c]); SetMatrixItem(inMat, 1, 0, Rg[r,c]); SetMatrixItem(inMat, 2, 0, Rb[r,c]); MultiplyMatrix(outMat, forwardMat, inMat); R1[r,c] = GetMatrixItem(outMat, 0, 0); R2[r,c] = GetMatrixItem(outMat, 1, 0); R3[r,c] = GetMatrixItem(outMat, 2, 0); } } # copy the georef CopySubobjects(Rr, R1, "GEOREF"); CopySubobjects(Rr, R2, "GEOREF"); CopySubobjects(Rr, R3, "GEOREF"); # do clean up CloseRaster(Rr); CloseRaster(Rg); CloseRaster(Rb); CloseRaster(R1); CloseRaster(R2); CloseRaster(R3); DestroyMatrix(forwardMat); DestroyMatrix(inverseMat); DestroyMatrix(inMat); DestroyMatrix(outMat);
PrincipleComponentsExt(forward, inverse, stats, Raster1, Raster2, ...)
場所:
パラメータ:
戻り値
作成日時: 21-Dec-2000
修正日時: 26-Mar-2004
TNTsml for Windows で使用可能: はい
例:
clear(); # clear the console # declare raster variables raster Rr, Rg, Rb; raster R1, R2, R3; # declare principal component stats object class PRINCOMPSTATS stats; # declare matrices class MATRIX forwardMat, inverseMat, inMat, outMat; array numeric forward[3,3], inverse[3,3]; # create the transformation matrices # to send to principal companent function forwardMat = CreateMatrix(3, 3); inverseMat = CreateMatrix(3, 3); # outMat = (forward * inMat) inMat = CreateMatrix(3, 1); # use to calculate the transformation outMat = CreateMatrix(3, 1); # get three input rasters to do principal components on # get red input raster GetInputRaster(Rr); GetInputRaster(Rg); # get green input raster GetInputRaster(Rb); # get blue input raster # create the rasters to hold principal components # output values will contain negative numbers so # allways use signed type GetOutputRaster(R1, NumLins(Rr), NumCols(Rr), "64-bit float"); GetOutputRaster(R2, NumLins(Rr), NumCols(Rr), "64-bit float"); GetOutputRaster(R3, NumLins(Rr), NumCols(Rr), "64-bit float"); # get the tranformation matrices PrincipleComponentsExt(forward, inverse, stats, Rr, Rg, Rb); # print the forward array and dump values into a matrix print("Forward matrix"); numeric r, c; for r = 1 to 3 { for c = 1 to 3 { numeric a = forward[r,c]; SetMatrixItem(forwardMat, r-1, c-1, a);# matrix is 0-indexed printf("%8.4f ", a); } print(); } # print the inverse array and dump values into a matrix print("Inverse matrix"); for r = 1 to 3 { for c = 1 to 3 { a = inverse[r,c]; SetMatrixItem(inverseMat, r-1, c-1, a);# matrix is 0-indexed printf("%8.4f ", a); } print(); } # now compute the principal component values # for each point in raster numeric numColumns = NumCols(Rr); numeric numLines = NumLins(Rr); for r = 1 to NumLins(Rr) { for c = 1 to NumCols(Rr) { SetMatrixItem(inMat, 0, 0, Rr[r,c]); SetMatrixItem(inMat, 1, 0, Rg[r,c]); SetMatrixItem(inMat, 2, 0, Rb[r,c]); MultiplyMatrix(outMat, forwardMat, inMat); R1[r,c] = GetMatrixItem(outMat, 0, 0); R2[r,c] = GetMatrixItem(outMat, 1, 0); R3[r,c] = GetMatrixItem(outMat, 2, 0); } } # print some of the computed stats as a demo report print(); print("The determinant result is: ", stats.Determinant); print("The total variance is: ", stats.TotalVariance); print("The correlation of bands 1,2: ", stats.GetCorrelation(1,2)); print("The correlation of bands 1,3: ", stats.GetCorrelation(1,3)); print("The correlation of bands 2,3: ", stats.GetCorrelation(2,3)); # copy the georef CopySubobjects(Rr, R1, "GEOREF"); CopySubobjects(Rr, R2, "GEOREF"); CopySubobjects(Rr, R3, "GEOREF"); # do clean up CloseRaster(Rr); CloseRaster(Rg); CloseRaster(Rb); CloseRaster(R1); CloseRaster(R2); CloseRaster(R3); DestroyMatrix(forwardMat); DestroyMatrix(inverseMat); DestroyMatrix(inMat); DestroyMatrix(outMat);
RasterApplyContrast(InputRaster, FileName$, ObjName$, Flag$)
場所:
パラメータ:
戻り値
作成日時: 11-Aug-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class DISP handle; raster Rvar, Ovar; OpenRaster(Rvar, "c:/tnt/samp.rvc", "RED"); RasterApplyContrast(Rvar, "c:/tnt/samp.rvc", "contsamp", "equalize"); OpenRaster(Ovar, "c:/tnt/samp.rvc", "contsamp"); handle=DispOpen(750,550); DispQuickAddRasterVar(handle, Ovar); DispRedraw(handle); CloseRaster(Rvar); CloseRaster(Ovar);
RasterApplyContrast2(InputRaster, OutputRaster, type$, SubobjectName$)
場所:
パラメータ:
戻り値
作成日時: 11-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster Rvar, OutRast; GetInputRaster(Rvar); GetOutputRaster(OutRast, NumLins(Rvar), NumCols(Rvar), "8-bit unsigned"); RasterApplyContrast2(Rvar, OutRast, "Subobject");
RasterCompress(SrcRaster, DestRaster, filename$, objname$, desc$, comptype$, compquality, copySubobjects, Credentials)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 09-Apr-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Raster Rin, Rout; numeric err = 0; GetInputRaster(Rin); string file$ = Rin.$INFO.Filename; string name$ = Rin.$INFO.Name + "_SML"; string desc$ = "Compressed raster"; # Function creates a new raster with 10:1 compression ratio err=RasterCompress(Rin, Rout, file$, name$, desc$, "JP2", 10); if (err >=0) { print(Rout.$INFO.Name); } else print ("An error occurred during compression");
RasterCopy(InputRaster, OutputRaster, srclin, srccol, height, width, destlin, destcol)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 21-Nov-2003
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# extract an interior portion of the input raster and copy to output raster Rin, Rout; GetInputRaster(Rin); numeric lines = NumLins(Rin); numeric cols = NumCols(Rin); numeric startLine = int(lines/4); numeric startColumn = int(cols/4); numeric numlines = int(lines/2); numeric numcols = int(cols/2); print(startLine); print(startColumn); print(numlines); print(numcols); GetOutputRaster(Rout, numlines, numcols, RastType(Rin)); RasterCopy(Rin, Rout, startLine, startColumn, numlines, numcols); CloseRaster(Rin); CloseRaster(Rout);
RasterExists(filename$, objectname$, Credentials)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
RasterFloodFill(Raster, lin, col, value)
場所:
パラメータ:
戻り値
作成日時: 21-Nov-2003
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); # # reclassify.sml # # This script is written to reclassify cell values in the user-entered input raster. # Reclassification is based on meeting certain criteria for class (value) and area. # For modification purposes, the variables used for this purpose are "threshold", # "oldValue", "and newValue". # Currently it is set to reclassify all areas of <5 acres in class '128' to class '0'. # class RASTER Rin; class RASTER Result; class STATUSDIALOG statusdialog; class STATUSCONTEXT statuscontext; # create the 5 acre threshold numeric thresholdAcres = 5; numeric oldValue = 128, newValue = 0; # Get the input and output rasters. GetInputRaster(Rin); IgnoreNull(Rin); GetOutputRaster(Result, NumLins(Rin), NumCols(Rin), RastType(Rin)); IgnoreNull(Result); # Copy all cell values printf("Copying source raster\n"); Result = Rin; # Get the georeference info CopySubobjects(Rin, Result); # get colormap, contrast, georef, etc. # Convert the threshold from Acres to cells numeric threshold = thresholdAcres * 4046.85642 / (LinScale(Rin) * ColScale(Rin)); printf("Eliminating solid features less than or equal to %g acres (%d cells)\n", thresholdAcres, threshold); numeric lin, col, r, up, left, count; foreach Result[lin, col] { r = Result[lin,col]; if (r == oldValue) { up = -1; left = -1; if (col > 1) left = Result[lin, col-1]; if (lin > 1) up = Result[lin-1, col]; #printf("R[%d,%d] = %d, Cell to the left = %d, Cell above = %d\n", lin, col, r, left, up); if (left != oldValue && up != oldValue) { #printf("Checking at %d,%d\n", lin, col); count = RasterGetSolidAreaSize(Result, lin, col, threshold+1); if (count <= threshold) { #printf("Filling at %d,%d - count = %d\n", lin, col, count); RasterFloodFill(Result, lin, col, newValue); } } } } CreateHistogram(Result); CreatePyramid(Result);
RasterGetSolidAreaSize(Raster, lin, col, maxsize)
場所:
パラメータ:
戻り値
作成日時: 21-Nov-2003
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); # # reclassify.sml # # This script is written to reclassify cell values in the user-entered input raster. # Reclassification is based on meeting certain criteria for class (value) and area. # For modification purposes, the variables used for this purpose are "threshold", # "oldValue", "and newValue". # Currently it is set to reclassify all areas of <5 acres in class '128' to class '0'. # class RASTER Rin; class RASTER Result; class STATUSDIALOG statusdialog; class STATUSCONTEXT statuscontext; # create the 5 acre threshold numeric thresholdAcres = 5; numeric oldValue = 128, newValue = 0; # Get the input and output rasters. GetInputRaster(Rin); IgnoreNull(Rin); GetOutputRaster(Result, NumLins(Rin), NumCols(Rin), RastType(Rin)); IgnoreNull(Result); # Copy all cell values printf("Copying source raster\n"); Result = Rin; # Get the georeference info CopySubobjects(Rin, Result); # get colormap, contrast, georef, etc. # Convert the threshold from Acres to cells numeric threshold = thresholdAcres * 4046.85642 / (LinScale(Rin) * ColScale(Rin)); printf("Eliminating solid features less than or equal to %g acres (%d cells)\n", thresholdAcres, threshold); numeric lin, col, r, up, left, count; foreach Result[lin, col] { r = Result[lin,col]; if (r == oldValue) { up = -1; left = -1; if (col > 1) left = Result[lin, col-1]; if (lin > 1) up = Result[lin-1, col]; #printf("R[%d,%d] = %d, Cell to the left = %d, Cell above = %d\n", lin, col, r, left, up); if (left != oldValue && up != oldValue) { #printf("Checking at %d,%d\n", lin, col); count = RasterGetSolidAreaSize(Result, lin, col, threshold+1); if (count <= threshold) { #printf("Filling at %d,%d - count = %d\n", lin, col, count); RasterFloodFill(Result, lin, col, newValue); } } } } CreateHistogram(Result); CreatePyramid(Result);
RasterLinearCombination(transformMat, outRVCFilename$, rasterNamePrefix$, rasterDescPrefix$, flags, inRas1, inRas2, ...)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# creating and filling in the transform matrix # # the matrix size is determined by the number # of input and output rasters: # number of columns = number of input rasters + 1 # number of rows = number of output rasters # column 1 hold offset coefficients # columns 2 to (N + 1) hold the coeffients for the N # output rasters # in general if: # N = number of output rasters, M = number of input rasters # # OutRasterN[r,c] = transformMatrix[N-1,0] # + transformMatrix[N-1,1] * # InRaster1[r,c] # + transformMatrix[N-1,2] * # InRaster2[r,c] # + ... # + transformMatrix[N-1,M] * # InRasterM[r,c] # # our matrix will be: # | 0.0 .213 .715 .072 | - coeff. for the first raster # | 0.0 .333 .333 .333 | - coeff. for the second raster # # our output rasters are created using these formulas: # # Lcombo1[r,c] = 0.0 + (.213 * Rred[r,c]) # + (.715 * Rgreen[r,c]) # + (.072 + Rblue[r,c]) # # Lcombo2[r,c] = 0.0 + (.333 * Rred[r,c]) # + (.333 * Rgreen[r,c]) # + (.333 + Rblue[r,c]) # # Compute brightness Raster from rgb rasters # the coefficents are only approximate, correct for NTSC(1953) # declare variables class MATRIX transform; raster Rred, Rgreen, Rblue; # set up variables to hold values for flags numeric flagNoAutoscale = 0; numeric flagAutoscale = 1; string outRVCFile$ = "c:/tnt/win32/Tntdata/cb_data/cb_tm.rvc"; # get the input rasters OpenRaster(Rred, outRVCFile$, "RED"); OpenRaster(Rgreen, outRVCFile$, "GREEN"); OpenRaster(Rblue, outRVCFile$, "BLUE"); numeric numInputRasters = 3; numeric numOutputRasters = 2; transform = CreateMatrix(numOutputRasters, numInputRasters+1); # output Raster one # set matrix items (coefficients) equal to correct # red, green, and blue contributions to brightness SetMatrixItem(transform, 0, 0, 0.0); # sets offset to zero SetMatrixItem(transform, 0, 1, .212); # red SetMatrixItem(transform, 0, 2, .715); # green SetMatrixItem(transform, 0, 3, .072); # blue # output Raster two # other method to compute brightness - not as good # set coefficients for average of red, green, and blue # sets offset to zero SetMatrixItem(transform, 1, 0, 0.0); SetMatrixItem(transform, 1, 1, .333); # red SetMatrixItem(transform, 1, 2, .333); # green SetMatrixItem(transform, 1, 3, .333); # blue numeric flags = 0; # no auto scale RasterLinearCombination(transform, outRVCFile$,"Lcombo", "Linear Combinations Test :", flags, Rred, Rgreen, Rblue); DestroyMatrix(transform); CloseRaster(Rred); CloseRaster(Rgreen); CloseRaster(Rblue);
RasterToBinaryViewshed(inRaster, OutRaster, nPoints, xMatrix, yMatrix, percent, height, zScale, maxdistance, horizstart, horizend, vertstart, vertend, earth_curv, invert_transp)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# VIEWSHED.sml # Computes binary viewshed raster from elevation raster input # and vector object containing lines. # Computes viewshed for all vertices on all lines # of a corresponding Vector object # Could use to get viewshed for all points # on one or more roads. ### Declarations array numeric xArray[10]; # use to hold line vertices array numeric yArray[10]; raster Rin, Rout; vector V; class GEOREF georefR, georefV; class TRANSPARM vecGeoToRastGeo; numeric numLines, numPoints; numeric thisLine, numPointsInThisLine; class MATRIX matX, matY; numeric currentPoint, i; numeric xVector, yVector, rCol, rLine; class POINT2D vecMapCoord, rastMapCoord; numeric percent, height, zScale; #### clear(); # clear the console # get the input and output raster and Vector object GetInputRaster( Rin ); GetInputVector( V ); GetOutputRaster( Rout, NumLins( Rin ), NumCols( Rin ), "binary" ); # get georef object id's for raster and vector georefR = GetLastUsedGeorefObject( Rin ); georefV = GetLastUsedGeorefObject( V ); vecGeoToRastGeo.InputProjection = georefV.Projection; vecGeoToRastGeo.OutputProjection = georefR.Projection; # first count total number of vertices in all lines numLines = NumVectorLines( V ); numPoints = 0; for thisLine = 1 to numLines { numPointsInThisLine = GetVectorLinePointList( V, xArray, yArray, thisLine ); numPoints += numPointsInThisLine; } # now create matrices large enough to hold points matX = CreateMatrix(1, numPoints ); matY = CreateMatrix(1, numPoints ); # now loop through lines and fill in matrices with points currentPoint = 0; # this will be our matrix index for thisLine = 1 to numLines { numPointsInThisLine = GetVectorLinePointList( V, xArray, yArray, thisLine ); for i = 1 to numPointsInThisLine { # convert vector object coordinates to map coordinates from its georef ObjectToMap( V, xArray[i], yArray[i], georefV, xVector, yVector ); # convert vector map coordinates to map coordinates in raster's georef vecMapCoord.x = xVector; # first assign map coordinates to a Point class vecMapCoord.y = yVector; # required by TRANSPARM # do conversion using method on class TRANSPARM rastMapCoord = vecGeoToRastGeo.ConvertPoint2DFwd(vecMapCoord); # convert vector coordinates to raster coordinates # note the order of rCol and rLine # col = x coord, row = y coord MapToObject( georefR, rastMapCoord.x, rastMapCoord.y, Rin, rCol, rLine ); # force to upper left corner rLine = floor( rLine ); rCol = floor( rCol ); # want matrix to index from zero to numPoints SetMatrixItem( matX, 0, currentPoint, rCol ); SetMatrixItem( matY, 0, currentPoint, rLine ); currentPoint += 1; } # end of for i } # end of for each line in V # set default values - want any one point to make "visible" percent = 100 / numPoints; height = 2; zScale = 1; # now create the viewshed Raster object RasterToBinaryViewshed( Rin, Rout, numPoints, matX, matY, percent, height, zScale ); # clean up GeorefFree( georefR ); # must free up id's GeorefFree( georefV ); DestroyMatrix( matX ); DestroyMatrix( matY ); CloseRaster( Rin ); CloseRaster( Rout );
RastType(Raster)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster R; GetInputRaster(R); print(RastType(R)); CloseRaster(R);
ReadHistogram(Raster, histo)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster R; array numeric histo[256]; GetInputRaster(R, 0, 0, "8-bit unsigned"); ReadHistogram(R, histo); numeric i; for i=0 to 255 print(i, histo[i]); CloseRaster(R);
ResampleRasterToCellSize(InRast, OutRast, linscale, colscale, model$, method$, DEM, geoidHeight)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 20-May-2004
修正日時: 20-May-2004
TNTsml for Windows で使用可能: はい
例:
class RASTER Rin, Rout; # decrease resolution numeric scalefactor = .5; GetInputRaster(Rin); numeric outLins = NumLins(Rin) * scalefactor; # inversely related to scale numeric outCols = NumCols(Rin) * scalefactor; GetOutputRaster(Rout, outLins, outCols, RastType(Rin)); numeric outLinScale = LinScale(Rin) / scalefactor; # double line scale numeric outColScale = ColScale(Rin) / scalefactor; ResampleRasterToCellSize(Rin, Rout, outLinScale, outColScale, "affine", "nearest"); CloseRaster(Rin); CloseRaster(Rout);
ResampleRasterToMatch(InRast, RefRast, OutRast, model$, method$, DEM, geoidHeight)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 20-May-2004
修正日時: 20-May-2004
TNTsml for Windows で使用可能: はい
例:
raster Rin, Rref, Rout; GetInputRaster(Rin); GetInputRaster(Rref); numeric lin=NumLins(Rref); numeric col=NumCols(Rref); string type$=RastType(Rref); printf("Enter new null value: "); numeric newNull=input(255); GetOutputRaster(Rout, lin, col, type$); SetNull(Rout, newNull); string model$="affine"; string method$="nearest neighbor"; ResampleRasterToMatch(Rin, Rref, Rout, model$, method$); CloseRaster(Rin); CloseRaster(Rref); CloseRaster(Rout);
SelectInputObject(type$, prompt$, filename$, objname$)
場所:
パラメータ:
戻り値
作成日時: 18-Nov-1998
修正日時: 17-May-2000
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/doqq7.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
SetNull(Raster, nullvalue)
場所:
パラメータ:
詳細と仮定
詳細と仮定
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster R; GetInputRaster(R, 0, 0, "8-bit unsigned"); numeric x=PopupNum("Enter integer.", 0, 0, 255, 0); SetNull(R, x); CloseRaster(R);
SetScale(Raster, linscale, colscale)
場所:
パラメータ:
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster R; GetInputRaster(R, 0, 0, "8-bit unsigned"); numeric h, v; h=PopupNum("Enter h scale.", 0, 0, 255, 0); v=PopupNum("Enter v scale.", 0, 0, 255, 0); SetScale(R, h, v); CloseRaster(R);
UnpackRGB(value, bits, order$)
場所:
パラメータ:
戻り値
作成日時: 09-Apr-2002
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
UseNull(Raster, temporary)
場所:
パラメータ:
詳細と仮定
詳細と仮定
戻り値
作成日時: 01-Jan-2004
修正日時: 22-Mar-2005
TNTsml for Windows で使用可能: はい
例:
clear(); raster R; GetInputRaster(R); if (PopupYesNo("Use the null value?", 1)) then UseNull(R); CloseRaster(R);
CloseVector(Vector)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
vector V; GetInputVector(V); # do something with V CloseVector(V);
CreateTempVector(Vector, flag1$, flag2$, extents)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 10-Apr-1998
修正日時: 19-May-1998
TNTsml for Windows で使用可能: はい
例:
vector VTemp; CreateTempVector(VTemp); # do something with it CloseVector(VTemp);
CreateVector(Vector, filename$, objname$, desc$, flag1$, flag2$, extents, Credentials)
場所:
パラメータ:
戻り値
作成日時: 07-May-1998
修正日時: 19-May-1998
TNTsml for Windows で使用可能: はい
例:
vector Vpoly, Vplanar, Vnetwork, Vnotopo; CreateVector(Vpoly, "c:/tnt/testCreateVector.rvc", "Vpoly", "Polygonal", "Polygonal"); CreateVector(Vplanar, "c:/tnt/testCreateVector.rvc", "Vplanar", "Planar", "Planar"); CreateVector(Vnetwork, "c:/tnt/testCreateVector.rvc", "Vnetwork", "Network", "Network"); CreateVector(Vnotopo, "c:/tnt/testCreateVector.rvc", "Vnotopo", "NoTopology", "NoTopology"); # Do something with one of the objects # add three points to the network vector VectorAddPoint(Vnetwork, 0, 0); VectorAddPoint(Vnetwork, 25, 25); VectorAddPoint(Vnetwork, 50, 50); # close the objects CloseVector(Vpoly); CloseVector(Vplanar); CloseVector(Vnetwork); CloseVector(Vnotopo);
FindClosestLabel(Vector, x, y, georef, maxdist, Distance)
場所:
パラメータ:
戻り値
作成日時: 22-Jun-1981
修正日時: 24-Jun-1999
TNTsml for Windows で使用可能: はい
例:
# Find the label closest to the 'object center' vector Vin; class Georef georef; GetInputVector(Vin); georef = GetGeorefObject(Vin); # find the x and y midpoint numeric xMin, xMax, yMin, yMax; GetObjectExtents(Vin, xMin, yMin, xMax, yMax, georef); numeric midX = (xMax + xMin)/2; numeric midY = (yMax + yMin)/2; numeric dist = xMax-midX; numeric numberLabels = NumVectorLabels(Vin); numeric labelnum = FindClosestLabel(Vin, midX, midY, georef, dist); print("number", numberLabels, "closest", labelnum);
FindClosestLine(Vector, x, y, georef, maxdist, Distance)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: 24-Jun-1999
TNTsml for Windows で使用可能: はい
例:
vector Vvar; class Georef georef; clear(); GetInputVector(Vvar); georef = GetGeorefObject(Vvar); print("Enter x."); numeric x = PopupNum("Enter x."); print("Enter y."); numeric y = PopupNum("Enter y."); print("Enter maxDistance."); numeric maxDistance = PopupNum("Enter maxDistance"); numeric num = FindClosestLine(Vvar, x, y, georef, maxDistance); print(num);
FindClosestNode(Vector, x, y, georef, maxdist, Distance)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: 24-Jun-1999
TNTsml for Windows で使用可能: はい
例:
clear(); Vector Vvar; class Georef georef; GetInputVector(Vvar); georef = GetGeorefObject(Vvar); print("Enter x."); numeric x = PopupNum("Enter x."); print("Enter y."); numeric y = PopupNum("Enter y."); print("Enter maxDistance."); numeric maxDistance = PopupNum("Enter maxDistance."); numeric num=FindClosestNode(Vvar, x, y, georef, maxDistance); print(num);
FindClosestPoint(Vector, x, y, georef, maxdist, Distance)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: 24-Jun-1999
TNTsml for Windows で使用可能: はい
例:
clear(); Vector Vvar; class Georef georef; GetInputVector(Vvar); georef = GetGeorefObject(Vvar); print("Enter x."); numeric x = PopupNum("Enter x."); print("Enter y."); numeric y = PopupNum("Enter y."); print("Enter maxDistance."); numeric maxDistance = PopupNum("Enter maxDistance."); numeric num = FindClosestPoint(Vvar, x, y, georef, maxDistance); print(num);
FindClosestPoly(Vector, x, y, georef, maxdist, Distance)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: 24-Jun-1999
TNTsml for Windows で使用可能: はい
例:
clear(); Vector Vvar; class Georef georef; numeric x, y, maxDistance, num; GetInputVector(Vvar); georef = GetGeorefObject(Vvar); print("Enter x."); numeric x = PopupNum("Enter x."); print("Enter y."); numeric y = PopupNum("Enter y."); print("Enter maxDistance."); numeric maxDistance = PopupNum("Enter maxDistance."); numeric num=FindClosestPoly(Vvar, x, y, georef, maxDistance); print(num);
GenerateCrossSection(polyline, srcObject, surfObject, destObject, baseValue, flags$)
場所:
パラメータ:
戻り値
作成日時: 23-Apr-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Vector src, dest; Raster surf; # set the base value numeric baseValue = 0; # get the input objects GetInputVector(src); GetInputRaster(surf); GetOutputVector(dest); # set up the polyline (w/ georeferenced pt coords) class POLYLINE polyline; numeric xmin, ymin, xmax, ymax; class GEOREF g = GetLastUsedGeorefObject(src); GetObjectExtents(src, xmin, ymin, xmax, ymax, g); # add the points to the polyline class POINT2D tmp; tmp.x = xmin; tmp.y = ymin; polyline.AppendVertex(tmp); tmp.x = xmax; tmp.y = ymax; polyline.AppendVertex(tmp); # do the cross section numeric err = GenerateCrossSection(polyline, src, surf, dest, baseValue, "NoGeoreference"); PopupError(err);
GetInputVector(Vector)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
vector Vvar; GetInputVector(Vvar); # do something with it CloseVector(Vvar);
GetInputVectorList(VectorList, prompt$)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/Misc/vector2raster.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
GetOutputVector(Vector, flag1$, flag2$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector V; array numeric xPoints[10], yPoints[10]; # for multiple flags simply comma seperate them as below GetOutputVector(V, "VectorToolkit", "NoQtree,NoDBStatTable"); # draw some boxes - this will create polygons # all closed lines are converted to polygons xPoints[1] = 0; yPoints[1] = 0; xPoints[2] = 100; yPoints[2] = 0; xPoints[3] = 100; yPoints[3] = 100; xPoints[4] = 0; yPoints[4] = 100; xPoints[5] = 0; yPoints[5] = 0; VectorAddLine(V, 5, xPoints, yPoints); # now add some points numeric i; for i = 1 to 4 { VectorAddPoint(V, xPoints[i] + 150, yPoints[i] + 150); } numeric numPolys = NumVectorPolys(V); numeric numberPoints = NumVectorPoints(V); print("number of polygons, points: ", numPolys, numberPoints);
GetVectorLine(Vectvar, element)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector V; class POLYLINE pline; numeric linenum = 10; GetInputVector(V); pline = GetVectorLine(V, linenum); print("Length =",pline.ComputeLength()); print("NumPts =",pline.GetNumPoints()); if(pline.IsClosed()) print("The line is closed"); else print("The line is not closed");
GetVectorLinePointList(Vector, xarray, yarray, line, zarray)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
array numeric xArray[10], yArray[10], zArray[10]; # will be resized automatically vector Vvar; GetInputVector(Vvar); numeric numLines, nPoints; numLines = NumVectorLines(Vvar); nPoints = GetVectorLinePointList(Vvar, xArray, yArray, 1, zArray); numeric i; for i = 1 to nPoints { print(xArray[i], yArray[i], zArray[i]); }
GetVectorNodeLineList(Vector, lines, node)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector Vvar; array numeric linelist[10]; # will be resized automatically GetVectorNodeLineList(Vvar, linelist, 1);
GetVectorPoly(Vectvar, element)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GetVectorPolyAdjacentPolyList(Vector, polygonList, polygonNumber)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# reads the poly list of all adjacent polygons to a given polygon # it only returns polygons that have common lines !!! # not a single common node vector V; array numeric polygonList[10]; # array to hold poly list clear(); GetInputVector(V); numeric polygonNumber = 150; # polygonNumber = 150 works for cb_soils/CBSOILS_Lite numeric numadjacent = GetVectorPolyAdjacentPolyList(V, polygonList, polygonNumber); string temp$ = "number of polygons adjacent to polygon:"; print(temp$, polygonNumber, " = ", numadjacent); numeric i; for i = 1 to numadjacent { print(i, ":", polygonList[i]); } print("Done");
GetVectorPolyIslandList(Vector, islands, polygon)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector Vvar; array numeric islandlist[10]; # will be resized automatically GetVectorPolyIslandList(Vvar, islandlist, 1);
GetVectorPolyLineList(Vector, lines, polygon)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector Vvar; array numeric linelist[10]; # will be resized automatically GetVectorPolyLineList(Vvar, linelist, 1);
NumVectorLabels(Vector)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector Vin; GetInputVector(Vin); numeric numLabels = NumVectorLabels(Vin); print("number of labels: ", numLabels);
NumVectorLines(Vector)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector V; GetInputVector(V); numeric n=NumVectorLines(V); print("Line count: ", n);
NumVectorNodes(Vector)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector V; GetInputVector(V); numeric n=NumVectorNodes(V); print("Node count: ", n);
NumVectorPoints(Vector)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector V; GetInputVector(V); numeric n=NumVectorPoints(V); print("Point count: ", n);
NumVectorPolys(Vector)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector V; GetInputVector(V); numeric n=NumVectorPolys(V); print("Polygon count: ", n);
OpenInputVectorList(VectorList, filename1$, objname1$, filename2$, objname2$, ...$)
場所:
パラメータ:
戻り値
作成日時: 19-May-1998
修正日時: 19-May-1998
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
OpenVector(Vector, filename$, objname$, flag1$, flag2$, Credentials)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
vector V; string fileName$ = "c:/tnt/data/cb_data/cb_soils.rvc"; string objectName$ = "CBSOILS_Lite"; # open the vector for editing with the toolkit OpenVector(V, fileName$, objectName$, "VectorToolkit");
VectMerge(Obj1, Obj2, ...)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
vector V1, V2, Vmerge; GetInputVector(V1); GetInputVector(V2); GetOutputVector(Vmerge); Vmerge = VectMerge(V1, V2); # get georef for merge class Georef georef; georef = GetLastUsedGeorefObject(V1); CopyGeorefToObject(Vmerge, georef);
VectorAND(OperatorVector, SourceVector, flags$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/vecop.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
VectorCopyElements(SourceVector, DestVector, flags$, pointQuery$, lineQuery$, polyQuery$)
場所:
パラメータ:
戻り値
作成日時: 22-Mar-2004
修正日時: 13-May-2004
TNTsml for Windows で使用可能: はい
例:
vector V1, V2; GetInputVector(V1); GetOutputVector(V2); VectorCopyElements(V1, V2, "None","0","LINESTATS.Length>1000","0"); #VectorCopyElements(V1, V2); # for a 'straight copy'
VectorElementInRegion(Region, Vectvar, element, ElemType$, TestType$)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector Vin; region reg; GetInputVector(Vin); GetInputRegion(reg); numeric elementNumber = 1; numeric inRegion = VectorElementInRegion(reg.$Data, Vin, elementNumber, "line", "CompletelyInside"); if (inRegion) print( "element ", elementNumber, "is CompletelyInside\n");
VectorExists(filename$, objectname$, Credentials)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); string file$="c:/tnt/data/sf_data/haywsoil.rvc"; string ob$="hsoils"; if (VectorExists(file$, ob$)) then print("Vector ", ob$, "Exists in ", file$);
VectorExtract(OperatorVector, SourceVector, operation, flags$, pointQuery$, lineQuery$, polyQuery$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
vector Voperator, Vsource, Vout1, Vout2; # get the input vectors GetInputVector(Voperator); GetInputVector(Vsource); # get the output vector GetOutputVector(Vout1); # use default flags string operation$ = "PartInside"; Vout1 = VectorExtract(Voperator, Vsource, operation$); GetOutputVector(Vout2); operation$ = "CompInside"; string flag$ = "TableRemoveDupRec,RemExRecords"; # using optional flags (example showing two flags) Vout2 = VectorExtract(Voperator, Vout1, operation$, flag$);
VectorIsEquivalent(Vector1, Vector2)
場所:
パラメータ:
戻り値
作成日時: 23-Apr-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
VectorLabelAddTextStyle(Vector, ElemNum, name$, TextStyle)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 28-Oct-2005
修正日時: 28-Oct-2005
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
VectorLabelGetBaseline(Vector, ElemNum, Polyline, IsBaselineFit, IsBaselineSplineFit)
場所:
パラメータ:
戻り値
作成日時: 28-Oct-2005
修正日時: 28-Oct-2005
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
VectorLabelGetHeight(Vector, ElemNum)
場所:
パラメータ:
戻り値
作成日時: 28-Oct-2005
修正日時: 28-Oct-2005
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
VectorLabelGetString(Vector, ElemNum)
場所:
パラメータ:
戻り値
作成日時: 28-Oct-2005
修正日時: 28-Oct-2005
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
VectorLabelGetTextStyle(Vector, ElemNum, TextStyle, name$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 28-Oct-2005
修正日時: 28-Oct-2005
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
VectorLabelSetBaseline(Vector, ElemNum, Polyline, BaselineFit$)
場所:
パラメータ:
戻り値
作成日時: 28-Oct-2005
修正日時: 28-Oct-2005
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
VectorLabelSetHeight(Vector, ElemNum, Height)
場所:
パラメータ:
戻り値
作成日時: 28-Oct-2005
修正日時: 28-Oct-2005
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
VectorLabelSetString(Vector, ElemNum, string$)
場所:
パラメータ:
戻り値
作成日時: 28-Oct-2005
修正日時: 28-Oct-2005
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
VectorLabelSetTextStyle(Vector, ElemNum, TextStyle)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 28-Oct-2005
修正日時: 28-Oct-2005
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
VectorOR(OperatorVector, SourceVector, flags$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/vecop.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
VectorReplace(OperatorVector, SourceVector, flags$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/vecop.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
VectorSubtract(OperatorVector, SourceVector, flags$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/vecop.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
VectorToolkitInit(Vector, flag2$)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/Misc/addline.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
VectorWarp(SourceVector, DestVector, Transparm, DenseAccuracy)
場所:
パラメータ:
戻り値
作成日時: 04-May-2004
修正日時: 13-May-2004
TNTsml for Windows で使用可能: はい
例:
vector Vin, Vout; class TRANSPARM transparm; class GEOREF georef; class MAPPROJ inputProj, outputProj; GetInputVector(Vin); GetOutputVector(Vout); georef = GetLastUsedGeorefObject(Vin); inputProj = georef.Projection; outputProj.SetSystemUTM(13); outputProj.Datum = "North American 1927 - United States (NADCON)"; transparm.InputProjection = inputProj; transparm.OutputProjection = outputProj; VectorWarp(Vin, Vout, transparm, 10); print("IN:", transparm.inputProjection.System); print("OUT:", transparm.outputProjection.System);
VectorXOR(OperatorVector, SourceVector, flags$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/vecop.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
CopyObject(srcfilename$, srcobjectnumber, destfilename$, parentobjectnumber, Credentials)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
string srcfile$="/data/cb_data/cb_tm.rvc"; string destfile$="/data/cb_data/temp.rvc"; CopyObject(srcfile$, 1, destfile$, 1);
CopyObjectWithoutSubobjects(srcfilename$, srcobjectnumber, destfilename$, parentobjectnumber, Credentials)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
string srcfile$="/data/cb_data/cb_tm.rvc"; string destfile$="/data/cb_data/temp.rvc"; CopyObjectWithoutSubobjects(srcfile$, 1, destfile$, 1);
CopySubobjects(SourceObject, DestObject, type$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster A, B; GetInputRaster(A); GetOutputRaster(B, NumLins(A), NumCols(A), RastType(A)); CopySubobjects(A, B); CloseRaster(A); CloseRaster(B);
CreateProjectFile(filename$, description$)
場所:
パラメータ:
戻り値
作成日時: 02-Sep-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
CreateProjectFile("c:/ProjName.rvc", "Project file created in SML");
DeleteObject(filename$, objectnumber, Credentials)
場所:
パラメータ:
戻り値
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
string fileName$="/data/cb_data/cb_tm.rvc"; DeleteObject(fileName$, 1);
DeleteSubobjects(Object, type$)
場所:
パラメータ:
詳細と仮定
戻り値
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster Rvar; DeleteSubobjects(Rvar, "Pyramid");
DisableCredentialsPopup(disable)
場所:
パラメータ:
戻り値
作成日時: 09-Dec-2005
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
FindInvalidObjects(filename$, doSubLevels, invalidList, singletonList, Credentials)
場所:
パラメータ:
戻り値
作成日時: 20-May-2004
修正日時: 20-Dec-2005
TNTsml for Windows で使用可能: はい
例:
clear(); proc printErrors(string file$, class STRINGLIST invalid, class STRINGLIST singleton) { print(file$); numeric numInvalid = invalid.GetNumItems(); numeric numSingle = singleton.GetNumItems(); numeric i=0; if (numInvalid > 0) { print("INVALID:"); for (i=0; i0) { print("DUPLICATES:"); for (i=0; i
GetAllObjectNames
Get a list of all the object names in an RVC file
GetAllObjectNames(filename$, type$, parent, notype, nopath, Credentials)
場所:
オブジェクト
パラメータ:
string filename$
Object filename
string type$ (オプション)
Object Type to filter for
numeric parent (オプション)
可能性のある値:
"ALL"
All objects
"RASTER"
Raster object
"VECTOR"
Vector object
"CAD"
CAD object
"TIN"
TIN object
"SML"
SML object
"FOLDER"
Folder
"STYLE"
Style object
"DBASE"
General database object
"GEOREF"
Georeference object
"HISTO"
Histogram object
"RDBASE"
Raster database object
"PTDBAS"
Vector point database object
"LDBASE"
Vector line database object
"PDBASE"
Vector polygon database object
"NDBASE"
Vector node database object
"CDBASE"
CAD database object
"TDBASE"
TIN database object
"VDBASE"
Vector database object
"REGION"
Region object
"TABLE"
Table object
Parent object number (default is file)
numeric notype (オプション)
If 1 the return value does not include the object types. The default is 0.
numeric nopath (オプション)
If 1 the return value only has object name, not object path. The default is 1.
class RVC_CREDENTIALS Credentials (オプション)
Credentials Object
戻り値
class STRINGLIST
作成日時: 09-Apr-2002
修正日時: 22-Apr-2004
TNTsml for Windows で使用可能: はい
例:
clear(); class STRINGLIST objnames; objnames = GetAllObjectNames("c:/data/cb_data/cb_elev.rvc","Raster"); numeric i; for i=0 to objnames.GetNumItems()-1 { print (objnames.GetString(i)); }
GetAllObjectNumbers
Determines if object exists in project file
GetAllObjectNumbers(filename$, array, object$, parent, Credentials)
場所:
オブジェクト
パラメータ:
string filename$
A string containing path and filename of the RVC file.
array array
Array to store the object numbers in.
string object$ (オプション)
Object Type to filter for
numeric parent (オプション)
可能性のある値:
"ALL"
All objects
"RASTER"
Raster object
"VECTOR"
Vector object
"CAD"
CAD object
"TIN"
TIN object
"SML"
SML object
"FOLDER"
Folder
"STYLE"
Style object
"DBASE"
General database object
"GEOREF"
Georeference object
"HISTO"
Histogram object
"RDBASE"
Raster database object
"PTDBAS"
Vector point database object
"LDBASE"
Vector line database object
"PDBASE"
Vector polygon database object
"NDBASE"
Vector node database object
"CDBASE"
CAD database object
"TDBASE"
TIN database object
"VDBASE"
Vector database object
"REGION"
Region object
"TABLE"
Table object
Parent object number (optional - if omitted, will assume main level objects
class RVC_CREDENTIALS Credentials (オプション)
Credentials Object
戻り値
numeric
Number of object numbers in array.
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); array numeric objnums[10]; numeric max = GetAllObjectNumbers("c:/data/cb_data/cb_elev.rvc",objnums,"Raster"); print(max); numeric i; for i=1 to max { print (objnums[i]); }
GetObjectDescription
Gets the description of an object by object number
GetObjectDescription(filename$, objectnumber, Credentials)
場所:
オブジェクト
パラメータ:
string filename$
A string indicating path and project name
numeric objectnumber
A valid object number
class RVC_CREDENTIALS Credentials (オプション)
Credentials Object
戻り値
string
a string containing the name of the object, or "" if
object not found
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
string fileName$="/data/cb_data/cb_tm.rvc"; GetObjectDescription(fileName$, 1);
GetObjectExtents
Returns the x and y extents for a CAD, TIN, vector, or raster object
GetObjectExtents(Object, xMin, yMin, xMax, yMax, georef)
場所:
オブジェクト
パラメータ:
Raster, Vector or CAD Object
A valid vector, CAD, raster, or TIN object
numeric variable xMin
Minimum x value returned
numeric variable yMin
Minimum y value returned
numeric variable xMax
Maximum x value returned
numeric variable yMax
Maximum y value returned
class GEOREF georef (オプション)
Optional - georef object (if not used values will be in object coordinates)
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector V; # vector object class Georef vGeoref; GetInputVector(V); numeric xMin, yMin, xMax, yMax; GetObjectExtents(V, xMin, yMin, xMax, yMax); print("vector extents xMin, yMin, xMax, yMax"); printf("%10.2f %10.2f %10.2f %10.2f \n", xMin, yMin, xMax, yMax); vGeoref = GetLastUsedGeorefObject(V); GetObjectExtents(V, xMin, yMin, xMax, yMax, vGeoref); print("vector extents xMin, yMin, xMax, yMax"); printf("%10.2f %10.2f %10.2f %10.2f \n", xMin, yMin, xMax, yMax);
GetObjectExtentsRegion
Get the extents of an object as a region
GetObjectExtentsRegion(Object, georef)
場所:
オブジェクト
パラメータ:
Raster, Vector or CAD Object
A valid (Vector, CAD, Raster, or TIN object)
class GEOREF georef (オプション)
Optional georef object - if not used values will be in object coordinates
戻り値
class REGION2D
作成日時: 16-Feb-2000
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster R; region reg; class Georef georef; GetInputRaster(R); georef = GetLastUsedGeorefObject(R); reg = GetObjectExtentsRegion(R, georef); SaveRegion(reg, R.$Info.Filename, "region", R.$Info.Name + " extents region");
GetObjectFileName
Returns the path qualified RVC file name for an object.
GetObjectFileName(Object)
場所:
オブジェクト
パラメータ:
Raster, Vector or CAD Object
The afore-mentioned object
戻り値
string
A string containing the path plus filename.
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster Rin; vector Vin; tin TinIn; string str$; numeric objNum; GetInputRaster(Rin); # get the RVC file name str$ = GetObjectFileName(Rin); objNum = GetObjectNumber(Rin); print("Raster Object Number: ", objNum, "RVC file Name: ", str$); GetInputVector(Vin); # get the RVC file name str$ = GetObjectFileName(Vin); objNum = GetObjectNumber(Vin); print("Vector Object Number: ", objNum, "RVC file Name: ", str$); GetInputTIN(TinIn); # get the RVC file name str$ = GetObjectFileName(TinIn); objNum = GetObjectNumber(TinIn); print("TIN Object Number: ", objNum, "RVC file Name: ", str$);
GetObjectName
Gets the name of an object by object number
GetObjectName(filename$, objectnumber, Credentials)
場所:
オブジェクト
パラメータ:
string filename$
A string indicating path and project name
numeric objectnumber
A valid object number
class RVC_CREDENTIALS Credentials (オプション)
Credentials Object
戻り値
string
a string containing the name of the object, or "" if object not found
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
string fileName$="c:/data/cb_data/cb_tm.rvc"; GetObjectName(fileName$, 1);
GetObjectNumber
Returns the object number for a Raster, Vector, TIN, or CAD object
GetObjectNumber(inObject)
場所:
オブジェクト
パラメータ:
Raster, Vector or CAD inObject
The Object
詳細と仮定
The object exists.
戻り値
numeric
The object number.
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster R; GetInputRaster(R); string fileName$=R.$Info.Filename; numeric objectNumber=GetObjectNumber(R); SetObjectDescription(fileName$, objectNumber, "A New Description");
GetObjectSize
Get the number of bytes in an object
GetObjectSize(Object)
場所:
オブジェクト
パラメータ:
Raster, Vector or CAD Object
The object
戻り値
numeric
作成日時: 18-Dec-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GetObjectZExtents
Returns the z extents for a CAD, TIN, or vector object
GetObjectZExtents(Object, zMin, zMax)
場所:
オブジェクト
パラメータ:
Raster, Vector or CAD Object
A valid CAD, TIN, or vector object
numeric variable zMin (オプション)
Minimum z value returned
numeric variable zMax (オプション)
Maximum z value returned
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector V; # vector object numeric zMin, zMax; GetInputVector(V); GetObjectZExtents(V, zMin, zMax); print("vector z extents - zMin, zMax"); printf("%10.2f %10.2f \n", zMin, zMax);
MakeRVCFolder
Creates a folder in an RVC project.
MakeRVCFolder(filename$, foldername$, description$, parentfolder$, Credentials)
場所:
オブジェクト
パラメータ:
string filename$
RVC project filename.
string foldername$
Name of folder to be created.
string description$
Description of folder.
string parentfolder$ (オプション)
(optional) Name of parent folder for creating a folder in a folder.
class RVC_CREDENTIALS Credentials (オプション)
Credentials Object
戻り値
なし
作成日時: 20-Jul-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
MakeRVCFolder("c:/tnt/testdata.rvc","NewFolder","A new folder","Users");
ObjectExists
Determines if object exists in project file
ObjectExists(filename$, objectname$, type$, Credentials)
場所:
オブジェクト
パラメータ:
string filename$
A string containing path and filename
string objectname$
A string containing objects name
string type$ (オプション)
The object type (the default is "all")
class RVC_CREDENTIALS Credentials (オプション)
可能性のある値:
"ALL"
All objects
"RASTER"
Raster object
"VECTOR"
Vector object
"CAD"
CAD object
"TIN"
TIN object
"SML"
SML object
"FOLDER"
Folder
"STYLE"
Style object
"DBASE"
General database object
"GEOREF"
Georeference object
"HISTO"
Histogram object
"RDBASE"
Raster database object
"PTDBAS"
Vector point database object
"LDBASE"
Vector line database object
"PDBASE"
Vector polygon database object
"NDBASE"
Vector node database object
"CDBASE"
CAD database object
"TDBASE"
TIN database object
"VDBASE"
Vector database object
"REGION"
Region object
"TABLE"
Table object
Credentials Object
詳細と仮定
A blank object name ("") is used to determine if ANY objects of the given type exist.
戻り値
numeric
1 if it exists, 0 if it doesn't
作成日時: 24-Jun-1999
修正日時: 28-Jan-2004
TNTsml for Windows で使用可能: はい
例:
clear(); string file$="c:/data/sf_data/haywsoil"; string ob$="hsoils"; if (ObjectExists(file$, ob$)) then print("Object", ob$, "Exists in", file$); else print("Object", ob$, "Does not exist in", file$);
ObjectNumber
Returns an object number used by several object and display functions
ObjectNumber(filename$, objectname$, type$, Credentials)
場所:
オブジェクト
パラメータ:
string filename$
A string indicating path and project name
string objectname$
A string indicating name of object
string type$
- object type (see below)
class RVC_CREDENTIALS Credentials (オプション)
"FILE", File type
"FOLDER", An object to contain other objects
"RASTER", Raster object
"VECTOR", VECTOR object
"CAD", CAD object
"DBASE", General/raster database
"STYLE", Drawing style object
"QUERY", Generic database query string
"FILTER", Spatial filter description
"VIDSEQ", Ref for sequence of frames on video disk
"GEOREF", Georeference object
"PAGELT", Information for page layouts
"HYPER", Database referenced by HyperIndex
"DBFORM", Database display layout
"TPOINT", Tie point list
"HISTO", Histogram object
"CONTAB", Contrasting table
"2DHIST", Information about 2-D histogram
"COLMAP", Color table for rasters
"RDBASE", Db record list for rasters
"FPROC", Information to match frequency-domain rasters
"RTREND", Trend Information
"SPOTHR", Header (leader) file from SPOT tape
"CAMERA", Camera calibration information
"PTDBAS", Db record list for point elements
"LDBASE", Db record list for line elements
"PDBASE", Db record list for polygon elements
"NDBASE", Db record list for node elements
"CDBASE", Db record list for CAD object
"COLBAL", Printer color balance
"PRTDEF", Description for raster printer devices
"PLOTDF", Description for pen plotter devices
"OFONT", Outline (stroke) font
"GENREF", Generic reference object, not user-viewable object
"SCANRF", Description for scanners
"XYDIG", Description for XY digitizer devices
"D2DGRP", Display group layout information
"D2DWIN", Display window layout information
"TIN", TIN object
"DPARM", Display parameter structure
"LEGEND", Legend object
"TEXT", Generic Text Object
"TDBASE", Database for TIN objects
"VDBASE", Database for vector objects
"REGION", REGION object
"ASSOC", External file association object
"QTREE", Search Quad Tree object
"DBPARM", Database parameters object
"THEME", Theme Mapping parameters object
"METADT", Metadata object - text
"TABLE", Table OTYPE tag for databases
"INVDBL", Database table to element lists
"EDPARM", Object Editor parameter structure
"DLAYOT", Display layout information
"SML", Stand-alone SML Script
"SPECT", Spectral object
"RASTST", Raster Set object
"SENSOR", Sensor calibration information for spectral bands
"DSIM3D", Display 3D simulation parameters object
"HYPSPC", HyperSpectral object
"DBCONS", Database table constraint information
可能性のある値:
"ALL"
All objects
"RASTER"
Raster object
"VECTOR"
Vector object
"CAD"
CAD object
"TIN"
TIN object
"SML"
SML object
"FOLDER"
Folder
"STYLE"
Style object
"DBASE"
General database object
"GEOREF"
Georeference object
"HISTO"
Histogram object
"RDBASE"
Raster database object
"PTDBAS"
Vector point database object
"LDBASE"
Vector line database object
"PDBASE"
Vector polygon database object
"NDBASE"
Vector node database object
"CDBASE"
CAD database object
"TDBASE"
TIN database object
"VDBASE"
Vector database object
"REGION"
Region object
"TABLE"
Table object
Credentials Object
詳細と仮定
returns 0 if no valid object found
戻り値
numeric
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); string fileName$="/data/cb_data/cb_tm.rvc"; string obname$="TM_2"; numeric objectNumber=ObjectNumber(fileName$, obname$, "raster"); GetObjectDescription(fileName$, objectNumber);
PackRVC
Compresses the rvc file eliminating unused space
PackRVC(filename$)
場所:
オブジェクト
パラメータ:
string filename$
The rvc file to compress
戻り値
numeric
作成日時: 06-Feb-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ProjectFileIsLocked
Returns true if the Project file is locked
ProjectFileIsLocked(filename$)
場所:
オブジェクト
パラメータ:
string filename$
Filename of the project file
戻り値
numeric
作成日時: 21-Jun-2005
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ReadMetaData
Returns an object's metadata as a string
ReadMetaData(Object)
場所:
オブジェクト
パラメータ:
class RVC_GEOSPATIAL Object
The Object
戻り値
string
作成日時: 05-Jan-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); Vector V; GetInputVector(V); WriteMetaData(V, "Some importantant Information about this Vector object"); string metadata$ = ReadMetaData(V); print(metadata$);
RecoverProjectFile
Recover project file copying to a new file
RecoverProjectFile(infilename$, outfilename$, outfiledesc$, log$, Credentials)
場所:
オブジェクト
パラメータ:
string infilename$
The source file to copy from
string outfilename$
The destination file to copy to (must be a new file)
string outfiledesc$
The output file description
string log$
Log of actions performed by the recover process
class RVC_CREDENTIALS Credentials (オプション)
Credentials Object
戻り値
numeric
0 if rvc file has no errors, 1 if errors exist, a number <0 if an error occurred
作成日時: 24-May-2004
修正日時: 20-Dec-2005
TNTsml for Windows で使用可能: はい
例:
clear(); string infile$ = GetInputFileName("", "Select File to perform recovery on:", ".rvc"); string outfile$ = "C:/cleaned/cb_soils.rvc"; string desc$ = "desc"; class FILE logFile; string log$; logFile = fopen("C:/log.txt", "w"); numeric err = RecoverProjectFile(infile$, outfile$, desc$, log$); print(err); fwritestring(logFile, log$);
SetObjectDescription
Changes the description of an object
SetObjectDescription(filename$, objectnumber, string$, Credentials)
場所:
オブジェクト
パラメータ:
string filename$
A string indicating path and project name
numeric objectnumber
A valid object number
string string$
A string indicating the new object description
class RVC_CREDENTIALS Credentials (オプション)
Credentials Object
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster R; GetInputRaster(R); string fileName$=R.$Info.Filename; numeric objectNumber=GetObjectNumber(R); SetObjectDescription(fileName$, objectNumber, "A New Description");
SetObjectName
Change the object name of an existing object
SetObjectName(Object, NewName$)
場所:
オブジェクト
パラメータ:
Raster, Vector or CAD Object
The object to change
string NewName$
The new object name
戻り値
なし
作成日時: 15-Sep-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
SubObjectNumber
Returns an object number used by several object and display functions (similar to GetObjectNumber() but looks under "parent" object for valid subobject)
SubObjectNumber(filename$, parentobjectnumber, objectname$, type$, Credentials)
場所:
オブジェクト
パラメータ:
string filename$
A string indicating path and project name
numeric parentobjectnumber
A valid object number
string objectname$
A string indicating name of subobject (pass "*" to get the last used subobject)
string type$
- object type (see below)
class RVC_CREDENTIALS Credentials (オプション)
"FILE", File type
"FOLDER", An object to contain other objects
"RASTER", Raster object
"VECTOR", VECTOR object
"CAD", CAD object
"DBASE", General/raster database
"STYLE", Drawing style object
"QUERY", Generic database query string
"FILTER", Spatial filter description
"VIDSEQ", Ref for sequence of frames on video disk
"GEOREF", Georeference object
"PAGELT", Information for page layouts
"HYPER", Database referenced by HyperIndex
"DBFORM", Database display layout
"TPOINT", Tie point list
"HISTO", Histogram object
"CONTAB", Contrasting table
"2DHIST", Information about 2-D histogram
"COLMAP", Color table for rasters
"RDBASE", DB record list for rasters
"FPROC", Information to match frequency-domain rasters
"RTREND", Trend Information
"SPOTHR", Header (leader) file from SPOT tape
"CAMERA", Camera calibration information
"PTDBAS", DB record list for point elements
"LDBASE", DB record list for line elements
"PDBASE", DB record list for polygon elements
"NDBASE", DB record list for node elements
"CDBASE", DB record list for CAD object
"COLBAL", Printer color balance
"PRTDEF", Description for raster printer devices
"PLOTDF", Description for pen plotter devices
"OFONT", Outline (stroke) font
"GENREF", Generic reference object, not user-viewable object
"SCANRF", Description for scanners
"XYDIG", Description for XY digitizer devices
"D2DGRP", Display group layout information
"D2DWIN", Display window layout information
"TIN", TIN object
"DPARM", Display parameter structure
"LEGEND", Legend object
"TEXT", Generic Text Object
"TDBASE", Database for TIN objects
"VDBASE", Database for vector objects
"REGION", REGION object
"ASSOC", External file association object
"QTREE", Search Quad Tree object
"DBPARM", Database parameters object
"THEME", Theme Mapping parameters object
"METADT", Metadata object - text
"TABLE", Table OTYPE tag for databases
"INVDBL", Database table to element lists
"EDPARM", Object Editor parameter structure
"DLAYOT", Display layout information
"SML", Stand-alone SML Script
"SPECT", Spectral object
"RASTST", Raster Set object
"SENSOR", Sensor calibration information for spectral bands
"DSIM3D", Display 3D simulation parameters object
"HYPSPC", HyperSpectral object
可能性のある値:
"ALL"
All objects
"RASTER"
Raster object
"VECTOR"
Vector object
"CAD"
CAD object
"TIN"
TIN object
"SML"
SML object
"FOLDER"
Folder
"STYLE"
Style object
"DBASE"
General database object
"GEOREF"
Georeference object
"HISTO"
Histogram object
"RDBASE"
Raster database object
"PTDBAS"
Vector point database object
"LDBASE"
Vector line database object
"PDBASE"
Vector polygon database object
"NDBASE"
Vector node database object
"CDBASE"
CAD database object
"TDBASE"
TIN database object
"VDBASE"
Vector database object
"REGION"
Region object
"TABLE"
Table object
Credentials Object
詳細と仮定
Useful for finding subobjects like histograms and georeference objects.
戻り値
numeric
a number indicating the object number, or a negative number if no such object
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster R; GetInputRaster(R); string fileName$=R.$Info.Filename; numeric objectNumber=GetObjectNumber(R); numeric subobjectNumber=SubObjectNumber(fileName$, objectNumber,"HISTOGRAM","HISTO"); #DeleteObject(fileName$, subobjectNumber); # delete histogram print(subobjectNumber);
WriteMetaData
Writes metadata to an object
WriteMetaData(Object, metaData$)
場所:
オブジェクト
パラメータ:
class RVC_GEOSPATIAL Object
The Object
string metaData$
The contents of the meta data to write
戻り値
なし
作成日時: 05-Jan-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); Vector V; GetInputVector(V); WriteMetaData(V, "Some importantant Information about this Vector object"); string metadata$ = ReadMetaData(V); print(metadata$);
AddMatrix
Adds two matrices - (matrixOut = matrixLeft + matrixRight)
AddMatrix(matOut, matLeft, matRight)
場所:
マトリックス
パラメータ:
class MATRIX matOut
The output matrix returned
class MATRIX matLeft
The matrix to add
class MATRIX matRight
The matrix to add
詳細と仮定
All matrices have been created with CreateMatrix() and have not destroyed. All matrices are the same size.
戻り値
なし
作成日時: 20-Oct-1997
修正日時: 08-Mar-1999
TNTsml for Windows で使用可能: はい
例:
clear(); class MATRIX h1, h2, h3; h1 = CreateMatrix(2, 2); # create three matrices h2 = CreateMatrix(2, 2); h3 = CreateMatrix(2, 2); # fill the matrices with some values numeric r,c,a; for r = 0 to 1 { for c = 0 to 1 { SetMatrixItem(h1, r, c, r + c); SetMatrixItem(h2, r, c, (r + c) * 2); SetMatrixItem(h3, r, c, (r + c) * 3); } } # now add h1 to h2, result is h3 AddMatrix(h3, h1, h2); # print the resulting matrix h3 print("add h1 + h2"); for r = 0 to 1 { for c = 0 to 1 { a = GetMatrixItem(h3, r, c); printf("%8.4f ", a); } print(); } # destroy the matrices DestroyMatrix(h1); DestroyMatrix(h2); DestroyMatrix(h3);
AddMatrixScaler
Adds scalar to each element of a matrix
AddMatrixScaler(matrix, value)
場所:
マトリックス
パラメータ:
class MATRIX matrix
The output matrix returned
numeric value
The scalar value to add to each element
詳細と仮定
The matrix has been created with CreateMatrix() and not destroyed.
戻り値
なし
作成日時: 20-Oct-1997
修正日時: 08-Mar-1999
TNTsml for Windows で使用可能: はい
例:
clear(); class MATRIX h1; numeric r,c,a; h1 = CreateMatrix(2, 2); # create a matrix # fill the matrix with some values for r = 0 to 1 { for c = 0 to 1 { SetMatrixItem(h1, r, c, r + c); } } # print the matrix print("original matrix"); for r = 0 to 1 { for c = 0 to 1 { a = GetMatrixItem(h1, r, c); printf("%8.4f ", a); } print(); } AddMatrixScaler(h1, 100.0); # add 100.0 to each element # print the resulting matrix print("after adding 100.0 to each element"); for r = 0 to 1 { for c = 0 to 1 { a = GetMatrixItem(h1, r, c); printf("%8.4f ", a); } print(); } # destroy the matrix DestroyMatrix(h1);
CreateMatrix
Creates a matrix - returns a valid matrix handle
CreateMatrix(numRows, numCols)
場所:
マトリックス
パラメータ:
numeric numRows
The row size of the matrix to create
numeric numCols
The column size of the matrix to create
詳細と仮定
This function must be called before any other functions that take matrices as input.
戻り値
class MATRIX
A valid matrix handle
作成日時: 20-Oct-1997
修正日時: 08-Mar-1999
TNTsml for Windows で使用可能: はい
例:
clear(); class MATRIX h1; numeric r,c,a; h1 = CreateMatrix(2, 2); # create a matrix # fill the matrices with some values for r = 0 to 1 { for c = 0 to 1 { SetMatrixItem(h1, r, c, r + c); } } print("Printing the matrix:"); # print the matrix for r = 0 to 1 { for c = 0 to 1 { a = GetMatrixItem(h1, r, c); printf("%8.4f ", a); } print(); } # destroy the matrix DestroyMatrix(h1);
DestroyMatrix
Destroys a previously created matrix
DestroyMatrix(matrix)
場所:
マトリックス
パラメータ:
class MATRIX matrix
A valid matrix handle
詳細と仮定
The matrix has been created with CreateMatrix() and not previously destroyed.
戻り値
なし
作成日時: 20-Oct-1997
修正日時: 08-Mar-1999
TNTsml for Windows で使用可能: はい
例:
clear(); class MATRIX h1; h1 = CreateMatrix(2, 2); # create a matrix numeric r,c,a; # fill the matrices with some values for r = 0 to 1 { for c = 0 to 1 { SetMatrixItem(h1, r, c, r + c); } } print("Printing the matrix:"); # print the matrix for r = 0 to 1 { for c = 0 to 1 { a = GetMatrixItem(h1, r, c); printf("%8.4f ", a); } print(); } # destroy the matrix DestroyMatrix(h1);
GetMatrixColSize
Returns the number of columns in a matrix
GetMatrixColSize(matrix)
場所:
マトリックス
パラメータ:
class MATRIX matrix
A valid matrix handle
詳細と仮定
The matrix has been created with CreateMatrix() and not previously destroyed.
戻り値
numeric
The number of columns in the matrix.
作成日時: 20-Oct-1997
修正日時: 08-Mar-1999
TNTsml for Windows で使用可能: はい
例:
# # proc printMatrixToConsole(matHandle, formatStr$) # # procedure to print out a matrix to console - row major order # parameters: # matHandle a matrix handle # format$ string to control output format # proc printMatrixToConsole(class MATRIX matHandle, string formatStr$) { # get the size of the matrix numeric lastRow = GetMatrixRowSize(matHandle) - 1; numeric lastCol = GetMatrixColSize(matHandle) - 1; numeric row, col; for row = 0 to lastRow { for col = 0 to lastCol { printf(formatStr$, GetMatrixItem(matHandle, row, col)); } print(); } print(); # print blank line after matrix output } # start of code clear(); class MATRIX h1; h1 = CreateMatrix(2, 2); # create a matrix # fill the matrix with some values numeric r, c; for r = 0 to 1 { for c = 0 to 1 { SetMatrixItem(h1, r, c, r + c); } } # call procedure printMatrixToConsole() printMatrixToConsole(h1, "%8.4f "); # destroy the matrix DestroyMatrix(h1);
GetMatrixItem
Returns value of matrix element
GetMatrixItem(matrix, row, col)
場所:
マトリックス
パラメータ:
class MATRIX matrix
A valid matrix handle
numeric row
The row number
numeric col
The column number
詳細と仮定
The matrix has been created with CreateMatrix() and not previously destroyed.
戻り値
numeric
Value of matrix[row, column]
作成日時: 20-Oct-1997
修正日時: 08-Mar-1999
TNTsml for Windows で使用可能: はい
例:
# # proc printMatrixToConsole(matHandle, formatStr$) # # procedure to print out a matrix to console - row major order # parameters: # matHandle a matrix handle # format$ string to control output format # proc printMatrixToConsole(class MATRIX matHandle, string formatStr$) { # get the size of the matrix numeric lastRow = GetMatrixRowSize(matHandle) - 1; numeric lastCol = GetMatrixColSize(matHandle) - 1; numeric row, col; for row = 0 to lastRow { for col = 0 to lastCol { printf(formatStr$, GetMatrixItem(matHandle, row, col)); } print(); } print(); # print blank line after matrix output } # start of code clear(); class MATRIX h1; h1 = CreateMatrix(2, 2); # create a matrix # fill the matrix with some values numeric r, c; for r = 0 to 1 { for c = 0 to 1 { SetMatrixItem(h1, r, c, r + c); } } # call procedure printMatrixToConsole() printMatrixToConsole(h1, "%8.4f "); # destroy the matrix DestroyMatrix(h1);
GetMatrixRowSize
Returns the number of rows in a matrix
GetMatrixRowSize(matrix)
場所:
マトリックス
パラメータ:
class MATRIX matrix
A valid matrix handle
詳細と仮定
The matrix has been created with CreateMatrix() and not previously destroyed.
戻り値
numeric
The number of columns in the matrix.
作成日時: 20-Oct-1997
修正日時: 08-Mar-1999
TNTsml for Windows で使用可能: はい
例:
# # proc printMatrixToConsole(matHandle, formatStr$) # # procedure to print out a matrix to console - row major order # parameters: # matHandle a matrix handle # format$ string to control output format # proc printMatrixToConsole(class MATRIX matHandle, string formatStr$) { # get the size of the matrix numeric lastRow = GetMatrixRowSize(matHandle) - 1; numeric lastCol = GetMatrixColSize(matHandle) - 1; numeric row, col; for row = 0 to lastRow { for col = 0 to lastCol { printf(formatStr$, GetMatrixItem(matHandle, row, col)); } print(); } print(); # print blank line after matrix output } # start of code clear(); class MATRIX h1; h1 = CreateMatrix(2, 2); # create a matrix # fill the matrix with some values numeric r, c; for r = 0 to 1 { for c = 0 to 1 { SetMatrixItem(h1, r, c, r + c); } } # call procedure printMatrixToConsole() printMatrixToConsole(h1, "%8.4f "); # destroy the matrix DestroyMatrix(h1);
InvertMatrix
Inverts a matrix
InvertMatrix(matOut, matIn)
場所:
マトリックス
パラメータ:
詳細と仮定
The matrix has been created with CreateMatrix() and not previously destroyed. The matrices are the same size and the input matrix has an inverse.
戻り値
なし
作成日時: 20-Oct-1997
修正日時: 08-Mar-1999
TNTsml for Windows で使用可能: はい
例:
# # proc printMatrixToConsole(matHandle, formatStr$) # # procedure to print out a matrix to console - row major order # parameters: # matHandle a matrix handle # format$ string to control output format # proc printMatrixToConsole(class MATRIX matHandle, string formatStr$) { # get the size of the matrix numeric lastRow = GetMatrixRowSize(matHandle) - 1; numeric lastCol = GetMatrixColSize(matHandle) - 1; numeric row, col; for row = 0 to lastRow { for col = 0 to lastCol { printf(formatStr$, GetMatrixItem(matHandle, row, col)); } print(); } print(); # print blank line after matrix output } # start of program clear(); class MATRIX h1, h2, h3; h1 = CreateMatrix(2, 2); # create three matrices h2 = CreateMatrix(2, 2); h3 = CreateMatrix(2, 2); # fill the matrices values known to produce matrix # with an inverse SetMatrixItem(h1, 0, 0, 1.0); SetMatrixItem(h1, 0, 1, 2.0); SetMatrixItem(h1, 1, 0, 3.0); SetMatrixItem(h1, 1, 1, 4.0); # print the resulting matrix print("matrix before inverse"); printMatrixToConsole(h1, "%8.4f "); # now calculate the inverse of h1 InvertMatrix(h2, h1); # print the inverse matrix # result should be | -2.0 1.0 | # | 1.5 -.5 | print("matrix after inverse"); printMatrixToConsole(h2, "%8.4f "); # now multiply matrix 1 by it's inverse # result matrix h3 should be identity matrix MultiplyMatrix(h3, h1, h2); print("matrix times its inverse"); printMatrixToConsole(h3, "%8.4f "); # destroy the matrices DestroyMatrix(h1); DestroyMatrix(h2); DestroyMatrix(h3);
MultiplyMatrix
Multiplies two matrices - (matrixOut = matrixLeft * matrixRight)
MultiplyMatrix(matOut, matLeft, matRight)
場所:
マトリックス
パラメータ:
class MATRIX matOut
The output matrix returned
class MATRIX matLeft
The matrix to premultiply with
class MATRIX matRight
The matrix to post multiply with
詳細と仮定
The matrix has been created with CreateMatrix() and not previously destroyed. All matrices are the same size.
戻り値
なし
作成日時: 20-Oct-1997
修正日時: 08-Mar-1999
TNTsml for Windows で使用可能: はい
例:
# # proc printMatrixToConsole(matHandle, formatStr$) # # procedure to print out a matrix to console - row major order # parameters: # matHandle a matrix handle # format$ string to control output format # proc printMatrixToConsole(class MATRIX matHandle, string formatStr$) { # get the size of the matrix numeric lastRow = GetMatrixRowSize(matHandle) - 1; numeric lastCol = GetMatrixColSize(matHandle) - 1; numeric row, col; for row = 0 to lastRow { for col = 0 to lastCol { printf(formatStr$, GetMatrixItem(matHandle, row, col)); } print(); } print(); # print blank line after matrix output } # start of program clear(); class MATRIX h1, h2, h3; h1 = CreateMatrix(2, 2); # create three matrices h2 = CreateMatrix(2, 2); h3 = CreateMatrix(2, 2); # create a matrix to test # result should be | 1 2 | # | 3 4 | SetMatrixItem(h1, 0, 0, 1.0); SetMatrixItem(h1, 0, 1, 2.0); SetMatrixItem(h1, 1, 0, 3.0); SetMatrixItem(h1, 1, 1, 4.0); # print the resulting matrix print("Original matrix:"); printMatrixToConsole(h1, "%8.4f "); # create an identity matrix # result should be | 1 0 | # | 0 1 | SetMatrixItem(h2, 0, 0, 1.0); SetMatrixItem(h2, 0, 1, 0.0); SetMatrixItem(h2, 1, 0, 0.0); SetMatrixItem(h2, 1, 1, 1.0); # print the resulting matrix print("Identity matrix:"); printMatrixToConsole(h2, "%8.4f "); # now multiply h1 by the h2 (identity matrix) # result in h3 MultiplyMatrix(h3, h2, h1); # print the result - should be same as original print("Matrix after multiplication by identity:"); printMatrixToConsole(h3, "%8.4f "); # destroy the matrices DestroyMatrix(h1); DestroyMatrix(h2); DestroyMatrix(h3);
MultiplyMatrixScaler
Multiplies each element of a matrix by a scaler
MultiplyMatrixScaler(matrix, value)
場所:
マトリックス
パラメータ:
class MATRIX matrix
The output matrix returned
numeric value
The scaler value to multiply each element by
詳細と仮定
The matrix has been created with CreateMatrix() and not destroyed.
戻り値
なし
作成日時: 20-Oct-1997
修正日時: 08-Mar-1999
TNTsml for Windows で使用可能: はい
例:
clear(); class MATRIX h1; h1 = CreateMatrix(2, 2); # create a matrix # fill the matrix with some values numeric r,c,a; for r = 0 to 1 { for c = 0 to 1 { SetMatrixItem(h1, r, c, r + c); } } # print the matrix print("original matrix"); for r = 0 to 1 { for c = 0 to 1 { a = GetMatrixItem(h1, r, c); printf("%8.4f ", a); } print(); } # multiply each element by 100.0 MultiplyMatrixScaler(h1, 100.0); # print the resulting matrix print("After multiplying each element by 100.0"); for r = 0 to 1 { for c = 0 to 1 { a = GetMatrixItem(h1, r, c); printf("%8.4f ", a); } print(); } # destroy the matrix DestroyMatrix(h1);
SetMatrixItem
Sets the element of a matrix to a value.
SetMatrixItem(matrix, row, col, value)
場所:
マトリックス
パラメータ:
class MATRIX matrix
A valid matrix handle
numeric row
The row number
numeric col
The column number
numeric value
The value to set the element to
詳細と仮定
The matrix has been created with CreateMatrix() and not previously destroyed.
戻り値
なし
作成日時: 20-Oct-1997
修正日時: 08-Mar-1999
TNTsml for Windows で使用可能: はい
例:
clear(); class MATRIX h1; numeric r,c,a; h1 = CreateMatrix(2, 2); # create a matrix # fill the matrix with some values for r = 0 to 1 { for c = 0 to 1 { SetMatrixItem(h1, r, c, r + c); } } # print the matrix print("The matrix:"); for r = 0 to 1 { for c = 0 to 1 { a = GetMatrixItem(h1, r, c); printf("%8.4f ", a); } print(); } # destroy the matrix DestroyMatrix(h1);
SubMatrix
Subtracts two matrices - (matrixOut = matrixLeft - matrixRight)
SubMatrix(matOut, matLeft, matRight)
場所:
マトリックス
パラメータ:
class MATRIX matOut
The output matrix returned
class MATRIX matLeft
The matrix to subtract from
class MATRIX matRight
The matrix to subtract
詳細と仮定
The matrix has been created with CreateMatrix() and not previously destroyed. All matrices are the same size.
戻り値
なし
作成日時: 20-Oct-1997
修正日時: 08-Mar-1999
TNTsml for Windows で使用可能: はい
例:
clear(); class MATRIX h1, h2, h3; h1 = CreateMatrix(2, 2); # create three matrices h2 = CreateMatrix(2, 2); h3 = CreateMatrix(2, 2); # fill the matrices with some values numeric r,c,a; for r = 0 to 1 { for c = 0 to 1 { SetMatrixItem(h1, r, c, r + c); SetMatrixItem(h2, r, c, (r + c) * 2); SetMatrixItem(h3, r, c, (r + c) * 3); } } # now subtract h2 from h1, result is h3 SubMatrix(h3, h1, h2); print("Subtract h2 from h1"); # print the resulting matrix h3 for r = 0 to 1 { for c = 0 to 1 { a = GetMatrixItem(h3, r, c); printf("%8.4f ", a); } print(); } # destroy the matrices DestroyMatrix(h1); DestroyMatrix(h2); DestroyMatrix(h3);
TransposeMatrix
Transposes rows and columns of a matrix
TransposeMatrix(matOut, matIn)
場所:
マトリックス
パラメータ:
詳細と仮定
The matrices have been created with CreateMatrix() and have not destroyed. The matrices are the same size.
戻り値
なし
作成日時: 20-Oct-1997
修正日時: 08-Mar-1999
TNTsml for Windows で使用可能: はい
例:
# # proc printMatrixToConsole (matHandle, formatStr$) # # procedure to print out a matrix to console - row # major order # parameters: # matHandle a matrix handle # format$ string to control output format # proc printMatrixToConsole(class MATRIX matHandle, string formatStr$) { # get the size of the matrix numeric lastRow = GetMatrixRowSize(matHandle) - 1; numeric lastCol = GetMatrixColSize(matHandle) - 1; numeric row, col; for row = 0 to lastRow { for col = 0 to lastCol { printf(formatStr$, GetMatrixItem(matHandle, row, col)); } print(); } print(); # print blank line after matrix output } # start of program clear(); class MATRIX h1, h2; h1 = CreateMatrix(2, 2); # create two matrices h2 = CreateMatrix(2, 2); # fill the matrix with some values SetMatrixItem(h1, 0, 0, 1.0); SetMatrixItem(h1, 0, 1, 2.0); SetMatrixItem(h1, 1, 0, 3.0); SetMatrixItem(h1, 1, 1, 4.0); # print the resulting matrix # result should be | 1 2 | # | 3 4 | print("matrix before transpose"); printMatrixToConsole(h1, "%8.4f "); # now calculate the transpose of h1 TransposeMatrix(h2, h1); # print the inverse matrix # result should be | 1 3 | # | 2 4 | print("matrix after transpose"); printMatrixToConsole(h2, "%8.4f "); # destroy the matrices DestroyMatrix(h1); DestroyMatrix(h2);
CopyGeorefToObject
Write a georeference subobject
CopyGeorefToObject(Object, georef)
場所:
ジオリファレンス(座標付与)
パラメータ:
Raster, Vector or CAD Object
Object to copy georeference to
class GEOREF georef
Georeference to copy
詳細と仮定
When copying a georef to a vector object which has been opened for Vector Toolkit, you need to close the vector before copying the georef. This function is used to specify that a vector, CAD or TIN has a particular implied georeference. Don't try to use it with a raster - it won't work. Rasters can't have implied georeferences. If you just want to copy a georeference, use CopySubobjects() instead.
戻り値
なし
作成日時: 18-Jun-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
vector V1, V2, Vmerge; GetInputVector(V1); GetInputVector(V2); GetOutputVector(Vmerge); Vmerge = VectMerge(V1, V2); # get georef for merge class Georef georef; georef = GetLastUsedGeorefObject(V1); CopyGeorefToObject(Vmerge, georef);
CreateControlPointGeoref
Creates a control point georeference object.
CreateControlPointGeoref(Object, numberPoints, xSource, ySource, zSource, xDestination, yDestination, zDestination, xSourceAccuracy, ySourceAccuracy, zSourceAccuracy, xDestinationAccuracy, yDestinationAccuracy, zDestinationAccuracy, refsys)
場所:
ジオリファレンス(座標付与)
パラメータ:
Raster, Vector or CAD Object
A valid (raster, vector, CAD, or TIN object
numeric numberPoints
Number of control points
array xSource
One dimensional array of source x coordinates
array ySource
One dimensional array of source y coordinates
array zSource
One dimensional array of source z coordinates
array xDestination
One dimensional array of destination x coordinates
array yDestination
One dimensional array of destination y coordinates
array zDestination (オプション)
One dimensional array of destination z coordinates
array xSourceAccuracy (オプション)
Optional - one dimensional array of source x accuracy
array ySourceAccuracy (オプション)
Optional - one dimensional array of source y accuracy
array zSourceAccuracy (オプション)
Optional - one dimensional array of source z accuracy
array xDestinationAccuracy (オプション)
Optional - one dimensional array of destination x accuracy
array yDestinationAccuracy (オプション)
Optional - one dimensional array of destination y accuracy
array zDestinationAccuracy (オプション)
Optional - one dimensional array of destination z accuracy
class SR_COORDREFSYS refsys (オプション)
The coordinate reference system
詳細と仮定
You must have a minumum of three non-collinear points
戻り値
class GEOREF
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# SML script to demonstrate creation of georef object in SML # # 1. opens a raster - cb_tm/blue # 2. creates a new vector object and draws a box # 3. georeferences the vector so that it bounds the raster # # NOTES: # 1. you must use a minimum of three control points # 2. they must not be all on the same line! # ################################################################# # alternate method to get extents of object # # can use this in general - if last parm is omitted then # returns object coordinates # # rgeoref = GetLastUsedGeorefObject(Rin) # GetObjectExtents(Rin, rxMin, ryMin, rxMax, ryMax, rgeoref) # # now do same for vector except do not use georef parm # this will give object coordinates # GetObjectExtents(Vout, vxMin, vyMin, vxMax, vyMax) # ################################################################# # the source arrays will hold the object coordinates # for a raster this would be cell values # for vector, CAD, TIN it would be object, (non-georeferenced), # coordinates array numeric xsrc[5], ysrc[5], zsrc[5]; # the destination arrays will hold the appropriate, # (georeferenced), values array numeric xdest[5], ydest[5], zdest[5]; # arrays to hold vector points to draw box array numeric xpoints[10]; array numeric ypoints[10]; # fill in the control points (source and destination) # need a minimum of three # we will assume a georeferenced raster and a non-georeferenced # vector that we wish to georeference to the raster clear(); raster Rin; vector Vout; class Georef rgeoref; # get the raster and vector GetInputRaster(Rin); # get number of lines and columns numeric numlines = NumLins(Rin); numeric numcols = NumCols(Rin); # get the upper left (UL), lower right (LR) # upper right (UR), and lower left (LL) coordinates numeric xUL, yUL, xLR, yLR, xUR, yUR, xLL, yLL; rgeoref = GetLastUsedGeorefObject(Rin); ObjectToMap(Rin, 1, 1, rgeoref, xUL, yUL); ObjectToMap(Rin, numcols+1, numlines+1, rgeoref, xLR, yLR); ObjectToMap(Rin, numcols+1, 1, rgeoref, xUR, yUR); ObjectToMap(Rin, 1, numlines+1, rgeoref, xLL, yLL); printf("UL: %7.2f %7.2f\n", xUL, yUL); printf("UR: %7.2f %7.2f\n", xUR, yUR); printf("LL: %7.2f %7.2f\n", xLL, yLL); printf("LR: %7.2f %7.2f\n", xLR, yLR); # create a new vector here !!!! # we will draw a box and match it to the raster GetOutputVector(Vout, "VectorToolkit"); # draw the box - this will create a polygon # fill in the points xpoints[1] = 0; ypoints[1] = 0; xpoints[2] = 100; ypoints[2] = 0; xpoints[3] = 100; ypoints[3] = 100; xpoints[4] = 0; ypoints[4] = 100; xpoints[5] = 0; ypoints[5] = 0; VectorAddLine(Vout, 5, xpoints, ypoints); # fill in four control points - one for each corner # the source values are # control point 1 - upper left corner xsrc[1] = 0; ysrc[1] = 100; zsrc[1] = 0; xdest[1] = xUL; ydest[1] = yUL; zdest[1] = 0; # control point 2 - lower right corner xsrc[2] = 100; ysrc[2] = 0; zsrc[2] = 0; xdest[2] = xLR; ydest[2] = yLR; zdest[2] = 0; # control point 3 - upper right corner xsrc[3] = 100; ysrc[3] = 100; zsrc[3] = 0; xdest[3] = xUR; ydest[3] = yUR; zdest[3] = 0; # control point 3 - lower left corner xsrc[4] = 0; ysrc[4] = 0; zsrc[4] = 0; xdest[4] = xLL; ydest[4] = yLL; zdest[4] = 0; # print out the control points numeric i; for i = 1 to 4 { printf("%s %2d %7.2f %7.2f %7.2f ", "i: xsrc, ysrc, zsrc, xdest, ydest, zdest ", i, xsrc[i], ysrc[i], zsrc[i]); printf("%7.2f %7.2f %7.2f\n", xdest[i], ydest[i], zdest[i]); } # set number of control points numeric numberPoints = 4; # now create the georef via dialog CreateControlPointGeoref(Vout, numberPoints, xsrc, ysrc, zsrc, xdest, ydest, zdest); GeorefFree(rgeoref); # clean up CloseRaster(Rin);
CreateControlPointGeorefDefaultAccuracy
Same as CreateControlPointGeoref but without accuracy parameters
CreateControlPointGeorefDefaultAccuracy(Object, refsys, numberPoints, xSource, ySource, xDestination, yDestination, zDestination)
場所:
ジオリファレンス(座標付与)
パラメータ:
Raster, Vector or CAD Object
A valid Raster, Vector, CAD, or TIN object
class SR_COORDREFSYS refsys
The coordinate reference system
numeric numberPoints
Number of control points
array xSource
One dimensional array of source x coordinates
array ySource
One dimensional array of source y coordinates
array xDestination
One dimensional array of destination x coordinates
array yDestination
One dimensional array of destination y coordinates
array zDestination (オプション)
One dimensional array of destination z coordinates
戻り値
class GEOREF
作成日時: 16-May-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/import_srtm.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
CreateControlPointGeorefFromGeoref
Creates a control point georeference object using an existing georeference for the projection system.
CreateControlPointGeorefFromGeoref(Object, georef, numberPoints, xSource, ySource, zSource, xDestination, yDestination, zDestination, xSourceAccuracy, ySourceAccuracy, zSourceAccuracy, xDestinationAccuracy, yDestinationAccuracy, zDestinationAccuracy)
場所:
ジオリファレンス(座標付与)
パラメータ:
Raster, Vector or CAD Object
A valid Raster, Vector, CAD, or TIN object
class GEOREF georef
The georeference to use for projection system parmameters
numeric numberPoints
Number of control points
array xSource
One dimensional array of source x coordinates
array ySource
One dimensional array of source y coordinates
array zSource
One dimensional array of source z coordinates
array xDestination
One dimensional array of destination x coordinates
array yDestination
One dimensional array of destination y coordinates
array zDestination (オプション)
One dimensional array of destination z coordinates
array xSourceAccuracy (オプション)
Optional - one dimensional array of source x accuracy
array ySourceAccuracy (オプション)
Optional - one dimensional array of source y accuracy
array zSourceAccuracy (オプション)
Optional - one dimensional array of source z accuracy
array xDestinationAccuracy (オプション)
Optional - one dimensional array of destination x accuracy
array yDestinationAccuracy (オプション)
Optional - one dimensional array of destination y accuracy
array zDestinationAccuracy (オプション)
Optional - one dimensional array of destination z accuracy
詳細と仮定
You must have a minumum of three non-collinear points
戻り値
class GEOREF
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster Rin, Rnew; class Georef geoOrg, geoNew; array numeric xsrc[5], ysrc[5], zsrc[5]; array numeric xdest[5], ydest[5], zdest[5]; # get the raster GetInputRaster(Rin); #create a new raster CreateRaster(Rnew, "c:/tnt/win32/newras.rvc", "newras", "description", 200, 200, "8-bit unsigned"); # duplicate the corrosponding values numeric r, c; for r = 1 to 200 { for c = 1 to 200 { Rnew[r,c] = Rin[r,c]; } } # get number of lines and columns numeric numlines, numcols; numlines = NumLins(Rin); numcols = NumCols(Rin); # get the upper left (UL), lower right (LR) # upper right (UR), and lower left (LL) coordinates # of the portion of the raster we are going to duplicate numeric xUL, yUL, xLR, yLR, xUR, yUR, xLL, yLL; geoOrg = GetLastUsedGeorefObject(Rin); ObjectToMap(Rin, 1, 1, geoOrg, xUL, yUL); ObjectToMap(Rin, 201, 201, geoOrg, xLR, yLR); ObjectToMap(Rin, 201, 1, geoOrg, xUR, yUR); ObjectToMap(Rin, 1, 201, geoOrg, xLL, yLL); printf("UL: %7.2f %7.2f\n", xUL, yUL); printf("UR: %7.2f %7.2f\n", xUR, yUR); printf("LL: %7.2f %7.2f\n", xLL, yLL); printf("LR: %7.2f %7.2f\n", xLR, yLR); # fill in four control points - one for each corner # control point 1 - upper left corner xsrc[1] = 0; ysrc[1] = 0; zsrc[1] = 0; xdest[1] = xUL; ydest[1] = yUL; zdest[1] = 0; # control point 2 - lower right corner xsrc[2] = 200; ysrc[2] = 200; zsrc[2] = 0; xdest[2] = xLR; ydest[2] = yLR; zdest[2] = 0; # control point 3 - upper right corner xsrc[3] = 200; ysrc[3] = 0; zsrc[3] = 0; xdest[3] = xUR; ydest[3] = yUR; zdest[3] = 0; # control point 3 - lower left corner xsrc[4] = 0; ysrc[4] = 200; zsrc[4] = 0; xdest[4] = xLL; ydest[4] = yLL; zdest[4] = 0; # print out the control points numeric i; for i = 1 to 4 { printf("%s %2d %7.2f %7.2f %7.2f ", "i: xsrc, ysrc, zsrc, xdest, ydest, zdest ", i, xsrc[i], ysrc[i], zsrc[i]); printf("%7.2f %7.2f %7.2f\n", xdest[i], ydest[i], zdest[i]); } # set number of control points numeric numpoints = 4; # now create the georef without dialog geoNew = CreateControlPointGeorefFromGeoref(Rnew, geoOrg, numpoints, xsrc, ysrc, zsrc, xdest, ydest, zdest); GeorefFree(geoOrg); GeorefFree(geoNew); CloseRaster(Rin); CloseRaster(Rnew);
CreateImpliedGeoref
Create an implied georeference subobject
CreateImpliedGeoref(Object, refsys)
場所:
ジオリファレンス(座標付与)
パラメータ:
Raster, Vector or CAD Object
A valid Vector, CAD, or TIN object
class SR_COORDREFSYS refsys
The coordinate reference system
戻り値
numeric
作成日時: 16-May-2000
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class MAPPROJ mapproj; vector V; # set projection parameters mapproj.SetSystemLatLon(); mapproj.Datum = "World Geodetic System 1984"; GetInputVector(V); CreateImpliedGeoref(V, mapproj);
CreateSimpleGeoref
Create simple raster georeference
CreateSimpleGeoref(raster, refSys, refCoord, lineScale, columnScale, referencePoint$, orientation$, angle)
場所:
ジオリファレンス(座標付与)
パラメータ:
Raster raster
The raster object to georeference
class SR_COORDREFSYS refSys
Coordinate Reference System
class POINT2D refCoord
The reference coordinate location
numeric lineScale
Cell size setting for line scale
numeric columnScale
Cell size setting for column scale
string referencePoint$ (オプション)
The position of the reference point (Upper Left by default)
string orientation$ (オプション)
可能性のある値:
"UpperLeft"
"UpperRight"
"LowerLeft"
"LowerRight"
"Center"
The orientation of the raster (Projection Upright by default)
numeric angle (オプション)
可能性のある値:
"Upright"
"UpsideDown"
"TopToLeft"
"TopToRight"
"UserDefined"
The angle to use for User-defined orientation
戻り値
numeric
作成日時: 08-Nov-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster src, dest; class RVC_GEOREFERENCE georef; class SR_COORDREFSYS refsys; class POINT2D refCoord; GetInputRaster(src); GetInputRaster(dest); georef.OpenLastUsed(src); refsys = georef.GetCoordRefSys(); refCoord.x = 333349.501; # Use values and units appropriate for the coord ref sys refCoord.y = 162833.442; # Create Simple Georeference (the last two are defaults) numeric err = CreateSimpleGeoref(dest, refsys, refCoord, LinScale(src), ColScale(src), "UpperLeft", "Upright"); PopupError(err);
DeleteGeoref
Delete georef subobjects of the given object
DeleteGeoref(Object)
場所:
ジオリファレンス(座標付与)
パラメータ:
Raster, Vector or CAD Object
Any valid object
戻り値
なし
作成日時: 01-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster Rvar; DeleteGeoref(Rvar);
GeorefAlloc
Allocate a new georeference handle
GeorefAlloc()
場所:
ジオリファレンス(座標付与)
戻り値
class GEOREF
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class Georef geonum1, geonum2; geonum1 = GeorefAlloc(); geonum2 = GeorefAlloc(); GeorefFree(geonum1); GeorefFree(geonum2);
GeorefAngleToNorth
Returns the angle between north and a line from center to x,y
GeorefAngleToNorth(georef, x, y)
場所:
ジオリファレンス(座標付与)
パラメータ:
class GEOREF georef
Georeference object obtained from a previous GetGeorefObject() call
numeric x
Horizontal coordinate of point of interest
numeric y
Vertical coordinate of point of interest
詳細と仮定
The center of the (vector or raster) object is determined from the georeferenced extent of the object.
戻り値
numeric
a number in radians
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster R; class Georef rGeoref; GetInputRaster(R); rGeoref = GetGeorefObject(R); print("Enter x value."); numeric x = PopupNum("Enter x."); print("Enter y value."); numeric y = PopupNum("Enter y."); numeric angle = GeorefAngleToNorth(rGeoref, x, y); print("Angle between line connecting center of object to x,y and true north:",angle/deg); CloseRaster(R);
GeorefFree
Free georeference object
GeorefFree(georef)
場所:
ジオリファレンス(座標付与)
パラメータ:
class GEOREF georef
Class Georef from a previous call to GetGeorefObject() or GeorefAlloc()
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class Georef gref; gref = GeorefAlloc(); GeorefFree(gref);
GeorefGetParms
Open dialog for selecting georeference subobject
GeorefGetParms(georef)
場所:
ジオリファレンス(座標付与)
パラメータ:
class GEOREF georef (オプション)
Class Georef from previous call to GetGeorefObject()
戻り値
class GEOREF
a copy of the selected georeference subobject, or a new one if no parameter was specified (with parms as entered in the popup dialog)
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class Georef g, h; raster R; GetInputRaster(R); # get input raster g = GetGeorefObject(R); # get georeference of object h = GeorefGetParms(g); # display the georef parms and copy to 'h' GeorefFree(g); GeorefFree(h); CloseRaster(R);
GeorefSetCoordRefSys
Set the coordinate reference system for this georeference
GeorefSetCoordRefSys(georef, refsys)
場所:
ジオリファレンス(座標付与)
パラメータ:
class GEOREF georef
The georeference to use
class SR_COORDREFSYS refsys
The coordinate reference system
戻り値
なし
作成日時: 25-Jun-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GeorefSetProjection
Set the projection of a Georef
GeorefSetProjection(georef, projection)
場所:
ジオリファレンス(座標付与)
パラメータ:
戻り値
なし
作成日時: 17-Jun-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
###################### # # ORBITSP.SML # # Demonstration of movie generation from 3D display using spiral # orbit path. Both 2D and 3D views are copied into each movie frame. # # View center is fixed at center of group. Viewer position is computed # from size of group. Two complete orbits are made. The first starts # beyond the edge of group and spirals inward and downward; the second # spirals outward and upward. # # Script uses an input DEM for the surface layer, an input raster drape # layer, and an input vector drape layer. # # Requires TNTmips Version 6.5 # ##################### clear(); #### Set movie format, frame rate, and recording time # Movie format (Possible values : "MPEG"(All platform) or "AVI"(Windows only) string format$; format$ = "AVI"; # Frame rate # Possible values : # "MOVIE_FRAMERATE_23_976" 23.976 (24000/1001) fps - NTSC encapsulated film rate # "MOVIE_FRAMERATE_24" 24 fps - Standard international cinema film rate # "MOVIE_FRAMERATE_25" 25 fps - PAL (625/50) video frame rate # "MOVIE_FRAMERATE_29_970" 29.97 (30000/1001) fps - NTSC video frame rate # "MOVIE_FRAMERATE_30" 30 fps - NTSC drop-frame (525/60) video frame rate # "MOVIE_FRAMERATE_50" 50 fps - Double frame rate / progressive PAL # "MOVIE_FRAMERATE_59_940" 59.94 (60000/1001) fps - Double frame rate NTSC # "MOVIE_FRAMERATE_60" 60 fps - Double frame rate drop-frame NTSC string framerate$; framerate$ = "MOVIE_FRAMERATE_24"; # Recording time numeric time; time = 60; ###### Get RVC objects to load raster Surface, RastDrape; vector VectDrape; print("Select raster to use for surface"); GetInputRaster(Surface); print("Select raster to use for first drape layer"); GetInputRaster(RastDrape); print("Select vector to use for second drape layer"); GetInputVector(VectDrape); ###### RVC style object to draw center point and viewer point string styleFilename$; string styleObjectname$; GetInputObject("Style","Select style object for center and viewer point symbols:", styleFilename$, styleObjectname$); string viewer$; viewer$ = "VIEWER"; string center$; center$ = "CENTER"; ######## Create display group with 2d and 3d views print("START"); # Size of squared 2D view and 3D view # Should be evenly divisible by 8 numeric size; size = 400; # Zoom out factor for 2D view numeric zoomfactor; zoomfactor = 1.8; # Create group print("Creating Group"); class GRE_GROUP group; group = GroupCreate(); # Create flags to create view without iconbar, scrollbars, status line and scale/position line # This is important to maintain fixed window size for movie generation string flags$; flags$ = "NoScalePosLine,NoIconBar,NoScrollbars,NoStatusLine"; # Create dialog and 2D view print("Creating dialog and 2D view"); class XmForm dialog2d; class GRE_VIEW view2d; dialog2d = CreateFormDialog("VIEW 2D"); view2d = GroupCreateView(group,dialog2d,"",size,size,flags$); view2d.BackgroundColor.red = 67; view2d.BackgroundColor.green = 100; view2d.BackgroundColor.blue = 100; # Create dialog and 3D view print("Creating dialog and 3D view"); class XmForm dialog3d; class GRE_VIEW3D view3d; dialog3d = CreateFormDialog("VIEW 3D"); view3d = GroupCreate3DView(group,dialog3d,"",size,size,flags$); view3d.BackgroundColor.red = 67; view3d.BackgroundColor.green = 100; view3d.BackgroundColor.blue = 100; # Add layers to group GroupQuickAddRasterVar(group,Surface,1); GroupQuickAddRasterVar(group,RastDrape,0); GroupQuickAddVectorVar(group,VectDrape); # Open both views DialogOpen(dialog2d); DialogOpen(dialog3d); # Full redraw of both views ViewRedrawFull(view2d); ViewRedrawFull(view3d); ViewZoomOut(view2d,zoomfactor,1); ####### Set up parameters for movie frame # Destination of each view in final frame for movie numeric x2d, y2d, x3d, y3d, w, h; x2d = 0; y2d = 0; x3d = size; y3d = 0; w = 2 * size; h = size; # Create text strings for annotation in frame string frameTitle$; string frameTitle2$; frameTitle$ = "Mount St. Helens Flow Hazard Zonation"; frameTitle2$ = "and Survey Station Locations"; # Font size numeric fontsize; fontsize = 16; # Define color for text annotation in frame class Color black; black.red = 0; black.green = 0; black.blue = 0; # Creating frame print("Creating frame for movie"); class Frame frame; frame = FrameCreate(w,h); # Create graphics context (GC) for frame print("Creating GC from frame and activate it"); ActivateGC(FrameCreateGC(frame)); DrawTextSetHeightPixels(fontsize); DrawUseStyleObject(styleFilename$,styleObjectname$); ######## Set some more movie parameters # Initiale Movie print("Initializing Movie"); class Movie movie; movie = MovieInit(); # Check framerate and force it to "MOVIE_FRAMERATE_24" if it is invalid numeric rate; rate = 24; if (framerate$ == "MOVIE_FRAMERATE_23_976") rate = 23.976; if (framerate$ == "MOVIE_FRAMERATE_25") rate = 25.0; if (framerate$ == "MOVIE_FRAMERATE_29_970") rate = 29.970; if (framerate$ == "MOVIE_FRAMERATE_30") rate = 30.0; if (framerate$ == "MOVIE_FRAMERATE_50") rate = 50.0; if (framerate$ == "MOVIE_FRAMERATE_59_940") rate = 59.940; if (framerate$ == "MOVIE_FRAMERATE_60") rate = 60.0; if (rate == 24.0) framerate$ = "MOVIE_FRAMERATE_24"; # Set Movie Parameters print("Setting Movie Parameters"); MovieSetFormat(movie,format$); MovieSetFrameRate(movie,framerate$); MovieSetFrameWidth(movie,w); MovieSetFrameHeight(movie,h); # Make Output File string ext$; ext$ = MovieGetFileExt(movie); string filename$; filename$ = GetOutputFileName("","Make filename for movie",ext$); printf("Filename = %s\n",filename$); # Check recording time if (time <= 1.0) time = 1.0; ##### Get georeference for surface layer and reset to group projection class Georef georef; georef = GetLastUsedGeorefObject(Surface); GeorefSetProjection(georef,group.Projection); # Find map coordinates and surface elevation at center of group # and define as view point (center) class POINT3D center; center.x = group.Center.x; center.y = group.Center.y; numeric objx; numeric objy; MapToObject(georef,center.x,center.y,Surface,objx,objy); center.z = Surface[objy,objx]; ##### Set up viewpoint and viewer position parameters class VIEWPOINT3D vp; vp = view3d.ViewPoint; vp.SetCenter(center); class POINT3D pt; # viewer position class POINT2D point; # 2D point for location symbols # Set initial viewer position north of center just beyond group extents # and 10000 m higher than center point pt.x = group.Center.x; pt.y = group.Extents.y2 + 0.6 * (group.Extents.y2 - group.Center.y); pt.z = center.z + 10000; vp.SetViewerPosition(pt); # Calculate spiral orbit parameters numeric numFrames = time * rate; numeric deltaAngle = -360.0 / numFrames * 2; numeric tx = vp.ViewPos.x - vp.CenterPoint.x; numeric ty = vp.ViewPos.y - vp.CenterPoint.y; numeric distance = 4 * sqrt(tx * tx + ty * ty) / 5 / numFrames * 2; numeric height = (vp.ViewPos.z - vp.CenterPoint.z) / numFrames * 2; ###### Start recording movie to file MovieStart(movie,filename$); # Loop for each frame numeric i, azimuth; for i = 1 to numFrames { SetStatusMessage(sprintf("Processing frame %d of %d",i,numFrames)); # Rotate viewer position around center with deltaAngle increment vp.RotateViewerPosition(deltaAngle); if (i <= numFrames / 2) { # Move viewer position closer and higher to center point azimuth = vp.AzimAngle * 180 / PI; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,90,height,"m"); } else { # Move viewer position farther and lower from center point azimuth = vp.AzimAngle * 180 / PI + 180; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,-90,height,"m"); } # ViewRedrawDirect(view3d,"NoBlankScreen"); # This new function added after release of TNTmips 6.5 # can redraw the view without blanking it first. Use of # this function eliminates "flashing" of the view as the # movie is initially rendered. It has no effect on the # output movie file. For 6.5 release version, use the # function in the next statement. ViewRedraw(view3d); # Copy 2d view and 3d view to destination frame FrameCopyFromView(frame,view2d,0,0,size,size,x2d,y2d); FrameCopyFromView(frame,view3d,0,0,size,size,x3d,y3d); # Draw center point in 2d view point.x = vp.CenterPoint.x; point.y = vp.CenterPoint.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(center$); DrawPoint(point.x,point.y); # Draw viewer position point in 2d view point.x = vp.ViewPos.x; point.y = vp.ViewPos.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(viewer$); DrawPoint(point.x,point.y); # Draw text to top of frame DrawTextSetColors(black); DrawTextSimple(frameTitle$,5,fontsize); DrawTextSimple(frameTitle2$,5,2.2*fontsize); # Add frame to movie MovieAddFrame(movie,frame); } # End of main processing loop # Stop and Exit movie MovieStop(movie); MovieExit(movie); # Close dialogs DialogClose(dialog2d); DialogClose(dialog3d); print("END");
GeorefTrans
Transform point from one map projection to another
GeorefTrans(from_georef, from_x, from_y, to_georef, to_x, to_y)
場所:
ジオリファレンス(座標付与)
パラメータ:
class GEOREF from_georef
The original georeference object
numeric from_x
The x coordinate of the point of interest, as it exists in the original georeference system
numeric from_y
The y coordinate in the original georeference system
class GEOREF to_georef
The target georeference object
numeric variable to_x
The x coordinate of the point of interest, as it exists in the target georeference system
numeric variable to_y
The y coordinate in the target georeference system
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster R; class Georef g1, g2; numeric x1, y1, x2, y2; GetInputRaster(R); g1 = GetGeorefObject(R); print("Enter x1"); x1=PopupNum("Enter x1."); print("Enter x2"); x2=PopupNum("Enter x2."); g2 = GeorefGetParms(); GeorefTrans(g1, x1, y1, g2, x2, y2); print("Original: ", x1, y1); print("\nNew: ", x2, y2); GeorefFree(g1); GeorefFree(g2); CloseRaster(R);
GetGeorefObject
Return a handle to the georeference subobject
GetGeorefObject(Object)
場所:
ジオリファレンス(座標付与)
パラメータ:
Raster, Vector or CAD Object
A valid Vector or Raster Object
戻り値
class GEOREF
georeference subobject of object parameter
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster R; class Georef g; GetInputRaster(R); g=GetGeorefObject(R); # get georeference, change projection g=GeorefGetParms(g); # Do something with the georef here GeorefFree(g);
GetLastUsedGeorefObject
Return the most recently used georeference subobject
GetLastUsedGeorefObject(Object)
場所:
ジオリファレンス(座標付与)
パラメータ:
Raster, Vector or CAD Object
A valid Vector or Raster object
詳細と仮定
Instead of prompting the user for a new georeference, the most recently used georeference is automatically used.
戻り値
class GEOREF
georef object or 0 if not found
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster R; class Georef g; GetInputRaster(R); g=GetLastUsedGeorefObject(R); # get most recent georeference # Translate top left corner of raster to # map coordinates last used by R numeric x, y; ObjectToMap(R, 1, 1, g, x, y); print("Top left corner is at\nLat: ", y, "\nlon: ", x); GeorefFree(g); CloseRaster(R);
MapToObject
Transform georeferenced location from map coordinates to object coordinates
MapToObject(georef, map_x, map_y, Object, x, y)
場所:
ジオリファレンス(座標付与)
パラメータ:
class GEOREF georef
Georeference object
numeric map_x
The x coordinate of the point of interest, as it exists in the georeferenced map coordinate system
numeric map_y
The y coordinate in the map coordinate system
Raster, Vector or CAD Object
A valid vector or raster object
numeric variable x (オプション)
The coordinates of the point of interest, as it exists relative to the origin of the object
numeric variable y (オプション)
The y coordinate relative to the object origin
戻り値
class POINT2D
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster R; class Georef g; numeric x1, y1, x2, y2; GetInputRaster(R); g=GetGeorefObject(R); print("Enter x1."); x1=PopupNum("Enter x1."); print("Enter y1."); y1=PopupNum("Enter y1."); MapToObject(g, x1, y1, R, x2, y2); print("Map: ", x1, y1); print("/nObject: ", x2, y2); GeorefFree(g); CloseRaster(R);
ObjectToMap
Transform object coordinates to georeferenced location
ObjectToMap(Object, x, y, georef, map_x, map_y)
場所:
ジオリファレンス(座標付与)
パラメータ:
Raster, Vector or CAD Object
A valid vector or raster object
numeric x
The coordinates of the point of interest, as it exists relative to the origin of the object
numeric y
The y coordinate relative to the object origin
class GEOREF georef
A georeference object
numeric variable map_x (オプション)
The coordinates of the point of interest, as it exists in the georeferenced map coordinate system
numeric variable map_y (オプション)
The y coordinate in the map coordinate system
戻り値
class POINT2D
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster R; class Georef g; numeric x1, y1, x2, y2; GetInputRaster(R); g=GetGeorefObject(R); print("Enter object coord x1."); x1=PopupNum("Enter object coord x1."); print("Enter object coord y1."); y1=PopupNum("Enter object coord y1."); ObjectToMap(R, x1, y1, g, x2, y2); print("Object: ", x1,y1); print("/nMap: ", x2, y2); GeorefFree(g); CloseRaster(R);
ProjDistanceToMeters
Compute distance in meters between two points in specified projection. If the coordinate system is Latitude-Longitude the distance along a geodetic is returned (actual distance over curved surface).
ProjDistanceToMeters(refsys, x1, y1, x2, y2)
場所:
ジオリファレンス(座標付与)
パラメータ:
class SR_COORDREFSYS refsys
The coordinate reference system
numeric x1
X coordinate of point 1
numeric y1
Y coordinate of point 1
numeric x2
X coordinate of point 2
numeric y2
Y coordinate of point 2
戻り値
numeric
作成日時: 09-Jan-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); class MAPPROJ mapproj; mapproj.SetSystemLatLon(); class POINT2D la; la.x = -118; la.y = 33.5; class POINT2D ny; ny.x = -73.5; ny.y = 41; print(ProjDistanceToMeters(mapproj, la.x, la.y, ny.x, ny.y) / 1000, "km");
ReadControlPoints
Reads the control points of the last used georeference attached to an object
ReadControlPoints(Object, xSource, ySource, zSource, xDestination, yDestination, zDestination)
場所:
ジオリファレンス(座標付与)
パラメータ:
Raster, Vector or CAD Object
The Object the georeference is attached to
array xSource
Source x positions returned
array ySource
Source y positions returned
array zSource
Source z positions returned
array xDestination
Destination x positions returned
array yDestination
Destination y positions returned
array zDestination
Destination z positions returned
詳細と仮定
The Object has a control point georeference
戻り値
numeric
number of control points read
作成日時: 07-Jul-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); raster R; array numeric xS[5], yS[5], zS[5], xD[5], yD[5], zD[5]; GetInputRaster(R); numeric numPoints = ReadControlPoints(R, xS, yS, zS, xD, yD, zD); numeric i; for i = 1 to numPoints { print(xS[i], yS[i], zS[i], " - ", xD[i], yD[i], zD[i]); }
TransPoint2D
Transform 2D point using transparm
TransPoint2D(point, transparm, invert)
場所:
ジオリファレンス(座標付与)
パラメータ:
class POINT2D point
The point to transform
class TRANSPARM transparm
Transparm to use
numeric invert (オプション)
Do inverse
戻り値
class POINT2D
作成日時: 22-May-1998
修正日時: 22-May-1998
TNTsml for Windows で使用可能: はい
例:
###################### # # ORBITSP.SML # # Demonstration of movie generation from 3D display using spiral # orbit path. Both 2D and 3D views are copied into each movie frame. # # View center is fixed at center of group. Viewer position is computed # from size of group. Two complete orbits are made. The first starts # beyond the edge of group and spirals inward and downward; the second # spirals outward and upward. # # Script uses an input DEM for the surface layer, an input raster drape # layer, and an input vector drape layer. # # Requires TNTmips Version 6.5 # ##################### clear(); #### Set movie format, frame rate, and recording time # Movie format (Possible values : "MPEG"(All platform) or "AVI"(Windows only) string format$; format$ = "AVI"; # Frame rate # Possible values : # "MOVIE_FRAMERATE_23_976" 23.976 (24000/1001) fps - NTSC encapsulated film rate # "MOVIE_FRAMERATE_24" 24 fps - Standard international cinema film rate # "MOVIE_FRAMERATE_25" 25 fps - PAL (625/50) video frame rate # "MOVIE_FRAMERATE_29_970" 29.97 (30000/1001) fps - NTSC video frame rate # "MOVIE_FRAMERATE_30" 30 fps - NTSC drop-frame (525/60) video frame rate # "MOVIE_FRAMERATE_50" 50 fps - Double frame rate / progressive PAL # "MOVIE_FRAMERATE_59_940" 59.94 (60000/1001) fps - Double frame rate NTSC # "MOVIE_FRAMERATE_60" 60 fps - Double frame rate drop-frame NTSC string framerate$; framerate$ = "MOVIE_FRAMERATE_24"; # Recording time numeric time; time = 60; ###### Get RVC objects to load raster Surface, RastDrape; vector VectDrape; print("Select raster to use for surface"); GetInputRaster(Surface); print("Select raster to use for first drape layer"); GetInputRaster(RastDrape); print("Select vector to use for second drape layer"); GetInputVector(VectDrape); ###### RVC style object to draw center point and viewer point string styleFilename$; string styleObjectname$; GetInputObject("Style","Select style object for center and viewer point symbols:", styleFilename$, styleObjectname$); string viewer$; viewer$ = "VIEWER"; string center$; center$ = "CENTER"; ######## Create display group with 2d and 3d views print("START"); # Size of squared 2D view and 3D view # Should be evenly divisible by 8 numeric size; size = 400; # Zoom out factor for 2D view numeric zoomfactor; zoomfactor = 1.8; # Create group print("Creating Group"); class GRE_GROUP group; group = GroupCreate(); # Create flags to create view without iconbar, scrollbars, status line and scale/position line # This is important to maintain fixed window size for movie generation string flags$; flags$ = "NoScalePosLine,NoIconBar,NoScrollbars,NoStatusLine"; # Create dialog and 2D view print("Creating dialog and 2D view"); class XmForm dialog2d; class GRE_VIEW view2d; dialog2d = CreateFormDialog("VIEW 2D"); view2d = GroupCreateView(group,dialog2d,"",size,size,flags$); view2d.BackgroundColor.red = 67; view2d.BackgroundColor.green = 100; view2d.BackgroundColor.blue = 100; # Create dialog and 3D view print("Creating dialog and 3D view"); class XmForm dialog3d; class GRE_VIEW3D view3d; dialog3d = CreateFormDialog("VIEW 3D"); view3d = GroupCreate3DView(group,dialog3d,"",size,size,flags$); view3d.BackgroundColor.red = 67; view3d.BackgroundColor.green = 100; view3d.BackgroundColor.blue = 100; # Add layers to group GroupQuickAddRasterVar(group,Surface,1); GroupQuickAddRasterVar(group,RastDrape,0); GroupQuickAddVectorVar(group,VectDrape); # Open both views DialogOpen(dialog2d); DialogOpen(dialog3d); # Full redraw of both views ViewRedrawFull(view2d); ViewRedrawFull(view3d); ViewZoomOut(view2d,zoomfactor,1); ####### Set up parameters for movie frame # Destination of each view in final frame for movie numeric x2d, y2d, x3d, y3d, w, h; x2d = 0; y2d = 0; x3d = size; y3d = 0; w = 2 * size; h = size; # Create text strings for annotation in frame string frameTitle$; string frameTitle2$; frameTitle$ = "Mount St. Helens Flow Hazard Zonation"; frameTitle2$ = "and Survey Station Locations"; # Font size numeric fontsize; fontsize = 16; # Define color for text annotation in frame class Color black; black.red = 0; black.green = 0; black.blue = 0; # Creating frame print("Creating frame for movie"); class Frame frame; frame = FrameCreate(w,h); # Create graphics context (GC) for frame print("Creating GC from frame and activate it"); ActivateGC(FrameCreateGC(frame)); DrawTextSetHeightPixels(fontsize); DrawUseStyleObject(styleFilename$,styleObjectname$); ######## Set some more movie parameters # Initiale Movie print("Initializing Movie"); class Movie movie; movie = MovieInit(); # Check framerate and force it to "MOVIE_FRAMERATE_24" if it is invalid numeric rate; rate = 24; if (framerate$ == "MOVIE_FRAMERATE_23_976") rate = 23.976; if (framerate$ == "MOVIE_FRAMERATE_25") rate = 25.0; if (framerate$ == "MOVIE_FRAMERATE_29_970") rate = 29.970; if (framerate$ == "MOVIE_FRAMERATE_30") rate = 30.0; if (framerate$ == "MOVIE_FRAMERATE_50") rate = 50.0; if (framerate$ == "MOVIE_FRAMERATE_59_940") rate = 59.940; if (framerate$ == "MOVIE_FRAMERATE_60") rate = 60.0; if (rate == 24.0) framerate$ = "MOVIE_FRAMERATE_24"; # Set Movie Parameters print("Setting Movie Parameters"); MovieSetFormat(movie,format$); MovieSetFrameRate(movie,framerate$); MovieSetFrameWidth(movie,w); MovieSetFrameHeight(movie,h); # Make Output File string ext$; ext$ = MovieGetFileExt(movie); string filename$; filename$ = GetOutputFileName("","Make filename for movie",ext$); printf("Filename = %s\n",filename$); # Check recording time if (time <= 1.0) time = 1.0; ##### Get georeference for surface layer and reset to group projection class Georef georef; georef = GetLastUsedGeorefObject(Surface); GeorefSetProjection(georef,group.Projection); # Find map coordinates and surface elevation at center of group # and define as view point (center) class POINT3D center; center.x = group.Center.x; center.y = group.Center.y; numeric objx; numeric objy; MapToObject(georef,center.x,center.y,Surface,objx,objy); center.z = Surface[objy,objx]; ##### Set up viewpoint and viewer position parameters class VIEWPOINT3D vp; vp = view3d.ViewPoint; vp.SetCenter(center); class POINT3D pt; # viewer position class POINT2D point; # 2D point for location symbols # Set initial viewer position north of center just beyond group extents # and 10000 m higher than center point pt.x = group.Center.x; pt.y = group.Extents.y2 + 0.6 * (group.Extents.y2 - group.Center.y); pt.z = center.z + 10000; vp.SetViewerPosition(pt); # Calculate spiral orbit parameters numeric numFrames = time * rate; numeric deltaAngle = -360.0 / numFrames * 2; numeric tx = vp.ViewPos.x - vp.CenterPoint.x; numeric ty = vp.ViewPos.y - vp.CenterPoint.y; numeric distance = 4 * sqrt(tx * tx + ty * ty) / 5 / numFrames * 2; numeric height = (vp.ViewPos.z - vp.CenterPoint.z) / numFrames * 2; ###### Start recording movie to file MovieStart(movie,filename$); # Loop for each frame numeric i, azimuth; for i = 1 to numFrames { SetStatusMessage(sprintf("Processing frame %d of %d",i,numFrames)); # Rotate viewer position around center with deltaAngle increment vp.RotateViewerPosition(deltaAngle); if (i <= numFrames / 2) { # Move viewer position closer and higher to center point azimuth = vp.AzimAngle * 180 / PI; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,90,height,"m"); } else { # Move viewer position farther and lower from center point azimuth = vp.AzimAngle * 180 / PI + 180; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,-90,height,"m"); } # ViewRedrawDirect(view3d,"NoBlankScreen"); # This new function added after release of TNTmips 6.5 # can redraw the view without blanking it first. Use of # this function eliminates "flashing" of the view as the # movie is initially rendered. It has no effect on the # output movie file. For 6.5 release version, use the # function in the next statement. ViewRedraw(view3d); # Copy 2d view and 3d view to destination frame FrameCopyFromView(frame,view2d,0,0,size,size,x2d,y2d); FrameCopyFromView(frame,view3d,0,0,size,size,x3d,y3d); # Draw center point in 2d view point.x = vp.CenterPoint.x; point.y = vp.CenterPoint.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(center$); DrawPoint(point.x,point.y); # Draw viewer position point in 2d view point.x = vp.ViewPos.x; point.y = vp.ViewPos.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(viewer$); DrawPoint(point.x,point.y); # Draw text to top of frame DrawTextSetColors(black); DrawTextSimple(frameTitle$,5,fontsize); DrawTextSimple(frameTitle2$,5,2.2*fontsize); # Add frame to movie MovieAddFrame(movie,frame); } # End of main processing loop # Stop and Exit movie MovieStop(movie); MovieExit(movie); # Close dialogs DialogClose(dialog2d); DialogClose(dialog3d); print("END");
WriteControlPoints
Write control points to the last used georeference attached to an object
WriteControlPoints(Object, numberPoints, xSource, ySource, zSource, xDestination, yDestination, zDestination)
場所:
ジオリファレンス(座標付与)
パラメータ:
Raster, Vector or CAD Object
The Object the georeference is attached to
numeric numberPoints
Number of control points to write
array xSource
Source x positions
array ySource
Source y positions
array zSource
Source z positions
array xDestination
Destination x positions
array yDestination
Destination y positions
array zDestination
Destination z positions
詳細と仮定
The Object has a control point georeference and the arrays are large enough to hold numberPoints numbers
戻り値
なし
作成日時: 07-Jul-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
raster R; array numeric xS[5], yS[5], zS[5], xD[5], yD[5], zD[5]; xS[1] = 0; yS[1] = 0; zS[1] = 0; xD[1] = 333354; yD[1] = 162833; zD[1] = 0; xS[2] = 361; yS[2] = 488; zS[2] = 0; xD[2] = 343050; yD[2] = 148559; zD[2] = 0; xS[3] = 0; yS[3] = 488; zS[3] = 0; xD[3] = 332803; yD[3] = 148958; zD[3] = 0; xS[4] = 361; yS[4] = 0; zS[4] = 0; xD[4] = 343000; yD[4] = 162000; zD[4] = 0; GetInputRaster(R); WriteControlPoints(R, 4, xS, yS, zS, xD, yD, zD);
ColorMapFromRastVar
Read colormap from under raster.
ColorMapFromRastVar(raster, nameOrNum)
場所:
カラーパレット
パラメータ:
Raster raster
Raster object
any value nameOrNum (オプション)
Which one if more than one available (default: last used)
戻り値
class COLORMAP
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/deveg68.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ColorMapGetColor
Get a color from a colormap
ColorMapGetColor(colormap, index)
場所:
カラーパレット
パラメータ:
class COLORMAP colormap
The ColorMap
numeric index
What color index to get
戻り値
class COLOR
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/biomass.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ColorMapSetColor
Set a colormap color given a class color structure.
ColorMapSetColor(colormap, index, color)
場所:
カラーパレット
パラメータ:
class COLORMAP colormap
The colormap to set
numeric index
Index of color to set
class COLOR color
The color structure to set the color with
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/biomass.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ColorMapSetColorHIS
Set a colormap color to given HIS values.
ColorMapSetColorHIS(colormap, index, hue, intensity, saturation)
場所:
カラーパレット
パラメータ:
class COLORMAP colormap
The colormap to set
numeric index
Index of color to set
numeric hue
Hue value
numeric intensity
Intensity value
numeric saturation
Saturation value
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/biomass.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ColorMapSetColorRGB
Set a colormap color to given RGB values.
ColorMapSetColorRGB(colormap, index, red, green, blue, range)
場所:
カラーパレット
パラメータ:
class COLORMAP colormap
The colormap to set
numeric index
Index of color to set
numeric red
Red value
numeric green
Green value
numeric blue
Blue value
numeric range (オプション)
Sets the maximum value for red, green, blue
詳細と仮定
default range is 0 - 255
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/classifyRaster.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ColorMapWriteToRastVar
Write a colormap under a raster.
ColorMapWriteToRastVar(raster, colormap, name$, description$)
場所:
カラーパレット
パラメータ:
Raster raster
Raster object
class COLORMAP colormap
The colormap to write
string name$
The colormap object name
string description$ (オプション)
The colormap object description
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/deveg68.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
CloseStyleObject
Close a Style Object
CloseStyleObject(style)
場所:
スタイル
パラメータ:
class RVC_STYLE style
Style Object
戻り値
なし
作成日時: 07-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
OpenStyleObject
Open a Style Object
OpenStyleObject(filename$, objectname$, Credentials)
場所:
スタイル
パラメータ:
string filename$
Full filepath
string objectname$
Object Name
class RVC_CREDENTIALS Credentials (オプション)
Credentials Object
戻り値
class RVC_STYLE
作成日時: 07-Apr-1998
修正日時: 20-Dec-2005
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
OpenStyleSubObject
Open a Sub-Object of a Style Object
OpenStyleSubObject(ParentObject)
場所:
スタイル
パラメータ:
class RVC_OBJECT ParentObject
Parent Style Object
戻り値
class RVC_STYLE
作成日時: 07-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
StyleReadBitmapPattern
Read a BITMAPPATTERN from a style object
StyleReadBitmapPattern(style, name$)
場所:
スタイル
パラメータ:
class RVC_STYLE style
A style object
string name$
The bitmap pattern name
戻り値
class BITMAPPATTERN
作成日時: 07-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class STYLEOBJECT style; class BITMAPPATTERN bitmap; class LINEPATTERN linepattern; string filepath$ = "C:/Program Files/MicroImages/TNT_69/stdstyle.rvc"; # Open the style object string obj$ = "BitmapPatterns/General"; style = OpenStyleObject(filepath$, obj$); # if the style is a subobject SEE: OpenStyleSubObject() bitmap = StyleReadBitmapPattern(style, "Bitmap0"); # Open the style object string obj$ = "LinePatterns/Basic"; style = OpenStyleObject(filepath$, obj$); linepattern = StyleReadLinePattern(style, "LinePatt0"); # Can do the same with # StyleReadLineStyle() # StyleReadPointStyle() # StyleReadPointSymbol() # StyleReadPolyStyle() # StyleReadTextStyle() CloseStyleObject(style);
StyleReadHatchPattern
Read a hatch pattern from a style object
StyleReadHatchPattern(style, name$)
場所:
スタイル
パラメータ:
class RVC_STYLE style
The style object to use
string name$
The hatch pattern name
戻り値
class HATCHPATTERN
作成日時: 27-Sep-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
StyleReadLinePattern
Read a LINEPATTERN from a style object
StyleReadLinePattern(style, name$)
場所:
スタイル
パラメータ:
class RVC_STYLE style
A style object
string name$
The line pattern name
戻り値
class LINEPATTERN
作成日時: 07-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class STYLEOBJECT style; class BITMAPPATTERN bitmap; class LINEPATTERN linepattern; string filepath$ = "C:/Program Files/MicroImages/TNT_69/stdstyle.rvc"; # Open the style object string obj$ = "BitmapPatterns/General"; style = OpenStyleObject(filepath$, obj$); # if the style is a subobject SEE: OpenStyleSubObject() bitmap = StyleReadBitmapPattern(style, "Bitmap0"); # Open the style object string obj$ = "LinePatterns/Basic"; style = OpenStyleObject(filepath$, obj$); linepattern = StyleReadLinePattern(style, "LinePatt0"); # Can do the same with # StyleReadLineStyle() # StyleReadPointStyle() # StyleReadPointSymbol() # StyleReadPolyStyle() # StyleReadTextStyle() CloseStyleObject(style);
StyleReadLineStyle
Read a line style from a style object
StyleReadLineStyle(styleobj, stylename$)
場所:
スタイル
パラメータ:
class RVC_STYLE styleobj
The style object to read from
string stylename$
The style name
戻り値
class LINESTYLE
作成日時: 28-Sep-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class STYLEOBJECT style; class BITMAPPATTERN bitmap; class LINEPATTERN linepattern; string filepath$ = "C:/Program Files/MicroImages/TNT_69/stdstyle.rvc"; # Open the style object string obj$ = "BitmapPatterns/General"; style = OpenStyleObject(filepath$, obj$); # if the style is a subobject SEE: OpenStyleSubObject() bitmap = StyleReadBitmapPattern(style, "Bitmap0"); # Open the style object string obj$ = "LinePatterns/Basic"; style = OpenStyleObject(filepath$, obj$); linepattern = StyleReadLinePattern(style, "LinePatt0"); # Can do the same with # StyleReadLineStyle() # StyleReadPointStyle() # StyleReadPointSymbol() # StyleReadPolyStyle() # StyleReadTextStyle() CloseStyleObject(style);
StyleReadPointStyle
Read a point style from a style object
StyleReadPointStyle(styleobj, stylename$)
場所:
スタイル
パラメータ:
class RVC_STYLE styleobj
The style object to read from
string stylename$
The style name
戻り値
class POINTSTYLE
作成日時: 28-Sep-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class STYLEOBJECT style; class BITMAPPATTERN bitmap; class LINEPATTERN linepattern; string filepath$ = "C:/Program Files/MicroImages/TNT_69/stdstyle.rvc"; # Open the style object string obj$ = "BitmapPatterns/General"; style = OpenStyleObject(filepath$, obj$); # if the style is a subobject SEE: OpenStyleSubObject() bitmap = StyleReadBitmapPattern(style, "Bitmap0"); # Open the style object string obj$ = "LinePatterns/Basic"; style = OpenStyleObject(filepath$, obj$); linepattern = StyleReadLinePattern(style, "LinePatt0"); # Can do the same with # StyleReadLineStyle() # StyleReadPointStyle() # StyleReadPointSymbol() # StyleReadPolyStyle() # StyleReadTextStyle() CloseStyleObject(style);
StyleReadPointSymbol
Read a POINTSYMBOL from a style object
StyleReadPointSymbol(style, name$)
場所:
スタイル
パラメータ:
class RVC_STYLE style
A style object
string name$
The point symbol name
戻り値
class POINTSYMBOL
作成日時: 07-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class STYLEOBJECT style; class BITMAPPATTERN bitmap; class LINEPATTERN linepattern; string filepath$ = "C:/Program Files/MicroImages/TNT_69/stdstyle.rvc"; # Open the style object string obj$ = "BitmapPatterns/General"; style = OpenStyleObject(filepath$, obj$); # if the style is a subobject SEE: OpenStyleSubObject() bitmap = StyleReadBitmapPattern(style, "Bitmap0"); # Open the style object string obj$ = "LinePatterns/Basic"; style = OpenStyleObject(filepath$, obj$); linepattern = StyleReadLinePattern(style, "LinePatt0"); # Can do the same with # StyleReadLineStyle() # StyleReadPointStyle() # StyleReadPointSymbol() # StyleReadPolyStyle() # StyleReadTextStyle() CloseStyleObject(style);
StyleReadPolyStyle
Read a polygon style from a style object
StyleReadPolyStyle(styleobj, stylename$)
場所:
スタイル
パラメータ:
class RVC_STYLE styleobj
The style object to read from
string stylename$
The style name
戻り値
class POLYSTYLE
作成日時: 28-Sep-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class STYLEOBJECT style; class BITMAPPATTERN bitmap; class LINEPATTERN linepattern; string filepath$ = "C:/Program Files/MicroImages/TNT_69/stdstyle.rvc"; # Open the style object string obj$ = "BitmapPatterns/General"; style = OpenStyleObject(filepath$, obj$); # if the style is a subobject SEE: OpenStyleSubObject() bitmap = StyleReadBitmapPattern(style, "Bitmap0"); # Open the style object string obj$ = "LinePatterns/Basic"; style = OpenStyleObject(filepath$, obj$); linepattern = StyleReadLinePattern(style, "LinePatt0"); # Can do the same with # StyleReadLineStyle() # StyleReadPointStyle() # StyleReadPointSymbol() # StyleReadPolyStyle() # StyleReadTextStyle() CloseStyleObject(style);
StyleReadTextStyle
Read a text style from a style object
StyleReadTextStyle(styleobj, stylename$)
場所:
スタイル
パラメータ:
class RVC_STYLE styleobj
The style object to read from
string stylename$
The style name
戻り値
class TEXTSTYLE
作成日時: 28-Sep-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class STYLEOBJECT style; class BITMAPPATTERN bitmap; class LINEPATTERN linepattern; string filepath$ = "C:/Program Files/MicroImages/TNT_69/stdstyle.rvc"; # Open the style object string obj$ = "BitmapPatterns/General"; style = OpenStyleObject(filepath$, obj$); # if the style is a subobject SEE: OpenStyleSubObject() bitmap = StyleReadBitmapPattern(style, "Bitmap0"); # Open the style object string obj$ = "LinePatterns/Basic"; style = OpenStyleObject(filepath$, obj$); linepattern = StyleReadLinePattern(style, "LinePatt0"); # Can do the same with # StyleReadLineStyle() # StyleReadPointStyle() # StyleReadPointSymbol() # StyleReadPolyStyle() # StyleReadTextStyle() CloseStyleObject(style);
AddCallback
Add a user defined callback
AddCallback(callback, function, data)
場所:
システム
パラメータ:
class CALLBACKLIST callback
An instance of a class that is, or inherits from CallbackList
proc function
Procedure to call
class anything data (オプション)
Data passed to callback
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# DIALOG1.SML # Sample script for Getting Started. # Creates and opens a simple dialog window. # Define parent widget for dialog window. class XmForm win1; # Procedure for closing window proc OnClose() { DialogClose(win1); DestroyWidget(win1); } # Set up dialog window win1 = CreateFormDialog("Hello World"); win1.MarginHeight = 5; win1.MarginWidth = 5; # Create label text for window class XmLabel winLabel; winLabel = CreateLabel(win1,"Sample Dialog Window"); winLabel.TopWidget = win1; winLabel.LeftWidget = win1; winLabel.LeftOffset = 10; winLabel.RightWidget = win1; winLabel.RightOffset = 10; # Create Close button attached to label on # on top and to window margin on left and right class XmPushButton closeButton; closeButton = CreatePushButton(win1,"Close"); closeButton.TopWidget = winLabel; closeButton.TopOffset = 5; closeButton.leftWidget = win1; closeButton.rightWidget = win1; closeButton.bottomWidget = win1; # Could also use the generic AddCallback() function WidgetAddCallback(closeButton.ActivateCallback,OnClose); # Open dialog window and keep script active # until window is closed. DialogOpen(win1); DialogWaitForClose(win1); # Example of CreateFormDialog()
Exit
Exit the script (calls functions registered with OnExit).
Exit()
場所:
システム
パラメータ:
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
### ### Using Function Group ### class STATUSHANDLE statushandle; class STATUSCONTEXT statuscontext; numeric count = 500; # Create progress dialog statushandle = StatusDialogCreate(); statuscontext = StatusContextCreate(statushandle); StatusSetMessage(statuscontext, "Starting..."); # initialize progress bar StatusSetBar(statuscontext, 0, count); numeric percent = 0; numeric i; for i=1 to count { print(i); StatusSetBar(statuscontext, i, count); # if(i%25==0) # { percent = round((i/count) * 100); statuscontext.Message = "Task Completed: " + NumToStr(percent) + "%" ; # } } StatusContextDestroy(statuscontext); StatusDialogDestroy(statushandle); ### ### Using Class Methods (Preferred) ### class STATUSDIALOG statusdialog; class STATUSCONTEXT statuscontext; numeric count = 500; # Create progress dialog statusdialog.Create(); statuscontext = statusdialog.CreateContext(); statuscontext.Message = "Starting..."; # initialize progress bar statuscontext.BarInit(count,0); numeric percent; numeric i; for i=1 to count { print(i); statuscontext.BarIncrement(1,0); # if(i%25==0) # { percent = round((i/count) * 100); statuscontext.Message = "Task Completed: " + NumToStr(percent) + "%" ; # } if (statusdialog.CheckCancel()) { print("Task Cancelled"); Exit(); } } statusdialog.destroy();
GetLastError
Get the last error encountered in the script to test if a function succeeded
GetLastError()
場所:
システム
詳細と仮定
Calling the function clears the error code, so if you call it twice, the 2nd call will return 0.
戻り値
numeric
Returns an error code with value < 0, or 0 if there's no error. Starting with TNTmips7.0 script writer can perform their own error handling by setting _context.AbortOnError=0
作成日時: 29-Jan-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); _context.AbortOnError =0; func hadError() { if (GetLastError() < 0) return 1; else return 0; } vector V; GetInputVector(V); if(hadError()) print("ERROR - GetInputVector"); VectorDeleteDangleLines(V, 300); # need to init toolkit first if(hadError()) print("ERROR - DeleteDangles"); # this is the only print executed if(hadError()) print("ERROR - Returns 0 2nd time called");
OnExit
Register function to call just before script exits.
OnExit(function, data)
場所:
システム
パラメータ:
proc function
The function to call
class anything data (オプション)
Data to pass to the function
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# prints 1 2 3 # In general, on exit can be used to clean up at end of script # i.e. close rasters, delete temp files, etc. proc printThree() { print(3); } print(1); OnExit(printThree); print(2);
run
Runs another command
run(command$, wait)
場所:
システム
パラメータ:
string command$
Any valid string
numeric wait (オプション)
1 or 0:
1 means run() will not return until the command completes
0 means command will run in the background
戻り値
numeric
Returns a number < 0 if the run command failed
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
run("program.exe", 0); # run in background
RunAssociatedApplication
Runs application associated with passed file
RunAssociatedApplication(filename$)
場所:
システム
パラメータ:
string filename$
File to open
戻り値
なし
作成日時: 18-Oct-2000
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
RunAssociatedApplication("c:/temp/sample.txt");# Opens sample.txt with associated application
RunSML
Run an SML script
RunSML(filename$, objectname$)
場所:
システム
パラメータ:
string filename$
File name or RVC file name
string objectname$ (オプション)
File name if part of RVC file
戻り値
なし
作成日時: 08-May-1998
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
RunSML("C:/Program Files/MicroImages/TNT_70/smlsamples/StandAlone/movie.sml");
sleep
Pause execution for a number of seconds.
sleep(seconds)
場所:
システム
パラメータ:
numeric seconds
Number of seconds to sleep
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# declare class variables class GPSPort gpsport; class GPSData gpsdata; clear(); # open the port gpsport = GPSPortOpen("COM1", "NMEA", ":4800:8:none:1:"); print(gpsport.Protocol, gpsport.Name); while (1) # now read data { print(gpsport.protocol, gpsport.name, "\n"); gpsdata = GPSPortRead(gpsport); if (gpsdata.positionXYIsValid) print("x y", gpsdata.position.x, gpsdata.position.y); if (gpsdata.positionZIsValid) print("z ", gpsdata.position.z); if (gpsdata.velocityXYIsValid) print("vx vy ", gpsdata.velocity.x, gpsdata.velocity.y); if (gpsdata.velocityZIsValid) print("vz ", gpsdata.velocity.z); if (gpsdata.headingIsValid) print("heading", gpsdata.heading); if (gpsdata.speedIsValid) print("speed", gpsdata.speed); if (gpsdata.numberSatellitesIsValid) print("number of satellites", gpsdata.numberOfSatellites); print("\n\n"); sleep(1); } # close the port GPSPortClose(gpsport);
WaitForExit
Suspend script but process callbacks and events.
WaitForExit()
場所:
システム
パラメータ:
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/view.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ConvertCMYKtoRGB
Convert Cyan-Magenta-Yellow-Black to Red-Green-Blue
ConvertCMYKtoRGB(maxrgbvalue, c, m, y, k, red, green, blue)
場所:
カラー変換
パラメータ:
numeric maxrgbvalue
The maximum value for red, green, or blue
numeric c
Cyan
numeric m
Magenta
numeric y
Yellow
numeric k
Black
numeric variable red
Red value returned
numeric variable green
Green value returned
numeric variable blue
Blue value returned
戻り値
なし
作成日時: 08-Jul-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); numeric c, m, y, k, red, green, blue; c = 100; m = 100; y = 100; k = 101; ConvertCMYKtoRGB(255, c, m, y, k, red, green, blue); string format$ = "%3d %3d %3d %3d - %3d %3d %3d"; printf(format$, c, m, y, k, red, green, blue);
ConvertHBStoRGB
Convert hue, brightness, saturation to red, green, blue
ConvertHBStoRGB(hue, saturation, value, red, green, blue)
場所:
カラー変換
パラメータ:
numeric hue
Hue (range 0 - 360)
numeric saturation
Saturation (range 0 - 100)
numeric value
Value (range 0 - 100)
numeric variable red
Red value returned (range 0 - 255)
numeric variable green
Green value returned (range 0 - 255)
numeric variable blue
Blue value returned (range 0 - 255)
戻り値
なし
作成日時: 13-Jul-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); numeric h, b, s, red, green, blue; h = 180; b = 50; s = 50; ConvertHBStoRGB(h, b, s, red, green, blue); printf("hbs - rgb %3d %3d %3d - %3d %3d %3d\n", h, b, s, red, green, blue);
ConvertHIStoRGB
Convert from hue, intensity, saturation to red, green, blue
ConvertHIStoRGB(maxrgbvalue, hue, intensity, saturation, red, green, blue)
場所:
カラー変換
パラメータ:
numeric maxrgbvalue
The maximum posible value of red, green and blue
numeric hue
Hue value (range 0 to 360)
numeric intensity
Brightness value (range 0 to 100)
numeric saturation
Saturation value (range 0 to 100)
numeric variable red
Red value returned (range 0 to maxrgbvalue)
numeric variable green
Green value returned (range 0 to maxrgbvalue)
numeric variable blue
Blue value returned (range 0 to maxrgbvalue)
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# rgbhis.sml # convert between rgb and his # each function also takes a maximum rgb value for proper scaling # max for 8-bit unsigned = 255 # max for 16-bit unsigned = 65535 clear(); numeric maxrgb = 255; numeric h, i, s, r, g, b; for h = 1 to 360 step 179 { for i = 1 to 100 step 49 { for s = 1 to 100 step 49 { ConvertHIStoRGB(maxrgb, h, i, s, r, g, b); printf("%s: %6d %6d %6d %6d %6d %6d \n", "his -> rgb", h, i, s, r, g, b); } } } for r = 1 to 255 step 100 { for g = 1 to 255 step 100 { for b = 1 to 255 step 100 { ConvertRGBtoHIS(maxrgb, r, g, b, h, i, s); printf("%s: %6d %6d %6d %6d %6d %6d \n", "rgb -> his", r, g, b, h, i, s); } } }
ConvertHSVtoRGB
Convert hue, saturation, value to red, green, blue
ConvertHSVtoRGB(hue, saturation, value, red, green, blue)
場所:
カラー変換
パラメータ:
numeric hue
Hue (range 0 - 360)
numeric saturation
Saturation (range 0 - 208)
numeric value
Value (range 0 - 512)
numeric variable red
Red value returned (range 0 - 255)
numeric variable green
Green value returned (range 0 - 255)
numeric variable blue
Blue value returned (range 0 - 255)
戻り値
なし
作成日時: 10-Jul-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
numeric h,s,v,r,g,b; h = 180; s = 50; v = 50; ConvertHSVtoRGB(h, s, v, r, g, b); printf("hsv - rgb %3d %3d %3d - %3d %3d %3d\n", h, s, v, r, g, b);
ConvertRGBtoHBS
Convert red, green, blue, to hue, brightness, saturation
ConvertRGBtoHBS(red, green, blue, hue, brightness, saturation)
場所:
カラー変換
パラメータ:
numeric red
Red value (range 0 - 255)
numeric green
Green value (range 0 - 255)
numeric blue
Blue value (range 0 - 255)
numeric variable hue
Hue returned (range 0 - 360)
numeric variable brightness
Brightness returned (range 0 - 100)
numeric variable saturation
Saturation returned (range 0 - 100)
戻り値
なし
作成日時: 13-Jul-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# Example of ConvertRGBtoHBS() numeric r, g, b, h, b, s; r = 127; g = 127; b = 127; ConvertRGBtoHBS(r, g, b, h, b, s); printf("rgb - hbs %3d %3d %3d - %3d %3d %3d\n", r, g, b, h, b, s);
ConvertRGBtoHIS
Convert from red, green, blue to hue, intensity, saturation
ConvertRGBtoHIS(maxrgbvalue, red, green, blue, hue, intensity, saturation)
場所:
カラー変換
パラメータ:
numeric maxrgbvalue
The maximum posible value of red, green, and blue
numeric red
Red value (range 0 to maxrgbvalue)
numeric green
Green value (range 0 to maxrgbvalue)
numeric blue
Blue value (range 0 to maxrgbvalue)
numeric variable hue
Hue value returned (range 0 to 360)
numeric variable intensity
Brightness value returned (range 0 to 100)
numeric variable saturation
Saturation value returned (range 0 to 100)
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# rgbhis.sml # convert between rgb and his # each function also takes a maximum rgb value for proper scaling # max for 8-bit unsigned = 255 # max for 16-bit unsigned = 65535 clear(); numeric maxrgb = 255; numeric h, i, s, r, g, b; for h = 1 to 360 step 179 { for i = 1 to 100 step 49 { for s = 1 to 100 step 49 { ConvertHIStoRGB(maxrgb, h, i, s, r, g, b); printf("%s: %6d %6d %6d %6d %6d %6d \n", "his -> rgb", h, i, s, r, g, b); } } } for r = 1 to 255 step 100 { for g = 1 to 255 step 100 { for b = 1 to 255 step 100 { ConvertRGBtoHIS(maxrgb, r, g, b, h, i, s); printf("%s: %6d %6d %6d %6d %6d %6d \n", "rgb -> his", r, g, b, h, i, s); } } }
ConvertRGBtoHSV
Convert red, green, blue to hue, saturation, value
ConvertRGBtoHSV(red, green, blue, hue, saturation, value)
場所:
カラー変換
パラメータ:
numeric red
Red value (range 0 - 255)
numeric green
Green value (range 0 - 255)
numeric blue
Blue value (range 0 - 255)
numeric variable hue
Hue returned (range 0 - 360)
numeric variable saturation
Saturation returned (range 0 - 208)
numeric variable value
Value returned (range 0 - 512)
戻り値
なし
作成日時: 10-Jul-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# Example of ConvertRGBtoHSV() numeric r, g, b, h, s, v; r = 127; g = 127; b = 127; ConvertRGBtoHBS(r, g, b, h, s, v); printf("rgb - hsv %3d %3d %3d - %3d %3d %3d\n", r, g, b, h, s, v);
CreateStatusDialog
Create a status dialog
CreateStatusDialog(parent, flags$)
場所:
ポップアップダイアログ
パラメータ:
class Widget parent (オプション)
The parent widget of the status dialog
string flags$ (オプション)
See below
可能性のある値:
"NoCancel"
Disable the cancel button
"DelayPopup"
戻り値
class STATUSDIALOG
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
DlgGetObject
Object selection dialog for user to select a single object.
DlgGetObject(Prompt$, ObjectTypes$, ObjItem, GetObjectFlags$)
場所:
ポップアップダイアログ
パラメータ:
string Prompt$
Prompt String for Dialog
string ObjectTypes$
Object type allowed for selection
class RVC_OBJITEM ObjItem
可能性のある値:
"All"
Get any Object
"Raster"
Get Raster Object
"Vector"
Get Vector Object
"CAD"
Get CAD Object
"TIN"
Get TIN Object
"Layout"
Display Layout
"Group"
Display Group
"Database"
Database
"Region"
Region
"Style"
Style object
RVC_OBJITEM returned
string GetObjectFlags$ (オプション)
Object selection flags
可能性のある値:
"ExistingOnly"
Allow existing objects only (Default)
"NewOnly"
Allow new objects only
"NewOrExisting"
Allow new or existing objects
戻り値
numeric
0 on success, 1 if an RVC_OBJITEM is new, less then 0 if error occurs
作成日時: 30-Mar-2006
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
DlgGetObjects
Object selection dialog for user to select an unspecified number of objects.
DlgGetObjects(Prompt$, ObjectTypes$, ObjItemList, GetObjectFlags$, MinObjs, MaxObjs)
場所:
ポップアップダイアログ
パラメータ:
string Prompt$
Prompt String for Dialog
string ObjectTypes$
Object type allowed for selection
class ObjItemList
可能性のある値:
"All"
Get any Object
"Raster"
Get Raster Object
"Vector"
Get Vector Object
"CAD"
Get CAD Object
"TIN"
Get TIN Object
"Layout"
Display Layout
"Group"
Display Group
"Database"
Database
"Region"
Region
"Style"
Style object
RVC_OBJITEM returned
string GetObjectFlags$ (オプション)
Object selection flags
numeric MinObjs (オプション)
可能性のある値:
"ExistingOnly"
Allow existing objects only (Default)
"NewOnly"
Allow new objects only
"NewOrExisting"
Allow new or existing objects
Minimum number of objects required (Default = 1)
numeric MaxObjs (オプション)
Maximum number of objects required (Default = 0)
戻り値
numeric
0 on success, 1 if an RVC_OBJITEM is new, less then 0 if error occurs
作成日時: 31-Mar-2006
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
DlgGetObjectSet
Object selection dialog for user to select a specified number of objects.
DlgGetObjectSet(Prompt$, ObjectTypes$, Labels, ObjItemList, GetObjectFlags$)
場所:
ポップアップダイアログ
パラメータ:
string Prompt$
Prompt String for Dialog
string ObjectTypes$
Object type allowed for selection
class STRINGLIST Labels
可能性のある値:
"All"
Get any Object
"Raster"
Get Raster Object
"Vector"
Get Vector Object
"CAD"
Get CAD Object
"TIN"
Get TIN Object
"Layout"
Display Layout
"Group"
Display Group
"Database"
Database
"Region"
Region
"Style"
Style object
Labels for the objects to select
class ObjItemList
RVC_OBJITEM returned
string GetObjectFlags$ (オプション)
Object selection flags
可能性のある値:
"ExistingOnly"
Allow existing objects only (Default)
"NewOnly"
Allow new objects only
"NewOrExisting"
Allow new or existing objects
戻り値
numeric
0 on success, 1 if an RVC_OBJITEM is new, less then 0 if error occurs
作成日時: 31-Mar-2006
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GetInputObject
Popup dialog to select an object and return info.
GetInputObject(ObjectType$, prompt$, rvcFilename$, objectName$)
場所:
ポップアップダイアログ
パラメータ:
string ObjectType$
See below
string prompt$
可能性のある値:
"All"
Get any Object
"Raster"
Get Raster Object
"Vector"
Get Vector Object
"CAD"
Get CAD Object
"TIN"
Get TIN Object
"Layout"
Display Layout
"Group"
Display Group
"Database"
Database
"Region"
Region
"Style"
Style object
Dialog prompt
string rvcFilename$
RVC filename returned
string objectName$
Object name returned
戻り値
なし
作成日時: 17-Jun-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); string type$ = "Style"; string prompt$ = "Go find a style object."; string filename$, obj$; GetInputObject(type$, prompt$, filename$, obj$); print(filename$, obj$);
GetOutputObject
Prompt the user for an output object
GetOutputObject(ObjectType$, NewOrExisting$, prompt$, rvcFilename$, objectName$, objectDescription$)
場所:
ポップアップダイアログ
パラメータ:
string ObjectType$
See below
string NewOrExisting$
可能性のある値:
"All"
Get any Object
"Raster"
Get Raster Object
"Vector"
Get Vector Object
"CAD"
Get CAD Object
"TIN"
Get TIN Object
"Layout"
Display Layout
"Group"
Display Group
"Database"
Database
"Region"
Region
"Style"
Style object
See below
string prompt$
可能性のある値:
"ExistingOnly"
Allow existing objects only
"NewOnly"
Allow new objects only
"NewOrExisting"
Allow new or existing objects
Dialog prompt
string rvcFilename$
RVC filename returned
string objectName$
RVC filename returned
string objectDescription$
RVC filename returned
詳細と仮定
This function does not actually create any new objects. If the object does not already exist then "objectName" will contain the name as entered by the user. If the object already exists then "objectName" will contain the entire object path.
戻り値
なし
作成日時: 17-Jun-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); string type$ = "Style"; string prompt$ = "Go find a style object."; string filename$, obj$, desc$; GetOutputObject(type$, "NewOnly", prompt$, filename$, obj$, desc$); print(filename$); print(obj$); print(desc$);
PopupError
Displays a popup window and displays the text associated with error_code
PopupError(error_code)
場所:
ポップアップダイアログ
パラメータ:
numeric error_code
A number returned from a SML function indicating an error has occurred - see errmsgs.txt for a complete list
詳細と仮定
Error codes are always negative.
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); PopupError(-1012); # error codes are always negative
PopupMessage
Open popup window with message and [OK] choice
PopupMessage(message$)
場所:
ポップアップダイアログ
パラメータ:
string message$
A string holding the message
詳細と仮定
The only response from the user is to press the OK button in the message window.
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
PopupMessage("Hello!");
PopupNum
Open popup window asking for a number
PopupNum(prompt$, default, min, max, decimal_places)
場所:
ポップアップダイアログ
パラメータ:
string prompt$
A string holding the message
numeric default (オプション)
Optional - (a number), the value returned if the user hit
numeric min (オプション)
Optional - (a number), the minimum acceptable value
numeric max (オプション)
Optional - (a number), the maximum acceptable value
numeric decimal_places (オプション)
Optional - (an integer), the number of decimal places used when displaying the default value. This has no effect on the value returned
詳細と仮定
The optional arguments must all be used and entered in order. If an out-of-range value is entered, SML will beep and require a new entry before proceeding.
戻り値
numeric
either the default of the number entered. If the user hits cancel the return value will be NULL. Note that to detect this, you must use the function IsNull()
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
PopupNum("Value?", 1, 10, 0, 2);
PopupSelectTable
Popup dialog for database table selection
PopupSelectTable(database, table$)
場所:
ポップアップダイアログ
パラメータ:
class DATABASE database
The database
string variable table$
Table name (passed/returned)
戻り値
numeric
1 on success, 0 on user cancel, -1 on error
作成日時: 19-Oct-2000
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); vector V; class DATABASE db; string tablename$; GetInputVector(V); if (V.$Info.NumPolys>0) { db = OpenVectorPolyDatabase(V); PopupSelectTable(db, tablename$); print("You selected:", tablename$); }
PopupSelectTableField
Popup dialog for user to select a table and field
PopupSelectTableField(database, table$, field$)
場所:
ポップアップダイアログ
パラメータ:
class DATABASE database
The database
string variable table$
Table name (passed/returned)
string variable field$
Field name (passed/returned)
戻り値
numeric
1 on success, 0 on user cancel, -1 on error
作成日時: 19-Oct-2000
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
clear(); class DATABASE database; vector V; string table$, field$; GetInputVector(V); database = OpenVectorPolyDatabase(V); PopupSelectTableField(database, table$, field$); print(table$ + "." + field$);
PopupString
Open popup window asking for a string
PopupString(prompt$, default$, title$)
場所:
ポップアップダイアログ
パラメータ:
string prompt$
A string holding the message
string default$ (オプション)
The string returned if the user hit
string title$ (オプション).
The title for the dialog window
戻り値
string
either the string you entered or the default string
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); string a$ = PopupString("Enter a string.", "Or use this default string."); print(a$);
PopupYesNo
Open popup window asking for a yes or no input
PopupYesNo(prompt$, default)
場所:
ポップアップダイアログ
パラメータ:
string prompt$
A string holding the message
numeric default (オプション)
Optional - (a number), if set to 1, then hitting
returns 1, which is the same as pressing yes. If set to zero, then hitting the returns 0, which is the same as pressing NO. Anything else has no effect.
詳細と仮定
Pressing YES returns1. Pressing NO returns 0. Pressing
returns default (if set).
戻り値
numeric
either 1 or 0
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
print(PopupYesNo("Continue?", 1));
PopupYesNoCancel
Open popup window asking for a yes, no or cancel
PopupYesNoCancel(prompt$, default)
場所:
ポップアップダイアログ
パラメータ:
string prompt$
A string holding the message
numeric default (オプション)
Optional - (a number), if set to 1, then hitting
returns 1, which is the same as pressing yes. If set to zero, then hitting the returns 0, which is the same as pressing NO. Anything else has no effect.
詳細と仮定
Pressing YES returns1. Pressing NO returns 0. Pressing CANCEL does nothing. Pressing
returns default (if set).
戻り値
numeric
either 1 or 0
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
print(PopupYesNoCancel("Continue?", 1));
CADAttachDBRecord
Attach a database record to a CAD element
CADAttachDBRecord(CADvar, block, elemnum, table, recnum)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block that the element is in
numeric elemnum
The element to attach the record to
class DBTABLEINFO table
The table the record is in
numeric recnum
The record number
戻り値
なし
作成日時: 16-May-2000
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
cad C; GetOutputCAD(C); class DATABASE db; class DBTABLEINFO table; # write a point numeric xin = 100, yin = 200; CADWritePoint(C, 1, xin, yin); CADWritePoint(C, 1, xin+yin, yin); CADWritePoint(C, 1, xin-yin, yin); CADWritePoint(C, 1, xin, yin+xin); # now create a table db = OpenCADDatabase(C); table = TableCreate(db, "MyTable", "Newly Created Table"); TableAddFieldInteger(table, "NewField"); # write some important info to the db table TableWriteRecord(table, 0, 55); TableWriteRecord(table, 0, 45); # attach the records to elements CADAttachDBRecord(C, 1, 1, table, 1); CADUnattachDBRecord(C, 1, 1, table, 1); CADAttachDBRecord(C, 1, 1, table, 2); CADAttachDBRecord(C, 1, 2, table, 1); CADAttachDBRecord(C, 1, 3, table, 2); CADAttachDBRecord(C, 1, 4, table, 1);
CADCreateBlock
Create a new CAD block for element insertion
CADCreateBlock(CADvar, blockname$, blockdesc$)
場所:
CAD
パラメータ:
CAD CADvar
The output CAD object
string blockname$
The name of the block
string blockdesc$
The block description
詳細と仮定
The CAD exists and was opened with GetOutputCAD()
戻り値
numeric
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# subblock.sml # demonstrates creating and inserting a subblock cad C; GetOutputCAD(C); # first create a box in block 1 CADWriteBox(C, 1, 0, 0, 100, 100, 0); # now create a subblock CADCreateBlock(C,"BLOCK2", "subblock"); # create a small box in the subblock CADWriteBox(C, 2, 0, 0, 10, 10, 45); # now insert with replication - create a grid numeric destblock = 1, sourceblock = 2; numeric xinsert = 0, yinsert = 0, xScale = 1, yscale = 1, rotate = 0; numeric numlines = 10, numcols = 10, linespace = 10, colspace = 10; CADInsertBlock(C, destblock, sourceblock, xinsert, yinsert, xScale, yscale, rotate, numlines, numcols, linespace, colspace); CloseCAD(C);
CADElementInRegion
Tests a CAD element against a region.
CADElementInRegion(region, CADvar, block, element, TestType$)
場所:
CAD
パラメータ:
class REGION2D region
The region variable
CAD CADvar
The CAD object
numeric block
The block number
numeric element
The elment number
string TestType$ (オプション)
The region test type to perform
可能性のある値:
"CompletelyInside"
Is the element completely inside the region
"PartlyInside"
Is the element partially inside the region
"CompletelyOutside"
Is the element completely outside the region
"PartlyOutside"
Is the element partially outside the region
戻り値
numeric
0 or 1
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# Example of CADElementInRegion() clear(); cad C; region Rgn; # open existing file GetOutputCAD(C); GetInputRegion(Rgn); numeric block; numeric numberElements = CADNumElements(C, block); block = 1; string elemtype$; numeric i, inRegion; for i = 1 to numberElements { elemtype$ = CADElementType(C, block, i); inRegion = CADElementInRegion(Rgn.$Data, C, block, i, "CompletelyInside"); if (inRegion) print(elemtype$, "element ", i, "is CompletelyInside"); inRegion = CADElementInRegion(Rgn.$Data, C, block, i, "PartlyInside"); if (inRegion) print(elemtype$, "element ", i, "is PartlyInside"); inRegion = CADElementInRegion(Rgn.$Data, C, block, i, "CompletelyOutside"); if (inRegion) print(elemtype$, "element ", i, "is CompletelyOutside"); inRegion = CADElementInRegion(Rgn.$Data, C, block, i, "PartlyOutside"); if (inRegion) print(elemtype$, "element ", i, "is PartlyOutside"); print("\n"); } CloseCAD(C);
CADElementType
Returns type of CAD element.
CADElementType(CADvar, block, element)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block number of the element
numeric element
The elment number of the element
戻り値
string
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# example of CADElementType() # read the number of blocks in a CAD object # and then loop through all the blocks and print out type of each element clear(); cad C; GetInputCAD(C); numeric numBlocks = CADNumBlocks(C); print("number of blocks: ", numBlocks); # loop through all blocks string elemtype$; numeric blk, numElements, elem; for blk = 1 to numBlocks { numElements = CADNumElements(C, blk); printf("block: %3d number of elements: %5d \n\n", blk, numElements); # loop through all elements for elem = 1 to numElements { # get the element type string elemtype$ = CADElementType(C, blk, elem); printf("block: %3d element: %5d type: %s\n", blk, elem, elemtype$); } } CloseCAD(C);
CADGetElementList
Get list of all elements of a given type in a block
CADGetElementList(CADvar, block, elemtype$, elemlist)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block to read from
string elemtype$
The type of element list desired
array elemlist
可能性のある値:
"BlockInsertion"
a sublock
"Point"
a point
"Circle"
a circle
"Arc"
an arc
"ArcChord"
an arc chord
"Text"
a single line of text
"Line"
a line
"Box"
a rectangular box
"Polygon"
a polygon
"Ellipse"
an ellipse
"EllipticalArc"
an eliptical arc
"ArcWedge"
an arc wedge
"EllipticalArcWedge"
an eliptical arc wedge
"EllipticalArcChord"
an eliptical arc chord
One dimensional array of element numbers returned
詳細と仮定
The array elemlist will be resized to hold number of elements in the block.
戻り値
numeric
number of elements
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# elemlist.sml # demonstrates how to get a list of elements of a specified # type in a block # define array to hold element list - will be resized to fit array numeric elemlist[10]; numeric elem; clear(); cad C; GetInputCAD(C); numeric numElem = CADNumElements(C, 1); # get list of lines numeric numLines = CADGetElementList( C, 1, "Line", elemlist ); printf("number of elements: %4d number of lines: %4d \n", numElem, numLines); print("Line list:\n"); for elem = 1 to numLines { printf("%4d %4d\n", elem, elemlist[elem]); } CloseCAD(C);
CADInsertBlock
Create a new CAD block for element insertion
CADInsertBlock(CADvar, destblock, sourceblock, xinsert, yinsert, xscale, yscale, rotate, numlines, numcols, linespace, colspace)
場所:
CAD
パラメータ:
CAD CADvar
The output CAD object
numeric destblock
The block to insert into
numeric sourceblock
The block to insert
numeric xinsert
X coordinate of insertion point
numeric yinsert
Y coordinate of insertion point
numeric xscale (オプション)
Optional - x scale factor of source block (default = 1)
numeric yscale (オプション)
Optional - y scale factor of source block (default = 1)
numeric rotate (オプション)
Rotation applied to source block
numeric numlines (オプション)
Number of times to repeat source block - x dimension
numeric numcols (オプション)
Number of times to repeat source block - y dimension
numeric linespace (オプション)
Optional - line spacing - x dimension (default = 0)
numeric colspace (オプション)
Column spacing - y dimension
詳細と仮定
The CAD exists and was opened with GetOutputCAD(). The optional parameters xScale, yscale, and rotation must all be used together. The same holds for numlines, numcols, linespace, and colspace. If the second block of optional parameters is used then the first block must be also.
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# subblock.sml # demonstrates creating and inserting a subblock cad C; GetOutputCAD(C); # first create a box in block 1 CADWriteBox(C, 1, 0, 0, 100, 100, 0); # now create a subblock CADCreateBlock(C,"BLOCK2", "subblock"); # create a small box in the subblock CADWriteBox(C, 2, 0, 0, 10, 10, 45); # now insert with replication - create a grid numeric destblock = 1, sourceblock = 2; numeric xinsert = 0, yinsert = 0, xScale = 1, yscale = 1, rotate = 0; numeric numlines = 10, numcols = 10, linespace = 10, colspace = 10; CADInsertBlock(C, destblock, sourceblock, xinsert, yinsert, xScale, yscale, rotate, numlines, numcols, linespace, colspace); CloseCAD(C);
CADNumBlocks
Returns number of blocks in a CAD object
CADNumBlocks(CADvar)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
詳細と仮定
The CAD exists
戻り値
numeric
number of blocks in CAD object
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# readelem.sml # demonstrate how to read the number of blocks in a CAD object # and then loop through all the blocks and print out type of # each element clear(); cad C; GetInputCAD(C); numeric numBlocks = CADNumBlocks(C); print("number of blocks: ", numBlocks); # loop through all blocks string elemtype$; numeric blk, numElements, elem; for blk = 1 to numBlocks { numElements = CADNumElements(C, blk); printf("block: %3d number of elements: %5d \n\n", blk, numElements); # loop through all elements for elem = 1 to numElements { # get the element type elemtype$ = CADElementType(C, blk, elem); printf("block: %3d element: %5d type: %s\n", blk, elem, elemtype$); } } CloseCAD(C);
CADNumElements
Returns number of elements of all types in CAD object block
CADNumElements(CADvar, block)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block to read the number of elements of
詳細と仮定
The CAD exists
戻り値
numeric
number of elements in CAD object block
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# readelem.sml # demonstrate how to read the number of blocks in a CAD object # and then loop through all the blocks and print out type of # each element clear(); cad C; GetInputCAD(C); numeric numBlocks = CADNumBlocks(C); print("number of blocks: ", numBlocks); # loop through all blocks string elemtype$; numeric blk, numElements, elem; for blk = 1 to numBlocks { numElements = CADNumElements(C, blk); printf("block: %3d number of elements: %5d \n\n", blk, numElements); # loop through all elements for elem = 1 to numElements { # get the element type elemtype$ = CADElementType(C, blk, elem); printf("block: %3d element: %5d type: %s\n", blk, elem, elemtype$); } } CloseCAD(C);
CADReadArc
Reads an arc
CADReadArc(CADvar, block, element, xcenter, ycenter, radius, start, end, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block to read from
numeric element
The element to read
numeric variable xcenter
X coordinate of center returned
numeric variable ycenter
Y coordinate of center returned
numeric variable radius
Radius of the arc returned
numeric variable start
Start angle returned (in degrees)
numeric variable end
End angle returned (in degrees)
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD, block, and element exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# arc.sml # demonstrate creating and reading an arc CAD element clear(); cad C; GetOutputCAD(C); # create a new file or open existing file # write an arc chord numeric xin = 100, yin = 200, rin = 50, startAngle = 0, endAngle = 175; CADWriteArc(C, 1, xin, yin, rin, startAngle, endAngle); # the elements are always appended to end of block # so get number of elements - last element will be ours numeric lastelem = CADNumElements(C, 1); # now read data for most recently added element numeric xCenter, yCenter, radius, sAngle, eAngle; CADReadArc(C, 1, lastelem, xCenter, yCenter, radius, sAngle, eAngle); print("write and read CAD arc"); print("element xCenter yCenter radius sAngle eAngle"); printf("%7d %8.2f %8.2f %8.2f %8.2f %8.2f \n", lastelem, xCenter, yCenter, radius, sAngle, eAngle); CloseCAD(C);
CADReadArcChord
Reads an arc chord
CADReadArcChord(CADvar, block, element, xcenter, ycenter, radius, start, end, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block to read from
numeric element
The element to read
numeric variable xcenter
X coordinate of center returned
numeric variable ycenter
Y coordinate of center returned
numeric variable radius
Radius of the arc returned
numeric variable start
Start angle returned (in degrees)
numeric variable end
End angle returned (in degrees)
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD, block, and element exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# arcchord.sml # demonstrate creating and reading an arc chord CAD element clear(); cad C; GetOutputCAD(C); # create a new file or open existing file # write an arc numeric xin = 100, yin = 200, rin = 50, startAngle = 0, endAngle = 175; CADWriteArcChord(C, 1, xin, yin, rin, startAngle, endAngle); # the elements are always appended to end of block # so get number of elements - last element will be ours numeric lastelem = CADNumElements(C, 1); # now read data for most recently added element numeric xCenter, yCenter, radius, sAngle, eAngle; CADReadArcChord(C, 1, lastelem, xCenter, yCenter, radius, sAngle, eAngle); print("write and read CAD arc chord"); print("element xCenter yCenter radius sAngle eAngle"); printf("%7d %8.2f %8.2f %8.2f %8.2f %8.2f \n", lastelem, xCenter, yCenter, radius, sAngle, eAngle); CloseCAD(C);
CADReadArcWedge
Reads an arc wedge
CADReadArcWedge(CADvar, block, element, xcenter, ycenter, radius, start, end, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block to read from
numeric element
The element to read
numeric variable xcenter
X coordinate of center returned
numeric variable ycenter
Y coordinate of center returned
numeric variable radius
Radius of the arc returned
numeric variable start
Start angle returned (in degrees)
numeric variable end
End angle returned (in degrees)
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD, block, and element exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# arcwedge.sml # demonstrate creating and reading an arc wedge CAD element clear(); cad C; GetOutputCAD(C); # create a new file or open existing file # write an arc wedge numeric xin = 100, yin = 200, rin = 50, startAngle = 0, endAngle = 175; CADWriteArcWedge(C, 1, xin, yin, rin, startAngle, endAngle); # the elements are always appended to end of block # so get number of elements - last element will be ours numeric lastelem = CADNumElements(C, 1); # now read data for most recently added element numeric xCenter, yCenter, radius, sAngle, eAngle; CADReadArcWedge(C, 1, lastelem, xCenter, yCenter, radius, sAngle, eAngle); print("write and read CAD arc wedge"); print("element xCenter yCenter radius sAngle eAngle"); printf("%7d %8.2f %8.2f %8.2f %8.2f %8.2f \n", lastelem, xCenter, yCenter, radius, sAngle, eAngle); CloseCAD(C);
CADReadBox
Reads a polygon box
CADReadBox(CADvar, block, element, lowerleftx, lowerlefty, upperrightx, upperrighty, rotation, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block to read from
numeric element
The element to read
numeric variable lowerleftx
X coordinate of lower left corner of box returned
numeric variable lowerlefty
Y coordinate of lower left corner of box returned
numeric variable upperrightx
X coordinate of upper right corner of box returned
numeric variable upperrighty
Y coordinate of upper right corner of box returned
numeric variable rotation
Rotation of box with respect to world x axis
class CADELEMOPT elemopt (オプション)
returned (in degrees)
Optional element parameters
詳細と仮定
The CAD, block, and element exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# box.sml # demonstrate creating and reading a box CAD element # define array to hold element list array numeric elemlist[10]; clear(); # create a new file or open existing file cad C; GetOutputCAD(C); numeric llX, llY, urX, urY; llX = 2000; # define lower left x, y llY = 2000; urX = 2500; # define upper right x, y urY = 2050; numeric rotation; for rotation = 0 to 180 step 20 { CADWriteBox(C, 1, llX, llY, urX, urY, rotation); } # now read out the box values numeric numElem = CADNumElements(C, 1); numeric numBoxes = CADGetElementList(C, 1, "Box", elemlist ); printf("number of elements: %4d number of boxes: %4d \n", numElem, numBoxes); print("box list:\n"); numeric elem; for elem = 1 to numBoxes { CADReadBox(C, 1, elemlist[elem], llX, llY, urX, urY, rotation); printf("%4d %4d %6.2f %6.2f %6.2f %6.2f %6.2f\n", elem, elemlist[elem], llX, llY, urX, urY, rotation); } CloseCAD(C);
CADReadCircle
Reads a circle
CADReadCircle(CADvar, block, element, xcenter, ycenter, radius, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block to read from
numeric element
The element to read
numeric variable xcenter
X coordinate of center returned
numeric variable ycenter
Y coordinate of center returned
numeric variable radius
Radius of the circle returned
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD, block, and element exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# circle.sml # demonstrate creating and reading a circle CAD element clear(); # create a new file or open existing file cad C; GetOutputCAD(C); # write a circle numeric xin, yin, rin; xin = 100; yin = 200; rin = 50; CADWriteCircle(C, 1, xin, yin, rin); # the elements are always appended to end of block # so get number of elements - last element will be our circle numeric lastelem = CADNumElements(C, 1); # now read circle data for most recently added element numeric xCenter, yCenter, radius; CADReadCircle(C, 1, lastelem, xCenter, yCenter, radius); print("write and read CAD circle"); print("element xCenter yCenter radius"); printf("%7d %8.2f %8.2f %8.2f \n", lastelem, xCenter, yCenter, radius); CloseCAD(C);
CADReadEllipse
Reads an ellipse
CADReadEllipse(CADvar, block, element, xcenter, ycenter, xsize, ysize, rotate, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block to read from
numeric element
The element to read
numeric variable xcenter
X coordinate of center returned
numeric variable ycenter
Y coordinate of center returned
numeric variable xsize
X width of ellipse returned
numeric variable ysize
Y width of ellipse returned
numeric variable rotate
Rotation with respect to the world x axis returned (in degrees)
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD, block, and element exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# ellipse.sml # demonstrate creating and reading an ellipse CAD element clear(); cad C; GetOutputCAD(C); # create a new file or open existing file # write an ellipse numeric xin = 1000, yin = 2000, xSize = 500, ySize = 300, rotation = 45; CADWriteEllipse(C, 1, xin, yin, xSize, ySize, rotation); # the elements are always appended to end of block # so get number of elements - last element will be our ellipse numeric lastelem = CADNumElements(C, 1); # now read ellipse data for most recently added element numeric xCenter, yCenter; CADReadEllipse(C, 1, lastelem, xCenter, yCenter, xSize, ySize, rotation); print("write and read CAD ellipse"); print("element xCenter yCenter xSize ySize rotation"); printf("%7d %8.2f %8.2f %8.2f %8.2f %8.2f \n", lastelem, xCenter, yCenter, xSize, ySize, rotation); CloseCAD(C);
CADReadEllipticalArc
Reads an elliptical arc
CADReadEllipticalArc(CADvar, block, element, xcenter, ycenter, xsize, ysize, start, end, rotate, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block to read from
numeric element
The element to read
numeric variable xcenter
X coordinate of center returned
numeric variable ycenter
Y coordinate of center returned
numeric variable xsize
X width of ellipse returned
numeric variable ysize
Y width of ellipse returned
numeric variable start
Start angle returned (in degrees)
numeric variable end
End angle returned (in degrees)
numeric variable rotate
Rotation of ellipse axis with respect to the world x axis returned (in degrees)
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD, block, and element exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# earc.sml # demonstrate creating and reading an elliptical arc CAD element clear(); cad C; # create a new file or open existing file GetOutputCAD(C); # write an elliptical arc numeric xin = 1000, yin = 2000, xSize = 500, ySize = 300; numeric startAngle = 30, endAngle = 150, rotation = 45; CADWriteEllipticalArc(C, 1, xin, yin, xSize, ySize, startAngle, endAngle, rotation); # the elements are always appended to end of block # so get number of elements - last element will be ours numeric lastelem = CADNumElements(C, 1); # now read data for most recently added element numeric xCenter, yCenter, sAngle, eAngle; CADReadEllipticalArc(C, 1, lastelem, xCenter, yCenter, xSize, ySize, sAngle, eAngle, rotation); print("write and read CAD elliptical arc"); string a$ = "element xCenter yCenter "; string b$ = "xSize ySize sAngle eAngle rotation"; print(a$ + b$); printf("%7d %8.2f %8.2f %8.2f %8.2f %8.2f%8.2f %8.2f \n", lastelem, xCenter, yCenter, xSize, ySize, sAngle, eAngle, rotation); CloseCAD(C);
CADReadEllipticalArcChord
Reads an elliptical arc chord
CADReadEllipticalArcChord(CADvar, block, element, xcenter, ycenter, xsize, ysize, start, end, rotate, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block to read from
numeric element
The element to read
numeric variable xcenter
X coordinate of center returned
numeric variable ycenter
Y coordinate of center returned
numeric variable xsize
X width of ellipse returned
numeric variable ysize
Y width of ellipse returned
numeric variable start
Start angle returned (in degrees)
numeric variable end
End angle returned (in degrees)
numeric variable rotate
Rotation of ellipse axis with respect to the world x axis returned (in degrees)
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD, block, and element exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# echord.sml # demonstrate creating and reading an # elliptical arc chord CAD element clear(); # create a new file or open existing file cad C; GetOutputCAD(C); # write an elliptical arc chord numeric xin = 1000, yin = 2000, xSize = 500, ySize = 300, startAngle = 30; numeric endAngle = 150, rotation = 45; CADWriteEllipticalArcChord(C, 1, xin, yin, xSize, ySize, startAngle, endAngle, rotation); # the elements are always appended to end of block # so get number of elements - last element will be ours numeric lastelem = CADNumElements(C, 1); # now read data for most recently added element numeric xCenter, yCenter, sAngle, eAngle; CADReadEllipticalArcChord(C, 1, lastelem, xCenter, yCenter, xSize, ySize, sAngle, eAngle, rotation); print("write and read CAD elliptical arc chord"); string a$ = "element xCenter yCenter "; string b$ = "xSize ySize sAngle eAngle rotation"; print(a$ + b$); printf("%7d %8.2f %8.2f %8.2f %8.2f %8.2f%8.2f %8.2f \n", lastelem, xCenter, yCenter, xSize, ySize, sAngle, eAngle, rotation); CloseCAD(C);
CADReadEllipticalArcWedge
Reads an elliptical arc wedge.
CADReadEllipticalArcWedge(CADvar, block, element, xcenter, ycenter, xsize, ysize, start, end, rotate, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block to read from
numeric element
The element to read
numeric variable xcenter
X coordinate of center returned
numeric variable ycenter
Y coordinate of center returned
numeric variable xsize
X width of ellipse returned
numeric variable ysize
Y width of ellipse returned
numeric variable start
Start angle returned (in degrees)
numeric variable end
End angle returned (in degrees)
numeric variable rotate
Rotation of ellipse axis with respect to the world x axis returned (in degrees)
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD, block, and element exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# ewedge.sml # demonstrate creating and reading an # elliptical arc wedge CAD element clear(); # create a new file or open existing file cad C; GetOutputCAD(C); # write an elliptical arc wedge numeric xin = 1000, yin = 2000, xSize = 500, ySize = 300, startAngle = 30; numeric endAngle = 150, rotation = 45; CADWriteEllipticalArcWedge(C, 1, xin, yin, xSize, ySize, startAngle, endAngle, rotation); # the elements are always appended to end of block # so get number of elements - last element will be ours numeric lastelem = CADNumElements(C, 1); # now read data for most recently added element numeric xCenter, yCenter, sAngle, eAngle; CADReadEllipticalArcWedge(C, 1, lastelem, xCenter, yCenter, xSize, ySize, sAngle, eAngle, rotation); print("write and read CAD elliptical arc wedge"); string a$ = "element xCenter yCenter "; string b$ = "xSize ySize sAngle eAngle rotation"; print(a$ + b$); printf("%7d %8.2f %8.2f %8.2f %8.2f %8.2f%8.2f %8.2f \n", lastelem, xCenter, yCenter, xSize, ySize, sAngle, eAngle, rotation); CloseCAD(C);
CADReadLine
Reads a line
CADReadLine(CADvar, block, element, xpoints, ypoints, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block to read from
numeric element
The element to read
array xpoints
One dimensional array of x coordinates returned
array ypoints
One dimensional array of y coordinates returned
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD, block, and element exist
戻り値
numeric
number of points in the line
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# line.sml # demonstrate creating and reading a line CAD element # draws an amplitude modulated sine wave cad C; array numeric xPoints[1000]; array numeric yPoints[1000]; GetOutputCAD(C); numeric numberPoints = 250, inc = .025; numeric i, x; for i = 1 to numberPoints { x = i * inc; xPoints[i] = x; yPoints[i] = sin(x) * cos(10 * x); } CADWriteLine(C, 1, numberPoints, xPoints, yPoints); # now read and print out the points numberPoints = CADReadLine(C, 1, 1, xPoints, yPoints); print("line point list:\n"); numeric elem; for elem = 1 to numberPoints { printf("%4d %6.2 %6.2f\n", elem, xPoints[elem], yPoints[elem]); } CloseCAD(C);
CADReadPoint
Reads a single point
CADReadPoint(CADvar, block, element, xcoord, ycoord, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block to read from
numeric element
The element to read
numeric variable xcoord
X coordinate of point returned
numeric variable ycoord
Y coordinate of point returned
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD, block, and element exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# point.sml # demonstrate creating and reading a point CAD element clear(); # create a new file or open existing file cad C; GetOutputCAD(C); # write a point numeric xin = 100, yin = 200; CADWritePoint(C, 1, xin, yin); # the elements are always appended to end of block # so get number of elements - last element will be our point numeric lastelem = CADNumElements(C, 1); # now read point data for most recently added element numeric xCenter, yCenter; CADReadPoint(C, 1, lastelem, xCenter, yCenter); print("write and read CAD point"); print("element xCenter yCenter"); printf("%7d %8.2f %8.2f \n", lastelem, xCenter, yCenter); CloseCAD(C);
CADReadPoly
Reads a polygon
CADReadPoly(CADvar, block, element, xpoints, ypoints, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block to read from
numeric element
The element to read
array xpoints
One dimensional array of x coordinates returned returned
array ypoints
One dimensional array of y coordinates returned returned
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD, block, and element exist
戻り値
numeric
number of points in the polygon
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# poly.sml # demonstrate creating and reading a polygon CAD element clear(); cad C; array numeric xPoints[1000]; array numeric yPoints[1000]; GetOutputCAD(C); # define the polygon (triangle) xPoints[1] = 0; yPoints[1] = 0; xPoints[2] = 100; yPoints[2] = 0; xPoints[3] = 50; yPoints[3] = 100; numeric numberPoints = 3; # polygon will automatically close to last point CADWritePoly(C, 1, numberPoints, xPoints, yPoints); # now read and print out the points numberPoints = CADReadPoly( C, 1, 1, xPoints, yPoints); print("polygon point list:\n"); numeric elem; for elem = 1 to numberPoints { printf("%4d %6.2f %6.2f\n", elem, xPoints[elem], yPoints[elem]); } CloseCAD(C);
CADReadPolyLine
Read a cad element into the polyline
CADReadPolyLine(CADvar, block, element, polyline, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block to read from
numeric element
The element to read
class polyline
Polyline returned
class CADELEMOPT elemopt (オプション)
Optional element parameters
戻り値
numeric
作成日時: 27-May-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
CADReadText
Reads a single line of text
CADReadText(CADvar, block, element, basex1, basey1, basex2, basey2, textheight, rotation, xscale, shear, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block to read from
numeric element
The element to read
numeric variable basex1
X coordinate of first base point returned
numeric variable basey1
Y coordinate of first base point returned
numeric variable basex2
X coordinate of second base point returned
numeric variable basey2
Y coordinate of second base point returned
numeric variable textheight
The height of text in CAD coordinates returned
numeric variable rotation
Rotation angle of baseline returned (in degrees)
numeric variable xscale
X scale factor relative to height returned
numeric variable shear
Shear angle returned (in degrees)
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD, block, and element exist
戻り値
string
the text string
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# text.sml # demonstrate creating and reading a text CAD element clear(); cad C; string format$ = "%7d %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f \n"; # create a new file or open existing file GetOutputCAD(C); # write some text numeric baseX1 = 100, baseY1 = 100, baseX2 = 200, baseY2 = 100; numeric height = 100, rotation = 0, xScale = 1.0, shear = 0; # since rotation = 0 we will use both basepoints string text$ = "CAD text string 1"; CADWriteText(C, 1, text$, baseX1, baseY1, baseX2, baseY2, height, rotation, xScale, shear); # the elements are always appended to end of block # so get number of elements - last element will be our text numeric lastelem = CADNumElements(C, 1); # now read data for most recently added element string text$ = CADReadText(C, 1, lastelem, baseX1, baseY1, baseX2, baseY2, height, rotation, xScale, shear); print("write and read CAD text"); print("element baseX1 baseY1 baseX2 baseY2 height rotation xScale shear"); printf(format$, lastelem, baseX1, baseY1, baseX2, baseY2, height, rotation, xScale, shear); print("Text: ", text$); # now use rotation and one base point numeric baseX1 = 100, baseY1 = 500; numeric baseX2 = 0, baseY2 = 0; # don't care numeric height = 100, rotation = 45, xScale = 1.0, shear = -40; # angle text backwards string text$ = "CAD text string 2 - rotated and sheared"; CADWriteText(C, 1, text$, baseX1, baseY1, baseX2, baseY2, height, rotation, xScale, shear); numeric lastelem = CADNumElements(C, 1); # now read data for most recently added element string text$ = CADReadText(C, 1, lastelem, baseX1, baseY1, baseX2, baseY2, height, rotation, xScale, shear); printf(format$, lastelem, baseX1, baseY1, baseX2, baseY2, height, rotation, xScale, shear); print("Text: ", text$); CloseCAD(C);
CADUnattachDBRecord
Attach a database record to a CAD element
CADUnattachDBRecord(CADvar, block, elemnum, table, recnum)
場所:
CAD
パラメータ:
CAD CADvar
The CAD object
numeric block
The block that the element is in
numeric elemnum
The element to attach the record to
class DBTABLEINFO table
The table the record is in
numeric recnum
The record number
戻り値
なし
作成日時: 16-May-2000
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
cad C; GetOutputCAD(C); class DATABASE db; class DBTABLEINFO table; # write a point numeric xin = 100, yin = 200; CADWritePoint(C, 1, xin, yin); CADWritePoint(C, 1, xin+yin, yin); CADWritePoint(C, 1, xin-yin, yin); CADWritePoint(C, 1, xin, yin+xin); # now create a table db = OpenCADDatabase(C); table = TableCreate(db, "MyTable", "Newly Created Table"); TableAddFieldInteger(table, "NewField"); # write some important info to the db table TableWriteRecord(table, 0, 55); TableWriteRecord(table, 0, 45); # attach the records to elements CADAttachDBRecord(C, 1, 1, table, 1); CADUnattachDBRecord(C, 1, 1, table, 1); CADAttachDBRecord(C, 1, 1, table, 2); CADAttachDBRecord(C, 1, 2, table, 1); CADAttachDBRecord(C, 1, 3, table, 2); CADAttachDBRecord(C, 1, 4, table, 1);
CADWriteArc
Creates an arc
CADWriteArc(CADvar, block, xcenter, ycenter, radius, start, end, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The output CAD object
numeric block
The block to write to
numeric xcenter
X coordinate of center
numeric ycenter
Y coordinate of center
numeric radius
Radius of the arc
numeric start
Start angle (in degrees)
numeric end
End angle (in degrees)
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD and block exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# arc.sml # demonstrates creating and reading an arc CAD element clear(); cad C; GetOutputCAD(C); # create a new file or open existing file # write an arc numeric xin = 100, yin = 200, rin = 50, startAngle = 0, endAngle = 175; CADWriteArc(C, 1, xin, yin, rin, startAngle, endAngle); # the elements are always appended to end of block # so get number of elements - last element will be ours numeric lastelem = CADNumElements(C, 1); # now read data for most recently added element numeric radius, sAngle, eAngle, xCenter, yCenter; CADReadArc(C, 1, lastelem, xCenter, yCenter, radius, sAngle, eAngle); print("write and read CAD arc"); print("element xCenter yCenter radius sAngle eAngle"); printf("%7d %8.2f %8.2f %8.2f %8.2f %8.2f \n", lastelem, xCenter, yCenter, radius, sAngle, eAngle); CloseCAD(C);
CADWriteArcChord
Creates an arc chord
CADWriteArcChord(CADvar, block, xcenter, ycenter, radius, start, end, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The output CAD object
numeric block
The block to write to
numeric xcenter
X coordinate of center
numeric ycenter
Y coordinate of center
numeric radius
Radius of the arc
numeric start
Start angle (in degrees)
numeric end
End angle (in degrees)
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD and block exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# arcchord.sml # demonstrate creating and reading an arc chord CAD element clear(); cad C; GetOutputCAD(C); # create a new file or open existing file # write an arc numeric xin = 100, yin = 200, rin = 50, startAngle = 0, endAngle = 175; CADWriteArcChord(C, 1, xin, yin, rin, startAngle, endAngle); # the elements are always appended to end of block # so get number of elements - last element will be ours numeric lastelem = CADNumElements(C, 1); # now read data for most recently added element numeric radius, sAngle, eAngle, xCenter, yCenter; CADReadArcChord(C, 1, lastelem, xCenter, yCenter, radius, sAngle, eAngle); print("write and read CAD arc chord"); print("element xCenter yCenter radius sAngle eAngle"); printf("%7d %8.2f %8.2f %8.2f %8.2f %8.2f \n", lastelem, xCenter, yCenter, radius, sAngle, eAngle); CloseCAD(C);
CADWriteArcWedge
Creates an arc wedge
CADWriteArcWedge(CADvar, block, xcenter, ycenter, radius, start, end, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The output CAD object
numeric block
The block to write to
numeric xcenter
X coordinate of center
numeric ycenter
Y coordinate of center
numeric radius
Radius of the arc
numeric start
Start angle (in degrees)
numeric end
End angle (in degrees)
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD and block exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# arcwedge.sml # demonstrate creating and reading an arc wedge CAD element clear(); cad C; GetOutputCAD(C); # create a new file or open existing file # write an arc numeric xin = 100, yin = 200, rin = 50, startAngle = 0, endAngle = 175; CADWriteArcWedge(C, 1, xin, yin, rin, startAngle, endAngle); # the elements are always appended to end of block # so get number of elements - last element will be ours numeric lastelem = CADNumElements(C, 1); # now read data for most recently added element numeric radius, sAngle, eAngle, xCenter, yCenter; CADReadArcWedge(C, 1, lastelem, xCenter, yCenter, radius, sAngle, eAngle); print("write and read CAD arc wedge"); print("element xCenter yCenter radius sAngle eAngle"); printf("%7d %8.2f %8.2f %8.2f %8.2f %8.2f \n", lastelem, xCenter, yCenter, radius, sAngle, eAngle);
CADWriteBox
Creates a polygon from lower left and upper right corner points
CADWriteBox(CADvar, block, lowerleftx, lowerlefty, upperrightx, upperrighty, rotation, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The output CAD object
numeric block
The block to write to
numeric lowerleftx
X coordinate of lower left corner of box
numeric lowerlefty
Y coordinate of lower left corner of box
numeric upperrightx
X coordinate of upper right corner of box
numeric upperrighty
Y coordinate of upper right corner of box
numeric rotation (オプション)
Optional - rotation of box with respect to
class CADELEMOPT elemopt (オプション)
world x axis (in degrees)
Optional element parameters
詳細と仮定
The CAD and block exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# box.sml # demonstrate creating and reading a box CAD element clear(); # define array to hold element list array numeric elemlist[10]; cad C; # create a new file or open existing file GetOutputCAD(C); numeric llX = 2000; # define lower left x, y numeric llY = 2000; numeric urX = 2500; # define upper right x, y numeric urY = 2050; numeric rotation; for rotation = 0 to 180 step 20 { CADWriteBox(C, 1, llX, llY, urX, urY, rotation); } # now read out the box values numeric numElem = CADNumElements(C, 1); numeric numBoxes = CADGetElementList(C, 1, "Box", elemlist ); printf("number of elements: %4d number of boxes: %4d \n", numElem, numBoxes); print("box list:\n");numeric elem; for elem = 1 to numBoxes { CADReadBox(C, 1, elemlist[elem], llX, llY, urX, urY, rotation); printf("%4d %4d %6.2f %6.2f %6.2f %6.2f %6.2f\n", elem, elemlist[elem], llX, llY, urX, urY, rotation); } CloseCAD(C);
CADWriteCircle
Creates a circle
CADWriteCircle(CADvar, block, xcenter, ycenter, radius, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The output CAD object
numeric block
The block to write to
numeric xcenter
X coordinate of center
numeric ycenter
Y coordinate of center
numeric radius
Radius of the circle
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD and block exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# circle.sml # demonstrate creating and reading a circle CAD element cad C; GetOutputCAD(C); # create a new file or open existing file # write a circle numeric xin = 100, yin = 200, rin = 50; CADWriteCircle(C, 1, xin, yin, rin); # the elements are always appended to end of block # so get number of elements - last element will be our circle numeric lastelem = CADNumElements(C, 1); # now read circle data for most recently added element numeric xCenter, yCenter, radius; CADReadCircle(C, 1, lastelem, xCenter, yCenter, radius); print("write and read CAD circle"); print("element xCenter yCenter radius"); printf("%7d %8.2f %8.2f %8.2f \n", lastelem, xCenter, yCenter, radius); CloseCAD(C);
CADWriteEllipse
Creates an ellipse
CADWriteEllipse(CADvar, block, xcenter, ycenter, xsize, ysize, rotate, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The output CAD object
numeric block
The block to write to
numeric xcenter
X coordinate of center
numeric ycenter
Y coordinate of center
numeric xsize
X width of ellipse
numeric ysize
Y width of ellipse
numeric rotate
Rotation with respect to the world x axis (in degrees)
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD and block exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# ellipse.sml # demonstrate creating and reading an ellipse CAD element clear(); cad C; GetOutputCAD(C); # create a new file or open existing file # write an ellipse numeric xin = 1000, yin = 2000, xSize = 500, ySize = 300, rotation = 45; CADWriteEllipse(C, 1, xin, yin, xSize, ySize, rotation); # the elements are always appended to end of block # so get number of elements - last element will be our ellipse numeric lastelem = CADNumElements(C, 1); # now read ellipse data for most recently added element numeric xCenter, yCenter, xSize, ySize, radius; CADReadEllipse(C, 1, lastelem, xCenter, yCenter, xSize, ySize, rotation); print("write and read CAD ellipse"); print("element xCenter yCenter xSize ySize rotation"); printf("%7d %8.2f %8.2f %8.2f %8.2f %8.2f \n", lastelem, xCenter, yCenter, xSize, ySize, rotation); CloseCAD(C);
CADWriteEllipticalArc
Creates an elliptical arc
CADWriteEllipticalArc(CADvar, block, xcenter, ycenter, xsize, ysize, start, end, rotate, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The output CAD object
numeric block
The block to write to
numeric xcenter
X coordinate of center
numeric ycenter
Y coordinate of center
numeric xsize
X width of ellipse
numeric ysize
Y width of ellipse
numeric start
Start angle (in degrees)
numeric end
End angle (in degrees)
numeric rotate
Rotation of ellipse axis with respect to the world x axis (in degrees)
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD and block exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# earc.sml # demonstrate creating and reading an elliptical arc CAD element clear(); # create a new file or open existing file cad C; GetOutputCAD(C); # write a elliptical arc numeric xin = 1000, yin = 2000, xSize = 500, ySize = 300, startAngle = 30; numeric endAngle = 150, rotation = 45; CADWriteEllipticalArc(C, 1, xin, yin, xSize, ySize, startAngle, endAngle, rotation); # the elements are always appended to end of block # so get number of elements - last element will be our ellipse numeric lastelem = CADNumElements(C, 1); # now read ellipse data for most recently added element numeric radius, sAngle, eAngle, xCenter, yCenter; CADReadEllipticalArc(C, 1, lastelem, xCenter, yCenter, xSize, ySize, sAngle, eAngle, rotation); print("write and read CAD elliptical arc"); string a$ = "element xCenter yCenter "; string b$ = "xSize ySize sAngle eAngle rotation"; print(a$ + b$); printf("%7d %8.2f %8.2f %8.2f %8.2f %8.2f%8.2f %8.2f \n", lastelem, xCenter, yCenter, xSize, ySize, sAngle, eAngle, rotation); CloseCAD(C);
CADWriteEllipticalArcChord
Creates an elliptical arc chord
CADWriteEllipticalArcChord(CADvar, block, xcenter, ycenter, xsize, ysize, start, end, rotate, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The output CAD object
numeric block
The block to write to
numeric xcenter
X coordinate of center
numeric ycenter
Y coordinate of center
numeric xsize
X width of ellipse
numeric ysize
Y width of ellipse
numeric start
Start angle (in degrees)
numeric end
End angle (in degrees)
numeric rotate
Rotation of ellipse axis with respect to the world x axis (in degrees)
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD and block exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# echord.sml # demonstrate creating and reading an # elliptical arc chord CAD element clear(); # create a new file or open existing file cad C; GetOutputCAD(C); # write an elliptical arc chord numeric xin = 1000, yin = 2000, xSize = 500, ySize = 300, startAngle = 30; numeric endAngle = 150, rotation = 45; CADWriteEllipticalArcChord(C, 1, xin, yin, xSize, ySize, startAngle, endAngle, rotation); # the elements are always appended to end of block # so get number of elements - last element will be our ellipse numeric lastelem = CADNumElements(C, 1); # now read data for most recently added element numeric radius, sAngle, eAngle, xCenter, yCenter; CADReadEllipticalArcChord(C, 1, lastelem, xCenter, yCenter, xSize, ySize, sAngle, eAngle, rotation); print("write and read CAD elliptical arc chord"); string a$ = "element xCenter yCenter "; string b$ = "xSize ySize sAngle eAngle rotation"; print(a$ + b$); printf("%7d %8.2f %8.2f %8.2f %8.2f %8.2f%8.2f %8.2f \n", lastelem, xCenter, yCenter, xSize, ySize, sAngle, eAngle, rotation); CloseCAD(C);
CADWriteEllipticalArcWedge
Creates an elliptical arc wedge
CADWriteEllipticalArcWedge(CADvar, block, xcenter, ycenter, xsize, ysize, start, end, rotate, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The output CAD object
numeric block
The block to write to
numeric xcenter
X coordinate of center
numeric ycenter
Y coordinate of center
numeric xsize
X width of ellipse
numeric ysize
Y width of ellipse
numeric start
Start angle (in degrees)
numeric end
End angle (in degrees)
numeric rotate
Rotation of ellipse axis with respect to the world x axis (in degrees)
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD and block exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# ewedge.sml # demonstrate creating and reading an # elliptical arc wedge CAD element clear(); # create a new file or open existing file cad C; GetOutputCAD(C); # write an elliptical arc wedge numeric xin = 1000, yin = 2000, xSize = 500, ySize = 300, startAngle = 30; numeric endAngle = 150, rotation = 45; CADWriteEllipticalArcWedge(C, 1, xin, yin, xSize, ySize, startAngle, endAngle, rotation); # the elements are always appended to end of block # so get number of elements - last element will be ours numeric lastelem = CADNumElements(C, 1); # now read data for most recently added element numeric radius, sAngle, eAngle, xCenter, yCenter; CADReadEllipticalArcWedge(C, 1, lastelem, xCenter, yCenter, xSize, ySize, sAngle, eAngle, rotation); print("write and read CAD elliptical arc wedge"); string a$ = "element xCenter yCenter "; string b$ = "xSize ySize sAngle eAngle rotation"; print(a$ + b$); printf("%7d %8.2f %8.2f %8.2f %8.2f %8.2f%8.2f %8.2f \n", lastelem, xCenter, yCenter, xSize, ySize, sAngle, eAngle, rotation); CloseCAD(C);
CADWriteLine
Creates a line
CADWriteLine(CADvar, block, numPoints, xpoints, ypoints, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The output CAD object
numeric block
The block to write to
numeric numPoints
Number of points in the line
array xpoints
One dimensional array of x coordinates
array ypoints
One dimensional array of y coordinates
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD and block exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# line.sml # demonstrate creating and reading a line CAD element # draws an amplitude modulated sine wave cad C; array numeric xPoints[1000]; array numeric yPoints[1000]; GetOutputCAD(C); numeric i, x, numberPoints = 250, inc = .025; for i = 1 to numberPoints { x = i * inc; xPoints[i] = x; yPoints[i] = sin(x) * cos(10 * x); } CADWriteLine(C, 1, numberPoints, xPoints, yPoints); # now print out the points numeric numberPoints = CADReadLine(C, 1, 1, xPoints, yPoints); print("line point list:\n"); numeric elem; for elem = 1 to numberPoints { printf("%4d %6.2 %6.2f\n", elem, xPoints[elem], yPoints[elem]); } CloseCAD(C);
CADWritePoint
Creates a single point
CADWritePoint(CADvar, block, xcoord, ycoord, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The output CAD object
numeric block
The block to write to
numeric xcoord
X coordinate of point
numeric ycoord
Y coordinate of point
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD and block exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# point.sml # demonstrate creating and reading a point CAD element clear(); # create a new file or open existing file cad C; GetOutputCAD(C); # write a point numeric xin = 100, yin = 200; CADWritePoint(C, 1, xin, yin); # the elements are always appended to end of block # so get number of elements - last element will be our point numeric lastelem = CADNumElements(C, 1); # now read point data for most recently added element numeric xCenter, yCenter; CADReadPoint(C, 1, lastelem, xCenter, yCenter); print("write and read CAD point"); print("element xCenter yCenter"); printf("%7d %8.2f %8.2f \n", lastelem, xCenter, yCenter); CloseCAD(C);
CADWritePoly
Creates a polygon
CADWritePoly(CADvar, block, numPoints, xpoints, ypoints, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The output CAD object
numeric block
The block to write to
numeric numPoints
Number of points in the polygon
array xpoints
One dimensional array of x coordinates
array ypoints
One dimensional array of y coordinates
class CADELEMOPT elemopt (オプション)
Optional element parameters
詳細と仮定
The CAD and block exist
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# poly.sml # demonstrate creating and reading a polygon CAD element cad C; array numeric xPoints[1000]; array numeric yPoints[1000]; clear(); GetOutputCAD(C); # define the polygon (triangle) xPoints[1] = 0; yPoints[1] = 0; xPoints[2] = 100; yPoints[2] = 0; xPoints[3] = 50; yPoints[3] = 100; numeric numberPoints = 3; # polygon will automatically close to last point CADWritePoly(C, 1, numberPoints, xPoints, yPoints); # now print out the points numberPoints = CADReadPoly(C, 1, 1, xPoints, yPoints); print("polygon point list:\n"); numeric elem, numberPoints; for elem = 1 to numberPoints { printf("%4d %6.2f %6.2f\n", elem, xPoints[elem], yPoints[elem]); } CloseCAD(C);
CADWritePolyLine
Write a cad element from a given polyline
CADWritePolyLine(CADvar, block, polyline, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The output CAD object
numeric block
The block to write to
class polyline
The polyline of coordinate points
class CADELEMOPT elemopt (オプション)
Optional element parameters
戻り値
なし
作成日時: 27-May-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
CADWriteText
Creates a single line of text
CADWriteText(CADvar, block, text$, basex1, basey1, basex2, basey2, textheight, rotation, xscale, shear, elemopt)
場所:
CAD
パラメータ:
CAD CADvar
The output CAD object
numeric block
The block to write to
string text$
The text to write
numeric basex1
X coordinate of first base point
numeric basey1
Y coordinate of first base point
numeric basex2
X coordinate of second base point
numeric basey2
Y coordinate of second base point
numeric textheight
The height of text in CAD coordinates
numeric rotation (オプション)
Optional - rotation angle of baseline (in degrees,
numeric xscale (オプション)
default = 0)
Optional - x scale factor relative to height
numeric shear (オプション)
(default = 1.0)
Optional - shear angle (in degrees) use for italic
class CADELEMOPT elemopt (オプション)
effects (default = 0)
Optional element parameters
詳細と仮定
The CAD and block exist. Use of any optional parameter,
(rotation, xScale, or shear), requires the use of all optional
parameters preceeding it. Rotation can be achieved by giving two
baseline points or one baseline point and a rotation angle. If
rotation is non-zero then the baseX2, and baseY2 parameters are
ignored. See the sample script below for examples of both cases.
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# text.sml # demonstrate creating and reading a text CAD element clear(); string format$ = "%7d %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f \n"; # create a new file or open existing file cad C; GetOutputCAD(C); # write some text numeric baseX1 = 100, baseY1 = 100, baseX2 = 200, baseY2 = 100, height = 100; numeric rotation = 0, xScale = 1.0, shear = 0; # since rotation = 0 we will use both basepoints string text$ = "CAD text string 1"; CADWriteText(C, 1, text$, baseX1, baseY1, baseX2, baseY2, height, rotation, xScale, shear); # the elements are always appended to end of block # so get number of elements - last element will be our text numeric lastelem = CADNumElements(C, 1); # now read data for most recently added element text$ = CADReadText(C, 1, lastelem, baseX1, baseY1, baseX2, baseY2, height, rotation, xScale, shear); print("write and read CAD text"); print("element baseX1 baseY1 baseX2 baseY2 height ", "rotation xScale shear"); printf(format$, lastelem, baseX1, baseY1, baseX2, baseY2, height, rotation, xScale, shear); print("Text: ", text$); # now use rotation and one base point baseX1 = 100; baseY1 = 500; baseX2 = 0; # don't care baseY2 = 0; # don't care height = 100; rotation = 45; xScale = 1.0; shear = -40; # angle text backwards text$ = "CAD text string 2 - rotated and sheared"; CADWriteText(C, 1, text$, baseX1, baseY1, baseX2, baseY2, height, rotation, xScale, shear); lastelem = CADNumElements(C, 1); # now read data for most recently added element text$ = CADReadText(C, 1, lastelem, baseX1, baseY1, baseX2, baseY2, height, rotation, xScale, shear); printf(format$, lastelem, baseX1, baseY1, baseX2, baseY2, height, rotation, xScale, shear); print("Text: ", text$); CloseCAD(C);
CloseCAD
Closes a previously opened CAD object
CloseCAD(CADvar)
場所:
CAD
パラメータ:
CAD CADvar
A valid CAD object variable name
詳細と仮定
The CADVar is a valid variable name and was previously opened
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
cad C; GetInputCAD(C); # or GetOutputCAD(C) # do something with CAD object C CloseCAD(C);
CreateCAD
Create a CAD object
CreateCAD(CADvar, filename$, objname$, desc$, Credentials)
場所:
CAD
パラメータ:
CAD CADvar
CAD variable to reference the object by
string filename$
RVC file name to hold the object
string objname$
RVC object name of the new object
string desc$
Description for the new object
class RVC_CREDENTIALS Credentials (オプション)
Credentials Object
戻り値
なし
作成日時: 16-May-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/deveg68.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
GetInputCAD
Use a File/Object selection dialog to select an input CAD
GetInputCAD(CADvar)
場所:
CAD
パラメータ:
CAD CADvar
The input CAD object
詳細と仮定
The CADVar is a valid variable name
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# read elem.sml # demonstrates how to read the number of blocks in a CAD object # and loop through all the blocks and print out type of each # element clear(); cad C; GetInputCAD(C); numeric numBlocks = CADNumBlocks(C); print("number of blocks: ", numBlocks); string elemtype$; numeric numElements; # loop through all blocks numeric blk, elem; for blk = 1 to numBlocks { numElements = CADNumElements(C, blk); printf("block: %3d number of elements: %5d \n\n", blk, numElements); # loop through all elements for elem = 1 to numElements { # get the element type elemtype$ = CADElementType(C, blk, elem); printf("block: %3d element: %5d type: %s\n", blk, elem, elemtype$); } } CloseCAD(C);
GetOutputCAD
Opens a CAD object for reading or writing
GetOutputCAD(CADvar)
場所:
CAD
パラメータ:
CAD CADvar
The output CAD object
詳細と仮定
The CAD is a valid variable name
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# circle.sml # demonstrate creating and reading a circle CAD element clear(); # create a new file or open existing file cad C; GetOutputCAD(C); # write a circle numeric xin = 100, yin = 200, rin = 50; CADWriteCircle(C, 1, xin, yin, rin); # the elements are always appended to end of block # so get number of elements - last element will be our circle numeric lastelem = CADNumElements(C, 1); # now read cirle data for most recently added element numeric xCenter, yCenter, radius; CADReadCircle(C, 1, lastelem, xCenter, yCenter, radius); print("write and read CAD circle"); print("element xCenter yCenter radius"); printf("%7d %8.2f %8.2f %8.2f \n", lastelem, xCenter, yCenter, radius); CloseCAD(C);
OpenCAD
Open a CAD object given a filename and objectname
OpenCAD(CADvar, filename$, objname$, Credentials)
場所:
CAD
パラメータ:
CAD CADvar
CAD variable to reference the object by
string filename$
File name of the RVC file containing the object
string objname$
RVC object name of the object to open
class RVC_CREDENTIALS Credentials (オプション)
Credentials Object
戻り値
なし
作成日時: 16-May-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
CloseTIN
Close an open TIN object
CloseTIN(TINvar)
場所:
TIN
パラメータ:
TIN TINvar
A valid TIN variable
戻り値
なし
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
tin TinIn; GetInputTIN(TinIn); # do something useful with the tin CloseTIN(TinIn);
CreateTIN
Create a new TIN object
CreateTIN(TINvar, filename$, objname$, description$, Credentials)
場所:
TIN
パラメータ:
TIN TINvar
The TIN object
string filename$
The filename to save to
string objname$
The object name to save as
string description$ (オプション)
The description of the object
class RVC_CREDENTIALS Credentials (オプション)
Credentials Object
戻り値
numeric
作成日時: 21-Sep-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GetInputTIN
Use a File/Object selection dialog to select an input TIN
GetInputTIN(TIN)
場所:
TIN
パラメータ:
TIN TIN
A valid TIN variable
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
tin TinIn; GetInputTIN(TinIn); # do something useful with the tin CloseTIN(TinIn);
GetOutputTIN
Use a File/Object selection dialog to select an output TIN
GetOutputTIN(TIN, flag1$, flag2$)
場所:
TIN
パラメータ:
TIN TIN
A valid TIN variable
string flag1$ (オプション)
See below
string flag2$ (オプション)
可能性のある値:
"TINToolkit"
Open existing or create new TIN object for write
See below
可能性のある値:
"TINToolkit"
Open existing or create new TIN object for write
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class tin Tout; GetOutputTIN(Tout); # get the RVC file name string str$ = GetObjectFileName(Tout); numeric objNum = GetObjectNumber(Tout); clear(); print("TIN Object Number: ", objNum, "RVC file Name: ", str$);
OpenTIN
Open a TIN object
OpenTIN(TINvar, filename$, objname$, Credentials)
場所:
TIN
パラメータ:
TIN TINvar
The TIN object
string filename$
The filename to read from
string objname$
The object open
class RVC_CREDENTIALS Credentials (オプション)
Credentials Object
戻り値
numeric
作成日時: 21-Sep-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
TINAddNode
Add a node to a TIN object
TINAddNode(TIN, x, y, z)
場所:
TIN
パラメータ:
TIN TIN
TIN object
numeric x
X coordinate of the node
numeric y
Y coordinate of the node
numeric z
Z coordinate of the node
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
なし
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# addnode.sml clear(); tin Tout; GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); # note that node must be inside existing hull # use TINCreateFromNodes() to make initial TIN # get the extents - use georef version if needed numeric xMin, yMin, xMax, yMax; GetObjectExtents(Tout, xMin, yMin, xMax, yMax); print("xMin, yMin, xMax, yMax ", xMin, yMin, xMax, yMax); numeric x, y, z; x = floor((xMin + xMax) / 2); y = floor((yMin + yMax) / 2); z = 100; # set to what makes sense TINAddNode(Tout, x, y, z); print("node added at x, y ", x, y);
TINCreateFromNodes
Create a new TIN object from a list of nodes
TINCreateFromNodes(TIN, numNodes, xpoints, ypoints, zpoints, zscale, zoffset, xytolerance)
場所:
TIN
パラメータ:
TIN TIN
TIN object
numeric numNodes
Number of nodes to create
array xpoints
One dimensional array of x coordinates
array ypoints
One dimensional array of y coordinates
array zpoints
One dimensional array of z coordinates
numeric zscale
Scale applied to z values
numeric zoffset
Offset applied to z values
numeric xytolerance
Minimum allowed distance between points
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN() using
the "TINToolkit" flag
戻り値
なし
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
tin Tout; GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); # declare arrays to hold node x, y, and z values array numeric x[100], y[100], z[100]; numeric zscale = 1, zoffset = 0, xytolerance = 1; # create some node values numeric numnodes = 0, offset; numeric yy, xx; for yy = 0 to 4 { for xx = 0 to 4 { if ((xx % 2) == 0) { offset = 0; } else { offset = 10; } numnodes += 1; x[numnodes] = xx * 20; y[numnodes] = yy * 20 + offset; z[numnodes] = yy * 5 + xx * 10; } } # create the tin TINCreateFromNodes(Tout, numnodes, x, y, z, zscale, zoffset, xytolerance);
TINDeleteEdgeAndMakeHole
Delete an edge from a TIN object and create a hole
TINDeleteEdgeAndMakeHole(TIN, edge)
場所:
TIN
パラメータ:
TIN TIN
TIN object
numeric edge
Number of edge to delete
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
なし
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
tin Tout; GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); # pick an edge less than or equal # to number of edges numeric numedges, edge; numedges = TINNumberEdges(Tout); edge = floor(numedges / 2); TINDeleteEdgeAndMakeHole(Tout, edge); print("edge deleted ", edge);
TINDeleteNode
Delete a node from a TIN object without creating hole
TINDeleteNode(TIN, node)
場所:
TIN
パラメータ:
TIN TIN
TIN object
numeric node
Number of node to delete
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
なし
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
tin Tout; GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); # pick a node less than or equal # to number of nodes numeric numnodes, node; numnodes = TINNumberNodes(Tout); node = floor(numnodes / 2); TINDeleteNode(Tout, node); print("node deleted ", node);
TINDeleteNodeAndMakeHole
Delete a node from a TIN object and create a hole
TINDeleteNodeAndMakeHole(TIN, node)
場所:
TIN
パラメータ:
TIN TIN
TIN object
numeric node
Number of node to delete
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
なし
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# nodehole.sml tin Tout; GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); # pick a node less than or equal # to number of nodes numeric numnodes, node; numnodes = TINNumberNodes(Tout); node = floor(numnodes / 2); TINDeleteNodeAndMakeHole(Tout, node);
TINDeleteTriangleAndMakeHole
Delete a triangle from a TIN object and create a hole
TINDeleteTriangleAndMakeHole(TIN, triangle)
場所:
TIN
パラメータ:
TIN TIN
TIN object
numeric triangle
Number of triangle to delete
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
なし
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# trihole.sml tin Tout; GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); # pick a triangle less than or equal # to number of triangle numeric numtriangles, triangle; numtriangles = TINNumberTriangles(Tout); triangle = floor(numtriangles / 2); TINDeleteTriangleAndMakeHole(Tout, triangle); print("triangle deleted ", triangle);
TINDeleteTrianglesInPolygon
Delete TIN triangles inside a polygon
TINDeleteTrianglesInPolygon(TIN, numpoints, xpoints, ypoints)
場所:
TIN
パラメータ:
TIN TIN
TIN Object
numeric numpoints
Number of points in the polygon
array xpoints
Array of polygon X coordinates
array ypoints
Array of polygon Y coordinates
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
なし
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
TIN T; GetOutputTIN(T, "TinToolkit"); numeric minx, miny, maxx, maxy; numeric x1, y1, x2, y2; numeric numpoints = 4; numeric numtriangles = 0; array numeric arrayx[numpoints], arrayy[numpoints]; array numeric triangles[10]; # get the tin extents minx = T.$Info.MinX; miny = T.$Info.MinY; maxx = T.$Info.MaxX; maxy = T.$Info.MaxY; # define a four-sided poly and get the number of triangles x1 = minx + (maxx-minx) * (1/4); x2 = minx + (maxx-minx) * (3/4); y1 = miny + (maxy-miny) * (1/4); y2 = miny + (maxy-miny) * (3/4); arrayx[1] = x1; arrayx[2] = x2; arrayx[3] = x1; arrayx[4] = x2; arrayy[1] = y1; arrayy[2] = y1; arrayy[3] = y2; arrayy[4] = y2; numtriangles = TINGetTrianglesInPolygon(T, numpoints, arrayx, arrayy, triangles); print(numtriangles); TINDeleteTrianglesInPolygon(T, numpoints, arrayx, arrayy);
TINElementInRegion
Tests a TIN element against a region.
TINElementInRegion(region, TINvar, element, ElemType$, TestType$)
場所:
TIN
パラメータ:
class REGION2D region
The region variable
TIN TINvar
The TIN object
numeric element
The element number
string ElemType$
The element type to test
string TestType$ (オプション)
可能性のある値:
"node"
the element is a node
"edge"
the element is an edge
"triangle"
the element is a triangle
The region test type to perform
可能性のある値:
"CompletelyInside"
Is the element completely inside the region
"PartlyInside"
Is the element partially inside the region
"CompletelyOutside"
Is the element completely outside the region
"PartlyOutside"
Is the element partially outside the region
戻り値
numeric
0 or 1
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# example of TINElementInRegion() tin Tin1; region reg; GetInputTIN(Tin1); GetInputRegion(reg); # check triangle 1 numeric elem=1; numeric inRegion = TINElementInRegion(reg.$Data, Tin1, elem, "triangle", "CompletelyInside"); if (inRegion) print( "element ", elem, "is CompletelyInside\n");
TINGetConnectedEdgeList
Returns list of all edges connected to a given node
TINGetConnectedEdgeList(TIN, node, edgelist)
場所:
TIN
パラメータ:
TIN TIN
TIN object
numeric node
The node
array edgelist
One dimensional array of edges returned
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
numeric
number of edges
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# edgelist.sml clear(); array numeric edgelist[100]; tin Tout; GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); # pick a node less than or equal to number of nodes numeric numnodes, node; numnodes = TINNumberNodes(Tout); node = floor(numnodes / 2); numeric numedges = TINGetConnectedEdgeList(Tout, node, edgelist); print("number of edges connected to node: ", node, " = ", numedges); numeric i; for i = 1 to numedges { print(edgelist[i]); }
TINGetConnectedNodeList
Returns list of all nodes connected to a given node
TINGetConnectedNodeList(TIN, node, nodelist)
場所:
TIN
パラメータ:
TIN TIN
TIN object
numeric node
The node
array nodelist
One dimensional array of nodes returned
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
numeric
number of nodes
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# nodelist.sml tin Tout; array numeric nodelist[100]; clear(); GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); # pick a node less than or equal to number of nodes numeric numnodes, node; numnodes = TINNumberNodes(Tout); node = floor(numnodes / 2); numnodes = TINGetConnectedNodeList(Tout, node, nodelist); print("number of nodes connected to node: ", node, " = ", numnodes); numeric i; for i = 1 to numnodes { print(nodelist[i]); }
TINGetEdgeExtents
Return x and y extents of a edge
TINGetEdgeExtents(TINvar, edge, x1, y1, x2, y2)
場所:
TIN
パラメータ:
TIN TINvar
The TIN object
numeric edge
The edge to read
numeric variable x1
First x coordinate of line returned
numeric variable y1
First y coordinate of line returned
numeric variable x2
Second x coordinate of line returned
numeric variable y2
Second y coordinate of line returned
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
なし
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); tin Tout; GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); # pick an edge less than or equal to number of edges numeric numedges, edge; numedges = TINNumberEdges(Tout); edge = floor(numedges / 2); numeric x1, y1, x2, y2; TINGetEdgeExtents(Tout, edge, x1, y1, x2, y2); print("node, x1, y1, x2, y2 ", edge, x1, y1, x2, y2);
TINGetEdgeNodesAndTriangles
Returns nodes and left and right triangles for a given edge
TINGetEdgeNodesAndTriangles(TINvar, edge, nodefrom, nodeto, lefttriangle, righttriangle)
場所:
TIN
パラメータ:
TIN TINvar
The TIN object
numeric edge
The edge to read
numeric variable nodefrom
The node from
numeric variable nodeto
The node to
numeric variable lefttriangle
The left triangle
numeric variable righttriangle
The right triangle
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
なし
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); tin Tout; GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); # pick an edge less than or equal # to number of edges numeric numedges, edge; numedges = TINNumberEdges(Tout); edge = floor(numedges / 2); numeric nodefrom, nodeto, lefttriangle, righttriangle; TINGetEdgeNodesAndTriangles(Tout, edge, nodefrom, nodeto, lefttriangle, righttriangle); string temp$ = "edge, nodefrom, nodeto, lefttriangle, righttriangle "; print(temp$, edge, nodefrom, nodeto, lefttriangle, righttriangle);
TINGetNodeExtents
Return x and y coordinates of a node
TINGetNodeExtents(TINvar, node, xcoord, ycoord)
場所:
TIN
パラメータ:
TIN TINvar
The TIN object
numeric node
The node to read
numeric variable xcoord
X coordinate of node returned
numeric variable ycoord
Y coordinate of node returned
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
なし
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); tin Tout; GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); # pick a node less than or equal # to number of nodes numeric numnodes, node; numnodes = TINNumberNodes(Tout); node = floor(numnodes / 2); numeric xCoordinate, yCoordinate; TINGetNodeExtents(Tout, node, xCoordinate, yCoordinate); print("node, x, y ", node, xCoordinate, yCoordinate);
TINGetNodeZValue
Returns z value for a node
TINGetNodeZValue(TINvar, node)
場所:
TIN
パラメータ:
TIN TINvar
The TIN object
numeric node
The node to read
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
numeric
The z value of the node.
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); tin Tout; GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); # pick a node less than or equal # to number of nodes numeric numnodes, node; numnodes = TINNumberNodes(Tout); node = floor(numnodes / 2); numeric zvalue = TINGetNodeZValue(Tout, node); print("node, zvalue ", node, zvalue);
TINGetSurroundTriangleList
Get the list of triangles surrounding a TIN node
TINGetSurroundTriangleList(TIN, node, trianglelist)
場所:
TIN
パラメータ:
TIN TIN
TIN object
numeric node
Node number
array trianglelist
List of triangles returned. Array will be resized
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
numeric
number of triangles in array
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
TIN T; GetOutputTIN(T, "TinToolkit"); array numeric list[10]; numeric node=5; numeric num = TINGetSurroundTriangleList(T, node, list); print(num);
TINGetTriangleExtents
Return x and y extents of a triangle
TINGetTriangleExtents(TINvar, triangle, x1, y1, x2, y2)
場所:
TIN
パラメータ:
TIN TINvar
The TIN object
numeric triangle
The triangle to read
numeric variable x1
First x coordinate of triangle returned
numeric variable y1
First y coordinate of triangle returned
numeric variable x2
Second x coordinate of triangle returned
numeric variable y2
Second y coordinate of triangle returned
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
なし
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); tin Tout; GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); # pick a triangle less than or equal # to number of triangle numeric numtriangles, triangle; numtriangles = TINNumberTriangles(Tout); triangle = floor(numtriangles / 2); numeric x1, y1, x2, y2; TINGetTriangleExtents(Tout, triangle, x1, y1, x2, y2); print("node, x1, y1, x2, y2 ", triangle, x1, y1, x2, y2);
TINGetTriangleNodesAndEdges
Returns the nodes and edges that make up a given triangle
TINGetTriangleNodesAndEdges(TINvar, triangle, node1, node2, node3, edge12, edge23, edge31)
場所:
TIN
パラメータ:
TIN TINvar
The TIN object
numeric triangle
The triangle to read
numeric variable node1
Node 1
numeric variable node2
Node 2
numeric variable node3
Node 3
numeric variable edge12
The edge between nodes 1 and 2
numeric variable edge23
The edge between nodes 2 and 3
numeric variable edge31
The edge between nodes 3 and 1
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
なし
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); tin Tout; GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); # pick a triangle less than or equal # to number of triangles numeric numtriangles, triangle; numtriangles = TINNumberTriangles(Tout); triangle = floor(numtriangles / 2); numeric node1, node2, node3, edge12, edge23, edge31; TINGetTriangleNodesAndEdges(Tout, triangle, node1, node2, node3, edge12, edge23, edge31); string temp$ = "triangle, node1,node2, node3, edge12, edge23, edge31 "; print(temp$,"\n", triangle, node1, node2, node3, edge12, edge23, edge31);
TINGetTrianglesInPolygon
Get a list of TIN triangles in a polygon
TINGetTrianglesInPolygon(TIN, numpoints, xpoints, ypoints, trianglelist)
場所:
TIN
パラメータ:
TIN TIN
TIN Object
numeric numpoints
Number of points in the polygon
array xpoints
Array of polygon X coordinates
array ypoints
Array of polygon Y coordinates
array trianglelist
List of triangles returned. Array will be resized
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
numeric
The number of triangles returned
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
TIN T; GetOutputTIN(T, "TinToolkit"); numeric minx, miny, maxx, maxy; numeric x1, y1, x2, y2; numeric numpoints = 4; numeric numtriangles = 0; array numeric arrayx[numpoints], arrayy[numpoints]; array numeric triangles[10]; # get the tin extents minx = T.$Info.MinX; miny = T.$Info.MinY; maxx = T.$Info.MaxX; maxy = T.$Info.MaxY; # define a four-sided poly and get the number of triangles x1 = minx + (maxx-minx) * (1/4); x2 = minx + (maxx-minx) * (3/4); y1 = miny + (maxy-miny) * (1/4); y2 = miny + (maxy-miny) * (3/4); arrayx[1] = x1; arrayx[2] = x2; arrayx[3] = x1; arrayx[4] = x2; arrayy[1] = y1; arrayy[2] = y1; arrayy[3] = y2; arrayy[4] = y2; numtriangles = TINGetTrianglesInPolygon(T, numpoints, arrayx, arrayy, triangles); print(numtriangles); TINDeleteTrianglesInPolygon(T, numpoints, arrayx, arrayy);
TINNumberEdges
Returns number of edges in a TIN object
TINNumberEdges(TIN)
場所:
TIN
パラメータ:
TIN TIN
TIN object
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
numeric
number of edges
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); tin Tout; GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); numeric numhulls, numedges, numnodes, numtri; numhulls = TINNumberHulls(Tout); numedges = TINNumberEdges(Tout); numnodes = TINNumberNodes(Tout); numtri = TINNumberTriangles(Tout); string temp$ = "num hulls, nodes, edges, triangles"; print(temp$, numhulls, numnodes, numedges, numtri);
TINNumberHulls
Returns number of hulls in a TIN object
TINNumberHulls(TIN)
場所:
TIN
パラメータ:
TIN TIN
TIN object
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
numeric
number of hulls
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); tin Tout; GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); numeric numhulls, numedges, numnodes, numtri; numhulls = TINNumberHulls(Tout); numedges = TINNumberEdges(Tout); numnodes = TINNumberNodes(Tout); numtri = TINNumberTriangles(Tout); string temp$ = "num hulls, nodes, edges, triangles"; print(temp$, numhulls, numnodes, numedges, numtri);
TINNumberNodes
Returns number of nodes in a TIN object
TINNumberNodes(TIN)
場所:
TIN
パラメータ:
TIN TIN
TIN object
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
numeric
number of nodes
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); tin Tout; GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); numeric numhulls, numedges, numnodes, numtri; numhulls = TINNumberHulls(Tout); numedges = TINNumberEdges(Tout); numnodes = TINNumberNodes(Tout); numtri = TINNumberTriangles(Tout); string temp$ = "num hulls, nodes, edges, triangles"; print(temp$, numhulls, numnodes, numedges, numtri);
TINNumberTriangles
Returns number of triangles in a TIN object
TINNumberTriangles(TIN)
場所:
TIN
パラメータ:
TIN TIN
TIN object
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
numeric
number of triangles
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); tin Tout; GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); numeric numhulls, numedges, numnodes, numtri; numhulls = TINNumberHulls(Tout); numedges = TINNumberEdges(Tout); numnodes = TINNumberNodes(Tout); numtri = TINNumberTriangles(Tout); string temp$ = "num hulls, nodes, edges, triangles"; print(temp$, numhulls, numnodes, numedges, numtri);
TINSetNodeZValue
Sets z value for a node
TINSetNodeZValue(TINvar, node, zvalue)
場所:
TIN
パラメータ:
TIN TINvar
The TIN object
numeric node
The node to set
numeric zvalue
The z value to set
詳細と仮定
The TIN Object exists and was opened with GetOutputTIN()
戻り値
なし
作成日時: 05-Oct-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# setz.sml clear(); tin Tout; GetOutputTIN(Tout, "TINToolkit", "ComputeStandardAttributes"); # pick a node less than or equal # to number of nodes numeric numnodes, node; numnodes = TINNumberNodes(Tout); node = floor(numnodes / 2); numeric zvalue = TINGetNodeZValue(Tout, node); print("original node, value ", node, zvalue); TINSetNodeZValue(Tout, node, 100); zvalue = TINGetNodeZValue(Tout, node); print("new node, value ", node, zvalue);
CopyFile
Copy a file
CopyFile(inputFile$, outputFile$, statusHandle)
場所:
ファイル
パラメータ:
string inputFile$
The file to copy
string outputFile$
The file to create
class STATUSHANDLE statusHandle (オプション)
Status handle to use - else will create dialog
詳細と仮定
if a StatusHandle is passed and it is NULL then no status will be shown
戻り値
numeric
Returns 0 for success and an error code < 0 for failure.
Starting with TNTmips7.0 script writer can perform their
own error handling by setting _context.AbortOnError=0
See Also: GetLastError
作成日時: 22-Jun-1998
修正日時: 22-Jun-1998
TNTsml for Windows で使用可能: はい
例:
# Example of CopyFile() class StatusHandle statusHandle; # create and destroy default status dialog numeric result = CopyFile("c:/tnt/data/cb_tm.rvc", "c:/tnt/data/cb_tm_copy.rvc"); print(result); # don't display status - statusHandle is NULL result = CopyFile("c:/tnt/data/cb_tm.rvc", "c:/tnt/data/cb_tm_copy.rvc", statusHandle); print(result);
CreateDir
Create a directory
CreateDir(filename$)
場所:
ファイル
パラメータ:
string filename$
New directory name
戻り値
numeric
Returns 0 for success and an error code < 0 for failure.
Starting with TNTmips7.0 script writer can perform their
own error handling by setting _context.AbortOnError=0
See Also: GetLastError
作成日時: 06-Mar-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
string base$ = "C:/Who created this"; string subfolder$ = base$ + "/SML Did"; CreateDir(base$); CreateDir(subfolder$);
CreateTempFileName
Create a temporary file name.
CreateTempFileName()
場所:
ファイル
パラメータ:
戻り値
string
Filename string.
作成日時: 08-Dec-2000
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class FILE file; numeric numbytes = 8; array numeric bufferW[numbytes]; # 8-byte buffer array numeric bufferR[numbytes]; class FILEPATH tmp = CreateTempFileName(); file = fopen(tmp,"wb" ); # write some stuff into the buffer numeric i; for i=1 to 8 { bufferW[i] = (i * 100) % 256; } fwrite(file, bufferW, numbytes); # could also use fwritebyte() fclose(file); file = fopen(tmp,"rb" ); fread(file, bufferR, numbytes); # could also use freadbyte() # test that everything was written/read properly for i=1 to 8 { print(bufferW[i], "=", bufferR[i]); } fclose(file); DeleteFile(tmp);
DeleteFile
Delete a file.
DeleteFile(filename$)
場所:
ファイル
パラメータ:
string filename$
The file name of the file to delete
戻り値
numeric
Returns 0 for success and an error code < 0 for failure.
Starting with TNTmips7.0 script writer can perform their
own error handling by setting _context.AbortOnError=0
See Also: GetLastError
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/view-rgb.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
fclose
Close a file previously opened with fopen()
fclose(file)
場所:
ファイル
パラメータ:
class FILE file
The file number returned by the fopen() function.
詳細と仮定
The text file must already exist for any mode that expects to read
from it.
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# assume file already exists clear(); class FILE f; f=fopen("c:/junk.txt", "r"); # get next line of text from text file specified by fileNumber string str$ = fgetline$(f); print(str$); fclose(f);
feof
Detects end of file
feof(file)
場所:
ファイル
パラメータ:
class FILE file
A valid file handle
詳細と仮定
fileNumber is a valid file number returned from previous fopen()
戻り値
numeric
1 if at the end of the file, 0 if not.
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); class FILE f; string filename$ = GetInputFileName("","Select the desired file",".txt"); f=fopen(filename$, "r"); # get next line of text from text file specified by fileNumber while(!feof(f)) { string str$ = fgetline$(f); print(str$); } fclose(f);
fexists
Checks for existence and i/o mode of file
fexists(filename$, mode$)
場所:
ファイル
パラメータ:
string filename$
A string-path and file name
string mode$ (オプション)
A string-the mode "r", "w", etc.
可能性のある値:
"r"
See if we can read the file
"r+"
See if we can read and write the file
"w"
See if we can write the file
戻り値
numeric
Boolean true or false indicating existence of file
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); if (fexists("c:\temp.txt", "r")) then print("c:\temp.txt exists");
fgetline$
Get next line of text from a text file
fgetline$(file)
場所:
ファイル
パラメータ:
class FILE file
File handle returned by the fopen() function
詳細と仮定
The pointer starts at the beginning of the text file.
After each call to fgetline$() or fgetnum(), the
pointer automatically advances.
戻り値
string
the next line of text after the pointer, including the
end of line character (\n), or 0 if at the end of file
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); class FILE f; string filename$ = GetInputFileName("","Select the desired file",".txt"); f=fopen(filename$, "r"); # get next line of text from text file specified by fileNumber while(!feof(f)) { string str$ = fgetline$(f); print(str$); } fclose(f);
fgetnum
Get next number from text file
fgetnum(file)
場所:
ファイル
パラメータ:
class FILE file
File handle returned by the fopen() function
詳細と仮定
The pointer begins at the beginning of the text file.
After each call to fgetline$() or fgetnum(), the
pointer automatically advances to the next piece of
text that can be interpreted as a number. The number(s)
returned must be within the range of the system.
戻り値
numeric
The next number after the pointer. Returns 0 if the
next segment of ASCII is not a number.
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); class FILE f; string filename$ = GetInputFileName("","Select the desired file",".txt"); f=fopen(filename$, "r"); # get next number from text file specified by fileNumber while(!feof(f)) { numeric num = fgetnum(f); print(num); } fclose(f);
fopen
Open text file
fopen(filename$, mode$, encoding$)
場所:
ファイル
パラメータ:
string filename$
A string holding the filename, including a full path
string mode$ (オプション)
Optional - a string holding the read / write permissions for the file.
string encoding$ (オプション)
By default, newline characters are translated from whatever is in
the file to the format the current platform expects. This behavior
can be changed by adding a "b" to the end of the mode string,
causing the file to be opened in "binary" mode.
可能性のある値:
"r"
Open for reading
"r+"
Open for reading and writing
"w"
Open for writing, truncate to zero length first
"a"
Open in append mode, write starting at the end of the file
"rb"
Open for reading - binary mode
"r+b"
Open for reading and writing - binary mode
"wb"
Open for writing, truncate to zero length first - binary mode
"ab"
Open in append mode, write starting at the end of the file - binary mode
The string encoding
可能性のある値:
"ASCII"
ASCII
"WinANSI"
ANSI (Windows Code Page)
"Big5"
Chinese (Big5)
"GB-2312"
Chinese (GB-2312)
"JIS"
Japanese (JIS)
"Shift-JIS"
Shift-JIS Japanese encoding
"EUC"
Japanese (EUC)
"MacJapanese"
Japanese (Macintosh)
"ISO-2022"
ISO-2022 encoding (Default)
"X-Resfile"
X Resource File (TNTXRES.TXT)
"Unicode"
Unicode (2-byte)
"UTF8"
Unicode (UTF8) encoding
"KSC-5601"
Korean (KSC-5601)
"KOI-8"
Cyrillic (KOI-8)
"CP855"
Russian (CP855)
"CP1251"
Cyrillic (Windows Code Page 1251)
"CP869"
Greek (CP869)
"CP1250"
Eastern Europe (Windows Code Page 1250)
"CP1253"
Greek (Windows Code Page 1253)
"CP1254"
Turkish (Windows Code Page 1254)
"CP1255"
Hebrew (Windows Code Page 1255)
"CP1256"
Arabic (Windows Code Page 1256)
"Thai"
Thai
"DOSCP437"
United States (CP437)
"DOSCP850"
Multilingual (CP850)
"DOSCP852"
Slavic (CP852)
"DOSCP857"
DOS Code Page 857
"DOSCP861"
DOS Code Page 861
"DOSCP863"
Canadian French (CP863)
"DOSCP865"
Nordic (CP865)
"ISO-8859-1"
Latin 1 (ISO)
"ISO-8859-2"
Latin 2 (ISO)
"ISO-8859-3"
Latin 3 (ISO)
"ISO-8859-4"
Latin 4 (ISO)
"ISO-8859-5"
Cyrillic (ISO)
"ISO-8859-6"
Arabic (ISO)
"ISO-8859-7"
Greek (ISO)
"ISO-8859-8"
Hebrew (ISO)
"ISO-8859-9"
Turkish (ISO)
"MacArabic"
Arabic (Macintosh)
"MacCroatian"
Croatian (Macintosh)
"MacCyrillic"
Cyrillic (Macintosh)
"MacCentEurope"
Central Europe (Macintosh)
"MacGreek"
Greek (Macintosh)
"MacHebrew"
Hebrew (Macintosh)
"MacIcelandic"
Icelandic (Macintosh)
"MacRomanian"
Romanian (Macintosh)
"MacRoman"
Roman (Macintosh)
"MacThai"
Thai (Macintosh)
"MacTurkish"
Turkish (Macintosh)
"MacUkrainian"
Ukrainian (Macintosh)
"ISCII_Devanagari"
ISCII (Devanagari)
"ISCII_Bengali"
ISCII (Bengali)
"ISCII_Gurmukhi"
ISCII (Gurmukhi)
"ISCII_Gujarati"
ISCII (Gujarati)
"ISCII_Oriya"
ISCII (Oriya)
"ISCII_Tamil"
ISCII (Tamil)
"ISCII_Telugu"
ISCII (Telugu)
"ISCII_Kannada"
ISCII (Kannada)
"ISCII_Malayalam"
ISCII (Malayalam)
詳細と仮定
The text file must already exist for any mode that expects to read
from it.
戻り値
class FILE
a file handle
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# assume file already exists clear(); class FILE f; f=fopen("c:junk.txt", "w+"); # create a file fprint(f, "This is line 1.\nThis is line 2."); # write to it fclose(f); # close it f=fopen("c:junk.txt", "r"); # open the file for reading print(fgetline$(f)); # read and print two lines fclose(f); # close it
fprint
Print unformated text or values to text file
fprint(file, value, ...)
場所:
ファイル
パラメータ:
class FILE file
The number returned from the previously
any value value (オプション)
used fopen() function
One or more numbers or strings to print
any value ... (オプション)
(you can have any number of values)
詳細と仮定
The text file must be open and writable
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); # assume file already exists # Open a file, then write to the file, then close it class FILE f; f=fopen("c:/junk.txt", "r+"); fprint(f, "This is line 1\nThis is line2.", "More line 2"); fclose(f); f=fopen("c:/junk.txt", "r"); print(fgetline$(f)); print(fgetline$(f)); fclose(f);
fprintf
Print formatted text or values to text file
fprintf(file, format$, value, ...)
場所:
ファイル
パラメータ:
class FILE file
The number returned from the previously used fopen() function
string format$
Printf-style format string.
any value value (オプション)
The format string is scanned for format specification fields, which all start with a percent sign (%). Each format specification is replaced by the value of the next parameter passed after the format string. There should be a value passed for each format specification field.
Format Specification fields have the following form (parts in square brackets are optional)
%[flags][width][.precision]type
flags
Optional characters to control justification and sign display
- : Left align the result within the field
+ : Prefix numeric value with a sign (+ or -), even if positive
0 : If with is prefixed with a zero, the number will have leading zeros
width
Optional number that specifies the minimum number of characters output
precision
Optional number that specifies the maximum number of digits after the
decimal place for floating point numbers
type
Required character specifying the type of parameter to output
s : String
d : Signed decimal integer
u : Unsigned decimal integer
o : Unsigned octal integer
x : Unsigned hexadecimal integer, using "abcdef"
X : Unsigned hexadecimal integer, using "ABCDEF"
c : A single character, specified the ASCII value.
e : Floating point value in scientific notation (e.g.: 1e6 for 1,000,000)
f : Floating point value, not in scientific notation
g : Floating point value in e or f format, whichever is more compact
Etc. one or more numbers or strings
any value ... (オプション)
(you can have any number of values)
詳細と仮定
The text file must be open and writable. See the printf()
function for information on formatting strings.
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); string str1$="This is line "; string str2$=" you see. "; string str3$="This is line 2. "; numeric number=1; # Create a file, then write to the file, then close it class FILE f; f=fopen("c:/junk.txt", "w+"); fprintf(f, "%s%d%sn%s", str1$, number, str2$, str3$); fclose(f); f=fopen("c:/junk.txt", "r"); print(fgetline$(f)); print(fgetline$(f)); fclose(f);
fread
Read raw bytes a from a file.
fread(file, buffer, length)
場所:
ファイル
パラメータ:
class FILE file
An open file handle
array buffer
The array to hold the data read. Values will all be in the range of 0 to 255
numeric length
Number of bytes to read
戻り値
numeric
Number of bytes actually read
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class FILE file; numeric numbytes = 8; array numeric bufferW[numbytes]; # 8-byte buffer array numeric bufferR[numbytes]; class FILEPATH tmp = CreateTempFileName(); file = fopen(tmp,"wb" ); # write some stuff into the buffer numeric i; for i=1 to 8 { bufferW[i] = (i * 100) % 256; } fwrite(file, bufferW, numbytes); # could also use fwritebyte() fclose(file); file = fopen(tmp,"rb" ); fread(file, bufferR, numbytes); # could also use freadbyte() # test that everything was written/read properly for i=1 to 8 { print(bufferW[i], "=", bufferR[i]); } fclose(file); DeleteFile(tmp);
freadbyte
Read a byte from a file or port.
freadbyte(file)
場所:
ファイル
パラメータ:
class FILE file
File or port
戻り値
numeric
The byte read. Returns NULL if at end of file.
You must use IsNull() to detect null value, you cannot
compare to it.
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class FILE file; numeric numbytes = 8; array numeric bufferW[numbytes]; # 8-byte buffer array numeric bufferR[numbytes]; class FILEPATH tmp = CreateTempFileName(); file = fopen(tmp,"wb" ); # write some stuff into the buffer numeric i; for i=1 to 8 { bufferW[i] = (i * 100) % 256; } fwrite(file, bufferW, numbytes); # could also use fwritebyte() fclose(file); file = fopen(tmp,"rb" ); fread(file, bufferR, numbytes); # could also use freadbyte() # test that everything was written/read properly for i=1 to 8 { print(bufferW[i], "=", bufferR[i]); } fclose(file); DeleteFile(tmp);
freadstring
Read a string from a file.
freadstring(file, length)
場所:
ファイル
パラメータ:
class FILE file
File or port
numeric length
Maximum length to read
戻り値
string
The string read.
Use fgetline$() to read an entire line up to the next newline character
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
fwrite
Write unformated data to a file.
fwrite(file, buffer, length)
場所:
ファイル
パラメータ:
class FILE file
An open file handle
array buffer
The array holding the bytes to write. Values must be in the range of 0 to 255
numeric length
Number of bytes to write
戻り値
numeric
The number of bytes actually written
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class FILE file; numeric numbytes = 8; array numeric bufferW[numbytes]; # 8-byte buffer array numeric bufferR[numbytes]; class FILEPATH tmp = CreateTempFileName(); file = fopen(tmp,"wb" ); # write some stuff into the buffer numeric i; for i=1 to 8 { bufferW[i] = (i * 100) % 256; } fwrite(file, bufferW, numbytes); # could also use fwritebyte() fclose(file); file = fopen(tmp,"rb" ); fread(file, bufferR, numbytes); # could also use freadbyte() # test that everything was written/read properly for i=1 to 8 { print(bufferW[i], "=", bufferR[i]); } fclose(file); DeleteFile(tmp);
fwritebyte
Write a byte to a file or port.
fwritebyte(file, byte, ...)
場所:
ファイル
パラメータ:
class FILE file
File or port
numeric byte
The byte to write
numeric ... (オプション)
Additional bytes to write
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/planter2.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
fwritestring
Write a string to a file.
fwritestring(file, string$, length)
場所:
ファイル
パラメータ:
class FILE file
File or port
string string$
The string to write
numeric length (オプション)
Maximum length to write
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# Example of GetOutputTextFile() class FILE fOut; clear(); fOut = GetOutputTextFile("c:/default.txt", "Select text file for input", "txt"); # write some lines to the text file fwritestring(fOut, "string1\n"); fwritestring(fOut, "string2\n");
GetDirectory
Popup a dialog for selecting a directory
GetDirectory(default$, prompt$)
場所:
ファイル
パラメータ:
string default$
Default directory to use
string prompt$
Prompt to use
戻り値
string
Filepath of the selected directory. Returns an empty string if user canels the dialog
作成日時: 11-Sep-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); string path$ = GetDirectory("C:/tnt", "Select a directory"); print(path$);
GetInputFileName
Popup dialog to select a file
GetInputFileName(default$, prompt$, ext$)
場所:
ファイル
パラメータ:
string default$
Default file name
string prompt$
Prompt string
string ext$
File extension
戻り値
string
Filepath of the selected file. Returns an empty string if user canels the dialog
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
clear(); class FILE f; string filename$ = GetInputFileName("","Select the desired file",".txt"); f=fopen(filename$, "r"); # get next line of text from text file specified by fileNumber while(!feof(f)) { string str$ = fgetline$(f); print(str$); } fclose(f);
GetInputTextFile
Open or create a text file for input/output via dialog
GetInputTextFile(defaultFilename$, prompt$, extension$, encoding$)
場所:
ファイル
パラメータ:
string defaultFilename$
A default filename for the file selection dialog
string prompt$
Prompt for dialog
string extension$
The file extension of the file to open
string encoding$ (オプション)
The string encoding
可能性のある値:
"ISO-2022"
ISO-2022 encoding (Default)
"UTF8"
Unicode (UTF8) encoding
"Shift-JIS"
Shift-JIS Japanese encoding
戻り値
class FILE
Open file handle
作成日時: 06-Aug-1998
修正日時: 01-Feb-2001
TNTsml for Windows で使用可能: はい
例:
# Example of GetInputTextFile() class FILE fIn; clear(); fIn = GetInputTextFile("c:/default.txt", "Select text file for input", "txt"); # read a line from the text file string str$ = fgetline$(fIn); print(str$);
GetOutputFileName
Popup dialog to select an output file.
GetOutputFileName(default$, prompt$, ext$)
場所:
ファイル
パラメータ:
string default$
Default file name
string prompt$
Prompt string
string ext$
File extension
戻り値
string
Filepath of the selected file. Returns an empty string if user canels the dialog
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/pca.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
GetOutputTextFile
Open a text file for output via dialog
GetOutputTextFile(defaultFilename$, prompt$, extension$, encoding$)
場所:
ファイル
パラメータ:
string defaultFilename$
Default path/filename.ext
string prompt$
Prompt for dialog
string extension$
File extension
string encoding$ (オプション)
File encoding
可能性のある値:
"ISO-2022"
ISO-2022 encoding (Default)
"UTF8"
Unicode (UTF8) encoding
"Shift-JIS"
Shift-JIS Japanese encoding
戻り値
class FILE
作成日時: 06-Aug-1998
修正日時: 01-Feb-2001
TNTsml for Windows で使用可能: はい
例:
# Example of GetOutputTextFile() class FILE fOut; clear(); fOut = GetOutputTextFile("c:/default.txt", "Select text file for input", "txt"); # write some lines to the text file fwritestring(fOut, "string1\n"); fwritestring(fOut, "string2\n");
PortAddCallback
Used to register functions to call when data is available. Procedure will be passed two parameters, the port, and the value passed as the data parameter to PortAddCallback()
PortAddCallback(callback, function, data)
場所:
ファイル
パラメータ:
class CALLBACKLIST callback
Class CallbackList
proc function
Procedure to call
class anything data (オプション)
Data passed to callback
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
PortClose
Close a port.
PortClose(port)
場所:
ファイル
パラメータ:
class PORT port
The port to close
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/planter2.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
PortOpen
Open a port.
PortOpen(name$, type$)
場所:
ファイル
パラメータ:
string name$
Port name
string type$ (オプション)
Port type
戻り値
class PORT
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/planter2.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
RenameFile
Rename a file.
RenameFile(oldname$, newname$)
場所:
ファイル
パラメータ:
string oldname$
The old filename (with the full filepath)
string newname$
The new filename (just the new name of the file)
戻り値
numeric
Returns 0 for success and an error code < 0 for failure.
Starting with TNTmips7.0 script writer can perform their
own error handling by setting _context.AbortOnError=0
See Also: GetLastError
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/ToolScript/URLS.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ScriptResourceReadFull
Read a text file from a text subobject under the script or a file in the same directory
ScriptResourceReadFull(filename$)
場所:
ファイル
パラメータ:
string filename$
File name
戻り値
string
作成日時: 20-Nov-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
TextFileReadFull
Read an entire text file into a string (keep the size "reasonable")
TextFileReadFull(filename$)
場所:
ファイル
パラメータ:
string filename$
The text file
戻り値
string
作成日時: 01-Feb-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
IniClose
Close an ini file
IniClose(handle)
場所:
INI ファイル
パラメータ:
class INIHANDLE handle
An open ini file handle
戻り値
なし
作成日時: 07-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# read default display position from an ini and open a raster in view window class DISP d; numeric w = 500; numeric h = 600; raster R; class INIHANDLE ini; # get the position string inifile$ = "C:/Program Files/MicroImages/TNT_69/tntproc.ini"; ini = IniOpenFile(inifile$); string pos$ = IniReadString("tntdisp", "WinPosGroup1View2D1"); IniClose(ini); numeric x = StrToNum(GetToken(pos$, " ", 1, 1)); numeric y = StrToNum(GetToken(pos$, " ", 2, 1)); # open the raster GetInputRaster(R); d = DispOpen(w, h, x, y); DispQuickAddRasterVar(d, R);
IniOpenFile
Open an ini file
IniOpenFile(filename$)
場所:
INI ファイル
パラメータ:
string filename$
The file to open
戻り値
class INIHANDLE
作成日時: 07-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# read default display position from an ini and open a raster in view window class DISP d; numeric w = 500; numeric h = 600; raster R; class INIHANDLE ini; # get the position string inifile$ = "C:/Program Files/MicroImages/TNT_69/tntproc.ini"; ini = IniOpenFile(inifile$); string pos$ = IniReadString("tntdisp", "WinPosGroup1View2D1"); IniClose(ini); numeric x = StrToNum(GetToken(pos$, " ", 1, 1)); numeric y = StrToNum(GetToken(pos$, " ", 2, 1)); # open the raster GetInputRaster(R); d = DispOpen(w, h, x, y); DispQuickAddRasterVar(d, R);
IniOpenObject
Open an RVC text object
IniOpenObject(filename$, objectname$)
場所:
INI ファイル
パラメータ:
string filename$
The RVC filename
string objectname$
The object name
戻り値
class INIHANDLE
作成日時: 07-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# See: IniOpenFile() # IniOpenObject() works similarly to IniOpenFile # # Use this function if the ini file is stored as an object.
IniOpenScriptResource
Open an INI file as a subobject of the script or file in same directory
IniOpenScriptResource(objectname$)
場所:
INI ファイル
パラメータ:
string objectname$
Object name
戻り値
class INIHANDLE
作成日時: 07-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# See: IniOpenFile() # IniOpenScriptResource() works similarly to IniOpenFile # # It is assumed to be in the same directory.
IniReadNumber
Read a number from an ini file
IniReadNumber(group$, field$, default, min, max)
場所:
INI ファイル
パラメータ:
string group$
The group name
string field$
The field name
numeric default (オプション)
The default value
numeric min (オプション)
Minumum allowed value
numeric max (オプション)
Maximum allowed value
戻り値
numeric
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/doqq7.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
IniReadString
Read a string from an ini file
IniReadString(group$, field$, default$)
場所:
INI ファイル
パラメータ:
string group$
The group name
string field$
The field name
string default$ (オプション)
Default string to return if value not found
戻り値
string
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# read default display position from an ini and open a raster in view window class DISP d; numeric w = 500; numeric h = 600; raster R; class INIHANDLE ini; # get the position string inifile$ = "C:/Program Files/MicroImages/TNT_69/tntproc.ini"; ini = IniOpenFile(inifile$); string pos$ = IniReadString("tntdisp", "WinPosGroup1View2D1"); IniClose(ini); numeric x = StrToNum(GetToken(pos$, " ", 1, 1)); numeric y = StrToNum(GetToken(pos$, " ", 2, 1)); # open the raster GetInputRaster(R); d = DispOpen(w, h, x, y); DispQuickAddRasterVar(d, R);
IniWriteNumber
Write a number to an ini file
IniWriteNumber(group$, field$, value)
場所:
INI ファイル
パラメータ:
string group$
The group name
string field$
The field name
numeric value
The value to write
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/doqq7.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
IniWriteString
Write a string to an ini file
IniWriteString(group$, field$, value$)
場所:
INI ファイル
パラメータ:
string group$
The group name
string field$
The field name
string value$
The value to write
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/doqq7.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ResourceAugment
Add specified file to text resource set
ResourceAugment(xmlfilename$)
場所:
リソースファイル
パラメータ:
string xmlfilename$
Path to file, must be in proper XML or binary format
戻り値
numeric
作成日時: 23-Sep-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ResourceLookupLabel
Lookup a labelString resource from tntxres.txt
ResourceLookupLabel(key$)
場所:
リソースファイル
パラメータ:
string key$
The identifier of the message to read
戻り値
string
作成日時: 26-Feb-2003
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# for displaying localized messages and interface text clear(); string search$ = "help"; print("Message:", ResourceLookupMessage(search$)); print("Label:", ResourceLookupLabel(search$)); print("Title:", ResourceLookupTitle(search$)); string search$ = "Prompt_Patterns_Insert"; print("Message:", ResourceLookupMessage(search$)); print("Label:", ResourceLookupLabel(search$)); print("Title:", ResourceLookupTitle(search$));
ResourceLookupMessage
Lookup a message from messages.txt
ResourceLookupMessage(name$)
場所:
リソースファイル
パラメータ:
string name$
The name of the message to read
詳細と仮定
The messages.txt file is broken up into groups of related messages.
戻り値
string
作成日時: 26-Feb-2003
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# for displaying localized messages and interface text clear(); string search$ = "help"; print("Message:", ResourceLookupMessage(search$)); print("Label:", ResourceLookupLabel(search$)); print("Title:", ResourceLookupTitle(search$)); string search$ = "Prompt_Patterns_Insert"; print("Message:", ResourceLookupMessage(search$)); print("Label:", ResourceLookupLabel(search$)); print("Title:", ResourceLookupTitle(search$));
ResourceLookupTitle
Lookup a title resource from tntxres.txt
ResourceLookupTitle(key$)
場所:
リソースファイル
パラメータ:
string key$
The identifier of the message to read
戻り値
string
作成日時: 26-Feb-2003
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# for displaying localized messages and interface text clear(); string search$ = "help"; print("Message:", ResourceLookupMessage(search$)); print("Label:", ResourceLookupLabel(search$)); print("Title:", ResourceLookupTitle(search$)); string search$ = "Prompt_Patterns_Insert"; print("Message:", ResourceLookupMessage(search$)); print("Label:", ResourceLookupLabel(search$)); print("Title:", ResourceLookupTitle(search$));
MovieAddFrame
Add frame to movie
MovieAddFrame(movie, frame)
場所:
ムービー
パラメータ:
戻り値
numeric
作成日時: 04-Apr-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
###################### # # ORBITSP.SML # # Demonstration of movie generation from 3D display using spiral # orbit path. Both 2D and 3D views are copied into each movie frame. # # View center is fixed at center of group. Viewer position is computed # from size of group. Two complete orbits are made. The first starts # beyond the edge of group and spirals inward and downward; the second # spirals outward and upward. # # Script uses an input DEM for the surface layer, an input raster drape # layer, and an input vector drape layer. # # Requires TNTmips Version 6.5 # ##################### clear(); #### Set movie format, frame rate, and recording time # Movie format (Possible values : "MPEG"(All platform) or "AVI"(Windows only) string format$; format$ = "AVI"; # Frame rate # Possible values : # "MOVIE_FRAMERATE_23_976" 23.976 (24000/1001) fps - NTSC encapsulated film rate # "MOVIE_FRAMERATE_24" 24 fps - Standard international cinema film rate # "MOVIE_FRAMERATE_25" 25 fps - PAL (625/50) video frame rate # "MOVIE_FRAMERATE_29_970" 29.97 (30000/1001) fps - NTSC video frame rate # "MOVIE_FRAMERATE_30" 30 fps - NTSC drop-frame (525/60) video frame rate # "MOVIE_FRAMERATE_50" 50 fps - Double frame rate / progressive PAL # "MOVIE_FRAMERATE_59_940" 59.94 (60000/1001) fps - Double frame rate NTSC # "MOVIE_FRAMERATE_60" 60 fps - Double frame rate drop-frame NTSC string framerate$; framerate$ = "MOVIE_FRAMERATE_24"; # Recording time numeric time; time = 60; ###### Get RVC objects to load raster Surface, RastDrape; vector VectDrape; print("Select raster to use for surface"); GetInputRaster(Surface); print("Select raster to use for first drape layer"); GetInputRaster(RastDrape); print("Select vector to use for second drape layer"); GetInputVector(VectDrape); ###### RVC style object to draw center point and viewer point string styleFilename$; string styleObjectname$; GetInputObject("Style","Select style object for center and viewer point symbols:", styleFilename$, styleObjectname$); string viewer$; viewer$ = "VIEWER"; string center$; center$ = "CENTER"; ######## Create display group with 2d and 3d views print("START"); # Size of squared 2D view and 3D view # Should be evenly divisible by 8 numeric size; size = 400; # Zoom out factor for 2D view numeric zoomfactor; zoomfactor = 1.8; # Create group print("Creating Group"); class GRE_GROUP group; group = GroupCreate(); # Create flags to create view without iconbar, scrollbars, status line and scale/position line # This is important to maintain fixed window size for movie generation string flags$; flags$ = "NoScalePosLine,NoIconBar,NoScrollbars,NoStatusLine"; # Create dialog and 2D view print("Creating dialog and 2D view"); class XmForm dialog2d; class GRE_VIEW view2d; dialog2d = CreateFormDialog("VIEW 2D"); view2d = GroupCreateView(group,dialog2d,"",size,size,flags$); view2d.BackgroundColor.red = 67; view2d.BackgroundColor.green = 100; view2d.BackgroundColor.blue = 100; # Create dialog and 3D view print("Creating dialog and 3D view"); class XmForm dialog3d; class GRE_VIEW3D view3d; dialog3d = CreateFormDialog("VIEW 3D"); view3d = GroupCreate3DView(group,dialog3d,"",size,size,flags$); view3d.BackgroundColor.red = 67; view3d.BackgroundColor.green = 100; view3d.BackgroundColor.blue = 100; # Add layers to group GroupQuickAddRasterVar(group,Surface,1); GroupQuickAddRasterVar(group,RastDrape,0); GroupQuickAddVectorVar(group,VectDrape); # Open both views DialogOpen(dialog2d); DialogOpen(dialog3d); # Full redraw of both views ViewRedrawFull(view2d); ViewRedrawFull(view3d); ViewZoomOut(view2d,zoomfactor,1); ####### Set up parameters for movie frame # Destination of each view in final frame for movie numeric x2d, y2d, x3d, y3d, w, h; x2d = 0; y2d = 0; x3d = size; y3d = 0; w = 2 * size; h = size; # Create text strings for annotation in frame string frameTitle$; string frameTitle2$; frameTitle$ = "Mount St. Helens Flow Hazard Zonation"; frameTitle2$ = "and Survey Station Locations"; # Font size numeric fontsize; fontsize = 16; # Define color for text annotation in frame class Color black; black.red = 0; black.green = 0; black.blue = 0; # Creating frame print("Creating frame for movie"); class Frame frame; frame = FrameCreate(w,h); # Create graphics context (GC) for frame print("Creating GC from frame and activate it"); ActivateGC(FrameCreateGC(frame)); DrawTextSetHeightPixels(fontsize); DrawUseStyleObject(styleFilename$,styleObjectname$); ######## Set some more movie parameters # Initiale Movie print("Initializing Movie"); class Movie movie; movie = MovieInit(); # Check framerate and force it to "MOVIE_FRAMERATE_24" if it is invalid numeric rate; rate = 24; if (framerate$ == "MOVIE_FRAMERATE_23_976") rate = 23.976; if (framerate$ == "MOVIE_FRAMERATE_25") rate = 25.0; if (framerate$ == "MOVIE_FRAMERATE_29_970") rate = 29.970; if (framerate$ == "MOVIE_FRAMERATE_30") rate = 30.0; if (framerate$ == "MOVIE_FRAMERATE_50") rate = 50.0; if (framerate$ == "MOVIE_FRAMERATE_59_940") rate = 59.940; if (framerate$ == "MOVIE_FRAMERATE_60") rate = 60.0; if (rate == 24.0) framerate$ = "MOVIE_FRAMERATE_24"; # Set Movie Parameters print("Setting Movie Parameters"); MovieSetFormat(movie,format$); MovieSetFrameRate(movie,framerate$); MovieSetFrameWidth(movie,w); MovieSetFrameHeight(movie,h); # Make Output File string ext$; ext$ = MovieGetFileExt(movie); string filename$; filename$ = GetOutputFileName("","Make filename for movie",ext$); printf("Filename = %s\n",filename$); # Check recording time if (time <= 1.0) time = 1.0; ##### Get georeference for surface layer and reset to group projection class Georef georef; georef = GetLastUsedGeorefObject(Surface); GeorefSetProjection(georef,group.Projection); # Find map coordinates and surface elevation at center of group # and define as view point (center) class POINT3D center; center.x = group.Center.x; center.y = group.Center.y; numeric objx; numeric objy; MapToObject(georef,center.x,center.y,Surface,objx,objy); center.z = Surface[objy,objx]; ##### Set up viewpoint and viewer position parameters class VIEWPOINT3D vp; vp = view3d.ViewPoint; vp.SetCenter(center); class POINT3D pt; # viewer position class POINT2D point; # 2D point for location symbols # Set initial viewer position north of center just beyond group extents # and 10000 m higher than center point pt.x = group.Center.x; pt.y = group.Extents.y2 + 0.6 * (group.Extents.y2 - group.Center.y); pt.z = center.z + 10000; vp.SetViewerPosition(pt); # Calculate spiral orbit parameters numeric numFrames = time * rate; numeric deltaAngle = -360.0 / numFrames * 2; numeric tx = vp.ViewPos.x - vp.CenterPoint.x; numeric ty = vp.ViewPos.y - vp.CenterPoint.y; numeric distance = 4 * sqrt(tx * tx + ty * ty) / 5 / numFrames * 2; numeric height = (vp.ViewPos.z - vp.CenterPoint.z) / numFrames * 2; ###### Start recording movie to file MovieStart(movie,filename$); # Loop for each frame numeric i, azimuth; for i = 1 to numFrames { SetStatusMessage(sprintf("Processing frame %d of %d",i,numFrames)); # Rotate viewer position around center with deltaAngle increment vp.RotateViewerPosition(deltaAngle); if (i <= numFrames / 2) { # Move viewer position closer and higher to center point azimuth = vp.AzimAngle * 180 / PI; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,90,height,"m"); } else { # Move viewer position farther and lower from center point azimuth = vp.AzimAngle * 180 / PI + 180; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,-90,height,"m"); } # ViewRedrawDirect(view3d,"NoBlankScreen"); # This new function added after release of TNTmips 6.5 # can redraw the view without blanking it first. Use of # this function eliminates "flashing" of the view as the # movie is initially rendered. It has no effect on the # output movie file. For 6.5 release version, use the # function in the next statement. ViewRedraw(view3d); # Copy 2d view and 3d view to destination frame FrameCopyFromView(frame,view2d,0,0,size,size,x2d,y2d); FrameCopyFromView(frame,view3d,0,0,size,size,x3d,y3d); # Draw center point in 2d view point.x = vp.CenterPoint.x; point.y = vp.CenterPoint.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(center$); DrawPoint(point.x,point.y); # Draw viewer position point in 2d view point.x = vp.ViewPos.x; point.y = vp.ViewPos.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(viewer$); DrawPoint(point.x,point.y); # Draw text to top of frame DrawTextSetColors(black); DrawTextSimple(frameTitle$,5,fontsize); DrawTextSimple(frameTitle2$,5,2.2*fontsize); # Add frame to movie MovieAddFrame(movie,frame); } # End of main processing loop # Stop and Exit movie MovieStop(movie); MovieExit(movie); # Close dialogs DialogClose(dialog2d); DialogClose(dialog3d); print("END");
MovieExit
Finalize movie handle
MovieExit(movie)
場所:
ムービー
パラメータ:
class MOVIE movie
A valid movie handle
戻り値
なし
作成日時: 02-Apr-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
###################### # # ORBITSP.SML # # Demonstration of movie generation from 3D display using spiral # orbit path. Both 2D and 3D views are copied into each movie frame. # # View center is fixed at center of group. Viewer position is computed # from size of group. Two complete orbits are made. The first starts # beyond the edge of group and spirals inward and downward; the second # spirals outward and upward. # # Script uses an input DEM for the surface layer, an input raster drape # layer, and an input vector drape layer. # # Requires TNTmips Version 6.5 # ##################### clear(); #### Set movie format, frame rate, and recording time # Movie format (Possible values : "MPEG"(All platform) or "AVI"(Windows only) string format$; format$ = "AVI"; # Frame rate # Possible values : # "MOVIE_FRAMERATE_23_976" 23.976 (24000/1001) fps - NTSC encapsulated film rate # "MOVIE_FRAMERATE_24" 24 fps - Standard international cinema film rate # "MOVIE_FRAMERATE_25" 25 fps - PAL (625/50) video frame rate # "MOVIE_FRAMERATE_29_970" 29.97 (30000/1001) fps - NTSC video frame rate # "MOVIE_FRAMERATE_30" 30 fps - NTSC drop-frame (525/60) video frame rate # "MOVIE_FRAMERATE_50" 50 fps - Double frame rate / progressive PAL # "MOVIE_FRAMERATE_59_940" 59.94 (60000/1001) fps - Double frame rate NTSC # "MOVIE_FRAMERATE_60" 60 fps - Double frame rate drop-frame NTSC string framerate$; framerate$ = "MOVIE_FRAMERATE_24"; # Recording time numeric time; time = 60; ###### Get RVC objects to load raster Surface, RastDrape; vector VectDrape; print("Select raster to use for surface"); GetInputRaster(Surface); print("Select raster to use for first drape layer"); GetInputRaster(RastDrape); print("Select vector to use for second drape layer"); GetInputVector(VectDrape); ###### RVC style object to draw center point and viewer point string styleFilename$; string styleObjectname$; GetInputObject("Style","Select style object for center and viewer point symbols:", styleFilename$, styleObjectname$); string viewer$; viewer$ = "VIEWER"; string center$; center$ = "CENTER"; ######## Create display group with 2d and 3d views print("START"); # Size of squared 2D view and 3D view # Should be evenly divisible by 8 numeric size; size = 400; # Zoom out factor for 2D view numeric zoomfactor; zoomfactor = 1.8; # Create group print("Creating Group"); class GRE_GROUP group; group = GroupCreate(); # Create flags to create view without iconbar, scrollbars, status line and scale/position line # This is important to maintain fixed window size for movie generation string flags$; flags$ = "NoScalePosLine,NoIconBar,NoScrollbars,NoStatusLine"; # Create dialog and 2D view print("Creating dialog and 2D view"); class XmForm dialog2d; class GRE_VIEW view2d; dialog2d = CreateFormDialog("VIEW 2D"); view2d = GroupCreateView(group,dialog2d,"",size,size,flags$); view2d.BackgroundColor.red = 67; view2d.BackgroundColor.green = 100; view2d.BackgroundColor.blue = 100; # Create dialog and 3D view print("Creating dialog and 3D view"); class XmForm dialog3d; class GRE_VIEW3D view3d; dialog3d = CreateFormDialog("VIEW 3D"); view3d = GroupCreate3DView(group,dialog3d,"",size,size,flags$); view3d.BackgroundColor.red = 67; view3d.BackgroundColor.green = 100; view3d.BackgroundColor.blue = 100; # Add layers to group GroupQuickAddRasterVar(group,Surface,1); GroupQuickAddRasterVar(group,RastDrape,0); GroupQuickAddVectorVar(group,VectDrape); # Open both views DialogOpen(dialog2d); DialogOpen(dialog3d); # Full redraw of both views ViewRedrawFull(view2d); ViewRedrawFull(view3d); ViewZoomOut(view2d,zoomfactor,1); ####### Set up parameters for movie frame # Destination of each view in final frame for movie numeric x2d, y2d, x3d, y3d, w, h; x2d = 0; y2d = 0; x3d = size; y3d = 0; w = 2 * size; h = size; # Create text strings for annotation in frame string frameTitle$; string frameTitle2$; frameTitle$ = "Mount St. Helens Flow Hazard Zonation"; frameTitle2$ = "and Survey Station Locations"; # Font size numeric fontsize; fontsize = 16; # Define color for text annotation in frame class Color black; black.red = 0; black.green = 0; black.blue = 0; # Creating frame print("Creating frame for movie"); class Frame frame; frame = FrameCreate(w,h); # Create graphics context (GC) for frame print("Creating GC from frame and activate it"); ActivateGC(FrameCreateGC(frame)); DrawTextSetHeightPixels(fontsize); DrawUseStyleObject(styleFilename$,styleObjectname$); ######## Set some more movie parameters # Initiale Movie print("Initializing Movie"); class Movie movie; movie = MovieInit(); # Check framerate and force it to "MOVIE_FRAMERATE_24" if it is invalid numeric rate; rate = 24; if (framerate$ == "MOVIE_FRAMERATE_23_976") rate = 23.976; if (framerate$ == "MOVIE_FRAMERATE_25") rate = 25.0; if (framerate$ == "MOVIE_FRAMERATE_29_970") rate = 29.970; if (framerate$ == "MOVIE_FRAMERATE_30") rate = 30.0; if (framerate$ == "MOVIE_FRAMERATE_50") rate = 50.0; if (framerate$ == "MOVIE_FRAMERATE_59_940") rate = 59.940; if (framerate$ == "MOVIE_FRAMERATE_60") rate = 60.0; if (rate == 24.0) framerate$ = "MOVIE_FRAMERATE_24"; # Set Movie Parameters print("Setting Movie Parameters"); MovieSetFormat(movie,format$); MovieSetFrameRate(movie,framerate$); MovieSetFrameWidth(movie,w); MovieSetFrameHeight(movie,h); # Make Output File string ext$; ext$ = MovieGetFileExt(movie); string filename$; filename$ = GetOutputFileName("","Make filename for movie",ext$); printf("Filename = %s\n",filename$); # Check recording time if (time <= 1.0) time = 1.0; ##### Get georeference for surface layer and reset to group projection class Georef georef; georef = GetLastUsedGeorefObject(Surface); GeorefSetProjection(georef,group.Projection); # Find map coordinates and surface elevation at center of group # and define as view point (center) class POINT3D center; center.x = group.Center.x; center.y = group.Center.y; numeric objx; numeric objy; MapToObject(georef,center.x,center.y,Surface,objx,objy); center.z = Surface[objy,objx]; ##### Set up viewpoint and viewer position parameters class VIEWPOINT3D vp; vp = view3d.ViewPoint; vp.SetCenter(center); class POINT3D pt; # viewer position class POINT2D point; # 2D point for location symbols # Set initial viewer position north of center just beyond group extents # and 10000 m higher than center point pt.x = group.Center.x; pt.y = group.Extents.y2 + 0.6 * (group.Extents.y2 - group.Center.y); pt.z = center.z + 10000; vp.SetViewerPosition(pt); # Calculate spiral orbit parameters numeric numFrames = time * rate; numeric deltaAngle = -360.0 / numFrames * 2; numeric tx = vp.ViewPos.x - vp.CenterPoint.x; numeric ty = vp.ViewPos.y - vp.CenterPoint.y; numeric distance = 4 * sqrt(tx * tx + ty * ty) / 5 / numFrames * 2; numeric height = (vp.ViewPos.z - vp.CenterPoint.z) / numFrames * 2; ###### Start recording movie to file MovieStart(movie,filename$); # Loop for each frame numeric i, azimuth; for i = 1 to numFrames { SetStatusMessage(sprintf("Processing frame %d of %d",i,numFrames)); # Rotate viewer position around center with deltaAngle increment vp.RotateViewerPosition(deltaAngle); if (i <= numFrames / 2) { # Move viewer position closer and higher to center point azimuth = vp.AzimAngle * 180 / PI; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,90,height,"m"); } else { # Move viewer position farther and lower from center point azimuth = vp.AzimAngle * 180 / PI + 180; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,-90,height,"m"); } # ViewRedrawDirect(view3d,"NoBlankScreen"); # This new function added after release of TNTmips 6.5 # can redraw the view without blanking it first. Use of # this function eliminates "flashing" of the view as the # movie is initially rendered. It has no effect on the # output movie file. For 6.5 release version, use the # function in the next statement. ViewRedraw(view3d); # Copy 2d view and 3d view to destination frame FrameCopyFromView(frame,view2d,0,0,size,size,x2d,y2d); FrameCopyFromView(frame,view3d,0,0,size,size,x3d,y3d); # Draw center point in 2d view point.x = vp.CenterPoint.x; point.y = vp.CenterPoint.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(center$); DrawPoint(point.x,point.y); # Draw viewer position point in 2d view point.x = vp.ViewPos.x; point.y = vp.ViewPos.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(viewer$); DrawPoint(point.x,point.y); # Draw text to top of frame DrawTextSetColors(black); DrawTextSimple(frameTitle$,5,fontsize); DrawTextSimple(frameTitle2$,5,2.2*fontsize); # Add frame to movie MovieAddFrame(movie,frame); } # End of main processing loop # Stop and Exit movie MovieStop(movie); MovieExit(movie); # Close dialogs DialogClose(dialog2d); DialogClose(dialog3d); print("END");
MovieGetFileExt
Get File Extension
MovieGetFileExt(movie)
場所:
ムービー
パラメータ:
class MOVIE movie
A valid movie handle
戻り値
string
作成日時: 05-Apr-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
###################### # # ORBITSP.SML # # Demonstration of movie generation from 3D display using spiral # orbit path. Both 2D and 3D views are copied into each movie frame. # # View center is fixed at center of group. Viewer position is computed # from size of group. Two complete orbits are made. The first starts # beyond the edge of group and spirals inward and downward; the second # spirals outward and upward. # # Script uses an input DEM for the surface layer, an input raster drape # layer, and an input vector drape layer. # # Requires TNTmips Version 6.5 # ##################### clear(); #### Set movie format, frame rate, and recording time # Movie format (Possible values : "MPEG"(All platform) or "AVI"(Windows only) string format$; format$ = "AVI"; # Frame rate # Possible values : # "MOVIE_FRAMERATE_23_976" 23.976 (24000/1001) fps - NTSC encapsulated film rate # "MOVIE_FRAMERATE_24" 24 fps - Standard international cinema film rate # "MOVIE_FRAMERATE_25" 25 fps - PAL (625/50) video frame rate # "MOVIE_FRAMERATE_29_970" 29.97 (30000/1001) fps - NTSC video frame rate # "MOVIE_FRAMERATE_30" 30 fps - NTSC drop-frame (525/60) video frame rate # "MOVIE_FRAMERATE_50" 50 fps - Double frame rate / progressive PAL # "MOVIE_FRAMERATE_59_940" 59.94 (60000/1001) fps - Double frame rate NTSC # "MOVIE_FRAMERATE_60" 60 fps - Double frame rate drop-frame NTSC string framerate$; framerate$ = "MOVIE_FRAMERATE_24"; # Recording time numeric time; time = 60; ###### Get RVC objects to load raster Surface, RastDrape; vector VectDrape; print("Select raster to use for surface"); GetInputRaster(Surface); print("Select raster to use for first drape layer"); GetInputRaster(RastDrape); print("Select vector to use for second drape layer"); GetInputVector(VectDrape); ###### RVC style object to draw center point and viewer point string styleFilename$; string styleObjectname$; GetInputObject("Style","Select style object for center and viewer point symbols:", styleFilename$, styleObjectname$); string viewer$; viewer$ = "VIEWER"; string center$; center$ = "CENTER"; ######## Create display group with 2d and 3d views print("START"); # Size of squared 2D view and 3D view # Should be evenly divisible by 8 numeric size; size = 400; # Zoom out factor for 2D view numeric zoomfactor; zoomfactor = 1.8; # Create group print("Creating Group"); class GRE_GROUP group; group = GroupCreate(); # Create flags to create view without iconbar, scrollbars, status line and scale/position line # This is important to maintain fixed window size for movie generation string flags$; flags$ = "NoScalePosLine,NoIconBar,NoScrollbars,NoStatusLine"; # Create dialog and 2D view print("Creating dialog and 2D view"); class XmForm dialog2d; class GRE_VIEW view2d; dialog2d = CreateFormDialog("VIEW 2D"); view2d = GroupCreateView(group,dialog2d,"",size,size,flags$); view2d.BackgroundColor.red = 67; view2d.BackgroundColor.green = 100; view2d.BackgroundColor.blue = 100; # Create dialog and 3D view print("Creating dialog and 3D view"); class XmForm dialog3d; class GRE_VIEW3D view3d; dialog3d = CreateFormDialog("VIEW 3D"); view3d = GroupCreate3DView(group,dialog3d,"",size,size,flags$); view3d.BackgroundColor.red = 67; view3d.BackgroundColor.green = 100; view3d.BackgroundColor.blue = 100; # Add layers to group GroupQuickAddRasterVar(group,Surface,1); GroupQuickAddRasterVar(group,RastDrape,0); GroupQuickAddVectorVar(group,VectDrape); # Open both views DialogOpen(dialog2d); DialogOpen(dialog3d); # Full redraw of both views ViewRedrawFull(view2d); ViewRedrawFull(view3d); ViewZoomOut(view2d,zoomfactor,1); ####### Set up parameters for movie frame # Destination of each view in final frame for movie numeric x2d, y2d, x3d, y3d, w, h; x2d = 0; y2d = 0; x3d = size; y3d = 0; w = 2 * size; h = size; # Create text strings for annotation in frame string frameTitle$; string frameTitle2$; frameTitle$ = "Mount St. Helens Flow Hazard Zonation"; frameTitle2$ = "and Survey Station Locations"; # Font size numeric fontsize; fontsize = 16; # Define color for text annotation in frame class Color black; black.red = 0; black.green = 0; black.blue = 0; # Creating frame print("Creating frame for movie"); class Frame frame; frame = FrameCreate(w,h); # Create graphics context (GC) for frame print("Creating GC from frame and activate it"); ActivateGC(FrameCreateGC(frame)); DrawTextSetHeightPixels(fontsize); DrawUseStyleObject(styleFilename$,styleObjectname$); ######## Set some more movie parameters # Initiale Movie print("Initializing Movie"); class Movie movie; movie = MovieInit(); # Check framerate and force it to "MOVIE_FRAMERATE_24" if it is invalid numeric rate; rate = 24; if (framerate$ == "MOVIE_FRAMERATE_23_976") rate = 23.976; if (framerate$ == "MOVIE_FRAMERATE_25") rate = 25.0; if (framerate$ == "MOVIE_FRAMERATE_29_970") rate = 29.970; if (framerate$ == "MOVIE_FRAMERATE_30") rate = 30.0; if (framerate$ == "MOVIE_FRAMERATE_50") rate = 50.0; if (framerate$ == "MOVIE_FRAMERATE_59_940") rate = 59.940; if (framerate$ == "MOVIE_FRAMERATE_60") rate = 60.0; if (rate == 24.0) framerate$ = "MOVIE_FRAMERATE_24"; # Set Movie Parameters print("Setting Movie Parameters"); MovieSetFormat(movie,format$); MovieSetFrameRate(movie,framerate$); MovieSetFrameWidth(movie,w); MovieSetFrameHeight(movie,h); # Make Output File string ext$; ext$ = MovieGetFileExt(movie); string filename$; filename$ = GetOutputFileName("","Make filename for movie",ext$); printf("Filename = %s\n",filename$); # Check recording time if (time <= 1.0) time = 1.0; ##### Get georeference for surface layer and reset to group projection class Georef georef; georef = GetLastUsedGeorefObject(Surface); GeorefSetProjection(georef,group.Projection); # Find map coordinates and surface elevation at center of group # and define as view point (center) class POINT3D center; center.x = group.Center.x; center.y = group.Center.y; numeric objx; numeric objy; MapToObject(georef,center.x,center.y,Surface,objx,objy); center.z = Surface[objy,objx]; ##### Set up viewpoint and viewer position parameters class VIEWPOINT3D vp; vp = view3d.ViewPoint; vp.SetCenter(center); class POINT3D pt; # viewer position class POINT2D point; # 2D point for location symbols # Set initial viewer position north of center just beyond group extents # and 10000 m higher than center point pt.x = group.Center.x; pt.y = group.Extents.y2 + 0.6 * (group.Extents.y2 - group.Center.y); pt.z = center.z + 10000; vp.SetViewerPosition(pt); # Calculate spiral orbit parameters numeric numFrames = time * rate; numeric deltaAngle = -360.0 / numFrames * 2; numeric tx = vp.ViewPos.x - vp.CenterPoint.x; numeric ty = vp.ViewPos.y - vp.CenterPoint.y; numeric distance = 4 * sqrt(tx * tx + ty * ty) / 5 / numFrames * 2; numeric height = (vp.ViewPos.z - vp.CenterPoint.z) / numFrames * 2; ###### Start recording movie to file MovieStart(movie,filename$); # Loop for each frame numeric i, azimuth; for i = 1 to numFrames { SetStatusMessage(sprintf("Processing frame %d of %d",i,numFrames)); # Rotate viewer position around center with deltaAngle increment vp.RotateViewerPosition(deltaAngle); if (i <= numFrames / 2) { # Move viewer position closer and higher to center point azimuth = vp.AzimAngle * 180 / PI; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,90,height,"m"); } else { # Move viewer position farther and lower from center point azimuth = vp.AzimAngle * 180 / PI + 180; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,-90,height,"m"); } # ViewRedrawDirect(view3d,"NoBlankScreen"); # This new function added after release of TNTmips 6.5 # can redraw the view without blanking it first. Use of # this function eliminates "flashing" of the view as the # movie is initially rendered. It has no effect on the # output movie file. For 6.5 release version, use the # function in the next statement. ViewRedraw(view3d); # Copy 2d view and 3d view to destination frame FrameCopyFromView(frame,view2d,0,0,size,size,x2d,y2d); FrameCopyFromView(frame,view3d,0,0,size,size,x3d,y3d); # Draw center point in 2d view point.x = vp.CenterPoint.x; point.y = vp.CenterPoint.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(center$); DrawPoint(point.x,point.y); # Draw viewer position point in 2d view point.x = vp.ViewPos.x; point.y = vp.ViewPos.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(viewer$); DrawPoint(point.x,point.y); # Draw text to top of frame DrawTextSetColors(black); DrawTextSimple(frameTitle$,5,fontsize); DrawTextSimple(frameTitle2$,5,2.2*fontsize); # Add frame to movie MovieAddFrame(movie,frame); } # End of main processing loop # Stop and Exit movie MovieStop(movie); MovieExit(movie); # Close dialogs DialogClose(dialog2d); DialogClose(dialog3d); print("END");
MovieInit
Initialize movie handle (returns handle)
MovieInit()
場所:
ムービー
パラメータ:
戻り値
class MOVIE
作成日時: 02-Apr-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
###################### # # ORBITSP.SML # # Demonstration of movie generation from 3D display using spiral # orbit path. Both 2D and 3D views are copied into each movie frame. # # View center is fixed at center of group. Viewer position is computed # from size of group. Two complete orbits are made. The first starts # beyond the edge of group and spirals inward and downward; the second # spirals outward and upward. # # Script uses an input DEM for the surface layer, an input raster drape # layer, and an input vector drape layer. # # Requires TNTmips Version 6.5 # ##################### clear(); #### Set movie format, frame rate, and recording time # Movie format (Possible values : "MPEG"(All platform) or "AVI"(Windows only) string format$; format$ = "AVI"; # Frame rate # Possible values : # "MOVIE_FRAMERATE_23_976" 23.976 (24000/1001) fps - NTSC encapsulated film rate # "MOVIE_FRAMERATE_24" 24 fps - Standard international cinema film rate # "MOVIE_FRAMERATE_25" 25 fps - PAL (625/50) video frame rate # "MOVIE_FRAMERATE_29_970" 29.97 (30000/1001) fps - NTSC video frame rate # "MOVIE_FRAMERATE_30" 30 fps - NTSC drop-frame (525/60) video frame rate # "MOVIE_FRAMERATE_50" 50 fps - Double frame rate / progressive PAL # "MOVIE_FRAMERATE_59_940" 59.94 (60000/1001) fps - Double frame rate NTSC # "MOVIE_FRAMERATE_60" 60 fps - Double frame rate drop-frame NTSC string framerate$; framerate$ = "MOVIE_FRAMERATE_24"; # Recording time numeric time; time = 60; ###### Get RVC objects to load raster Surface, RastDrape; vector VectDrape; print("Select raster to use for surface"); GetInputRaster(Surface); print("Select raster to use for first drape layer"); GetInputRaster(RastDrape); print("Select vector to use for second drape layer"); GetInputVector(VectDrape); ###### RVC style object to draw center point and viewer point string styleFilename$; string styleObjectname$; GetInputObject("Style","Select style object for center and viewer point symbols:", styleFilename$, styleObjectname$); string viewer$; viewer$ = "VIEWER"; string center$; center$ = "CENTER"; ######## Create display group with 2d and 3d views print("START"); # Size of squared 2D view and 3D view # Should be evenly divisible by 8 numeric size; size = 400; # Zoom out factor for 2D view numeric zoomfactor; zoomfactor = 1.8; # Create group print("Creating Group"); class GRE_GROUP group; group = GroupCreate(); # Create flags to create view without iconbar, scrollbars, status line and scale/position line # This is important to maintain fixed window size for movie generation string flags$; flags$ = "NoScalePosLine,NoIconBar,NoScrollbars,NoStatusLine"; # Create dialog and 2D view print("Creating dialog and 2D view"); class XmForm dialog2d; class GRE_VIEW view2d; dialog2d = CreateFormDialog("VIEW 2D"); view2d = GroupCreateView(group,dialog2d,"",size,size,flags$); view2d.BackgroundColor.red = 67; view2d.BackgroundColor.green = 100; view2d.BackgroundColor.blue = 100; # Create dialog and 3D view print("Creating dialog and 3D view"); class XmForm dialog3d; class GRE_VIEW3D view3d; dialog3d = CreateFormDialog("VIEW 3D"); view3d = GroupCreate3DView(group,dialog3d,"",size,size,flags$); view3d.BackgroundColor.red = 67; view3d.BackgroundColor.green = 100; view3d.BackgroundColor.blue = 100; # Add layers to group GroupQuickAddRasterVar(group,Surface,1); GroupQuickAddRasterVar(group,RastDrape,0); GroupQuickAddVectorVar(group,VectDrape); # Open both views DialogOpen(dialog2d); DialogOpen(dialog3d); # Full redraw of both views ViewRedrawFull(view2d); ViewRedrawFull(view3d); ViewZoomOut(view2d,zoomfactor,1); ####### Set up parameters for movie frame # Destination of each view in final frame for movie numeric x2d, y2d, x3d, y3d, w, h; x2d = 0; y2d = 0; x3d = size; y3d = 0; w = 2 * size; h = size; # Create text strings for annotation in frame string frameTitle$; string frameTitle2$; frameTitle$ = "Mount St. Helens Flow Hazard Zonation"; frameTitle2$ = "and Survey Station Locations"; # Font size numeric fontsize; fontsize = 16; # Define color for text annotation in frame class Color black; black.red = 0; black.green = 0; black.blue = 0; # Creating frame print("Creating frame for movie"); class Frame frame; frame = FrameCreate(w,h); # Create graphics context (GC) for frame print("Creating GC from frame and activate it"); ActivateGC(FrameCreateGC(frame)); DrawTextSetHeightPixels(fontsize); DrawUseStyleObject(styleFilename$,styleObjectname$); ######## Set some more movie parameters # Initiale Movie print("Initializing Movie"); class Movie movie; movie = MovieInit(); # Check framerate and force it to "MOVIE_FRAMERATE_24" if it is invalid numeric rate; rate = 24; if (framerate$ == "MOVIE_FRAMERATE_23_976") rate = 23.976; if (framerate$ == "MOVIE_FRAMERATE_25") rate = 25.0; if (framerate$ == "MOVIE_FRAMERATE_29_970") rate = 29.970; if (framerate$ == "MOVIE_FRAMERATE_30") rate = 30.0; if (framerate$ == "MOVIE_FRAMERATE_50") rate = 50.0; if (framerate$ == "MOVIE_FRAMERATE_59_940") rate = 59.940; if (framerate$ == "MOVIE_FRAMERATE_60") rate = 60.0; if (rate == 24.0) framerate$ = "MOVIE_FRAMERATE_24"; # Set Movie Parameters print("Setting Movie Parameters"); MovieSetFormat(movie,format$); MovieSetFrameRate(movie,framerate$); MovieSetFrameWidth(movie,w); MovieSetFrameHeight(movie,h); # Make Output File string ext$; ext$ = MovieGetFileExt(movie); string filename$; filename$ = GetOutputFileName("","Make filename for movie",ext$); printf("Filename = %s\n",filename$); # Check recording time if (time <= 1.0) time = 1.0; ##### Get georeference for surface layer and reset to group projection class Georef georef; georef = GetLastUsedGeorefObject(Surface); GeorefSetProjection(georef,group.Projection); # Find map coordinates and surface elevation at center of group # and define as view point (center) class POINT3D center; center.x = group.Center.x; center.y = group.Center.y; numeric objx; numeric objy; MapToObject(georef,center.x,center.y,Surface,objx,objy); center.z = Surface[objy,objx]; ##### Set up viewpoint and viewer position parameters class VIEWPOINT3D vp; vp = view3d.ViewPoint; vp.SetCenter(center); class POINT3D pt; # viewer position class POINT2D point; # 2D point for location symbols # Set initial viewer position north of center just beyond group extents # and 10000 m higher than center point pt.x = group.Center.x; pt.y = group.Extents.y2 + 0.6 * (group.Extents.y2 - group.Center.y); pt.z = center.z + 10000; vp.SetViewerPosition(pt); # Calculate spiral orbit parameters numeric numFrames = time * rate; numeric deltaAngle = -360.0 / numFrames * 2; numeric tx = vp.ViewPos.x - vp.CenterPoint.x; numeric ty = vp.ViewPos.y - vp.CenterPoint.y; numeric distance = 4 * sqrt(tx * tx + ty * ty) / 5 / numFrames * 2; numeric height = (vp.ViewPos.z - vp.CenterPoint.z) / numFrames * 2; ###### Start recording movie to file MovieStart(movie,filename$); # Loop for each frame numeric i, azimuth; for i = 1 to numFrames { SetStatusMessage(sprintf("Processing frame %d of %d",i,numFrames)); # Rotate viewer position around center with deltaAngle increment vp.RotateViewerPosition(deltaAngle); if (i <= numFrames / 2) { # Move viewer position closer and higher to center point azimuth = vp.AzimAngle * 180 / PI; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,90,height,"m"); } else { # Move viewer position farther and lower from center point azimuth = vp.AzimAngle * 180 / PI + 180; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,-90,height,"m"); } # ViewRedrawDirect(view3d,"NoBlankScreen"); # This new function added after release of TNTmips 6.5 # can redraw the view without blanking it first. Use of # this function eliminates "flashing" of the view as the # movie is initially rendered. It has no effect on the # output movie file. For 6.5 release version, use the # function in the next statement. ViewRedraw(view3d); # Copy 2d view and 3d view to destination frame FrameCopyFromView(frame,view2d,0,0,size,size,x2d,y2d); FrameCopyFromView(frame,view3d,0,0,size,size,x3d,y3d); # Draw center point in 2d view point.x = vp.CenterPoint.x; point.y = vp.CenterPoint.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(center$); DrawPoint(point.x,point.y); # Draw viewer position point in 2d view point.x = vp.ViewPos.x; point.y = vp.ViewPos.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(viewer$); DrawPoint(point.x,point.y); # Draw text to top of frame DrawTextSetColors(black); DrawTextSimple(frameTitle$,5,fontsize); DrawTextSimple(frameTitle2$,5,2.2*fontsize); # Add frame to movie MovieAddFrame(movie,frame); } # End of main processing loop # Stop and Exit movie MovieStop(movie); MovieExit(movie); # Close dialogs DialogClose(dialog2d); DialogClose(dialog3d); print("END");
MovieSetFormat
Set movie format
MovieSetFormat(movie, format$)
場所:
ムービー
パラメータ:
class MOVIE movie
A valid movie handle
string format$
Movie format
可能性のある値:
"AVI"
AVI
戻り値
numeric
作成日時: 02-Apr-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
###################### # # ORBITSP.SML # # Demonstration of movie generation from 3D display using spiral # orbit path. Both 2D and 3D views are copied into each movie frame. # # View center is fixed at center of group. Viewer position is computed # from size of group. Two complete orbits are made. The first starts # beyond the edge of group and spirals inward and downward; the second # spirals outward and upward. # # Script uses an input DEM for the surface layer, an input raster drape # layer, and an input vector drape layer. # # Requires TNTmips Version 6.5 # ##################### clear(); #### Set movie format, frame rate, and recording time # Movie format (Possible values : "MPEG"(All platform) or "AVI"(Windows only) string format$; format$ = "AVI"; # Frame rate # Possible values : # "MOVIE_FRAMERATE_23_976" 23.976 (24000/1001) fps - NTSC encapsulated film rate # "MOVIE_FRAMERATE_24" 24 fps - Standard international cinema film rate # "MOVIE_FRAMERATE_25" 25 fps - PAL (625/50) video frame rate # "MOVIE_FRAMERATE_29_970" 29.97 (30000/1001) fps - NTSC video frame rate # "MOVIE_FRAMERATE_30" 30 fps - NTSC drop-frame (525/60) video frame rate # "MOVIE_FRAMERATE_50" 50 fps - Double frame rate / progressive PAL # "MOVIE_FRAMERATE_59_940" 59.94 (60000/1001) fps - Double frame rate NTSC # "MOVIE_FRAMERATE_60" 60 fps - Double frame rate drop-frame NTSC string framerate$; framerate$ = "MOVIE_FRAMERATE_24"; # Recording time numeric time; time = 60; ###### Get RVC objects to load raster Surface, RastDrape; vector VectDrape; print("Select raster to use for surface"); GetInputRaster(Surface); print("Select raster to use for first drape layer"); GetInputRaster(RastDrape); print("Select vector to use for second drape layer"); GetInputVector(VectDrape); ###### RVC style object to draw center point and viewer point string styleFilename$; string styleObjectname$; GetInputObject("Style","Select style object for center and viewer point symbols:", styleFilename$, styleObjectname$); string viewer$; viewer$ = "VIEWER"; string center$; center$ = "CENTER"; ######## Create display group with 2d and 3d views print("START"); # Size of squared 2D view and 3D view # Should be evenly divisible by 8 numeric size; size = 400; # Zoom out factor for 2D view numeric zoomfactor; zoomfactor = 1.8; # Create group print("Creating Group"); class GRE_GROUP group; group = GroupCreate(); # Create flags to create view without iconbar, scrollbars, status line and scale/position line # This is important to maintain fixed window size for movie generation string flags$; flags$ = "NoScalePosLine,NoIconBar,NoScrollbars,NoStatusLine"; # Create dialog and 2D view print("Creating dialog and 2D view"); class XmForm dialog2d; class GRE_VIEW view2d; dialog2d = CreateFormDialog("VIEW 2D"); view2d = GroupCreateView(group,dialog2d,"",size,size,flags$); view2d.BackgroundColor.red = 67; view2d.BackgroundColor.green = 100; view2d.BackgroundColor.blue = 100; # Create dialog and 3D view print("Creating dialog and 3D view"); class XmForm dialog3d; class GRE_VIEW3D view3d; dialog3d = CreateFormDialog("VIEW 3D"); view3d = GroupCreate3DView(group,dialog3d,"",size,size,flags$); view3d.BackgroundColor.red = 67; view3d.BackgroundColor.green = 100; view3d.BackgroundColor.blue = 100; # Add layers to group GroupQuickAddRasterVar(group,Surface,1); GroupQuickAddRasterVar(group,RastDrape,0); GroupQuickAddVectorVar(group,VectDrape); # Open both views DialogOpen(dialog2d); DialogOpen(dialog3d); # Full redraw of both views ViewRedrawFull(view2d); ViewRedrawFull(view3d); ViewZoomOut(view2d,zoomfactor,1); ####### Set up parameters for movie frame # Destination of each view in final frame for movie numeric x2d, y2d, x3d, y3d, w, h; x2d = 0; y2d = 0; x3d = size; y3d = 0; w = 2 * size; h = size; # Create text strings for annotation in frame string frameTitle$; string frameTitle2$; frameTitle$ = "Mount St. Helens Flow Hazard Zonation"; frameTitle2$ = "and Survey Station Locations"; # Font size numeric fontsize; fontsize = 16; # Define color for text annotation in frame class Color black; black.red = 0; black.green = 0; black.blue = 0; # Creating frame print("Creating frame for movie"); class Frame frame; frame = FrameCreate(w,h); # Create graphics context (GC) for frame print("Creating GC from frame and activate it"); ActivateGC(FrameCreateGC(frame)); DrawTextSetHeightPixels(fontsize); DrawUseStyleObject(styleFilename$,styleObjectname$); ######## Set some more movie parameters # Initiale Movie print("Initializing Movie"); class Movie movie; movie = MovieInit(); # Check framerate and force it to "MOVIE_FRAMERATE_24" if it is invalid numeric rate; rate = 24; if (framerate$ == "MOVIE_FRAMERATE_23_976") rate = 23.976; if (framerate$ == "MOVIE_FRAMERATE_25") rate = 25.0; if (framerate$ == "MOVIE_FRAMERATE_29_970") rate = 29.970; if (framerate$ == "MOVIE_FRAMERATE_30") rate = 30.0; if (framerate$ == "MOVIE_FRAMERATE_50") rate = 50.0; if (framerate$ == "MOVIE_FRAMERATE_59_940") rate = 59.940; if (framerate$ == "MOVIE_FRAMERATE_60") rate = 60.0; if (rate == 24.0) framerate$ = "MOVIE_FRAMERATE_24"; # Set Movie Parameters print("Setting Movie Parameters"); MovieSetFormat(movie,format$); MovieSetFrameRate(movie,framerate$); MovieSetFrameWidth(movie,w); MovieSetFrameHeight(movie,h); # Make Output File string ext$; ext$ = MovieGetFileExt(movie); string filename$; filename$ = GetOutputFileName("","Make filename for movie",ext$); printf("Filename = %s\n",filename$); # Check recording time if (time <= 1.0) time = 1.0; ##### Get georeference for surface layer and reset to group projection class Georef georef; georef = GetLastUsedGeorefObject(Surface); GeorefSetProjection(georef,group.Projection); # Find map coordinates and surface elevation at center of group # and define as view point (center) class POINT3D center; center.x = group.Center.x; center.y = group.Center.y; numeric objx; numeric objy; MapToObject(georef,center.x,center.y,Surface,objx,objy); center.z = Surface[objy,objx]; ##### Set up viewpoint and viewer position parameters class VIEWPOINT3D vp; vp = view3d.ViewPoint; vp.SetCenter(center); class POINT3D pt; # viewer position class POINT2D point; # 2D point for location symbols # Set initial viewer position north of center just beyond group extents # and 10000 m higher than center point pt.x = group.Center.x; pt.y = group.Extents.y2 + 0.6 * (group.Extents.y2 - group.Center.y); pt.z = center.z + 10000; vp.SetViewerPosition(pt); # Calculate spiral orbit parameters numeric numFrames = time * rate; numeric deltaAngle = -360.0 / numFrames * 2; numeric tx = vp.ViewPos.x - vp.CenterPoint.x; numeric ty = vp.ViewPos.y - vp.CenterPoint.y; numeric distance = 4 * sqrt(tx * tx + ty * ty) / 5 / numFrames * 2; numeric height = (vp.ViewPos.z - vp.CenterPoint.z) / numFrames * 2; ###### Start recording movie to file MovieStart(movie,filename$); # Loop for each frame numeric i, azimuth; for i = 1 to numFrames { SetStatusMessage(sprintf("Processing frame %d of %d",i,numFrames)); # Rotate viewer position around center with deltaAngle increment vp.RotateViewerPosition(deltaAngle); if (i <= numFrames / 2) { # Move viewer position closer and higher to center point azimuth = vp.AzimAngle * 180 / PI; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,90,height,"m"); } else { # Move viewer position farther and lower from center point azimuth = vp.AzimAngle * 180 / PI + 180; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,-90,height,"m"); } # ViewRedrawDirect(view3d,"NoBlankScreen"); # This new function added after release of TNTmips 6.5 # can redraw the view without blanking it first. Use of # this function eliminates "flashing" of the view as the # movie is initially rendered. It has no effect on the # output movie file. For 6.5 release version, use the # function in the next statement. ViewRedraw(view3d); # Copy 2d view and 3d view to destination frame FrameCopyFromView(frame,view2d,0,0,size,size,x2d,y2d); FrameCopyFromView(frame,view3d,0,0,size,size,x3d,y3d); # Draw center point in 2d view point.x = vp.CenterPoint.x; point.y = vp.CenterPoint.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(center$); DrawPoint(point.x,point.y); # Draw viewer position point in 2d view point.x = vp.ViewPos.x; point.y = vp.ViewPos.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(viewer$); DrawPoint(point.x,point.y); # Draw text to top of frame DrawTextSetColors(black); DrawTextSimple(frameTitle$,5,fontsize); DrawTextSimple(frameTitle2$,5,2.2*fontsize); # Add frame to movie MovieAddFrame(movie,frame); } # End of main processing loop # Stop and Exit movie MovieStop(movie); MovieExit(movie); # Close dialogs DialogClose(dialog2d); DialogClose(dialog3d); print("END");
MovieSetFrameHeight
Set movie frame height
MovieSetFrameHeight(movie, height)
場所:
ムービー
パラメータ:
class MOVIE movie
A valid movie handle
numeric height
Value to be set as current frame height
戻り値
なし
作成日時: 02-Apr-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
###################### # # ORBITSP.SML # # Demonstration of movie generation from 3D display using spiral # orbit path. Both 2D and 3D views are copied into each movie frame. # # View center is fixed at center of group. Viewer position is computed # from size of group. Two complete orbits are made. The first starts # beyond the edge of group and spirals inward and downward; the second # spirals outward and upward. # # Script uses an input DEM for the surface layer, an input raster drape # layer, and an input vector drape layer. # # Requires TNTmips Version 6.5 # ##################### clear(); #### Set movie format, frame rate, and recording time # Movie format (Possible values : "MPEG"(All platform) or "AVI"(Windows only) string format$; format$ = "AVI"; # Frame rate # Possible values : # "MOVIE_FRAMERATE_23_976" 23.976 (24000/1001) fps - NTSC encapsulated film rate # "MOVIE_FRAMERATE_24" 24 fps - Standard international cinema film rate # "MOVIE_FRAMERATE_25" 25 fps - PAL (625/50) video frame rate # "MOVIE_FRAMERATE_29_970" 29.97 (30000/1001) fps - NTSC video frame rate # "MOVIE_FRAMERATE_30" 30 fps - NTSC drop-frame (525/60) video frame rate # "MOVIE_FRAMERATE_50" 50 fps - Double frame rate / progressive PAL # "MOVIE_FRAMERATE_59_940" 59.94 (60000/1001) fps - Double frame rate NTSC # "MOVIE_FRAMERATE_60" 60 fps - Double frame rate drop-frame NTSC string framerate$; framerate$ = "MOVIE_FRAMERATE_24"; # Recording time numeric time; time = 60; ###### Get RVC objects to load raster Surface, RastDrape; vector VectDrape; print("Select raster to use for surface"); GetInputRaster(Surface); print("Select raster to use for first drape layer"); GetInputRaster(RastDrape); print("Select vector to use for second drape layer"); GetInputVector(VectDrape); ###### RVC style object to draw center point and viewer point string styleFilename$; string styleObjectname$; GetInputObject("Style","Select style object for center and viewer point symbols:", styleFilename$, styleObjectname$); string viewer$; viewer$ = "VIEWER"; string center$; center$ = "CENTER"; ######## Create display group with 2d and 3d views print("START"); # Size of squared 2D view and 3D view # Should be evenly divisible by 8 numeric size; size = 400; # Zoom out factor for 2D view numeric zoomfactor; zoomfactor = 1.8; # Create group print("Creating Group"); class GRE_GROUP group; group = GroupCreate(); # Create flags to create view without iconbar, scrollbars, status line and scale/position line # This is important to maintain fixed window size for movie generation string flags$; flags$ = "NoScalePosLine,NoIconBar,NoScrollbars,NoStatusLine"; # Create dialog and 2D view print("Creating dialog and 2D view"); class XmForm dialog2d; class GRE_VIEW view2d; dialog2d = CreateFormDialog("VIEW 2D"); view2d = GroupCreateView(group,dialog2d,"",size,size,flags$); view2d.BackgroundColor.red = 67; view2d.BackgroundColor.green = 100; view2d.BackgroundColor.blue = 100; # Create dialog and 3D view print("Creating dialog and 3D view"); class XmForm dialog3d; class GRE_VIEW3D view3d; dialog3d = CreateFormDialog("VIEW 3D"); view3d = GroupCreate3DView(group,dialog3d,"",size,size,flags$); view3d.BackgroundColor.red = 67; view3d.BackgroundColor.green = 100; view3d.BackgroundColor.blue = 100; # Add layers to group GroupQuickAddRasterVar(group,Surface,1); GroupQuickAddRasterVar(group,RastDrape,0); GroupQuickAddVectorVar(group,VectDrape); # Open both views DialogOpen(dialog2d); DialogOpen(dialog3d); # Full redraw of both views ViewRedrawFull(view2d); ViewRedrawFull(view3d); ViewZoomOut(view2d,zoomfactor,1); ####### Set up parameters for movie frame # Destination of each view in final frame for movie numeric x2d, y2d, x3d, y3d, w, h; x2d = 0; y2d = 0; x3d = size; y3d = 0; w = 2 * size; h = size; # Create text strings for annotation in frame string frameTitle$; string frameTitle2$; frameTitle$ = "Mount St. Helens Flow Hazard Zonation"; frameTitle2$ = "and Survey Station Locations"; # Font size numeric fontsize; fontsize = 16; # Define color for text annotation in frame class Color black; black.red = 0; black.green = 0; black.blue = 0; # Creating frame print("Creating frame for movie"); class Frame frame; frame = FrameCreate(w,h); # Create graphics context (GC) for frame print("Creating GC from frame and activate it"); ActivateGC(FrameCreateGC(frame)); DrawTextSetHeightPixels(fontsize); DrawUseStyleObject(styleFilename$,styleObjectname$); ######## Set some more movie parameters # Initiale Movie print("Initializing Movie"); class Movie movie; movie = MovieInit(); # Check framerate and force it to "MOVIE_FRAMERATE_24" if it is invalid numeric rate; rate = 24; if (framerate$ == "MOVIE_FRAMERATE_23_976") rate = 23.976; if (framerate$ == "MOVIE_FRAMERATE_25") rate = 25.0; if (framerate$ == "MOVIE_FRAMERATE_29_970") rate = 29.970; if (framerate$ == "MOVIE_FRAMERATE_30") rate = 30.0; if (framerate$ == "MOVIE_FRAMERATE_50") rate = 50.0; if (framerate$ == "MOVIE_FRAMERATE_59_940") rate = 59.940; if (framerate$ == "MOVIE_FRAMERATE_60") rate = 60.0; if (rate == 24.0) framerate$ = "MOVIE_FRAMERATE_24"; # Set Movie Parameters print("Setting Movie Parameters"); MovieSetFormat(movie,format$); MovieSetFrameRate(movie,framerate$); MovieSetFrameWidth(movie,w); MovieSetFrameHeight(movie,h); # Make Output File string ext$; ext$ = MovieGetFileExt(movie); string filename$; filename$ = GetOutputFileName("","Make filename for movie",ext$); printf("Filename = %s\n",filename$); # Check recording time if (time <= 1.0) time = 1.0; ##### Get georeference for surface layer and reset to group projection class Georef georef; georef = GetLastUsedGeorefObject(Surface); GeorefSetProjection(georef,group.Projection); # Find map coordinates and surface elevation at center of group # and define as view point (center) class POINT3D center; center.x = group.Center.x; center.y = group.Center.y; numeric objx; numeric objy; MapToObject(georef,center.x,center.y,Surface,objx,objy); center.z = Surface[objy,objx]; ##### Set up viewpoint and viewer position parameters class VIEWPOINT3D vp; vp = view3d.ViewPoint; vp.SetCenter(center); class POINT3D pt; # viewer position class POINT2D point; # 2D point for location symbols # Set initial viewer position north of center just beyond group extents # and 10000 m higher than center point pt.x = group.Center.x; pt.y = group.Extents.y2 + 0.6 * (group.Extents.y2 - group.Center.y); pt.z = center.z + 10000; vp.SetViewerPosition(pt); # Calculate spiral orbit parameters numeric numFrames = time * rate; numeric deltaAngle = -360.0 / numFrames * 2; numeric tx = vp.ViewPos.x - vp.CenterPoint.x; numeric ty = vp.ViewPos.y - vp.CenterPoint.y; numeric distance = 4 * sqrt(tx * tx + ty * ty) / 5 / numFrames * 2; numeric height = (vp.ViewPos.z - vp.CenterPoint.z) / numFrames * 2; ###### Start recording movie to file MovieStart(movie,filename$); # Loop for each frame numeric i, azimuth; for i = 1 to numFrames { SetStatusMessage(sprintf("Processing frame %d of %d",i,numFrames)); # Rotate viewer position around center with deltaAngle increment vp.RotateViewerPosition(deltaAngle); if (i <= numFrames / 2) { # Move viewer position closer and higher to center point azimuth = vp.AzimAngle * 180 / PI; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,90,height,"m"); } else { # Move viewer position farther and lower from center point azimuth = vp.AzimAngle * 180 / PI + 180; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,-90,height,"m"); } # ViewRedrawDirect(view3d,"NoBlankScreen"); # This new function added after release of TNTmips 6.5 # can redraw the view without blanking it first. Use of # this function eliminates "flashing" of the view as the # movie is initially rendered. It has no effect on the # output movie file. For 6.5 release version, use the # function in the next statement. ViewRedraw(view3d); # Copy 2d view and 3d view to destination frame FrameCopyFromView(frame,view2d,0,0,size,size,x2d,y2d); FrameCopyFromView(frame,view3d,0,0,size,size,x3d,y3d); # Draw center point in 2d view point.x = vp.CenterPoint.x; point.y = vp.CenterPoint.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(center$); DrawPoint(point.x,point.y); # Draw viewer position point in 2d view point.x = vp.ViewPos.x; point.y = vp.ViewPos.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(viewer$); DrawPoint(point.x,point.y); # Draw text to top of frame DrawTextSetColors(black); DrawTextSimple(frameTitle$,5,fontsize); DrawTextSimple(frameTitle2$,5,2.2*fontsize); # Add frame to movie MovieAddFrame(movie,frame); } # End of main processing loop # Stop and Exit movie MovieStop(movie); MovieExit(movie); # Close dialogs DialogClose(dialog2d); DialogClose(dialog3d); print("END");
MovieSetFrameRate
Set movie frame rate
MovieSetFrameRate(movie, framerate$)
場所:
ムービー
パラメータ:
class MOVIE movie
A valid movie handle
string framerate$
Frame rate
可能性のある値:
"MOVIE_FRAMERATE_23_976"
23.976 (24000/1001) fps - NTSC encapsulated film rate
"MOVIE_FRAMERATE_24"
24 fps - Standard international cinema film rate
"MOVIE_FRAMERATE_25"
25 fps - PAL (625/50) video frame rate
"MOVIE_FRAMERATE_29_970"
29.97 (30000/1001) fps - NTSC video frame rate
"MOVIE_FRAMERATE_30"
30 fps - NTSC drop-frame (525/60) video frame rate
"MOVIE_FRAMERATE_50"
50 fps - Double frame rate / progressive PAL
"MOVIE_FRAMERATE_59_940"
59.94 (60000/1001) fps - Double frame rate NTSC
"MOVIE_FRAMERATE_60"
60 fps - Double frame rate drop-frame NTSC
戻り値
なし
作成日時: 02-Apr-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
###################### # # ORBITSP.SML # # Demonstration of movie generation from 3D display using spiral # orbit path. Both 2D and 3D views are copied into each movie frame. # # View center is fixed at center of group. Viewer position is computed # from size of group. Two complete orbits are made. The first starts # beyond the edge of group and spirals inward and downward; the second # spirals outward and upward. # # Script uses an input DEM for the surface layer, an input raster drape # layer, and an input vector drape layer. # # Requires TNTmips Version 6.5 # ##################### clear(); #### Set movie format, frame rate, and recording time # Movie format (Possible values : "MPEG"(All platform) or "AVI"(Windows only) string format$; format$ = "AVI"; # Frame rate # Possible values : # "MOVIE_FRAMERATE_23_976" 23.976 (24000/1001) fps - NTSC encapsulated film rate # "MOVIE_FRAMERATE_24" 24 fps - Standard international cinema film rate # "MOVIE_FRAMERATE_25" 25 fps - PAL (625/50) video frame rate # "MOVIE_FRAMERATE_29_970" 29.97 (30000/1001) fps - NTSC video frame rate # "MOVIE_FRAMERATE_30" 30 fps - NTSC drop-frame (525/60) video frame rate # "MOVIE_FRAMERATE_50" 50 fps - Double frame rate / progressive PAL # "MOVIE_FRAMERATE_59_940" 59.94 (60000/1001) fps - Double frame rate NTSC # "MOVIE_FRAMERATE_60" 60 fps - Double frame rate drop-frame NTSC string framerate$; framerate$ = "MOVIE_FRAMERATE_24"; # Recording time numeric time; time = 60; ###### Get RVC objects to load raster Surface, RastDrape; vector VectDrape; print("Select raster to use for surface"); GetInputRaster(Surface); print("Select raster to use for first drape layer"); GetInputRaster(RastDrape); print("Select vector to use for second drape layer"); GetInputVector(VectDrape); ###### RVC style object to draw center point and viewer point string styleFilename$; string styleObjectname$; GetInputObject("Style","Select style object for center and viewer point symbols:", styleFilename$, styleObjectname$); string viewer$; viewer$ = "VIEWER"; string center$; center$ = "CENTER"; ######## Create display group with 2d and 3d views print("START"); # Size of squared 2D view and 3D view # Should be evenly divisible by 8 numeric size; size = 400; # Zoom out factor for 2D view numeric zoomfactor; zoomfactor = 1.8; # Create group print("Creating Group"); class GRE_GROUP group; group = GroupCreate(); # Create flags to create view without iconbar, scrollbars, status line and scale/position line # This is important to maintain fixed window size for movie generation string flags$; flags$ = "NoScalePosLine,NoIconBar,NoScrollbars,NoStatusLine"; # Create dialog and 2D view print("Creating dialog and 2D view"); class XmForm dialog2d; class GRE_VIEW view2d; dialog2d = CreateFormDialog("VIEW 2D"); view2d = GroupCreateView(group,dialog2d,"",size,size,flags$); view2d.BackgroundColor.red = 67; view2d.BackgroundColor.green = 100; view2d.BackgroundColor.blue = 100; # Create dialog and 3D view print("Creating dialog and 3D view"); class XmForm dialog3d; class GRE_VIEW3D view3d; dialog3d = CreateFormDialog("VIEW 3D"); view3d = GroupCreate3DView(group,dialog3d,"",size,size,flags$); view3d.BackgroundColor.red = 67; view3d.BackgroundColor.green = 100; view3d.BackgroundColor.blue = 100; # Add layers to group GroupQuickAddRasterVar(group,Surface,1); GroupQuickAddRasterVar(group,RastDrape,0); GroupQuickAddVectorVar(group,VectDrape); # Open both views DialogOpen(dialog2d); DialogOpen(dialog3d); # Full redraw of both views ViewRedrawFull(view2d); ViewRedrawFull(view3d); ViewZoomOut(view2d,zoomfactor,1); ####### Set up parameters for movie frame # Destination of each view in final frame for movie numeric x2d, y2d, x3d, y3d, w, h; x2d = 0; y2d = 0; x3d = size; y3d = 0; w = 2 * size; h = size; # Create text strings for annotation in frame string frameTitle$; string frameTitle2$; frameTitle$ = "Mount St. Helens Flow Hazard Zonation"; frameTitle2$ = "and Survey Station Locations"; # Font size numeric fontsize; fontsize = 16; # Define color for text annotation in frame class Color black; black.red = 0; black.green = 0; black.blue = 0; # Creating frame print("Creating frame for movie"); class Frame frame; frame = FrameCreate(w,h); # Create graphics context (GC) for frame print("Creating GC from frame and activate it"); ActivateGC(FrameCreateGC(frame)); DrawTextSetHeightPixels(fontsize); DrawUseStyleObject(styleFilename$,styleObjectname$); ######## Set some more movie parameters # Initiale Movie print("Initializing Movie"); class Movie movie; movie = MovieInit(); # Check framerate and force it to "MOVIE_FRAMERATE_24" if it is invalid numeric rate; rate = 24; if (framerate$ == "MOVIE_FRAMERATE_23_976") rate = 23.976; if (framerate$ == "MOVIE_FRAMERATE_25") rate = 25.0; if (framerate$ == "MOVIE_FRAMERATE_29_970") rate = 29.970; if (framerate$ == "MOVIE_FRAMERATE_30") rate = 30.0; if (framerate$ == "MOVIE_FRAMERATE_50") rate = 50.0; if (framerate$ == "MOVIE_FRAMERATE_59_940") rate = 59.940; if (framerate$ == "MOVIE_FRAMERATE_60") rate = 60.0; if (rate == 24.0) framerate$ = "MOVIE_FRAMERATE_24"; # Set Movie Parameters print("Setting Movie Parameters"); MovieSetFormat(movie,format$); MovieSetFrameRate(movie,framerate$); MovieSetFrameWidth(movie,w); MovieSetFrameHeight(movie,h); # Make Output File string ext$; ext$ = MovieGetFileExt(movie); string filename$; filename$ = GetOutputFileName("","Make filename for movie",ext$); printf("Filename = %s\n",filename$); # Check recording time if (time <= 1.0) time = 1.0; ##### Get georeference for surface layer and reset to group projection class Georef georef; georef = GetLastUsedGeorefObject(Surface); GeorefSetProjection(georef,group.Projection); # Find map coordinates and surface elevation at center of group # and define as view point (center) class POINT3D center; center.x = group.Center.x; center.y = group.Center.y; numeric objx; numeric objy; MapToObject(georef,center.x,center.y,Surface,objx,objy); center.z = Surface[objy,objx]; ##### Set up viewpoint and viewer position parameters class VIEWPOINT3D vp; vp = view3d.ViewPoint; vp.SetCenter(center); class POINT3D pt; # viewer position class POINT2D point; # 2D point for location symbols # Set initial viewer position north of center just beyond group extents # and 10000 m higher than center point pt.x = group.Center.x; pt.y = group.Extents.y2 + 0.6 * (group.Extents.y2 - group.Center.y); pt.z = center.z + 10000; vp.SetViewerPosition(pt); # Calculate spiral orbit parameters numeric numFrames = time * rate; numeric deltaAngle = -360.0 / numFrames * 2; numeric tx = vp.ViewPos.x - vp.CenterPoint.x; numeric ty = vp.ViewPos.y - vp.CenterPoint.y; numeric distance = 4 * sqrt(tx * tx + ty * ty) / 5 / numFrames * 2; numeric height = (vp.ViewPos.z - vp.CenterPoint.z) / numFrames * 2; ###### Start recording movie to file MovieStart(movie,filename$); # Loop for each frame numeric i, azimuth; for i = 1 to numFrames { SetStatusMessage(sprintf("Processing frame %d of %d",i,numFrames)); # Rotate viewer position around center with deltaAngle increment vp.RotateViewerPosition(deltaAngle); if (i <= numFrames / 2) { # Move viewer position closer and higher to center point azimuth = vp.AzimAngle * 180 / PI; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,90,height,"m"); } else { # Move viewer position farther and lower from center point azimuth = vp.AzimAngle * 180 / PI + 180; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,-90,height,"m"); } # ViewRedrawDirect(view3d,"NoBlankScreen"); # This new function added after release of TNTmips 6.5 # can redraw the view without blanking it first. Use of # this function eliminates "flashing" of the view as the # movie is initially rendered. It has no effect on the # output movie file. For 6.5 release version, use the # function in the next statement. ViewRedraw(view3d); # Copy 2d view and 3d view to destination frame FrameCopyFromView(frame,view2d,0,0,size,size,x2d,y2d); FrameCopyFromView(frame,view3d,0,0,size,size,x3d,y3d); # Draw center point in 2d view point.x = vp.CenterPoint.x; point.y = vp.CenterPoint.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(center$); DrawPoint(point.x,point.y); # Draw viewer position point in 2d view point.x = vp.ViewPos.x; point.y = vp.ViewPos.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(viewer$); DrawPoint(point.x,point.y); # Draw text to top of frame DrawTextSetColors(black); DrawTextSimple(frameTitle$,5,fontsize); DrawTextSimple(frameTitle2$,5,2.2*fontsize); # Add frame to movie MovieAddFrame(movie,frame); } # End of main processing loop # Stop and Exit movie MovieStop(movie); MovieExit(movie); # Close dialogs DialogClose(dialog2d); DialogClose(dialog3d); print("END");
MovieSetFrameWidth
Set movie frame width
MovieSetFrameWidth(movie, width)
場所:
ムービー
パラメータ:
class MOVIE movie
A valid movie handle
numeric width
Value to be set as current frame width
詳細と仮定
The width setting should be divisible by 4 for AVI movie format
戻り値
なし
作成日時: 02-Apr-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
###################### # # ORBITSP.SML # # Demonstration of movie generation from 3D display using spiral # orbit path. Both 2D and 3D views are copied into each movie frame. # # View center is fixed at center of group. Viewer position is computed # from size of group. Two complete orbits are made. The first starts # beyond the edge of group and spirals inward and downward; the second # spirals outward and upward. # # Script uses an input DEM for the surface layer, an input raster drape # layer, and an input vector drape layer. # # Requires TNTmips Version 6.5 # ##################### clear(); #### Set movie format, frame rate, and recording time # Movie format (Possible values : "MPEG"(All platform) or "AVI"(Windows only) string format$; format$ = "AVI"; # Frame rate # Possible values : # "MOVIE_FRAMERATE_23_976" 23.976 (24000/1001) fps - NTSC encapsulated film rate # "MOVIE_FRAMERATE_24" 24 fps - Standard international cinema film rate # "MOVIE_FRAMERATE_25" 25 fps - PAL (625/50) video frame rate # "MOVIE_FRAMERATE_29_970" 29.97 (30000/1001) fps - NTSC video frame rate # "MOVIE_FRAMERATE_30" 30 fps - NTSC drop-frame (525/60) video frame rate # "MOVIE_FRAMERATE_50" 50 fps - Double frame rate / progressive PAL # "MOVIE_FRAMERATE_59_940" 59.94 (60000/1001) fps - Double frame rate NTSC # "MOVIE_FRAMERATE_60" 60 fps - Double frame rate drop-frame NTSC string framerate$; framerate$ = "MOVIE_FRAMERATE_24"; # Recording time numeric time; time = 60; ###### Get RVC objects to load raster Surface, RastDrape; vector VectDrape; print("Select raster to use for surface"); GetInputRaster(Surface); print("Select raster to use for first drape layer"); GetInputRaster(RastDrape); print("Select vector to use for second drape layer"); GetInputVector(VectDrape); ###### RVC style object to draw center point and viewer point string styleFilename$; string styleObjectname$; GetInputObject("Style","Select style object for center and viewer point symbols:", styleFilename$, styleObjectname$); string viewer$; viewer$ = "VIEWER"; string center$; center$ = "CENTER"; ######## Create display group with 2d and 3d views print("START"); # Size of squared 2D view and 3D view # Should be evenly divisible by 8 numeric size; size = 400; # Zoom out factor for 2D view numeric zoomfactor; zoomfactor = 1.8; # Create group print("Creating Group"); class GRE_GROUP group; group = GroupCreate(); # Create flags to create view without iconbar, scrollbars, status line and scale/position line # This is important to maintain fixed window size for movie generation string flags$; flags$ = "NoScalePosLine,NoIconBar,NoScrollbars,NoStatusLine"; # Create dialog and 2D view print("Creating dialog and 2D view"); class XmForm dialog2d; class GRE_VIEW view2d; dialog2d = CreateFormDialog("VIEW 2D"); view2d = GroupCreateView(group,dialog2d,"",size,size,flags$); view2d.BackgroundColor.red = 67; view2d.BackgroundColor.green = 100; view2d.BackgroundColor.blue = 100; # Create dialog and 3D view print("Creating dialog and 3D view"); class XmForm dialog3d; class GRE_VIEW3D view3d; dialog3d = CreateFormDialog("VIEW 3D"); view3d = GroupCreate3DView(group,dialog3d,"",size,size,flags$); view3d.BackgroundColor.red = 67; view3d.BackgroundColor.green = 100; view3d.BackgroundColor.blue = 100; # Add layers to group GroupQuickAddRasterVar(group,Surface,1); GroupQuickAddRasterVar(group,RastDrape,0); GroupQuickAddVectorVar(group,VectDrape); # Open both views DialogOpen(dialog2d); DialogOpen(dialog3d); # Full redraw of both views ViewRedrawFull(view2d); ViewRedrawFull(view3d); ViewZoomOut(view2d,zoomfactor,1); ####### Set up parameters for movie frame # Destination of each view in final frame for movie numeric x2d, y2d, x3d, y3d, w, h; x2d = 0; y2d = 0; x3d = size; y3d = 0; w = 2 * size; h = size; # Create text strings for annotation in frame string frameTitle$; string frameTitle2$; frameTitle$ = "Mount St. Helens Flow Hazard Zonation"; frameTitle2$ = "and Survey Station Locations"; # Font size numeric fontsize; fontsize = 16; # Define color for text annotation in frame class Color black; black.red = 0; black.green = 0; black.blue = 0; # Creating frame print("Creating frame for movie"); class Frame frame; frame = FrameCreate(w,h); # Create graphics context (GC) for frame print("Creating GC from frame and activate it"); ActivateGC(FrameCreateGC(frame)); DrawTextSetHeightPixels(fontsize); DrawUseStyleObject(styleFilename$,styleObjectname$); ######## Set some more movie parameters # Initiale Movie print("Initializing Movie"); class Movie movie; movie = MovieInit(); # Check framerate and force it to "MOVIE_FRAMERATE_24" if it is invalid numeric rate; rate = 24; if (framerate$ == "MOVIE_FRAMERATE_23_976") rate = 23.976; if (framerate$ == "MOVIE_FRAMERATE_25") rate = 25.0; if (framerate$ == "MOVIE_FRAMERATE_29_970") rate = 29.970; if (framerate$ == "MOVIE_FRAMERATE_30") rate = 30.0; if (framerate$ == "MOVIE_FRAMERATE_50") rate = 50.0; if (framerate$ == "MOVIE_FRAMERATE_59_940") rate = 59.940; if (framerate$ == "MOVIE_FRAMERATE_60") rate = 60.0; if (rate == 24.0) framerate$ = "MOVIE_FRAMERATE_24"; # Set Movie Parameters print("Setting Movie Parameters"); MovieSetFormat(movie,format$); MovieSetFrameRate(movie,framerate$); MovieSetFrameWidth(movie,w); MovieSetFrameHeight(movie,h); # Make Output File string ext$; ext$ = MovieGetFileExt(movie); string filename$; filename$ = GetOutputFileName("","Make filename for movie",ext$); printf("Filename = %s\n",filename$); # Check recording time if (time <= 1.0) time = 1.0; ##### Get georeference for surface layer and reset to group projection class Georef georef; georef = GetLastUsedGeorefObject(Surface); GeorefSetProjection(georef,group.Projection); # Find map coordinates and surface elevation at center of group # and define as view point (center) class POINT3D center; center.x = group.Center.x; center.y = group.Center.y; numeric objx; numeric objy; MapToObject(georef,center.x,center.y,Surface,objx,objy); center.z = Surface[objy,objx]; ##### Set up viewpoint and viewer position parameters class VIEWPOINT3D vp; vp = view3d.ViewPoint; vp.SetCenter(center); class POINT3D pt; # viewer position class POINT2D point; # 2D point for location symbols # Set initial viewer position north of center just beyond group extents # and 10000 m higher than center point pt.x = group.Center.x; pt.y = group.Extents.y2 + 0.6 * (group.Extents.y2 - group.Center.y); pt.z = center.z + 10000; vp.SetViewerPosition(pt); # Calculate spiral orbit parameters numeric numFrames = time * rate; numeric deltaAngle = -360.0 / numFrames * 2; numeric tx = vp.ViewPos.x - vp.CenterPoint.x; numeric ty = vp.ViewPos.y - vp.CenterPoint.y; numeric distance = 4 * sqrt(tx * tx + ty * ty) / 5 / numFrames * 2; numeric height = (vp.ViewPos.z - vp.CenterPoint.z) / numFrames * 2; ###### Start recording movie to file MovieStart(movie,filename$); # Loop for each frame numeric i, azimuth; for i = 1 to numFrames { SetStatusMessage(sprintf("Processing frame %d of %d",i,numFrames)); # Rotate viewer position around center with deltaAngle increment vp.RotateViewerPosition(deltaAngle); if (i <= numFrames / 2) { # Move viewer position closer and higher to center point azimuth = vp.AzimAngle * 180 / PI; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,90,height,"m"); } else { # Move viewer position farther and lower from center point azimuth = vp.AzimAngle * 180 / PI + 180; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,-90,height,"m"); } # ViewRedrawDirect(view3d,"NoBlankScreen"); # This new function added after release of TNTmips 6.5 # can redraw the view without blanking it first. Use of # this function eliminates "flashing" of the view as the # movie is initially rendered. It has no effect on the # output movie file. For 6.5 release version, use the # function in the next statement. ViewRedraw(view3d); # Copy 2d view and 3d view to destination frame FrameCopyFromView(frame,view2d,0,0,size,size,x2d,y2d); FrameCopyFromView(frame,view3d,0,0,size,size,x3d,y3d); # Draw center point in 2d view point.x = vp.CenterPoint.x; point.y = vp.CenterPoint.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(center$); DrawPoint(point.x,point.y); # Draw viewer position point in 2d view point.x = vp.ViewPos.x; point.y = vp.ViewPos.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(viewer$); DrawPoint(point.x,point.y); # Draw text to top of frame DrawTextSetColors(black); DrawTextSimple(frameTitle$,5,fontsize); DrawTextSimple(frameTitle2$,5,2.2*fontsize); # Add frame to movie MovieAddFrame(movie,frame); } # End of main processing loop # Stop and Exit movie MovieStop(movie); MovieExit(movie); # Close dialogs DialogClose(dialog2d); DialogClose(dialog3d); print("END");
MovieStart
Start movie
MovieStart(movie, filename$)
場所:
ムービー
パラメータ:
class MOVIE movie
A valid movie handle
string filename$
Movie filename
戻り値
なし
作成日時: 02-Apr-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
###################### # # ORBITSP.SML # # Demonstration of movie generation from 3D display using spiral # orbit path. Both 2D and 3D views are copied into each movie frame. # # View center is fixed at center of group. Viewer position is computed # from size of group. Two complete orbits are made. The first starts # beyond the edge of group and spirals inward and downward; the second # spirals outward and upward. # # Script uses an input DEM for the surface layer, an input raster drape # layer, and an input vector drape layer. # # Requires TNTmips Version 6.5 # ##################### clear(); #### Set movie format, frame rate, and recording time # Movie format (Possible values : "MPEG"(All platform) or "AVI"(Windows only) string format$; format$ = "AVI"; # Frame rate # Possible values : # "MOVIE_FRAMERATE_23_976" 23.976 (24000/1001) fps - NTSC encapsulated film rate # "MOVIE_FRAMERATE_24" 24 fps - Standard international cinema film rate # "MOVIE_FRAMERATE_25" 25 fps - PAL (625/50) video frame rate # "MOVIE_FRAMERATE_29_970" 29.97 (30000/1001) fps - NTSC video frame rate # "MOVIE_FRAMERATE_30" 30 fps - NTSC drop-frame (525/60) video frame rate # "MOVIE_FRAMERATE_50" 50 fps - Double frame rate / progressive PAL # "MOVIE_FRAMERATE_59_940" 59.94 (60000/1001) fps - Double frame rate NTSC # "MOVIE_FRAMERATE_60" 60 fps - Double frame rate drop-frame NTSC string framerate$; framerate$ = "MOVIE_FRAMERATE_24"; # Recording time numeric time; time = 60; ###### Get RVC objects to load raster Surface, RastDrape; vector VectDrape; print("Select raster to use for surface"); GetInputRaster(Surface); print("Select raster to use for first drape layer"); GetInputRaster(RastDrape); print("Select vector to use for second drape layer"); GetInputVector(VectDrape); ###### RVC style object to draw center point and viewer point string styleFilename$; string styleObjectname$; GetInputObject("Style","Select style object for center and viewer point symbols:", styleFilename$, styleObjectname$); string viewer$; viewer$ = "VIEWER"; string center$; center$ = "CENTER"; ######## Create display group with 2d and 3d views print("START"); # Size of squared 2D view and 3D view # Should be evenly divisible by 8 numeric size; size = 400; # Zoom out factor for 2D view numeric zoomfactor; zoomfactor = 1.8; # Create group print("Creating Group"); class GRE_GROUP group; group = GroupCreate(); # Create flags to create view without iconbar, scrollbars, status line and scale/position line # This is important to maintain fixed window size for movie generation string flags$; flags$ = "NoScalePosLine,NoIconBar,NoScrollbars,NoStatusLine"; # Create dialog and 2D view print("Creating dialog and 2D view"); class XmForm dialog2d; class GRE_VIEW view2d; dialog2d = CreateFormDialog("VIEW 2D"); view2d = GroupCreateView(group,dialog2d,"",size,size,flags$); view2d.BackgroundColor.red = 67; view2d.BackgroundColor.green = 100; view2d.BackgroundColor.blue = 100; # Create dialog and 3D view print("Creating dialog and 3D view"); class XmForm dialog3d; class GRE_VIEW3D view3d; dialog3d = CreateFormDialog("VIEW 3D"); view3d = GroupCreate3DView(group,dialog3d,"",size,size,flags$); view3d.BackgroundColor.red = 67; view3d.BackgroundColor.green = 100; view3d.BackgroundColor.blue = 100; # Add layers to group GroupQuickAddRasterVar(group,Surface,1); GroupQuickAddRasterVar(group,RastDrape,0); GroupQuickAddVectorVar(group,VectDrape); # Open both views DialogOpen(dialog2d); DialogOpen(dialog3d); # Full redraw of both views ViewRedrawFull(view2d); ViewRedrawFull(view3d); ViewZoomOut(view2d,zoomfactor,1); ####### Set up parameters for movie frame # Destination of each view in final frame for movie numeric x2d, y2d, x3d, y3d, w, h; x2d = 0; y2d = 0; x3d = size; y3d = 0; w = 2 * size; h = size; # Create text strings for annotation in frame string frameTitle$; string frameTitle2$; frameTitle$ = "Mount St. Helens Flow Hazard Zonation"; frameTitle2$ = "and Survey Station Locations"; # Font size numeric fontsize; fontsize = 16; # Define color for text annotation in frame class Color black; black.red = 0; black.green = 0; black.blue = 0; # Creating frame print("Creating frame for movie"); class Frame frame; frame = FrameCreate(w,h); # Create graphics context (GC) for frame print("Creating GC from frame and activate it"); ActivateGC(FrameCreateGC(frame)); DrawTextSetHeightPixels(fontsize); DrawUseStyleObject(styleFilename$,styleObjectname$); ######## Set some more movie parameters # Initiale Movie print("Initializing Movie"); class Movie movie; movie = MovieInit(); # Check framerate and force it to "MOVIE_FRAMERATE_24" if it is invalid numeric rate; rate = 24; if (framerate$ == "MOVIE_FRAMERATE_23_976") rate = 23.976; if (framerate$ == "MOVIE_FRAMERATE_25") rate = 25.0; if (framerate$ == "MOVIE_FRAMERATE_29_970") rate = 29.970; if (framerate$ == "MOVIE_FRAMERATE_30") rate = 30.0; if (framerate$ == "MOVIE_FRAMERATE_50") rate = 50.0; if (framerate$ == "MOVIE_FRAMERATE_59_940") rate = 59.940; if (framerate$ == "MOVIE_FRAMERATE_60") rate = 60.0; if (rate == 24.0) framerate$ = "MOVIE_FRAMERATE_24"; # Set Movie Parameters print("Setting Movie Parameters"); MovieSetFormat(movie,format$); MovieSetFrameRate(movie,framerate$); MovieSetFrameWidth(movie,w); MovieSetFrameHeight(movie,h); # Make Output File string ext$; ext$ = MovieGetFileExt(movie); string filename$; filename$ = GetOutputFileName("","Make filename for movie",ext$); printf("Filename = %s\n",filename$); # Check recording time if (time <= 1.0) time = 1.0; ##### Get georeference for surface layer and reset to group projection class Georef georef; georef = GetLastUsedGeorefObject(Surface); GeorefSetProjection(georef,group.Projection); # Find map coordinates and surface elevation at center of group # and define as view point (center) class POINT3D center; center.x = group.Center.x; center.y = group.Center.y; numeric objx; numeric objy; MapToObject(georef,center.x,center.y,Surface,objx,objy); center.z = Surface[objy,objx]; ##### Set up viewpoint and viewer position parameters class VIEWPOINT3D vp; vp = view3d.ViewPoint; vp.SetCenter(center); class POINT3D pt; # viewer position class POINT2D point; # 2D point for location symbols # Set initial viewer position north of center just beyond group extents # and 10000 m higher than center point pt.x = group.Center.x; pt.y = group.Extents.y2 + 0.6 * (group.Extents.y2 - group.Center.y); pt.z = center.z + 10000; vp.SetViewerPosition(pt); # Calculate spiral orbit parameters numeric numFrames = time * rate; numeric deltaAngle = -360.0 / numFrames * 2; numeric tx = vp.ViewPos.x - vp.CenterPoint.x; numeric ty = vp.ViewPos.y - vp.CenterPoint.y; numeric distance = 4 * sqrt(tx * tx + ty * ty) / 5 / numFrames * 2; numeric height = (vp.ViewPos.z - vp.CenterPoint.z) / numFrames * 2; ###### Start recording movie to file MovieStart(movie,filename$); # Loop for each frame numeric i, azimuth; for i = 1 to numFrames { SetStatusMessage(sprintf("Processing frame %d of %d",i,numFrames)); # Rotate viewer position around center with deltaAngle increment vp.RotateViewerPosition(deltaAngle); if (i <= numFrames / 2) { # Move viewer position closer and higher to center point azimuth = vp.AzimAngle * 180 / PI; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,90,height,"m"); } else { # Move viewer position farther and lower from center point azimuth = vp.AzimAngle * 180 / PI + 180; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,-90,height,"m"); } # ViewRedrawDirect(view3d,"NoBlankScreen"); # This new function added after release of TNTmips 6.5 # can redraw the view without blanking it first. Use of # this function eliminates "flashing" of the view as the # movie is initially rendered. It has no effect on the # output movie file. For 6.5 release version, use the # function in the next statement. ViewRedraw(view3d); # Copy 2d view and 3d view to destination frame FrameCopyFromView(frame,view2d,0,0,size,size,x2d,y2d); FrameCopyFromView(frame,view3d,0,0,size,size,x3d,y3d); # Draw center point in 2d view point.x = vp.CenterPoint.x; point.y = vp.CenterPoint.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(center$); DrawPoint(point.x,point.y); # Draw viewer position point in 2d view point.x = vp.ViewPos.x; point.y = vp.ViewPos.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(viewer$); DrawPoint(point.x,point.y); # Draw text to top of frame DrawTextSetColors(black); DrawTextSimple(frameTitle$,5,fontsize); DrawTextSimple(frameTitle2$,5,2.2*fontsize); # Add frame to movie MovieAddFrame(movie,frame); } # End of main processing loop # Stop and Exit movie MovieStop(movie); MovieExit(movie); # Close dialogs DialogClose(dialog2d); DialogClose(dialog3d); print("END");
MovieStop
Stop movie
MovieStop(movie)
場所:
ムービー
パラメータ:
class MOVIE movie
A valid movie handle
戻り値
なし
作成日時: 02-Apr-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
###################### # # ORBITSP.SML # # Demonstration of movie generation from 3D display using spiral # orbit path. Both 2D and 3D views are copied into each movie frame. # # View center is fixed at center of group. Viewer position is computed # from size of group. Two complete orbits are made. The first starts # beyond the edge of group and spirals inward and downward; the second # spirals outward and upward. # # Script uses an input DEM for the surface layer, an input raster drape # layer, and an input vector drape layer. # # Requires TNTmips Version 6.5 # ##################### clear(); #### Set movie format, frame rate, and recording time # Movie format (Possible values : "MPEG"(All platform) or "AVI"(Windows only) string format$; format$ = "AVI"; # Frame rate # Possible values : # "MOVIE_FRAMERATE_23_976" 23.976 (24000/1001) fps - NTSC encapsulated film rate # "MOVIE_FRAMERATE_24" 24 fps - Standard international cinema film rate # "MOVIE_FRAMERATE_25" 25 fps - PAL (625/50) video frame rate # "MOVIE_FRAMERATE_29_970" 29.97 (30000/1001) fps - NTSC video frame rate # "MOVIE_FRAMERATE_30" 30 fps - NTSC drop-frame (525/60) video frame rate # "MOVIE_FRAMERATE_50" 50 fps - Double frame rate / progressive PAL # "MOVIE_FRAMERATE_59_940" 59.94 (60000/1001) fps - Double frame rate NTSC # "MOVIE_FRAMERATE_60" 60 fps - Double frame rate drop-frame NTSC string framerate$; framerate$ = "MOVIE_FRAMERATE_24"; # Recording time numeric time; time = 60; ###### Get RVC objects to load raster Surface, RastDrape; vector VectDrape; print("Select raster to use for surface"); GetInputRaster(Surface); print("Select raster to use for first drape layer"); GetInputRaster(RastDrape); print("Select vector to use for second drape layer"); GetInputVector(VectDrape); ###### RVC style object to draw center point and viewer point string styleFilename$; string styleObjectname$; GetInputObject("Style","Select style object for center and viewer point symbols:", styleFilename$, styleObjectname$); string viewer$; viewer$ = "VIEWER"; string center$; center$ = "CENTER"; ######## Create display group with 2d and 3d views print("START"); # Size of squared 2D view and 3D view # Should be evenly divisible by 8 numeric size; size = 400; # Zoom out factor for 2D view numeric zoomfactor; zoomfactor = 1.8; # Create group print("Creating Group"); class GRE_GROUP group; group = GroupCreate(); # Create flags to create view without iconbar, scrollbars, status line and scale/position line # This is important to maintain fixed window size for movie generation string flags$; flags$ = "NoScalePosLine,NoIconBar,NoScrollbars,NoStatusLine"; # Create dialog and 2D view print("Creating dialog and 2D view"); class XmForm dialog2d; class GRE_VIEW view2d; dialog2d = CreateFormDialog("VIEW 2D"); view2d = GroupCreateView(group,dialog2d,"",size,size,flags$); view2d.BackgroundColor.red = 67; view2d.BackgroundColor.green = 100; view2d.BackgroundColor.blue = 100; # Create dialog and 3D view print("Creating dialog and 3D view"); class XmForm dialog3d; class GRE_VIEW3D view3d; dialog3d = CreateFormDialog("VIEW 3D"); view3d = GroupCreate3DView(group,dialog3d,"",size,size,flags$); view3d.BackgroundColor.red = 67; view3d.BackgroundColor.green = 100; view3d.BackgroundColor.blue = 100; # Add layers to group GroupQuickAddRasterVar(group,Surface,1); GroupQuickAddRasterVar(group,RastDrape,0); GroupQuickAddVectorVar(group,VectDrape); # Open both views DialogOpen(dialog2d); DialogOpen(dialog3d); # Full redraw of both views ViewRedrawFull(view2d); ViewRedrawFull(view3d); ViewZoomOut(view2d,zoomfactor,1); ####### Set up parameters for movie frame # Destination of each view in final frame for movie numeric x2d, y2d, x3d, y3d, w, h; x2d = 0; y2d = 0; x3d = size; y3d = 0; w = 2 * size; h = size; # Create text strings for annotation in frame string frameTitle$; string frameTitle2$; frameTitle$ = "Mount St. Helens Flow Hazard Zonation"; frameTitle2$ = "and Survey Station Locations"; # Font size numeric fontsize; fontsize = 16; # Define color for text annotation in frame class Color black; black.red = 0; black.green = 0; black.blue = 0; # Creating frame print("Creating frame for movie"); class Frame frame; frame = FrameCreate(w,h); # Create graphics context (GC) for frame print("Creating GC from frame and activate it"); ActivateGC(FrameCreateGC(frame)); DrawTextSetHeightPixels(fontsize); DrawUseStyleObject(styleFilename$,styleObjectname$); ######## Set some more movie parameters # Initiale Movie print("Initializing Movie"); class Movie movie; movie = MovieInit(); # Check framerate and force it to "MOVIE_FRAMERATE_24" if it is invalid numeric rate; rate = 24; if (framerate$ == "MOVIE_FRAMERATE_23_976") rate = 23.976; if (framerate$ == "MOVIE_FRAMERATE_25") rate = 25.0; if (framerate$ == "MOVIE_FRAMERATE_29_970") rate = 29.970; if (framerate$ == "MOVIE_FRAMERATE_30") rate = 30.0; if (framerate$ == "MOVIE_FRAMERATE_50") rate = 50.0; if (framerate$ == "MOVIE_FRAMERATE_59_940") rate = 59.940; if (framerate$ == "MOVIE_FRAMERATE_60") rate = 60.0; if (rate == 24.0) framerate$ = "MOVIE_FRAMERATE_24"; # Set Movie Parameters print("Setting Movie Parameters"); MovieSetFormat(movie,format$); MovieSetFrameRate(movie,framerate$); MovieSetFrameWidth(movie,w); MovieSetFrameHeight(movie,h); # Make Output File string ext$; ext$ = MovieGetFileExt(movie); string filename$; filename$ = GetOutputFileName("","Make filename for movie",ext$); printf("Filename = %s\n",filename$); # Check recording time if (time <= 1.0) time = 1.0; ##### Get georeference for surface layer and reset to group projection class Georef georef; georef = GetLastUsedGeorefObject(Surface); GeorefSetProjection(georef,group.Projection); # Find map coordinates and surface elevation at center of group # and define as view point (center) class POINT3D center; center.x = group.Center.x; center.y = group.Center.y; numeric objx; numeric objy; MapToObject(georef,center.x,center.y,Surface,objx,objy); center.z = Surface[objy,objx]; ##### Set up viewpoint and viewer position parameters class VIEWPOINT3D vp; vp = view3d.ViewPoint; vp.SetCenter(center); class POINT3D pt; # viewer position class POINT2D point; # 2D point for location symbols # Set initial viewer position north of center just beyond group extents # and 10000 m higher than center point pt.x = group.Center.x; pt.y = group.Extents.y2 + 0.6 * (group.Extents.y2 - group.Center.y); pt.z = center.z + 10000; vp.SetViewerPosition(pt); # Calculate spiral orbit parameters numeric numFrames = time * rate; numeric deltaAngle = -360.0 / numFrames * 2; numeric tx = vp.ViewPos.x - vp.CenterPoint.x; numeric ty = vp.ViewPos.y - vp.CenterPoint.y; numeric distance = 4 * sqrt(tx * tx + ty * ty) / 5 / numFrames * 2; numeric height = (vp.ViewPos.z - vp.CenterPoint.z) / numFrames * 2; ###### Start recording movie to file MovieStart(movie,filename$); # Loop for each frame numeric i, azimuth; for i = 1 to numFrames { SetStatusMessage(sprintf("Processing frame %d of %d",i,numFrames)); # Rotate viewer position around center with deltaAngle increment vp.RotateViewerPosition(deltaAngle); if (i <= numFrames / 2) { # Move viewer position closer and higher to center point azimuth = vp.AzimAngle * 180 / PI; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,90,height,"m"); } else { # Move viewer position farther and lower from center point azimuth = vp.AzimAngle * 180 / PI + 180; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,-90,height,"m"); } # ViewRedrawDirect(view3d,"NoBlankScreen"); # This new function added after release of TNTmips 6.5 # can redraw the view without blanking it first. Use of # this function eliminates "flashing" of the view as the # movie is initially rendered. It has no effect on the # output movie file. For 6.5 release version, use the # function in the next statement. ViewRedraw(view3d); # Copy 2d view and 3d view to destination frame FrameCopyFromView(frame,view2d,0,0,size,size,x2d,y2d); FrameCopyFromView(frame,view3d,0,0,size,size,x3d,y3d); # Draw center point in 2d view point.x = vp.CenterPoint.x; point.y = vp.CenterPoint.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(center$); DrawPoint(point.x,point.y); # Draw viewer position point in 2d view point.x = vp.ViewPos.x; point.y = vp.ViewPos.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(viewer$); DrawPoint(point.x,point.y); # Draw text to top of frame DrawTextSetColors(black); DrawTextSimple(frameTitle$,5,fontsize); DrawTextSimple(frameTitle2$,5,2.2*fontsize); # Add frame to movie MovieAddFrame(movie,frame); } # End of main processing loop # Stop and Exit movie MovieStop(movie); MovieExit(movie); # Close dialogs DialogClose(dialog2d); DialogClose(dialog3d); print("END");
ViewActivateTool
Activate a given tool.
ViewActivateTool(view, tool)
場所:
空間データ表示ウィンドウ
パラメータ:
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
Unable to locate sample script "smlsamples/StandAlone/PTCOORD.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ViewAddStandardTools
Add "standard" tools to a view.
ViewAddStandardTools(view)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view to add "standard" tools to
詳細と仮定
After adding all the tools you want to the view, you have to call ViewAddToolIcons() to get
the icon buttons to actually show up.
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
Unable to locate sample script "smlsamples/StandAlone/biomass.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ViewAddToolIcons
Create icons for tools added.
ViewAddToolIcons(view, addscripts)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view to add icons to
numeric addscripts (オプション)
For tool/macro script icons (0 or 1)
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
Unable to locate sample script "smlsamples/StandAlone/PTCOORD.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ViewDestroy
Destroy a view.
ViewDestroy(view)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view to destroy
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/biomass.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ViewGetMapScale
Get the current map scale of a view.
ViewGetMapScale(view)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view to get map scale for
戻り値
numeric
the map scale of the specified view
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/ToolScript/STREET.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ViewGetTransLayerToScreen
Get transformation from layer to screen.
ViewGetTransLayerToScreen(view, layer, inverse)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view
class GRE_LAYER layer
The layer
numeric inverse (オプション)
Create inverse transform
戻り値
class TRANSPARM
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/ToolScript/Rastprof.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ViewGetTransLayerToView
Get transformation from layer to screen.
ViewGetTransLayerToView(view, layer, inverse)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view
class GRE_LAYER layer
The layer
numeric inverse (オプション)
Create inverse transform
戻り値
class TRANSPARM
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/PTCOORD.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ViewGetTransMapToView
Get the transparm to translate between a map projection and view coordinates
ViewGetTransMapToView(view, projection, inverse)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view
class SR_COORDREFSYS projection
The map projection
numeric inverse (オプション)
If true, return the ViewToMap trans instead
戻り値
class TRANSPARM
作成日時: 28-Jul-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/PTCOORD.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ViewGetTransViewToScreen
Get transformation from view to screen.
ViewGetTransViewToScreen(view, inverse)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view
numeric inverse (オプション)
Create inverse transform
戻り値
class TRANSPARM
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/PTCOORD.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ViewRedraw
Redraw view.
ViewRedraw(view, noUpdateBetweenLayers)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view to redraw
numeric noUpdateBetweenLayers (オプション)
If non-zero, don't refresh display between each layer
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
###################### # # ORBITSP.SML # # Demonstration of movie generation from 3D display using spiral # orbit path. Both 2D and 3D views are copied into each movie frame. # # View center is fixed at center of group. Viewer position is computed # from size of group. Two complete orbits are made. The first starts # beyond the edge of group and spirals inward and downward; the second # spirals outward and upward. # # Script uses an input DEM for the surface layer, an input raster drape # layer, and an input vector drape layer. # # Requires TNTmips Version 6.5 # ##################### clear(); #### Set movie format, frame rate, and recording time # Movie format (Possible values : "MPEG"(All platform) or "AVI"(Windows only) string format$; format$ = "AVI"; # Frame rate # Possible values : # "MOVIE_FRAMERATE_23_976" 23.976 (24000/1001) fps - NTSC encapsulated film rate # "MOVIE_FRAMERATE_24" 24 fps - Standard international cinema film rate # "MOVIE_FRAMERATE_25" 25 fps - PAL (625/50) video frame rate # "MOVIE_FRAMERATE_29_970" 29.97 (30000/1001) fps - NTSC video frame rate # "MOVIE_FRAMERATE_30" 30 fps - NTSC drop-frame (525/60) video frame rate # "MOVIE_FRAMERATE_50" 50 fps - Double frame rate / progressive PAL # "MOVIE_FRAMERATE_59_940" 59.94 (60000/1001) fps - Double frame rate NTSC # "MOVIE_FRAMERATE_60" 60 fps - Double frame rate drop-frame NTSC string framerate$; framerate$ = "MOVIE_FRAMERATE_24"; # Recording time numeric time; time = 60; ###### Get RVC objects to load raster Surface, RastDrape; vector VectDrape; print("Select raster to use for surface"); GetInputRaster(Surface); print("Select raster to use for first drape layer"); GetInputRaster(RastDrape); print("Select vector to use for second drape layer"); GetInputVector(VectDrape); ###### RVC style object to draw center point and viewer point string styleFilename$; string styleObjectname$; GetInputObject("Style","Select style object for center and viewer point symbols:", styleFilename$, styleObjectname$); string viewer$; viewer$ = "VIEWER"; string center$; center$ = "CENTER"; ######## Create display group with 2d and 3d views print("START"); # Size of squared 2D view and 3D view # Should be evenly divisible by 8 numeric size; size = 400; # Zoom out factor for 2D view numeric zoomfactor; zoomfactor = 1.8; # Create group print("Creating Group"); class GRE_GROUP group; group = GroupCreate(); # Create flags to create view without iconbar, scrollbars, status line and scale/position line # This is important to maintain fixed window size for movie generation string flags$; flags$ = "NoScalePosLine,NoIconBar,NoScrollbars,NoStatusLine"; # Create dialog and 2D view print("Creating dialog and 2D view"); class XmForm dialog2d; class GRE_VIEW view2d; dialog2d = CreateFormDialog("VIEW 2D"); view2d = GroupCreateView(group,dialog2d,"",size,size,flags$); view2d.BackgroundColor.red = 67; view2d.BackgroundColor.green = 100; view2d.BackgroundColor.blue = 100; # Create dialog and 3D view print("Creating dialog and 3D view"); class XmForm dialog3d; class GRE_VIEW3D view3d; dialog3d = CreateFormDialog("VIEW 3D"); view3d = GroupCreate3DView(group,dialog3d,"",size,size,flags$); view3d.BackgroundColor.red = 67; view3d.BackgroundColor.green = 100; view3d.BackgroundColor.blue = 100; # Add layers to group GroupQuickAddRasterVar(group,Surface,1); GroupQuickAddRasterVar(group,RastDrape,0); GroupQuickAddVectorVar(group,VectDrape); # Open both views DialogOpen(dialog2d); DialogOpen(dialog3d); # Full redraw of both views ViewRedrawFull(view2d); ViewRedrawFull(view3d); ViewZoomOut(view2d,zoomfactor,1); ####### Set up parameters for movie frame # Destination of each view in final frame for movie numeric x2d, y2d, x3d, y3d, w, h; x2d = 0; y2d = 0; x3d = size; y3d = 0; w = 2 * size; h = size; # Create text strings for annotation in frame string frameTitle$; string frameTitle2$; frameTitle$ = "Mount St. Helens Flow Hazard Zonation"; frameTitle2$ = "and Survey Station Locations"; # Font size numeric fontsize; fontsize = 16; # Define color for text annotation in frame class Color black; black.red = 0; black.green = 0; black.blue = 0; # Creating frame print("Creating frame for movie"); class Frame frame; frame = FrameCreate(w,h); # Create graphics context (GC) for frame print("Creating GC from frame and activate it"); ActivateGC(FrameCreateGC(frame)); DrawTextSetHeightPixels(fontsize); DrawUseStyleObject(styleFilename$,styleObjectname$); ######## Set some more movie parameters # Initiale Movie print("Initializing Movie"); class Movie movie; movie = MovieInit(); # Check framerate and force it to "MOVIE_FRAMERATE_24" if it is invalid numeric rate; rate = 24; if (framerate$ == "MOVIE_FRAMERATE_23_976") rate = 23.976; if (framerate$ == "MOVIE_FRAMERATE_25") rate = 25.0; if (framerate$ == "MOVIE_FRAMERATE_29_970") rate = 29.970; if (framerate$ == "MOVIE_FRAMERATE_30") rate = 30.0; if (framerate$ == "MOVIE_FRAMERATE_50") rate = 50.0; if (framerate$ == "MOVIE_FRAMERATE_59_940") rate = 59.940; if (framerate$ == "MOVIE_FRAMERATE_60") rate = 60.0; if (rate == 24.0) framerate$ = "MOVIE_FRAMERATE_24"; # Set Movie Parameters print("Setting Movie Parameters"); MovieSetFormat(movie,format$); MovieSetFrameRate(movie,framerate$); MovieSetFrameWidth(movie,w); MovieSetFrameHeight(movie,h); # Make Output File string ext$; ext$ = MovieGetFileExt(movie); string filename$; filename$ = GetOutputFileName("","Make filename for movie",ext$); printf("Filename = %s\n",filename$); # Check recording time if (time <= 1.0) time = 1.0; ##### Get georeference for surface layer and reset to group projection class Georef georef; georef = GetLastUsedGeorefObject(Surface); GeorefSetProjection(georef,group.Projection); # Find map coordinates and surface elevation at center of group # and define as view point (center) class POINT3D center; center.x = group.Center.x; center.y = group.Center.y; numeric objx; numeric objy; MapToObject(georef,center.x,center.y,Surface,objx,objy); center.z = Surface[objy,objx]; ##### Set up viewpoint and viewer position parameters class VIEWPOINT3D vp; vp = view3d.ViewPoint; vp.SetCenter(center); class POINT3D pt; # viewer position class POINT2D point; # 2D point for location symbols # Set initial viewer position north of center just beyond group extents # and 10000 m higher than center point pt.x = group.Center.x; pt.y = group.Extents.y2 + 0.6 * (group.Extents.y2 - group.Center.y); pt.z = center.z + 10000; vp.SetViewerPosition(pt); # Calculate spiral orbit parameters numeric numFrames = time * rate; numeric deltaAngle = -360.0 / numFrames * 2; numeric tx = vp.ViewPos.x - vp.CenterPoint.x; numeric ty = vp.ViewPos.y - vp.CenterPoint.y; numeric distance = 4 * sqrt(tx * tx + ty * ty) / 5 / numFrames * 2; numeric height = (vp.ViewPos.z - vp.CenterPoint.z) / numFrames * 2; ###### Start recording movie to file MovieStart(movie,filename$); # Loop for each frame numeric i, azimuth; for i = 1 to numFrames { SetStatusMessage(sprintf("Processing frame %d of %d",i,numFrames)); # Rotate viewer position around center with deltaAngle increment vp.RotateViewerPosition(deltaAngle); if (i <= numFrames / 2) { # Move viewer position closer and higher to center point azimuth = vp.AzimAngle * 180 / PI; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,90,height,"m"); } else { # Move viewer position farther and lower from center point azimuth = vp.AzimAngle * 180 / PI + 180; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,-90,height,"m"); } # ViewRedrawDirect(view3d,"NoBlankScreen"); # This new function added after release of TNTmips 6.5 # can redraw the view without blanking it first. Use of # this function eliminates "flashing" of the view as the # movie is initially rendered. It has no effect on the # output movie file. For 6.5 release version, use the # function in the next statement. ViewRedraw(view3d); # Copy 2d view and 3d view to destination frame FrameCopyFromView(frame,view2d,0,0,size,size,x2d,y2d); FrameCopyFromView(frame,view3d,0,0,size,size,x3d,y3d); # Draw center point in 2d view point.x = vp.CenterPoint.x; point.y = vp.CenterPoint.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(center$); DrawPoint(point.x,point.y); # Draw viewer position point in 2d view point.x = vp.ViewPos.x; point.y = vp.ViewPos.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(viewer$); DrawPoint(point.x,point.y); # Draw text to top of frame DrawTextSetColors(black); DrawTextSimple(frameTitle$,5,fontsize); DrawTextSimple(frameTitle2$,5,2.2*fontsize); # Add frame to movie MovieAddFrame(movie,frame); } # End of main processing loop # Stop and Exit movie MovieStop(movie); MovieExit(movie); # Close dialogs DialogClose(dialog2d); DialogClose(dialog3d); print("END");
ViewRedrawDirect
Draw view direct with drawflags
ViewRedrawDirect(view, drawflags$)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
View handle
string drawflags$ (オプション)
Draw flags
可能性のある値:
"NoBlankScreen"
Don't clear screen before drawing
戻り値
なし
作成日時: 17-Apr-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
###################### # # ORBITSP.SML # # Demonstration of movie generation from 3D display using spiral # orbit path. Both 2D and 3D views are copied into each movie frame. # # View center is fixed at center of group. Viewer position is computed # from size of group. Two complete orbits are made. The first starts # beyond the edge of group and spirals inward and downward; the second # spirals outward and upward. # # Script uses an input DEM for the surface layer, an input raster drape # layer, and an input vector drape layer. # # Requires TNTmips Version 6.5 # ##################### clear(); #### Set movie format, frame rate, and recording time # Movie format (Possible values : "MPEG"(All platform) or "AVI"(Windows only) string format$; format$ = "AVI"; # Frame rate # Possible values : # "MOVIE_FRAMERATE_23_976" 23.976 (24000/1001) fps - NTSC encapsulated film rate # "MOVIE_FRAMERATE_24" 24 fps - Standard international cinema film rate # "MOVIE_FRAMERATE_25" 25 fps - PAL (625/50) video frame rate # "MOVIE_FRAMERATE_29_970" 29.97 (30000/1001) fps - NTSC video frame rate # "MOVIE_FRAMERATE_30" 30 fps - NTSC drop-frame (525/60) video frame rate # "MOVIE_FRAMERATE_50" 50 fps - Double frame rate / progressive PAL # "MOVIE_FRAMERATE_59_940" 59.94 (60000/1001) fps - Double frame rate NTSC # "MOVIE_FRAMERATE_60" 60 fps - Double frame rate drop-frame NTSC string framerate$; framerate$ = "MOVIE_FRAMERATE_24"; # Recording time numeric time; time = 60; ###### Get RVC objects to load raster Surface, RastDrape; vector VectDrape; print("Select raster to use for surface"); GetInputRaster(Surface); print("Select raster to use for first drape layer"); GetInputRaster(RastDrape); print("Select vector to use for second drape layer"); GetInputVector(VectDrape); ###### RVC style object to draw center point and viewer point string styleFilename$; string styleObjectname$; GetInputObject("Style","Select style object for center and viewer point symbols:", styleFilename$, styleObjectname$); string viewer$; viewer$ = "VIEWER"; string center$; center$ = "CENTER"; ######## Create display group with 2d and 3d views print("START"); # Size of squared 2D view and 3D view # Should be evenly divisible by 8 numeric size; size = 400; # Zoom out factor for 2D view numeric zoomfactor; zoomfactor = 1.8; # Create group print("Creating Group"); class GRE_GROUP group; group = GroupCreate(); # Create flags to create view without iconbar, scrollbars, status line and scale/position line # This is important to maintain fixed window size for movie generation string flags$; flags$ = "NoScalePosLine,NoIconBar,NoScrollbars,NoStatusLine"; # Create dialog and 2D view print("Creating dialog and 2D view"); class XmForm dialog2d; class GRE_VIEW view2d; dialog2d = CreateFormDialog("VIEW 2D"); view2d = GroupCreateView(group,dialog2d,"",size,size,flags$); view2d.BackgroundColor.red = 67; view2d.BackgroundColor.green = 100; view2d.BackgroundColor.blue = 100; # Create dialog and 3D view print("Creating dialog and 3D view"); class XmForm dialog3d; class GRE_VIEW3D view3d; dialog3d = CreateFormDialog("VIEW 3D"); view3d = GroupCreate3DView(group,dialog3d,"",size,size,flags$); view3d.BackgroundColor.red = 67; view3d.BackgroundColor.green = 100; view3d.BackgroundColor.blue = 100; # Add layers to group GroupQuickAddRasterVar(group,Surface,1); GroupQuickAddRasterVar(group,RastDrape,0); GroupQuickAddVectorVar(group,VectDrape); # Open both views DialogOpen(dialog2d); DialogOpen(dialog3d); # Full redraw of both views ViewRedrawFull(view2d); ViewRedrawFull(view3d); ViewZoomOut(view2d,zoomfactor,1); ####### Set up parameters for movie frame # Destination of each view in final frame for movie numeric x2d, y2d, x3d, y3d, w, h; x2d = 0; y2d = 0; x3d = size; y3d = 0; w = 2 * size; h = size; # Create text strings for annotation in frame string frameTitle$; string frameTitle2$; frameTitle$ = "Mount St. Helens Flow Hazard Zonation"; frameTitle2$ = "and Survey Station Locations"; # Font size numeric fontsize; fontsize = 16; # Define color for text annotation in frame class Color black; black.red = 0; black.green = 0; black.blue = 0; # Creating frame print("Creating frame for movie"); class Frame frame; frame = FrameCreate(w,h); # Create graphics context (GC) for frame print("Creating GC from frame and activate it"); ActivateGC(FrameCreateGC(frame)); DrawTextSetHeightPixels(fontsize); DrawUseStyleObject(styleFilename$,styleObjectname$); ######## Set some more movie parameters # Initiale Movie print("Initializing Movie"); class Movie movie; movie = MovieInit(); # Check framerate and force it to "MOVIE_FRAMERATE_24" if it is invalid numeric rate; rate = 24; if (framerate$ == "MOVIE_FRAMERATE_23_976") rate = 23.976; if (framerate$ == "MOVIE_FRAMERATE_25") rate = 25.0; if (framerate$ == "MOVIE_FRAMERATE_29_970") rate = 29.970; if (framerate$ == "MOVIE_FRAMERATE_30") rate = 30.0; if (framerate$ == "MOVIE_FRAMERATE_50") rate = 50.0; if (framerate$ == "MOVIE_FRAMERATE_59_940") rate = 59.940; if (framerate$ == "MOVIE_FRAMERATE_60") rate = 60.0; if (rate == 24.0) framerate$ = "MOVIE_FRAMERATE_24"; # Set Movie Parameters print("Setting Movie Parameters"); MovieSetFormat(movie,format$); MovieSetFrameRate(movie,framerate$); MovieSetFrameWidth(movie,w); MovieSetFrameHeight(movie,h); # Make Output File string ext$; ext$ = MovieGetFileExt(movie); string filename$; filename$ = GetOutputFileName("","Make filename for movie",ext$); printf("Filename = %s\n",filename$); # Check recording time if (time <= 1.0) time = 1.0; ##### Get georeference for surface layer and reset to group projection class Georef georef; georef = GetLastUsedGeorefObject(Surface); GeorefSetProjection(georef,group.Projection); # Find map coordinates and surface elevation at center of group # and define as view point (center) class POINT3D center; center.x = group.Center.x; center.y = group.Center.y; numeric objx; numeric objy; MapToObject(georef,center.x,center.y,Surface,objx,objy); center.z = Surface[objy,objx]; ##### Set up viewpoint and viewer position parameters class VIEWPOINT3D vp; vp = view3d.ViewPoint; vp.SetCenter(center); class POINT3D pt; # viewer position class POINT2D point; # 2D point for location symbols # Set initial viewer position north of center just beyond group extents # and 10000 m higher than center point pt.x = group.Center.x; pt.y = group.Extents.y2 + 0.6 * (group.Extents.y2 - group.Center.y); pt.z = center.z + 10000; vp.SetViewerPosition(pt); # Calculate spiral orbit parameters numeric numFrames = time * rate; numeric deltaAngle = -360.0 / numFrames * 2; numeric tx = vp.ViewPos.x - vp.CenterPoint.x; numeric ty = vp.ViewPos.y - vp.CenterPoint.y; numeric distance = 4 * sqrt(tx * tx + ty * ty) / 5 / numFrames * 2; numeric height = (vp.ViewPos.z - vp.CenterPoint.z) / numFrames * 2; ###### Start recording movie to file MovieStart(movie,filename$); # Loop for each frame numeric i, azimuth; for i = 1 to numFrames { SetStatusMessage(sprintf("Processing frame %d of %d",i,numFrames)); # Rotate viewer position around center with deltaAngle increment vp.RotateViewerPosition(deltaAngle); if (i <= numFrames / 2) { # Move viewer position closer and higher to center point azimuth = vp.AzimAngle * 180 / PI; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,90,height,"m"); } else { # Move viewer position farther and lower from center point azimuth = vp.AzimAngle * 180 / PI + 180; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,-90,height,"m"); } # ViewRedrawDirect(view3d,"NoBlankScreen"); # This new function added after release of TNTmips 6.5 # can redraw the view without blanking it first. Use of # this function eliminates "flashing" of the view as the # movie is initially rendered. It has no effect on the # output movie file. For 6.5 release version, use the # function in the next statement. ViewRedraw(view3d); # Copy 2d view and 3d view to destination frame FrameCopyFromView(frame,view2d,0,0,size,size,x2d,y2d); FrameCopyFromView(frame,view3d,0,0,size,size,x3d,y3d); # Draw center point in 2d view point.x = vp.CenterPoint.x; point.y = vp.CenterPoint.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(center$); DrawPoint(point.x,point.y); # Draw viewer position point in 2d view point.x = vp.ViewPos.x; point.y = vp.ViewPos.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(viewer$); DrawPoint(point.x,point.y); # Draw text to top of frame DrawTextSetColors(black); DrawTextSimple(frameTitle$,5,fontsize); DrawTextSimple(frameTitle2$,5,2.2*fontsize); # Add frame to movie MovieAddFrame(movie,frame); } # End of main processing loop # Stop and Exit movie MovieStop(movie); MovieExit(movie); # Close dialogs DialogClose(dialog2d); DialogClose(dialog3d); print("END");
ViewRedrawFull
Redraw view (full).
ViewRedrawFull(view)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view to zoom
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
###################### # # ORBITSP.SML # # Demonstration of movie generation from 3D display using spiral # orbit path. Both 2D and 3D views are copied into each movie frame. # # View center is fixed at center of group. Viewer position is computed # from size of group. Two complete orbits are made. The first starts # beyond the edge of group and spirals inward and downward; the second # spirals outward and upward. # # Script uses an input DEM for the surface layer, an input raster drape # layer, and an input vector drape layer. # # Requires TNTmips Version 6.5 # ##################### clear(); #### Set movie format, frame rate, and recording time # Movie format (Possible values : "MPEG"(All platform) or "AVI"(Windows only) string format$; format$ = "AVI"; # Frame rate # Possible values : # "MOVIE_FRAMERATE_23_976" 23.976 (24000/1001) fps - NTSC encapsulated film rate # "MOVIE_FRAMERATE_24" 24 fps - Standard international cinema film rate # "MOVIE_FRAMERATE_25" 25 fps - PAL (625/50) video frame rate # "MOVIE_FRAMERATE_29_970" 29.97 (30000/1001) fps - NTSC video frame rate # "MOVIE_FRAMERATE_30" 30 fps - NTSC drop-frame (525/60) video frame rate # "MOVIE_FRAMERATE_50" 50 fps - Double frame rate / progressive PAL # "MOVIE_FRAMERATE_59_940" 59.94 (60000/1001) fps - Double frame rate NTSC # "MOVIE_FRAMERATE_60" 60 fps - Double frame rate drop-frame NTSC string framerate$; framerate$ = "MOVIE_FRAMERATE_24"; # Recording time numeric time; time = 60; ###### Get RVC objects to load raster Surface, RastDrape; vector VectDrape; print("Select raster to use for surface"); GetInputRaster(Surface); print("Select raster to use for first drape layer"); GetInputRaster(RastDrape); print("Select vector to use for second drape layer"); GetInputVector(VectDrape); ###### RVC style object to draw center point and viewer point string styleFilename$; string styleObjectname$; GetInputObject("Style","Select style object for center and viewer point symbols:", styleFilename$, styleObjectname$); string viewer$; viewer$ = "VIEWER"; string center$; center$ = "CENTER"; ######## Create display group with 2d and 3d views print("START"); # Size of squared 2D view and 3D view # Should be evenly divisible by 8 numeric size; size = 400; # Zoom out factor for 2D view numeric zoomfactor; zoomfactor = 1.8; # Create group print("Creating Group"); class GRE_GROUP group; group = GroupCreate(); # Create flags to create view without iconbar, scrollbars, status line and scale/position line # This is important to maintain fixed window size for movie generation string flags$; flags$ = "NoScalePosLine,NoIconBar,NoScrollbars,NoStatusLine"; # Create dialog and 2D view print("Creating dialog and 2D view"); class XmForm dialog2d; class GRE_VIEW view2d; dialog2d = CreateFormDialog("VIEW 2D"); view2d = GroupCreateView(group,dialog2d,"",size,size,flags$); view2d.BackgroundColor.red = 67; view2d.BackgroundColor.green = 100; view2d.BackgroundColor.blue = 100; # Create dialog and 3D view print("Creating dialog and 3D view"); class XmForm dialog3d; class GRE_VIEW3D view3d; dialog3d = CreateFormDialog("VIEW 3D"); view3d = GroupCreate3DView(group,dialog3d,"",size,size,flags$); view3d.BackgroundColor.red = 67; view3d.BackgroundColor.green = 100; view3d.BackgroundColor.blue = 100; # Add layers to group GroupQuickAddRasterVar(group,Surface,1); GroupQuickAddRasterVar(group,RastDrape,0); GroupQuickAddVectorVar(group,VectDrape); # Open both views DialogOpen(dialog2d); DialogOpen(dialog3d); # Full redraw of both views ViewRedrawFull(view2d); ViewRedrawFull(view3d); ViewZoomOut(view2d,zoomfactor,1); ####### Set up parameters for movie frame # Destination of each view in final frame for movie numeric x2d, y2d, x3d, y3d, w, h; x2d = 0; y2d = 0; x3d = size; y3d = 0; w = 2 * size; h = size; # Create text strings for annotation in frame string frameTitle$; string frameTitle2$; frameTitle$ = "Mount St. Helens Flow Hazard Zonation"; frameTitle2$ = "and Survey Station Locations"; # Font size numeric fontsize; fontsize = 16; # Define color for text annotation in frame class Color black; black.red = 0; black.green = 0; black.blue = 0; # Creating frame print("Creating frame for movie"); class Frame frame; frame = FrameCreate(w,h); # Create graphics context (GC) for frame print("Creating GC from frame and activate it"); ActivateGC(FrameCreateGC(frame)); DrawTextSetHeightPixels(fontsize); DrawUseStyleObject(styleFilename$,styleObjectname$); ######## Set some more movie parameters # Initiale Movie print("Initializing Movie"); class Movie movie; movie = MovieInit(); # Check framerate and force it to "MOVIE_FRAMERATE_24" if it is invalid numeric rate; rate = 24; if (framerate$ == "MOVIE_FRAMERATE_23_976") rate = 23.976; if (framerate$ == "MOVIE_FRAMERATE_25") rate = 25.0; if (framerate$ == "MOVIE_FRAMERATE_29_970") rate = 29.970; if (framerate$ == "MOVIE_FRAMERATE_30") rate = 30.0; if (framerate$ == "MOVIE_FRAMERATE_50") rate = 50.0; if (framerate$ == "MOVIE_FRAMERATE_59_940") rate = 59.940; if (framerate$ == "MOVIE_FRAMERATE_60") rate = 60.0; if (rate == 24.0) framerate$ = "MOVIE_FRAMERATE_24"; # Set Movie Parameters print("Setting Movie Parameters"); MovieSetFormat(movie,format$); MovieSetFrameRate(movie,framerate$); MovieSetFrameWidth(movie,w); MovieSetFrameHeight(movie,h); # Make Output File string ext$; ext$ = MovieGetFileExt(movie); string filename$; filename$ = GetOutputFileName("","Make filename for movie",ext$); printf("Filename = %s\n",filename$); # Check recording time if (time <= 1.0) time = 1.0; ##### Get georeference for surface layer and reset to group projection class Georef georef; georef = GetLastUsedGeorefObject(Surface); GeorefSetProjection(georef,group.Projection); # Find map coordinates and surface elevation at center of group # and define as view point (center) class POINT3D center; center.x = group.Center.x; center.y = group.Center.y; numeric objx; numeric objy; MapToObject(georef,center.x,center.y,Surface,objx,objy); center.z = Surface[objy,objx]; ##### Set up viewpoint and viewer position parameters class VIEWPOINT3D vp; vp = view3d.ViewPoint; vp.SetCenter(center); class POINT3D pt; # viewer position class POINT2D point; # 2D point for location symbols # Set initial viewer position north of center just beyond group extents # and 10000 m higher than center point pt.x = group.Center.x; pt.y = group.Extents.y2 + 0.6 * (group.Extents.y2 - group.Center.y); pt.z = center.z + 10000; vp.SetViewerPosition(pt); # Calculate spiral orbit parameters numeric numFrames = time * rate; numeric deltaAngle = -360.0 / numFrames * 2; numeric tx = vp.ViewPos.x - vp.CenterPoint.x; numeric ty = vp.ViewPos.y - vp.CenterPoint.y; numeric distance = 4 * sqrt(tx * tx + ty * ty) / 5 / numFrames * 2; numeric height = (vp.ViewPos.z - vp.CenterPoint.z) / numFrames * 2; ###### Start recording movie to file MovieStart(movie,filename$); # Loop for each frame numeric i, azimuth; for i = 1 to numFrames { SetStatusMessage(sprintf("Processing frame %d of %d",i,numFrames)); # Rotate viewer position around center with deltaAngle increment vp.RotateViewerPosition(deltaAngle); if (i <= numFrames / 2) { # Move viewer position closer and higher to center point azimuth = vp.AzimAngle * 180 / PI; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,90,height,"m"); } else { # Move viewer position farther and lower from center point azimuth = vp.AzimAngle * 180 / PI + 180; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,-90,height,"m"); } # ViewRedrawDirect(view3d,"NoBlankScreen"); # This new function added after release of TNTmips 6.5 # can redraw the view without blanking it first. Use of # this function eliminates "flashing" of the view as the # movie is initially rendered. It has no effect on the # output movie file. For 6.5 release version, use the # function in the next statement. ViewRedraw(view3d); # Copy 2d view and 3d view to destination frame FrameCopyFromView(frame,view2d,0,0,size,size,x2d,y2d); FrameCopyFromView(frame,view3d,0,0,size,size,x3d,y3d); # Draw center point in 2d view point.x = vp.CenterPoint.x; point.y = vp.CenterPoint.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(center$); DrawPoint(point.x,point.y); # Draw viewer position point in 2d view point.x = vp.ViewPos.x; point.y = vp.ViewPos.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(viewer$); DrawPoint(point.x,point.y); # Draw text to top of frame DrawTextSetColors(black); DrawTextSimple(frameTitle$,5,fontsize); DrawTextSimple(frameTitle2$,5,2.2*fontsize); # Add frame to movie MovieAddFrame(movie,frame); } # End of main processing loop # Stop and Exit movie MovieStop(movie); MovieExit(movie); # Close dialogs DialogClose(dialog2d); DialogClose(dialog3d); print("END");
ViewRedrawIfNeeded
Redraw a view (but only if it has changed since last redraw)
ViewRedrawIfNeeded(view)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view to redraw
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/ToolScript/FLOWPATH.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ViewRedrawLayer
Redraw the specified layer in the view
ViewRedrawLayer(view, layer)
場所:
空間データ表示ウィンドウ
パラメータ:
戻り値
なし
作成日時: 10-May-2004
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ViewSaveSnapshot
Save a snapshot of a view.
ViewSaveSnapshot(view, filename$, objname$, desc$)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view to save
string filename$
RVC file name
string objname$
Object name
string desc$
Object description
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
Unable to locate sample script "smlsamples/MacroScript/Snapshot.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ViewSetGPS
Set the GPS source for a view
ViewSetGPS(view, gps)
場所:
空間データ表示ウィンドウ
パラメータ:
戻り値
なし
作成日時: 13-Jul-1998
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
# no sample necessary
ViewSetMapScale
Set the mapscale for a view (for next redraw).
ViewSetMapScale(view, mapscale)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view to set map scale for
numeric mapscale
The map scale to set
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/MacroScript/ZOOMTO.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ViewSetMessage
Set message in status line at bottom of view.
ViewSetMessage(view, msg$)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view to set the message for
string msg$
The message
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/PTCOORD.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ViewSetStatusBar
Set status bar at bottom of view.
ViewSetStatusBar(view, value, max)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view the status bar is attached to
numeric value
Current status bar value
numeric max
Maximum status bar number
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ViewStatusBarClear
Clear the status bar.
ViewStatusBarClear(view)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view whose status bar is cleared
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ViewTransPointLayerToView
Translate a point from layer coordinates to view coordinates.
ViewTransPointLayerToView(view, layer, inPoint)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view
class GRE_LAYER layer
The layer
class POINT2D inPoint
The point to translate
戻り値
class POINT2D
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ViewTransPointViewToLayer
Translate a point from layer view to layer coordinates.
ViewTransPointViewToLayer(view, layer, inPoint)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view
class GRE_LAYER layer
The layer
class POINT2D inPoint
The point to translate
戻り値
class POINT2D
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/PTCOORD.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
ViewZoom1X
Set view to 1X zoom and redraw.
ViewZoom1X(view, redraw)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view to zoom
numeric redraw (オプション)
Do redraw
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ViewZoomFull
Zoom to show full extents of view
ViewZoomFull(view, redraw)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
Description
numeric redraw (オプション)
Description
戻り値
なし
作成日時: 24-Jun-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ViewZoomIn
Zoom in on view.
ViewZoomIn(view, zoomfactor, redraw)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view to zoom
numeric zoomfactor (オプション)
Amount to zoom
numeric redraw (オプション)
Do redraw
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ViewZoomOut
Zoom out on view.
ViewZoomOut(view, zoomfactor, redraw)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view to zoom
numeric zoomfactor (オプション)
Amount to zoom
numeric redraw (オプション)
Do redraw
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
###################### # # ORBITSP.SML # # Demonstration of movie generation from 3D display using spiral # orbit path. Both 2D and 3D views are copied into each movie frame. # # View center is fixed at center of group. Viewer position is computed # from size of group. Two complete orbits are made. The first starts # beyond the edge of group and spirals inward and downward; the second # spirals outward and upward. # # Script uses an input DEM for the surface layer, an input raster drape # layer, and an input vector drape layer. # # Requires TNTmips Version 6.5 # ##################### clear(); #### Set movie format, frame rate, and recording time # Movie format (Possible values : "MPEG"(All platform) or "AVI"(Windows only) string format$; format$ = "AVI"; # Frame rate # Possible values : # "MOVIE_FRAMERATE_23_976" 23.976 (24000/1001) fps - NTSC encapsulated film rate # "MOVIE_FRAMERATE_24" 24 fps - Standard international cinema film rate # "MOVIE_FRAMERATE_25" 25 fps - PAL (625/50) video frame rate # "MOVIE_FRAMERATE_29_970" 29.97 (30000/1001) fps - NTSC video frame rate # "MOVIE_FRAMERATE_30" 30 fps - NTSC drop-frame (525/60) video frame rate # "MOVIE_FRAMERATE_50" 50 fps - Double frame rate / progressive PAL # "MOVIE_FRAMERATE_59_940" 59.94 (60000/1001) fps - Double frame rate NTSC # "MOVIE_FRAMERATE_60" 60 fps - Double frame rate drop-frame NTSC string framerate$; framerate$ = "MOVIE_FRAMERATE_24"; # Recording time numeric time; time = 60; ###### Get RVC objects to load raster Surface, RastDrape; vector VectDrape; print("Select raster to use for surface"); GetInputRaster(Surface); print("Select raster to use for first drape layer"); GetInputRaster(RastDrape); print("Select vector to use for second drape layer"); GetInputVector(VectDrape); ###### RVC style object to draw center point and viewer point string styleFilename$; string styleObjectname$; GetInputObject("Style","Select style object for center and viewer point symbols:", styleFilename$, styleObjectname$); string viewer$; viewer$ = "VIEWER"; string center$; center$ = "CENTER"; ######## Create display group with 2d and 3d views print("START"); # Size of squared 2D view and 3D view # Should be evenly divisible by 8 numeric size; size = 400; # Zoom out factor for 2D view numeric zoomfactor; zoomfactor = 1.8; # Create group print("Creating Group"); class GRE_GROUP group; group = GroupCreate(); # Create flags to create view without iconbar, scrollbars, status line and scale/position line # This is important to maintain fixed window size for movie generation string flags$; flags$ = "NoScalePosLine,NoIconBar,NoScrollbars,NoStatusLine"; # Create dialog and 2D view print("Creating dialog and 2D view"); class XmForm dialog2d; class GRE_VIEW view2d; dialog2d = CreateFormDialog("VIEW 2D"); view2d = GroupCreateView(group,dialog2d,"",size,size,flags$); view2d.BackgroundColor.red = 67; view2d.BackgroundColor.green = 100; view2d.BackgroundColor.blue = 100; # Create dialog and 3D view print("Creating dialog and 3D view"); class XmForm dialog3d; class GRE_VIEW3D view3d; dialog3d = CreateFormDialog("VIEW 3D"); view3d = GroupCreate3DView(group,dialog3d,"",size,size,flags$); view3d.BackgroundColor.red = 67; view3d.BackgroundColor.green = 100; view3d.BackgroundColor.blue = 100; # Add layers to group GroupQuickAddRasterVar(group,Surface,1); GroupQuickAddRasterVar(group,RastDrape,0); GroupQuickAddVectorVar(group,VectDrape); # Open both views DialogOpen(dialog2d); DialogOpen(dialog3d); # Full redraw of both views ViewRedrawFull(view2d); ViewRedrawFull(view3d); ViewZoomOut(view2d,zoomfactor,1); ####### Set up parameters for movie frame # Destination of each view in final frame for movie numeric x2d, y2d, x3d, y3d, w, h; x2d = 0; y2d = 0; x3d = size; y3d = 0; w = 2 * size; h = size; # Create text strings for annotation in frame string frameTitle$; string frameTitle2$; frameTitle$ = "Mount St. Helens Flow Hazard Zonation"; frameTitle2$ = "and Survey Station Locations"; # Font size numeric fontsize; fontsize = 16; # Define color for text annotation in frame class Color black; black.red = 0; black.green = 0; black.blue = 0; # Creating frame print("Creating frame for movie"); class Frame frame; frame = FrameCreate(w,h); # Create graphics context (GC) for frame print("Creating GC from frame and activate it"); ActivateGC(FrameCreateGC(frame)); DrawTextSetHeightPixels(fontsize); DrawUseStyleObject(styleFilename$,styleObjectname$); ######## Set some more movie parameters # Initiale Movie print("Initializing Movie"); class Movie movie; movie = MovieInit(); # Check framerate and force it to "MOVIE_FRAMERATE_24" if it is invalid numeric rate; rate = 24; if (framerate$ == "MOVIE_FRAMERATE_23_976") rate = 23.976; if (framerate$ == "MOVIE_FRAMERATE_25") rate = 25.0; if (framerate$ == "MOVIE_FRAMERATE_29_970") rate = 29.970; if (framerate$ == "MOVIE_FRAMERATE_30") rate = 30.0; if (framerate$ == "MOVIE_FRAMERATE_50") rate = 50.0; if (framerate$ == "MOVIE_FRAMERATE_59_940") rate = 59.940; if (framerate$ == "MOVIE_FRAMERATE_60") rate = 60.0; if (rate == 24.0) framerate$ = "MOVIE_FRAMERATE_24"; # Set Movie Parameters print("Setting Movie Parameters"); MovieSetFormat(movie,format$); MovieSetFrameRate(movie,framerate$); MovieSetFrameWidth(movie,w); MovieSetFrameHeight(movie,h); # Make Output File string ext$; ext$ = MovieGetFileExt(movie); string filename$; filename$ = GetOutputFileName("","Make filename for movie",ext$); printf("Filename = %s\n",filename$); # Check recording time if (time <= 1.0) time = 1.0; ##### Get georeference for surface layer and reset to group projection class Georef georef; georef = GetLastUsedGeorefObject(Surface); GeorefSetProjection(georef,group.Projection); # Find map coordinates and surface elevation at center of group # and define as view point (center) class POINT3D center; center.x = group.Center.x; center.y = group.Center.y; numeric objx; numeric objy; MapToObject(georef,center.x,center.y,Surface,objx,objy); center.z = Surface[objy,objx]; ##### Set up viewpoint and viewer position parameters class VIEWPOINT3D vp; vp = view3d.ViewPoint; vp.SetCenter(center); class POINT3D pt; # viewer position class POINT2D point; # 2D point for location symbols # Set initial viewer position north of center just beyond group extents # and 10000 m higher than center point pt.x = group.Center.x; pt.y = group.Extents.y2 + 0.6 * (group.Extents.y2 - group.Center.y); pt.z = center.z + 10000; vp.SetViewerPosition(pt); # Calculate spiral orbit parameters numeric numFrames = time * rate; numeric deltaAngle = -360.0 / numFrames * 2; numeric tx = vp.ViewPos.x - vp.CenterPoint.x; numeric ty = vp.ViewPos.y - vp.CenterPoint.y; numeric distance = 4 * sqrt(tx * tx + ty * ty) / 5 / numFrames * 2; numeric height = (vp.ViewPos.z - vp.CenterPoint.z) / numFrames * 2; ###### Start recording movie to file MovieStart(movie,filename$); # Loop for each frame numeric i, azimuth; for i = 1 to numFrames { SetStatusMessage(sprintf("Processing frame %d of %d",i,numFrames)); # Rotate viewer position around center with deltaAngle increment vp.RotateViewerPosition(deltaAngle); if (i <= numFrames / 2) { # Move viewer position closer and higher to center point azimuth = vp.AzimAngle * 180 / PI; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,90,height,"m"); } else { # Move viewer position farther and lower from center point azimuth = vp.AzimAngle * 180 / PI + 180; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,-90,height,"m"); } # ViewRedrawDirect(view3d,"NoBlankScreen"); # This new function added after release of TNTmips 6.5 # can redraw the view without blanking it first. Use of # this function eliminates "flashing" of the view as the # movie is initially rendered. It has no effect on the # output movie file. For 6.5 release version, use the # function in the next statement. ViewRedraw(view3d); # Copy 2d view and 3d view to destination frame FrameCopyFromView(frame,view2d,0,0,size,size,x2d,y2d); FrameCopyFromView(frame,view3d,0,0,size,size,x3d,y3d); # Draw center point in 2d view point.x = vp.CenterPoint.x; point.y = vp.CenterPoint.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(center$); DrawPoint(point.x,point.y); # Draw viewer position point in 2d view point.x = vp.ViewPos.x; point.y = vp.ViewPos.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(viewer$); DrawPoint(point.x,point.y); # Draw text to top of frame DrawTextSetColors(black); DrawTextSimple(frameTitle$,5,fontsize); DrawTextSimple(frameTitle2$,5,2.2*fontsize); # Add frame to movie MovieAddFrame(movie,frame); } # End of main processing loop # Stop and Exit movie MovieStop(movie); MovieExit(movie); # Close dialogs DialogClose(dialog2d); DialogClose(dialog3d); print("END");
ViewZoomToGroup
Zoom so that a given group fills the view
ViewZoomToGroup(view, group, redraw)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view
class GRE_GROUP group
The group
numeric redraw (オプション)
Force redraw if true
戻り値
なし
作成日時: 05-Jun-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
ViewZoomToLayer
Zoom so that a given layer fills the view
ViewZoomToLayer(view, layer, redraw)
場所:
空間データ表示ウィンドウ
パラメータ:
class GRE_VIEW view
The view
class GRE_LAYER layer
The layer
numeric redraw (オプション)
Force a redraw if true
戻り値
なし
作成日時: 05-Jun-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
LayoutCreate
Create a display or hardcopy layout
LayoutCreate(name$, hardcopy)
場所:
空間データレイアウト
パラメータ:
string name$ (オプション)
The layout name
numeric hardcopy (オプション)
Pass 1 for a hardcopy layout, 0 for display layout
戻り値
class GRE_LAYOUT
作成日時: 11-Jun-1998
修正日時: 20-Mar-2001
TNTsml for Windows で使用可能: はい
例:
class GRE_LAYOUT layout; class GRE_GROUP gp; Raster R; # Get the raster to print GetInputRaster(R); # Create the layout used to print the raster layout = LayoutCreate("myLayout", 1); # 1 for hardcopy # Create group to add raster to gp = GroupCreate("Any Group Name", layout); # Add the raster to the group GroupQuickAddRasterVar(gp, R); # (GROUP name, raster) # open up dialog to setup printer numeric err = LayoutPageSetupDialog(layout); if(err>=0) { LayoutPrint(layout, 1); } else { print("Layout was sent to printer"); } GroupDestroy(gp); LayoutDestroy(layout);
LayoutCreateView
Create a view for a layout.
LayoutCreateView(layout, form, name$, height, width)
場所:
空間データレイアウト
パラメータ:
class GRE_LAYOUT layout
The layout
class Widget form
Parent widget for view widget form
string name$ (オプション)
Name for title bar
numeric height (オプション)
Initial height of drawing area
numeric width (オプション)
Initial width of drawing area
戻り値
class GRE_VIEW
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
# no sample necessary
LayoutDestroy
Destroy a layout and all the groups in it
LayoutDestroy(layout)
場所:
空間データレイアウト
パラメータ:
class GRE_LAYOUT layout
The layout to destroy
戻り値
class GRE_LAYOUT
作成日時: 04-Aug-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/Misc/PrintRasterLayout.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
LayoutGetGroupByName
Get a group pointer given group name.
LayoutGetGroupByName(layout, name$)
場所:
空間データレイアウト
パラメータ:
class GRE_LAYOUT layout
The layout
string name$
The group name
戻り値
class GRE_GROUP
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/doqq7.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
LayoutPageSetupDialog
Popup page setup dialog for a layout
LayoutPageSetupDialog(layout)
場所:
空間データレイアウト
パラメータ:
class GRE_LAYOUT layout
The layout
戻り値
numeric
negative if dialog canceled, 0 if 'ok'
作成日時: 03-Feb-1999
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
class GRE_LAYOUT layout; class GRE_GROUP gp; Raster R; # Get the raster to print GetInputRaster(R); # Create the layout used to print the raster layout = LayoutCreate("myLayout", 1); # 1 for hardcopy # Create group to add raster to gp = GroupCreate("Any Group Name", layout); # Add the raster to the group GroupQuickAddRasterVar(gp, R); # (GROUP name, raster) # open up dialog to setup printer numeric err = LayoutPageSetupDialog(layout); if(err>=0) { LayoutPrint(layout, 1); } else { print("Layout was sent to printer"); } GroupDestroy(gp); LayoutDestroy(layout);
LayoutPrint
Print a layout
LayoutPrint(layout, setupDialog)
場所:
空間データレイアウト
パラメータ:
class GRE_LAYOUT layout
The layout to print
numeric setupDialog (オプション)
Pass 0 to bypass setup dialog (unless needed)
戻り値
なし
作成日時: 03-Feb-1999
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
class GRE_LAYOUT layout; class GRE_GROUP gp; Raster R; # Get the raster to print GetInputRaster(R); # Create the layout used to print the raster layout = LayoutCreate("myLayout", 1); # 1 for hardcopy # Create group to add raster to gp = GroupCreate("Any Group Name", layout); # Add the raster to the group GroupQuickAddRasterVar(gp, R); # (GROUP name, raster) # open up dialog to setup printer numeric err = LayoutPageSetupDialog(layout); if(err>=0) { LayoutPrint(layout, 1); } else { print("Layout was sent to printer"); } GroupDestroy(gp); LayoutDestroy(layout);
LayoutRead
Read a saved display layout from a file
LayoutRead(layout, filename$, objectname$)
場所:
空間データレイアウト
パラメータ:
class GRE_LAYOUT layout
The layout
string filename$
RVC filename
string objectname$ (オプション)
Object name
戻り値
なし
作成日時: 11-Jun-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/Misc/LayoutPrint.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
LayoutWrite
Save a display layout to a file
LayoutWrite(layout, filename$, objectname$, description$)
場所:
空間データレイアウト
パラメータ:
class GRE_LAYOUT layout
The layout to save
string filename$
RVC filename
string objectname$ (オプション)
Object name
string description$ (オプション)
Object description
戻り値
なし
作成日時: 11-Jun-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/doqq7.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
DispCreate2DGroup
Create a 2d group on a display.
DispCreate2DGroup(name$, layout)
場所:
空間データグループ
パラメータ:
string name$ (オプション)
The group name
class GRE_LAYOUT layout (オプション)
Layout to contain group, none if group not in layout
戻り値
class GRE_GROUP
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
Unable to locate sample script "smlsamples/StandAlone/View3d.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
GroupAttachHorizontal
Set horizontal position of display group in layout
GroupAttachHorizontal(group, groupPoint$, offset, anchor$, anchorPoint$, refgroup)
場所:
空間データグループ
パラメータ:
class GRE_GROUP group
Group to position
string groupPoint$
Where on the group to attach
numeric offset
可能性のある値:
"None"
No attachment
"Left"
Attach left edge
"Center"
Attach center
"Right"
Attach right edge
"Geographic"
Attach Geographically (both groups must be georeferenced)
Page inches in hardcopy mode, ground meters in display mode
string anchor$
What to attach the group to
string anchorPoint$
可能性のある値:
"None"
No attachment
"Group"
Attach to another group (set RefGroup to the group to attach to)
"Page"
Attach to the page
"Margin"
Attach to the margin
Attachment location on the anchor
class GRE_GROUP refgroup (オプション)
可能性のある値:
"None"
No attachment
"Left"
Attach left edge
"Center"
Attach center
"Right"
Attach right edge
"Geographic"
Attach Geographically (both groups must be georeferenced)
Group to attach to, if needed
戻り値
なし
作成日時: 12-Jun-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GroupAttachVertical
Set vertical position of display group in layout
GroupAttachVertical(group, groupPoint$, offset, anchor$, anchorPoint$, refgroup)
場所:
空間データグループ
パラメータ:
class GRE_GROUP group
Group to position
string groupPoint$
Where on the group to attach
numeric offset
可能性のある値:
"None"
No attachment
"Top"
Attach top edge
"Center"
Attach center
"Bottom"
Attach bottom edge
"Geographic"
Attach Geographically (both groups must be georeferenced)
Page inches in hardcopy mode, ground meters in display mode
string anchor$
What to attach the group to
string anchorPoint$
可能性のある値:
"None"
No attachment
"Group"
Attach to another group (set RefGroup to the group to attach to)
"Page"
Attach to the page
"Margin"
Attach to the margin
Attachment location on the anchor
class GRE_GROUP refgroup (オプション)
可能性のある値:
"None"
No attachment
"Top"
Attach top edge
"Center"
Attach center
"Bottom"
Attach bottom edge
"Geographic"
Attach Geographically (both groups must be georeferenced)
Group to attach to, if needed
戻り値
なし
作成日時: 12-Jun-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GroupCreate
Create a group
GroupCreate(name$, layout)
場所:
空間データグループ
パラメータ:
string name$ (オプション)
Group name
class GRE_LAYOUT layout (オプション)
Layout to contain group (if any)
戻り値
class GRE_GROUP
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class GRE_LAYOUT layout; class GRE_GROUP gp; Raster R; # Get the raster to print GetInputRaster(R); # Create the layout used to print the raster layout = LayoutCreate("myLayout", 1); # 1 for hardcopy # Create group to add raster to gp = GroupCreate("Any Group Name", layout); # Add the raster to the group GroupQuickAddRasterVar(gp, R); # (GROUP name, raster) # open up dialog to setup printer numeric err = LayoutPageSetupDialog(layout); if(err>=0) { LayoutPrint(layout, 1); } else { print("Layout was sent to printer"); } GroupDestroy(gp); LayoutDestroy(layout);
GroupCreate3DView
Create a 3d view of a group.
GroupCreate3DView(group, form, name$, height, width, createflags$)
場所:
空間データグループ
パラメータ:
class GRE_GROUP group
The group
class Widget form
Parent widget for view widget form
string name$ (オプション)
The name for the view
numeric height (オプション)
Initial height of drawing area
numeric width (オプション)
Initial width of drawing area
string createflags$ (オプション)
Create flags
可能性のある値:
"NoCloseOption"
Don't include "Close" option on view menu
"DestroyOnClose"
Destroy view when View/Close selected
"NoSelectTool"
Don't add "Select" tool
"NoLegendView"
Don't create LegendView
"NoStdTools"
Don't add any standard tools
"NoDftAddIcons"
Don't put default "add" icon(s) on toolbar
"NoCancelButton"
Don't put "Cancel" button at bottom of window
"NoSkipButton"
Don't put "Skip" button at bottom of window
"NoRedrawButton"
Don't put "Redraw" button at bottom of window
"NoToolBoxTool"
Don't add "ToolBox" tool
"NoStatusLine"
Don't create "status" line
"NoIconBar"
Don't create iconbar
"NoDftDrawIcons"
Don't create default "draw" icons when creating window
"NoDftViewIcons"
Don't create default "view" icons when creating window
"NoDftMarkIcons"
Don't create default "mark" icons when creating window
"NoScalePosLine"
Don't create zoom/scale/position line at bottom of view window
"NoScrollbars"
Don't create scroll bars
戻り値
class GRE_VIEW3D
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
###################### # # ORBITSP.SML # # Demonstration of movie generation from 3D display using spiral # orbit path. Both 2D and 3D views are copied into each movie frame. # # View center is fixed at center of group. Viewer position is computed # from size of group. Two complete orbits are made. The first starts # beyond the edge of group and spirals inward and downward; the second # spirals outward and upward. # # Script uses an input DEM for the surface layer, an input raster drape # layer, and an input vector drape layer. # # Requires TNTmips Version 6.5 # ##################### clear(); #### Set movie format, frame rate, and recording time # Movie format (Possible values : "MPEG"(All platform) or "AVI"(Windows only) string format$; format$ = "AVI"; # Frame rate # Possible values : # "MOVIE_FRAMERATE_23_976" 23.976 (24000/1001) fps - NTSC encapsulated film rate # "MOVIE_FRAMERATE_24" 24 fps - Standard international cinema film rate # "MOVIE_FRAMERATE_25" 25 fps - PAL (625/50) video frame rate # "MOVIE_FRAMERATE_29_970" 29.97 (30000/1001) fps - NTSC video frame rate # "MOVIE_FRAMERATE_30" 30 fps - NTSC drop-frame (525/60) video frame rate # "MOVIE_FRAMERATE_50" 50 fps - Double frame rate / progressive PAL # "MOVIE_FRAMERATE_59_940" 59.94 (60000/1001) fps - Double frame rate NTSC # "MOVIE_FRAMERATE_60" 60 fps - Double frame rate drop-frame NTSC string framerate$; framerate$ = "MOVIE_FRAMERATE_24"; # Recording time numeric time; time = 60; ###### Get RVC objects to load raster Surface, RastDrape; vector VectDrape; print("Select raster to use for surface"); GetInputRaster(Surface); print("Select raster to use for first drape layer"); GetInputRaster(RastDrape); print("Select vector to use for second drape layer"); GetInputVector(VectDrape); ###### RVC style object to draw center point and viewer point string styleFilename$; string styleObjectname$; GetInputObject("Style","Select style object for center and viewer point symbols:", styleFilename$, styleObjectname$); string viewer$; viewer$ = "VIEWER"; string center$; center$ = "CENTER"; ######## Create display group with 2d and 3d views print("START"); # Size of squared 2D view and 3D view # Should be evenly divisible by 8 numeric size; size = 400; # Zoom out factor for 2D view numeric zoomfactor; zoomfactor = 1.8; # Create group print("Creating Group"); class GRE_GROUP group; group = GroupCreate(); # Create flags to create view without iconbar, scrollbars, status line and scale/position line # This is important to maintain fixed window size for movie generation string flags$; flags$ = "NoScalePosLine,NoIconBar,NoScrollbars,NoStatusLine"; # Create dialog and 2D view print("Creating dialog and 2D view"); class XmForm dialog2d; class GRE_VIEW view2d; dialog2d = CreateFormDialog("VIEW 2D"); view2d = GroupCreateView(group,dialog2d,"",size,size,flags$); view2d.BackgroundColor.red = 67; view2d.BackgroundColor.green = 100; view2d.BackgroundColor.blue = 100; # Create dialog and 3D view print("Creating dialog and 3D view"); class XmForm dialog3d; class GRE_VIEW3D view3d; dialog3d = CreateFormDialog("VIEW 3D"); view3d = GroupCreate3DView(group,dialog3d,"",size,size,flags$); view3d.BackgroundColor.red = 67; view3d.BackgroundColor.green = 100; view3d.BackgroundColor.blue = 100; # Add layers to group GroupQuickAddRasterVar(group,Surface,1); GroupQuickAddRasterVar(group,RastDrape,0); GroupQuickAddVectorVar(group,VectDrape); # Open both views DialogOpen(dialog2d); DialogOpen(dialog3d); # Full redraw of both views ViewRedrawFull(view2d); ViewRedrawFull(view3d); ViewZoomOut(view2d,zoomfactor,1); ####### Set up parameters for movie frame # Destination of each view in final frame for movie numeric x2d, y2d, x3d, y3d, w, h; x2d = 0; y2d = 0; x3d = size; y3d = 0; w = 2 * size; h = size; # Create text strings for annotation in frame string frameTitle$; string frameTitle2$; frameTitle$ = "Mount St. Helens Flow Hazard Zonation"; frameTitle2$ = "and Survey Station Locations"; # Font size numeric fontsize; fontsize = 16; # Define color for text annotation in frame class Color black; black.red = 0; black.green = 0; black.blue = 0; # Creating frame print("Creating frame for movie"); class Frame frame; frame = FrameCreate(w,h); # Create graphics context (GC) for frame print("Creating GC from frame and activate it"); ActivateGC(FrameCreateGC(frame)); DrawTextSetHeightPixels(fontsize); DrawUseStyleObject(styleFilename$,styleObjectname$); ######## Set some more movie parameters # Initiale Movie print("Initializing Movie"); class Movie movie; movie = MovieInit(); # Check framerate and force it to "MOVIE_FRAMERATE_24" if it is invalid numeric rate; rate = 24; if (framerate$ == "MOVIE_FRAMERATE_23_976") rate = 23.976; if (framerate$ == "MOVIE_FRAMERATE_25") rate = 25.0; if (framerate$ == "MOVIE_FRAMERATE_29_970") rate = 29.970; if (framerate$ == "MOVIE_FRAMERATE_30") rate = 30.0; if (framerate$ == "MOVIE_FRAMERATE_50") rate = 50.0; if (framerate$ == "MOVIE_FRAMERATE_59_940") rate = 59.940; if (framerate$ == "MOVIE_FRAMERATE_60") rate = 60.0; if (rate == 24.0) framerate$ = "MOVIE_FRAMERATE_24"; # Set Movie Parameters print("Setting Movie Parameters"); MovieSetFormat(movie,format$); MovieSetFrameRate(movie,framerate$); MovieSetFrameWidth(movie,w); MovieSetFrameHeight(movie,h); # Make Output File string ext$; ext$ = MovieGetFileExt(movie); string filename$; filename$ = GetOutputFileName("","Make filename for movie",ext$); printf("Filename = %s\n",filename$); # Check recording time if (time <= 1.0) time = 1.0; ##### Get georeference for surface layer and reset to group projection class Georef georef; georef = GetLastUsedGeorefObject(Surface); GeorefSetProjection(georef,group.Projection); # Find map coordinates and surface elevation at center of group # and define as view point (center) class POINT3D center; center.x = group.Center.x; center.y = group.Center.y; numeric objx; numeric objy; MapToObject(georef,center.x,center.y,Surface,objx,objy); center.z = Surface[objy,objx]; ##### Set up viewpoint and viewer position parameters class VIEWPOINT3D vp; vp = view3d.ViewPoint; vp.SetCenter(center); class POINT3D pt; # viewer position class POINT2D point; # 2D point for location symbols # Set initial viewer position north of center just beyond group extents # and 10000 m higher than center point pt.x = group.Center.x; pt.y = group.Extents.y2 + 0.6 * (group.Extents.y2 - group.Center.y); pt.z = center.z + 10000; vp.SetViewerPosition(pt); # Calculate spiral orbit parameters numeric numFrames = time * rate; numeric deltaAngle = -360.0 / numFrames * 2; numeric tx = vp.ViewPos.x - vp.CenterPoint.x; numeric ty = vp.ViewPos.y - vp.CenterPoint.y; numeric distance = 4 * sqrt(tx * tx + ty * ty) / 5 / numFrames * 2; numeric height = (vp.ViewPos.z - vp.CenterPoint.z) / numFrames * 2; ###### Start recording movie to file MovieStart(movie,filename$); # Loop for each frame numeric i, azimuth; for i = 1 to numFrames { SetStatusMessage(sprintf("Processing frame %d of %d",i,numFrames)); # Rotate viewer position around center with deltaAngle increment vp.RotateViewerPosition(deltaAngle); if (i <= numFrames / 2) { # Move viewer position closer and higher to center point azimuth = vp.AzimAngle * 180 / PI; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,90,height,"m"); } else { # Move viewer position farther and lower from center point azimuth = vp.AzimAngle * 180 / PI + 180; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,-90,height,"m"); } # ViewRedrawDirect(view3d,"NoBlankScreen"); # This new function added after release of TNTmips 6.5 # can redraw the view without blanking it first. Use of # this function eliminates "flashing" of the view as the # movie is initially rendered. It has no effect on the # output movie file. For 6.5 release version, use the # function in the next statement. ViewRedraw(view3d); # Copy 2d view and 3d view to destination frame FrameCopyFromView(frame,view2d,0,0,size,size,x2d,y2d); FrameCopyFromView(frame,view3d,0,0,size,size,x3d,y3d); # Draw center point in 2d view point.x = vp.CenterPoint.x; point.y = vp.CenterPoint.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(center$); DrawPoint(point.x,point.y); # Draw viewer position point in 2d view point.x = vp.ViewPos.x; point.y = vp.ViewPos.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(viewer$); DrawPoint(point.x,point.y); # Draw text to top of frame DrawTextSetColors(black); DrawTextSimple(frameTitle$,5,fontsize); DrawTextSimple(frameTitle2$,5,2.2*fontsize); # Add frame to movie MovieAddFrame(movie,frame); } # End of main processing loop # Stop and Exit movie MovieStop(movie); MovieExit(movie); # Close dialogs DialogClose(dialog2d); DialogClose(dialog3d); print("END");
GroupCreateLayerManagerForm
Create layer manager as a form, (not a dialog)
GroupCreateLayerManagerForm(parent, group)
場所:
空間データグループ
パラメータ:
戻り値
class GRE_LAYERMANAGER
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
# no sample necessary
GroupCreateView
Create a 2d view of a group.
GroupCreateView(group, form, name$, height, width, createflags$)
場所:
空間データグループ
パラメータ:
class GRE_GROUP group
The group
class Widget form
Parent widget for view widget form
string name$ (オプション)
The name for the view
numeric height (オプション)
Initial height of drawing area
numeric width (オプション)
Initial width of drawing area
string createflags$ (オプション)
Create flags
可能性のある値:
"NoCloseOption"
Don't include "Close" option on view menu
"DestroyOnClose"
Destroy view when View/Close selected
"NoSelectTool"
Don't add "Select" tool
"NoLegendView"
Don't create LegendView
"NoStdTools"
Don't add any standard tools
"NoDftAddIcons"
Don't put default "add" icon(s) on toolbar
"NoCancelButton"
Don't put "Cancel" button at bottom of window
"NoSkipButton"
Don't put "Skip" button at bottom of window
"NoRedrawButton"
Don't put "Redraw" button at bottom of window
"NoToolBoxTool"
Don't add "ToolBox" tool
"NoStatusLine"
Don't create "status" line
"NoIconBar"
Don't create iconbar
"NoDftDrawIcons"
Don't create default "draw" icons when creating window
"NoDftViewIcons"
Don't create default "view" icons when creating window
"NoDftMarkIcons"
Don't create default "mark" icons when creating window
"NoScalePosLine"
Don't create zoom/scale/position line at bottom of view window
"NoScrollbars"
Don't create scroll bars
戻り値
class GRE_VIEW
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
###################### # # ORBITSP.SML # # Demonstration of movie generation from 3D display using spiral # orbit path. Both 2D and 3D views are copied into each movie frame. # # View center is fixed at center of group. Viewer position is computed # from size of group. Two complete orbits are made. The first starts # beyond the edge of group and spirals inward and downward; the second # spirals outward and upward. # # Script uses an input DEM for the surface layer, an input raster drape # layer, and an input vector drape layer. # # Requires TNTmips Version 6.5 # ##################### clear(); #### Set movie format, frame rate, and recording time # Movie format (Possible values : "MPEG"(All platform) or "AVI"(Windows only) string format$; format$ = "AVI"; # Frame rate # Possible values : # "MOVIE_FRAMERATE_23_976" 23.976 (24000/1001) fps - NTSC encapsulated film rate # "MOVIE_FRAMERATE_24" 24 fps - Standard international cinema film rate # "MOVIE_FRAMERATE_25" 25 fps - PAL (625/50) video frame rate # "MOVIE_FRAMERATE_29_970" 29.97 (30000/1001) fps - NTSC video frame rate # "MOVIE_FRAMERATE_30" 30 fps - NTSC drop-frame (525/60) video frame rate # "MOVIE_FRAMERATE_50" 50 fps - Double frame rate / progressive PAL # "MOVIE_FRAMERATE_59_940" 59.94 (60000/1001) fps - Double frame rate NTSC # "MOVIE_FRAMERATE_60" 60 fps - Double frame rate drop-frame NTSC string framerate$; framerate$ = "MOVIE_FRAMERATE_24"; # Recording time numeric time; time = 60; ###### Get RVC objects to load raster Surface, RastDrape; vector VectDrape; print("Select raster to use for surface"); GetInputRaster(Surface); print("Select raster to use for first drape layer"); GetInputRaster(RastDrape); print("Select vector to use for second drape layer"); GetInputVector(VectDrape); ###### RVC style object to draw center point and viewer point string styleFilename$; string styleObjectname$; GetInputObject("Style","Select style object for center and viewer point symbols:", styleFilename$, styleObjectname$); string viewer$; viewer$ = "VIEWER"; string center$; center$ = "CENTER"; ######## Create display group with 2d and 3d views print("START"); # Size of squared 2D view and 3D view # Should be evenly divisible by 8 numeric size; size = 400; # Zoom out factor for 2D view numeric zoomfactor; zoomfactor = 1.8; # Create group print("Creating Group"); class GRE_GROUP group; group = GroupCreate(); # Create flags to create view without iconbar, scrollbars, status line and scale/position line # This is important to maintain fixed window size for movie generation string flags$; flags$ = "NoScalePosLine,NoIconBar,NoScrollbars,NoStatusLine"; # Create dialog and 2D view print("Creating dialog and 2D view"); class XmForm dialog2d; class GRE_VIEW view2d; dialog2d = CreateFormDialog("VIEW 2D"); view2d = GroupCreateView(group,dialog2d,"",size,size,flags$); view2d.BackgroundColor.red = 67; view2d.BackgroundColor.green = 100; view2d.BackgroundColor.blue = 100; # Create dialog and 3D view print("Creating dialog and 3D view"); class XmForm dialog3d; class GRE_VIEW3D view3d; dialog3d = CreateFormDialog("VIEW 3D"); view3d = GroupCreate3DView(group,dialog3d,"",size,size,flags$); view3d.BackgroundColor.red = 67; view3d.BackgroundColor.green = 100; view3d.BackgroundColor.blue = 100; # Add layers to group GroupQuickAddRasterVar(group,Surface,1); GroupQuickAddRasterVar(group,RastDrape,0); GroupQuickAddVectorVar(group,VectDrape); # Open both views DialogOpen(dialog2d); DialogOpen(dialog3d); # Full redraw of both views ViewRedrawFull(view2d); ViewRedrawFull(view3d); ViewZoomOut(view2d,zoomfactor,1); ####### Set up parameters for movie frame # Destination of each view in final frame for movie numeric x2d, y2d, x3d, y3d, w, h; x2d = 0; y2d = 0; x3d = size; y3d = 0; w = 2 * size; h = size; # Create text strings for annotation in frame string frameTitle$; string frameTitle2$; frameTitle$ = "Mount St. Helens Flow Hazard Zonation"; frameTitle2$ = "and Survey Station Locations"; # Font size numeric fontsize; fontsize = 16; # Define color for text annotation in frame class Color black; black.red = 0; black.green = 0; black.blue = 0; # Creating frame print("Creating frame for movie"); class Frame frame; frame = FrameCreate(w,h); # Create graphics context (GC) for frame print("Creating GC from frame and activate it"); ActivateGC(FrameCreateGC(frame)); DrawTextSetHeightPixels(fontsize); DrawUseStyleObject(styleFilename$,styleObjectname$); ######## Set some more movie parameters # Initiale Movie print("Initializing Movie"); class Movie movie; movie = MovieInit(); # Check framerate and force it to "MOVIE_FRAMERATE_24" if it is invalid numeric rate; rate = 24; if (framerate$ == "MOVIE_FRAMERATE_23_976") rate = 23.976; if (framerate$ == "MOVIE_FRAMERATE_25") rate = 25.0; if (framerate$ == "MOVIE_FRAMERATE_29_970") rate = 29.970; if (framerate$ == "MOVIE_FRAMERATE_30") rate = 30.0; if (framerate$ == "MOVIE_FRAMERATE_50") rate = 50.0; if (framerate$ == "MOVIE_FRAMERATE_59_940") rate = 59.940; if (framerate$ == "MOVIE_FRAMERATE_60") rate = 60.0; if (rate == 24.0) framerate$ = "MOVIE_FRAMERATE_24"; # Set Movie Parameters print("Setting Movie Parameters"); MovieSetFormat(movie,format$); MovieSetFrameRate(movie,framerate$); MovieSetFrameWidth(movie,w); MovieSetFrameHeight(movie,h); # Make Output File string ext$; ext$ = MovieGetFileExt(movie); string filename$; filename$ = GetOutputFileName("","Make filename for movie",ext$); printf("Filename = %s\n",filename$); # Check recording time if (time <= 1.0) time = 1.0; ##### Get georeference for surface layer and reset to group projection class Georef georef; georef = GetLastUsedGeorefObject(Surface); GeorefSetProjection(georef,group.Projection); # Find map coordinates and surface elevation at center of group # and define as view point (center) class POINT3D center; center.x = group.Center.x; center.y = group.Center.y; numeric objx; numeric objy; MapToObject(georef,center.x,center.y,Surface,objx,objy); center.z = Surface[objy,objx]; ##### Set up viewpoint and viewer position parameters class VIEWPOINT3D vp; vp = view3d.ViewPoint; vp.SetCenter(center); class POINT3D pt; # viewer position class POINT2D point; # 2D point for location symbols # Set initial viewer position north of center just beyond group extents # and 10000 m higher than center point pt.x = group.Center.x; pt.y = group.Extents.y2 + 0.6 * (group.Extents.y2 - group.Center.y); pt.z = center.z + 10000; vp.SetViewerPosition(pt); # Calculate spiral orbit parameters numeric numFrames = time * rate; numeric deltaAngle = -360.0 / numFrames * 2; numeric tx = vp.ViewPos.x - vp.CenterPoint.x; numeric ty = vp.ViewPos.y - vp.CenterPoint.y; numeric distance = 4 * sqrt(tx * tx + ty * ty) / 5 / numFrames * 2; numeric height = (vp.ViewPos.z - vp.CenterPoint.z) / numFrames * 2; ###### Start recording movie to file MovieStart(movie,filename$); # Loop for each frame numeric i, azimuth; for i = 1 to numFrames { SetStatusMessage(sprintf("Processing frame %d of %d",i,numFrames)); # Rotate viewer position around center with deltaAngle increment vp.RotateViewerPosition(deltaAngle); if (i <= numFrames / 2) { # Move viewer position closer and higher to center point azimuth = vp.AzimAngle * 180 / PI; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,90,height,"m"); } else { # Move viewer position farther and lower from center point azimuth = vp.AzimAngle * 180 / PI + 180; # make it in degrees vp.MoveViewerPosition(azimuth,0,distance,"m"); vp.MoveViewerPosition(0,-90,height,"m"); } # ViewRedrawDirect(view3d,"NoBlankScreen"); # This new function added after release of TNTmips 6.5 # can redraw the view without blanking it first. Use of # this function eliminates "flashing" of the view as the # movie is initially rendered. It has no effect on the # output movie file. For 6.5 release version, use the # function in the next statement. ViewRedraw(view3d); # Copy 2d view and 3d view to destination frame FrameCopyFromView(frame,view2d,0,0,size,size,x2d,y2d); FrameCopyFromView(frame,view3d,0,0,size,size,x3d,y3d); # Draw center point in 2d view point.x = vp.CenterPoint.x; point.y = vp.CenterPoint.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(center$); DrawPoint(point.x,point.y); # Draw viewer position point in 2d view point.x = vp.ViewPos.x; point.y = vp.ViewPos.y; point = TransPoint2D(point,ViewGetTransMapToView(view2d,group.Projection)); point = TransPoint2D(point,ViewGetTransViewToScreen(view2d)); DrawSetPointStyle(viewer$); DrawPoint(point.x,point.y); # Draw text to top of frame DrawTextSetColors(black); DrawTextSimple(frameTitle$,5,fontsize); DrawTextSimple(frameTitle2$,5,2.2*fontsize); # Add frame to movie MovieAddFrame(movie,frame); } # End of main processing loop # Stop and Exit movie MovieStop(movie); MovieExit(movie); # Close dialogs DialogClose(dialog2d); DialogClose(dialog3d); print("END");
GroupDestroy
Destroy a group.
GroupDestroy(group)
場所:
空間データグループ
パラメータ:
class GRE_GROUP group
The group to destroy
戻り値
class GRE_GROUP
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/Misc/PrintRasterLayout.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
GroupGetLayerByName
Get a layer pointer given the layer name.
GroupGetLayerByName(group, name$)
場所:
空間データグループ
パラメータ:
class GRE_GROUP group
The group
string name$
The layer name
詳細と仮定
The layer name may or may not be equal to the object's name (depending on display settings).
If possible, use the ActiveLayer or allow the user to select the desired layer.
戻り値
class GRE_LAYER
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/doqq7.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
GroupOpenLayerManagerWindow
Create "layer manager" dialog
GroupOpenLayerManagerWindow(parent, group)
場所:
空間データグループ
パラメータ:
戻り値
class GRE_LAYERMANAGER
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
# no sample necessary
GroupRead
Read a saved display group from a file
GroupRead(group, filename$, objectname$)
場所:
空間データグループ
パラメータ:
class GRE_GROUP group
A group class
string filename$
RVC filename
string objectname$ (オプション)
Object name
詳細と仮定
If no objectname is specified the group will be read from the filename as text
戻り値
なし
作成日時: 11-Jun-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GroupRemoveAllLayers
Remove all layers from a group.
GroupRemoveAllLayers(group)
場所:
空間データグループ
パラメータ:
class GRE_GROUP group
The group to remove all layers from
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GroupRemoveLayer
Remove a single layer from a group
GroupRemoveLayer(group, layer)
場所:
空間データグループ
パラメータ:
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GroupSetActiveLayer
Set the active layer for a group
GroupSetActiveLayer(group, layer)
場所:
空間データグループ
パラメータ:
戻り値
なし
作成日時: 05-Jun-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GroupWrite
Save a display group to a file
GroupWrite(group, filename$, objectname$, description$)
場所:
空間データグループ
パラメータ:
class GRE_GROUP group
The group to save
string filename$
RVC filename
string objectname$ (オプション)
Object name
string description$ (オプション)
Object description
詳細と仮定
If no objectname is specified the group will be written to the filename as text
戻り値
なし
作成日時: 11-Jun-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
CADLayerGetObject
Set a CAD variable to point to the CAD object from a CADLayer
CADLayerGetObject(layer, Object)
場所:
空間データ表示
パラメータ:
class GRE_LAYER_CAD layer
The CAD layer
CAD Object
A CAD object variable (undefined ok)
戻り値
なし
作成日時: 17-Jun-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
CADLayerSetObject
Change the object used by a CAD layer
CADLayerSetObject(layer, Object)
場所:
空間データ表示
パラメータ:
class GRE_LAYER_CAD layer
The CAD layer
CAD Object
The CAD object
戻り値
なし
作成日時: 26-Jun-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
DispAddButtons
Adds custom buttons to a display
DispAddButtons(disp, button1$, button2$, ...$)
場所:
空間データ表示
パラメータ:
class DISP disp
A display handle
string button1$
A string indicating the label of the button
string button2$ (オプション)
A string indicating the lable of the 2nd button
string ...$ (オプション)
(you can have any number of buttons)
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
clear(); class DISP handle; handle=DispOpen(); DispSetName(handle, "Window1"); DispAddButtons(handle, "Close"); string str$=DispWaitForButtonPress(handle); if (str$ == "Close") { print("Close Pressed"); DispClose(handle); }
DispAddCallback
Register function to call when an action happens on a view.
DispAddCallback(callback, function, data)
場所:
空間データ表示
パラメータ:
class CALLBACKLIST callback
A class member of type XmCallbackList
proc function
Function to call for view event
class anything data (オプション)
Data sent to function
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
Unable to locate sample script "smlsamples/StandAlone/planter.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
DispAddRaster
Adds a raster layer to a display window
DispAddRaster(disp, filename$, objectnum)
場所:
空間データ表示
パラメータ:
class DISP disp
A valid display handle
string filename$
A string indicating path and project name
numeric objectnum
Object number of raster, use GetObjectNumber() to
retrieve
詳細と仮定
The display does not automatically redraw after a DispAddRaster().
戻り値
class GRE_LAYER_RASTER
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
clear(); class DISP handle; raster Rvar; GetInputRaster(Rvar); string fileName$=Rvar.$Info.Filename; numeric objectNumber=GetObjectNumber(Rvar); handle=DispOpen(); DispAddRaster(handle, fileName$, objectNumber); DispRedraw(handle); CloseRaster(Rvar);
DispAddRasterVar
Same as DispAddRaster() except uses SML raster variable
DispAddRasterVar(disp, Raster)
場所:
空間データ表示
パラメータ:
class DISP disp
A valid display handle
Raster Raster
Any valid raster variable
詳細と仮定
The display does not automatically redraw after a
DispAddRasterVar().
戻り値
class GRE_LAYER_RASTER
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
clear(); class DISP handle; raster Rvar; GetInputRaster(Rvar); # open a raster handle=DispOpen(); DispAddRasterVar(handle, Rvar); DispRedraw(handle); CloseRaster(Rvar);
DispAddStandardTools
Add standard tools to a display, (zoom box, slide view, and measurement)
DispAddStandardTools(disp)
場所:
空間データ表示
パラメータ:
class DISP disp
A valid display handle
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
clear(); class DISP handle; handle=DispOpen(); DispAddStandardTools(handle); # adds the tools
DispClose
Closes the display associated with handle displayNumber
DispClose(disp)
場所:
空間データ表示
パラメータ:
class DISP disp
A valid display handle
詳細と仮定
If the handle is zero, the display functions will
ignore any calls using that handle. A useful safety
tip is to always set handle to zero after closing a display.
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
clear(); class DISP handle; handle=DispOpen(); DispAddStandardTools(handle); # adds the tools # do something with the display DispClose(handle);
DispGetMapScale
Returns the current map scale of the display associated with displayNumber
DispGetMapScale(disp)
場所:
空間データ表示
パラメータ:
class DISP disp
Any valid display handle
詳細と仮定
The map scale of an empty display is undefined.
戻り値
numeric
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
clear(); class DISP handle; raster Rvar; handle=DispOpen(); DispQuickAddRasterVar(handle, Rvar); DispRedraw(handle); print(DispGetMapScale(handle)); DispClose(handle);
DispGetRasterFromLayer
Get the raster used by a given layer.
DispGetRasterFromLayer(Object, layer, component)
場所:
空間データ表示
パラメータ:
Raster Object
The Raster object
class GRE_LAYER layer
The layer
numeric component (オプション)
The nth component
0 for RED, 1 for GREEN, 2 for BLUE for RGB Raster
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
Unable to locate sample script "smlsamples/ToolScript/Rastprof.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
DispGetVectorFromLayer
Get the vector used by a given layer.
DispGetVectorFromLayer(Object, layer)
場所:
空間データ表示
パラメータ:
Vector Object
The Vector object
class GRE_LAYER layer
The layer
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
Unable to locate sample script "smlsamples/ToolScript/elemsel.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
DispLastButtonPressed
Returns the label of the last button that was pressed
DispLastButtonPressed(disp)
場所:
空間データ表示
パラメータ:
class DISP disp
Any valid display handle
詳細と仮定
You must use DispResetButtons() after this function.
Subsequent calls to DispLastButtonPressed() return the
same string unless DispResetButtons() is called.
戻り値
string
a string-indicating label of last button pressed, or ""
if none pressed
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
clear(); class DISP handle1; handle1=DispOpen(); DispSetName(handle1, "Window1"); DispAddButtons(handle1, "Close"); string str$=DispLastButtonPressed(handle1); # reset button so it can be used again DispResetButtons(handle1); if (str$ == "Close") then DispClose(handle1);
DispOpen
Opens a display and returns a handle to the display
DispOpen(xsize, ysize, x, y)
場所:
空間データ表示
パラメータ:
numeric xsize (オプション)
The x dimension of the display
numeric ysize (オプション)
The y dimension of the display
numeric x (オプション)
The x position of the display
numeric y (オプション)
The y position of the display
戻り値
class DISP
a handle to the display, used by other display
functions that require an open display window.
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
clear(); class DISP disp1, disp2; disp1=DispOpen(); disp2=DispOpen(); DispSetTitle(disp1, "Display 1"); # set the titles DispSetTitle(disp2, "Display 2");
DispPanTo
Pan to a given location.
DispPanTo(disp, x, y, redraw)
場所:
空間データ表示
パラメータ:
class DISP disp
Handle for an open display.
numeric x
X coordinate to pan to.
numeric y
Y coordinate to pan to.
numeric redraw (オプション)
1 to redraw after operation or 0 to not.
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
class DISP mydisp; raster R; OpenRaster(R, "c:/tnt/benchmarks/benchmrk.sml", "milogo24"); mydisp = DispOpen(700,500); DispQuickAddRasterVar(mydisp, R); DispRedraw(mydisp); DispZoomIn(mydisp,4,1); DispPanTo(mydisp,.03,.03,1);
DispQuickAddCAD
Adds a CAD layer to display window referenced by displayNumber
DispQuickAddCAD(disp, filename$, objectnum)
場所:
空間データ表示
パラメータ:
class DISP disp
A valid display handle
string filename$
A string indicating path and project name
numeric objectnum
Object number of CAD object, use
GetObjectNumber() to retrieve
詳細と仮定
The display does not automatically redraw after a
DispQuickAddCad().
戻り値
class GRE_LAYER_CAD
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
clear(); class DISP handle; cad C; GetInputCAD(C); string fileName$=C.$Info.Filename; numeric objectNumber=GetObjectNumber(C); handle=DispOpen(); DispQuickAddCAD(handle, fileName$, objectNumber); DispRedraw(handle);
DispQuickAddCADVar
Quick add a CAD object to a Disp window given a CAD variable
DispQuickAddCADVar(disp, CADVar)
場所:
空間データ表示
パラメータ:
class DISP disp
Display to add object to
CAD CADVar
Oject variable to add
戻り値
class GRE_LAYER_CAD
作成日時: 06-Jul-2001
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
clear(); class DISP handle; cad C; GetInputCAD(C); handle=DispOpen(); DispQuickAddCADVar(handle, C); DispRedraw(handle);
DispQuickAddRaster
Adds a raster layer to display window referenced by displayNumber
DispQuickAddRaster(disp, filename$, objectnum)
場所:
空間データ表示
パラメータ:
class DISP disp
A valid display handle
string filename$
A string indicating path and project name
numeric objectnum
Object number of raster, use GetObjectNumber() to retrieve
詳細と仮定
The display does not automatically redraw after a
DispQuickAddRaster().
戻り値
class GRE_LAYER_RASTER
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
class DISP handle; raster R; GetInputRaster(R); string filename$=R.$Info.Filename; numeric objectNumber=GetObjectNumber(R); handle=DispOpen(); DispQuickAddRaster(handle, filename$, objectNumber); DispRedraw(handle);
DispQuickAddRasterVar
Same as DispQuickAddRaster() except uses SML raster variable
DispQuickAddRasterVar(disp, Raster)
場所:
空間データ表示
パラメータ:
class DISP disp
A valid display handle
Raster Raster
Any valid raster variable
詳細と仮定
The display does not automatically redraw after a
DispQuickAddRasterVar().
戻り値
class GRE_LAYER_RASTER
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
class DISP handle; class GRE_LAYER_RASTER layer; raster Rvar; GetInputRaster(Rvar); # open a raster handle=DispOpen(); layer = DispQuickAddRasterVar(handle, Rvar); DispRedraw(handle);
DispQuickAddTIN
Adds a TIN layer to display window referenced by displayNumber
DispQuickAddTIN(disp, filename$, objectnum)
場所:
空間データ表示
パラメータ:
class DISP disp
A valid display handle
string filename$
A string indicating path and project name
numeric objectnum
Object number of TIN, use GetObjectNumber() to retrieve
詳細と仮定
The display does not automatically redraw after a
DispQuickAddTIN().
戻り値
class GRE_LAYER_TIN
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
# no sample necessary
DispQuickAddTINVar
Quick add TIN object to a Disp window given a TIN variable
DispQuickAddTINVar(disp, TINVar)
場所:
空間データ表示
パラメータ:
class DISP disp
Display to add object to
TIN TINVar
Oject variable to add
戻り値
class GRE_LAYER_TIN
作成日時: 06-Jul-2001
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
# no sample necessary
DispQuickAddVector
Adds a vector layer to display window referenced by displayNumber
DispQuickAddVector(disp, filename$, objectnum)
場所:
空間データ表示
パラメータ:
class DISP disp
A valid display handle
string filename$
A string indicating path and project name
numeric objectnum
Object number of vector, use
GetObjectNumber() to retrieve
詳細と仮定
The display does not automatically redraw after a
DispQuickAddVector().
戻り値
class GRE_LAYER_VECTOR
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
class DISP handle; vector V; GetInputVector(V); string filename$=V.$Info.Filename; numeric objectNumber=GetObjectNumber(V); handle=DispOpen(); DispQuickAddVector(handle, filename$, objectNumber); DispRedraw(handle);
DispQuickAddVectorVar
Same as DispQuickAddVector() except uses SML vector variable
DispQuickAddVectorVar(disp, Vector)
場所:
空間データ表示
パラメータ:
class DISP disp
A valid display handle
Vector Vector
Any valid Vector variable
詳細と仮定
The display does not automatically redraw after a
DispQuickAddVectorVar().
戻り値
class GRE_LAYER_VECTOR
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
class DISP handle; class GRE_LAYER_VECTOR layer; vector V; GetInputVector(V); # open a vector handle=DispOpen(); layer = DispQuickAddVectorVar(handle, V); DispRedraw(handle);
DispRedraw
Same as clicking "Redraw"
DispRedraw(disp)
場所:
空間データ表示
パラメータ:
class DISP disp
Any valid window handle
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
class DISP handle; class GRE_LAYER_RASTER layer; raster Rvar; GetInputRaster(Rvar); # open a raster handle=DispOpen(); layer = DispQuickAddRasterVar(handle, Rvar); DispRedraw(handle);
DispRedrawFull
Same as clicking "Full view"
DispRedrawFull(disp)
場所:
空間データ表示
パラメータ:
class DISP disp
Any valid window handle
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
vector Vvar; class DISP handle; GetInputVector(Vvar); # open a vector handle=DispOpen(); DispQuickAddVectorVar(handle, Vvar); DispRedrawFull(handle);
DispRemoveAllLayers
Removes all layers from display referenced by displayNumber
DispRemoveAllLayers(disp)
場所:
空間データ表示
パラメータ:
class DISP disp
Any valid window handle
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
vector Vvar1, Vvar2; class DISP handle; handle=DispOpen(); GetInputVector(Vvar1); # open a vector GetInputVector(Vvar2); # open a second vector DispQuickAddVectorVar(handle, Vvar1); DispQuickAddVectorVar(handle, Vvar2); DispRedrawFull(handle); DispRemoveAllLayers(handle);
DispResetButtons
Forces system to "forget" last button pressed
DispResetButtons(disp)
場所:
空間データ表示
パラメータ:
class DISP disp
Any valid window handle
詳細と仮定
Used in conjunction with DispLastButtonPressed() and DispWaitForButtonPress().
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
raster Rvar; class DISP handle1; handle1=DispOpen(); DispSetName(handle1, "Window1"); DispAddButtons(handle1, "Close"); string str$=DispWaitForButtonPress(handle1); # reset button so it can be used again DispResetButtons(handle1); if (str$ == "Close") then DispClose(handle1);
DispSetBackgroundColor
Set the background color of a display
DispSetBackgroundColor(disp, red, green, blue)
場所:
空間データ表示
パラメータ:
class DISP disp
Description
numeric red
Red value (0-255)
numeric green
Green value (0-255)
numeric blue
Blue value (0-255)
詳細と仮定
Note, the numeric range of color componants here is 0-255 instead
of 0-100 as it is elsewhere.
This function is for older scripts using the Display class instead
of the newer Group/View classes. On a View, you would do...
view.BackgroundColor.Name = "white";
or
view.BackgroundColor.Red = 100;
view.BackgroundColor.Green = 100;
view.BackgroundColor.Blue = 100;
戻り値
なし
作成日時: 30-Jul-1999
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
# no sample necessary
DispSetMapScale
Sets the map scale for a display
DispSetMapScale(disp, mapscale)
場所:
空間データ表示
パラメータ:
class DISP disp
Any valid window handle
numeric mapscale
A number-equal to the denominator in the
scale ratio 1 / mapscale
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
clear(); class DISP handle; handle=DispOpen(); DispSetMapScale(handle, 24000); # sets map scale to 1:24,000
DispSetMessage
Displays string in message area of display window
DispSetMessage(disp, message$)
場所:
空間データ表示
パラメータ:
class DISP disp
Any valid window handle
string message$
A string holding the message
詳細と仮定
the display is open
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
class DISP handle; handle=DispOpen(); DispSetMessage(handle, "This is a message");
DispSetMinMaxIndexFromGroup
Set Raster cells to layer index of Raster with largest/smallest cell value in a group
DispSetMinMaxIndexFromGroup(Object, group, MinMaxFlag$)
場所:
空間データ表示
パラメータ:
Raster Object
Output Raster object
class GRE_GROUP group
Group containing Rasters
string MinMaxFlag$
Minimum/maximum flag
可能性のある値:
"Min"
set cells to minimum of all Rasters
"Max"
set cells to maximum of all Rasters
詳細と仮定
Rasters are non-composite types and are same size as output Raster
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
class DISP handle; class GRE_GROUP g; raster Rout, R1, R2, R3; GetInputRaster(R1, 0, 0, "8-bit unsigned"); GetInputRaster(R2, NumLins(R1), NumCols(R1), RastType(R1)); GetInputRaster(R3, NumLins(R1), NumCols(R1), RastType(R1)); GetOutputRaster(Rout, NumLins(R1), NumCols(R1), RastType(R1)); handle = DispOpen(); DispQuickAddRasterVar(handle, R1); DispQuickAddRasterVar(handle, R2); DispQuickAddRasterVar(handle, R3); DispRedraw(handle); g = handle.Group; DispSetMinMaxIndexFromGroup(Rout, g, "Max");
DispSetName
Sets the name of a display window
DispSetName(disp, name$)
場所:
空間データ表示
パラメータ:
class DISP disp
Any valid window handle
string name$
A string holding the message
詳細と仮定
The name is used by the button functions to return a string
indicating what button was pressed in which window. The returned
value from DispWaitForButtonPress(), (with no display number
parameter), is "WindowName.ButtonName"
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
raster Rvar; class DISP handle1, handle2; handle1=DispOpen(); handle2=DispOpen(); DispSetName(handle1, "Window1"); DispSetName(handle2, "Window2"); string str$=DispWaitForButtonPress(); DispSetMessage(handle2, "Button press message is " + str$); DispClose(handle1); DispClose(handle2);
DispSetStatusBar
Set the status bar on a standalone display window.
DispSetStatusBar(disp, value, max)
場所:
空間データ表示
パラメータ:
class DISP disp
The display
numeric value
The value to set
numeric max
The maximum value
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
# no sample necessary
DispSetTitle
Displays string in title area of display window
DispSetTitle(disp, title$)
場所:
空間データ表示
パラメータ:
class DISP disp
Any valid window handle
string title$
A string holding the message
詳細と仮定
the display is open
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
class DISP handle; handle=DispOpen(); DispSetTitle(handle, "My Custom Window");
DispStatusBarClear
Clear the status bar.
DispStatusBarClear(disp)
場所:
空間データ表示
パラメータ:
class DISP disp
The display
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
# no sample necessary
DispWaitForButtonPress
Suspend execution and wait until button event
DispWaitForButtonPress(disp)
場所:
空間データ表示
パラメータ:
class DISP disp (オプション)
Optional - a window handle. If used, then wait for a
button press in a specific window. If not used, then you
may intercept button events from any window
詳細と仮定
If disp parameter is not used then the returned value is in
the form "Windowname.ButtonLabel". If disp parameter is used
then the returned value is in the form "ButtonLabel".
You must use DispResetButtons() after this function.
Subsequent calls to DispWaitForButtonPress() return the
same string unless DispResetButtons() is called.
戻り値
string
a string - if disp parameter is used then returns "ButtonLabel",
if disp parameter is omitted then returns "WindowName.ButtonLabel"
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
class DISP handle; handle=DispOpen(); DispSetName(handle, "Window1"); string str$ = DispWaitForButtonPress(handle); DispResetButtons(handle); DispSetMessage(handle, "ButtonPressed = " + str$); DispClose(handle);
DispZoom1X
Same as clicking "Zoom 1X"
DispZoom1X(disp, redraw)
場所:
空間データ表示
パラメータ:
class DISP disp
Any valid window handle
numeric redraw (オプション)
If non-zero, redraw now.
詳細と仮定
displays one pixel per raster cell
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
raster Rvar; class DISP handle; GetInputRaster(Rvar); # open a raster handle=DispOpen(); DispQuickAddRasterVar(handle, Rvar); DispZoom1X(handle);
DispZoomIn
Same as clicking "Zoom In"
DispZoomIn(disp, zoomfactor, redraw)
場所:
空間データ表示
パラメータ:
class DISP disp
Any valid window handle
numeric zoomfactor (オプション)
Optional - a number indicating zoom,
numeric redraw (オプション)
default value is two
Optional - a Boolean value indicating
whether to redraw the display, default
value is true
詳細と仮定
Zoomfactor is relative to the current zoom factor.
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
# DispZoomIn raster Rvar; class DISP handle; GetInputRaster(Rvar); # open a raster handle=DispOpen(); DispQuickAddRasterVar(handle, Rvar); DispZoom1X(handle, true); # sets current zoomFactor to one # zoom in to four pixels per raster cell, with redraw DispZoomIn(handle, 4, true); # zoom in to eight pixels per raster cell, with redraw DispZoomIn(handle); # zoomFactor==2, redraw==true are implied
DispZoomOut
Same as clicking "Zoom Out"
DispZoomOut(disp, zoomfactor, redraw)
場所:
空間データ表示
パラメータ:
class DISP disp
Any valid window handle
numeric zoomfactor (オプション)
Optional - a number indicating zoom,
numeric redraw (オプション)
default value is two
Optional - a Boolean value indicating
whether to redraw the display, default
value is true
詳細と仮定
Zoomfactor is relative to the current zoom factor.
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
raster Rvar; class DISP handle; GetInputRaster(Rvar); # open a raster handle=DispOpen(); DispQuickAddRasterVar(handle, Rvar); DispZoom1X(handle,true) ; # sets current zoomFactor to one # zoom out to four pixels per raster cell, with redraw DispZoomOut(handle, 4, true); # zoom out to eight pixels per raster cell, with redraw DispZoomOut(handle); # zoomFactor==2, redraw==true are implied
DispZoomTo
Pan to a given location.
DispZoomTo(disp, x, y, zoomfactor, redraw)
場所:
空間データ表示
パラメータ:
class DISP disp
Handle for an open display.
numeric x
X coordinate to pan to.
numeric y
Y coordinate to pan to.
numeric zoomfactor (オプション)
Reletive zoom factor.
numeric redraw (オプション)
1 to redraw after operation or 0 to not.
戻り値
なし
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: いいえ
例:
# no sample necessary
GroupAddMapGridLayer
Add a MapGridLayer to a group
GroupAddMapGridLayer(group, refsys, xinterval, yinterval, units$, extentsProjection, extents)
場所:
空間データ表示
パラメータ:
class GRE_GROUP group
Group to add MapGridLayer to
class SR_COORDREFSYS refsys
The coordinate reference system
numeric xinterval
Grid x interval in ground meters or decimal degrees
numeric yinterval
Grid y interval in ground meters or decimal degrees
string units$
Units for interval
class SR_COORDREFSYS extentsProjection (オプション)
Projection the extents are given in
class RECT extents (オプション)
Extents (will use current group extents if omitted)
戻り値
class GRE_LAYER_MAPGRID
作成日時: 01-Feb-1999
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
Unable to locate sample script "smlsamples/StandAlone/doqq7.sml" for this function. Please download latest collection of reference scripts from www.microimages.com and try again.
GroupAddRaster
Add a raster to a group by name
GroupAddRaster(group, filename$, objectnum, isElevation)
場所:
空間データ表示
パラメータ:
class GRE_GROUP group
The group to add to
string filename$
RVC file name
numeric objectnum
Object number of Raster
numeric isElevation (オプション)
The raster is a surface
戻り値
class GRE_LAYER_RASTER
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GroupAddRasterVar
Add a raster to a group.
GroupAddRasterVar(group, Raster, isElevation)
場所:
空間データ表示
パラメータ:
class GRE_GROUP group
The group to add to
Raster Raster
The Raster to add
numeric isElevation (オプション)
The raster is a surface
戻り値
class GRE_LAYER_RASTER
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GroupQuickAddCAD
Quick add a CAD layer (prompt).
GroupQuickAddCAD(group, filename$, objectnum)
場所:
空間データ表示
パラメータ:
class GRE_GROUP group
The group to add to
string filename$
RVC file name
numeric objectnum
CAD object number
戻り値
class GRE_LAYER_CAD
作成日時: 01-Dec-1997
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GroupQuickAddCADVar
Quick add a CAD layer given a CAD variable
GroupQuickAddCADVar(group, CADVar)
場所:
空間データ表示
パラメータ:
class GRE_GROUP group
Group to add the object to
CAD CADVar
Oject variable to add
戻り値
class GRE_LAYER_CAD
作成日時: 07-Jun-2001
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GroupQuickAddDBPinmap
Add a database pinmap to a group.
GroupQuickAddDBPinmap(group, filename$, objectname$, tablename$, xfieldname$, yfieldname$)
場所:
空間データ表示
パラメータ:
class GRE_GROUP group
The group to add the pin map to
string filename$
RVC file of pinmap
string objectname$
Pinmap object name
string tablename$
Table name
string xfieldname$
Field holding x coordinates of pin locations
string yfieldname$
Field holding y coordinates of pin locations
戻り値
class GRE_LAYER_PINMAP
作成日時: 03-Apr-1998
修正日時: なし
TNTsml for Windows で使用可能: はい
例:
# no sample necessary
GroupQuickAddRaster
Quick add a Raster layer (prompt).
GroupQuickAddRaster(group, filename$, objectnum, isElevation)
場所:
空間データ表示
パラメータ:
class GRE_GROUP group
The group to add to
string filename$
RVC file name
numeric objectnum
Raster object number
numeric isElevation (オプション)