1 | #pragma once |
---|
2 | |
---|
3 | /* osgVisual test. distortionNG, experimental. |
---|
4 | * |
---|
5 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
---|
6 | * of this software and associated documentation files (the "Software"), to deal |
---|
7 | * in the Software without restriction, including without limitation the rights |
---|
8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
---|
9 | * copies of the Software, and to permit persons to whom the Software is |
---|
10 | * furnished to do so, subject to the following conditions: |
---|
11 | * |
---|
12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
---|
13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
---|
14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
---|
15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
---|
16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
---|
17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
---|
18 | * THE SOFTWARE. |
---|
19 | */ |
---|
20 | |
---|
21 | #include <osgViewer/Viewer> |
---|
22 | #include<osg/Referenced> |
---|
23 | #include "DistortionSet.h" |
---|
24 | |
---|
25 | #include <string> |
---|
26 | |
---|
27 | class extViewer : public osgViewer::Viewer |
---|
28 | { |
---|
29 | public: |
---|
30 | extViewer(); |
---|
31 | |
---|
32 | extViewer(osg::ArgumentParser& arguments); |
---|
33 | |
---|
34 | extViewer(const osgViewer::Viewer& viewer, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); |
---|
35 | |
---|
36 | virtual ~extViewer(); |
---|
37 | |
---|
38 | /** Convenience method for projection on curved screens using a slave camera rendering scene and a second camera doing distortion correction to present on a nonplaner display.*/ |
---|
39 | void setUpViewForManualDistortion(osgViewer::DistortionSet* distSet, unsigned int screenNum=0, const osg::Matrixd& projectorMatrix = osg::Matrixd()); |
---|
40 | //void setUpViewForManualDistortion(unsigned int rows, unsigned int colums, std::string intensityMap=""); |
---|
41 | |
---|
42 | |
---|
43 | void setUpIntensityMapBlending(osgViewer::DistortionSet* distSet, unsigned int screenNum=0); |
---|
44 | void setUpIntensityMapBlending(std::string intensityMap); |
---|
45 | |
---|
46 | osgViewer::DistortionSet* getDistortionSet() {return _distortionSet;} |
---|
47 | void setDistortionSet(osgViewer::DistortionSet* ds) {_distortionSet = ds;} |
---|
48 | |
---|
49 | private: |
---|
50 | osg::ref_ptr<osgViewer::DistortionSet> _distortionSet; |
---|
51 | }; |
---|