OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
WoWVxDisplay.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2  *
3  * This library is open source and may be redistributed and/or modified under
4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5  * (at your option) any later version. The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * OpenSceneGraph Public License for more details.
12 */
13 
14 #ifndef OSGVIEWER_WoWVxDisplay
15 #define OSGVIEWER_WoWVxDisplay 1
16 
17 #include <osgViewer/View>
18 
19 namespace osgViewer {
20 
23 {
24  public:
25 
26  // default to 20" display, type can be 20 to 42.
27  WoWVxDisplay(unsigned int type=20, unsigned int screenNum=0):
28  _screenNum(screenNum),
29  _wow_content(0x02),
30  _wow_factor(0x40),
31  _wow_offset(0x80),
32  _wow_disparity_Zd(0.459813f),
33  _wow_disparity_vz(6.180772f),
34  _wow_disparity_M(-1586.34f),
35  _wow_disparity_C(127.5f) { if (type==42) WoWVx42(); }
36 
37  WoWVxDisplay(unsigned int screenNum, unsigned char wow_content, unsigned char wow_factor, unsigned char wow_offset, float wow_disparity_Zd, float wow_disparity_vz, float wow_disparity_M, float wow_disparity_C):
38  _screenNum(screenNum),
39  _wow_content(wow_content),
40  _wow_factor(wow_factor),
41  _wow_offset(wow_offset),
42  _wow_disparity_Zd(wow_disparity_Zd),
43  _wow_disparity_vz(wow_disparity_vz),
44  _wow_disparity_M(wow_disparity_M),
45  _wow_disparity_C(wow_disparity_C) {}
46 
48  ViewConfig(rhs, copyop),
49  _screenNum(rhs._screenNum),
50  _wow_content(rhs._wow_content),
51  _wow_factor(rhs._wow_factor),
52  _wow_offset(rhs._wow_offset),
53  _wow_disparity_Zd(rhs._wow_disparity_Zd),
54  _wow_disparity_vz(rhs._wow_disparity_vz),
55  _wow_disparity_M(rhs._wow_disparity_M),
56  _wow_disparity_C(rhs._wow_disparity_C) {}
57 
59 
60  virtual void configure(osgViewer::View& view) const;
61 
62  void setScreenNum(unsigned int n) { _screenNum = n; }
63  unsigned int getScreenNum() const { return _screenNum; }
64 
65  void WoWVx20()
66  {
67  _wow_disparity_Zd = 0.459813f;
68  _wow_disparity_vz = 6.180772f;
69  _wow_disparity_M = -1586.34f;
70  _wow_disparity_C = 127.5f;
71  }
72 
73  void WoWVx42()
74  {
75  _wow_disparity_Zd = 0.467481f;
76  _wow_disparity_vz = 7.655192f;
77  _wow_disparity_M = -1960.37f;
78  _wow_disparity_C = 127.5f;
79  }
80 
81  void setContent(unsigned char c) { _wow_content = c; }
82  double getContent() const { return _wow_content; }
83 
84  void setFactor(unsigned char c) { _wow_factor = c; }
85  double getFactor() const { return _wow_factor; }
86 
87  void setOffset(unsigned char c) { _wow_offset = c; }
88  double getOffset() const { return _wow_offset; }
89 
90  void setDisparityZD(float c) { _wow_disparity_Zd = c; }
91  float getDisparityZD() const { return _wow_disparity_Zd; }
92 
93  void setDisparityVZ(float c) { _wow_disparity_vz = c; }
94  float getDisparityVZ() const { return _wow_disparity_vz; }
95 
96  void setDisparityM(float c) { _wow_disparity_M = c; }
97  float getDisparityM() const { return _wow_disparity_M; }
98 
99  void setDisparityC(float c) { _wow_disparity_C = c; }
100  float getDisparityC() const { return _wow_disparity_C; }
101 
102  protected:
103 
104  unsigned int _screenNum;
105  unsigned char _wow_content;
106  unsigned char _wow_factor;
107  unsigned char _wow_offset;
112 };
113 
114 #if 0
115 
116 class OSGVIEWER_EXPORT DepthPartition : public Config
117 {
118  public:
119 
120  DepthPartition(DepthPartitionSettings* dsp=0);
121 
122  DepthPartition(const ViewForWoWVxDisplay& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
123 
124  META_Object(osgViewer,DepthPartition);
125 
126  void setDepthPartionSettings(DepthPartitionSettings* dsp) const { _dps = dps; }
127  const DepthPartitionSettings* getDepthPartionSettings() const { return _dps; }
128 
130  bool setUpDepthPartitionForCamera(osg::Camera* cameraToPartition, DepthPartitionSettings* dps=0);
131 
132  virtual void configure(osgViewer::View& view) const;
133 
134  protected:
135 };
136 
137 #endif
138 
139 }
140 
141 
142 #endif
unsigned char _wow_content
Definition: WoWVxDisplay.h:105
void setDisparityM(float c)
Definition: WoWVxDisplay.h:96
void setDisparityC(float c)
Definition: WoWVxDisplay.h:99
WoWVxDisplay(unsigned int type=20, unsigned int screenNum=0)
Definition: WoWVxDisplay.h:27
#define OSGVIEWER_EXPORT
Definition: Export.h:40
void setDisparityZD(float c)
Definition: WoWVxDisplay.h:90
unsigned int getScreenNum() const
Definition: WoWVxDisplay.h:63
unsigned char _wow_offset
Definition: WoWVxDisplay.h:107
double getContent() const
Definition: WoWVxDisplay.h:82
void setOffset(unsigned char c)
Definition: WoWVxDisplay.h:87
float getDisparityVZ() const
Definition: WoWVxDisplay.h:94
#define META_Object(library, name)
Definition: Object.h:42
void setDisparityVZ(float c)
Definition: WoWVxDisplay.h:93
unsigned char _wow_factor
Definition: WoWVxDisplay.h:106
float getDisparityM() const
Definition: WoWVxDisplay.h:97
double getFactor() const
Definition: WoWVxDisplay.h:85
WoWVxDisplay(unsigned int screenNum, unsigned char wow_content, unsigned char wow_factor, unsigned char wow_offset, float wow_disparity_Zd, float wow_disparity_vz, float wow_disparity_M, float wow_disparity_C)
Definition: WoWVxDisplay.h:37
float getDisparityZD() const
Definition: WoWVxDisplay.h:91
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum type
Definition: GLU.h:71
double getOffset() const
Definition: WoWVxDisplay.h:88
void setScreenNum(unsigned int n)
Definition: WoWVxDisplay.h:62
void setFactor(unsigned char c)
Definition: WoWVxDisplay.h:84
float getDisparityC() const
Definition: WoWVxDisplay.h:100
void setContent(unsigned char c)
Definition: WoWVxDisplay.h:81
WoWVxDisplay(const WoWVxDisplay &rhs, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
Definition: WoWVxDisplay.h:47