VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Entity State Repository Extension

The MyEntityStateRep class contains the new mass variable


Header file:

/*******************************************************************************
** Copyright (c) 2007 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
/*******************************************************************************
** $RCSfile: myEsr.h,v $ $Revision: 1.8 $ $State: Exp $
*******************************************************************************/
#pragma once
#if DtHLA
#include <vrfExtObjects/extEntityStateRepository.h>
#include <stdio.h>
//Because this example adds a concept that did not already exist in VR-Link's
//DtEntityStateRepository class, we create this subclass of
//DtEntityStateRepository that adds the concept of mass.
{
public:
, myMass(0.)
{
}
{
}
//Set/Get the value of mass
virtual void setMass(float mass);
virtual float mass() const;
//Virtual function override: print the state rep's data.
virtual void printData() const;
public:
//Create a MyEntityStateRep. Caller is reponsible for deletion.
//Copy shallow (false) or deep (true).
virtual DtStateRepository* clone(bool copy = false) const;
protected:
float myMass;
};
//Inline functions
inline void MyEntityStateRep::setMass(float temp)
{
myMass = temp;
}
inline float MyEntityStateRep::mass() const
{
return myMass;
}
inline void MyEntityStateRep::printData() const
{
printf("Mass: %lf\n", mass());
}
{
return new MyEntityStateRep();
}
inline DtStateRepository* MyEntityStateRep::clone(bool copy) const
{
if (copy)
{
return new MyEntityStateRep(*this);
}
else
{
return new MyEntityStateRep();
}
}
#endif

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)