VR-Forces 4.0.4 Class Documentation
include/vrfExtObjects/3dGraphicalObjectStateRecord.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2009 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: 3dGraphicalObjectStateRecord.h,v $ $Revision: 1.2 $ $State: Exp $
00007 *******************************************************************************/
00010 
00011 #ifndef Dt3DGraphicalObjectStateRecord_H_
00012 #define Dt3DGraphicalObjectStateRecord_H_
00013 
00014 #include <vrfExtObjects/vrfExtObjectsDefines.h>
00015 
00016 #include <vl/objDesList.h>
00017 #include <vl/envRec.h>
00018 #include <vl/packets/envProcP.h>
00019 #include <vlpi/disEnums.h>
00020 
00021 #include <vrfExtObjects/stringList.h>
00022 #include <vrfExtObjects/3dAttachDescriptor.h>
00023 
00024 #include <vector>
00025 
00026 struct DtNet3DGraphicalObjectStateRecord : DtNetEnvironmentalRecord
00027 {
00028    DtNetVector32 myOffset;
00029    DtNetU8       myColor[4];
00030    DtNetInt32    myFillPattern;
00031    DtNetBoolean  myFlashing;
00032    DtNetU8       myForceType;
00033    DtNetBoolean  myProjected;
00034    DtNetBoolean  myBound2D;
00035    DtNetU8       myNumberOfApplicationIds;
00036    DtNetU8       myNumberOfAttachments;
00037    DtNetU8       myNumberOfParentOverlays;
00038    DtNetU8       myLabelSize;
00039    DtNetU16      myUserDataSize;
00040 };
00041 
00042 
00045 class DT_DLL_vrfExtObjects Dt3DGraphicalObjectStateRecord : public DtEnvironmentalRecord
00046 {
00047 public:
00049    Dt3DGraphicalObjectStateRecord();
00050 
00052    Dt3DGraphicalObjectStateRecord(
00053       const Dt3DGraphicalObjectStateRecord& orig);
00054 
00056    const Dt3DGraphicalObjectStateRecord& operator=(
00057       const Dt3DGraphicalObjectStateRecord& orig);
00058 
00060    virtual ~Dt3DGraphicalObjectStateRecord();
00061 
00063    virtual DtEnvironmentalRecord* clone() const;
00064    
00066    virtual void setOffset(const DtVector& pos);
00067    virtual const DtVector& offset() const;
00068 
00070    virtual void setColor(int r, int g, int b, int a);
00071    virtual void getColor(int& r, int& g, int& b, int& a) const;
00072 
00074    virtual void setFillPattern(int pattern);
00075    virtual int fillPattern() const;
00076 
00078    virtual void setFlashing(bool yesNo);
00079    virtual bool flashing() const;
00080 
00082    virtual void setForceType(DtForceType forceType);
00083    virtual DtForceType forceType() const;
00084 
00086    virtual void setProjected(bool yesNo);
00087    virtual bool projected() const;
00088 
00090    virtual void setBound2D(bool yesNo);
00091    virtual bool bound2D() const;
00092 
00093    virtual bool setNumberOfApplicationIds(int newNumberOfAppIds);
00094    virtual int numberOfApplicationIds() const;
00095 
00096    virtual bool setApplicationId(int index,
00097       const DtGlobalObjectDesignator& subID);
00098 
00099    virtual bool getApplicationId(int index, DtGlobalObjectDesignator& subID)
00100       const;
00101 
00102    virtual bool setNumberOfAttachments(int newNumberOfAppIds);
00103    virtual int numberOfAttachments() const;
00104 
00105    virtual bool setAttachment(int index, const DtAttachmentDescriptor& desc, 
00106       const DtGlobalObjectDesignator& attachId);
00107 
00108    virtual bool getAttachment(int index, DtAttachmentDescriptor& desc,
00109       DtGlobalObjectDesignator& attachId) const;
00110 
00111    virtual bool setNumberOfParentOverlays(int newNumberOfParentOverlays);
00112    virtual int numberOfParentOverlays() const;
00113 
00114    virtual bool setParentOverlay(int index,
00115       const DtString& name);
00116 
00117    virtual bool getParentOverlay(int index, DtString& name) const;
00118 
00119 
00121    virtual void setLabel(const DtString& label);
00122    virtual const DtString& label() const;
00123 
00125    virtual void setUserData(const char* data, int length);
00126    virtual const char* userData(int* length = 0) const;
00127 
00129    virtual bool createNetworkRepresentation();
00130 
00132    const DtNet3DGraphicalObjectStateRecord* objectNetRep() const;
00133    DtNet3DGraphicalObjectStateRecord* objectNetRep();
00134 
00136    virtual void setFromNet(const DtNetEnvironmentalRecord& buffer);
00137 
00139    virtual int netRepSize() const;
00140 
00141 protected:
00142    virtual bool resizeNetRep(int newSize);
00143 
00144    // These functions do the pointer math to get a pointer to
00145    // the right place in the internal buffer for the start of these
00146    // data areas.
00147    virtual void* pointerToApplicationIds() const;
00148    virtual void* pointerToAttachmentList() const;
00149    virtual void* pointerToAttachmentIdList() const;
00150    virtual void* pointerToParentOverlays() const;
00151    virtual void* pointerToLabel() const;
00152    virtual void* pointerToUserData() const;
00153 
00154 protected:
00155    DtVector                     myOffset;
00156    int                          myColorR;
00157    int                          myColorG;
00158    int                          myColorB;
00159    int                          myColorA;
00160    int                          myFillPattern;
00161    bool                         myFlashing;
00162    DtForceType                  myForceType;
00163    bool                         myProjected;
00164    bool                         myBound2D;
00165    DtGlobalObjectDesignatorList myApplicationIds;
00166    DtAttachmentDescriptorList   myAttachments;
00167    DtGlobalObjectDesignatorList myAttachmentIds;
00168    DtStringList                 myParentOverlays; 
00169    DtString                     myLabel;
00170    char*                        myUserData;
00171    int                          myUserDataLength;
00172 
00173    int myNetRepSize;
00174 };
00175 
00176 
00177 #endif
00178 

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)