VR-Exchange 2.1 API Documentation
pViewControlInter.h
Go to the documentation of this file.
1 /*********************************************************************
2  ** Copyright (c) 1992-2010 VT MAK
3  ** All rights reserved.
4  *********************************************************************/
5 
6 
7 #ifndef pViewControlInter_H_
8 #define pViewControlInter_H_
9 
11 #include <vlutil/vlString.h>
12 #include <vlutil/vlNetTypes.h>
13 #include <matrix/vlVector.h>
14 
15 namespace MAKVrExchange {
16 
17 class DtPortalConnection;
18 
20 {
84 };
85 
87 {
92 };
93 
94 #define DtDEC_ATTRIBUTE_PRESENT(T, N, n) \
95  public : \
96  void set##N(const T& val) { my##N = val; long long shiftNum = (1ull << DtVC##N); myOptionPresent = myOptionPresent | shiftNum; }\
97  const T& n() const { return my##N;} \
98  T& n() { return my##N;} \
99  protected: \
100  T my##N;
101 
102 #define DtDEC_ATTRIBUTE_PRESENT2(T, N, n) \
103  public : \
104  void set##N(const T& val) { my##N = val; long long shiftNum = (1ul << DtVC##N); myOptionPresent2 = myOptionPresent2 | shiftNum; }\
105  const T& n() const { return my##N;} \
106  T& n() { return my##N;} \
107  protected: \
108  T my##N;
109 
112 //
116 {
117 public:
118 
119  typedef void (*DtPortalViewControlInteractionCb)
120  (const DtPortalViewControlInteraction &inter, void *usr);
121 
122 public:
123 
126 
129 
130  virtual bool contains(DtViewControlOption opt) const;
131  virtual bool contains(DtViewControlOption2 opt) const;
132 
135 
137  DtDEC_ATTRIBUTE(DtString, ViewerId, viewerId);
138 
140  DtDEC_ATTRIBUTE(DtString, SenderId, senderId);
141 
143  DtDEC_ATTRIBUTE(DtU32, ViewerCommand, viewerCommand);
144 
146  DtDEC_ATTRIBUTE(DtU32, IgnoreFlag, ignoreFlag);
147 
149  DtDEC_ATTRIBUTE(DtBoolean, StatusCommand, statusCommand);
150 
153  DtDEC_ATTRIBUTE(DtString, ViewString, viewString);
154 
157  DtDEC_ATTRIBUTE(std::vector<DtString>, ObjectIds, objectIds);
158 
159  DtDEC_ATTRIBUTE(DtU64, OptionPresent, optionPresent);
160  DtDEC_ATTRIBUTE(DtU64, OptionPresent2, optionPresent2);
161 
163  DtDEC_ATTRIBUTE_PRESENT(DtU32, OverlayOption, overlayOption);
164  DtDEC_ATTRIBUTE_PRESENT(double, LocatorRange, locatorRange);
165  DtDEC_ATTRIBUTE_PRESENT(DtU32, Smoothing, smoothing);
166  DtDEC_ATTRIBUTE_PRESENT(double, SmoothingPeriod, smoothingPeriod);
167  DtDEC_ATTRIBUTE_PRESENT(bool, Sound, sound);
168  DtDEC_ATTRIBUTE_PRESENT(bool, EntityLabels, entityLabels);
169  DtDEC_ATTRIBUTE_PRESENT(bool, TrailingEffects, trailingEffects);
170  DtDEC_ATTRIBUTE_PRESENT(bool, TrajectoryHistory, trajectoryHistory);
171  DtDEC_ATTRIBUTE_PRESENT(bool, Recording, recording);
172  DtDEC_ATTRIBUTE_PRESENT(DtU32, AggregateLevel, aggregateLevel);
173  DtDEC_ATTRIBUTE_PRESENT(bool, AggregateHighestOnly, aggregateHighestOnly);
174  DtDEC_ATTRIBUTE_PRESENT(bool, AggregatesAltitudeControlled, aggregatesAltitudeControlled);
175  DtDEC_ATTRIBUTE_PRESENT(bool, NestedAggregates, nestedAggregates);
176  DtDEC_ATTRIBUTE_PRESENT(bool, NestedEntities, nestedEntities);
177  DtDEC_ATTRIBUTE_PRESENT(bool, GroundClamping, groundClamping);
178  DtDEC_ATTRIBUTE_PRESENT(double, ClampRange, clampRange);
179  DtDEC_ATTRIBUTE_PRESENT(bool, FollowGround, followGround);
180  DtDEC_ATTRIBUTE_PRESENT(bool, ConstrainWithFloor, constrainWithFloor);
181  DtDEC_ATTRIBUTE_PRESENT(double, Floor, floor);
182  DtDEC_ATTRIBUTE_PRESENT(double, TimeOfDay, timeOfDay);
183  DtDEC_ATTRIBUTE_PRESENT(double, NearClip, nearClip);
184  DtDEC_ATTRIBUTE_PRESENT(double, FarClip, farClip);
185  DtDEC_ATTRIBUTE_PRESENT(double, Fov, fov);
186  DtDEC_ATTRIBUTE_PRESENT(bool, Fog, fog);
187  DtDEC_ATTRIBUTE_PRESENT(double, NearFog, nearFog);
188  DtDEC_ATTRIBUTE_PRESENT(double, FarFog, farFog);
189  DtDEC_ATTRIBUTE_PRESENT(bool, Texture, texture);
190  DtDEC_ATTRIBUTE_PRESENT(DtString, DatabaseToLoad, databaseToLoad);
191  DtDEC_ATTRIBUTE_PRESENT(float, Stepsize, stepsize);
192  DtDEC_ATTRIBUTE_PRESENT(float, Turnrate, turnrate);
193  DtDEC_ATTRIBUTE_PRESENT(bool, IncrementStepsize, incrementStepsize);
194  DtDEC_ATTRIBUTE_PRESENT(bool, IncrementTurnrate, incrementTurnrate);
195  DtDEC_ATTRIBUTE_PRESENT(bool, DecrementStepsize, decrementStepsize);
196  DtDEC_ATTRIBUTE_PRESENT(bool, DecrementTurnrate, decrementTurnrate);
197  DtDEC_ATTRIBUTE_PRESENT(DtString, Date, date);
198  DtDEC_ATTRIBUTE_PRESENT(bool, Xr, xr);
199  DtDEC_ATTRIBUTE_PRESENT(bool, HatLabels, hatLabels);
200  DtDEC_ATTRIBUTE_PRESENT(DtString, CurrentModelSet, currentModelSet);
201  DtDEC_ATTRIBUTE_PRESENT(bool, ShowNextModelSet, showNextModelSet);
202  DtDEC_ATTRIBUTE_PRESENT(bool, ShowPrevModelSet, showPrevModelSet);
203  DtDEC_ATTRIBUTE_PRESENT(DtString, CurrentTextureSet, currentTextureSet);
204  DtDEC_ATTRIBUTE_PRESENT(bool, ShowNextTextureSet, showNextTextureSet);
205  DtDEC_ATTRIBUTE_PRESENT(bool, ShowPrevTextureSet, showPrevTextureSet);
206  DtDEC_ATTRIBUTE_PRESENT(double, TerrainScale, terrainScale);
207  DtDEC_ATTRIBUTE_PRESENT(double, ObjectScale, objectScale);
208  DtDEC_ATTRIBUTE_PRESENT(bool, Exit, exit);
209  DtDEC_ATTRIBUTE_PRESENT(bool, SkyDome, skyDome);
210  DtDEC_ATTRIBUTE_PRESENT(bool, Clouds, clouds);
211  DtDEC_ATTRIBUTE_PRESENT(bool, Mirroring, mirroring);
212  DtDEC_ATTRIBUTE_PRESENT(bool, MirrorMessageEveryFrame, mirrorMessageEveryFrame);
213  DtDEC_ATTRIBUTE_PRESENT(bool, Broadcasting, broadcasting);
214  DtDEC_ATTRIBUTE_PRESENT(bool, ClusteringLabels, clusteringLabels);
215  DtDEC_ATTRIBUTE_PRESENT(bool, TacticalGraphicsLabels, tacticalGraphicsLabels);
216  DtDEC_ATTRIBUTE_PRESENT(bool, TacticalGraphics, tacticalGraphics);
217  DtDEC_ATTRIBUTE_PRESENT(bool, ShowAggregates, showAggregates);
218  DtDEC_ATTRIBUTE_PRESENT(bool, ShowEmitters, showEmitters);
219  DtDEC_ATTRIBUTE_PRESENT(DtU32, VideoCaptureCommand, videoCaptureCommand);
220  DtDEC_ATTRIBUTE_PRESENT(bool, VideoCaptureRecordInsets, videoCaptureRecordInsets);
221  DtDEC_ATTRIBUTE_PRESENT(DtU32, VideoCaptureFramesPerSecond, videoCaptureFramesPerSecond);
222  DtDEC_ATTRIBUTE_PRESENT(DtString, VideoCaptureFilename, videoCaptureFilename);
223  DtDEC_ATTRIBUTE_PRESENT(DtString, VideoCaptureFilenameBase, videoCaptureFilenameBase);
224  DtDEC_ATTRIBUTE_PRESENT(DtString, VideoCaptureDirectory, videoCaptureDirectory);
225  DtDEC_ATTRIBUTE_PRESENT(bool, ConstrainedToAll, constrainedToAll);
226 
227  DtDEC_ATTRIBUTE_PRESENT2(double, BlockedDistance, blockedDistance);
228  DtDEC_ATTRIBUTE_PRESENT2(bool, UseNearClipForBlockedDistance, useNearClipForBlockedDistance);
229  DtDEC_ATTRIBUTE_PRESENT2(DtU32, FeatureCommand, featureCommand);
230  DtDEC_ATTRIBUTE_PRESENT2(DtString, FeatureFilename, featureFilename);
232 
233 public: /*The access specifier must be reset after calling DtDEC_ATTRIBUTE() */
234 
235  virtual DtPortalMessageKind kind() const;
236  virtual const char * interactionKindName() const { return "View Control"; }
237 
238  virtual unsigned int netSize() const;
239  virtual void writeSelfToBuffer(void *buffer) const ;
240  virtual void readSelfFromBuffer(const void *buffer);
241  virtual std::ostream &printDataToStream(std::ostream &str) const;
242 
243 
244 public:
245 
247 
248  static DtPortalMessage *create();
249 
250  static void addCallback(DtPortalConnection *conn,
251  DtPortalViewControlInteractionCb cb, void *usr);
252  static void removeCallback(DtPortalConnection *conn,
253  DtPortalViewControlInteractionCb cb, void *usr);
254 
255 
256 protected:
257 
258 };
259 }
260 #endif //pViewControlInter_H_

Document ID: Generated on Tue Aug 7 22:07:13 EDT 2012 from SVN revision 117874
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)