VR-Vantage 3.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ssObject.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 _ssObject_
13 #define _ssObject_
14 
15 #include "ssIncAll.h"
16 #include "atm_common.h"
17 #include "Objects.h"
18 
19 #include "ssdllexport.h"
20 #include "ssMaterialSet.h"
21 
22 #include <memory>
23 
24 #define DIRTY_VELDIF_MPS 1.0
25 #define DIRTY_ALTDIF_M 1000.0
26 #define HFT_DTMIN 0.0001
27 
28 
30 // class: ssObject
35 {
36 public:
38  typedef enum
39  {
41  SR,
44  } ObjectBrdfEnum;
45 
46 
48  // ssObject
52  ssObject();
53 
55  //~ssObject
59  virtual ~ssObject();
60 
62  //getThermalSpinUpTime
67  double getThermalSpinUpTime();
68 
70  //setThermalSpinUpTime
76  bool setThermalSpinUpTime(double hours);
77 
79  //*getResponseData
118  float *getResponseData(ssSensor *sensor, unsigned int &numMaterials, unsigned int &numBins, unsigned int &numParameters);
120  //*getSandfordRobertsonResponseData
130  float *getSandfordRobertsonResponseData(ssSensor *sensor, unsigned int &numMaterials, unsigned int &numBins, unsigned int &numParameters);
131 
133  // getVisualdata
143  float *getVisualData(unsigned int &numMaterials, ssSensor *sensor);
144 
146  //getMaterialResponse
157  void getMaterialResponse(ssSensor *sensor, unsigned int matCode,
158  float &ambient, float &emission, float &cosEmission);
159 
161  //getNumberResponses
166  unsigned int getNumberResponses();
167 
169  // getNumberResponseValues
170  //
175  unsigned int getNumberResponseValues();
176 
178  //getNumberMaterials
183  unsigned int getNumberMaterials();
184 
186  //*getObjectType
191  int getObjectType();
192 
194  //setObjectType
199  void setObjectType(const int type);
200 
202  //*getName
207  char *getName();
208 
210  //setName
215  void setName(const char *name);
216 
218  //getUniqueID
223  int getUniqueID();
224 
226  //setUniqueID
234  bool setUniqueID(int id);
235 
237  //*setFullResponseEnable
245  void setFullResponseEnable(bool flag);
246 
248  //*getFullResponseEnable
253  bool getFullResponseEnable();
254 
256  //*setIncludeEmissivity
263  void setIncludeEmissivity(bool flag);
264 
266  //*getIncludeEmissivity
271  bool getIncludeEmissivity();
272 
274  //setGeomFileName
279  void setGeometryFileName(char *name);
280 
282  //getGeomFileName
287  char *getGeometryFileName();
288 
289 
291  //setMaterialSystemFileName
296  void setMaterialSystemFileName(char *name);
297 
299  //getMaterialSystemFileName
304  char *getMaterialSystemFileName();
305 
307  //setSCfilename
312  void setSCfilename(char *name);
313 
315  //getSCfilename
320  char *getSCfilename();
321 
323  //setRCSfilename
328  void setRCSfilename(char *name);
329 
331  //getRCSfilename
336  char *getRCSfilename();
337 
339  //setPIPfilename
344  void setPIPfilename(char *name = NULL);
345 
347  //getPIPfilename
352  char *getPIPfilename();
353 
355  //setMSICfilename
360  void setMSICfilename(char *name = NULL);
361 
363  //getMSICfilename
368  char *getMSICfilename();
369 
371  //setSmokeMaterialSystemFileName
377  void setSmokeMaterialSystemFileName(char *name);
378 
380  //getSmokeMaterialSystemFileName
386  char *getSmokeMaterialSystemFileName();
387 
389  //setSmokeGeomFileName
395  void setSmokeGeometryFileName(char *name);
396 
398  //getSmokeGeomFileName
404  char *getSmokeGeometryFileName();
405 
407  //setSmokePIPfilename
413  void setSmokePIPfilename(char *name = NULL);
414 
416  //getSmokePIPfilename
422  char *getSmokePIPfilename();
423 
425  //setTrackFileName
430  void setTrackFileName(char *name);
431 
433  //getTrackFileName
438  char *getTrackFileName();
439 
441  //setIndex
446  void setIndex(int i);
448  //getIndex
453  int getIndex();
454 
456  //*setMaterialSet
461  void setMaterialSet(const std::shared_ptr<ssMaterialSet>& set);
462 
464  //*getMaterialSet
469  ssMaterialSet* getMaterialSet() const;
470 
472  //*getMaterialSetPtr
477  std::shared_ptr<ssMaterialSet> getMaterialSetPtr() const;
478 
480  //setGeocentricLocation
487  void setGeocentricLocation(
488  double x,
489  double y,
490  double z);
491 
493  //getGeocentricLocation
500  void getGeocentricLocation(
501  double &x,
502  double &y,
503  double &z);
504 
506  //setGeodeticLocation
513  void setGeodeticLocation(
514  double lat,
515  double lon,
516  double alt);
517 
519  //getGeodeticLocation
526  void getGeodeticLocation(
527  double &lat,
528  double &lon,
529  double &alt);
530 
532  //setOrientation
539  void setOrientation(
540  double h,
541  double p,
542  double r);
543 
545  //getOrientation
552  void getOrientation(
553  double &h,
554  double &p,
555  double &r);
556 
557 
559  //setLinearVelocity
566  void setLinearVelocity(double e,
567  double n,
568  double u);
569 
571  //getLinearVelocity
578  void getLinearVelocity(double &e,
579  double &n,
580  double &u);
581 
583  //setLinearAcceleration
590  void setLinearAcceleration(double e,
591  double n,
592  double u);
593 
595  //getLinearAcceleration
602  void getLinearAcceleration(double &e,
603  double &n,
604  double &u);
605 
607  //setAngularVelocity
615  void setAngularVelocity(double e,
616  double n,
617  double u);
618 
620  //getAngularVelocity
628  void getAngularVelocity(double &e,
629  double &n,
630  double &u);
631 
633  //setAngularAcceleration
641  void setAngularAcceleration(double e,
642  double n,
643  double u);
644 
646  //getAngularAcceleration
654  void getAngularAcceleration(double &e,
655  double &n,
656  double &u);
657 
665  void setTimeActivated(double time = 0.0);
666 
674  double getTimeActivated(void);
675 
683  void setHFTTimeLastUpdated(double time);
684 
692  double getHFTTimeLastUpdated(void);
693 
701  void setHFTTimeLLoaded(double time);
702 
710  double getHFTTimeLoaded(void);
711 
722  void ResetHFT();
723 
735  bool LoadHFTFile(char *infile, double current);
736 
747  void UpdateHFT(double current, double dwell_secs = UPLIM);
748 
749 
750 
752  // setTrack
758  void setTrack(TRACK *track, int numTracks);
759 
761  // setTrackfileUpdate
767  void setTrackfileUpdate(double simTime, ::ellipsoid *ellipsoid);
768 
769 
770  ssObject *getPtr();
771 
772 
774  //*getObjectPtr
784  OBJECT *getObjectPtr();
785 
787  //thermalSpinUp
793  bool thermalSpinUp(ssEnvironment *env);
794 
796  //isEmatType
801  bool isEmatType() ;
802 
804  //setEmatType
810  void setEmatType(bool flag);
811 
813  //initialize
820  bool initialize(char *dataDir = NULL);
821 
823  // update
829  bool update(ssEnvironment *env);
830 
831 #ifdef _SIGSIM_RADAR_H_
832 
833  // loadSCFile
839  bool loadSCFile();
840 
842  // loadRCSFile
848  bool loadRCSFile();
849 
851  // getRCS
858  double getRCS(ssSensor *sensor, ssEnvironment *env);
859 
861  //ReturnSCVArray
871  int ReturnSCVArray(ssSensor *curSensor, double freq, double Cel, double Caz, int *ncenters, std::vector<SCATTER_VECTOR_CENTER>& svc);
872  int ReturnSCVArray(ssSensor *curSensor, double freq, double Cel, double Caz, int *ncenters, SCATTER_VECTOR_CENTER **svc);
873 
874 #endif // _SIGSIM_RADAR_H_
875 
876 #ifdef _GFE_NRT_
877 
878  // getScaledPlumeSpectralSignature
879  //
880  // description: Retrieves (dynamic-range scaled) sensor band value for emission along the centerline LOS from end to end of the plume.
881  //
882  // parameter : ssSensor pointer corresponding to desired sensor band,
883  // ssEnvironment pointer whose metin->inf.spectrum must be the same as used in ssObject::update()!!!
884  //
885  //
886  float * getScaledPlumeSpectralSignature(int &numSensorWaveLengths, int &reponseWidth, ssSensor *sensor);
887 #endif
888 
889 #ifdef _PARTICLES_H_
890 
891  // getScaledEffectBandSignature
905  bool getScaledEffectBandSignature(double &emission, double &reflectivity, double &alpha, int &processpath, ssEnvironment *env, ssSensor *sensor);
906 
908  // getScaledEffectSpectralSignature
923  float *getScaledEffectSpectralSignature(int &processpath, int &numSensorWaveLengths, int &reponseWidth, ssEnvironment *env, ssSensor *sensor);
924 
926  // updateVisibleScaledEffectBandSignature
933  void updateVisibleScaledEffectBandSignature(ssEnvironment *env);
934 
936  // getVisibleScaledEffectBandSignature
942  void getVisibleScaledEffectBandSignature(double &emission, double &reflectivity, double &alpha);
943 
945  // setVisibleScaledEffectBandSignature
954  void setVisibleScaledEffectBandSignature(double emission, double reflectivity, double alpha);
955 #endif
956 
957 #ifdef _CTDR_CPDR_H_
958 
959  //* getPlumeRadianceMap
964  PLUME_RADIANCE_MAP *getPlumeRadianceMap();
965 #endif
966 
967 
969  // copyIntrinsicParams
976  void copyIntrinsicParams(ssObject *from);
977 
978 
980  // setIsDirty
986  void setIsDirty(bool flag);
987 
989  // isDirty
995  bool isDirty();
996 
998  //setWorldLocation
1005  void setWorldLocation(double x, double y, double z);
1006 
1008  //getWorldLocation
1015  void getWorldLocation(double& x, double& y, double& z);
1016 
1017  // Method for querying the state of whether this object is a flare or not
1018  bool isFlareObject() const
1019  {
1020  return m_isFlare;
1021  }
1022 
1023  // Methods for per object, material system independent, intensity modification
1024  void setObjectIntensityFactor( float intensity )
1025  {
1026  m_intensityFactor = intensity;
1027  }
1028 
1029  float getObjectIntensityFactor() const
1030  {
1031  return m_intensityFactor;
1032  }
1033 
1034  // Methods for SR support
1036  void setBrdf (ObjectBrdfEnum v);
1038  ObjectBrdfEnum getBrdf ();
1040  void setRoughness (float r);
1042  float getRoughness ();
1043 
1044  /* -------------- BEGIN SILVERLINING SUPPORT ----------------- */
1045 
1046  typedef enum
1047  {
1048  NONE = -1,
1049  CIRROCUMULUS=0,
1057  TOWERING_CUMULUS
1058  } SL_CLOUD_TYPE;
1059 
1061  // Category
1066  typedef enum
1067  {
1068  defaultCategory = 0,
1081  emsig
1082  } Category;
1083 
1084 
1085  typedef struct
1086  {
1087  SL_CLOUD_TYPE type; // [enum] SL CLOUD TYPE
1088  double basealt_m; // [m] Base Altitude
1089  double extent_m; // [m] Horizontal Extent
1090  double thickness_m; // [m] Vertical Thickness
1091  double coverage; // [unitless 0-1] Cloud Coverage Fraction (maps to SL "density")
1092  ATM_VOL_PROPS atm; // [ATM_VOL_PROPS] Spectral array of extinction, scattering, and thermal emission params computed from ssEnvironment::ProcessSL_CLOUD() (over metin.inf.spectrum).
1093  double *emission; // [W/cm2/sr/um] Emission spectral array (over metin.inf.spectrum)
1094  double *reflectivity; // [unitless] Reflectivity spectral array (over metin.inf.spectrum)
1095  double *alpha; // [unitless] Alpha spectral array (over metin.inf.spectrum)
1096  double *g1; // [unitless] HG asymmetry #1
1097  double *g2; // [unitless] HG asymmetry #2
1098  double *f; // [unitless] HG mixing parameter s.t. PH(x) = f * HG(g1,x) + (1-f) * HG(g2,x).
1099  double simulationTime; // [seconds] SensorRender's simulation clock the last time SkyDrawable::updateSL_CLOUD()
1100  int handle; // [cardinal] SilverLining cloud handle
1101  } SL_CLOUD;
1102 
1104  // ProcessSL_CLOUD
1105  // Processes main signature components for SilverLining cloud type
1106  int ProcessSL_CLOUD(ssEnvironment *env, double H2O_density_gpm3, double voxdim_m);
1107 
1109  // getSL_CLOUD
1110  // Gets pointer to SilverLining cloud
1111  SL_CLOUD *getSL_CLOUD(void);
1112 
1114  // FreeSL_CLOUDArrays
1115  // Frees pointers inside SilverLining cloud
1116  // If init=true, just performs NULLification.
1117  void FreeSL_CLOUDArrays(bool init);
1118 
1120  // AllocateSL_CLOUDArrays
1121  // Allocates spectral arrays inside SilverLining cloud
1122  int AllocateSL_CLOUDArrays(long nlambda);
1123 
1125  // getSL_CLOUDPassbandSignature
1126  // Assumes ProcessSL_CLOUD is performed first!
1127  // Outputs the following quantities:
1128  // emission [unitless 0-1] : Emission integrated over sensor's passband and scaled by sensor's dynamic range.
1129  // reflectivity [unitless 0-1] : Reflectivity averaged over sensor's passband.
1130  // alpha [unitless 0-1] : Alpha = (1 - transmission), averaged over sensor's passband.
1131  // g1 [unitless -1->1] : Equivalent Henyey-Greenstein asymmetry parameter #1, averaged over sensor's passband.
1132  // g2 [unitless -1->1] : Equivalent Henyey-Greenstein asymmetry parameter #2, averaged over sensor's passband.
1133  // f [unitless 0-1] : Equivalent mixing factor for HG functions [f*HG(g1)+(1-f)*HG(g2)], averaged over sensor's passband.
1134  int getSL_CLOUDPassbandSignature(ssSensor *sensor, ssEnvironment *env, double &emission, double &reflectivity, double &alpha, double &g1, double &g2, double &f);
1135 
1136  void setSLCloudGeometry(SL_CLOUD_TYPE type, double basealt_m, double thickness_m, double extent_m, double coverage);
1137  int getSLCloudGeometry(SL_CLOUD_TYPE &type, double &basealt_m, double &thickness_m, double &extent_m, double &coverage);
1138 
1139 #ifdef _GFE_NRT_
1140  void setST_CONTEXT_TEMPLATE(ST_CONTEXT_TEMPLATE st);
1141  ST_CONTEXT_TEMPLATE * getST_CONTEXT_TEMPLATE();
1142 #endif
1143 
1144  Category getCategory();
1145  void setCategory(Category category);
1146 
1147  // Offsets due to ship motion in sea state, but could also be used for other sources of turbulence.
1148  void setOffsetTranslation(double X, double Y, double Z);
1149  void getOffsetTranslation(double &X, double &Y, double &Z);
1150  void setOffsetOrientation(double yaw, double pitch, double roll);
1151  void getOffsetOrientation(double &yaw, double &pitch, double &roll);
1152  // ------------------------------
1153 
1154 
1155  /* -------------- END SILVERLINING SUPPORT ----------------- */
1156 
1157 protected:
1160 
1161 private:
1162 
1163  virtual void updateInternal(ssEnvironment *env, bool forceUpdate);
1164 
1166  //setObjectPtr
1171  void setObjectPtr(OBJECT *objectPtr);
1172 
1174  int m_index;
1175 
1177  int m_id;
1179  std::shared_ptr<ssMaterialSet> m_materialSet;
1180 
1185 
1187  char m_trackFileName[SIGSIM_STRING_SIZE];
1189  char m_materialSystemFileName[SIGSIM_STRING_SIZE];
1190 
1192  char m_dataDirectory[SIGSIM_STRING_SIZE];
1194  char m_geometryFilename[SIGSIM_STRING_SIZE];
1196  char m_rcsFilename[SIGSIM_STRING_SIZE];
1198  char m_scFilename[SIGSIM_STRING_SIZE];
1200  char m_pipFilename[SIGSIM_STRING_SIZE];
1202  char m_msicFilename[SIGSIM_STRING_SIZE];
1204  char m_smokeGeometryFileName[SIGSIM_STRING_SIZE];
1206  char m_smokeMaterialSystemFileName[SIGSIM_STRING_SIZE];
1208  char m_smokePipFilename[SIGSIM_STRING_SIZE];
1209 
1216  // For generating the unique id
1219 
1221  double m_visAlpha;
1226 
1229 
1230  double m_worldXCoord;
1231  double m_worldYCoord;
1232  double m_worldZCoord;
1233 
1234 
1235  // Offsets due to ship motion in sea state, but could also be used for other sources of turbulence.
1236  double m_offsetTranslationX; // [m]
1237  double m_offsetTranslationY; // [m]
1238  double m_offsetTranslationZ; // [m]
1239  double m_offsetOrientationYaw; // [rad]
1240  double m_offsetOrientationPitch; // [rad]
1241  double m_offsetOrientationRoll; // [rad]
1242  // ------------------------------
1243 
1244  // --- HFT and IntensityFactor support ---
1245  float m_intensityFactor; // [1] Current at-object signature multiplier
1246  int m_numHFT; // [1] Number of entries in m_HFT array
1247  float *m_HFT; // [1] Array of at-object signature multipliers to be applied
1248  float m_HFTTimeInterval; // [s] Scenario Time between m_HFT entries
1249  double m_HFTLoadTime; // [s] Scenario Timestamp at which HFT array was loaded/initialized
1250  double m_HFTLastUpdate; // [s] Scenario Timestamp at which m_intensityFactor last came from element [i] in m_HFT array
1251  // ---------------------------------------
1252 
1254 
1259 
1260  // SILVERLINING SETTINGS
1262 
1263 #ifdef _GFE_NRT_
1264  // GFE-NRT
1265  ST_CONTEXT_TEMPLATE *st_ct;
1266 #endif
1267 
1268  //object category (default, diguy, sfx, speedtree, water, etc)
1270 
1271  static int s_objectId;
1272 
1273  friend class SigSimRT;
1274 
1275 };
1276 
1277 #endif // _ssObject_
1278 


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