VR-Forces 4.0.4 Class Documentation
include/vrfExtObjects/2dGraphicalObjectStateRecord.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2010 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: 2dGraphicalObjectStateRecord.h,v $ $Revision: 1.2 $ $State: Exp $
00007 *******************************************************************************/
00008 #ifndef Dt2DGraphicalObjectStateRecord_H_
00009 #define Dt2DGraphicalObjectStateRecord_H_
00010 
00011 #include <vrfExtObjects/vrfExtObjectsDefines.h>
00012 
00013 #include <vl/objDesList.h>
00014 #include <vl/envRec.h>
00015 #include <vl/packets/envProcP.h>
00016 #include <vlpi/disEnums.h>
00017 
00018 #include <vrfExtObjects/stringList.h>
00019 
00020 #include <vector>
00021 
00022 struct DtNet2DGraphicalObjectStateRecord : DtNetEnvironmentalRecord
00023 {
00024    DtNetU8       myColor[4];
00025    DtNetInt32    myFillPattern;
00026    DtNetBoolean  myFlashing;
00027    DtNetU8       myNumberOfApplicationIds;
00028    DtNetU8       myNumberOfVertices;
00029    DtNetU8       myNumberOfParentOverlays;
00030    DtNetU16      myUserDataSize;
00031    DtNetU8       myWindowNameSize;
00032    DtNetU8       myPadding;
00033 };
00034 
00035 
00038 class DT_DLL_vrfExtObjects Dt2DGraphicalObjectStateRecord : public DtEnvironmentalRecord
00039 {
00040 public:
00042    Dt2DGraphicalObjectStateRecord();
00043 
00045    Dt2DGraphicalObjectStateRecord(
00046       const Dt2DGraphicalObjectStateRecord& orig);
00047 
00049    const Dt2DGraphicalObjectStateRecord& operator=(
00050       const Dt2DGraphicalObjectStateRecord& orig);
00051 
00053    virtual ~Dt2DGraphicalObjectStateRecord();
00054 
00056    virtual DtEnvironmentalRecord* clone() const;
00057    
00059    virtual void setColor(int r, int g, int b, int a);
00060    virtual void getColor(int& r, int& g, int& b, int& a) const;
00061 
00063    virtual void setFillPattern(int pattern);
00064    virtual int fillPattern() const;
00065 
00067    virtual void setFlashing(bool yesNo);
00068    virtual bool flashing() const;
00069 
00070    virtual bool setNumberOfApplicationIds(int newNumberOfAppIds);
00071    virtual int numberOfApplicationIds() const;
00072 
00073    virtual bool setApplicationId(int index,
00074       const DtGlobalObjectDesignator& subID);
00075 
00076    virtual bool getApplicationId(int index, DtGlobalObjectDesignator& subID)
00077       const;
00078 
00079    virtual bool setNumberOfVertices(unsigned int newNumberOfVertices);
00080    virtual unsigned int numberOfVertices() const;
00081 
00082    virtual bool setVertex(unsigned int index, const DtVector& loc);
00083    virtual bool getVertex(unsigned int index, DtVector& loc);
00084 
00085    virtual bool setNumberOfParentOverlays(int newNumberOfParentOverlays);
00086    virtual int numberOfParentOverlays() const;
00087 
00088    virtual bool setParentOverlay(int index,
00089       const DtString& name);
00090 
00091    virtual bool getParentOverlay(int index, DtString& name) const;
00092 
00094    virtual void setWindowName(const DtString& name);
00095    virtual const DtString& windowName() const;
00096 
00098    virtual void setUserData(const char* data, int length);
00099    virtual const char* userData(int* length = 0) const;
00100 
00102    virtual bool createNetworkRepresentation();
00103 
00105    const DtNet2DGraphicalObjectStateRecord* objectNetRep() const;
00106    DtNet2DGraphicalObjectStateRecord* objectNetRep();
00107 
00109    virtual void setFromNet(const DtNetEnvironmentalRecord& buffer);
00110 
00112    virtual int netRepSize() const;
00113 
00114 protected:
00115    virtual bool resizeNetRep(int newSize);
00116 
00117    virtual int verticesNetSize() const;
00118 
00119    // These functions do the pointer math to get a pointer to
00120    // the right place in the internal buffer for the start of these
00121    // data areas.
00122    virtual void* pointerToVertices() const;
00123    virtual void* pointerToApplicationIds() const;
00124    virtual void* pointerToParentOverlays() const;
00125    virtual void* pointerToWindowName() const;
00126    virtual void* pointerToUserData() const;
00127 
00128 protected:
00129    int                          myColorR;
00130    int                          myColorG;
00131    int                          myColorB;
00132    int                          myColorA;
00133    int                          myFillPattern;
00134    bool                         myFlashing;
00135    std::vector<DtVector>        myVertices;
00136    DtGlobalObjectDesignatorList myApplicationIds;
00137    DtStringList                 myParentOverlays; 
00138    DtString                     myWindowName;
00139    char*                        myUserData;
00140    int                          myUserDataLength;
00141 
00142    int myNetRepSize;
00143 };
00144 
00145 
00146 #endif
00147 

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)