VR-Vantage 2.7 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ssMaterialSet.h
Go to the documentation of this file.
1 
2 // Copyright JRM Enterprises, Inc. 2004 - 2012
3 // All rights reserved.
4 //
5 // This code is the intellectual property of JRM Enterprises, Inc.
6 // It may not be used or released as source or compiled binary form
7 // without the prior written consent of JRM Enterprises, Inc.
8 //
9 // Original Author: Eric Olson Date: May 2004
11 
12 #ifndef _ssMaterialSet_
13 #define _ssMaterialSet_
14 
15 #ifdef WIN32
16 #include <windows.h>
17 #endif
18 
19 #include "ssEnvironment.h"
20 #include "ssdllexport.h"
21 #include "ssMaterialTable.h"
22 #include "ssMaterialProperties.h"
23 
24 
25 
27 // ssMaterialSet
38 {
39 
40 public:
41 
43  typedef struct {
44  double BaseSurface;
45  double CosSurface;
46  double Surface;
47  } ssEmission;
48 
50  typedef struct {
51  double BaseSurfaceTemp;
52  double CosSurfaceTemp;
53  double QdiffH;
54  double SurfaceTemp;
55  } ssTemperature;
56 
58  typedef struct {
59  char materialName[256];
60  double visualAvg;
61  double NVGGain;
62  double FLIRGain;
63  double RFGain;
65 
66 
67 
69  // ssMaterialSet
73  ssMaterialSet();
74 
76  //ssMaterialSet
80  ~ssMaterialSet();
81 
83  //ssMaterialSet
87  ssMaterialSet(ssMaterialSet &copyObj);
88 
89 
90 
92  //*getResponseData
150  float *getResponseData(ssSensor *sensor, unsigned int &numMaterials, unsigned int &numBins, unsigned int &numParameters); // BRDF or radar
151 #if(0)
152 
153  //*getBRDFResponseData
162  float *getBRDFResponseData(ssSensor *sensor, unsigned int &numMaterials, unsigned int &numBins, unsigned int &numParameters);
163 #else
164 
165  //*getPhongResponseData
174  float *getPhongResponseData(ssSensor *sensor, unsigned int &numMaterials, unsigned int &numBins, unsigned int &numParameters);
175 
177  //*getSandfordRobertsonResponseData
186  float *getSandfordRobertsonResponseData(ssSensor *sensor, unsigned int &numMaterials, unsigned int &numBins, unsigned int &numParameters);
187 #endif
188 
189  //*getRadarResponseData
198  float *getRadarResponseData(ssSensor *sensor, unsigned int &numMaterials, unsigned int &numBins, unsigned int &numParameters);
199 
201  // getVisualdata
210  float *getVisualData(unsigned int &numMaterials, ssSensor *sensor);
211 
212 
214  //*getMSBandDHR
225  float getMSBandDHR(ssMaterialTable *table, ssSensor *sensor, int msindex, double ax, double bx, double thetarad);
226 
227 #if(0)
228 
230  //getBRDFMaterialResponse
241  void getBRDFMaterialResponse(ssSensor *sensor, unsigned int matCode, float &ambient, float &emission, float &cosEmission);
242 
243 
244 
245 #else
246 
248  //getPhongMaterialResponse
259  void getPhongMaterialResponse(ssSensor *sensor, unsigned int matCode,
260  float &ambient, float &emission, float &cosEmission);
261 
262 
264  //getSandfordRobertson
277  void getSanfordRobertson(ssSensor *sensor, unsigned int matCode, float &reflectance, float &lobeWidth, float &emissivity, float &grazingB) ;
278 
279 #endif
280 
282  //getNumberMaterials
287  unsigned int getNumberMaterials();
288 
290  //getNumberResponses
298  unsigned int getNumberResponses();
299 
301  //getNumberResponseValues
306  unsigned int getNumberResponseValues();
307 
309  //initializeEmats
314  bool initializeEmats (ssEnvironment *env);
315 
317  // getEmatEmission
318  //
328  void getEmatEmission(double &baseEmission, double &cosEmission, double &twoSideFlag, double &absorbRatio, ssSensor *sensor, unsigned int index);
329 
331  // getEmatIndex
336  int getEmatIndex(unsigned int ematIndex);
337 
339  //setThermalSpinUpTime
350  bool setThermalSpinUpTime(double spinUp);
351 
353  //getThermalSpinUp
358  double getThermalSpinUpTime();
359 
361  //*setFullResponseEnable
370  void setFullResponseEnable(bool flag);
371 
373  //*getFullResponseEnable
378  bool getFullResponseEnable();
379 
381  //*setIncludeEmissivity
388  void setIncludeEmissivity(bool flag);
389 
391  //*getIncludeEmissivity
396  bool getIncludeEmissivity();
397 
399  //*getMaximumTemperature
404  double getMaximumTemperature();
405 
407  //*getMinimumTemperature
412  double getMinimumTemperature();
413 
415  //getNumberTemperatures
420  unsigned int getNumberTemperatures();
421 
423  //setNumberTemperatures
428  void setNumberTemperatures(unsigned int n);
429 
431  //setAutoRadianceScale
436  void setAutoRadianceScale(bool flag);
437 
439  //isAutoRadianceScale
446  bool isAutoRadianceScale();
447 
449  //getAverageAbsorbRatio
455  double getAverageAbsorbRatio();
456 
458  //getAverageTwoSidedFlag
464  double getAverageTwoSidedFlag();
465 
467  //getAverageConductionFactor
473  double getAverageConductionFactor();
474 
476  //setAbsorbRatio
484  void setAbsorbRatio(double absorbRatio);
485 
487  //getAbsorbRatio
493  double getAbsorbRatio();
494 
496  //setTwoSidedFlag
504  void setTwoSidedFlag(double twoSidedFlag);
505 
507  //getTwoSidedFlag
513  double getTwoSidedFlag();
514 
516  //setAppendLightData
523  void setAppendLightData(bool flag);
524 
526  //isAppendLightData
533  bool isAppendLightData();
534 
536  //isEmatType
541  bool isEmatType();
542 
544  //setEmatTextureType
550  void setEmatType(bool flag);
551 
553  //setNumberEMats
558  void setNumberEMats(unsigned int numEmats);
559 
561  //getNumberEMats
566  unsigned int getNumberEMats();
567 
569  //*getMaterialPropertyTablePtr
575 
577  //*getEmatFractionsPtr
582  MATERIAL_EIGENFRACTIONS *getEmatFractionsPtr();
583 
584 
586  //isUsingSimpleGpuFactor
591  bool isUsingSimpleGpuFactor();
592 
594  //setUseSimpleGpuFactor
600  void setUseSimpleGpuFactor(bool flag);
601 
603  //isCacheDirty
609  bool isCacheDirty(ssEnvironment *env) ;
610 
612  //forceCacheUpdate
616  void forceCacheUpdate();
617 
619  //getUseInstance
624  bool getUseInstance();
625 
627  //setUseInstance
631  void setUseInstance(bool flag);
632 
634  //initActiveRegions
638  void initActiveRegions(bool loadFile = true);
639 
641  //getActiveMaterials
645  ssMaterialProperties *getActiveMaterials();
646 
648  //getInactiveMaterials
652  ssMaterialProperties *getInactiveMaterials();
653 
655  //setActiveRegion
662  bool setActiveRegion(unsigned int index, bool activeFlag);
663 
665  //sendActiveRegionImpulse
671  bool sendActiveRegionImpulse(unsigned int index);
672 
674  //getActiveRegionImpulseCount
679  int getActiveRegionImpulseCount(unsigned int index);
680 
682  //getActiveRegionImpulseDeltaTime
687  double getActiveRegionImpulseDeltaTime(unsigned int index);
688 
690  //getActiveRegion
696  bool getActiveRegion(unsigned int index);
697 
699  //getNumberActiveRegions
705  int getNumberActiveRegions();
706 
708  //getActiveRegionName
714  char *getActiveRegionName(int index);
715 
717  //hasActiveRegionsFile
724  bool hasActiveRegionsFile(char *msName = NULL);
725 
727  // getRCSData
738 #if 0
739  float *getRCSData(ssSensor *sensor, unsigned int &numBins, unsigned int &x, unsigned int &y);
740 #else
741 
742 
743  float *getRCSData(ssSensor *sensor, unsigned int &numBins, unsigned int &x, unsigned int &y, unsigned int &z);
744 #endif
745 
747  //setNumberRCSangle
753  void setNumberRCSangle(unsigned int angles);
754 
756  //getNumberRCSangle
762  unsigned int getNumberRCSangle();
763 
765  //hasIntensityModulationFile
771  bool hasIntensityModulationFile();
772 
774  //loadIntensityModulationFile
779  bool loadIntensityModulationFile();
780 
782  //writeIntensityModulationFile
787  void writeIntensityModulationFile();
788 
790  //setIntensityModulationParameters
794  void setIntensityModulationParameters(ssIntensityModulationParameters imodGain, int index);
795 
797  //setIntensityModulationParameters
801  void setIntensityModulationParameters(double visAvg, double NVGGain, double IRGain, double RFGain, int index);
802 
804  //getIntensityModulationParameters
809  void getIntensityModulationParameters(ssIntensityModulationParameters &imodGain, int index);
810 
812  //getIntensityModulationParameters
817  void getIntensityModulationParameters(double &visAvg,double &NVGGain, double &FLIRGain, double &RFGain, int index);
818 
820  //getMSFilename
825  const char *getMSfilename();
826 
831  void setImmediateActiveRegionUpdate(bool flag);
832 
837  bool getImmediateActiveRegionUpdate();
838 
840  //isMarkedDelete
845  bool isMarkedDelete();
846 
848  //setMarkedDelete
854  void setMarkedDelete(bool flag);
855 
856 private:
857 
858 
860  //initialize
866  bool initialize(ssEnvironment *env, char *dataDir);
867 
869  //update
875  void update(ssSensor *sensor, ssEnvironment *env);
876 
877 
879  //insertMaterialTable
885  bool insertMaterialTable(ssSensor *sensor);
886  // helpers
887 #if(0)
888  bool insertBRDFMaterialTable(ssSensor *sensor);
889 #else
890  bool insertPhongMaterialTable(ssSensor *sensor);
891  bool insertSRMaterialTable(ssSensor *sensor);
892 #endif
893  bool insertRadarMaterialTable(ssSensor *sensor);
894 
895  // Helpers, do not call directly..
896 #if(0)
897  void updateBRDF(ssSensor *sensor, ssEnvironment *env, bool dirty);
898 #else
899  void updatePhong(ssSensor *sensor, ssEnvironment *env, bool dirty);
900  void updateSR(ssSensor *sensor, ssEnvironment *env, bool dirty);
901 #endif
902  void updateRadar(ssSensor *sensor, ssEnvironment *env, bool dirty);
903 
905  //getTemperatureData
911  void getTemperatureData(ssEnvironment *env);
912 
913 
915  //thermalSpinUp
922  bool thermalSpinUp(ssEnvironment *env);
923 
925  // dynamicThermalSpinUp
926  //
933  bool dynamicThermalSpinUp(ssEnvironment *env, float deltaTime);
934 
936  //computeSpectralReflectanceParameters
942  bool computeSpectralReflectanceParameters(ssSensor *sensor, ssMaterialTable *table);
943 
945  //computeBaseAndLoadedRadiances
954  void computeBaseAndLoadedRadiances(ssTemperature inTemp, double ax,
955  double bx, double emissivity, ssEmission &emission);
956 
957 
959  //updateFullTemperatureCache
963  void updateFullTemperatureCache(ssEnvironment *env);
964 
966  //queryTemperatureCache
972  bool queryTemperatureCache(ssEnvironment *env);
973 
975  //getTemperatureCache
980  ssTemperature *getTemperatureCache();
981 
983  //saveTemperatureCache
988  void saveTemperatureCache(ssEnvironment *env);
989 
991  //getEmatTemperatureCache
996  ssTemperature *getEmatTemperatureCache();
997 
999  //compareFloat
1006  bool compareFloat(float float1, float float2);
1007 
1009  //loadActiveRegionsFile
1016  void loadActiveRegionsFile();
1017 
1018 
1025 
1037 
1044 
1053 
1069  unsigned int m_numEMats;
1070 
1079 
1082 
1085 
1086  unsigned int m_numRCSangles;
1087 
1088  struct Implementation;
1089  Implementation *m_impl;
1090 
1091  friend class ssObject;
1092  friend class SigSimRT;
1093 
1094 };
1095 
1096 #endif // _ssMaterialSet_
1097 


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