![]() |
VR-Link API Documentation for DIS
|
00001 /********************************************************************* 00002 ** Copyright (c) 1992-2010 VT MAK 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 #pragma once 00006 00007 #if DtHLA 00008 00009 #include <stdio.h> 00010 #include <vl/entitySR.h> 00011 00016 class MyEntityStateRep : public DtEntityStateRepository 00017 { 00018 public: 00019 00021 virtual void setMass(float mass); 00023 virtual float mass() const; 00024 00026 virtual void printData() const; 00027 00028 public: 00029 00031 static DtEntityStateRepository* create(); 00032 00034 virtual DtStateRepository* clone(bool copy = false) const; 00035 00036 protected: 00037 00038 float myMass; 00039 }; 00040 00041 00042 inline void MyEntityStateRep::setMass(float temp) 00043 { 00044 myMass = temp; 00045 } 00046 00047 inline float MyEntityStateRep::mass() const 00048 { 00049 return myMass; 00050 } 00051 00052 inline void MyEntityStateRep::printData() const 00053 { 00054 DtEntityStateRepository::printData(); 00055 printf("Mass: %lf\n", mass()); 00056 } 00057 00058 inline DtEntityStateRepository* MyEntityStateRep::create() 00059 { 00060 return new MyEntityStateRep(); 00061 } 00062 00063 inline DtStateRepository* MyEntityStateRep::clone(bool copy) const 00064 { 00065 if (copy) 00066 { 00067 return new MyEntityStateRep(*this); 00068 } 00069 else 00070 { 00071 return new MyEntityStateRep(); 00072 } 00073 } 00074 00075 #endif 00076