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) 2025 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 
249  virtual void setChannelOpacity(float opacity);
250 
252  virtual float channelOpacity() const;
253 
257  virtual void setChannelOpacityMaskPath(std::string maskTexturePath);
258 
260  virtual std::string channelOpacityMaskPath() const;
261 
264  virtual void setImageOverlayPath(std::string overlayPath);
265 
267  virtual std::string imageOverlayPath() const;
268 
271  virtual bool enableBlendMaskEffect() const;
272 
275  virtual bool enableAlphaBlending() const;
276 
278  virtual void setHitPlaneWidth(float width);
279 
281  virtual float hitPlaneWidth() const;
282 
284  virtual void setHitPlaneDistance(float distance);
285 
287  virtual float hitPlaneDistance() const;
288 
295  protected:
296 
297  template<class Archive>
298  void _serialize(Archive & ar, const unsigned int version)
299  {
302 
303  ar & DT_SERIALIZE_MEMBER(myClearColorR);
304  ar & DT_SERIALIZE_MEMBER(myClearColorG);
305  ar & DT_SERIALIZE_MEMBER(myClearColorB);
306  ar & DT_SERIALIZE_MEMBER(myClearColorA);
307  ar & DT_SERIALIZE_MEMBER(myViewportLeft);
308  ar & DT_SERIALIZE_MEMBER(myViewportRight);
309  ar & DT_SERIALIZE_MEMBER(myViewportBottom);
310  ar & DT_SERIALIZE_MEMBER(myViewportTop);
311  ar & DT_SERIALIZE_MEMBER(myParentDisplayEngineName);
312  ar & DT_SERIALIZE_MEMBER(myParentWindowName);
313  ar & DT_SERIALIZE_MEMBER(myParentChannelName);
314  ar & DT_SERIALIZE_MEMBER(myCameraPositionOffsetX);
315  ar & DT_SERIALIZE_MEMBER(myCameraPositionOffsetY);
316  ar & DT_SERIALIZE_MEMBER(myCameraPositionOffsetZ);
317  ar & DT_SERIALIZE_MEMBER(myCameraOrientationOffsetPsi);
318  ar & DT_SERIALIZE_MEMBER(myCameraOrientationOffsetTheta);
319  ar & DT_SERIALIZE_MEMBER(myCameraOrientationOffsetPhi);
320  ar & DT_SERIALIZE_MEMBER(myFrustumLeft);
321  ar & DT_SERIALIZE_MEMBER(myFrustumRight);
322  ar & DT_SERIALIZE_MEMBER(myFrustumTop);
323  ar & DT_SERIALIZE_MEMBER(myFrustumBottom);
324  ar & DT_SERIALIZE_MEMBER(myNearZ);
325  ar & DT_SERIALIZE_MEMBER(myFarZ);
326  ar & DT_SERIALIZE_MEMBER(myProjectionUnits);
327  ar & DT_SERIALIZE_MEMBER(myObserverName);
328  ar & DT_SERIALIZE_MEMBER(myProjectionResizePolicy);
329 
330  if (version > 1)
331  {
332  ar & DT_SERIALIZE_MEMBER(myKeywords);
333  }
334 
335  if (version > 2 && version < 6)
336  {
337  ar & DT_SERIALIZE_MEMBER(myDynamicNearFar);
338  ar & DT_SERIALIZE_MEMBER(myNearFarRatio);
339  }
340 
341  if (version > 3)
342  {
343  ar & DT_SERIALIZE_MEMBER(myCameraMagnification);
344  }
345 
346  if (version > 4)
347  {
348  ar & DT_SERIALIZE_MEMBER(mySensorName);
349  }
350 
351  if (version > 5)
352  {
353  ar & DT_SERIALIZE_MEMBER(myNearFarClipPolicy);
354  ar & DT_SERIALIZE_MEMBER(myZFightReductionRatio);
355  ar & DT_SERIALIZE_MEMBER(myDynamicNearClipAttachedObjectPolicy);
356  ar & DT_SERIALIZE_MEMBER(myAltitudeForUseAttachedNearClip);
357  ar & DT_SERIALIZE_MEMBER(myNearClipWhenAttached);
358  ar & DT_SERIALIZE_MEMBER(myDynamicWaterVisibilityEnable);
359  ar & DT_SERIALIZE_MEMBER(myDynamicWaterVisibilityMax);
360  }
361 
362  if (version > 6)
363  {
364  ar & DT_SERIALIZE_MEMBER(myRenderOrder);
365  }
366  if (version > 7)
367  {
368  ar & DT_SERIALIZE_MEMBER(myLodScale);
369  }
370  if (version > 8)
371  {
372  ar & DT_SERIALIZE_MEMBER(myHorizontalFlip);
373  }
374  if (version > 9)
375  {
376  ar & DT_SERIALIZE_MEMBER(myChannelOpacity);
377  ar & DT_SERIALIZE_MEMBER(myChannelOpacityMaskPath);
378  ar & DT_SERIALIZE_MEMBER(myImageOverlayPath);
379  ar & DT_SERIALIZE_MEMBER(myHitPlaneWidth);
380  ar & DT_SERIALIZE_MEMBER(myHitPlaneDistance);
381  }
382  }
383 
385  std::string myParentWindowName;
386  std::string myParentChannelName;
387 
388  // This is storing info, not writing out/reading in
389  // The app gets pixel ratio from windows/X (not setting
390  // itself)
392 
393  //Default Clear color is 0,0,0,0
398 
403 
410 
414  double myFrustumTop;
416  double myNearZ;
417  double myFarZ;
418 
419  double myMinZNear;
420 
421  bool myDynamicNearFar; //Version 3-5
422  // Not used
423  double myNearFarRatio; //Version 3-5
424 
425  double myCameraMagnification; // Version 4
426 
427  // Instead of per channel, this is now per observer.
428  // You should use the Observer Control dialog LOD Distance Scale instead of
429  // the channel config
430  // The observer LOD scale value is saved in a Saved View (via
431  // DtObserverStateRecord in .osrx files)
432  float myLodScale; // Version 8 DEPRECATED
433 
435  std::string myObserverName;
436  std::string mySensorName;
438 
446 
447  int myRenderOrder; // Version 7
448 
449  bool myHorizontalFlip; // Version 9
450 
451  float myHitPlaneWidth; // Version 10
453 
454  float myChannelOpacity; // Version 10
456  std::string myImageOverlayPath;
457 
458  };
459 }
460 
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:298
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:385
double myAltitudeForUseAttachedNearClip
Definition: DtChannelConfiguration.h:442
double myMinZNear
Definition: DtChannelConfiguration.h:419
double myCameraOrientationOffsetTheta
Definition: DtChannelConfiguration.h:408
double myFrustumTop
Definition: DtChannelConfiguration.h:414
double myNearFarRatio
Definition: DtChannelConfiguration.h:423
double myFrustumRight
Definition: DtChannelConfiguration.h:413
Definition: DtChannelConfiguration.h:39
double myCameraOrientationOffsetPsi
Definition: DtChannelConfiguration.h:407
double myNearClipWhenAttached
Definition: DtChannelConfiguration.h:443
DynamicNearClipAttachedObjectPolicy myDynamicNearClipAttachedObjectPolicy
Definition: DtChannelConfiguration.h:441
double myCameraOrientationOffsetPhi
Definition: DtChannelConfiguration.h:409
ProjectionResizePolicy myProjectionResizePolicy
Definition: DtChannelConfiguration.h:437
double myFrustumBottom
Definition: DtChannelConfiguration.h:415
Adjust the HORIZOTNAL field of view on window resizes.
Definition: DtChannelConfiguration.h:48
std::string myParentChannelName
Definition: DtChannelConfiguration.h:386
double myFrustumLeft
Projection stuff.
Definition: DtChannelConfiguration.h:412
double myViewportLeft
Definition: DtChannelConfiguration.h:399
Contains DLL export macros.
static const char * DefaultChannelString
Definition: DtChannelConfiguration.h:31
NearFarClipPolicy
Definition: DtChannelConfiguration.h:52
float myPixelRatio
Definition: DtChannelConfiguration.h:391
double myCameraPositionOffsetY
Definition: DtChannelConfiguration.h:405
std::string myChannelOpacityMaskPath
Definition: DtChannelConfiguration.h:455
std::string myParentDisplayEngineName
Definition: DtChannelConfiguration.h:384
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:439
int myRenderOrder
Definition: DtChannelConfiguration.h:447
double myCameraMagnification
Definition: DtChannelConfiguration.h:425
double myViewportBottom
Definition: DtChannelConfiguration.h:401
#define DT_DECLARE_ALL_serialize_FUNCTIONS
Definition: DtSerialize.h:134
double myDynamicWaterVisibilityMax
Definition: DtChannelConfiguration.h:445
std::string myImageOverlayPath
Definition: DtChannelConfiguration.h:456
std::string myObserverName
Definition: DtChannelConfiguration.h:435
double myCameraPositionOffsetZ
Definition: DtChannelConfiguration.h:406
double myZFightReductionRatio
Definition: DtChannelConfiguration.h:440
bool myHorizontalFlip
Definition: DtChannelConfiguration.h:449
Contains makVrv::DtConfiguration class.
double myNearZ
Definition: DtChannelConfiguration.h:416
Keep the projection matrix fixed, despite window resizes.
Definition: DtChannelConfiguration.h:47
ProjectionUnits myProjectionUnits
Definition: DtChannelConfiguration.h:434
double myCameraPositionOffsetX
Definition: DtChannelConfiguration.h:404
ProjectionUnits
Definition: DtChannelConfiguration.h:37
double myViewportRight
Definition: DtChannelConfiguration.h:400
float myClearColorB
Definition: DtChannelConfiguration.h:396
double myFarZ
Definition: DtChannelConfiguration.h:417
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:394
float myClearColorA
Definition: DtChannelConfiguration.h:397
Mixin that provides set of keywords functionality.
The base implementation of a configuration.
Definition: DtConfiguration.h:24
std::string mySensorName
Definition: DtChannelConfiguration.h:436
double myViewportTop
Definition: DtChannelConfiguration.h:402
#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:421
Definition: DtChannelConfiguration.h:54
ProjectionResizePolicy
Definition: DtChannelConfiguration.h:44
float myChannelOpacity
Definition: DtChannelConfiguration.h:454
float myHitPlaneDistance
Definition: DtChannelConfiguration.h:452
float myHitPlaneWidth
Definition: DtChannelConfiguration.h:451
float myLodScale
Definition: DtChannelConfiguration.h:432
bool myDynamicWaterVisibilityEnable
Definition: DtChannelConfiguration.h:444
float myClearColorG
Definition: DtChannelConfiguration.h:395

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)