Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
TracePro_User_Manual_5.0.pdf
Источник:
Скачиваний:
281
Добавлен:
03.05.2015
Размер:
6.09 Mб
Скачать

Surface Properties

Description:

This function announces the start of the raytrace.

Parameters:

nUniqueSurfaceID:

unique surface ID established during the audit phase of the simulation Data flow direction: TracePro > DLL

szMessage:

message sent to TracePro's message window if the return code is non-zero Data flow direction: DLL > TracePro

Function: fnAnnounceWavelengthStart

Calling Frequency:

Per Wavelength

Function Prototype:

int fnAnnounceWavelengthStart( double wavelength,

long nUniqueSurfaceID, LPTSTR szMessage

);

Description:

This function announces the start of the raytrace for a particular wavelength

Parameters:

wavelength:

the wavelength, in microns, that will be raytraced next Data flow direction: TracePro > DLL

nUniqueSurfaceID:

unique surface ID established during the audit phase of the simulation Data flow direction: TracePro > DLL

szMessage:

message sent to TracePro's message window if the return code is non-zero Data flow direction: DLL > TracePro

TracePro 5.0 User’s Manual

7.39

Technical Reference

Function: fnAnnounceWavelengthFinish

Calling Frequency:

Per Wavelength

Function Prototype:

int fnAnnounceWavelengthFinish( double wavelength,

long nUniqueSurfaceID, LPTSTR szMessage

);

Description:

This function announces the completion of the raytrace for a particular wavelength.

Parameters:

wavelength:

the wavelength, in microns, that was just raytraced Data flow direction: TracePro > DLL

nUniqueSurfaceID:

unique surface ID established during the audit phase of the simulation Data flow direction: TracePro > DLL

szMessage:

message sent to TracePro's message window if the return code is non-zero Data flow direction: DLL > TracePro

Function: fnAnnounceRaytraceFinish

Calling Frequency:

Per Simulation

Function Prototype:

int fnAnnounceRaytraceFinish( int nStatus,

long nUniqueSurfaceID, LPTSTR szMessage

);

Description:

This function announces the completion of the raytrace.

7.40

TracePro 5.0 User’s Manual

Surface Properties

Parameters:

nStatus:

the raytrace finishing status

one of the following const values will be sent by TracePro:

const int COATING_DLL_RAYTRACE_FINISH_OK = 0;

const int COATING_DLL_RAYTRACE_FINISH_USER_CANCEL = 1; const int COATING_DLL_RAYTRACE_FINISH_CATCH_EXCEPTION = 2;

const int COATING_DLL_RAYTRACE_FINISH_CRITICAL_ERROR_FROM_DLL =3;

Data flow direction: TracePro > DLL

nUniqueSurfaceID:

unique surface ID established during the audit phase of the simulation Data flow direction: TracePro > DLL

szMessage:

message sent to TracePro's message window if the return code is non-zero Data flow direction: DLL > TracePro

Example of Enhanced Coating DLL

Provided here is an example of an enhanced coating DLL. It is a variable transmission (and reflection) filter as a function of radial position. The equations that governs the transmission (T) and reflection (R) are

T = 1 – r rmax and

(7.37)

R = 1 – T = r rmax ,

(7.38)

where r is the local radius of the ray on the applied surface and rmax is maximum radius of the surface, which is hard-coded to a value of 5 as shown below.

The programming of interest in the DLL is:

////////////////////////////////////

// End of example

////////////////////////////////////

SURF_API double fnEvaluateCoating( double*input,

int input_size, double*user,

int user_size, double*results,

int results_size

)

TracePro 5.0 User’s Manual

7.41

Technical Reference

{

double result_val = 0;

// zero-out the results array memset(results,0,sizeof(double)*results_size); results[SIGNAL_TO_TRACEPRO] = COATING_DLL_SIGNAL_NONE;

double x = input[RAY_POS_X]; double y = input[RAY_POS_Y]; double r = sqrt( x*x + y*y ); double rMax = 5.0;

double tran = 1.0 - r/rMax;

if( tran < 0.0 ) tran = 0.0;

results[TRAN_S] = results[TRAN_P] = tran; results[REFL_S] = results[REFL_P] = 1.0 - tran;

return result_val;

}

////////////////////////////////////

// End of example

////////////////////////////////////

This example can be found after installation of TracePro. The default location is:

C:\Program Files\Lambda Research Corporation\TracePro\examples\demos\Variable

DLL

To use this OML example you must import the Surface Property within the above folder. Note that you must set up a Surface Property using the Define|Edit Property Data|Surface Properties… Editor if you create new DLLs. The process is the same except select for Type Coating DLL. Additionally, when you apply this property to a surface you must set its Property Orientation, including Origin (set to (0, 0, 0) in this case), Normal Direction (set to (0, 0, 1) in this case) and Up Direction (set to 0, 1, 0) in this case). See Figure 7.9 for a screen capture of the system and Figure 7.10 for the Apply Properties dialog for Filter|Variable. Figure 7.11 shows the reflection results, while Figure 7.12 shows the transmission results when a circular grid of over 30,000 rays is traced.

7.42

TracePro 5.0 User’s Manual

Surface Properties

FIGURE 7.9 - Layout of the example for Enhanced Coating DLL.

FIGURE 7.10 - Apply Properties dialog for the Filter|Variable surface.

TracePro 5.0 User’s Manual

7.43

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]