1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
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.
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.
14#ifndef OSGVIEWER_WoWVxDisplay
15#define OSGVIEWER_WoWVxDisplay 1
17#include <osgViewer/View>
21/** autostereoscopic Philips WoWvx display.*/
22class OSGVIEWER_EXPORT WoWVxDisplay : public ViewConfig
26 // default to 20" display, type can be 20 to 42.
27 WoWVxDisplay(unsigned int type=20, unsigned int screenNum=0):
28 _screenNum(screenNum),
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(); }
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) {}
47 WoWVxDisplay(const WoWVxDisplay& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
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) {}
58 META_Object(osgViewer, WoWVxDisplay);
60 virtual void configure(osgViewer::View& view) const;
62 void setScreenNum(unsigned int n) { _screenNum = n; }
63 unsigned int getScreenNum() const { return _screenNum; }
67 _wow_disparity_Zd = 0.459813f;
68 _wow_disparity_vz = 6.180772f;
69 _wow_disparity_M = -1586.34f;
70 _wow_disparity_C = 127.5f;
75 _wow_disparity_Zd = 0.467481f;
76 _wow_disparity_vz = 7.655192f;
77 _wow_disparity_M = -1960.37f;
78 _wow_disparity_C = 127.5f;
81 void setContent(unsigned char c) { _wow_content = c; }
82 double getContent() const { return _wow_content; }
84 void setFactor(unsigned char c) { _wow_factor = c; }
85 double getFactor() const { return _wow_factor; }
87 void setOffset(unsigned char c) { _wow_offset = c; }
88 double getOffset() const { return _wow_offset; }
90 void setDisparityZD(float c) { _wow_disparity_Zd = c; }
91 float getDisparityZD() const { return _wow_disparity_Zd; }
93 void setDisparityVZ(float c) { _wow_disparity_vz = c; }
94 float getDisparityVZ() const { return _wow_disparity_vz; }
96 void setDisparityM(float c) { _wow_disparity_M = c; }
97 float getDisparityM() const { return _wow_disparity_M; }
99 void setDisparityC(float c) { _wow_disparity_C = c; }
100 float getDisparityC() const { return _wow_disparity_C; }
104 unsigned int _screenNum;
105 unsigned char _wow_content;
106 unsigned char _wow_factor;
107 unsigned char _wow_offset;
108 float _wow_disparity_Zd;
109 float _wow_disparity_vz;
110 float _wow_disparity_M;
111 float _wow_disparity_C;
115/** Configure view with DepthPartition.*/
116class OSGVIEWER_EXPORT DepthPartition : public Config
120 DepthPartition(DepthPartitionSettings* dsp=0);
122 DepthPartition(const ViewForWoWVxDisplay& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
124 META_Object(osgViewer,DepthPartition);
126 void setDepthPartionSettings(DepthPartitionSettings* dsp) const { _dps = dps; }
127 const DepthPartitionSettings* getDepthPartionSettings() const { return _dps; }
129 /** for setting up depth partitioning on the specified camera.*/
130 bool setUpDepthPartitionForCamera(osg::Camera* cameraToPartition, DepthPartitionSettings* dps=0);
132 virtual void configure(osgViewer::View& view) const;