VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtChannelConfiguration.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2022 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvUtil/vrvUtil.h>
14 #include <vrvUtil/DtKeywordMixin.h>
15 
16 #include <boost/serialization/set.hpp>
17 
18 namespace makVrv
19 {
27  : public DtConfiguration
28  , public DtKeywordMixin
29  {
30 
31  public:
32 
33  static const char* DefaultChannelString;
34 
37  static const char* UseObserverSensorString;
38 
40  {
43  DatabaseUnits
44  };
45 
47  {
48  FIXED = 0,
52  };
53 
55  {
59  NEAR_FAR_DYNAMIC_NEAR_CLIP_MAG_CLAMP // same as reduce z fight but with near clamped
60  // by an intersector so it can't go past terrain
61  // in front of the camera
62  };
63 
65  {
66  IGNORE_ATTACHED = 0,
70  DISTANCE_TO_ATTACHED
72  };
73 
76  DtChannelConfiguration(const std::string& name = DefaultChannelString);
77 
80 
83 
85  virtual ~DtChannelConfiguration();
86 
88  virtual void setParentChannel(const std::string& displayName,
89  const std::string& windowName, const std::string& channelName);
90 
92  virtual void getParentChannel(std::string& displayEngineNameOut,
93  std::string& windowNameOut, std::string& channelNameOut) const;
94 
96  virtual void setProjection(ProjectionUnits units, double left, double right, double bottom, double top,
97  double zNear, double zFar);
98 
100  virtual void getProjection(ProjectionUnits& units, double &left, double &right, double &bottom, double &top,
101  double &zNear, double &zFar) const;
102 
104  virtual ProjectionUnits projectionUnits() const;
105 
107  virtual void setProjectionUnits(ProjectionUnits units);
108 
111  virtual void getClearColor(float& r,float& g,float& b,float& a) const;
112 
115  virtual void setClearColor(float r,float g,float b,float a);
116 
118  virtual void setCameraPositionOffset(double x, double y, double z);
119 
121  virtual void getCameraPositionOffset(double& x, double& y, double& z) const;
122 
124  virtual void setCameraOrientationOffset(double psi, double theta, double phi);
125 
127  virtual void getCameraOrientationOffset(double& psi, double& theta, double& phi) const;
128 
130  virtual void getViewport(double& left,double& right,double& bottom,double& top) const;
131 
133  virtual void setViewport(double left,double right,double bottom, double top);
134 
136  virtual const std::string& observerName() const;
137 
139  virtual void setObserverName(const std::string& observerName);
140 
142  virtual const std::string& sensorName() const;
143 
145  virtual void setSensorName(const std::string& sensorName);
146 
148  virtual ProjectionResizePolicy projectionResizePolicy() const;
149 
151  virtual void setProjectionResizePolicy(ProjectionResizePolicy policy);
152 
154  virtual double cameraMagnification() const;
155 
157  virtual void setCameraMagnification(double mag);
158 
163  virtual void setNearFarClipPolicy( NearFarClipPolicy policy );
164 
166  virtual NearFarClipPolicy nearFarClipPolicy() const;
167 
170  virtual void setZFightReductionRatio( double ratio );
171 
174  virtual double zFightReductionRatio() const;
175 
178  virtual void setDynamicNearClipAttachedObjectPolicy(
179  DynamicNearClipAttachedObjectPolicy useAttached );
180 
183  virtual DynamicNearClipAttachedObjectPolicy
184  dynamicNearClipAttachedObjectPolicy() const;
185 
188  virtual void setAltitudeForUseAttachedNearClip( double altitude );
189 
192  virtual double altitudeForUseAttachedNearClip() const;
193 
197  virtual void setNearClipWhenAttached( double distance );
198 
202  virtual double nearClipWhenAttached() const;
203 
207  virtual void setDynamicWaterVisibilityEnable( bool enable );
208 
210  virtual bool dynamicWaterVisibilityEnable() const;
211 
214  virtual void setDynamicWaterVisibilityMax( double visMax );
215 
218  virtual double dynamicWaterVisibilityMax() const;
219 
222  virtual void setRenderOrder( int order );
223 
225  virtual int renderOrder() const;
226 
230  virtual double minZNear(double value) const;
231 
235  virtual void setMinZNear(double value);
236 
238  virtual float pixelRatio() const;
239 
242  virtual void setPixelRatio(float ratio);
243 
245  virtual void setHorizontalFlip(bool flipped);
246 
248  virtual bool horizontalFlip() const;
249 
256  protected:
257 
258  template<class Archive>
259  void _serialize(Archive & ar, const unsigned int version)
260  {
263 
264  ar & DT_SERIALIZE_MEMBER(myClearColorR);
265  ar & DT_SERIALIZE_MEMBER(myClearColorG);
266  ar & DT_SERIALIZE_MEMBER(myClearColorB);
267  ar & DT_SERIALIZE_MEMBER(myClearColorA);
268  ar & DT_SERIALIZE_MEMBER(myViewportLeft);
269  ar & DT_SERIALIZE_MEMBER(myViewportRight);
270  ar & DT_SERIALIZE_MEMBER(myViewportBottom);
271  ar & DT_SERIALIZE_MEMBER(myViewportTop);
272  ar & DT_SERIALIZE_MEMBER(myParentDisplayEngineName);
273  ar & DT_SERIALIZE_MEMBER(myParentWindowName);
274  ar & DT_SERIALIZE_MEMBER(myParentChannelName);
275  ar & DT_SERIALIZE_MEMBER(myCameraPositionOffsetX);
276  ar & DT_SERIALIZE_MEMBER(myCameraPositionOffsetY);
277  ar & DT_SERIALIZE_MEMBER(myCameraPositionOffsetZ);
278  ar & DT_SERIALIZE_MEMBER(myCameraOrientationOffsetPsi);
279  ar & DT_SERIALIZE_MEMBER(myCameraOrientationOffsetTheta);
280  ar & DT_SERIALIZE_MEMBER(myCameraOrientationOffsetPhi);
281  ar & DT_SERIALIZE_MEMBER(myFrustumLeft);
282  ar & DT_SERIALIZE_MEMBER(myFrustumRight);
283  ar & DT_SERIALIZE_MEMBER(myFrustumTop);
284  ar & DT_SERIALIZE_MEMBER(myFrustumBottom);
285  ar & DT_SERIALIZE_MEMBER(myNearZ);
286  ar & DT_SERIALIZE_MEMBER(myFarZ);
287  ar & DT_SERIALIZE_MEMBER(myProjectionUnits);
288  ar & DT_SERIALIZE_MEMBER(myObserverName);
289  ar & DT_SERIALIZE_MEMBER(myProjectionResizePolicy);
290 
291  if (version > 1)
292  {
293  ar & DT_SERIALIZE_MEMBER(myKeywords);
294  }
295 
296  if (version > 2 && version < 6)
297  {
298  ar & DT_SERIALIZE_MEMBER(myDynamicNearFar);
299  ar & DT_SERIALIZE_MEMBER(myNearFarRatio);
300  }
301 
302  if (version > 3)
303  {
304  ar & DT_SERIALIZE_MEMBER(myCameraMagnification);
305  }
306 
307  if (version > 4)
308  {
309  ar & DT_SERIALIZE_MEMBER(mySensorName);
310  }
311 
312  if (version > 5)
313  {
314  ar & DT_SERIALIZE_MEMBER(myNearFarClipPolicy);
315  ar & DT_SERIALIZE_MEMBER(myZFightReductionRatio);
316  ar & DT_SERIALIZE_MEMBER(myDynamicNearClipAttachedObjectPolicy);
317  ar & DT_SERIALIZE_MEMBER(myAltitudeForUseAttachedNearClip);
318  ar & DT_SERIALIZE_MEMBER(myNearClipWhenAttached);
319  ar & DT_SERIALIZE_MEMBER(myDynamicWaterVisibilityEnable);
320  ar & DT_SERIALIZE_MEMBER(myDynamicWaterVisibilityMax);
321  }
322 
323  if (version > 6)
324  {
325  ar & DT_SERIALIZE_MEMBER(myRenderOrder);
326  }
327  if (version > 7)
328  {
329  ar & DT_SERIALIZE_MEMBER(myLodScale);
330  }
331  if (version > 8)
332  {
333  ar & DT_SERIALIZE_MEMBER(myHorizontalFlip);
334  }
335  }
336 
338  std::string myParentWindowName;
339  std::string myParentChannelName;
340 
341  // This is storing info, not writing out/reading in
342  // The app gets pixel ratio from windows/X (not setting
343  // itself)
345 
346  //Default Clear color is 0,0,0,0
351 
356 
363 
367  double myFrustumTop;
369  double myNearZ;
370  double myFarZ;
371 
372  double myMinZNear;
373 
374  bool myDynamicNearFar; //Version 3-5
375  // Not used
376  double myNearFarRatio; //Version 3-5
377 
378  double myCameraMagnification; // Version 4
379 
380  // Instead of per channel, this is now per observer.
381  // You should use the Observer Control dialog LOD Distance Scale instead of
382  // the channel config
383  // The observer LOD scale value is saved in a Saved View (via
384  // DtObserverStateRecord in .osrx files)
385  float myLodScale; // Version 8 DEPRECATED
386 
388  std::string myObserverName;
389  std::string mySensorName;
391 
399 
400  int myRenderOrder; // Version 7
401 
402  bool myHorizontalFlip; // Version 9
403 
404  };
405 }
406 
DynamicNearClipAttachedObjectPolicy
Definition: DtChannelConfiguration.h:64
Ignore attached objects when setting near clipping plane.
Definition: DtChannelConfiguration.h:68
BOOST_CLASS_VERSION(makArchives::DtDiGuySettingsRecord, 3)
#define DT_SERIALIZE_BASE(BASE_CLASS)
Serialize the base class implementation.
Definition: DtSerialize.h:161
#define DT_DLL_VRVUTIL
Definition: vrvUtil.h:34
void _serialize(Archive &ar, const unsigned int version)
Declare serialize functions Call via serialize(Archive ar, unsigned int version); Where Archive can b...
Definition: DtChannelConfiguration.h:259
The DtKeyword mixin is a mixin class (add funcionality by inheritence) for adding generic keywords to...
Definition: DtKeywordMixin.h:23
std::string myParentWindowName
Definition: DtChannelConfiguration.h:338
double myAltitudeForUseAttachedNearClip
Definition: DtChannelConfiguration.h:395
double myMinZNear
Definition: DtChannelConfiguration.h:372
double myCameraOrientationOffsetTheta
Definition: DtChannelConfiguration.h:361
double myFrustumTop
Definition: DtChannelConfiguration.h:367
double myNearFarRatio
Definition: DtChannelConfiguration.h:376
double myFrustumRight
Definition: DtChannelConfiguration.h:366
Definition: DtChannelConfiguration.h:41
double myCameraOrientationOffsetPsi
Definition: DtChannelConfiguration.h:360
double myNearClipWhenAttached
Definition: DtChannelConfiguration.h:396
DynamicNearClipAttachedObjectPolicy myDynamicNearClipAttachedObjectPolicy
Definition: DtChannelConfiguration.h:394
double myCameraOrientationOffsetPhi
Definition: DtChannelConfiguration.h:362
ProjectionResizePolicy myProjectionResizePolicy
Definition: DtChannelConfiguration.h:390
double myFrustumBottom
Definition: DtChannelConfiguration.h:368
Adjust the HORIZOTNAL field of view on window resizes.
Definition: DtChannelConfiguration.h:50
std::string myParentChannelName
Definition: DtChannelConfiguration.h:339
double myFrustumLeft
Projection stuff.
Definition: DtChannelConfiguration.h:365
double myViewportLeft
Definition: DtChannelConfiguration.h:352
Contains DLL export macros.
static const char * DefaultChannelString
Definition: DtChannelConfiguration.h:33
NearFarClipPolicy
Definition: DtChannelConfiguration.h:54
float myPixelRatio
Definition: DtChannelConfiguration.h:344
double myCameraPositionOffsetY
Definition: DtChannelConfiguration.h:358
std::string myParentDisplayEngineName
Definition: DtChannelConfiguration.h:337
Definition: DtChannelConfiguration.h:42
Definition: DtFxParticleSystem.h:98
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points. Coordinates are in local database coordinates The coordinat...
NearFarClipPolicy myNearFarClipPolicy
Definition: DtChannelConfiguration.h:392
int myRenderOrder
Definition: DtChannelConfiguration.h:400
double myCameraMagnification
Definition: DtChannelConfiguration.h:378
double myViewportBottom
Definition: DtChannelConfiguration.h:354
#define DT_DECLARE_ALL_serialize_FUNCTIONS
Definition: DtSerialize.h:134
double myDynamicWaterVisibilityMax
Definition: DtChannelConfiguration.h:398
std::string myObserverName
Definition: DtChannelConfiguration.h:388
double myCameraPositionOffsetZ
Definition: DtChannelConfiguration.h:359
double myZFightReductionRatio
Definition: DtChannelConfiguration.h:393
bool myHorizontalFlip
Definition: DtChannelConfiguration.h:402
Contains makVrv::DtConfiguration class.
double myNearZ
Definition: DtChannelConfiguration.h:369
Keep the projection matrix fixed, despite window resizes.
Definition: DtChannelConfiguration.h:49
ProjectionUnits myProjectionUnits
Definition: DtChannelConfiguration.h:387
double myCameraPositionOffsetX
Definition: DtChannelConfiguration.h:357
ProjectionUnits
Definition: DtChannelConfiguration.h:39
double myViewportRight
Definition: DtChannelConfiguration.h:353
float myClearColorB
Definition: DtChannelConfiguration.h:349
double myFarZ
Definition: DtChannelConfiguration.h:370
Configuration for a single channel Serialized and sent to remote displays as necessary to configure r...
Definition: DtChannelConfiguration.h:26
static const char * UseObserverSensorString
Special sensor name that indicates this channel should use the sensor specified by its observer...
Definition: DtChannelConfiguration.h:37
DT_DLL_vrfutil double mag(double x[3])
float myClearColorR
Definition: DtChannelConfiguration.h:347
float myClearColorA
Definition: DtChannelConfiguration.h:350
Mixin that provides set of keywords functionality.
The base implementation of a configuration.
Definition: DtConfiguration.h:24
std::string mySensorName
Definition: DtChannelConfiguration.h:389
double myViewportTop
Definition: DtChannelConfiguration.h:355
#define DT_SERIALIZE_MEMBER(NAME)
Serialize a Member whose name starts with &#39;my&#39; If your member does not have that name, use Dt_SERIALIZE.
Definition: DtSerialize.h:158
bool myDynamicNearFar
Definition: DtChannelConfiguration.h:374
Definition: DtChannelConfiguration.h:56
ProjectionResizePolicy
Definition: DtChannelConfiguration.h:46
float myLodScale
Definition: DtChannelConfiguration.h:385
bool myDynamicWaterVisibilityEnable
Definition: DtChannelConfiguration.h:397
float myClearColorG
Definition: DtChannelConfiguration.h:348

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)