/* -*-c++-*- osgVisual - Copyright (C) 2009-2012 Torben Dannhauer * * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. * * osgVisual requires for some proprietary modules a license from the correspondig manufacturer. * You have to aquire licenses for all used proprietary modules. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ #include "DistortionSet.h" #include #include #include using namespace osgViewer; DistortionSet::DistortionSet() { _dirty = false; _distortionMeshRows = 2; _distortionMeshColumns = 2; //GLenum _meshType; _intensityMap = NULL; _texUnitScene = 0; _texUnitIntensityMap = 1; _viewOffset = osg::Matrixd::identity(); _projectionOffset = osg::Matrixd::identity(); _showIntesityMapMapOnly = false; _camera = NULL; _distortionInternals = NULL; _distortionInternals = new osg::Switch(); } DistortionSet::~DistortionSet() { } void DistortionSet::setDistortionMesh(osg::Geometry*) { // todo: denormalisieren und mesh dann an seine passenden Platz vom Switch packen. } const osg::Geometry* DistortionSet::getDistortionMesh() const { // Todo: Normalisieren und dann zurückgeben return NULL; } REGISTER_OBJECT_WRAPPER( osgViewer_DistortionSet, // The unique wrapper name new osgViewer::DistortionSet, // The proto osgViewer::DistortionSet, // The class typename "osg::Object osgViewer::DistortionSet" ) // The inheritance relations { // Serializers for different members ADD_INT_SERIALIZER( DistortionMeshRows, 1 ); //int _distortionMeshRows; ADD_INT_SERIALIZER( DistortionMeshColumns, 1 ); //int _distortionMeshColumns; ADD_OBJECT_SERIALIZER( DistortionMesh, osg::Geometry, NULL ); // Normalisiertes Mesh ADD_GLENUM_SERIALIZER( MeshType, GLenum, GL_QUAD_STRIP ); //osg::PrimitiveSet::Mode _MeshType ADD_IMAGE_SERIALIZER( IntensityMap, osg::Image, NULL ); //osg::ref_ptr _intensityMap; ADD_UINT_SERIALIZER( TexUnitScene, 0 ); //unsigned int _texUnitScene; ADD_UINT_SERIALIZER( TexUnitIntensityMap, 1 ); //unsigned int _texUnitIntensityMap; ADD_MATRIX_SERIALIZER( ViewOffset, osg::Matrix() ); //osg::Matrix _viewOffset; ADD_MATRIX_SERIALIZER( ProjectionOffset, osg::Matrix() ); //osg::Matrix _projectionOffset; ADD_BOOL_SERIALIZER( ShowIntensityMapOnly, false ); //bool _showIntesityMapMapOnly }