Navigation: Scripting Reference Manual > Functions & Subroutines > SGSurfSetIthTermData

 

SGSurfSetIthTermData

 

Contact Us: fredsupport@photonengr.com

 

Description

This command sets the data for each parameter of the I'th term in an SGS surface.  Please see the SGS Surface documentation for a description of the term parameters and functional form.

 

Syntax

SGSurfSetIthTermData sgsNode, ithTerm, pdCoeff, pdX0, pdY0, pdSx, pdSy, nPx, nPy, nP, thetaDeg

 

 

Parameters

sgsNode As Long

Node number of the SGS surface whose I'th term is being modified.

 

ithTerm As Long

Term identifier (0 based) indicating which term in the SGS surface's term list is being modified.

 

pdCoeff As Double

Coefficient of the I'th term.

 

pdX0 As Double

Position offset in the X direction for the I'th term.

 

pdY0 As Double

Position offset in the Y direction for the I'th term.

 

pdSx As Double

Sigma_x parameter of the I'th term.  Related to the full width at half max by, fwhm_x = 2*Sqr[2ln(2)] *sigma_x.

 

pdSy As Double

Sigma_y parameter of the I'th term.  Related to the full width at half max by, fwhm_y = 2*Sqr[2ln(2)] *sigma_y.

 

nPx As Long

X power multiple for the I'th term.

 

nPy As Long

Y power multiple for the I'th term.

 

nP As Long

Overall power multiple for the I'th term.

 

thetaDeg As Double

Rotation angle in degrees for the I'th term.

 

 

Example

The following example creates a default SGS surface, modifies the default 0'th entry name, loops over all terms and prints out the information for each entry.

 

Sub Main

 

 

    Dim ceNode As Long

    Dim ent As T_ENTITY

    InitEntity ent

        ent.name = "Custom Element"

    ceNode = AddCustomElement( ent )

 

    InitEntity ent

        ent.parent = ceNode

        ent.name = "My SGS"

        ent.Description = "Surface made of a superposition of super-gaussians."

    Dim sgsNode As Long

    sgsNode = SGSurfAdd( ent )

    SGSurfSetIthTermName sgsNode, 0, "Default Entry"

 

    Update

 

    Dim sgsTermCount As Long

    sgsTermCount = SGSurfGetTermCount( sgsNode )

    Print "SGS Surf has " & sgsTermCount & " term(s)."

 

 

    Dim curTerm As Long

    Dim pdCoeff As Double, pdX0 As Double, pdY0 As Double, pdSx As Double, pdSy As Double

    Dim pnPx As Long, pnPy As Long, pnP As Long, pdThetaDeg As Double

    Dim termName As String

    Print "Term" & Chr(9) & "Name" & Chr(9) & "Coeff" & Chr(9) & "X off." & Chr(9) & "Y off" & Chr(9) & "Sigma X" & Chr(9) & "Sigma Y" & _

        Chr(9) & "Power X" & Chr(9) & "Power Y" & Chr(9) & "Overall Power" & Chr(9) & "Theta (deg.)"

    For curTerm = 0 To sgsTermCount-1

        SGSurfGetIthTermData sgsNode, _

                             curTerm, _

                             pdCoeff, _

                             pdX0, _

                             pdY0, _

                             pdSx, _

                             pdSy, _

                             pnPx, _

                             pnPy, _

                             pnP, _

                             pdThetaDeg

        termName = SGSurfGetIthTermName( sgsNode, curTerm )

 

        Print curTerm & Chr(9) & termName & Chr(9) & pdCoeff & Chr(9) & pdX0 & Chr(9) & pdY0 & Chr(9) & pdSx & Chr(9) & pdSy & Chr(9) & pnPx & Chr(9) & pnPy & Chr(9) & pnP & Chr(9) & pdThetaDeg

    Next curTerm

 

End Sub

 

 

See Also

SGSurfAdd

SGSurfGetTermCount

SGSurfSetTermCount

SGSurfGetIthTermData

SGSurfFindTermIndexFromName

SGSurfSetIthTermName

SGSurfGetIthTermName

 

 

 

 

 

Copyright © Photon Engineering, LLC