source: experimental/distortionNG/DistortionSet.h @ 347

Last change on this file since 347 was 345, checked in by Torben Dannhauer, 13 years ago
File size: 3.2 KB
Line 
1#ifndef OSGVIEWER_DistortionSet
2#define OSGVIEWER_DistortionSet 1
3
4/* -*-c++-*- osgVisual - Copyright (C) 2009-2012 Torben Dannhauer
5 *
6 * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under
7 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
8 * (at your option) any later version.  The full license is in LICENSE file
9 * included with this distribution, and on the openscenegraph.org website.
10 *
11 * osgVisual requires for some proprietary modules a license from the correspondig manufacturer.
12 * You have to aquire licenses for all used proprietary modules.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * OpenSceneGraph Public License for more details.
18*/
19
20#include <osg/Object>
21#include <osg/Image>
22#include <osg/Matrixd>
23
24namespace osgViewer {
25
26class DistortionSet : public osg::Object
27{
28public:
29        META_Object(osgViewer,DistortionSet);   // Required for serializer
30
31        DistortionSet(const osgViewer::DistortionSet& ds, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): // Required for serializer
32                _distortionMeshRows(ds._distortionMeshRows),
33                _distortionMeshColumns(ds._distortionMeshColumns),
34                //osg::PrimitiveSet::Mode _MeshType
35                _intensityMap(ds._intensityMap),
36                _texUnitScene(ds._texUnitScene),
37                _texUnitIntensityMap(ds._texUnitIntensityMap),
38                _viewOffset(ds._viewOffset),
39                _projectionOffset(ds._projectionOffset){}
40
41        DistortionSet();
42        virtual ~DistortionSet();
43
44        void setDistortionMeshRows(int distortionMeshRows)              { _distortionMeshRows = distortionMeshRows; }
45        int getDistortionMeshRows() const       { return _distortionMeshRows; }
46
47        void setDistortionMeshColumns(int distortionMeshColumns)                { _distortionMeshColumns = distortionMeshColumns; }
48        int getDistortionMeshColumns() const    { return _distortionMeshColumns; }
49
50        void setMeshType(GLenum meshType) { _meshType = meshType; }
51    inline GLenum getMeshType() const { return _meshType; }
52
53        void setIntensityMap(osg::Image* intensityMap)          { _intensityMap = intensityMap; }
54        const osg::Image* getIntensityMap() const       { return _intensityMap; }
55
56        void setTexUnitScene(unsigned int texUnitScene)         { _texUnitScene = texUnitScene; }
57        unsigned int getTexUnitScene() const    { return _texUnitScene; }
58
59        void setTexUnitIntensityMap(unsigned int texUnitIntensityMap)   { _texUnitIntensityMap = texUnitIntensityMap; }
60        unsigned int getTexUnitIntensityMap() const     { return _texUnitIntensityMap; }
61
62        void setViewOffset(const osg::Matrixd& viewOffset)      { _viewOffset = viewOffset; }
63        const osg::Matrixd& getViewOffset() const       { return _viewOffset; }
64
65        void setProjectionOffset(const osg::Matrixd& projectionOffset)          { _projectionOffset = projectionOffset; }
66        const osg::Matrixd& getProjectionOffset() const { return _projectionOffset; }
67
68private:
69        int _distortionMeshRows;
70        int _distortionMeshColumns;
71        GLenum _meshType;
72       
73        osg::ref_ptr<osg::Image> _intensityMap;
74        unsigned int _texUnitScene;
75        unsigned int _texUnitIntensityMap;
76
77        osg::Matrixd _viewOffset;
78        osg::Matrixd _projectionOffset;
79
80
81};
82
83}
84
85
86#endif
Note: See TracBrowser for help on using the repository browser.