Description This function adds a diffuse polynomial scatter model to the FRED document using a text file as the source defining the parameters and coefficients.
Syntax nScatter = AddDiffusePolynomialFromFile( fName, tDiff, dCoefs( ) )
Parameters nScatter As Long Returned index number of the scatter model that was added to the document.
fName As String Full path name to the file from which the scatter model is being created. See the diffuse polynomial help topic for a description of the file format specification.
tDiff As T_DIFFUSEPOLYNOMIAL Data structure defining the generic parameters of the scatter model being added. The structure members n, m, l, lp and D are overridden by the contents of the text file. After the function is executed, the values in structure members n, m, l, lp and D will reflect the contents of the text file.
dCoefs() As Double This array variable is passed into the function call as an argument. If the function call is successful, then dCoefs() stores the values of the coefficients from the text file.
Example The following example initializes a T_DIFFUSEPOLYNOMIAL data structure, adds a diffuse polynomial model scatter model to the document and then prints out a summary of the model that was added.
Sub Main
Dim tDiff As T_DIFFUSEPOLYNOMIAL Dim coefs() As Double Dim fName As String Dim sNode As Long Dim curCoef As Double
fName = "C:\temp\SampleDiffusePolynomialModel.txt"
InitDiffusePolynomial( tDiff ) tDiff.name = "Sample diffuse polynomial from file" sNode = AddDiffusePolynomialFromFile( fName, tDiff, coefs() )
Print "Diffuse Polynomial scatter model added at node " & sNode Print "Parameters:" Print Chr(9) & "n = " & tDiff.n Print Chr(9) & "m = " & tDiff.m Print Chr(9) & "l = " & tDiff.L Print Chr(9) & "lp= " & tDiff.lp Print Chr(9) & "D = " & tDiff.D Print Chr(9) & "mode = " & tDiff.lMode Print "Coefficients:" For Each curCoef In coefs() Print Chr(9) & curCoef Next
End Sub
See Also
|