VR-Forces 4.1.1 Class Documentation
2dGraphicalObjectStateRecord.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2010 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: 2dGraphicalObjectStateRecord.h,v $ $Revision: 1.2 $ $State: Exp $
7 *******************************************************************************/
8 #ifndef Dt2DGraphicalObjectStateRecord_H_
9 #define Dt2DGraphicalObjectStateRecord_H_
10 
12 
13 #include <vl/objDesList.h>
14 #include <vl/envRec.h>
15 #include <vl/packets/envProcP.h>
16 #include <vlpi/disEnums.h>
17 
19 
20 #include <vector>
21 
22 struct DtNet2DGraphicalObjectStateRecord : DtNetEnvironmentalRecord
23 {
24  DtNetU8 myColor[4];
25  DtNetInt32 myFillPattern;
26  DtNetBoolean myFlashing;
30  DtNetU16 myUserDataSize;
32  DtNetU8 myPadding;
33 };
34 
35 
39 {
40 public:
43 
46  const Dt2DGraphicalObjectStateRecord& orig);
47 
49  const Dt2DGraphicalObjectStateRecord& operator=(
50  const Dt2DGraphicalObjectStateRecord& orig);
51 
54 
56  virtual DtEnvironmentalRecord* clone() const;
57 
59  virtual void setColor(int r, int g, int b, int a);
60  virtual void getColor(int& r, int& g, int& b, int& a) const;
61 
63  virtual void setFillPattern(int pattern);
64  virtual int fillPattern() const;
65 
67  virtual void setFlashing(bool yesNo);
68  virtual bool flashing() const;
69 
70  virtual bool setNumberOfApplicationIds(int newNumberOfAppIds);
71  virtual int numberOfApplicationIds() const;
72 
73  virtual bool setApplicationId(int index,
74  const DtGlobalObjectDesignator& subID);
75 
76  virtual bool getApplicationId(int index, DtGlobalObjectDesignator& subID)
77  const;
78 
79  virtual bool setNumberOfVertices(unsigned int newNumberOfVertices);
80  virtual unsigned int numberOfVertices() const;
81 
82  virtual bool setVertex(unsigned int index, const DtVector& loc);
83  virtual bool getVertex(unsigned int index, DtVector& loc);
84 
85  virtual bool setNumberOfParentOverlays(int newNumberOfParentOverlays);
86  virtual int numberOfParentOverlays() const;
87 
88  virtual bool setParentOverlay(int index,
89  const DtString& name);
90 
91  virtual bool getParentOverlay(int index, DtString& name) const;
92 
94  virtual void setWindowName(const DtString& name);
95  virtual const DtString& windowName() const;
96 
98  virtual void setUserData(const char* data, int length);
99  virtual const char* userData(int* length = 0) const;
100 
102  virtual bool createNetworkRepresentation();
103 
105  const DtNet2DGraphicalObjectStateRecord* objectNetRep() const;
106  DtNet2DGraphicalObjectStateRecord* objectNetRep();
107 
109  virtual void setFromNet(const DtNetEnvironmentalRecord& buffer);
110 
112  virtual int netRepSize() const;
113 
114 protected:
115  virtual bool resizeNetRep(int newSize);
116 
117  virtual int verticesNetSize() const;
118 
119  // These functions do the pointer math to get a pointer to
120  // the right place in the internal buffer for the start of these
121  // data areas.
122  virtual void* pointerToVertices() const;
123  virtual void* pointerToApplicationIds() const;
124  virtual void* pointerToParentOverlays() const;
125  virtual void* pointerToWindowName() const;
126  virtual void* pointerToUserData() const;
127 
128 protected:
129  int myColorR;
130  int myColorG;
131  int myColorB;
132  int myColorA;
135  std::vector<DtVector> myVertices;
136  DtGlobalObjectDesignatorList myApplicationIds;
139  char* myUserData;
141 
143 };
144 
145 
146 #endif
147 

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)