VR-Forces 4.1.1 Class Documentation
DtChannelConfiguration.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2012 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,
51  NONE
52  };
53 
56  DtChannelConfiguration(const std::string& name = DefaultChannelString);
57 
60 
63 
65  virtual ~DtChannelConfiguration();
66 
68  virtual void setParentChannel(const std::string& displayName,
69  const std::string& windowName, const std::string& channelName);
70 
72  virtual void getParentChannel(std::string& displayEngineNameOut,
73  std::string& windowNameOut, std::string& channelNameOut) const;
74 
76  virtual void setProjection(ProjectionUnits units, double left, double right, double bottom, double top,
77  double zNear, double zFar);
78 
80  virtual void getProjection(ProjectionUnits& units, double &left, double &right, double &bottom, double &top,
81  double &zNear, double &zFar) const;
82 
84  bool dynamicNearFar() const;
85 
87  void setDynamicNearFar(bool enabled);
88 
90  double nearFarRatio() const;
91 
93  void setNearFarRatio(double ratio);
94 
96  virtual ProjectionUnits projectionUnits() const;
97 
99  virtual void setProjectionUnits(ProjectionUnits units);
100 
103  virtual void getClearColor(float& r,float& g,float& b,float& a) const;
104 
107  virtual void setClearColor(float r,float g,float b,float a);
108 
110  virtual void setCameraPositionOffset(double x, double y, double z);
111 
113  virtual void getCameraPositionOffset(double& x, double& y, double& z) const;
114 
116  virtual void setCameraOrientationOffset(double psi, double theta, double phi);
117 
119  virtual void getCameraOrientationOffset(double& psi, double& theta, double& phi) const;
120 
122  virtual void getViewport(double& left,double& right,double& bottom,double& top) const;
123 
125  virtual void setViewport(double left,double right,double bottom, double top);
126 
128  virtual const std::string& observerName() const;
129 
131  virtual void setObserverName(const std::string& observerName);
132 
134  virtual const std::string& sensorName() const;
135 
137  virtual void setSensorName(const std::string& sensorName);
138 
140  virtual ProjectionResizePolicy projectionResizePolicy() const;
141 
143  virtual void setProjectionResizePolicy(ProjectionResizePolicy policy);
144 
146  virtual double cameraMagnification() const;
147 
149  virtual void setCameraMagnification(double mag);
150 
157  protected:
158 
159  template<class Archive>
160  void _serialize(Archive & ar, const unsigned int version)
161  {
164 
165  ar & DT_SERIALIZE_MEMBER(myClearColorR);
166  ar & DT_SERIALIZE_MEMBER(myClearColorG);
167  ar & DT_SERIALIZE_MEMBER(myClearColorB);
168  ar & DT_SERIALIZE_MEMBER(myClearColorA);
169  ar & DT_SERIALIZE_MEMBER(myViewportLeft);
170  ar & DT_SERIALIZE_MEMBER(myViewportRight);
171  ar & DT_SERIALIZE_MEMBER(myViewportBottom);
172  ar & DT_SERIALIZE_MEMBER(myViewportTop);
173  ar & DT_SERIALIZE_MEMBER(myParentDisplayEngineName);
174  ar & DT_SERIALIZE_MEMBER(myParentWindowName);
175  ar & DT_SERIALIZE_MEMBER(myParentChannelName);
176  ar & DT_SERIALIZE_MEMBER(myCameraPositionOffsetX);
177  ar & DT_SERIALIZE_MEMBER(myCameraPositionOffsetY);
178  ar & DT_SERIALIZE_MEMBER(myCameraPositionOffsetZ);
179  ar & DT_SERIALIZE_MEMBER(myCameraOrientationOffsetPsi);
180  ar & DT_SERIALIZE_MEMBER(myCameraOrientationOffsetTheta);
181  ar & DT_SERIALIZE_MEMBER(myCameraOrientationOffsetPhi);
182  ar & DT_SERIALIZE_MEMBER(myFrustumLeft);
183  ar & DT_SERIALIZE_MEMBER(myFrustumRight);
184  ar & DT_SERIALIZE_MEMBER(myFrustumTop);
185  ar & DT_SERIALIZE_MEMBER(myFrustumBottom);
186  ar & DT_SERIALIZE_MEMBER(myNearZ);
187  ar & DT_SERIALIZE_MEMBER(myFarZ);
188  ar & DT_SERIALIZE_MEMBER(myProjectionUnits);
189  ar & DT_SERIALIZE_MEMBER(myObserverName);
190  ar & DT_SERIALIZE_MEMBER(myProjectionResizePolicy);
191 
192  if(version > 1)
193  {
194  ar & DT_SERIALIZE_MEMBER(myKeywords);
195  }
196 
197  if (version > 2)
198  {
199  ar & DT_SERIALIZE_MEMBER(myDynamicNearFar);
200  ar & DT_SERIALIZE_MEMBER(myNearFarRatio);
201  }
202 
203  if (version > 3)
204  {
205  ar & DT_SERIALIZE_MEMBER(myCameraMagnification);
206  }
207 
208  if (version > 4)
209  {
210  ar & DT_SERIALIZE_MEMBER(mySensorName);
211  }
212  }
213 
215  std::string myParentWindowName;
216  std::string myParentChannelName;
217 
218  //Default Clear color is 0,0,0,0
222  float myClearColorA;;
223 
224  double myViewportLeft;
228 
235 
239  double myFrustumTop;
241  double myNearZ;
242  double myFarZ;
243 
244  bool myDynamicNearFar; //Version 3
245  double myNearFarRatio; //Version 3
246 
247  double myCameraMagnification; // Version 4
248 
250  std::string myObserverName;
251  std::string mySensorName;
253  };
254 }
255 

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)