VR-Forces 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) 2024 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 {
25  : public DtConfiguration
26  , public DtKeywordMixin
27  {
28 
29  public:
30 
31  static const char* DefaultChannelString;
32 
35  static const char* UseObserverSensorString;
36 
38  {
41  DatabaseUnits
42  };
43 
45  {
46  FIXED = 0,
50  };
51 
53  {
57  NEAR_FAR_DYNAMIC_NEAR_CLIP_MAG_CLAMP // same as reduce z fight but with near clamped
58  // by an intersector so it can't go past terrain
59  // in front of the camera
60  };
61 
63  {
64  IGNORE_ATTACHED = 0,
68  DISTANCE_TO_ATTACHED
70  };
71 
74  DtChannelConfiguration(const std::string& name = DefaultChannelString);
75 
78 
81 
83  virtual ~DtChannelConfiguration();
84 
86  virtual void setParentChannel(const std::string& displayName,
87  const std::string& windowName, const std::string& channelName);
88 
90  virtual void getParentChannel(std::string& displayEngineNameOut,
91  std::string& windowNameOut, std::string& channelNameOut) const;
92 
94  virtual void setProjection(ProjectionUnits units, double left, double right, double bottom, double top,
95  double zNear, double zFar);
96 
98  virtual void getProjection(ProjectionUnits& units, double &left, double &right, double &bottom, double &top,
99  double &zNear, double &zFar) const;
100 
102  virtual ProjectionUnits projectionUnits() const;
103 
105  virtual void setProjectionUnits(ProjectionUnits units);
106 
109  virtual void getClearColor(float& r,float& g,float& b,float& a) const;
110 
113  virtual void setClearColor(float r,float g,float b,float a);
114 
116  virtual void setCameraPositionOffset(double x, double y, double z);
117 
119  virtual void getCameraPositionOffset(double& x, double& y, double& z) const;
120 
122  virtual void setCameraOrientationOffset(double psi, double theta, double phi);
123 
125  virtual void getCameraOrientationOffset(double& psi, double& theta, double& phi) const;
126 
128  virtual void getViewport(double& left,double& right,double& bottom,double& top) const;
129 
131  virtual void setViewport(double left,double right,double bottom, double top);
132 
134  virtual const std::string& observerName() const;
135 
137  virtual void setObserverName(const std::string& observerName);
138 
140  virtual const std::string& sensorName() const;
141 
143  virtual void setSensorName(const std::string& sensorName);
144 
146  virtual ProjectionResizePolicy projectionResizePolicy() const;
147 
149  virtual void setProjectionResizePolicy(ProjectionResizePolicy policy);
150 
152  virtual double cameraMagnification() const;
153 
155  virtual void setCameraMagnification(double mag);
156 
161  virtual void setNearFarClipPolicy( NearFarClipPolicy policy );
162 
164  virtual NearFarClipPolicy nearFarClipPolicy() const;
165 
168  virtual void setZFightReductionRatio( double ratio );
169 
172  virtual double zFightReductionRatio() const;
173 
176  virtual void setDynamicNearClipAttachedObjectPolicy(
177  DynamicNearClipAttachedObjectPolicy useAttached );
178 
181  virtual DynamicNearClipAttachedObjectPolicy
182  dynamicNearClipAttachedObjectPolicy() const;
183 
186  virtual void setAltitudeForUseAttachedNearClip( double altitude );
187 
190  virtual double altitudeForUseAttachedNearClip() const;
191 
195  virtual void setNearClipWhenAttached( double distance );
196 
200  virtual double nearClipWhenAttached() const;
201 
205  virtual void setDynamicWaterVisibilityEnable( bool enable );
206 
208  virtual bool dynamicWaterVisibilityEnable() const;
209 
212  virtual void setDynamicWaterVisibilityMax( double visMax );
213 
216  virtual double dynamicWaterVisibilityMax() const;
217 
220  virtual void setRenderOrder( int order );
221 
223  virtual int renderOrder() const;
224 
228  virtual double minZNear(double value) const;
229 
233  virtual void setMinZNear(double value);
234 
236  virtual float pixelRatio() const;
237 
240  virtual void setPixelRatio(float ratio);
241 
243  virtual void setHorizontalFlip(bool flipped);
244 
246  virtual bool horizontalFlip() const;
247 
254  protected:
255 
256  template<class Archive>
257  void _serialize(Archive & ar, const unsigned int version)
258  {
261 
262  ar & DT_SERIALIZE_MEMBER(myClearColorR);
263  ar & DT_SERIALIZE_MEMBER(myClearColorG);
264  ar & DT_SERIALIZE_MEMBER(myClearColorB);
265  ar & DT_SERIALIZE_MEMBER(myClearColorA);
266  ar & DT_SERIALIZE_MEMBER(myViewportLeft);
267  ar & DT_SERIALIZE_MEMBER(myViewportRight);
268  ar & DT_SERIALIZE_MEMBER(myViewportBottom);
269  ar & DT_SERIALIZE_MEMBER(myViewportTop);
270  ar & DT_SERIALIZE_MEMBER(myParentDisplayEngineName);
271  ar & DT_SERIALIZE_MEMBER(myParentWindowName);
272  ar & DT_SERIALIZE_MEMBER(myParentChannelName);
273  ar & DT_SERIALIZE_MEMBER(myCameraPositionOffsetX);
274  ar & DT_SERIALIZE_MEMBER(myCameraPositionOffsetY);
275  ar & DT_SERIALIZE_MEMBER(myCameraPositionOffsetZ);
276  ar & DT_SERIALIZE_MEMBER(myCameraOrientationOffsetPsi);
277  ar & DT_SERIALIZE_MEMBER(myCameraOrientationOffsetTheta);
278  ar & DT_SERIALIZE_MEMBER(myCameraOrientationOffsetPhi);
279  ar & DT_SERIALIZE_MEMBER(myFrustumLeft);
280  ar & DT_SERIALIZE_MEMBER(myFrustumRight);
281  ar & DT_SERIALIZE_MEMBER(myFrustumTop);
282  ar & DT_SERIALIZE_MEMBER(myFrustumBottom);
283  ar & DT_SERIALIZE_MEMBER(myNearZ);
284  ar & DT_SERIALIZE_MEMBER(myFarZ);
285  ar & DT_SERIALIZE_MEMBER(myProjectionUnits);
286  ar & DT_SERIALIZE_MEMBER(myObserverName);
287  ar & DT_SERIALIZE_MEMBER(myProjectionResizePolicy);
288 
289  if (version > 1)
290  {
291  ar & DT_SERIALIZE_MEMBER(myKeywords);
292  }
293 
294  if (version > 2 && version < 6)
295  {
296  ar & DT_SERIALIZE_MEMBER(myDynamicNearFar);
297  ar & DT_SERIALIZE_MEMBER(myNearFarRatio);
298  }
299 
300  if (version > 3)
301  {
302  ar & DT_SERIALIZE_MEMBER(myCameraMagnification);
303  }
304 
305  if (version > 4)
306  {
307  ar & DT_SERIALIZE_MEMBER(mySensorName);
308  }
309 
310  if (version > 5)
311  {
312  ar & DT_SERIALIZE_MEMBER(myNearFarClipPolicy);
313  ar & DT_SERIALIZE_MEMBER(myZFightReductionRatio);
314  ar & DT_SERIALIZE_MEMBER(myDynamicNearClipAttachedObjectPolicy);
315  ar & DT_SERIALIZE_MEMBER(myAltitudeForUseAttachedNearClip);
316  ar & DT_SERIALIZE_MEMBER(myNearClipWhenAttached);
317  ar & DT_SERIALIZE_MEMBER(myDynamicWaterVisibilityEnable);
318  ar & DT_SERIALIZE_MEMBER(myDynamicWaterVisibilityMax);
319  }
320 
321  if (version > 6)
322  {
323  ar & DT_SERIALIZE_MEMBER(myRenderOrder);
324  }
325  if (version > 7)
326  {
327  ar & DT_SERIALIZE_MEMBER(myLodScale);
328  }
329  if (version > 8)
330  {
331  ar & DT_SERIALIZE_MEMBER(myHorizontalFlip);
332  }
333  }
334 
336  std::string myParentWindowName;
337  std::string myParentChannelName;
338 
339  // This is storing info, not writing out/reading in
340  // The app gets pixel ratio from windows/X (not setting
341  // itself)
343 
344  //Default Clear color is 0,0,0,0
349 
354 
361 
365  double myFrustumTop;
367  double myNearZ;
368  double myFarZ;
369 
370  double myMinZNear;
371 
372  bool myDynamicNearFar; //Version 3-5
373  // Not used
374  double myNearFarRatio; //Version 3-5
375 
376  double myCameraMagnification; // Version 4
377 
378  // Instead of per channel, this is now per observer.
379  // You should use the Observer Control dialog LOD Distance Scale instead of
380  // the channel config
381  // The observer LOD scale value is saved in a Saved View (via
382  // DtObserverStateRecord in .osrx files)
383  float myLodScale; // Version 8 DEPRECATED
384 
386  std::string myObserverName;
387  std::string mySensorName;
389 
397 
398  int myRenderOrder; // Version 7
399 
400  bool myHorizontalFlip; // Version 9
401 
402  };
403 }
404 
DynamicNearClipAttachedObjectPolicy
Definition: DtChannelConfiguration.h:62
Ignore attached objects when setting near clipping plane.
Definition: DtChannelConfiguration.h:66
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:257
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:336
double myAltitudeForUseAttachedNearClip
Definition: DtChannelConfiguration.h:393
double myMinZNear
Definition: DtChannelConfiguration.h:370
double myCameraOrientationOffsetTheta
Definition: DtChannelConfiguration.h:359
double myFrustumTop
Definition: DtChannelConfiguration.h:365
double myNearFarRatio
Definition: DtChannelConfiguration.h:374
double myFrustumRight
Definition: DtChannelConfiguration.h:364
Definition: DtChannelConfiguration.h:39
double myCameraOrientationOffsetPsi
Definition: DtChannelConfiguration.h:358
double myNearClipWhenAttached
Definition: DtChannelConfiguration.h:394
DynamicNearClipAttachedObjectPolicy myDynamicNearClipAttachedObjectPolicy
Definition: DtChannelConfiguration.h:392
double myCameraOrientationOffsetPhi
Definition: DtChannelConfiguration.h:360
ProjectionResizePolicy myProjectionResizePolicy
Definition: DtChannelConfiguration.h:388
double myFrustumBottom
Definition: DtChannelConfiguration.h:366
Adjust the HORIZOTNAL field of view on window resizes.
Definition: DtChannelConfiguration.h:48
std::string myParentChannelName
Definition: DtChannelConfiguration.h:337
double myFrustumLeft
Projection stuff.
Definition: DtChannelConfiguration.h:363
double myViewportLeft
Definition: DtChannelConfiguration.h:350
Contains DLL export macros.
static const char * DefaultChannelString
Definition: DtChannelConfiguration.h:31
NearFarClipPolicy
Definition: DtChannelConfiguration.h:52
float myPixelRatio
Definition: DtChannelConfiguration.h:342
double myCameraPositionOffsetY
Definition: DtChannelConfiguration.h:356
std::string myParentDisplayEngineName
Definition: DtChannelConfiguration.h:335
Definition: DtChannelConfiguration.h:40
Definition: DtTemplatedModelInstanceCreator.h:28
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:390
int myRenderOrder
Definition: DtChannelConfiguration.h:398
double myCameraMagnification
Definition: DtChannelConfiguration.h:376
double myViewportBottom
Definition: DtChannelConfiguration.h:352
#define DT_DECLARE_ALL_serialize_FUNCTIONS
Definition: DtSerialize.h:134
double myDynamicWaterVisibilityMax
Definition: DtChannelConfiguration.h:396
std::string myObserverName
Definition: DtChannelConfiguration.h:386
double myCameraPositionOffsetZ
Definition: DtChannelConfiguration.h:357
double myZFightReductionRatio
Definition: DtChannelConfiguration.h:391
bool myHorizontalFlip
Definition: DtChannelConfiguration.h:400
Contains makVrv::DtConfiguration class.
double myNearZ
Definition: DtChannelConfiguration.h:367
Keep the projection matrix fixed, despite window resizes.
Definition: DtChannelConfiguration.h:47
ProjectionUnits myProjectionUnits
Definition: DtChannelConfiguration.h:385
double myCameraPositionOffsetX
Definition: DtChannelConfiguration.h:355
ProjectionUnits
Definition: DtChannelConfiguration.h:37
double myViewportRight
Definition: DtChannelConfiguration.h:351
float myClearColorB
Definition: DtChannelConfiguration.h:347
double myFarZ
Definition: DtChannelConfiguration.h:368
Configuration for a single channel Serialized and sent to remote displays as necessary to configure r...
Definition: DtChannelConfiguration.h:24
static const char * UseObserverSensorString
Special sensor name that indicates this channel should use the sensor specified by its observer...
Definition: DtChannelConfiguration.h:35
DT_DLL_vrfutil double mag(double x[3])
float myClearColorR
Definition: DtChannelConfiguration.h:345
float myClearColorA
Definition: DtChannelConfiguration.h:348
Mixin that provides set of keywords functionality.
The base implementation of a configuration.
Definition: DtConfiguration.h:24
std::string mySensorName
Definition: DtChannelConfiguration.h:387
double myViewportTop
Definition: DtChannelConfiguration.h:353
#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:372
Definition: DtChannelConfiguration.h:54
ProjectionResizePolicy
Definition: DtChannelConfiguration.h:44
float myLodScale
Definition: DtChannelConfiguration.h:383
bool myDynamicWaterVisibilityEnable
Definition: DtChannelConfiguration.h:395
float myClearColorG
Definition: DtChannelConfiguration.h:346

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)