![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2000 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: extEntSR.h,v $ $Revision: 1.13 $ $State: Exp $ 00007 *******************************************************************************/ 00008 00009 #ifndef EXTENTSR_H 00010 #define EXTENTSR_H 00011 00012 #include <vl/entitySR.h> 00013 #include <vrfExtObjects/vrfExtensions.h> 00014 00015 #include <list> 00016 00017 // class DtExtEntityStateRepository: 00018 // 00019 // Instances of DtExtEntityStateRepository are 00022 00023 #include <vrfExtObjects/vrfExtObjectsDefines.h> 00024 class DT_DLL_vrfExtObjects DtExtEntityStateRepository : public DtEntityStateRepository, 00025 public DtVrfExtensions 00026 { 00027 00028 public: 00029 00030 // default constructor 00031 DtExtEntityStateRepository(); 00032 00033 // destructor 00034 virtual ~DtExtEntityStateRepository(); 00035 00036 // copy constructor 00037 DtExtEntityStateRepository(const DtExtEntityStateRepository& orig); 00038 00039 // assignment operator 00040 DtExtEntityStateRepository& operator=(const DtExtEntityStateRepository& orig); 00041 00042 // Return a copy/empty object of the same type as this. 00043 virtual DtStateRepository* clone(bool copy = false) const; 00044 00045 // Compares us against the supplied state repository and returns what's 00046 // changed 00047 virtual int compare(const DtExtEntityStateRepository* rhs); 00048 00049 // Returns what has changed since the last time we called compare 00050 virtual int compareToMostRecent(); 00051 00052 // Compares articulated parts in the local copy to current values 00053 // and returns a non-zero value if modified. If modified, copies current 00054 // into last value 00055 virtual int compareArtParts(const std::list<int>&); 00056 00057 // Compares each value that is valid, and, if any have changed, returns 00058 // DtChanged_Other 00059 virtual int compareArtParts(const DtArticulatedPart* source, const DtArticulatedPart* target); 00060 00061 // Returns true if our stashed location is different than our 00062 // current location 00063 virtual bool locationsDifferent(bool updateIfDifferent); 00064 00065 public: 00067 bool needsVrfDataUpdate() const; 00068 void clearVrfDataNeedsUpdate(); 00069 00071 bool hasVrfObjectDataMessage() const; 00072 00076 void setHasVrfObjectDataMessage(bool); 00077 00078 public: 00079 00080 static DtExtEntityStateRepository* create(); 00081 00082 protected: 00083 virtual void extensionModified(); 00084 00085 public: 00086 // Override to set myHasVrfObjectDataMessage to true 00087 virtual bool setupFromVrfObjectData(const DtIfVrfObjectData& data); 00088 00089 protected: 00090 DtExtEntityStateRepository* myLastCopy; 00091 bool myVrfObjectDataUpdated; 00092 00093 // If true, a vrf object data message has been seen for this object. By default, this is false 00094 bool myHasVrfObjectDataMessage; 00095 }; 00096 00097 inline bool DtExtEntityStateRepository::hasVrfObjectDataMessage() const 00098 { 00099 return myHasVrfObjectDataMessage; 00100 } 00101 00102 inline void DtExtEntityStateRepository::setHasVrfObjectDataMessage(bool b) 00103 { 00104 myHasVrfObjectDataMessage = b; 00105 } 00106 00107 inline bool DtExtEntityStateRepository::needsVrfDataUpdate() const 00108 { 00109 return myVrfObjectDataUpdated; 00110 } 00111 00112 inline void DtExtEntityStateRepository::clearVrfDataNeedsUpdate() 00113 { 00114 myVrfObjectDataUpdated = false; 00115 } 00116 00117 inline void DtExtEntityStateRepository::extensionModified() 00118 { 00119 myVrfObjectDataUpdated = true; 00120 } 00121 00122 #endif