VR-Vantage 3.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ciEntity.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: Michael Ortalano
10 // Date: Oct 2004
11 //
12 //
13 //
14 //
16 
17 #if !defined(AFX_CIENTITY_H__DE81EF86_CAA9_471E_AE7A_9087CD4CB282__INCLUDED_)
18 #define AFX_CIENTITY_H__DE81EF86_CAA9_471E_AE7A_9087CD4CB282__INCLUDED_
19 
20 #if _MSC_VER > 1000
21 #pragma once
22 #endif // _MSC_VER > 1000
23 
24 #include "ciApi.h"
25 #include "clXML.h"
26 #include <stdio.h>
27 #include <string.h>
28 #include <iostream>
29 #include <fstream>
30 #include <memory.h>
31 #include <malloc.h>
32 #include <assert.h>
33 #include "clXMLNode.h"
34 #include "ciGreNrt.h"
35 #include "ciGreSTDomain.h"
36 
42 {
43 public: // enumerations & structs
44 
46  // Category
51  enum Category
52  {
53  defaultCategory = 0,
59  rdg,
66  emsig
67  };
68 
69 
71  // ClampingMode
77  {
78  NONE = 0,
80  TUNNEL_CLAMP
81  };
82 
84  // enumTextureType
90  {
91  MCM,
92  EMAT
93  };
94 
95 
96  typedef struct
97  {
98  char geomFileName[512];
99  char matSysFileName[512];
100  char pipFileName[512];
101  char rcsFileName[512];
102  char scFileName[512];
104  double r;
105  double f;
106  double u;
107  double heading;
108  double pitch;
109  double roll;
110  double velocity;
115 
116 
117 
118 public: // contructors, destructors and assignment operators
119 
121  // ciEntity
126  ciEntity();
127 
129  // ciEntity
137 
139  // ~ciEntity
144  virtual ~ciEntity();
145 
147  // operator =
155  ciEntity operator =(ciEntity &obj);
156 
158  // operator []
165  ciEntity &operator [] (int idx);
166 
167 public: // methods
168 
170  // Add
179  bool add(ciEntity entity);
180 
182  // Insert
192  bool insert(ciEntity entity, int placeBeforeIdx);
193 
195  // Remove
203  bool remove(int entityIdx);
204 
206  // Print
214  void print();
215 
217  // archive
226  bool archive(std::ofstream &outf);
227 
229  // serialize
237  int serialize(char *filepath);
238 
239  //
240  // loadXML
241  //
242  // \par Description:
243  // Loads attributes from an XML node
244  //
245  // \param clXMLNode* childNode
246  // \return bool
247  //
248  bool loadXML(clXMLNode* childNode);
249 
250  //
251  // parseXML
252  //
253  // \par Description:
254  // Parses an XML document for specific tags
255  //
256  // \param clXML xmlDocument
257  // \return bool
258  //
259  bool parseXML(clXML& xmlDocument);
260 
262  //loadXMLNode
269  bool loadXMLNode(std::string tag, char *nodeString);
271  //loadXMLNode
278  bool loadXMLNode(std::string tag, bool *nodeBool);
280  //loadXMLNode
287  bool loadXMLNode(std::string tag, int *nodeBool);
289  //loadXMLNode
296  bool loadXMLNode(std::string tag, double *nodeBool);
297 
298  //
299  // saveXML
300  //
301  // \par Description:
302  // Saves XML nodes to an XML document
303  //
304  // \param clXML* xmlDocument
305  //
306  void saveXML(clXML* xmlDocument, int index = -1, bool saveGFE = true);
307 
309  //serializeCheck
315  int serializeCheck(char *filepath);
316 
318  // setIndex
325  void setIndex(int index)
326  {
327  if(!m_entityList) return;
328  m_entityList[0].index = index;
329  }
330 
332  // getIndex
339  int getIndex()
340  {
341  if(!m_entityList) return(0);
342  return m_entityList[0].index;
343  }
344 
346  // getNumEntities
353  int getNumEntities() {return m_nEntities;}
355  //setNumEntities
360  void setNumEntities(int count) {m_nEntities = count;}
361 
363  // Getters and Setters
364 
366  // GetName
373  char *getName(int index=0);
374 
375 
377  // SetName
385  void setName(const char *name, int index=0);
386  double getVelocity(int index=0);
387  void setVelocity(double velocity, int index=0);
388 
390  // GetGeomFileName
397  char *getGeomFileName(int index=0);
398 
400  // SetGeomFileName
408  void setGeomFileName(char *name, int index=0);
409 
411  // GetMatSysFileName
418  char *getMatSysFileName(int index=0);
419 
421  // SetMatSysFileName
429  void setMatSysFileName(char *name, int index=0);
430 
432  // GetMatSysFileNameMCM
439  char *getMatSysFileNameMCM(int index = 0);
440 
442  // SetMatSysFileNameMCM
450  void setMatSysFileNameMCM(char *name, int index = 0);
451 
453  // getSmokeGeomFileName
461  char *getSmokeGeomFileName(int index=0);
462 
464  // setSmokeGeomFileName
473  void setSmokeGeomFileName(char *name, int index=0);
474 
476  // getSmokeMatSysFileName
484  char *getSmokeMatSysFileName(int index=0);
485 
487  // setSmokeMatSysFileName
497  void setSmokeMatSysFileName(char *name, int index=0);
498 
500  // getTextureType
508  int getTextureType(int idx=0);
509 
511  // setTextureType
520  void setTextureType(int textureType, int idx=0);
521 
523  // GetTrackFileName
530  char *getTrackFileName(int index=0);
531 
533  // SetTrackFileName
541  void setTrackFileName(char *name, int index=0);
542 
544  // getCategory
551  ciEntity::Category getCategory(int index=0);
552 
553 
555  // setCategory
563  void setCategory(ciEntity::Category category, int index=0);
564 
566  // GetThermalSpinUpPeriod
573  double getThermalSpinUpPeriod(int index=0);
574 
576  // SetThermalSpinUpPeriod
585  void setThermalSpinUpPeriod(double period, int index = 0);
586 
588  // setRenderEnable
597  void setRenderEnable(bool render, int index = 0);
598 
600  // getRenderEnable
608  bool getRenderEnable(int index = 0);
609 
611  // setClampMode
621  void setClampMode(int clampMode, int index = 0);
622 
624  // getClampMode
633  int getClampMode(int index = 0);
634 
636  // setUseTrackfile
645  void setUseTrackfile(bool useTrackfile, int idx = 0);
646 
648  // getUseTrackfile
656  bool getUseTrackfile(int idx = 0);
657 
659  // setWorldPosition
667  void setWorldPosition(double x, double y, double z, int i = 0);
668 
670  // getWorldPosition
678  void getWorldPosition(double& x, double& y, double& z, int i = 0);
679 
681  // setGeodeticPosition
692  void setGeodeticPosition(double latitude, double longitude, double altitude, int idx = 0);
693 
695  // getGeodeticPosition
706  void getGeodeticPosition(double &latitude, double &longitude, double &altitude, int idx = 0);
707 
709  // setNEDOrientation
720  void setNEDOrientation(double heading, double pitch, double roll, int idx = 0);
721 
723  // getNEDOrientation
734  void getNEDOrientation(double &heading, double &pitch, double &roll, int idx = 0);
735 
737  // getRCSfilename
744  char *getRCSfilename(int idx = 0);
745 
747  // getRCSfilename
754  void setRCSfilename(char *filename, int idx = 0);
755 
757  // getSCfilename
764  char *getSCfilename(int idx = 0);
765 
767  // setSCfilename
774  void setSCfilename(char *filename, int idx = 0);
775 
777  // getMSICfilename
784  char *getMSICfilename(int idx = 0);
785 
787  // setMSICfilename
794  void setMSICfilename(char *filename, int idx = 0);
795 
797  // getPIPfilename
804  char *getPIPfilename(int idx = 0);
805 
807  // setPIPfilename
814  void setPIPfilename(char *filename, int idx = 0);
815 
817  // getSmokePIPfilename
824  char *getSmokePIPfilename(int idx = 0);
825 
827  // setSmokePIPfilename
834  void setSmokePIPfilename(char *filename, int idx = 0);
835 
836  void setClampHeightOffset(double offset, int idx = 0);
837 
838  double getClampHeightOffset(int idx = 0);
839 
840  int getBrdf(int idx = 0);
841  void setBrdf(int brdf, int idx = 0);
842  double getRoughness(int idx = 0);
843  void setRoughness(double roughness, int idx = 0);
844 
845  bool getMmlsReflect(int idx = 0);
846  void setMmlsReflect(bool mmlsReflect, int idx = 0);
847  bool getThermalReflect(int idx = 0);
848  void setThermalReflect(bool thermalReflect, int idx = 0);
849  double getThermalReflectTemp(int idx = 0);
850  void setThermalReflectTemp(double thermalReflectTemp, int idx = 0);
851 
852  void getThermalReflectExtent(double &x, double &y, int idx = 0);
853  void setThermalReflectExtent(double x, double y, int idx = 0);
854  void getThermalReflectOffset(double &x, double &y, double &z, int idx = 0);
855  void setThermalReflectOffset(double x, double y, double z, int idx = 0);
856 
857  void setImpostorEnable(bool enable = false, int idx = 0);
858  bool getImpostorEnable(int idx = 0) const;
859  void setImpostorResolution(double resolution = 512.0, int idx = 0);
860  double getImpostorResolution(int idx = 0) const;
861  void setImpostorPixelCoverage(double coverage = 40.0, int idx = 0);
862  double getImpostorPixelCoverage(int idx = 0) const;
863 
864  // Sets the silverlining cloud type.
865  void setSLCloudType(int type, int index = 0);
866 
867  // Gets the silverlining cloud type.
868  int getSLCloudType(int index = 0);
869 
870  // Sets the silverlining cloud base alt.
871  void setSLBaseAlt(double alt_m, int index = 0);
872 
873  // Gets the silverlining cloud base alt.
874  double getSLBaseAlt(int index = 0);
875 
876  // Sets the silverlining cloud thickness.
877  void setSLThickness(double thick_m, int index = 0);
878 
879  // Gets the silverlining cloud thickness.
880  double getSLThickness(int index = 0);
881 
882  // Sets the silverlining cloud extents.
883  void setSLExtent(double extent_m, int index = 0);
884 
885  // Gets the silverlining cloud extents.
886  double getSLExtent(int index);
887 
888  // Sets the silverlining cloud coverage.
889  void setSLCoverage(double coverage, int index = 0);
890 
891  // Gets the silverlining cloud coverage.
892  double getSLCoverage(int index = 0);
893 
895  // setDIGuyCharacterType
902  void setDIGuyCharacterType(char *characterType, int index = 0);
903 
905  // getDIGuyCharacterType
912  char* getDIGuyCharacterType(int index = 0);
913 
915  // setDIGuyBaseAppearance
922  void setDIGuyBaseAppearance(char *baseAppearance, int index = 0);
923 
925  // getDIGuyBaseAppearance
932  char* getDIGuyBaseAppearance(int index = 0);
933 
935  // setDIGuyHeadAppearance
942  void setDIGuyHeadAppearance(char *headAppearance, int index = 0);
943 
945  // getDIGuyHeadAppearance
952  char* getDIGuyHeadAppearance(int index = 0);
953 
955  // setDIGuyHandItem
962  void setDIGuyHandItem(char *handItem, int index = 0);
963 
965  // getDIGuyHandItem
972  char* getDIGuyHandItem(int index = 0);
973 
975  // setDIGuyAppearance
982  void setDIGuyAppearance(char *appearance, int index = 0);
983 
985  // getDIGuyAppearance
992  char* getDIGuyAppearance(int index = 0);
993 
994  // sets the state of the search and rescue radar transponder
995  void setTransponderEnable(bool flag, int index = 0);
996  // gets the state of the search and rescue radar transponder
997  bool getTransponderEnable(int index = 0) const;
998  // sets the frequency of the search and rescue radar transponder
999  void setTransponderFrequency(double freq, int index = 0);
1000  // gets the frequency of the search and rescue radar transponder
1001  double getTransponderFrequency(int index = 0) const;
1002 
1003 
1004  int getNumSubObjects(int index=0);
1005  bool loadXMLNode(ciEntity &currentEntity, int idx, int subObjIndex);
1006  bool validSubObjectIndex(int idx, int subObjectIndex);
1007  bool addSubObject(int idx, structSubObjectData subObject);
1008  bool removeSubObject(int idx, int subObjectIndex);
1009  ciEntity::Category getSubObjectCategory(int index=0, int subObjectIndex=0);
1010  void setSubObjectCategory(ciEntity::Category category, int index=0, int subObjectIndex=0);
1011  char *getSubObjectGeomFileName(int index=0, int subObjectIndex=0);
1012  void setSubObjectGeomFileName(char *name, int index=0, int subObjectIndex=0);
1013  char *getSubObjectPipFileName(int idx, int subObjectIndex);
1014  void setSubObjectPipFileName(char *name, int idx, int subObjectIndex);
1015  char *getSubObjectRcsFileName(int idx, int subObjectIndex);
1016  void setSubObjectRcsFileName(char *name, int idx, int subObjectIndex);
1017  char *getSubObjectScFileName(int idx, int subObjectIndex);
1018  void setSubObjectScFileName(char *name, int idx, int subObjectIndex);
1019  char *getSubObjectMatSysFileName(int index=0, int subObjectIndex=0);
1020  void setSubObjectMatSysFileName(char *name, int index=0, int subObjectIndex=0);
1021  void setSubObjectOffsetPosition(double r, double f, double u, int i = 0, int subObjectIndex=0);
1022  void getSubObjectOffsetPosition(double& r, double& f, double& u, int i = 0, int subObjectIndex=0);
1023  void setSubObjectOrientation(double heading, double pitch, double roll, int idx = 0, int subObjectIndex=0);
1024  void getSubObjectOrientation(double &heading, double &pitch, double &roll, int idx = 0, int subObjectIndex=0);
1025  void setSubObjectVelocity(double v, int i = 0, int subObjectIndex=0);
1026  void getSubObjectVelocity(double &v, int i = 0, int subObjectIndex=0);
1027  bool getSubObjectImpostorEnable(int idx, int subObjectIndex=0);
1028  void setSubObjectImpostorEnable(bool enable, int idx, int subObjectIndex=0);
1029  void setSubObjectImpostorTextureResolution(double res, int idx, int subObjectIndex=0);
1030  void getSubObjectImpostorTextureResolution(double &res, int idx, int subObjectIndex=0);
1031  void setSubObjectImpostorPixelCoverage(double cov, int idx, int subObjectIndex=0);
1032  void getSubObjectImpostorPixelCoverage(double &cov, int idx, int subObjectIndex=0);
1033 
1034  void setGreNrt(ciGreNrt *gre, int index = 0);
1035  ciGreNrt *getGreNrt(int index = 0);
1036 
1037  void setGreSTDomain(ciGreSTDomain *gre, int index = 0);
1038  ciGreSTDomain * getGreSTDomain(int index = 0);
1039 
1040 protected: // methods
1041 
1042 private: // methods
1043 
1045  // categoryStringToEnum
1053  Category stringToEnum(char* categoryString);
1054 
1056  // enumToCategoryString
1064  char* enumToCategoryString(ciEntity::Category categoryEnum);
1065 
1066 private: // variables
1067 
1068 
1070  // structEntityData
1083  {
1084  int index;
1085  char entityName[128];
1086  char geomFileName[512];
1087  char matSysFileName[512];
1088  char matSysFileNameMCM[512];
1089  char smokeGeomFileName[512];
1090  char smokeMatSysFileName[512];
1097  char trackFileName[512];
1098  double worldX;
1099  double worldY;
1100  double worldZ;
1101  double latitude;
1102  double longitude;
1103  double altitude;
1104  double heading;
1105  double pitch;
1106  double roll;
1107  char rcsFileName[512];
1108  char scFileName[512];
1109  char pipFileName[512];
1110  char msicFileName[512];
1111  char smokePipFileName[512];
1112  double velocity;
1114  int brdf;
1115  double roughness;
1128  double slBaseAlt;
1129  double slThickness;
1130  double slExtent;
1131  double slCoverage;
1132  char DIGuyCharacterType[512];
1133  char DIGuyBaseAppearance[512];
1134  char DIGuyHeadAppearance[512];
1135  char DIGuyHandItem[512];
1136  char DIGuyAppearance[512];
1143  } *m_entityList;
1148  // ciEntity *m_ciEntityList; /*!< contiguous array of active ciEntity objects */
1149 
1150 };
1151 
1152 #endif // !defined(AFX_CIENTITY_H__DE81EF86_CAA9_471E_AE7A_9087CD4CB282__INCLUDED_)


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