VR-Vantage 3.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
mmlsources.h
Go to the documentation of this file.
1 /* © 1998 JRM Technologies, Inc.*/
2 
3 
4 
5 /***********************************
6 Copyright JRM Enterprises, Inc. 1998
7 All rights reserved.
8 
9 This code is the intellectual property of JRM Enterprises, Inc.
10 It may not be used or released as source or compiled binary form
11 without the prior written consent of JRM Enterprises, Inc.
12 ***********************************/
13 
14 #ifndef _MMLS_H_
15 #define _MMLS_H_
16 
17 
18 #include <math.h>
19 
20 //#include "windows.h"
21 
22 #include "JRMDefines.h"
23 #include "JRMlibrary.h"
24 #include "SigSimDefines.h"
25 #include "SourceData.h"
26 #include "sigsimDLLstub.h"
27 
28 #define LOW_LIMIT 1.0E-24
29 
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif
34 
35 
36 typedef enum
37 {
38  UNKNOWN_PLANCK = 0, // Unknown light source types with Planckian Distributions
39  TUNGSTEN, // Tungsten Filament Light Sources with Planckian Distribution
40  HALOGEN, // Halogen
41  MERCURY_CAP, // Mercury Capillary Lamps
42  MERCURY_VAP, // Mercury Vapor Lamps
43  MERCURY_PURE, // Pure Mercury Lamps
44  SODIUM, // Sodium Lamps
45  HPSODIUM, // High-Pressure Sodium Lamps
46  XENON, // Xenon Lamps
47  STRONTIUM, // Carbon Arc Strontium-3
48  ENCLOSEDARC, // Carbon Arc EnclosedArc
49  POLYMETAL3, // Carbon Arc Polymetallic-3
50  POLYMETAL4, // Carbon Arc Polymetallic-4
51  RAREEARTH1, // Carbon Arc RareEarth-1
52  RAREEARTH1_5, // Carbon Arc RareEarth-1.5
53  RAREEARTH1_9, // Carbon Arc RareEarth-1.9
54  RAREEARTH2_85, // Carbon Arc RareEarth-2.85
55  RAREEARTH3, // Carbon Arc RareEarth-3
56  RAREEARTH4 // Carbon Arc RareEarth-4
57 } MMLS_TYPE;
58 
59 #define NUM_MMLS_TYPES 19
60 
61 
62 
63 typedef struct
64 {
65  // --- INPUTS ---
66  char MS_ID[50]; // Arbitrary light source type name. Formerly needed to be one of the string values in the list incorporated in the MMLS_Type() function.
67  // If source type is UNKNOWN_PLANCK, this string will be checked to see if it contains a path to an existing 2-column file on disk specifying a custom power density spectrum.
68  MMLS_TYPE type; // light source type code
69  RGB filter; // [1] Optional Vis-band color filter (default = 1.0 in each channel).
70  // For this purpose, wavebands are defined as follows: B = {0.4-0.5 um}, G = {0.5-0.6 um}, R = {0.6-0.7 um}.
71  VECTOR pos; // [m] Vector defining manmade light source position in the scene NED system. [Only used for predicting irradiance, not radiance]
72  VECTOR dir; // [Unitless cosines] Unit vector defining light source direction in the scene NED system. [Only used for predicting irradiance, not radiance]
73  // Will be used for spotlights. If all three components are zeros, the source is not a spotlight
74  double T; // [degK] Effective black-body temperature of filament, read from input file, but overridden if not tungsten type.
75  double Tbulb; // [degK] Effective bulb temperature (calculated output!)
76  double P; // [W] source power, read from input file
77  double etha; // [unitless real (0-1)], field that gives a sense of source efficiency (i.e. fraction of input power P converted into EM light field. Read from input file
78  double area; // [cm2] Effective area of light source (bulb), read from input file. If <=0 then default value of 400cm2 is used.
79  //double k; // [W/m/degK] Thermal conductivity of glass or other material through which excess heat is conducted, read from input file.
80  double thickness; // [cm] Thickness of glass or other material through which excess heat is conducted, read from input file.
81  double mm_ls_cutoff;// [deg] Spotlight cutoff angle (<180deg for spotlights, =360deg otherwise)
82  double curvature; // [1] = 1 for flat area lights, or JRM_PI for spherical bulbs.
83 
84  // --- OUTPUTS ---
85  double* rad; // [W/m2/sr/um] Output Spectral radiance array of size metin.nlambda.
86  double Kc; // [unitless] Constant term in denominator of OpenGL attenuation factor
87  double Kl; // [m-1] Coefficient of term linear in range in denominator of OpenGL attenuation factor
88  double Kq; // [m-2] Coefficient of term quadratic in range in denominator of OpenGL attenuation factor
90 
91 
92  MMLS_TYPE MMLS_Type(char *s_type);
94  int GetLSConstructionMaterialSpectralEmissivity(SPECTRAL_DOMAIN spectrum, double *emissivity);
95  int GetPlanckSpectralShape(double degK, SPECTRAL_DOMAIN spectrum, double *shape);
96  int GetNonPlanckSpectralShape(MMLS_TYPE source_type, SPECTRAL_DOMAIN spectrum, double *shape);
97 
98  SIGSIM_API int ComputeSingleSourceIrradiance(MANMADE_LIGHTSOURCE_TABLE *mm_lstable, VECTOR SurfacePositionNED, VECTOR SurfaceNormalNED, SPECTRAL_DOMAIN spectrum, double *irradiance, double air_temperature);
101 
102 
103 #ifdef __cplusplus
104 }
105 #endif
106 
107 #endif //_MMLS_H_


Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)