OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PanoramicSphericalDisplay.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_PanoramicSphericalDisplay
15 #define OSGVIEWER_PanoramicSphericalDisplay 1
16 
17 #include <osgViewer/View>
18 
19 namespace osgViewer {
20 
23 {
24  public:
25 
26  PanoramicSphericalDisplay(double radius=1.0, double collar=0.45, unsigned int screenNum=0, osg::Image* intensityMap=0, const osg::Matrixd& projectorMatrix = osg::Matrixd()):
27  _radius(radius),
28  _collar(collar),
29  _screenNum(screenNum),
30  _intensityMap(intensityMap),
31  _projectorMatrix(projectorMatrix) {}
32 
34  ViewConfig(rhs, copyop),
35  _radius(rhs._radius),
36  _collar(rhs._collar),
37  _screenNum(rhs._screenNum),
38  _intensityMap(rhs._intensityMap),
39  _projectorMatrix(rhs._projectorMatrix) {}
40 
41 
43 
44  virtual void configure(osgViewer::View& view) const;
45 
46  void setRadius(double r) { _radius = r; }
47  double getRadius() const { return _radius; }
48 
49  void setCollar(double r) { _collar = r; }
50  double getCollar() const { return _collar; }
51 
52  void setScreenNum(unsigned int n) { _screenNum = n; }
53  unsigned int getScreenNum() const { return _screenNum; }
54 
55  void setIntensityMap(osg::Image* im) { _intensityMap = im; }
56  const osg::Image* getIntensityMap() const { return _intensityMap.get(); }
57 
58  void setProjectionMatrix(const osg::Matrixd& m) { _projectorMatrix = m; }
59  const osg::Matrixd& getProjectionMatrix() const { return _projectorMatrix; }
60 
61  protected:
62 
63  osg::Geometry* createParoramicSphericalDisplayDistortionMesh(const osg::Vec3& origin, const osg::Vec3& widthVector, const osg::Vec3& heightVector, double sphere_radius, double collar_radius, osg::Image* intensityMap, const osg::Matrix& projectorMatrix) const;
64 
65  double _radius;
66  double _collar;
67  unsigned int _screenNum;
70 };
71 
72 }
73 
74 
75 #endif
#define OSGVIEWER_EXPORT
Definition: Export.h:40
PanoramicSphericalDisplay(const PanoramicSphericalDisplay &rhs, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
#define META_Object(library, name)
Definition: Object.h:42
PanoramicSphericalDisplay(double radius=1.0, double collar=0.45, unsigned int screenNum=0, osg::Image *intensityMap=0, const osg::Matrixd &projectorMatrix=osg::Matrixd())
void setProjectionMatrix(const osg::Matrixd &m)
const osg::Matrixd & getProjectionMatrix() const