[344] | 1 | /* -*-c++-*- osgVisual - Copyright (C) 2009-2012 Torben Dannhauer |
---|
| 2 | * |
---|
| 3 | * This library is based on OpenSceneGraph, 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 | * osgVisual requires for some proprietary modules a license from the correspondig manufacturer. |
---|
| 9 | * You have to aquire licenses for all used proprietary modules. |
---|
| 10 | * |
---|
| 11 | * This library is distributed in the hope that it will be useful, |
---|
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 14 | * OpenSceneGraph Public License for more details. |
---|
| 15 | */ |
---|
| 16 | |
---|
| 17 | #include "DistortionSet.h" |
---|
| 18 | #include <osgDB/ObjectWrapper> |
---|
| 19 | #include <osgDB/InputStream> |
---|
| 20 | #include <osgDB/OutputStream> |
---|
| 21 | |
---|
| 22 | using namespace osgViewer; |
---|
| 23 | |
---|
| 24 | DistortionSet::DistortionSet() |
---|
| 25 | { |
---|
[360] | 26 | _distortionMeshRows = 2; |
---|
| 27 | _distortionMeshColumns = 2; |
---|
[350] | 28 | //GLenum _meshType; |
---|
| 29 | |
---|
| 30 | _intensityMap = NULL; |
---|
| 31 | _texUnitScene = 0; |
---|
| 32 | _texUnitIntensityMap = 1; |
---|
| 33 | |
---|
| 34 | _viewOffset = osg::Matrixd::identity(); |
---|
| 35 | _projectionOffset = osg::Matrixd::identity(); |
---|
| 36 | |
---|
| 37 | _showIntesityMapMapOnly = false; |
---|
[353] | 38 | |
---|
| 39 | _camera = NULL; |
---|
| 40 | _distortionInternals = NULL; |
---|
| 41 | |
---|
| 42 | _distortionInternals = new osg::Switch(); |
---|
[361] | 43 | |
---|
[344] | 44 | } |
---|
| 45 | |
---|
| 46 | DistortionSet::~DistortionSet() |
---|
| 47 | { |
---|
| 48 | } |
---|
| 49 | |
---|
[374] | 50 | void DistortionSet::setDistortionMesh(osg::Geometry*) |
---|
| 51 | { |
---|
| 52 | // todo: denormalisieren und mesh dann an seine passenden Platz vom Switch packen. |
---|
| 53 | } |
---|
| 54 | |
---|
| 55 | const osg::Geometry* DistortionSet::getDistortionMesh() const |
---|
| 56 | { |
---|
| 57 | // Todo: Normalisieren und dann zurückgeben |
---|
| 58 | return NULL; |
---|
| 59 | } |
---|
| 60 | |
---|
[344] | 61 | REGISTER_OBJECT_WRAPPER( osgViewer_DistortionSet, // The unique wrapper name |
---|
| 62 | new osgViewer::DistortionSet, // The proto |
---|
| 63 | osgViewer::DistortionSet, // The class typename |
---|
| 64 | "osg::Object osgViewer::DistortionSet" ) // The inheritance relations |
---|
| 65 | { |
---|
| 66 | // Serializers for different members |
---|
| 67 | ADD_INT_SERIALIZER( DistortionMeshRows, 1 ); //int _distortionMeshRows; |
---|
| 68 | ADD_INT_SERIALIZER( DistortionMeshColumns, 1 ); //int _distortionMeshColumns; |
---|
[374] | 69 | ADD_OBJECT_SERIALIZER( DistortionMesh, osg::Geometry, NULL ); // Normalisiertes Mesh |
---|
[344] | 70 | |
---|
[345] | 71 | ADD_GLENUM_SERIALIZER( MeshType, GLenum, GL_QUAD_STRIP ); //osg::PrimitiveSet::Mode _MeshType |
---|
[344] | 72 | |
---|
[345] | 73 | ADD_IMAGE_SERIALIZER( IntensityMap, osg::Image, NULL ); //osg::ref_ptr<osg::Image> _intensityMap; |
---|
[344] | 74 | |
---|
| 75 | ADD_UINT_SERIALIZER( TexUnitScene, 0 ); //unsigned int _texUnitScene; |
---|
| 76 | ADD_UINT_SERIALIZER( TexUnitIntensityMap, 1 ); //unsigned int _texUnitIntensityMap; |
---|
| 77 | |
---|
| 78 | ADD_MATRIX_SERIALIZER( ViewOffset, osg::Matrix() ); //osg::Matrix _viewOffset; |
---|
| 79 | ADD_MATRIX_SERIALIZER( ProjectionOffset, osg::Matrix() ); //osg::Matrix _projectionOffset; |
---|
[350] | 80 | |
---|
| 81 | ADD_BOOL_SERIALIZER( ShowIntensityMapOnly, false ); //bool _showIntesityMapMapOnly |
---|
[344] | 82 | } |
---|