VR-Forces 4.0.4 Class Documentation
include/vrfExtProtocol/vrfObjectStateUpdate.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2004 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: vrfObjectStateUpdate.h,v $ $Revision: 1.10 $ $State: Exp $
00007 *******************************************************************************/
00008 
00009 #ifndef DtVrfObjectStateUpdate_H_
00010 #define DtVrfObjectStateUpdate_H_
00011 
00012 #include <vector>
00013 #include <vrfExtProtocol/ifaceCont.h>
00014 #include <vlpi/NetStructs.h>
00015 
00016 struct DtNetVrfObjectStateHeader
00017 {
00018    DtNetU32    myNumberOfRecords;
00019    DtNetU32    myPadding;
00020 };
00021 
00022 struct DtNetVrfObjectStateRecord
00023 {
00024    // HACK for visual studio 6.0.  For some reason, VC6 would not accept this 
00025    // structure in a std::container class without an operator= defined.
00026    DtNetVrfObjectStateRecord& operator=(const DtNetVrfObjectStateRecord& other) 
00027    {
00028       myGeocentricPosition = other.myGeocentricPosition;
00029       myGeocentricVelocity = other.myGeocentricVelocity;
00030       myGeocentricAcceleration = other.myGeocentricAcceleration;
00031       myGeocentricOrientation = other.myGeocentricOrientation;
00032       myObjectIdentifier = other.myObjectIdentifier;
00033       return *this;
00034    };
00035 
00036    DtNet64Vector           myGeocentricPosition;      // 96 bytes
00037    DtNet64Vector           myGeocentricVelocity;      // 96 bytes
00038    DtNet64Vector           myGeocentricAcceleration;  // 96 bytes
00039    DtNetEulerAngles        myGeocentricOrientation;   // 12 bytes
00040    DtNetU32                myPadding1;                //  4 bytes
00041    DtNetEntityIdentifier   myObjectIdentifier;        //  6 bytes
00042    DtNetU16                myPadding;                 //  2 bytes
00043 };
00044 
00045 
00046 // class DtVrfObjectStateUpdate:
00047 //
00048 // Instances of DtVrfObjectStateUpdate are
00049 
00050 #include <vrfExtProtocol/vrfExtProtocolDefines.h>
00051 class DT_DLL_vrfExtProtocol DtVrfObjectStateUpdate : public DtSimInterfaceContent
00052 {
00053 public:
00054 
00055    // default constructor
00056    DtVrfObjectStateUpdate();
00057 
00058    // destructor
00059    virtual ~DtVrfObjectStateUpdate();
00060 
00061    DtVrfObjectStateUpdate(const DtVrfObjectStateUpdate& orig);
00062 
00063    DtVrfObjectStateUpdate& operator=(const DtVrfObjectStateUpdate& orig);
00064 
00065    // Returns the type of Interface Content; DtVrfObjectStateMessageType.
00066    virtual int type() const;
00067 
00068    virtual DtSimInterfaceContent * clone() const;
00069 
00070    // Removes all records that have been added to the object state update.
00071    virtual void clear();
00072 
00073    virtual void add(const DtNetVrfObjectStateRecord& record);
00074 
00075    virtual const std::vector<DtNetVrfObjectStateRecord>& records() const;
00076 
00077    virtual int netRepSize() const;
00078    virtual bool setFromNet(const char* contentBuffer, 
00079       unsigned contentSize);
00080    virtual bool setToNet();
00081 
00082    virtual void printDataToString(DtString& str);
00083 
00084    static DtSimInterfaceContent* creator();
00085 
00086 protected:
00087 
00088    std::vector<DtNetVrfObjectStateRecord> myRecords;
00089 };
00090 
00091 #endif

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)