source: experimental/distortionNG/DistortionSet.h @ 349

Last change on this file since 349 was 349, checked in by Torben Dannhauer, 12 years ago
File size: 3.3 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; }       // for serializers
55        osg::Image* getIntensityMap()  { return _intensityMap; }        // for manipulating the intensity map
56
57        void setTexUnitScene(unsigned int texUnitScene)         { _texUnitScene = texUnitScene; }
58        unsigned int getTexUnitScene() const    { return _texUnitScene; }
59
60        void setTexUnitIntensityMap(unsigned int texUnitIntensityMap)   { _texUnitIntensityMap = texUnitIntensityMap; }
61        unsigned int getTexUnitIntensityMap() const     { return _texUnitIntensityMap; }
62
63        void setViewOffset(const osg::Matrixd& viewOffset)      { _viewOffset = viewOffset; }
64        const osg::Matrixd& getViewOffset() const       { return _viewOffset; }
65
66        void setProjectionOffset(const osg::Matrixd& projectionOffset)          { _projectionOffset = projectionOffset; }
67        const osg::Matrixd& getProjectionOffset() const { return _projectionOffset; }
68
69private:
70        int _distortionMeshRows;
71        int _distortionMeshColumns;
72        GLenum _meshType;
73       
74        osg::ref_ptr<osg::Image> _intensityMap;
75        unsigned int _texUnitScene;
76        unsigned int _texUnitIntensityMap;
77
78        osg::Matrixd _viewOffset;
79        osg::Matrixd _projectionOffset;
80
81
82};
83
84}
85
86
87#endif
Note: See TracBrowser for help on using the repository browser.