VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
3dGraphicalObjectStateRecord.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2009 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: 3dGraphicalObjectStateRecord.h,v $ $Revision: 1.2 $ $State: Exp $
7 *******************************************************************************/
10 
11 #ifndef Dt3DGraphicalObjectStateRecord_H_
12 #define Dt3DGraphicalObjectStateRecord_H_
13 
15 
16 #include <vl/globalObjectDesignatorList.h>
17 #include <vl/environmentalRecord.h>
18 #include <vl/packets/envProcP.h>
19 #include <vlpi/disEnums.h>
20 
23 
24 #include <vector>
25 
26 struct DtNet3DGraphicalObjectStateRecord : DtNetEnvironmentalRecord
27 {
28  DtNetVector32 myOffset;
29  DtNetU8 myColor[4];
30  DtNetInt32 myFillPattern;
31  DtNetBoolean myFlashing;
32  DtNetU8 myForceType;
33  DtNetBoolean myProjected;
34  DtNetBoolean myBound2D;
38  DtNetU8 myLabelSize;
39  DtNetU16 myUserDataSize;
40 };
41 
42 
46 {
47 public:
50 
53  const Dt3DGraphicalObjectStateRecord& orig);
54 
56  const Dt3DGraphicalObjectStateRecord& operator=(
57  const Dt3DGraphicalObjectStateRecord& orig);
58 
61 
63  virtual DtEnvironmentalRecord* clone() const;
64 
66  virtual void setOffset(const DtVector32& pos);
67  virtual const DtVector32& offset() const;
68 
70  virtual void setColor(int r, int g, int b, int a);
71  virtual void getColor(int& r, int& g, int& b, int& a) const;
72 
74  virtual void setFillPattern(int pattern);
75  virtual int fillPattern() const;
76 
78  virtual void setFlashing(bool yesNo);
79  virtual bool flashing() const;
80 
82  virtual void setForceType(DtForceType forceType);
83  virtual DtForceType forceType() const;
84 
86  virtual void setProjected(bool yesNo);
87  virtual bool projected() const;
88 
90  virtual void setBound2D(bool yesNo);
91  virtual bool bound2D() const;
92 
93  virtual bool setNumberOfApplicationIds(int newNumberOfAppIds);
94  virtual int numberOfApplicationIds() const;
95 
96  virtual bool setApplicationId(int index,
97  const DtGlobalObjectDesignator& subID);
98 
99  virtual bool getApplicationId(int index, DtGlobalObjectDesignator& subID)
100  const;
101 
102  virtual bool setNumberOfAttachments(int newNumberOfAppIds);
103  virtual int numberOfAttachments() const;
104 
105  virtual bool setAttachment(int index, const DtAttachmentDescriptor& desc,
106  const DtGlobalObjectDesignator& attachId);
107 
108  virtual bool getAttachment(int index, DtAttachmentDescriptor& desc,
109  DtGlobalObjectDesignator& attachId) const;
110 
111  virtual bool setNumberOfParentOverlays(int newNumberOfParentOverlays);
112  virtual int numberOfParentOverlays() const;
113 
114  virtual bool setParentOverlay(int index,
115  const DtString& name);
116 
117  virtual bool getParentOverlay(int index, DtString& name) const;
118 
119 
121  virtual void setLabel(const DtString& label);
122  virtual const DtString& label() const;
123 
125  virtual void setUserData(const char* data, int length);
126  virtual const char* userData(int* length = 0) const;
127 
129  virtual bool createNetworkRepresentation();
130 
132  const DtNet3DGraphicalObjectStateRecord* objectNetRep() const;
133  DtNet3DGraphicalObjectStateRecord* objectNetRep();
134 
136  virtual void setFromNet(const DtNetEnvironmentalRecord& buffer, int protocolVersion);
137 
139  virtual int netRepSize() const;
140 
141 protected:
142  virtual bool resizeNetRep(int newSize);
143 
144  // These functions do the pointer math to get a pointer to
145  // the right place in the internal buffer for the start of these
146  // data areas.
147  virtual void* pointerToApplicationIds() const;
148  virtual void* pointerToAttachmentList() const;
149  virtual void* pointerToAttachmentIdList() const;
150  virtual void* pointerToParentOverlays() const;
151  virtual void* pointerToLabel() const;
152  virtual void* pointerToUserData() const;
153 
154 protected:
155  DtVector32 myOffset;
156  int myColorR;
157  int myColorG;
158  int myColorB;
159  int myColorA;
162  DtForceType myForceType;
164  bool myBound2D;
165  DtGlobalObjectDesignatorList myApplicationIds;
167  DtGlobalObjectDesignatorList myAttachmentIds;
170  char* myUserData;
172 
174 };
175 
176 
177 #endif
178 

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)